<?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 Sabanova Rubabe on Medium]]></title>
        <description><![CDATA[Stories by Sabanova Rubabe on Medium]]></description>
        <link>https://medium.com/@sabanovarubabe?source=rss-20dd52f3c690------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1Tx1RtWx0TUJ6DR_.jpg</url>
            <title>Stories by Sabanova Rubabe on Medium</title>
            <link>https://medium.com/@sabanovarubabe?source=rss-20dd52f3c690------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:21:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sabanovarubabe/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[Data Structure]]></title>
            <link>https://sabanovarubabe.medium.com/data-structure-9afbb2361849?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/9afbb2361849</guid>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Mon, 07 Dec 2020 10:10:39 GMT</pubDate>
            <atom:updated>2020-12-07T10:18:40.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Strukturları</h3><blockquote>Kompüter proqramları müəyyən bir tapşırığı icra etmək üçün yazılmış əmrlərdən ibarətdir. Həmin əmrləri yazarkən, əslində, əlimizdə olan məlumatların üzərində müxtəlif işlər görürük.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/0*49ZKePUB_E0SyHfH.png" /></figure><p><strong>Data structure</strong> bu məlumatları saxlaması, bir-biriləri arasında əlaqə qurulması və rahatlıqla onlara çatıb istifadə etməyimizi təmin edir. <strong>Data structure </strong>haqqında məlumatımız olması, daha effektiv və optimallaşdırılmış kompüter proqramları yazmağa imkan yaradır. Bunun üçün müxtəlif data structure növləri arasında işimizə ən uyğun olanını seçməliyik.</p><blockquote>Başlıca növləri olaraq :</blockquote><blockquote>Array</blockquote><blockquote>Stack</blockquote><blockquote>Queue</blockquote><blockquote>Linked list</blockquote><blockquote>Graphs</blockquote><blockquote>Binary trees</blockquote><blockquote>Hash table</blockquote><h3>ARRAY</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*XWoAwjaQ4NOWGzUu.png" /></figure><p><strong>Array</strong>-i içində müəyyən qədər element olan qutu kimi təsəvvür edə bilərik. Onun məqsədi eyni növdə olan məlumatları bir yerə yığa bilmə və lazım olduqda onlardan rahatlıqla istifadə etməkdir.</p><p>Beləliklə, eyni <strong>array</strong>-in içində eyni növdə olan məlumatlar <strong>elementlər </strong>adlanır.</p><blockquote>Array vasitəsilə məlumatları eyni yerə yığa bildik. Bəs lazım olanda onları necə asanlıqla çağıra bilərik?</blockquote><p>Bunun üçün<strong> index </strong>nəzərdə tutulub. <strong>Index</strong> hər bir elementin yerini göstərir. Beləliklə, bir elementi <strong>index</strong> vasitəsilə çağıra bildiyimiz zaman(məsələn, “B” hərfinin index-i 1-dir), üzərinə 1 gələrək yanındakını və bu məntiqlə yerdə qalan elementləri də çağıra bilərik.</p><blockquote>Array üzərində hansı əməliyyatları apara bilərik?</blockquote><ol><li>0-dan başlayaraq hər hansı bir elementi çağıra bilmək.</li><li><strong>Array</strong>-in içində olan elementlərin sayını onun uzunluğu ilə müəyyən etmək.</li><li><strong>Array</strong>-ə yeni element əlavə etmək</li><li><strong>Array</strong>-dən element silmək</li><li><strong>Index</strong> vasitəsilə elementi,<strong> element</strong> vasitəsilə isə onun hansı index-də olduğunu təyin etmək</li><li><strong>Array</strong>-də mövcud olan elementi dəyişdirmək</li></ol><p><strong>Stack</strong>,<strong>queue</strong> kim digər data structure növləri <strong>array</strong>-lərdən əldə olunur.</p><h3>STACK</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/0*5iVdw3SoFcgs221I.png" /></figure><p>Şəkildə də olduğu kimi <strong>stack</strong>-i üst-üstə yığılmış boş-qablar, kitablar və sairə kimi düşünə bilərik. Tərcümə etibarilə “<em>dəstə</em>” adlandıra bilərik. Yeni boş-qab əlavə edir və ya ən sonuncusunu götürürük. Yeni əlavə edilən boş-qab ən üstdə yerləşir.</p><blockquote>Yaxşı bəs, bu situasiya kodda necə tətbiq olunur?</blockquote><p>Termin olaraq, bir elementi əlavə etməyə <em>“push”</em>, götürməyə isə <em>“pop”</em> deyirik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*puakEWKvBg25rUyC.png" /></figure><p>Qoyulan ən sonuncu “3” elementi ən üstə gəlir, beləliklə, biz bir elementi götürmək istəsək, yenə “3” elementini götürəcəyik. Bu yanaşma<strong> Last In First Out(LIFO) </strong>adlanır. Yəni ki, ən son əlavə edilən element ən birinci götürüləndir.</p><blockquote>Dəstə üzərində hansı əməliyyatları apara bilərik?</blockquote><p><strong>Push</strong> — Dəstənin üstünə yeni element əlavə etmək</p><p><strong>Pop</strong> — Dəstədən ən üstdəki elementi silmək</p><p><strong>IsEmpty</strong> — Dəstənin boş olub olmadığını yoxlamaq</p><p><strong>IsFull</strong> — Dəstənin dolu olub olmadığını yoxlamaq</p><p><strong>Peek</strong> — Ən üstdəki elementin dəyərini onu silmədən almaq</p><h3>QUEUE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*brIo8mIx2_cVFcwW.png" /></figure><p>Adından da göründüyü kimi, <strong>queue</strong> növ data structure-ı hər-hansı bir həyatda gördüyümüz “<em>növbə</em>” kimi düşünə bilərik. Birinci kim gəlibsə, ən birinci də elə o gedir.</p><p>Stack-in tam tərsi olan bu yanaşma <strong>First In First Out(FIFO) </strong>adlanır.<strong> </strong>Yəni ilk əlavə edilən element ən birinci götürüləndir.</p><blockquote>Queue üzərində hansı əməliyyatları apara bilərik?</blockquote><p><strong>Enqueue</strong> — Növbənin sonuna yeni element əlavə etmək</p><p><strong>Dequeue</strong> — Növbənin əvvəlindəki elementi silmək</p><p><strong>IsEmpty</strong> — Növbənin boş olub olmadığını yoxlamaq</p><p><strong>IsFull</strong> — Növbənin dolu olub olmadığını yoxlamaq</p><p><strong>Peek</strong> — Ən birinci elementin dəyərini onu silmədən almaq</p><h3>LINKED LIST</h3><p><strong>Linked List </strong>bir-birilə<strong> </strong>bağlanmış<strong> node</strong>-lardan ibarətdir. Həmin Linked list-in içindəki hər bir element ayrı bir obyekdir.</p><blockquote>Bəs <strong>node</strong> özü tam olaraq nədir?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*tenby3DPsqcgvP4_.png" /></figure><p>Hər bir node, göründüyü kimi, iki elementdən təşkil olunub. İlk olaraq, bizə lazım olan məlumat, sonra isə ondan sonra gələn <strong>node</strong>-un adresindən ibarətdir.</p><p>Linked list-in başlanğıc nöqtəsi <strong>head</strong> adlanır. <strong>Head</strong> ayrı bir node deyil, sadəcə ardıcıllığı qorumaq üçün və haradan başladığımızı bilmək üçün birinci gələn node-un adresinə verilən addır.</p><p><strong>Null</strong> isə axırıncı node-dan sonra heç bir şey gəlmədiyi üçün adres olaraq qeyd olunan yerdir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*LN-jakimSh7n7SMD" /></figure><p>Linked list-in ən önəmli xarakteristikası odur ki, istənilən yerə yeni element əlavə edə bilərik. Bunun üçün digər elementləri yenidən yerləşdirməyə ehtiyac yoxdur. Eynilə, istənilən yerdə olan elementi, başqa elementləri dəyişdirmədən silə bilərik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*rpVaITjC9KDTp050.jpg" /></figure><p>Indi isə data structure-ın <strong>non-linear</strong> növlərindən məlumat verəcəyik.</p><h3>GRAPHS</h3><p>Qrafiklər bir-birilə əlaqədə olan <strong>vertex</strong>-lərdən(təpə nöqtələri) ibarətdir. Həmin bu <strong>vertex</strong>-lər(təpə nöqtələri) arasındakı əlaqə isə <strong>edges</strong>(yəni, xətlər) vasitəsilə qurulur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*d6DcQFCghn3lM5h2" /></figure><p>Buradakı şəkildə <em>a, b</em> və <em>c </em>olaraq üç <strong>vertex</strong>(təpə nöqtələri) var. Eynilə, bunları birləşdirən 3 <strong>edge</strong>(xətlər) var ki, onların hansı hansı vertex-ləri birləşdirdiyini <em>(a, b)</em>, <em>(b, c)</em> və <em>(c, a)</em> kimi göstərə bilərik.</p><p>Qrafiklərin işlədilmə yerinə misal olaraq sosial şəbəkələri göstərə bilərik. Hər bir şəxs orada bir vertex təşkil edir. Həmin bu vertex-lər şəxslər barəsində adı, soyadı, yaşadığı yeri və s. kimi məlumatlar daşıyır.</p><h3>BINARY TREES</h3><p>Bu növ data structure, qrafiklərdə olduğu kimi, <strong>vertex</strong>(təpə nöqtələri) və <strong>edge</strong>(xətlərdən) ibarətdir. Lakin aralarındakı ən böyük fərq<em> dairəvi </em>əlaqənin olmamasıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*GZ9Sz1l_cGPknQE5.png" /></figure><p><strong>Tree</strong> data structure-da istifadə olunan bəsit terminologiya :</p><ol><li><strong>Root</strong>(kök) — Ən yuxarıda yerləşən element</li><li><strong>Parent</strong>(valideyn) — Özündən törəyən elementlər olan hər bir element</li><li><strong>Child</strong>(uşaq) — valideyndən törəyən hər bir element</li><li><strong>Leaf</strong>(yarpaq) — heç bir child(uşaq) elementi olmayan element</li><li><strong>Sibling</strong>(bacı və ya qardaş)- valideynləri eyni olan elementlər</li><li><strong>Level</strong>(səviyyə) — elementlərin nəslini göstərir(məsələn, <em>2,3,4</em> olan sıra <strong>səviyyə-1</strong>; <em>6,7</em> olan sıra isə <strong>səviyyə-2</strong> sayılır)</li></ol><h3>HASH TABLE</h3><p><strong>Hash table</strong> əlimizdə olan böyük məlumatlara daha tez çatmaq üçün istifadə olunun data structure növüdür. Buradakı məlumatlar <strong>key-value</strong>(<em>açar söz — dəyər</em>)<em> </em>şəklində yadda saxlanılır. Məsələn, bir kitabxanada olan kitabların adları açar söz, onun yazarı və janrı isə dəyər kimi verilir.</p><blockquote>Məlumatları array-in içinə qoyaraq index-lər vasitəsilə çata bilərik. Bəs o zaman niyə hash-table ehtiyac var?</blockquote><p>Çünki, kiçik saylı məlumatların indexlərini asanlıqla bilib onları çağıra bilirik. Məsələn,</p><p><em>mənimListim=[“Mia”, “Ted”, “Ada”].</em></p><p><em>Bizə “Ted” lazım olarsa, mənimListim[1] deyə çağıra bilərik. Çünki, “Ted” 1-ci index-dədir və bu yeri asanlıqla təyin edə bilərik.</em></p><p>İndi isə təsəvvür edək ki, biz toya 500 nəfər çağırmalıyıq. Bu zaman hər bir şəxsin ümumi listdə hansı yerdə(index-də) olduğunu təyin etmək həm çətin, həm də yorucudur. Təbii ki, biz alqoritm qurub həmin şəxsi tapmaq üçün bir-bir listimizin içindəki adları nəzərdən keçirməliyik. Bu kifayət qədər çox vaxt apardığından array öz effektivliyini itirir.</p><p>Beləliklə, bu tip nisbətən kompleks problemləri <strong>hash table </strong>vasitəsilə həll edirik.<strong> Hashing</strong> metodunda hər bir<strong> </strong><em>key(açar söz)</em> uyğun olaraq xüsusi<strong> </strong><em>index </em>təyin edilir yəni, <em>index</em> mənalı hala gətirilir. Mənalı deyərkən, nəzərdə tutulan odur ki, bizim elementin <em>key(açar söz)</em> hissəsi elə bir hesablama sisteminə köçürülməlidir ki, biz onu sıralaya bilək.</p><blockquote>Bəs bu key(açar sözləri) necə ədədlərə çevirək?</blockquote><p>Bu məqsədlə, hər bir xarakterin qarşılığı ədədlərlə ifadə olunduğundan, ASCII-dən istifadə edilir.<em> </em>Beləliklə, biz sadəcə açar söz vasitəsilə istədiyimiz məlumata çata bilərik. Məsələn, yuxarıdakı misaldan davam edək, lakin 500-i vizuallaşdırmaq çətin olduğu üçün deyək ki, bu adamların sayı 11 nəfərdir və bizə “Ted”-i çağırmaq lazımdır.</p><p>Burada “Ted” açar sözdür. Həmin açar sözə uyğun xüsusi index qoymaq üçün bir neçə addımlı hesablama aparılır :</p><ol><li>Sözdəki hər bir hərfin ASCII kodu müəyyənləşdirilir. <em>(Misalımızda, T- 84, E-101, D-100)</em></li><li>ASCII kodlarını toplanılır. (84 + 101 + 100=285)</li><li>Listimizdə boşluq yaranmaması üçün <em>(məsələn, Ted- 285, ondan sonra gələcək olan isə Leo- 288-dir. Bu o deməkdir ki, aradakı 286, 287 index-ləri boş olacaq), </em>bunu daha qısaltmaq üçün bu hesablama sistemini daha da optimallaşdıraq. Beləliklə, hər bir elementin alınan cəmi elementlərin sayına bölünür və qalığı qeyd edirik. Beləliklə, Ted sözünün hara yerləşdiriləcəyi müəyyən olunur. <em>(285/11=25 (qalıq 10))</em></li></ol><p>Bu yolla həmin o 10 nəfəri də qeyd etsək, belə bir nəticə ala bilərik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m7wC1y5WE9nT8EKf.png" /></figure><blockquote>Bəs axı bəzi açar sözlərin dəyərləri eyni nəticə verə bilər. Onda istədiyimiz nəticəni necə əldə edirik?</blockquote><p>Eyni nəticənin alındığı yerlərdə, məsələn, “3” bir neçə dəfə alınıbsa, o zaman həmin sırada<em> “linked list”(ətraflı izah hissə 1-də) </em>yaranır. Həmin daxil olunan açar söz vasitəsilə “3” nəticəsinin alındığı elementlərin arasında həmin sözü axtarır və çıxarır.</p><p><em>Data Structure</em> — <a href="https://www.tutorialspoint.com/data_structures_algorithms/data_structures_basics.htm">https://www.tutorialspoint.com/data_structures_algorithms/data_structures_basics.htm</a></p><p><em>Data Structure</em> — <a href="https://www.programiz.com/dsa#:~:text=A%20data%20structure%20is%20a,efficient%20and%20optimized%20computer%20programs.">https://www.programiz.com/dsa#:~:text=A%20data%20structure%20is%20a,efficient%20and%20optimized%20computer%20programs.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9afbb2361849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are HTTP Cookies?]]></title>
            <link>https://medium.com/pragmatech/what-are-http-cookies-3889cf2b057b?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/3889cf2b057b</guid>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Sun, 01 Nov 2020 19:13:12 GMT</pubDate>
            <atom:updated>2020-11-28T16:29:03.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*pg1zYQJRbHZb_Kby.png" /></figure><blockquote>Webpages have no memories. It means whenever you move from one page to another, webpages don’t basically remember any information of you. The reason why it happens is HTTP being stateless, which means the server can’t determine whether two requests came from the same browser.</blockquote><p>An <strong>HTTP cookie</strong> (web cookie, browser cookie) is a small piece of data that a server sends to the user’s web browser. Basically its purpose is to store data received from the server in a request and send it back to the server in next requests. Consequently, cookies allow us to stay logged in while travelling from one page to another and also provides information of you to be remembered the next time you return back. There can be given several examples why use cookies as:</p><p>Remembering logins, products in your shopping carts, the scores or reputations you have — <strong>Authentication</strong> (session management)</p><p>The themes, language selection or shortly user preferences you chose which is basically called — <strong>Personalization </strong>and so on.</p><blockquote>Characteristics of cookies :</blockquote><ul><li>Cookie is stored by browser on user’s computer.(Cookies are client-side files that contain user information)</li><li>Cookies are plain text; they contain no executable code.</li><li>A cookie can only be read from the exactly its own domain.</li><li>A cookie created by a user can only be visible to them.</li><li>Size of the cookies cannot be greater than 4KB.</li><li>The amount of cookies per domain is limited(about 20–25 cookies per domain) to avoid disk space consumption.</li><li>Cookies are temporary and permanent. Persistent cookies remain on the computer when we close the tab with the site, and temporary ones are deleted. It is decided by its developer. That is why on some sites have to log in when visiting again and on others it remembers us though we come back after a while.</li></ul><h3>How Cookies Work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/0*htogOgxw8xbABSaO.jpg" /></figure><ol><li>The browser sends a request to the server.</li><li>The server responds to the request by sending the requested page and also one or more cookies.</li><li>When a response is received, the browser renders the page and stores the cookie on the client’s computer.</li><li>When a next request is sent to the server, it will include information about the cookie and the process will last till the cookie expires. When it happens, the cookie is deleted from the browser.</li></ol><h3><strong>How to Set Cookies?</strong></h3><p>Flask has a method to set cookies set_cookie():</p><p>set_cookie(key, value=””)</p><p>The key is the name and value is data of the cookie that we try to store. The max_age is the expiration time of the cookie, if we do not specify any limitation, then it will expire when the browser is closed.</p><p><em>More information can be found at resources.</em></p><h3><strong>Disadvantages of Cookies :</strong></h3><ul><li>A cookie can contain a very limited amount of information.(max 4KB)</li><li>Cookies are easily accessible if somebody finds them.</li><li>The amount of cookie per domain is also limited (approximately 20)</li><li>Cookies are limited to simple string information.</li></ul><h3><strong>Resources:</strong></h3><ol><li>Cookies and security — <a href="https://ssl.com.ua/blog/what-are-cookies/">https://ssl.com.ua/blog/what-are-cookies/</a></li><li>Setting cookies — <a href="https://overiq.com/flask-101/cookies-in-flask/">https://overiq.com/flask-101/cookies-in-flask/</a></li><li>Ultimate Guide HTTP Cookies — <a href="https://blog.webf.zone/ultimate-guide-to-http-cookies-2aa3e083dbae">https://blog.webf.zone/ultimate-guide-to-http-cookies-2aa3e083dbae</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3889cf2b057b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/what-are-http-cookies-3889cf2b057b">What are HTTP Cookies?</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ORM for Python]]></title>
            <link>https://medium.com/pragmatech/orm-for-python-b63cfbc39e7f?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/b63cfbc39e7f</guid>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Thu, 22 Oct 2020 12:02:06 GMT</pubDate>
            <atom:updated>2020-11-28T16:29:16.773Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Before giving information about some ORMs for Python, it would be better to talk about an ORM concept in general.</blockquote><h4>So what is an ORM(Object Relational Mapping) ?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*3uedj0JV8LWYNc8Q" /></figure><p>The logic behind <strong><em>Object Relational Mapping</em></strong> is being able to write queries and manipulating data using an <strong><em>object-oriented paradigm. </em></strong>It gives an opportunity to deal with a database by using our language (which in this article we will mention Python) instead of SQL. It means that ORMs allows us to create, read, update and delete data and schemas in the database with Python code.</p><p><strong>What are the advantages of using ORMs?</strong></p><ul><li>It might save a lot of time for whom don’t write in <em>SQL</em> much. So because you use the language you already were using can speed up the process.</li><li>ORM makes switching between various relational databases(e.g. from <em>MySQL</em> to <em>PostgreSQL</em>) much easier because most functions remain same.</li><li>Some of the queries will perform better than if you wrote them yourself.</li></ul><p><strong>What are the disadvantages of using ORMs?</strong></p><ul><li>Because ORM is a different concept, in order to use an ORM, first you should learn it, which learning something new and adjust can take time.</li><li>For whom that is good at SQL, using ORM can be less efficient and useful. Because it won’t give you as much opportunities as you would get when you write queries yourself.</li><li>In general, because of the fact that ORM abstracts what is happenning under the hood, it would lead you be less capable to erase the problems.</li><li>The extra conflicts can appear when setting configuration and so on.</li></ul><blockquote>As we already are more aware of an ORM concept, we can move on to some examples of ORM for Python.</blockquote><p>The<strong> Python ORMs</strong> that are mostly used these days are :(I have also added their original documentations for whom that is interested)</p><blockquote><a href="https://docs.djangoproject.com/en/3.1/topics/db/queries/">The Django ORM</a></blockquote><blockquote><a href="https://www.sqlalchemy.org/">SQLAlchemy</a></blockquote><blockquote><a href="http://docs.peewee-orm.com/en/latest/">Peewee</a></blockquote><blockquote><a href="https://ponyorm.org/">PonyORM</a></blockquote><blockquote><a href="http://sqlobject.org/">SQLObject</a></blockquote><h3>Django ORM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*edCX411wsnWlaFD7.png" /></figure><p><strong>The Django web framework</strong> has its own built-in object-relational mapping module that can be used to deal with database written in <em>SQLite, PostgreSQL, MySQL</em> and so on. It is also possible not to use this default ORM for <strong>Django web framework</strong> in particular but others as <strong>SQLAlchemy </strong>because though <strong>Django ORM</strong> helps somehow, there are complains much that using <strong>Django ORM</strong> is mostly harder than just writing the codes in raw <strong>SQL.</strong></p><h3>SQLAlchemy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/0*GQOCq59Ye8Ka4mEL.jpg" /></figure><p><strong>SQLAlchemy</strong> is mostly considered as the best one among other ORMs beacuse of its simplicity, speed and also some other features that other ORMs don’t have. One of the advantages it has is <strong>SQLAlchemy</strong> allows writing Python code to map data from the database to the applications’ Python objects. No SQL is required to create, maintain and query the database. It provides us working with Python objects instead of writing bridge code to get data in and out of relational tables.</p><p><strong>SQLAlchemy</strong> can be used with <em>Flask</em>, <em>Pyramid</em>( which they are Python frameworks), <em>Django</em>(though Django doesn’t support it officially yet, there are some ways to switch to <strong>SQLAlchemy</strong>).</p><p><strong>Peewee</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*E3GbrTtJVNjxFdd-.png" /></figure><p><strong>Peewee </strong>is simpler and easier than most ORMs as<em> Django ORM</em> or <em>SQLAlchemy</em> which makes it useful for the ones who is just getting started web development. <strong>Peewee</strong> can be used with nearly any web framework which is good news to hear. But at the end of the day because the analogy used by the core <strong>Peewee</strong> author is that <strong>Peewee </strong>is to <em>SQLAlchemy</em> as <em>SQLite</em> is to <em>PostgreSQL</em> which makes it hard to use it in big projects.</p><p><strong>Pony ORM</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*O_0gA0gK1x70yqN0.png" /></figure><p><strong>Pony </strong>also looks like other Python ORMs that is available but it also has differences as <strong>Pony</strong> makes it much easier to write even so complex <em>SQL </em>codes in pythonic way, also in terms of speed, <strong>Pony</strong> is one of the best among them. In general we can say that <strong>Pony</strong> supporting nearly everything that other ORMs have makes it powerful but maybe the biggest problem<strong> Pony</strong> has is it doesn’t support <em>migration</em> yet (but <strong>Pony</strong> developers have <a href="https://github.com/ponyorm/pony/issues/16">confirmed they are working on this</a>).</p><h3>Resourses :</h3><ol><li><em>ORM Concept</em> — <a href="https://blog.bitsrc.io/what-is-an-orm-and-why-you-should-use-it-b2b6f75f5e2a">https://blog.bitsrc.io/what-is-an-orm-and-why-you-should-use-it-b2b6f75f5e2a</a></li><li><em>Python ORMs </em>— <a href="https://www.fullstackpython.com/object-relational-mappers-orms.html">https://www.fullstackpython.com/object-relational-mappers-orms.html</a></li><li>Pony ORM — <a href="http://jakeaustwick.me/why-you-should-give-ponyorm-a-chance/">http://jakeaustwick.me/why-you-should-give-ponyorm-a-chance/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b63cfbc39e7f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/orm-for-python-b63cfbc39e7f">ORM for Python</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conditions in Python]]></title>
            <link>https://medium.com/pragmatech/conditions-in-python-876b3b20515e?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/876b3b20515e</guid>
            <category><![CDATA[praqmatik-məsələlər]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 18:54:21 GMT</pubDate>
            <atom:updated>2020-09-19T13:59:49.441Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In order to change the output of the program depending on the input, we use conditions. Python uses boolean variables to evaluate conditions. In this article we will analyze boolean variables and most importantly how to use it in conditions.</blockquote><h3>BOOLEAN VARIABLES</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*6hHnFCAWWNqlUCZc6fdCtA.jpeg" /></figure><p><strong><em>Note :</em></strong><em> The logic behind them and generally all modern computers comes from Boolean Algebra.</em></p><p>A <em>Boolean</em> value can be either <strong>True</strong> or <strong>False</strong>(In Python they are written with capital letters in particular). The type of boolean values are called <strong>bool</strong> as one of the data types in Python.</p><pre>print(type(True))</pre><pre>print(type(False))</pre><p>Output :</p><pre>&lt;class &#39;bool&#39;&gt;<br>&lt;class &#39;bool&#39;&gt;</pre><p>However if we don’t use boolean value capitalized, Python won’t understand it as bool but variable.</p><pre>print(type(true))<br>NameError: name &#39;true&#39; is not defined</pre><h3><strong>BOOLEAN EXPRESSIONS</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*_wHKtlW0loBZQwkO.jpg" /></figure><p>A Boolean expression evaluates conditions that returns either <strong>True </strong>or <strong>False</strong>.</p><p><strong>Comparison Operator :</strong></p><p>Comparison operators evalute two values while comparing them and returns either <strong>True</strong> or<strong> False</strong>.</p><ul><li>(Equal)<strong>== </strong>: Returns<strong> True</strong> if two values are equal, either <strong>False</strong>.</li><li>(Not Equal)<strong>!=</strong>: Returns<strong> True</strong> if two values aren’t equal, either <strong>False</strong>.</li></ul><pre>print(&quot;a&quot; == &quot;a&quot;)  # True</pre><pre>print(3 == 4)  # False</pre><pre>print(1 != 1)  # False</pre><pre>print([&quot;Pragmatech&quot;] != None)  # True</pre><ul><li>(Less Than)<strong>&lt; </strong>: Returns<strong> True</strong> if left side is less than right one, either <strong>False</strong>.</li><li>(Less Than or Equal)<strong>&lt;= </strong>: Returns<strong> True</strong> if left side is less than or equal to right one, either <strong>False</strong>.</li><li>(Greater Than)<strong>&gt; </strong>: Returns<strong> True</strong> if left side is greater than right one, either <strong>False</strong>.</li><li>(Greater Than or Equal)<strong>&gt;= </strong>: Returns<strong> True</strong> if left side is greater than or equal to right one, either <strong>False</strong>.</li></ul><pre>print(85 &gt; 3)  # True</pre><pre>print(-12 &gt;= 4)  # False</pre><pre>print(9 &lt; -123+3)  # False</pre><pre>print(24*3 &lt;= 56**23)  # True</pre><p><strong>Logical Operators :</strong></p><p>Logical Operators in Python are <strong><em>and, or, not.</em></strong></p><p><strong>and : </strong>Returns <strong>True</strong> if both statements are true, either <strong>False.</strong></p><pre>print(85 != 3 and -12 &gt;= 4)  # False</pre><pre>print(85 &gt; 3 and 0 == 0)  # True</pre><p><strong>or</strong> : Returns<strong> True</strong> if one of the statements is true, either <strong>False</strong>.</p><pre>print(85 != 3 or -12 &gt;= 4)  # True</pre><pre>print(85 &lt; 3 or 0 != 0)  # False</pre><p><strong>not</strong> : Returns <strong>True</strong> if the result is false either <strong>True.</strong></p><pre>print(not(85 != 3 or -12 &gt;= 4)) # True</pre><pre>print(not (85 &lt; 3 or 0 != 0))  # False</pre><h3>Conditionals :</h3><p>At the end of the day about how to use conditions.</p><p>Syntax looks like this :</p><pre>if(condition):</pre><pre>   code_block1</pre><pre>else:</pre><pre>   code_block2</pre><blockquote>What is condition and code block at the code?</blockquote><p>The expression after <strong>if</strong> is called <strong>condition</strong>(at the end it ends with “:”). Example :</p><pre>x=6</pre><pre>if x % 2 == 0:</pre><pre>    print(x, &quot;is even.&quot;)</pre><pre>else:</pre><pre>    print(x, &quot;is odd.&quot;)</pre><p><strong>Code block</strong> is a statement or declaration. In Python, we have to use indentation to show it.</p><p>First code block will be executed if the condition is <strong>True</strong>. We can imagine it as door which lets you in only when the condition is True. Otherwise, the second one will.</p><pre>x=19</pre><pre>if x % 2 == 0:</pre><pre>print(x, &quot;is even.&quot;)</pre><pre>else:</pre><pre>print(x, &quot;is odd.&quot;)</pre><pre># OUTPUT<br># 19 is odd.</pre><h3>Resourses :</h3><p><a href="https://medium.com/@ngohongphuc2001/python-condition-869faf7afe8a">https://medium.com/@ngohongphuc2001/python-condition-869faf7afe8a</a></p><p><a href="https://www.learnpython.org/en/Conditions">Conditions - Learn Python - Free Interactive Python Tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=876b3b20515e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/conditions-in-python-876b3b20515e">Conditions in Python</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the LEGB Rule in Python?]]></title>
            <link>https://medium.com/pragmatech/what-is-the-legb-rule-in-python-9c05967d9108?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c05967d9108</guid>
            <category><![CDATA[praqmatik-məsələlər]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Thu, 27 Aug 2020 08:08:48 GMT</pubDate>
            <atom:updated>2020-09-06T13:38:52.862Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The logic behind <strong>scope</strong> is that <strong>scope </strong>determines accessibility of variables, functions, objects, and so on. It is directly depends on where you creat them.</blockquote><p>In order to understand actually how the scope resolution happening in Python, we should analyze the <strong>LEGB rule </strong>because, it is the sequence of names(variables, functions, objects and so on) that Python resolves in a program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*_h8IujiEfhwWBK2ddyrT4g.png" /></figure><blockquote><strong>LEGB</strong> stands for :</blockquote><blockquote>(L) → Local scope</blockquote><blockquote>(E) →Enclosed scope</blockquote><blockquote>(G) →Global scope</blockquote><blockquote>(B) →Built-in scope</blockquote><blockquote>As l mentioned earlier, because the <strong>LEGB rule</strong> displays the sequence of how Python resolves names(variables, functions, objects and so on), it is so important to remember it from(highest(<strong>L</strong>) to lowest(<strong>B</strong>)).</blockquote><h3><strong>Local (or function) scope</strong></h3><p>Local scope refers to the name(variable, function and so on) that is defined inside the function. It means it is accessible within the point at it is defined until the end of the function. That particular scope can’t be modified or even accessed outside of the function. As an example,</p><pre><em>def </em>example():<br>    x=&quot;LEGB rule&quot;<br>    <em>print</em>(x)<br><br>example()<br><br><em>print</em>(x)</pre><p><em>x </em>variable can be accessible only inside the <em>example()</em> function so, when we attempt to use it as <em>print(x)</em> it gives no error. However when we try to reach it from outside of the function(below we call example function), there an error arises:</p><pre>NameError: name &#39;x&#39; is not defined<br>LEGB rule</pre><p>It is because, local scope isn’t visible outside of the function where it is created.</p><h3><strong>Enclosing (or nonlocal) scope</strong></h3><p>Enclosing scope is kind of scope that exists only in <strong>nested functions</strong>(A function defined inside another function is called a <strong>nested function</strong>). The enclosing scope is visible only for inner and enclosing functions.</p><pre><em>def </em>example():<br>    x=&quot;outer function&quot;<br><br>    <em>def </em>example_inner():<br>        y=&quot;inner function&quot;<br>        <em>print</em>(f&quot;{x} // {y}&quot;)<br>    <em>print</em>(x)<br>    example_inner()<br>example()</pre><p>Here is our output,</p><pre>outer function<br>outer function // inner function</pre><p>As we learnt before because of the reason <em>y</em> is an local scope, it can be called only inside <em>example_inner()</em>. However <em>x</em> is an enclosing scope which means that it can be called inside <em>example()</em>, morever inside <em>example_inner() </em>as well(because, despite of the fact it is another function, it is still inside the <em>example()</em> function).</p><h3><strong>Global (or module) scope</strong></h3><p>Global scope contains all the names(variables, functions, objects and so on) that you define at the highest level in your program. It means that we can use that names from anywhere we wish.</p><pre>str=&quot;global function&quot;<br><br><em>def </em>example():<br>    <br>    <em>def </em>example_inner():<br>        <em>print</em>(str)<br>    <em>print</em>(str)<br>    <br>    example_inner()<br>    <br>example()</pre><p>Output will be as,</p><pre>global function<br>global function</pre><h3>Built-in Scope</h3><p>Built-in scope has the widest accessibility among other scopes. We can give examples such as keywords, functions, and other attributes that are built into Python(We can call the keywords anywhere within our program without defining them).</p><pre><em>from </em>math <em>import </em>pi<br><br><em>def </em>example():<br>    <em>def </em>example_inner():<br>        <em>print</em>(pi)<br>    <em>print</em>(pi)<br><br>    example_inner()<br><br>example()<br><em>print</em>(pi)</pre><p>Though we don’t assign <em>pi</em> to any value, still when we use it as in the code above, we get an output as,</p><pre>3.141592653589793<br>3.141592653589793<br>3.141592653589793</pre><p>At the end of the day, the logic of the <strong>LEGB rule</strong> is the sequence that a Python interpreter follows when it is executing your program. Firsly, it checks the nearest( <strong>→Local scope</strong>), if it doesn’t exist, moves one step to ( <strong>→Global scope</strong>) and with same logic it checks ( <strong>→Global scope</strong>) and at the end ( <strong>→Built-in scope</strong>).</p><p>Let’s check the quick example in order to understang better :</p><pre>x=&quot;Global scope&quot;<br><br><em>def </em>example(x):<br>    <em>print</em>(x)<br><br>example(&quot;Local scope&quot;)<br><br><em>print</em>(x)</pre><p>The OUTPUT will be,</p><pre>Local scope<br>Global scope</pre><p>Because when we call the function, we creat a local scope(<em>“Local scope”</em>) and also we have a global scope(<em>“Global scope”</em>). The <em>example(x)</em> function at the first place looks if there is a local scope(which there is →<em>“Local scope</em>”). So it prints<em> “Local scope”</em>.</p><p>However, in this example</p><pre>x=&quot;Global scope&quot;<br><br><em>def </em>example():<br>    <em>print</em>(x)<br><br>example()<br><br><em>print</em>(x)</pre><p>Our OUTPUT is</p><pre>Global scope<br>Global scope</pre><p>This time when we call a function, we don’t creat any local scope. The <em>example()</em> function again, firstly checks local scope(which there is no), then takes one step forward and checks global scope(<em>“Global scope”</em>). So, it prints <em>“Global scope”</em>.</p><h3>Sources :</h3><ol><li><a href="https://www.geeksforgeeks.org/scope-resolution-in-python-legb-rule/">https://www.geeksforgeeks.org/scope-resolution-in-python-legb-rule/</a></li><li><a href="https://realpython.com/python-scope-legb-rule/">https://realpython.com/python-scope-legb-rule/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c05967d9108" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/what-is-the-legb-rule-in-python-9c05967d9108">What is the LEGB Rule in Python?</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Structure Hissə 2]]></title>
            <link>https://medium.com/pragmatech/data-structure-hiss%C9%99-2-67e17a2a0c95?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/67e17a2a0c95</guid>
            <category><![CDATA[alqoritm-və-data]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 20:59:36 GMT</pubDate>
            <atom:updated>2020-08-24T10:07:08.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*vDv4Qt-7EN3igeF8.jpg" /></figure><p>Əvvəlki hissədə, array, stack, queue və linked list barəsində danışdıq. Indi isə data structure-ın non-linear növlərindən məlumat verəcəyik.</p><h3>GRAPHS</h3><p>Qrafiklər bir-birilə əlaqədə olan <strong>vertex</strong>-lərdən(təpə nöqtələri) ibarətdir. Həmin bu <strong>vertex</strong>-lər(təpə nöqtələri) arasındakı əlaqə isə <strong>edges</strong>(yəni, xətlər) vasitəsilə qurulur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*bn9zx34vwWtEje_V" /></figure><p>Buradakı şəkildə <em>a, b</em> və <em>c </em>olaraq üç <strong>vertex</strong>(təpə nöqtələri) var. Eynilə, bunları birləşdirən 3 <strong>edge</strong>(xətlər) var ki, onların hansı hansı vertex-ləri birləşdirdiyini <em>(a, b)</em>, <em>(b, c)</em> və <em>(c, a)</em> kimi göstərə bilərik.</p><p>Qrafiklərin işlədilmə yerinə misal olaraq sosial şəbəkələri göstərə bilərik. Hər bir şəxs orada bir vertex təşkil edir. Həmin bu vertex-lər şəxslər barəsində adı, soyadı, yaşadığı yeri və s. kimi məlumatlar daşıyır.</p><h3>BINARY TREES</h3><p>Bu növ data structure, qrafiklərdə olduğu kimi, <strong>vertex</strong>(təpə nöqtələri) və <strong>edge</strong>(xətlərdən) ibarətdir. Lakin aralarındakı ən böyük fərq<em> dairəvi </em>əlaqənin olmamasıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*yQfcDpDbtps2qJYODC9R9Q.png" /></figure><p><strong>Tree</strong> data structure-da istifadə olunan bəsit terminologiya :</p><ol><li><strong>Root</strong>(kök) — Ən yuxarıda yerləşən element</li><li><strong>Parent</strong>(valideyn) — Özündən törəyən elementlər olan hər bir element</li><li><strong>Child</strong>(uşaq) — valideyndən törəyən hər bir element</li><li><strong>Leaf</strong>(yarpaq) — heç bir child(uşaq) elementi olmayan element</li><li><strong>Sibling</strong>(bacı və ya qardaş)- valideynləri eyni olan elementlər</li><li><strong>Level</strong>(səviyyə) — elementlərin nəslini göstərir(məsələn, <em>2,3,4</em> olan sıra <strong>səviyyə-1</strong>; <em>6,7</em> olan sıra isə <strong>səviyyə-2</strong> sayılır)</li></ol><h3>HASH TABLE</h3><p><strong>Hash table</strong> əlimizdə olan böyük məlumatlara daha tez çatmaq üçün istifadə olunun data structure növüdür. Buradakı məlumatlar <strong>key-value</strong>(<em>açar söz — dəyər</em>)<em> </em>şəklində yadda saxlanılır. Məsələn, bir kitabxanada olan kitabların adları açar söz, onun yazarı və janrı isə dəyər kimi verilir.</p><blockquote>Məlumatları array-in içinə qoyaraq index-lər vasitəsilə çata bilərik. Bəs o zaman niyə hash-table ehtiyac var?</blockquote><p>Çünki, kiçik saylı məlumatların indexlərini asanlıqla bilib onları çağıra bilirik. Məsələn,</p><p><em>mənimListim=[“Mia”, “Ted”, “Ada”].</em></p><p><em>Bizə “Ted” lazım olarsa, mənimListim[1] deyə çağıra bilərik. Çünki, “Ted” 1-ci index-dədir və bu yeri asanlıqla təyin edə bilərik.</em></p><p>İndi isə təsəvvür edək ki, biz toya 500 nəfər çağırmalıyıq. Bu zaman hər bir şəxsin ümumi listdə hansı yerdə(index-də) olduğunu təyin etmək həm çətin, həm də yorucudur. Təbii ki, biz alqoritm qurub həmin şəxsi tapmaq üçün bir-bir listimizin içindəki adları nəzərdən keçirməliyik. Bu kifayət qədər çox vaxt apardığından array öz effektivliyini itirir.</p><p>Beləliklə, bu tip nisbətən kompleks problemləri <strong>hash table </strong>vasitəsilə həll edirik.<strong> Hashing</strong> metodunda hər bir<strong> </strong><em>key(açar söz)</em> uyğun olaraq xüsusi<strong> </strong><em>index </em>təyin edilir yəni, <em>index</em> mənalı hala gətirilir. Mənalı deyərkən, nəzərdə tutulan odur ki, bizim elementin <em>key(açar söz)</em> hissəsi elə bir hesablama sisteminə köçürülməlidir ki, biz onu sıralaya bilək.</p><blockquote>Bəs bu key(açar sözləri) necə ədədlərə çevirək?</blockquote><p>Bu məqsədlə, hər bir xarakterin qarşılığı ədədlərlə ifadə olunduğundan, ASCII-dən istifadə edilir.<em> </em>Beləliklə, biz sadəcə açar söz vasitəsilə istədiyimiz məlumata çata bilərik. Məsələn, yuxarıdakı misaldan davam edək, lakin 500-i vizuallaşdırmaq çətin olduğu üçün deyək ki, bu adamların sayı 11 nəfərdir və bizə “Ted”-i çağırmaq lazımdır.</p><p>Burada “Ted” açar sözdür. Həmin açar sözə uyğun xüsusi index qoymaq üçün bir neçə addımlı hesablama aparılır :</p><ol><li>Sözdəki hər bir hərfin ASCII kodu müəyyənləşdirilir. <em>(Misalımızda, T- 84, E-101, D-100)</em></li><li>ASCII kodlarını toplanılır. (84 + 101 + 100=285)</li><li>Listimizdə boşluq yaranmaması üçün <em>(məsələn, Ted- 285, ondan sonra gələcək olan isə Leo- 288-dir. Bu o deməkdir ki, aradakı 286, 287 index-ləri boş olacaq), </em>bunu daha qısaltmaq üçün bu hesablama sistemini daha da optimallaşdıraq. Beləliklə, hər bir elementin alınan cəmi elementlərin sayına bölünür və qalığı qeyd edirik. Beləliklə, Ted sözünün hara yerləşdiriləcəyi müəyyən olunur. <em>(285/11=25 (qalıq 10))</em></li></ol><p>Bu yolla həmin o 10 nəfəri də qeyd etsək, belə bir nəticə ala bilərik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0HUqB03dcxW3wF1qXEsbQ.png" /></figure><blockquote>Bəs axı bəzi açar sözlərin dəyərləri eyni nəticə verə bilər. Onda istədiyimiz nəticəni necə əldə edirik?</blockquote><p>Eyni nəticənin alındığı yerlərdə, məsələn, “3” bir neçə dəfə alınıbsa, o zaman həmin sırada<em> “linked list”(ətraflı izah hissə 1-də) </em>yaranır. Həmin daxil olunan açar söz vasitəsilə “3” nəticəsinin alındığı elementlərin arasında həmin sözü axtarır və çıxarır.</p><h3>Mənbələr :</h3><p><em>Data Structure</em> — <a href="https://www.hackerearth.com/practice/data-structures/arrays/1-d/tutorial/">https://www.hackerearth.com/practice/data-structures/arrays/1-d/tutorial/</a></p><p><em>Data Structure</em> — <a href="https://www.geeksforgeeks.org/array-data-structure/">https://www.geeksforgeeks.org/array-data-structure/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67e17a2a0c95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/data-structure-hiss%C9%99-2-67e17a2a0c95">Data Structure Hissə 2</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Structure Hissə 1]]></title>
            <link>https://medium.com/pragmatech/data-structure-hiss%C9%99-1-6fabae2e3419?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fabae2e3419</guid>
            <category><![CDATA[alqoritm-və-data]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 20:58:40 GMT</pubDate>
            <atom:updated>2020-08-24T10:06:56.788Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Kompüter proqramları müəyyən bir tapşırığı icra etmək üçün yazılmış əmrlərdən ibarətdir. Həmin əmrləri yazarkən, əslində, əlimizdə olan məlumatların üzərində müxtəlif işlər görürük.</blockquote><p><strong>Data structure</strong> bu məlumatları saxlaması, bir-biriləri arasında əlaqə qurulması və rahatlıqla onlara çatıb istifadə etməyimizi təmin edir. <strong>Data structure </strong>haqqında məlumatımız olması, daha effektiv və optimallaşdırılmış kompüter proqramları yazmağa imkan yaradır. Bunun üçün müxtəlif data structure növləri arasında işimizə ən uyğun olanını seçməliyik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/0*umRSuOHnFilteVXu.png" /></figure><blockquote>Başlıca növləri olaraq :</blockquote><blockquote>Array</blockquote><blockquote>Stack</blockquote><blockquote>Queue</blockquote><blockquote>Linked list</blockquote><blockquote>Graphs</blockquote><blockquote>Binary trees</blockquote><blockquote>Hash table</blockquote><h3>ARRAY</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*lnzSC_vAiK7o4Wz69SntZg.png" /></figure><p><strong>Array</strong>-i içində müəyyən qədər element olan qutu kimi təsəvvür edə bilərik. Onun məqsədi eyni növdə olan məlumatları bir yerə yığa bilmə və lazım olduqda onlardan rahatlıqla istifadə etməkdir.</p><p>Beləliklə, eyni <strong>array</strong>-in içində eyni növdə olan məlumatlar <strong>elementlər </strong>adlanır.</p><blockquote>Array vasitəsilə məlumatları eyni yerə yığa bildik. Bəs lazım olanda onları necə asanlıqla çağıra bilərik?</blockquote><p>Bunun üçün<strong> index </strong>nəzərdə tutulub. <strong>Index</strong> hər bir elementin yerini göstərir. Beləliklə, bir elementi <strong>index</strong> vasitəsilə çağıra bildiyimiz zaman(məsələn, “B” hərfinin index-i 1-dir), üzərinə 1 gələrək yanındakını və bu məntiqlə yerdə qalan elementləri də çağıra bilərik.</p><blockquote>Array üzərində hansı əməliyyatları apara bilərik?</blockquote><ol><li>0-dan başlayaraq hər hansı bir elementi çağıra bilmək.</li><li><strong>Array</strong>-in içində olan elementlərin sayını onun uzunluğu ilə müəyyən etmək.</li><li><strong>Array</strong>-ə yeni element əlavə etmək</li><li><strong>Array</strong>-dən element silmək</li><li><strong>Index</strong> vasitəsilə elementi,<strong> element</strong> vasitəsilə isə onun hansı index-də olduğunu təyin etmək</li><li><strong>Array</strong>-də mövcud olan elementi dəyişdirmək</li></ol><p><strong>Stack</strong>,<strong>queue</strong> kim digər data structure növləri <strong>array</strong>-lərdən əldə olunur.</p><h3>STACK</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/0*O1qiWuB5I5FF8im-.png" /></figure><p>Şəkildə də olduğu kimi <strong>stack</strong>-i üst-üstə yığılmış boş-qablar, kitablar və sairə kimi düşünə bilərik. Tərcümə etibarilə “<em>dəstə</em>” adlandıra bilərik. Yeni boş-qab əlavə edir və ya ən sonuncusunu götürürük. Yeni əlavə edilən boş-qab ən üstdə yerləşir.</p><blockquote>Yaxşı bəs, bu situasiya kodda necə tətbiq olunur?</blockquote><p>Termin olaraq, bir elementi əlavə etməyə <em>“push”</em>, götürməyə isə <em>“pop”</em> deyirik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*4l1kYYYUcp12caDR.png" /></figure><p>Qoyulan ən sonuncu “3” elementi ən üstə gəlir, beləliklə, biz bir elementi götürmək istəsək, yenə “3” elementini götürəcəyik. Bu yanaşma<strong> Last In First Out(LIFO) </strong>adlanır. Yəni ki, ən son əlavə edilən element ən birinci götürüləndir.</p><blockquote>Dəstə üzərində hansı əməliyyatları apara bilərik?</blockquote><p><strong>Push</strong> — Dəstənin üstünə yeni element əlavə etmək</p><p><strong>Pop</strong> — Dəstədən ən üstdəki elementi silmək</p><p><strong>IsEmpty</strong> — Dəstənin boş olub olmadığını yoxlamaq</p><p><strong>IsFull</strong> — Dəstənin dolu olub olmadığını yoxlamaq</p><p><strong>Peek</strong> — Ən üstdəki elementin dəyərini onu silmədən almaq</p><h3>QUEUE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*AAoLPk0JMPy-_Tnk.png" /></figure><p>Adından da göründüyü kimi, <strong>queue</strong> növ data structure-ı hər-hansı bir həyatda gördüyümüz “<em>növbə</em>” kimi düşünə bilərik. Birinci kim gəlibsə, ən birinci də elə o gedir. Bu şəkilimizdə bəyaz geyimli adam ən birinci gedəndir. Stack-in tam tərsi olan bu yanaşma <strong>First In First Out(FIFO) </strong>adlanır.<strong> </strong>Yəni ilk əlavə edilən element ən birinci götürüləndir.</p><blockquote>Queue üzərində hansı əməliyyatları apara bilərik?</blockquote><p><strong>Enqueue</strong> — Növbənin sonuna yeni element əlavə etmək</p><p><strong>Dequeue</strong> —Növbənin əvvəlindəki elementi silmək</p><p><strong>IsEmpty</strong> — Növbənin boş olub olmadığını yoxlamaq</p><p><strong>IsFull</strong> — Növbənin dolu olub olmadığını yoxlamaq</p><p><strong>Peek</strong> — Ən birinci elementin dəyərini onu silmədən almaq</p><h3>LINKED LIST</h3><p><strong>Linked List </strong>bir-birilə<strong> </strong>bağlanmış<strong> node</strong>-lardan ibarətdir. Həmin Linked list-in içindəki hər bir element ayrı bir obyekdir.</p><blockquote>Bəs <strong>node</strong> özü tam olaraq nədir?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*rJcZCUOrHJKfURhV-1UMuQ.png" /></figure><p>Hər bir node, göründüyü kimi, iki elementdən təşkil olunub. İlk olaraq, bizə lazım olan məlumat, sonra isə ondan sonra gələn <strong>node</strong>-un adresindən ibarətdir.</p><p>Linked list-in başlanğıc nöqtəsi <strong>head</strong> adlanır. <strong>Head</strong> ayrı bir node deyil, sadəcə ardıcıllığı qorumaq üçün və haradan başladığımızı bilmək üçün birinci gələn node-un adresinə verilən addır.</p><p><strong>Null</strong> isə axırıncı node-dan sonra heç bir şey gəlmədiyi üçün adres olaraq qeyd olunan yerdir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*64BHi-PbyiWwD0eQ" /></figure><p>Linked list-in ən önəmli xarakteristikası odur ki, istənilən yerə yeni element əlavə edə bilərik. Bunun üçün digər elementləri yenidən yerləşdirməyə ehtiyac yoxdur. Eynilə, istənilən yerdə olan elementi, başqa elementləri dəyişdirmədən silə bilərik.</p><blockquote>Qalan data structure növləri ikinci hissədədir.</blockquote><h3>Mənbələr :</h3><p><em>Data Structure</em> — <a href="https://www.tutorialspoint.com/data_structures_algorithms/data_structures_basics.htm">https://www.tutorialspoint.com/data_structures_algorithms/data_structures_basics.htm</a></p><p><em>Data Structure</em> — <a href="https://www.programiz.com/dsa#:~:text=A%20data%20structure%20is%20a,efficient%20and%20optimized%20computer%20programs.">https://www.programiz.com/dsa#:~:text=A%20data%20structure%20is%20a,efficient%20and%20optimized%20computer%20programs.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fabae2e3419" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/data-structure-hiss%C9%99-1-6fabae2e3419">Data Structure Hissə 1</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kompüter kodları necə anlayır? Hissə 2]]></title>
            <link>https://medium.com/pragmatech/komp%C3%BCter-kodlar%C4%B1-nec%C9%99-anlay%C4%B1r-hiss%C9%99-2-593a1b43226f?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/593a1b43226f</guid>
            <category><![CDATA[o-necə-olur]]></category>
            <category><![CDATA[praqmatik-məsələlər]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Fri, 14 Aug 2020 19:43:45 GMT</pubDate>
            <atom:updated>2020-08-19T10:09:21.025Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Keçən hissədə translator və assembler anlayışlarını analiz etdik. Bəs assembler-dən əlavə compiler və interpreter proqramları da var. Onların iş prinsipləri necədir?</em></p><blockquote>Bildiyimiz kimi, translator-un bir növü olan assembler “assembly language” istifadə edilərək yazılan kodları “tərcümə” edir. Bəs bizim bildiyimiz C#, Javascript, Ruby kimi dillər necə çap olunur?</blockquote><p>Həmin bu dillər üçün <strong>compiler</strong> və<strong> interpreter</strong>-dən istifadə olunur. Hər biri öz xarakteristikalarına uyğun olaraq fərqli dillərlə işləyirlər.</p><h3>COMPILER</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*y_NgeOWQe7RFewFu.jpeg" /></figure><p><strong>Compiler</strong> yazdığımız bütün kodları bütünlüklə “machine code”-a çevirir. Təsəvvür edirsiniz ki, bu kodlar yalnızca, ekranda göründüyü kimi, 1 və 0-lardan ibarətdir. Həmin bu kodlar kompüterin anlayacağı dildə “yaddaşdan filan qədər byte oxu”, “onlar üzərində filan işi icra et” və sairə kimi əmrlərdən ibarətdir. <strong>Compiler</strong> bu kodları tamamilə “machine code”-a çevirdikdən sonra, artıq icra edilə bilən (<strong>object code</strong>) halına gəlir və yaddaşda saxlanılır. Bundan sonra artıq proqram işlənilə bilər.</p><p>Hər dəfə kodda dəyişiklik edildikdə yenidən bütün kodlar tərcümə olunmalıdır.</p><p>Başqa kompüterlərdə həmin kodun işləməsi üçün, bizim yazdığımız(<strong>source code</strong>) deyil, “machine code”-a çevrilmiş fayl göndərilir və icra edilir.</p><blockquote>Bəs kodda səhvlik varsa, nə baş verir?</blockquote><p>Əgər kodda sintaktik və ya semantik hər hansı bir səhvlik varsa, <strong>compiler</strong> əvvəlcə bütün programı yoxlayacaq sonra isə həmin səhvlikləri göstərəcək. Bütün bu problemləri düzəltmədən proqramın işləməsi mümkün deyil.</p><p><strong>Compiler</strong> istifadə edən dillərə misal olaraq, C, C++ dillərini göstərə bilərik. Hər bir proqramlaşdırma dili xüsusi <strong>compiler</strong> tələb edir. Onlardan bəzilərinə misal olaraq :</p><blockquote><strong>C++ </strong>-GCC, Clang, Dev C++, Intel C++, Code Block</blockquote><h3>INTERPRETER</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*ES1Ji468vIX7EHhGvspjKQ.png" /></figure><p>Yuxarı səviyyə dilləri “machine code”-a çevirmənin digər bir yolu isə <strong>interpreter</strong>-dən istifadə etməkdir. Compiler-dan fərqli olaraq <strong>interpreter</strong> bir sətir kodu oxuyur və dərhal icra edir.</p><p>Kodda dəyişiklik etmək istəsək, həmin kodun olduğu sətir yenidən oxunacaq.</p><p>Başqa kompüterlərdə işləməsi üçün, compiler-dan fərqli olaraq, bizim yazdığımız(<strong>source code</strong>) göndərilir və icra olunur.</p><blockquote>Bəs kodda səhvlik varsa, nə baş verir?</blockquote><p>Əgər kodda hər hansı bir səhvlik varsa, interpreter kodları sətirbəsətir oxuduğu üçün, problemin olduğunu sətirdə interpreter dayanır. O sətirdəki səhvlik düzəlmədikcə<strong> interpreter</strong> davam etmir. Bu proqramçıya asanlıqla səhvləri tapıb düzəltməyə kömək edir.</p><p><strong>İnterpreter</strong> istifadə edən dillərə Ruby, Perl, PHP kimi nümunələr göstərə bilərik. Bu dillərə uyğun olaraq <strong>interpreter</strong>-lər :</p><blockquote>Ruby- YARV, Ruby MRI (CRuby)</blockquote><h3>COMPİLER- ın fərqləri :</h3><ul><li>Compiler kodları icra etmədən öncə bütün proqramı “machine code”-a çevirir.</li><li>Kodlar daha sürətli icra olunur.</li><li>Koddakı səhvlikləri bütün proqramı tərcümə etdikdən sonra göstərir.</li><li>Bütün kodlar artıq tərcümə olunduğu üçün, növbəti dəfə proqramı icra edəndə çox daha az vaxt tələb olunur.</li><li>Aralıq kod yaratdığı üçün daha çox yaddaş tələb olunur.</li><li><strong>Source code</strong> sizdə qaldığı üçün, <strong>compiler</strong> daha güvənlidir.</li></ul><h3>INTERPRETER- ın fərqləri :</h3><ul><li>Interpreter programı sətirbəsətir “machine code”-a çevirir və kodları ardıcıllıqla icra edir.</li><li>Kodlar daha yavaş icra olunur.</li><li>Koddakı hər bir səhvi bir-bir göstərir.</li><li>Bir-bir icra etdiyi üçün daha çox vaxt tələb olunur.</li><li>Heç bir aralıq kod yaratmadığı üçün yaddaş baxımından daha effektivdir.</li><li><strong>Source code</strong>-u paylaşdığı üçün, <strong>interpreter</strong> daha az güvənlidir.</li></ul><p>Bəzi dillər var ki, onlar hər iki translator-dan da istifadə edirlər. Bu və digər nüanslar haqqında növbət hisslərdə danışılacaq.</p><h3>Mənbələr :</h3><p>Compiler, Interpreter — <a href="https://www.microcontrollertips.com/compilers-translators-interpreters-assemblers-faq/">https://www.microcontrollertips.com/compilers-translators-interpreters-assemblers-faq/</a></p><p>Compiler və Interpreter arasındakı fərqlər — <a href="https://pandabunnytech.com/compiler-vs-interpreter/">https://pandabunnytech.com/compiler-vs-interpreter/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=593a1b43226f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/komp%C3%BCter-kodlar%C4%B1-nec%C9%99-anlay%C4%B1r-hiss%C9%99-2-593a1b43226f">Kompüter kodları necə anlayır? Hissə 2</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kompüter kodları necə anlayır? Hissə 1]]></title>
            <link>https://medium.com/pragmatech/komp%C3%BCter-kodlar%C4%B1-nec%C9%99-anlay%C4%B1r-hiss%C9%99-1-106e4e205ee6?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/106e4e205ee6</guid>
            <category><![CDATA[o-necə-olur]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 14:19:55 GMT</pubDate>
            <atom:updated>2020-08-13T12:24:58.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZjZGtnB6wzfYxDJM.png" /></figure><p><em>Proqramlaşdırma dilləri kompüterə əmrlər vermək üçün istifadə etdiyimiz alətlərdir. Amma bu proqramlaşdırma dilləri bizim üçün yazılıb, kompüter üçün deyil. Çünki, kompüter yalnız “machine codes(ikilik)”-ı anlaya bilir. Bəs onda necə olur ki, kompüter yazdığımız kodları icra edir?</em></p><p>Bu situasiyanı sanki, bildiyimiz dillərdən tamamilə fərqli dildə danışan birinə nəyisə anlatmağa çalışmaq kimi təsəvvür edə bilərik. Onun bizi anlamasının yolları ya onun bildiyi dildə danışmaq, ya da “tərcüməçi”-dən yardım almaqdır.</p><p>Lakin kompüterin anladığı dil insanlara çox çətinlik yaratdığından, çoxları “machine code”-un çox sadələşdirilmiş halı olan indiki gördüyümüz proqramlaşdırma dillərindən istifadə edirlər. Ona görə bizim yerdə qalır bir yolumuz. <strong>Tərcüməçi</strong>-dən yardım almaq.</p><blockquote>Translator(tərçüməçi) nədir?</blockquote><p>Translator “machine code”-dan fərqli dillərdə yazılan kodu(<strong>source code</strong>) “machine code”-a(<strong>object code</strong>) çevirmək üçün istifadə olunur. Bu <strong>translator</strong>-un müxtəlif növləri və hərəsinin öz yaxşı və pis cəhətləri var. Buna görə də müxtəlif məqamlarda istifadə olunurlar.</p><blockquote>Translator növləri :</blockquote><blockquote>- Assembler</blockquote><blockquote>- İnterpreter</blockquote><blockquote>- Compiler</blockquote><h3>Assembler</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*oK1TAlsoejucdMWE.png" /></figure><p>Bayaq da qeyd etdiyimiz kimi, kompüterlərin anladığı tək dil “machine language”-dir. Lakin insanların sadəcə 1 və 0-larla proqram yazması çox çətin olduğundan, əvvəlcə insan dilinə daha yaxın olan <strong>assembly language</strong> yaranmasına ehtiyac yaranıb. Lakin hələ də, bizim indiki bildiyimiz proqramlaşdırma dillərindən — Python, Java, C++ daha az insan dilinə yaxın dildir. Bu dillərlə müqayisədə eyni əmri <strong>assembly language</strong>-də daha çox sətir kodla ifadə edirik. Beləliklə, artıq bu dil çox istifadə edilmir.</p><blockquote>Buna baxmayaraq erkən kompüter proqramlarının çoxsu və indiki bəzi texniki applikasiyalar bu dildə yazılıb. Bəs bu kodları kompüter necə anlayır?</blockquote><p>Bayaq da qeyd etdiyimiz kimi, bunun üçün bizə hər iki dildə bilən bir “tərcüməçi” lazimdır. Həmin bu “tərcüməçi” <strong>assembler</strong> adlanır. Bu proqram assembly language-də yazılan kodları(<strong>source code</strong>) bir-bir analiz edərək onları machine code-a(<strong>object code</strong>) tərcümə edir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKAHew_8xWAnJwFfiqca_w.png" /></figure><blockquote><strong>Assembler</strong>-ə aid xarakteristikalar :</blockquote><p>— Assembler əvvəlcə bütün proqramı bir-başa tərcümə edir və yalnız ondan sonra proqramı “run” edir.</p><p>— Error-lar proqram “run” edilmədən öncə göstərilir.</p><p>— Sadəcə bir dəfə proqram tərcümə edilir, yenidən işlədildiyi zaman təkrar tərcümə etməyə ehtiyac qalmır.</p><p>— Az yaddaşa ehtiyac duyulur.</p><p>Assembler-lərə nümunə olaraq NASM, MASM, FASM göstərə bilərik.</p><ul><li>MASM(Microsoft Assembler) — Windows üçün popular istifadə olunan assembler.</li><li>NASM(Netwide Assembler) — Linux üçün popular olan assembler, yalnız Windows üçün də istifadə oluna bilər.</li><li>FASM(Flat Assembler) — Həm Windows, həm də Linux üçün istifadə oluna bilər.</li></ul><h3>Mənbələr :</h3><p>Translator, Assembly dili — <a href="https://www.youtube.com/watch?v=1OukpDfsuXE">https://www.youtube.com/watch?v=1OukpDfsuXE</a></p><p>Assembly dili— <a href="https://www.youtube.com/watch?v=wA2oMRmbrfo">https://www.youtube.com/watch?v=wA2oMRmbrfo</a></p><p>Assembler xarakteristikaları — <a href="https://www.geeksforgeeks.org/introduction-of-assembler/">https://www.geeksforgeeks.org/introduction-of-assembler/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=106e4e205ee6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/komp%C3%BCter-kodlar%C4%B1-nec%C9%99-anlay%C4%B1r-hiss%C9%99-1-106e4e205ee6">Kompüter kodları necə anlayır? Hissə 1</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kodlardan Rəsimlərə]]></title>
            <link>https://medium.com/pragmatech/kodlardan-r%C9%99siml%C9%99r%C9%99-f467d2a7175a?source=rss-20dd52f3c690------2</link>
            <guid isPermaLink="false">https://medium.com/p/f467d2a7175a</guid>
            <category><![CDATA[o-necə-olur]]></category>
            <category><![CDATA[kompüter-arxitekturası]]></category>
            <dc:creator><![CDATA[Sabanova Rubabe]]></dc:creator>
            <pubDate>Mon, 03 Aug 2020 14:53:43 GMT</pubDate>
            <atom:updated>2020-08-03T18:31:44.071Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Telefonların, kompüterlərin və başqa cihazların ekranlarında rəsimlər və ya “hərəkət edən rəsimlər” — video,GIF və s. görürük. Bəs əgər texnoloji cihazlar ikilik say sistemindən(0 və 1-lər) istifadə edirsə, necə olur ki, rəsimləri ekranda görürük?</em></p><p>Rəsimləri ekranda görmək üçün ilk öncə onları <strong>Proqramlaşdıra Biləcəyimiz Hissələrə — </strong>piksellərə(“picture element”) bölməliyik. Əgər rəsimləri yaxınlaşdırsanız, siz də onları görə bilərsiniz!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*SFJKNCP4L-fIF0VxotqplA.jpeg" /></figure><p>Hər bir piksel öz yerindən asılı olaraq yalnız bir rəngi ifadə edə bilir. Ona görə də, daha detallı rəsimləri yaratmaq üçün minlərlə hətta milyonlarla piksellərdən istifadə olunur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*CzR4krG6csWfHqPe.png" /><figcaption>Ekran görüntü imkanları</figcaption></figure><p>Ekran ölçüləri dəyişdikcə piksel sıxlığı da dəyişir. <strong>Piksel sıxlığı</strong> müəyyən ölçüdə(daha çox inch) olan piksellərin sayıdır. İndi ən sadə kompüterlərin belə hər inch-ində 115-160 arasında piksel olur.</p><figure><img alt="Fərqli ekran ölçülərində hər inch üçün piksel sıxlığı" src="https://cdn-images-1.medium.com/max/1024/0*OmOA0p6bTNUJOvOC.png" /><figcaption>Fərqli ekran ölçülərində hər inch üçün piksel sıxlığı</figcaption></figure><p><em>Bəs dünyada milyonlarla rəng varkən, kompüter hansı pikselin hansı rəngi bildirdiyini necə anlayır?</em></p><p>Bizim normal gözlə rəngləri görməyimizin səbəbi işıqdır. İşığın ən az miqdarı qara, ən çoxu isə bizə ağ rəngi yaradır. İşığın əsas rəngləri <strong>qırmızı,</strong> <strong>mavi</strong> və <strong>yaşıldır.</strong> Onun üçün RGB(red, green, blue) dəyərləri bizə istədiyimiz hər hansı bir rəngi monitorda ifadə etməyə kifayətdir. Belə ki, bütün digər rənglər və çalarları bu üç rəngin birləşməsindən yaranır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*iy2uDTHynyhc5V0_" /></figure><p>Bu o deməkdir ki, məsələn, əgər biz sarı rəngi almaq istəyiriksə, bizə qırmızı və yaşıl rəngli işıqlar, bənövşəyi almaq istəyiriksə, qırmızı və mavi rəngli işıqlar lazım olacaq.</p><p><em>Bəs bunu kompüterin anlayacağı dildə necə başa salaq?</em></p><p>Bunun üçün RGB rənglərinin hərəsini bir bitlə ifadə edə bilərik. Əgər qırmızı rəng almaq istəyiriksə, 1 0 0(RGB sıralamasına uyğun olaraq), sarı rəng almaq istəyiriksə,0 1 1 yazmaq lazımdır. Lakin, bu yolla biz çox az sayda, dəqiqliklə desək, 2³=8 rəng ala bilərik.</p><p>İnsan gözünü aldadıb ekrandakı görüntünü gerçək kimi göstərmək üçün istifadə olunan üç rəngi də (qırmızı, yaşıl ve mavi) 8 bitlə ifadə etmək lazımlıdır. Bu isə hər bir rəngin 2⁸ = 256 tonunun olması deməkdir. Bununla biz tam 256³ = 16 milyon rəngi əldə edə bilərik!</p><p>Bəzi rənglərin RGB ilə necə ifadə etdiyimizə baxaq:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*XEz4xGX15KsiBOYSC1S65w.png" /></figure><p>Kompüterin anlaması üçün isə biz bu dəyərləri sırası ilə, daha öncə qeyd etdiyimiz kimi, 0 və 1-lərlə ifadə etməliyik. Məsələn,</p><p><em>Mavi — rgb(0, 0, 255) — 00000000 00000000 11111111</em></p><p><em>Sarı — rgb(255, 255, 0) — 11111111 11111111 00000000</em></p><p>Verdiyimiz misal üzərindən davam edərək, deyək ki,<strong> <em>mavi </em></strong>rəngli pikseli ekranda göstərmək istəyirik. Həmin pikseli ikilik sistemə(<em>00000000 00000000 11111111) </em>çevirdikdən sonra, bizə CPU-dan bu ikilik sistemdə olan kodları vizuallaşdırmaq üçün “tərcüməçi” lazımdır. Bu tərcümə prosesi <strong>GPU(Graphics Processing Unit)</strong> vasitəsi ilə həyata keçirilir. <strong>Qrafik kart </strong>CPU-dan ötürülmüş məlumatları ekranda şəkili göstərmək üçün emal edir və monitora ötürür. Beləliklə, bütün bu proseslər bizim rəsimləri görməyimizə imkan yaradır.</p><p>Mənbələr :</p><p>Rəsimlər, Piksellər və RGB — <a href="https://www.youtube.com/watch?v=15aqFQQVBWU&amp;feature=youtu.be">https://www.youtube.com/watch?v=15aqFQQVBWU&amp;feature=youtu.be</a></p><p>Rəng, RGB — <a href="https://youtu.be/LKnqECcg6Gw">https://youtu.be/LKnqECcg6Gw</a></p><p>Piksel sıxlığı — <a href="https://medium.com/@pnowelldesign/pixel-density-demystified-a4db63ba2922">https://medium.com/@pnowelldesign/pixel-density-demystified-a4db63ba2922</a></p><p>Qrafik kart — <a href="https://computer.howstuffworks.com/graphics-card.htm">https://computer.howstuffworks.com/graphics-card.htm</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f467d2a7175a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pragmatech/kodlardan-r%C9%99siml%C9%99r%C9%99-f467d2a7175a">Kodlardan Rəsimlərə</a> was originally published in <a href="https://medium.com/pragmatech">Pragmatech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>