<?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 Thuta Min Thway on Medium]]></title>
        <description><![CDATA[Stories by Thuta Min Thway on Medium]]></description>
        <link>https://medium.com/@thutaminthway.dev?source=rss-2b2ac3770b76------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vhCOI_fPtZUka6Dz</url>
            <title>Stories by Thuta Min Thway on Medium</title>
            <link>https://medium.com/@thutaminthway.dev?source=rss-2b2ac3770b76------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:12:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thutaminthway.dev/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[Openedx Open Source အတွေ့ကြုံ]]></title>
            <link>https://medium.com/@thutaminthway.dev/openedx-open-source-%E1%80%A1%E1%80%90%E1%80%BD%E1%80%B1%E1%80%B7%E1%80%80%E1%80%BC%E1%80%AF%E1%80%B6-48eb9a12eea7?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/48eb9a12eea7</guid>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Thu, 22 May 2025 15:22:51 GMT</pubDate>
            <atom:updated>2025-05-22T15:22:51.099Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EC-DrwsptVF1CBidHEfTeA.png" /></figure><p>Content</p><p># Introduction and what the Tutor is?<br># How the Tutor Work?<br># How to customize UI?<br># Micro Frontend Technology (MFE)<br># Conclusion</p><h4># Introduction and what the Tutor is?</h4><p>Learning Management System (LMS) ကို လုပ်မယ်ဆိုတော့ Moodle ကို မသုံးပဲ EDX Open Source ကို ဘော်ဒါ တစ်သိုက် နဲ့ စလုပ်ကြတယ်။</p><p>EDX မှာ edx-platform ဆိုတဲ့ Django သုံးပြီး ရေးထားတဲ့ Core System ရှိတယ် (<a href="https://github.com/openedx/edx-platform">https://github.com/openedx/edx-platform</a>)။ Project မှာ သုံးထားတဲ့ API Endpoints တွေ သုံးထားတဲ့ variables တွေကို ရေးထားတယ်ပေါ့။ ဒါပေမယ့် သူ့ကိုတော့ သွားထိ သွားပြင်လို့တော့ မလွယ်ဘူး။</p><p>အရင်ကတော့ edx က ပေးထားတဲ့ Open Source ဖြစ်တဲ့ DevStack +​ edx-platform ဆိုပြီး တွဲပြီးသုံးကြတယ်။ ဒါပေမယ့် နောက်ပိုင်းကျ DevStack ကို support ဆက်မလုပ်ကြတော့ပဲ Tutor ဆိုပြီး စပြောင်းသုံးလာတယ်။</p><p>Tutor ဆိုတာကတော့ <strong><em>The Fully Docker-based Open edX distribution </em></strong>ကို အသုံးပြုထားတယ်။ Docker ကို အရင် သွင်း / ပြီးရင် စက်ထဲမှာ ဒါမှမဟုတ် server ပေါ်မှာ သူသတ်မှတ်ထားတဲ့ Specification တွေနဲ့ သူပေးထားတဲ့ Command Run ပေးရင် LMS တစ်ခု စပြီး သုံးလို့ရပြီပေါ့။</p><h4># How the Tutor Works?</h4><p>LMS Open Source တွေ အတိုင်း သူလည်းပဲ Theme တွေ သွင်းပြီး အလုပ်လုပ်တယ်။ Tutor နဲ့ သွင်းရင် Default ပါလာတဲ့ Theme ကတော့ tutor-indigo (<a href="https://github.com/overhangio/tutor-indigo">https://github.com/overhangio/tutor-indigo</a>) ဆိုတဲ့ ဟာ။ တစ်ခြား LMS ထပ်စာရင် UI က သပ်သပ်ရပ်ရပ် နဲ့ ပိုလှတယ်လို့မြင်တယ်။ မိမိကိုယ်တိုင်လည်း ဒီ tutor-indigo ကို မှီငြမ်းပြီး ကိုယ်ပိုင် Customize Theme တွေ ရေးလို့ရတယ်။ ဒါပေမယ့် ပြသာနာလေးတွေ ရှိသေးတယ်။</p><h4># How to customize UI?</h4><p>ဒီ Tutor မှာ အပေါ်က ပြောခဲ့တဲ့ Core System ဖြစ်တဲ့ edx-platform ကို သွားထိစရာမလိုတော့အောင် Mounts လုပ်ပြီး ထားထားတယ်။ ပြီးတော့ LMS နဲ့ CMS ဆိုပြီး ကွဲသေးတယ်။</p><p>LMS က ကျောင်းသားတွေ အတွက် ဖြစ်ပြီး CMS ကတော့ Instructor / SuperUser တွေ အတွက် ဆိုပြီးအလုပ်လုပ်တယ်။ ဒါကို Theme ထဲမှာ LMS / CMS ဆိုပြီး File သက်သက်စီနဲ့ Develop လုပ်ရတယ်။ ဒါပေမယ့် ပြင်လို့ရတာက အကန့်သတ်ရှိတယ်။</p><p>Theme တွေကို Develop လုပ်မယ်ဆိုရင် Python ရဲ့ Blade Engine တစ်ခုဖြစ်တဲ့ mako template နဲ့ Django ကို သုံးပြီးရေးရတယ်။ တစ်ခါ ပြင်တိုင်း တစ်ခါ Cache Kill ပေးရတော့ တစ်ခါ တစ်ခါ ပြင်ရတာ အလုပ်ရှုပ်တယ်။ မှတ်ထားရမှာက Customize ပြင်လို့ရတဲ့ Theme က Landing Page ပြင်လို့ရတယ်။ တခြားသော About US တို့ Contact Us တို့ စတဲ့ Static Page တွေလည်း ထပ်ထည့်လို့ရတယ်။ ဒါပေမယ့် Learning Panel တွေ Admin Panel တွေ Login / Register တွေ ဘာမှပြင်လို့ရမှာ မဟုတ်ဘူး။ ဒါဆို တစ်ခြားဟာတွေ customize ချင်ရင် ဘယ်လိုလုပ်ရမလဲဆိုတာ ဆက်ပြောမယ်။</p><h4># Micro Frontend Technology (mfe)</h4><p>Tutor မှာ နောက်ထပ် Default အနေနဲ့ ပါလာတာက <strong>MFE (Micro Frontend)</strong> နည်းပညာသုံးထားတဲ့ plugin တစ်ခုပါလာပါတယ်။ LMS မှာ သုံးထားတဲ့ -</p><ul><li>Login / Register</li><li>Learning Page</li><li>Learner Dashboard</li><li>Header</li><li>Footer အပြင် တစ်ခြားသော page တွေ အကုန်လုံးကို <strong>React.js</strong> သုံးပြီး အပိုင်းပိုင်း Project တွေခွဲကာ သုံးထားပါတယ်။ (<a href="https://github.com/openedx">https://github.com/openedx</a>)</li></ul><p>ဒီမှာ ပြဿနာက ဥပမာ <strong>Login / Register</strong>လေးတစ်ခုကို <strong>Customize</strong> ချင်ရင် -</p><ol><li>အရင်ဆုံး သက်ဆိုင်ရာ Project ကို <strong>Clone</strong> လုပ်ရမယ်</li><li>ပြီးမှ လိုချင်တာ <strong>ပြင်ဆင်ရမယ်</strong></li><li>နောက်ဆုံးမှာ ကိုယ့်ရဲ့ <strong>Theme</strong> မှာ သွားပြီး <strong>Mounts (တွဲ)</strong> ပေးရပါတယ်။</li></ol><p>ဒါကြောင့် ကိုယ်က တစ်ခုခု <strong>Customize</strong> ချင်ရင် အရင်ဆုံး ဘယ် <strong>Project</strong> မှာ ရှိလဲ ရှာရမယ် ပြီးမှ သွားပြင်ရမယ်။ အလုပ်တွေ ရှုပ်တာပေါ့။</p><h4># Conclusion</h4><p>Edx က support လုပ်ထားတဲ့ Feature တွေ UI တွေ က တော်တော်လှတယ် စုံစုံလင်လင်လည်း ပါတယ်။ ဒါပေမယ့် Develop လုပ်တဲ့ အချိန် မှာ Docker ကို Run ပေးထားရတယ်။ Docker run ရင် Images တွေ (mysql / mongo, … ) စတာတွေ အများကြီး Migrate ပေးရတယ်။ ကျွန်တော့် M1 Mac တော့ မခံနိုင်ဘူး Project တစ်ခါ Run ပြီးရင် Customize ကတာတွေက Typescript သုံးထားတဲ့ React Repo တွေဆို စက်က လစ်သွားရော :3။ ပြီးတော့ ကိုယ်ပိုင် customize တာတွေ များရင် ရေရှည် Maintenance Update တွေ လည်း အခက်ခဲတွေ ရှိမယ်လို့မြင်ပါတယ်။</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48eb9a12eea7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fibonacci Sequence and its MATH]]></title>
            <link>https://medium.com/@thutaminthway.dev/fabonacci-sequence-and-its-math-43255be0e555?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/43255be0e555</guid>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 05:46:47 GMT</pubDate>
            <atom:updated>2024-07-14T05:54:15.474Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>History of Fibonacci Sequence</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*loq_a6sFuUuIyF4Hv3e9TQ.jpeg" /></figure><p>သိသာတဲ့ သမိုင်းအရင်းအမြစ်မရှိပေမယ့် 200 BC လောက်ကာလအတွင်းမှာ Sanskrit Language ကို လေ့လာနေတဲ့ အိန္ဒိယ သင်္ချာပညာရှင်တစ်ယောက်က Fibonacci Sequence ကို စတင်ခဲ့တယ်လို့ ဆိုပါတယ်။</p><p>Fibonacci Sequence ကို စတင် လူသိများစေခဲ့သူကတော့ Fibonacci လို့ လူသိများတဲ့ Leonardo of Pisa ဆိုသူပါ။ 1201 ခုနှစ်တွင် “Liber Abaci” (သို့) “The Book of Calculation” ဆိုတဲ့ စာအုပ်ထဲမှာ Fibonacci Sequence ကို စတင်မိတ်ဆက်ခဲ့တယ်။</p><p>သူ့ရဲ့ တွေ့ရှိချက်တွေထဲမှာ လူသိများပြီး စာအုပ်ထဲမှာပါတဲ့ အကြောင်းအရာကတော့ Breeding Pattern of Rabbits ဆိုတာပါ။ ထိုအကြောင်းအရာအတွက်မေးခွန်းကတော့</p><blockquote>How many pairs of rabbits could be produced from a single pair of rabbits in one year?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*vbrmRWXkS6q0EYhZNRE7vg.png" /><figcaption>Problem of Rabbits</figcaption></figure><p>ဆိုကြပါစို့။</p><ul><li>ပထမလမှာ Immature ယုန် အထီးအမ တစ်စုံရှိတယ်။</li><li>ဒုတိယလမှာ အဲ့ဒီ ယုန်အထီးအမ တစ်စုံ Mature ဖြစ်ပြီး Mating Process လုပ်ကြမယ်။ ဒီအချိန်မှာ သူတို့ဟာ Mating Process လုပ်ရုံပဲ ရှိပြီးတော့ တစ်စုံပဲ ရှိနေသေးတယ်။</li><li>တတိယလမှာ ပထမ ယုန်အထီးအမ တစ်စုံက နောက်ထပ် တစ်စုံ ထပ်မွေးမယ်။ ဒါကြောင့် သူတို့ဟာ (2 Pairs) ဖြစ်သွားပြီ။ ဒီလိုနဲ့ သူတို့နှစ်စုံလုံး Mating Process ထပ်လုပ်ပြီး Doe (မယုန်) တစ်ကောင်က Gestation (ကိုယ်ဝန်ဆောင်မှု) လုပ်မယ်။</li><li>စတုတ္ထလ မှာတော့ Gestation လုပ်ထားတဲ့ မူလ ယုန်အထီးအမ တစ်စုံက ထပ်မွေးတယ်။ အဲ့ဒီတစ်ချိန်မှာ တတိယလကမွေးလာတဲ့ Immature တစ်စုံက Mature ဖြစ်လာတယ်။ ဒါဆို (3 Pairs) ဖြစ်သွားပြီ။</li></ul><p><a href="https://web.as.miami.edu/hare/scary.html#:~:text=Rabbit%20gestation%20lasts%2028%2D31,constantly%20with%20a%20male%20rabbit.">(The Amazing (and scary) Reproductive Potential of Rabbits)</a></p><p>ဒါဆို သင်္ချာနည်းအရဆိုရင်တော့ <strong><em>f(n) = f(n-1) + f(n-2) </em></strong>ပေါ့။ သူ့ရဲ့ Sequence က</p><blockquote>0,1,1,2,3,5,8,13,…</blockquote><p>Pattern ကတော့ ရှင်းပါတယ်။ ဂဏန်းတစ်ခုကိုလိုချင်ရင် သူ့အရှေ့က ကိန်းဂဏန်း၂ခုကို ပေါင်းလိုက်ရုံပါပဲ။ ဆိုလိုတာက</p><p>Example ( 1 )</p><blockquote>f(5) = f(5–1) + f(5–2)</blockquote><blockquote>f(5) = f(4) + f(3)</blockquote><blockquote>3 = 2 + 1</blockquote><p>Example ( 2 )</p><blockquote>f(8) = f(8–1) + f(8–2)</blockquote><blockquote>f(8) = f(7) + f(6)</blockquote><blockquote>13 = 8 + 5(ဒီလိုပုံစံပါ)</blockquote><h4>Fibonacci Sequence In Nature</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzLBm6734m4Fu-ZChAYKvQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8_iqZO25Ha6bi8N_IUMaw.png" /><figcaption>Fibonacci in nature</figcaption></figure><p>သဘာဝတရားကြီးမှာလည်း Fibonacci Sequence တွေက ရှိနေပါတယ်။ ဥပမာ ပန်းပွင့်တွေ ၊ လူ့ရဲ့အရိုးအဆစ်တွေ၊ ခရုခွံ ၊ ဒါ့အပြင် Galaxy ကြီးသည်လည်း အပါအဝင်ဖြစ်တာ တွေ့ရပါတယ်။</p><h4>Golden Ratio</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*NM1Pr_5x_EPdS9AWPkHcVw.png" /></figure><p>Golden Ratio တစ်နည်းအားဖြင့် the golden number, golden proportion, or the divine proportion လို့လည်း လူသိများတဲ့ Ratio က လည်း Fibonacci နဲ့ Strongly Related ဖြစ်ပါတယ်။ ဒီ Article မှာ တော့ Golden Ratio ကို အကျယ်တပွင့် မပြောတော့ပါဘူး။ ဒါပေမယ့် Fibonacci Sequence ကို သုံးပြီး တွက်ကြည့်လို့ရပါတယ်။ Formula ကတော့ ဒီလိုပါ။</p><blockquote>1,1,2,3,5,8,13, (sequence)</blockquote><blockquote>golden ratio f(n) = (f(n-1) + f(n-2))/f(n-1)</blockquote><blockquote>f(5) = (f(4) + f(3)) / f(4))</blockquote><blockquote>= (3 + 2) / 3</blockquote><blockquote>= 5 / 3</blockquote><blockquote>= 1.666666 ( approximately 1.618 )</blockquote><p>Reference : <a href="https://www.adobe.com/th_en/creativecloud/design/discover/golden-ratio.html#:~:text=The%20golden%20ratio%2C%20also%20known,is%20added%20to%20the%20last.">Golden Ratio Article</a></p><h4>Fibonacci Sequence in CODE</h4><p>Fibonacci Sequence ကို Recursion သုံးပြီး အသုံးချကြည့်ရအောင်။</p><pre><br>function fibonacci(n) { <br>    //base case<br>    if (n &lt;= 1) { <br>        return n; <br>    } <br>    return fibonacci(n - 1) + fibonacci(n - 2); <br>} </pre><p>ဒီလောက်ဆို Fibonacci Sequence ဆိုတာကို အကြမ်းဖြင်း နားလည် သဘောပေါက်မယ်လို ထင်ပါတယ်။</p><p>Author : Thuta Min Thway ( July 14, 2024)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43255be0e555" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stability In Sorting]]></title>
            <link>https://medium.com/@thutaminthway.dev/stability-in-sorting-23f7fd450b59?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/23f7fd450b59</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[sorting]]></category>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 16:44:36 GMT</pubDate>
            <atom:updated>2024-07-07T16:44:36.151Z</atom:updated>
            <content:encoded><![CDATA[<p>Computer Science မှာ Sorting Algorithm တွေ (Bubble Sort, Merge Sort, Quick Sort စသဖြင့်) အမျိုးမျိုးရှိပြီး၊ သူတို့ရဲ့လုပ်ဆောင်ချက်တွေကတော့ မတူညီပါဘူး။ ဒီဆောင်းပါးမှာတော့ Sorting Algorithm အမျိုးအစားတွေကို မပြောပြပဲ၊ Stability in Sortingဆိုတာဘာလဲဆိုတာကို ပိုမိုနားလည်လွယ်အောင် ရှင်းပြသွားပါမယ်။</p><h4>Sorting</h4><p>Sorting ဆိုတာ မြန်မာလို အဓိပ္ပာယ်ပြန်ရင်တော့ အစီအရီဖြစ်အောင် စီတာပေါ့။ လက်တွေ့ဘဝမှာလည်း ကျွန်တော်တို့ အမျိုးမျိုး အဖုံဖုံ သုံးကြရပါတယ်။</p><p>ဥပမာ ဆိုရင်</p><ol><li><strong>စာကြည့်တိုက်မှာ </strong>စာအုပ်တွေကို သုတစာအုပ်၊ ရသစာအုပ် စသဖြင့် ခေါင်းစဉ်အလိုက် ခွဲခြားပြီး စီသွားတာက Sorting ဖြစ်ပါတယ်။ ဒါ့ကြောင့် ဘယ်စာအုပ်ကိုရှာမလဲ ဆိုတာ သိရလွယ်ကူပါတယ်။</li><li><strong>စာမေးပွဲရမှတ်စာရင်းမှာ </strong>ဂုဏ်ထူးအမှတ်ကနေ ကျရှုံးအမှတ်အထိ အမှတ်အလိုက် စီထားတာက Sorting ပဲ ဖြစ်ပါတယ်။ ဒါမှမဟုတ်လဲ နာမည်ပေါ်မူတည်ပြီး A — Z အစီအစဉ်အတိုင်း စီထားတာကလည်း နာမည်အလိုက် ရှာရလွယ်ကူစေမှာပါ။</li></ol><h4>Sorting Terminology …</h4><p>Sorting Algorithm တွေထဲမှာ Internal Sorting, External Sorting, In-place Sorting Algorithm ဆိုတဲ့ အမျိုးအစားတွေရှိသလို Stability ဆိုတဲ့ Stable Sorting နဲ့ Unstable Sorting ဆိုတဲ့ အမျိုးအစားတွေလည်း ရှိပါတယ်။</p><p>ဒီ Article မှာတော့ Stability အကြောင်းကိုပဲ ပြောပါမယ်။ Stable Sorting နဲ့ Unstable Sorting ဆိုတာ ဘာလဲ၊ ဘယ်လိုကွာခြားလဲ ဆိုတာကို ရှင်းပြသွားပါမယ်။</p><h4>Stable Sorting</h4><p>ကျွန်တော်တို့ Algorithm အကြောင်းလေ့လာကြတဲ့ အခါမှာ ဘယ် Algorithm က stable ( Yes ) တို့ ဒီ Algorithm က stable ( No ) တို့ ဒီလိုမျိုးတွေ့ရပါတယ်။ ဥပမာ Bubble Sort ဆို Stable ( Yes ) ဆိုပြီးပေါ့။</p><blockquote>A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in sorted output as they appear in the input data set</blockquote><p>Stable Sort ဆိုတာက Element သို့မဟုတ် Array တစ်ခုထဲမှာ Value တူတဲ့ Item တွေ Sorting လုပ်ပြီးတဲ့အခါ မူလ sequence အတိုင်း သက်ဆိုင်ရာ value တွေကို ထားပေးတဲ့ algorithm ပါပဲ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*ZuP38CfWPk4ey-VUSSvJLg.png" /><figcaption>Unsorted Numbers</figcaption></figure><p>ပုံကို တစ်ချက်ကြည့်ကြည့်ပါ။ ကျွန်တော်တို့က Ascending Order စီချင်တယ်။ ဆိုလိုတာက 1 → 5 ပေါ့။ ဒါပေမယ့် Value တူတဲ့ <strong>No(2)</strong> က အစိမ်းနဲ့ အနီ ဆိုပြီး 2 ခု ဖြစ်နေတာ တွေ့ရမယ်။ ကျွန်တော်တို့ အစဥ်လိုက်ဖြစ်အောင် စီကြည့်ရအောင်။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*92xv4JT3xVZcMhQjLv8ZYg.png" /><figcaption>Stable Sorting</figcaption></figure><p>Sorting က value တွေ တူနေရင် မူလနဲ့အတိုင်း ရှိနေမယ်ဆိုတဲ့ property ရှိရင် Stable Sort လို့ခေါ်ပါတယ်။ ပုံမှာဆိုရင် No2 (အစိမ်း) နဲ့ No2 (အနီ) ကနေရာ မပြောင်းဘဲရှိနေတဲ့အတွက် Stable Sort လို့သတ်မှတ်နိုင်ပါတယ်။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMcaPAHCnGcS2a5H1aQTQw.png" /><figcaption>Another Example Of Stable Sorting</figcaption></figure><h4>Unstable Sorting</h4><p>Unstable Sorting ကတော့ ပြောင်းပြန်ပေါ့။ Numbers တွေကို Ascending Order အလိုက်ပဲ စီမှာပေမယ့် ပထမတစ်ခါ Sort တာနဲ့ ဒုတိယတစ်ခါ Sort တာ တူချင်မှ တူမယ် ဆိုတဲ့ သဘောပါ။</p><blockquote>Unstable sorting algorithm can be defined as sorting algorithm in which the order of objects with the same values in the sorted array are not guaranteed to be the same as in the input array.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*wFcxoDQXL-jglRIrayN5LQ.png" /><figcaption>Unstable Sorting</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-YVDY0oa6p4cjEDpNnSug.png" /><figcaption>Another Example Of Unstable Sorting</figcaption></figure><h4>Where can we use? What are the pros and cons?</h4><p>Stable Sorting ကိုတော့ Grading Systems, Online Shopping, Task Scheduling တွေမှာသုံးကြပြီး Unstable Sorting ကိုတော့ Casino Games တွေ, Image Processing လုပ်ငန်းတွေမှာသုံးကြပါတယ်။</p><p>ဘယ် Sorting က ပိုမြန်တယ် ပိုကောင်းတယ်လို့ ပြောလို့တော့လည်း မရသေးပါဘူး။Stable Sorting ဟာ Predictability, Consistency, Data Handling စတာတွေမှာ Unstable Sorting ထက်ပိုပြီးအသုံးဝင်ပေမယ့် Data Set အများကြီးကို မြန်မြန်ဆန်ဆန် Handle ရမယ်ဆိုရင်တော့ Unstable Sorting ဟာ Stable Sorting ထက်ပိုမြန်ပြီးထိရောက်ပါတယ်။</p><p>Author : Thuta Min Thway ( 7 July, 2024 )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23f7fd450b59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compilation & Interpretation In Software Engineering…]]></title>
            <link>https://medium.com/@thutaminthway.dev/compilation-interpretation-in-software-engineering-80da9142c1a1?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/80da9142c1a1</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 10:22:12 GMT</pubDate>
            <atom:updated>2024-06-26T16:01:07.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyjzihKYJNErgPmTFKEpKA.png" /></figure><p>Developers တွေနဲ့ Computer ကြား ဆက်သွယ်နိုင်စေဖို့ Programming Language ကို သုံးတယ်။ Developers တွေက လူသားတွေ နားလည်နိုင်တဲ့ High-Level Language တွေ သုံးပြီး ကုဒ်ရေးကြတယ်။ ဒါပေမယ့် Computer Processors က အဲ့ဒီလိုဘာသာစကားကို နားမလည်နိုင်ဘူး။ ဒါကြောင့် Computer နားလည်တဲ့ Binary စနစ် (Machine Code) အဖြစ် ပြောင်းဖို့ Compiler နဲ့ Interpreter ဆိုတဲ့ Translators တွေကို သုံးရတယ်။</p><p><strong>ဒါဆို Compiler နဲ့ Interpreter ဆိုတာ ဘာတွေလဲ?​</strong></p><p>Compiler နဲ့ Interpreter ဆိုတာက ကျွန်တော်တို့ Programming Language ကို သုံးပြီး ရေးလိုက်တဲ့ code (Source Code) တွေကို Computer နားလည်တဲ့ Machine code or Byte code ကြားထဲက Translation လုပ်ပေးတဲ့ လုပ်ဆောင်ချက်တွေပါ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pT2vROx3MQPQJ2M2ccnyvA.png" /></figure><h4>Compiler as translator ?</h4><p>ကျွန်တော့်မှာ မြန်မာဘာသာနဲ့ ရေးထားတဲ့ စာအုပ်တစ်အုပ်ရှိတယ်ဆိုပါစို့။ အဲဒီစာအုပ်ကို ကျွန်တော်က UK က သူငယ်ချင်းအတွက် အင်္ဂလိပ် ဘာသာပြန်ပြီး လက်ဆောင်ပေးချင်တယ်။ ဒီနေရာမှာ Compiler လုပ်ပုံကနေ ပြန်ရွေးပေးလိုက်မယ်။</p><ol><li>မြန်မာဘာသာနဲ့ ရေးထားတဲ့ စာအုပ် (Source code)</li><li>မြန်မာဘာသာမှ အင်္ဂလိပ်ဘာသာ ပြန်ဆိုခြင်း (Compilation Process)</li><li>အင်္ဂလိပ်ဘာသာပြန်ပြီးစာအုပ် (Translated Book / Machine Code)</li></ol><p>( Translation process ) စာအုပ်တစ်အုပ်လုံး ဘာသာပြန်ပြီးမှ လက်ဆောင်ပေးလိုက်တယ်။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UIMSqERgKxrN5rft3vURmA.png" /></figure><h4>Interpreter as translator ?</h4><p>Interpreter ကိုတော့ တိုက်ရိုက်စကားပြန်ပေးတဲ့ သူလို့ မြင်ကြည့်လို့ရပါတယ်။ ကျွန်တော်က ပြောလိုက်သမျှစကားတစ်ခွန်းချင်းစီတိုင်းကို တစ်ဖက်ကို တိုက်ရိုက်ဘာသာပြန်ပေးတာပါ။</p><p>ဒီတော့ ပြန်ဆက်ရရင် Compiler က developer ရေးလိုက်တဲ့ Program source code တွေကို Language Analysis လုပ်ပြီး မှန်ရင် Compile လုပ်မယ်။ ပြီးရင် Machine Code ကိုပြောင်းမယ်။ Interpreter က ကျတော့ ရေးလိုက်တဲ့ Code statement တစ်ခုချင်းစီတိုင်းကို ဆက်တိုက် Translate လုပ်ပေးနေမယ်။</p><h4>Pros and Cons ?</h4><p><strong>Compiler အနေနဲ့ကြည့်ရင်</strong></p><p>Source code &gt;&gt; Compilation &gt;&gt; Machine Code &gt;&gt; Output</p><p>ဖြစ်တဲ့အတွက် Machine Code ပြောင်းဖို့ကို Compile လုပ်တဲ့အချိန် (Compilation time) က ကြာနိုင်ပါတယ်။ ဒါပေမဲ့ Machine Code ကို ပြောင်းပြီးတဲ့အခါမှာ Execution လုပ်တဲ့ အပိုင်းက အရမ်းမြန်ပါတယ်။ ဘာလို့လဲဆိုတော့ Source Code ကိုယူပြီး Execution မလုပ်ဘဲ Machine Code ကိုပဲ Execution လုပ်လို့ပါ။</p><p>ဒီလို Machine Code ကိုပဲယူတဲ့ အတွက်ကြောင့် Source code ကို Share ပေးစရာမလိုဘဲ Private ဖြစ်ပါတယ်။</p><p>— — — — — — —</p><p><strong>Interpreter အနေနဲ့ ကြည့်ရင်</strong></p><p>Source code &gt;&gt; Compilation &gt;&gt; Output</p><p>ဖြစ်တဲ့အတွက် Machine Code ပြောင်းဖို့မလိုဘဲ၊ ရေးထားတဲ့ code တွေကို တစ်ကြောင်းချင်းစီ Interpret လုပ်နေမှာဖြစ်လို့ Interpretation Time က အတော်မြန်ပါတယ်။ တစ်ကြောင်းချင်းစီဖြစ်တဲ့အတွက် Developer က Debugging အလုပ်ရတဲ့အခါမှာ အတော်အဆင်ပြေပါတယ်။ ဒါပေမယ့် Compiler နဲ့ယှဉ်ရင် Line by Line လုပ်နေရတာဖြစ်တဲ့အတွက် Execution Time မှာတော့ နှေးပါတယ်။</p><p>C / C++ / Go / Java / Rust စတဲ့ Languages တွေက များသောအားဖြင့် Compiled Languages ဖြစ်ပြီး၊ Javascript / PHP / Python စတဲ့ Languages တွေကတော့ Interpreter တွေနဲ့အလုပ်လုပ်ပါတယ်။ ဒါပေမယ့် Java တို့ Python တို့လို Language တွေကတော့ Performance အရ Compilation နဲ့ Interpretation နှစ်မျိုးလုံးကို တွဲဖက်ပြီး အလုပ်လုပ်တာမျိုးလည်း ရှိပါတယ်။</p><p>ဒါကတော့ Software Engineering ရဲ့ အရေးကြီးတဲ့ Compiler နဲ့ Interpreter ကို နားလည်ရလွယ်အောင် ရှင်းပြပေးထားတာ ဖြစ်ပါတယ်။ အမှားများ ပါနိုင်တာကြောင့် Comment box မှာ ဆွေးနွေးသွားလို့ရပါတယ်။</p><p>Author : Thuta Min Thway ( 26 June, 2024 )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80da9142c1a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BigO (Big Oh) Notation]]></title>
            <link>https://medium.com/@thutaminthway.dev/bigo-big-oh-notation-60aa5f722c6d?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/60aa5f722c6d</guid>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 10:30:10 GMT</pubDate>
            <atom:updated>2024-06-23T10:30:10.307Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5XsUPI7XkVtiYByo5e2ew.png" /></figure><p>သာမန်တွေးကြည့်ရင် ကျွန်တော်တို့အသုံးပြုနေတဲ့ device တွေရဲ့ specification ပေါ်မူတည်ပြီး ဘယ်ဟာက မြန်တယ်၊ မမြန်ဘူး စမ်းကြည့်လို့ရနိုင်ပါတယ်။ ဒါပေမဲ့လည်း algorithm တစ်ခုကိုတိုင်းတာဖို့ ဒီလိုစမ်းကြည့်လို့မရသေးပါဘူး။</p><p>BigO Notation (Big Oh Notation) ဆိုတာ input size ဘယ်လောက်ရှိသလဲပေါ်မူတည်ပြီး algorithm ရဲ့ complexity ကို တိုင်းတာတာပါ။ Complexity မှာ အဓိကအားဖြင့် time နဲ့ space complexity ဆိုပြီး ၂မျိုးရှိတယ်။</p><h4>Space Complexity</h4><p>ပြသာနာ တစ်ခုကိုရှင်းဖို့ algorithm / program ကိုသုံးရင် memory ဘယ်လောက်ယူလဲကို ဆိုလိုတာပါ။</p><h4>Time Complexity</h4><p>Algorithm ရဲ့ run-time ဘယ်လောက်ရှိသလဲကို တွက်တာ။</p><p>BigO ကို တွက်တဲ့နေရာမှာ common complexities တွေ ရှိတယ်။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5XsUPI7XkVtiYByo5e2ew.png" /></figure><ol><li><strong>Constant | O(1)</strong> — Excellent/Best (constant time တစ်ကြိမ်ပဲလုပ်ရတဲ့အတွက် input size ဘယ်လောက်ရှိလည်း တွက်ရမယ့် calculation က အရေးမကြီးတော့ဘူး)</li><li><strong>Logarithm | O(log n)</strong> — Good (Calculation ကို တစ်ဝက်စီပိုင်းပိုင်းပြီးလုပ်ဆောင်ရတာ)</li><li><strong>Linear | O(n)</strong> — Fair (Algorithm တစ်ခုကို single loop လုပ်ပြီး linear time နဲ့ရှာရတာ)</li><li><strong>O(n log n)</strong> — Bad (log linear complexity | binary sorting algorithm တွေမှာသုံးမယ်)</li><li><strong>O(n²)</strong>, <strong>O(2^n)</strong> and <strong>O(n!)</strong> — Horrible/Worst (Quadratic , Exponential time complexity ဖြစ်ပြီး loop after loop လုပ်တယ်)</li></ol><blockquote><strong><em>O(1) — Constant</em></strong></blockquote><p>Constant time တစ်ကြိမ်ပဲလုပ်ရတဲ့အတွက် algorithm တစ်ခုကို တွက်တဲ့နေရာမှာ input size က အရေးမကြီးတော့ပါဘူး။ ဥပမာပေးရရင် array တစ်ခုရှိတယ်။ Array ထဲမှာ element တွေအများကြီးရှိတယ်။ ဒါပေမယ့် ပထမဆုံး element ကိုလိုချင်တယ်ဆိုရင်…</p><pre>const names = [&#39;thuta&#39;, &#39;john&#39;, &#39;christ&#39;, &#39;tony&#39; ...]<br><br>console.log(names[0]) // get first element &quot;thuta&quot;</pre><blockquote><strong><em>O(log n) — Logarithm</em></strong></blockquote><p>Logarithm time | O(log n) သည်လည်းပဲ run-time မှာ input size ဘယ်လောက်ဖြစ်ဖြစ် depend မဖြစ်ပေမယ့် input size တစ်ဝက်ကိုတော့ depend ဖြစ်မှာပါ။ ဆိုလိုချင်တာက complexity တွက်တဲ့ step တစ်ဆင့်ချင်းစီမှာ input size က တစ်ဝက်စီ လျော့ကြသွားမှာဖြစ်တယ်။ ဥပမာပေးရရင် binary search ပါ။ Binary search အလုပ်လုပ်ပုံက sorting လုပ်ထားပြီးသား array တစ်ခုရှိမယ်။ Array ထဲမှာ ကိုယ်လိုချင်တဲ့ value ကိုရှာမယ်ဆိုရင် array length ကို တစ်ဝက်အရင်ပိုင်း။ ပြီးရင် ဆက်ရှာ။ ဒီလိုနဲ့ လိုချင်တဲ့ target ရောက်အောင်ထိသွားရမှာပါ။</p><pre>numbers = [1,2,3,4,5,6,7,8,9] // target value is 2<br>  first = 1<br>   last = 9<br>    mid = (first + last) / 2<br>        = (1 + 9) / 2 <br>        = 5</pre><p>ဒီနေရာမှာ အလယ်ဖြစ်တဲ့နေရာက 5 ။ လိုချင်တဲ့ value က 2။ ဒီတော့ sorting array ဖြစ်တဲ့အတွက် လိုချင်တဲ့ value နေရာကို ခန့်မှန်းလို့ရတာပေါ့။ ဒီတော့ ၅ ကနေစပြီး ညာဘက်က element တွေမဖြစ်နိုင်တော့ဘူးဆိုတော့ array ဆက်တွက်မယ်။</p><pre><br>numbers = [1,2,3,4] // target value is 2<br>  first = 1<br>   last = 4<br>    mid = (first + last) / 2<br>        = (1 + 4) / 2 <br>        = 5 / 2 = 2 // target has reached</pre><p>ဒါဆိုရင် လိုချင်တဲ့အဖြေရဖို့ ၂ဆင့်ပဲ တွက်စရာလိုတယ်။</p><blockquote><strong><em>O(n) — Linear</em></strong></blockquote><p>Linearly သွားတာဖြစ်တဲ့အတွက် input size များလေလေ algorithm run-time များလာလေလေ။</p><p>ဥပမာပေးရရင် array တစ်ခုရှိတယ်။ element 1 ကနေ 10 ထိရှိတယ်။</p><pre>const array = [1,2,3,4,5,6,7,8,9,10] <br><br>for (let i = 0; i &lt;= array.length; i ++) {<br>    console.log(&#39;Hello world&#39;) // output will be 11 times of &quot;Hello World&quot;<br>}</pre><p>ဒီတော့ ကိုယ်ပေးလိုက်တဲ့ n times အလိုက် အလုပ်လုပ်မယ်။ နောက် example ကြည့်ရအောင်</p><pre>const calcFactorial = (n) =&gt; {<br>  let factorial = 1;<br>  for (let i = 2; i &lt;= n; i++) {<br>    factorial = factorial * i;<br>  }<br>  return factorial;<br>};<br><br>console.log(calcFactorial(5)); // 120</pre><p>5 * 4 * 3 * 2 * 1 = 120 ။ ဆိုတော့ ကျွန်တော်က calcFactorial မှာ input 10 ပေးရင်လည်း</p><p>10 * 9 * 8 * … ဒီလို linearly ဆက်သွားလိမ့်မယ်။</p><blockquote><strong><em>O(n²) — Quadratic</em></strong></blockquote><p>ကျွန်တော်တို့မှာ locker 5 ခုရှိတယ်။ သော့ ၅ ခုရှိတယ်။ ကျွန်တော်လိုချင်တဲ့ ပစ္စည်းက locker 5 ခုထဲက တစ်ခုမှာထည့်ထားတယ်။ ဒါပေမယ့် ကျွန်တော်က ပစ္စည်းရှိတဲ့နေရာလည်းမသိဘူး။ ဘယ်သော့နဲ့ ဘယ် locker နဲ့ match ဖြစ်လည်းဆိုတာလဲ မသိပြန်ဘူး။ ဆိုတော့ ကျွန်တော်က သော့၅ခုနဲ့ locker ၅ ခုကိုဖွင့်ရပါတော့မယ်။ ဒီလိုဆို 5 * 5 (5²) ပေါ့။</p><p>ဆိုလိုချင်တာက quadratic မှာ input size ထည့်ပြီး လိုချင်တဲ့ targeted value ရဖို့ loop 2 ခါပတ်ရတယ် (n times n) ဒါကြောင့်ဒီအခြေအနေက worst ဖြစ်နေရတာ။ Sample code ကြည့်မယ်ဆိုရင် pair ရှာတဲ့ example မျိုး။</p><pre>function processPairs(array) {<br>  const n = array.length;<br><br>  for (let i = 0; i &lt; n; i++) {<br>    for (let j = 0; j &lt; n; j++) {<br>      const pair = [array[i], array[j]];<br>      console.log(&quot;Processing pair:&quot;, pair);<br>    }<br>  }<br>}<br><br>const exampleArray = [1, 2, 3, 4];<br>console.log(&quot;Input array:&quot;, exampleArray);<br><br>processPairs(exampleArray); <br><br>//output<br><br>[ 1 , 2 , 3 , 4 ]<br><br>[ 1 , 1 ] , [ 1 , 2 ], [ 1 , 3 ], [ 1 , 4 ]<br><br>[ 2 , 1 ] , [ 2 , 2 ], [ 2 , 3 ], [ 2 , 4 ]<br><br>[ 3 , 1 ] , [ 3 , 2 ], [ 3 , 3 ], [ 3 , 4 ]<br><br>[ 4 , 1 ] , [ 4 , 2 ], [ 4 , 3 ], [ 4 , 4 ]</pre><blockquote><strong><em>O(2^n) — Exponential</em></strong></blockquote><p>Exponential time complexity ဆိုတာ input size တိုးသလောက် algorithm ရဲ့ run-time ကလည်း exponential ratio နဲ့ တိုးပွားတာ ဖြစ်တယ်။ ဒီလိုကိစ္စတွေမှာ loop တစ်ခုပြီးတစ်ခု nested လုပ်ထားရုံတင်မကပဲ recursive algorithm တွေမှာ တွေ့ရတတ်တယ်။</p><p>ဥပမာ binary decision tree တစ်ခုကို traverse လုပ်တာမျိုး၊ အောက်ပါ function မှာ recursive call တွေတွေ့ရမှာ ဖြစ်တယ်။ ဒီမှာ n က 2 ဖြစ်တဲ့အခါ base case ကိုရောက်ဖို့ 2² = 4 times ခေါ်ရမယ်၊ n က 3 ဖြစ်ရင် 2³ = 8 times ခေါ်ရမယ်။</p><pre>function fibonacci(n) {<br>    if (n &lt;= 1) return n;<br>    return fibonacci(n - 1) + fibonacci(n - 2);<br>}<br><br>console.log(fibonacci(5)); // Output: 5</pre><blockquote><strong><em>O(n!) — Factorial</em></strong></blockquote><p>Factorial time complexity ကတော့ input size n ရဲ့ factorial value နဲ့ညီတဲ့ run-time ဖြစ်တယ်။ ဒီအခြေအနေမှာ run-time က အရမ်းမြင့်တက်တတ်တာကြောင့် practical ဖြစ်လို့အသုံးချဖို့အရမ်းခက်ပါတယ်။</p><p>ဥပမာ၊ permutation တွေကို generate လုပ်တဲ့ algorithm တစ်ခုမှာ ကြည့်မယ်ဆိုရင် input size n ရဲ့ permutations အားလုံးကို generate လုပ်ဖို့ n! operations လိုအပ်ပါတယ်။</p><pre>function generatePermutations(array) {<br>    const results = [];<br>    <br>    function permute(arr, memo = []) {<br>        let cur, memoArr;<br>        for (let i = 0; i &lt; arr.length; i++) {<br>            cur = arr.splice(i, 1);<br>            if (arr.length === 0) {<br>                results.push(memo.concat(cur));<br>            }<br>            permute(arr.slice(), memo.concat(cur));<br>            arr.splice(i, 0, cur[0]);<br>        }<br>        return results;<br>    }<br><br>    return permute(array);<br>}<br><br>console.log(generatePermutations([1, 2, 3])); <br>// Output: All permutations of [1, 2, 3]</pre><p>ဒီတော့ BigO Notation ဟာ input size ကြီးသွားလို့ algorithm ရဲ့ efficiency ဘယ်လိုပြောင်းလဲသလဲဆိုတာကိုရှင်းပြတယ်။ Run-time က input size ပေါ်မူတည်ပြီး ဘယ်လိုသက်ရောက်မှုရှိလဲဆိုတာနားလည်ဖို့ BigO ကိုသုံးတယ်။</p><p>Author : Thuta Min Thway ( 23 Jun, 2024 )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60aa5f722c6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asymptotic Analysis]]></title>
            <link>https://medium.com/@thutaminthway.dev/asymptotic-analysis-c73f0e232df9?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/c73f0e232df9</guid>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Sat, 22 Jun 2024 17:02:18 GMT</pubDate>
            <atom:updated>2024-06-22T17:06:36.577Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xunilGniC1-xgrQP4V6MQA.png" /></figure><p>Algorithm analysis ဆိုတာက စိတ်ဝင်စားစရာကောင်းတဲ့ အရာပါပဲ။ အဓိကအားဖြင့် Algorithm ရဲ့ ရှုပ်ထွေးမှုကို သင်္ချာဆိုင်ရာ နည်းလမ်းတွေနဲ့ တိုင်းတာတယ်။ အထူးသဖြင့် input size ကြီးလာလေ Performance ကလည်း တစ်ခုနဲ့ တစ်ခု မတူနိုင်တော့ပါဘူး။ ဒါကြောင့် အဲ့ဒီ performance များကို နားလည်ဖို့နဲ့ တွက်ချက်ဖို့အတွက် Asymptotic Notations လို့ခေါ်တဲ့ အထောက်အထားတွေကို အသုံးပြုတယ်။</p><p><strong>Asymptotic Notations</strong></p><p>အပေါ်မှာ ပြောပြခဲ့တဲ့ အတိုင်း Asymptotic Notations က Algorithm တစ်ခုရဲ့ Input size ကြီးလာတာနဲ့ အမျှ သူ့ရဲ့ Complexity ဘယ်လောက် မြင့်တယ်၊ နိမ့်တယ်ဆိုတာကို ဖော်ပြတယ်။ Algorithm တစ်ခုမှာ Best case, Worst case, Average case ဆိုတဲ့ အခြေအနေ သုံးမျိုး ရှိနိုင်တယ်။</p><ul><li><strong>Best case scenario</strong>: Algorithm ရဲ့ အမြန်ဆုံး အလုပ်ဖြစ်တတ်တဲ့ အခြေအနေ</li><li><strong>Worst case scenario</strong>: Algorithm ရဲ့ အနှေးဆုံး အလုပ်ဖြစ်တတ်တဲ့ အခြေအနေ</li><li><strong>Average case scenario</strong>: Algorithm ရဲ့ အလယ်အလတ် အလုပ်ဖြစ်တတ်တဲ့ အခြေအနေ</li></ul><p>ဥပမာပေးရမယ်ဆိုရင် Array တစ်ခုရှိတယ်လို့ ပြောကြပါစို့။</p><pre>let array = [1, 2, 3, 4, 5];</pre><p>ဒီ Array ထဲက Element [1] ကို Linear Search နဲ့ ရှာမယ်ဆိုရင် အရမ်းလွယ်ကူတယ်။ ဒီလိုအခြေအနေကို Best case scenario လို့ ခေါ်တယ်။</p><p>Worst case က ရေကူးကန် တစ်ခုမှာ Locker 5 ခု ရှိတယ်။ 5 ခုထဲက တစ်ခုမှာ ကျွန်တော့် ပစ္စည်းတွေ ထည့်ထားပြီးသော့ခတ်ထားတယ်။ ဒါပေမယ့် ကျွန်တော်က ကိုယ့်ရဲ့ သော့ကို မမှတ်မိသလို ဘယ် Locker room ထဲထည့်လိုက်မှန်းလည်း မေ့သွားတယ်ဆိုပါတော့။ ပြီးတော့ တစ်ခြား ကျန်တဲ့ Locker 4 ခုရဲ့ သော့တွေနဲ့ ရောပြီးထားလိုက်မိတယ်။ ဒါဆိုဘယ်လိုလုပ်ကြမလဲ?။</p><p>ကျွန်တော်တို့ locker ၅ ခုကို သော့ ၅ ခုနဲ့ ဖွင့်ရတော့မယ်။ ဒီနေရာမှာ ကိုယ်ပထမဆုံး ရွေးလိုက်တဲ့ သော့နဲ့ ပထမဆုံး ဖွင့်လိုက်တဲ့ Locker room နဲ့ match ဖြစ်ပြီး သော့ပွင့်သွားမယ်။ ကံကကောင်းချင်တော့ ကိုယ့်ပစ္စည်းထည့်ထားတဲ့ နေရာဖြစ်ပြန်တယ်။ ဒါဆို Best case ပေါ့။ ဒါပေမယ့် ဒီလိုမဖြစ်ရင်ကော? နောက်ဆုံး ၅ ခုမြောက်သော့က ၅ ခုမြောက် locker room ကို ပွင့်ပြီး ပစ္စည်းတွေ ရှာတွေ့တယ်ဆိုရင် 5 times 5 ဖြစ်ပြီး Worst case ဖြစ်သွားပြီ။ ၃ ခုမြောက်လောက်မှာ ရှာတွေ့သွားတာလည်း ဖြစ်နိုင်တော့ Average time ပေါ့။ ဒီလို Duration တွေကို တိုင်းတာဖို့အတွက်က mathematical notations တွေကို သုံးရတယ်။</p><p>အဓိကအနေနဲ့ အောက်ပါ Notations သုံးမျိုးရှိတယ်:</p><ol><li><strong>Big O Notation (O)</strong>: Worst case scenario ကို ဖော်ပြတယ်</li><li><strong>Omega Notation (Ω)</strong>: Best case scenario ကို ဖော်ပြတယ်</li><li><strong>Theta Notation (θ)</strong>: Average case scenario ကို ဖော်ပြတယ်</li></ol><p>နောက်အပိုင်းတွေမှာ ဒီ Notations တွေကို အသေးစိတ်ဆွေးနွေးပါအုံးမယ်။</p><p><strong>Author: Thuta Min Thway ( 22 June, 2024 )</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c73f0e232df9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flowcharts ဆိုတာ …]]></title>
            <link>https://medium.com/@thutaminthway.dev/flowcharts-%E1%80%86%E1%80%AD%E1%80%AF%E1%80%90%E1%80%AC-e808ae241af9?source=rss-2b2ac3770b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/e808ae241af9</guid>
            <dc:creator><![CDATA[Thuta Min Thway]]></dc:creator>
            <pubDate>Wed, 19 Jun 2024 09:41:08 GMT</pubDate>
            <atom:updated>2024-06-19T17:47:19.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g87OiqRWgi_-AyBwyxK40g.png" /></figure><h3>Flowcharts ဆိုတာ …</h3><p>ခက်ခဲတဲ့ လုပ်ငန်းတွေကို စလုပ်မယ်ဆိုရင်၊ အာရုံအပြည့်နဲ့ အလုပ်ကို အောင်မြင်အောင် လုပ်ဖို့ လိုတယ်။ အလုပ်လုပ်တဲ့အချိန်မှာလည်း အကုန်မမှတ်မိနိုင်တာမို့ Tools (စာအုပ်၊ Laptop စတဲ့) တွေကို သေချာစီမံဖို့ လိုပါတယ်။ မှတ်သားရာမှာလည်းပဲ Visual Design Techniques တွေ သုံးပြီး မှတ်လို့ရပါတယ်။ ဒီ Article မှာတော့ Flowchart ကို အသုံးပြုပြီး နားလည်လွယ်အောင် ရှင်းပြပေးပါမယ်။</p><ul><li><strong>Flowcharts</strong> ဆိုတာ ဘာလဲ။</li></ul><p>ကျွန်တော့်မှာ အစီအစဉ်တစ်ခုရှိတယ်ဆိုကြပါစို့။ အဲဒီအစီအစဉ်ကတော့ ရုံးက ပြန်ရောက်ပြီးရင် ခနနားမယ်။ ည ၇နာရီထိုးရင် ရေချိုးပြီး ထမင်းစားမယ်။ ပြီးရင် ရုပ်ရှင်ကြည့်မယ်။ ၁၂ နာရီလောက်ဆို အိပ်မယ်ပေါ့။ ဒီနေရာမှာ အိမ်ပြန်ရောက်ရင် ဘာလုပ်မယ်ဆိုတဲ့ လုပ်ငန်းစဥ် (Process) တွေ၊ ရေချိုးမယ်၊ ထမင်းစားမယ်၊ ရုပ်ရှင်ကြည့်မယ်ဆိုတဲ့ အလုပ် (Tasks) တွေ ရှိမယ်။ ဒါတွေကို Flowchart သုံးပြီး ရေးကြည့်ရအောင်။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*q5NBroNoeMIsDStdLPDiXA.png" /></figure><ul><li><strong>Common Flowcharts Symbols</strong></li></ul><p>Flowchart ဆိုတာ သင့်ရဲ့ အလုပ်စဉ်တွေကို ပိုမိုလွယ်ကူပြီး မြင်သာရှင်းလင်းစေဖို့အတွက် ကူညီပေးတဲ့ ပုံစံလမ်းညွှန်ပဲဖြစ်ပါတယ်။ ဒီအတွက် Flowchart သည် သင်္ကေတပုံစံအသီးသီးကို အသုံးပြုပြီး လုပ်ငန်းစဉ်တွေကို ဖော်ပြပေးတဲ့အတွက် သင့်အနေနဲ့ လွယ်ကူစွာနားလည်နိုင်ပါတယ်။ အခု ကျွန်တော်တို့ Flowchart မှာ တွေ့ရတဲ့ သင်္ကေတတွေကို ပြောပြမယ်၊ သူတို့က ဘာကိုဆိုလိုသလဲဆိုတာနဲ့အတူ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*1sMmh4mtMKU-E3-EfCV19Q.png" /><figcaption><strong>အသုံးများသော Symbols များ</strong></figcaption></figure><ul><li><strong>Summary</strong></li></ul><p>Flowchart ဆိုတာ လုပ်ငန်းစဉ်တွေကို တိတိကျကျနားလည်စေဖို့အတွက် အကောင်းဆုံးနည်းလမ်းတစ်ခုပါပဲ။ ပုံစံချထားတဲ့အတိုင်း သွားရင် ရှင်းလင်းစွာနားလည်နိုင်တယ်။ လုပ်ငန်းစဉ်တစ်ခုက ဘယ်လိုလုပ်ဆောင်ရမလဲဆိုတာ နားလည်ဖို့ ပထမဦးဆုံး အရေးကြီးတာက Flowchart ပါပဲ။</p><p>ဒါကြောင့် လုပ်ငန်းစဉ်တွေကို နားလည်စေဖို့ (<strong>Understanding the process</strong>)၊ လေ့လာဖို့ (<strong>To Study</strong>)၊ အခြားသူတွေနဲ့ ပြောပြဖို့ (<strong>Communication</strong>)၊ တူညီတဲ့အလုပ်တွေအတွက် ပိုကောင်းတဲ့ ဆက်သွယ်မှုလိုအပ်တဲ့အခါတွေမှာ၊ မှတ်တမ်းတင်ဖို့နဲ့ စီမံကိန်းတွေစီစဉ်ချိန်မှာ Flowchart ကို အသုံးပြုပြီး အဆင်ပြေစေဖို့ အကြံပေးချင်ပါတယ်။</p><p>Author: Thuta Min Thway ( 19 Jun, 2024)</p><p>References:</p><p>Wladston Ferreira Filho — Computer Science Distilled_ Learn the Art of Solving Computational Problems-Code Energy LLC (2017).pdf</p><p><a href="https://www.lucidchart.com/pages/what-is-a-flowchart-tutorial#:~:text=A%20flowchart%20is%20a%20diagram,easy%2Dto%2Dunderstand%20diagrams">https://www.lucidchart.com/pages/what-is-a-flowchart-tutorial#:~:text=A%20flowchart%20is%20a%20diagram,easy%2Dto%2Dunderstand%20diagrams</a>.</p><p><a href="https://asq.org/quality-resources/flowchart">https://asq.org/quality-resources/flowchart</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e808ae241af9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>