<?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 Moch Lutfi on Medium]]></title>
        <description><![CDATA[Stories by Moch Lutfi on Medium]]></description>
        <link>https://medium.com/@mochlutfi?source=rss-f4d8ad2949e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2SgGGby502mNogryzQOeEA.jpeg</url>
            <title>Stories by Moch Lutfi on Medium</title>
            <link>https://medium.com/@mochlutfi?source=rss-f4d8ad2949e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:23:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mochlutfi/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[Golang Om Telolet Om Server]]></title>
            <link>https://medium.com/@mochlutfi/golang-om-telolet-om-server-5343d8cbf477?source=rss-f4d8ad2949e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5343d8cbf477</guid>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Moch Lutfi]]></dc:creator>
            <pubDate>Mon, 22 Oct 2018 10:06:01 GMT</pubDate>
            <atom:updated>2018-10-22T10:06:01.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>Golang: Om Telolet Om Server</h3><p>Tahun 2016 lalu ramai sekali tentang om telolet om, dan disalah satu website e-commerse di Indonesia menambahkan x-om-telolet-omdi response header. Mungkin banyak yang tidak mengetahuinya, karena hanya tambahan response header dan tidak terlihat di tampilan website.</p><h3><strong>Basic Server</strong></h3><p>Pertanyaannya bagaimana menambahkan respon http header menggunakan golang? Jawabnya tentu bisa dan sangat mudah sekali bahkan tidak perlu menggunakan eksternal pustaka tambahan cukup pustaka standar dari golang.</p><p>Pertama perlu kita buat web server sederhana menggunakan net/httppackage seperti dibawah ini.</p><pre>import (<br> &quot;fmt&quot;<br> &quot;net/http&quot;<br>)</pre><pre>func helloWorldHandler(w http.ResponseWriter, r *http.Request) {<br> fmt.Fprint(w, &quot;Hello World!&quot;)<br>}</pre><pre>func main() {<br> http.HandleFunc(&quot;/&quot;, helloWorldHandler)<br> http.ListenAndServe(&quot;:8080&quot;, nil)<br>}<br>// run dengan perintah `go run main.go`</pre><p>Kita tes menggunakan curlhasilnya seperti di bawah ini masih tanpa ada tambahan om telolet om di header dan <em>response body</em> menampilkan string Hello World!</p><pre>$curl -X HEAD -I localhost:8080<br>HTTP/1.1 200 OK<br>Date: Wed, 03 Jan 2018 02:13:14 GMT<br>Content-Length: 12<br>Content-Type: text/plain; charset=utf-8</pre><pre>$curl localhost:8080<br>Hello World!</pre><p>Cara sederhana menambahkan header x-telolet hanya dengan menambahkan code w.Header().Add(“x-telolet”, “OM telolet OM”) sebelum fmt.Fprint(w, “Hello World!”) sehingga jadi seperti ini.</p><pre>package main</pre><pre>import (<br>    &quot;fmt&quot;<br>    &quot;net/http&quot;<br>)</pre><pre>func helloWorldHandler(w http.ResponseWriter, r *http.Request) {<br>    w.Header().Add(&quot;x-telolet&quot;, &quot;OM telolet OM&quot;)<br>    fmt.Fprint(w, &quot;Hello World!&quot;)<br>}</pre><pre>func main() {<br>    http.HandleFunc(&quot;/&quot;, helloWorldHandler)<br>    http.ListenAndServe(&quot;:8080&quot;, nil)<br>}</pre><p>Jika dicek menggunakan curl hasilnya sudah berubah.</p><pre>$curl -X HEAD -I localhost:8080<br>HTTP/1.1 200 OK<br>X-Telolet: OM telolet OM<br>Date: Wed, 03 Jan 2018 02:18:58 GMT<br>Content-Length: 12<br>Content-Type: text/plain; charset=utf-8</pre><h3><strong>Middleware</strong></h3><p>Kemudian muncul pertanyaan bagaimana jika handlernya banyak tidak hanya HelloWorldHandler saja? Untuk keperluan seperti ini bisa menggunakan middleware. Jadi menjalankan satu atau lebih fungsi tertentu sebelum menjalankan handler utama seperti helloWorldHandler.</p><p>Struktur middleware yang akan kita buat menggunakan func(w http.ResponseWriter, r *http.Request) sebagai tipe data. Jadi passing fungsi kedalam fungsi dan return fungsi lagi. Lebih jelasnya kita lihat code dibawah ini.</p><pre>package main</pre><pre>import (<br>    &quot;fmt&quot;<br>    &quot;net/http&quot;<br>)</pre><pre>// OmTeloletOm middleware<br>func OmTeloletOm(handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) {<br>    return func(w http.ResponseWriter, r *http.Request) {<br>        w.Header().Add(&quot;x-telolet&quot;, &quot;OM telolet OM pake middleware&quot;)<br>        handler(w, r)<br>    }<br>}</pre><pre>func helloWorldHandler(w http.ResponseWriter, r *http.Request) {<br>    fmt.Fprint(w, &quot;Hello World!&quot;)<br>}</pre><pre>func main() {<br>    http.HandleFunc(&quot;/&quot;, OmTeloletOm(helloWorldHandler))<br>    http.ListenAndServe(&quot;:8080&quot;, nil)<br>}</pre><p>Jika kita cek lagi dengan curl hasilnya seperti ini.</p><pre>$curl -X HEAD -I localhost:8080<br>HTTP/1.1 200 OK<br>X-Telolet: OM telolet OM pake middleware<br>Date: Wed, 03 Jan 2018 02:34:48 GMT<br>Content-Length: 12<br>Content-Type: text/plain; charset=utf-8</pre><p>Mudah bukan ternyata menambahkan custom header menggunakan golang?</p><blockquote>Tulisan ini pertama kali dipublikasikan di blog saya <a href="https://lumochift.org/post/golang-om-telolet-om-server/">https://lumochift.org/post/golang-om-telolet-om-server/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5343d8cbf477" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Science for Humanities]]></title>
            <link>https://medium.com/@mochlutfi/computer-science-for-humanities-560db78d62d5?source=rss-f4d8ad2949e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/560db78d62d5</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[teaching-computer-science]]></category>
            <dc:creator><![CDATA[Moch Lutfi]]></dc:creator>
            <pubDate>Tue, 06 Jun 2017 11:36:26 GMT</pubDate>
            <atom:updated>2017-06-06T11:36:26.580Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Computer science is no more about computers than astronomy is about telescopes, biology about microscopes, or chemistry about beakers and test tubes. Science is not about tools. It is about how we use them, and what we find out when we do.</blockquote><blockquote>— — <strong>Michael Fellows and Ian Parberry</strong></blockquote><p>Imagine if today without computer technology, maybe we still doing everything in manual way and paper everywhere without gadget, internet connection, smart device, and many things. We are living in computer era with the new lifestyle and computer is really helpful to human being. But if you hear the computer science degree what are you thinking about at first? At my first semester in college I imagine that I will learn software like Photoshop, flash, fixing computer hardware, and game. I was wrong because I meet mathemathics,programming, basic natural science, and other unexpected subjects.</p><blockquote>Computer science is a liberal art. It’s something everyone should know how to use and harness in their life.</blockquote><blockquote>— — <strong>Steve Jobs</strong></blockquote><p>My heart just rebell, why I got all of this. For what? Why I must enroll biology, physic, chemistry, calculus, linear algebra, numerical method, operation research, statistics, probabilitas theorem, discrete mathematics and mathematics stuff which not related at all with computer science. Slow but sure finally I know if computer science is just tools which connected to other dicipline. Before goes to another dicipline area, I want to share story about basic mathematics in computer science. I’m too naive to hate mathematics at first then I realize every computer science subject base on mathematics.</p><p>Why learn calculus? because to calculate in advance subject at CS you will need them such as digital image processing you will face the integrall, derivation. You must learn calculus and numerical method because computer is finite and not continues you must convert calculation from continous to discrete so computer can help you in computation.</p><p>If we want to create computer games, we must know about pyshic, art, history, mathematics dan optimitation. Like angrybird games, it convert the annoying parabolic theorema into beautiful and funny computer game.</p><p>Bioinfomatics, medical records, information systems, everything can be connected to computer science even the economic area like prediction stocks using artificial intelligence. Before we can do that we must learn about natural science, artificial intelligence, information systems, little accounting or every subject which support what will you do.</p><p>So computer science is not end up with calculation or computer itself but spread all accros different area which unlimited scenario that we can imagine.</p><p>If you already put yourself into computer science world, I hope we can support each other and make computer science easy to understand and fun to learn because computer science for humanity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=560db78d62d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Am I Lost?]]></title>
            <link>https://medium.com/@mochlutfi/am-i-lost-cd027aee6f19?source=rss-f4d8ad2949e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd027aee6f19</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Moch Lutfi]]></dc:creator>
            <pubDate>Mon, 05 Jun 2017 10:20:56 GMT</pubDate>
            <atom:updated>2017-06-05T10:20:56.135Z</atom:updated>
            <content:encoded><![CDATA[<p>The story behind my adventure of code</p><p>I’m proud to be software engineer, programmer, kuli koding, code saint, or whatever you call it. Do you know before I choose Computer Science degree I don’t know what the hell Computer Science is. Here the short history about path of my adventure of code. :p</p><p><strong>Junior High School Arch</strong></p><p>In this era I don’t know what I’m doing and I hate enter Junior High School 1 Malang because I wanted to enter another school. Every day just went to school, learn, play, and made some trouble. Just some trouble, not so many I think. haha… I still remember the day I was touch the computer, yeah MS-DOS. Use it like hacker and I always remember the fun moment when I’m trying execute command `del *.*` on MS-DOS then everything going dark.</p><p>After that <strong>**great**</strong> experiment I’m afraid to explore that `black thing` again. Beside of that, I don’t like computer stuff because pricey thing that I couldn’t afford to buy it. Do you know I hate Mathemathic subject and love learn biology. This arch doesn’t have good memories for me. Everything so flat and had bad memory with MS-DOS.</p><p><strong>Senior High School Arch</strong></p><p>In previous arch so boring huh. My real life begin in this arch, first time of my life I love learning accounting. What? Really? Accounting? Yes, beside physics and chemistry. But that’s not long story, everything turn 180 degree after my class move near computer laboratory. Everyday I always in the lab, yes just play game. That era counter strike is the one of fenomemal game beside the starcraft. And I had computer at second year life on my senior high school life, the fact still not change every day always playing game. After that I choose computer science degree in Brawijaya University because the campus location near with my home. But the decision about really went to college was after I failed in selection to join Navy Academy.</p><p><strong>Undergraduate Arch</strong></p><p>YES, final arch. Welcome to Mathemathic Major, eh. Math? What? I hate math, but this is the path I choose, I must survive. At my first year I meet C++ world, and piss off with pointer. I’m mastered C++? not yet mastered just know it. Then the second year meet java and also with another mathematics subject such as algebra, linear algebra, numerical method, operation research, statistics, automata, and etc. Haha… If you hate mathematics like me, you have two choice: learn how to love it maybe at least hardwork to learn it or leave. :p</p><p>Back to java story, start from C++ is easy to print out to screen just cout&lt;&lt;”bla bla bla”; but java have more complex for IO. But it just story of my first week meet the java, everyday going a good day with java until my last year in college. C# invasion, I can’t avoid because easy and better than java (IMHO). I finish my application for my final year project just in 2 weeks, but I learn to solve my the problem for 6 months. And my story of undergraduate arch closed with C# as main language to do programming stuff.</p><p><strong>Postgraduate arch</strong></p><p>null pointer exception</p><p><strong>Programmer Arch</strong></p><p>There is bonus arch, the short story as a programmer. Start as C# programmer with first project interfacing microcontroller, then medical software. One year with C# then intensive using python with tornado package to build website and using backbonejs as front end scripting. Only just one year also, and now still using Golang as main programming language. Such a long, boring story about my adventure.</p><p><strong>Conclusion</strong></p><p>At first hate math then end up with the same condition. Now I’m realized I’m not lost to choose computer science. And for everyone who decide join the hellish world that I choose. Two message for you, just love what you do and never give up. All programmer around the world will be your best friend don’t forget them. I love you all. :p</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd027aee6f19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>