<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Başak keskinoğlu on Medium]]></title>
        <description><![CDATA[Stories by Başak keskinoğlu on Medium]]></description>
        <link>https://medium.com/@keskinoglub?source=rss-ef2aaf018d1d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uzmfDwKJC7JVFvNL.jpg</url>
            <title>Stories by Başak keskinoğlu on Medium</title>
            <link>https://medium.com/@keskinoglub?source=rss-ef2aaf018d1d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:06:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@keskinoglub/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Postgresql win11 sorunu çözümü]]></title>
            <link>https://keskinoglub.medium.com/postgresql-win11-sorunu-%C3%A7%C3%B6z%C3%BCm%C3%BC-758ccfed982f?source=rss-ef2aaf018d1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/758ccfed982f</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Başak keskinoğlu]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 10:29:04 GMT</pubDate>
            <atom:updated>2024-04-01T10:29:04.399Z</atom:updated>
            <content:encoded><![CDATA[<p>İndirirken bile clusterdb tam olarak inmiyordu ve her seferinde server bulunamıyordu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4ACDzLlmUBSjM5O1upI-Q.png" /></figure><p>Problem running post-install step. Installation may not complete correctly The database cluster installation failed.</p><p>Çözüm:</p><p>Öncelikle “C:\Program Files\PostgreSQL\16\data”nın veri yolu olduğundan emin olun ve boş olduğundan.</p><p>Ardından yönetici olarak cmd çalıştırın ve</p><pre>cd &quot;C:\Program Files\PostgreSQL\16\bin&quot;</pre><p>ile psql klasörüne gidin.</p><p>Sonra data yolunu initiliaze eteniz gerekecek.</p><pre>initdb -D &quot;C:\Program Files\PostgreSQL\16\data&quot; -U postgres</pre><p>Burada biraz yüklendikten sonra hata aldım.</p><pre>önyükleme sonrası başlatmayı gerçekleştirme ...2024-03-28 11:39:09.123 +03 <br>[5612] ÖLÜMCÜL (FATAL):  invalid LC_COLLATE locale name: &quot;Turkish_Türkiye.utf8&quot;</pre><p>Ne kadar bilgisayarım Türkçe utf8 olsada başka dillerdede utf8 gelmeyebiliyormuş. Çıkan hata yerini belirteyim olur diye düşündüm ilk:</p><pre> initdb -D &quot;C:\Program Files\PostgreSQL\16\data&quot; -U postgres --lc-collate=&#39;tr_TR.utf8&#39;</pre><p>ve çoğu yerde bu utf8in patladığını öğrenmiş oldum:</p><pre>The database cluster will be initialized with this locale configuration:<br>  provider:    libc<br>  LC_COLLATE:  tr_TR.utf8<br>  LC_CTYPE:    Turkish_Türkiye.utf8<br>  LC_MESSAGES: Turkish_Türkiye.utf8<br>  LC_MONETARY: Turkish_Türkiye.utf8<br>  LC_NUMERIC:  Turkish_Türkiye.utf8<br>  LC_TIME:     Turkish_Türkiye.utf8<br>Öntanımlı veritabanı dil kodlaması buna göre &quot;UTF8&quot; olarak ayarlandı.<br>Öntanımlı metin arama yapılandırması &quot;turkish&quot; olarak ayarlanacak.<br><br>Veri sayfası (data page) doğrulama devre dışı bırakılmıştır.<br><br>mevcut C:/Program Files/PostgreSQL/16/data dizininin izinleri düzeltiliyor ... tamam<br>alt dizinler oluşturuluyor ... tamam<br>dinamik paylaşılan bellek (shared memory) uygulaması seçimi ... windows<br>ön tanımlı max_connections seçiliyor ... 100<br>öntanımlı shared_buffers değeri seçiliyor ... 128MB<br>selecting default time zone ... Europe/Istanbul<br>yapılandırma dosyaları yaratılıyor ... tamam<br>önyükleme komut dosyası çalıştırılıyor ...tamam<br>önyükleme sonrası başlatmayı gerçekleştirme ...2024-03-28 14:43:51.935 +03 [5312] ÖLÜMCÜL (FATAL):  invalid LC_CTYPE locale name: &quot;Turkish_Türkiye.utf8&quot;<br>2024-03-28 14:43:51.935 +03 [5312] İPUCU:If the locale name is specific to ICU, use ICU_LOCALE.<br>2024-03-28 14:43:51.935 +03 [5312] KOMUT:  CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false OID = 4 STRATEGY = file_copy;<br><br>alt süreç 1 çıkış koduyla sonuçlandırılmıştır</pre><p>Bunun yerine direk localin hepsini elle veremem mantıklı oa-lacaktı, ki bu kodla çalıştı.</p><pre>initdb -D &quot;C:\Program Files\PostgreSQL\16\data&quot; -U postgres --locale=&#39;tr_TR.utf8&#39;</pre><p>Sonra güzel güzel pgAdmin4 dan server oluşturup günü geçirdim.</p><p>Sonra bilgisayarı başka gün açtığımda servera yine bağlanılamıyor time out veriyordu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufVAimlzjd-Dbi39b-4Psg.png" /></figure><p>Arama çubuğuna hizmetler(services) yazdım, ve windowsta çalışan servislere baktım. psql yoktu. internette çalışan çoğu şeyi denedim ama zaten bende postgres-x64 gibi bir servis inenler arasında yoktu.</p><p>Çalışan komut:</p><pre>pg_ctl.exe register -N &quot;PostgreSQL&quot; -U &quot;NT AUTHORITY\NetworkService&quot; -D &quot;C:\Program Files\PostgreSQL\16\data&quot; -w</pre><p>Sonra hizmetler sayfasına dönüp gelen Postgres servisine sağ tıklayıp başlat dedim, böylece otomatik olarak gelmeye başladı kapanıp açılsa bile bilgisayar.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=758ccfed982f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Insertion sort using Turing Machine]]></title>
            <link>https://keskinoglub.medium.com/insertion-sort-using-turing-machine-d6ce2972102d?source=rss-ef2aaf018d1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6ce2972102d</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[automata]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Başak keskinoğlu]]></dc:creator>
            <pubDate>Sun, 03 Jan 2021 18:17:40 GMT</pubDate>
            <atom:updated>2021-01-03T18:17:40.509Z</atom:updated>
            <content:encoded><![CDATA[<p>Possibly you are here because you are taking automata class and trying to understand how a basic machine works. So buckle up, we are going to take a look the Turing Machine and how to use it in an algorithym for sorting.</p><h3>What is Turing Machine?</h3><p>TM(Turig Machine) is an abstract machine, it has a infinite tape and 7-tuple: states that decide move(Q), blank symbol in the areas that doesnt have an input,T tape alphabet that tape accept,<strong> </strong>∑ alpabet inputs, δ funtion that moves and change in the tape(Q x T), q0 initial state and F set of final states. I will be explaining the tuples little bit later. TM was invented by Alan Turing in 1936, he called it a-machine as automatic machine.</p><p>So what is an abstract machine? It’s a theoretical model of a computer used in automata theory. Oops,what is automata theory by the way? Automata theory is a computer science branch that designs abstract computing devices that follows predetermined sequence of operations. TM is a FSM(finite state machine).</p><p>Let’s turn back to TM. What is infinite tape? Think it like an infinite lenght of paper that has only one line to write. You can change what is written on the paper. It has only one line because think it like you are writting about same subject in same paper. There are other types of TM that has multiple tapes but it has the same rule, one subject for one tape; example of this is simulating tic tac toe using tm, there you have tapes for player a, player b and the board so there is 3 tape. We don’t need that for this algorithym.</p><p>Now let’s look at 7-tupple of TM:</p><p>· Q the set of states; like go left if input is 1 ,is a state</p><p>· T is the tape alphabet that tape accepts. It can be numbers, symbols,alphabet like T={0,1,X,B}</p><p>· ∑ is the input alphabet ∑={0,1}</p><p>· δ<strong> </strong>The transaction function Q x T → { Q x T } x {L,R} here L,R means left or right to move in tape, T is the alphabet and Q is the state that choose to move left of right by current T.</p><p>· q0 is the initial state</p><p>· F is the set of final states</p><p>· B blank symbol</p><p><strong><em>Why I choose to use insertion sort?</em></strong></p><p>I was thinking between bubble sort, selction sort and insertion sort because these three are the best methods for using TM. They have averge O(n²) but selection sort’s best case is O(n²) too so I eleminated it.</p><h3><strong><em>TM design for sorting</em></strong></h3><p>Now let’s look at our TM design for insertion sort. It’s actually a comparison TM design.</p><p>In easy words we will change each num’s ones to “X” one by one, when one num is finished other num still has ones that num is bigger. Lets put it together.</p><p>We have an infinite tape. We put two numbers made from “1”s (ex. For 8, 8times 1) and between our two numbers we put “0”. Then we start our comparison, starting from first num’s ones we change one 1 to “X” then we go right in the tape and find “0” to find where our second num starts. We change second num’s first “1” to “X” too. Then go left and find 0 to know we will be back to first num. Then go left till we find “X”, so we now where we left. Go right change first “1” to an “X” and go right in the tape find “0” to find where our second num starts, then again go right to find “1” and change it to “X”, continue that circle till in first num finishes and you came to “0” or second num finishes and you came to B(black symbol in the tape) or both.</p><p>In the end if you found “0” in the tape first num&gt; second num, if you found “B” in the tape second num&gt; first num and if you found both “0” and “B” first num=second num.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*WJ38BeVL0igLSuVrKOcg2A.png" /><figcaption>Diagram for our TM[1]</figcaption></figure><p>Our tupples for this design:</p><p>· Q={q0,q1,q2,q3,q4,q5}</p><p>· T={0,1,X,B}</p><p>· ∑={0,1}</p><p>· δ: Q x T → { Q x T } x {L,R}</p><p>· q0∈Q</p><p>· F ∈ Q : q2, q5</p><p><em>Now let’s look at my code.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*ZeyDxzBEKqoUmvGUYXcJ7w.png" /></figure><p>First thing first I made a class for TM. It has some properties. TMBand for TM tape, A for first number, B for second number. IndexforSeperation for make finding “0” easy each time but you can add if sentences to find “0” instead of using this property. Lastly I had to determine TMBand as new list in constructor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*cMt_YHzdYt7NwT1Xt8WyJg.png" /></figure><p>Next, still in TMclass, I added a compare method for determining and manipulating TM tape.</p><p>As I took TM as a list(I though it was easier to fit an infinite tape,I can just move it), I added “B”(our blank symbol) to the tape. Than I added our first num to compare, then “0” to find i easy(as I said you can basicly write if sentences to find our “0” too) and I fixed our seperation index to the “0”. Then continue adding, first B as second number , and “B” for blank. We can assume after these “B”s tape goes infinite filled with “B”s.</p><p>Last thing for compare method we have to add our transaction function without final set states. So this is the part we change “1”s with “X”s. To start, from i=1(at list[0] we have “B”) changing list[i]=”X”; then going to our “0” and againg going as i, we find our second num’s “1” and change it to “X”. This is the part we can add if sentences. We can put while and look for “0” then if we are going right again with while we need to search for “1” and change it to “X”. If we were going left after finding “0”, this time we would be looking for first “X” with while. After finding we would move right and change the first “1” .</p><p>To be able to change insertion sort to any other sorting type, I used an abstract class for sort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3FZKXqmeOGE5DD9SdAUntQ.png" /></figure><p>Here as you see the abstract sort class has some properties. An integer array to hold array from form, c for array lenght, sum for our final sorted string and an abstract method sorting to turn a tuple that holds our sum from sorting and TMBand sequence for logging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*eYXg26xQ5AsZhfwUBmTQLg.png" /></figure><p>There is a method for converting our nums to tape inputs. It returns nums as made from “1”s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*pDYXAt2o-YHYhuwbVSs4cg.png" /></figure><p>Lastly in sort class I wrote a function that convert given array to TM tape input array so it is easier to choose from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*IbETdu9wWEBW_t_H3zQp_A.png" /></figure><p>Our third class is insertion sort. This class inherited from our sort class. It doesn’t have a property but it has to override the abstract method Sorting. Here lw for listview(to add TM tape outputs) and str is our array in tape input type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/202/1*3uqcU2frEx1F_sPF8g-EDA.png" /></figure><p>Here is the our real insertion sort method. As simple as I can explain insertion sort is an algorithym that checks neighbors for sorting. Here I determine an arra for our TM tape log and added it onlist to return in our tuple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*Xc88EZGK1PvajtrDNyOzOw.png" /></figure><p>Then we need to check which final state is out. For this in if sentence we check for if before “0” is “X” and before B is “1” or not “X”</p><p>In that case our second num is bigger but since j-1 is the second num we have to change their values.</p><p>On else if sentence we check for duplicates if “X”s from first num reached the “0” and “X”s from second num reached the “B” they are duplicates. We have to increase j in order to keep up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*lvulozjQyHPobtIpwoK4fA.png" /></figure><p>Then we convert our array to string and as a tuple return values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*HvoervT-e_NN4J5kw61o0A.png" /></figure><p>In the form.cs we make our new sorting object. Then taking our input(array) looking for if last key is blank and if it is, we remove it. Then we split our array by blanks. Then we define a tuple for our sorting returns. Item 2 is our logs, for each log we add them in listview. And as output our sum is Item 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*EDLNg0bgyAoQQUAnFdsOPQ.png" /><figcaption>Our program</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*lskAPBWhDto7EpqzxNqXKA.png" /></figure><p><em>full code link:</em></p><p><a href="https://github.com/Basakkeskinoglu/Sorting-using-TM">https://github.com/Basakkeskinoglu/Sorting-using-TM</a></p><h3>Notes</h3><p><a href="https://www.geeksforgeeks.org/turing-machine-as-comparator/">https://www.geeksforgeeks.org/turing-machine-as-comparator/</a></p><p><a href="https://en.wikipedia.org/wiki/Turing_machine#cite_note-2">https://en.wikipedia.org/wiki/Turing_machine#cite_note-2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6ce2972102d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>