<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codebreaker</title>
	<atom:link href="http://blog.sumin.us/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sumin.us</link>
	<description>2bc08752a0894eb2c7afb345286e391d</description>
	<lastBuildDate>Fri, 23 Jul 2010 22:25:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Double SSH Tunneling</title>
		<link>http://blog.sumin.us/archives/1318</link>
		<comments>http://blog.sumin.us/archives/1318#comments</comments>
		<pubDate>Fri, 23 Jul 2010 22:23:10 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1318</guid>
		<description><![CDATA[This is just a self-reminder. ssh -t -L 8000:localhost:8000 lec.cs.arizona.edu 'ssh -L 8000:sebeos:80 robotlab@sebeos' lec.cs.arizona.edu is in the DMZ, and sebeos.cs.arizona.edu is one of the machines in the robot lab, which is behind the firewall. So, I'm basically double tunneling to sebeos via lec to access to sebeos from outside the firewall.]]></description>
			<content:encoded><![CDATA[<p>This is just a self-reminder.</p>

<pre><code>ssh -t -L 8000:localhost:8000 lec.cs.arizona.edu 'ssh -L 8000:sebeos:80 robotlab@sebeos'
</code></pre>

<p><code>lec.cs.arizona.edu</code> is in the DMZ, and <code>sebeos.cs.arizona.edu</code> is one of the machines in the robot lab, which is behind the firewall. So, I'm basically <em>double</em> tunneling to <code>sebeos</code> via <code>lec</code> to access to <code>sebeos</code> from outside the firewall.</p>
<!-- AdSense Now! V1.83 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-2353453386862167";
/* 468x60, created 10/26/09 */
google_ad_slot = "1252542387";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1318/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ah, Finally</title>
		<link>http://blog.sumin.us/archives/1308</link>
		<comments>http://blog.sumin.us/archives/1308#comments</comments>
		<pubDate>Tue, 22 Jun 2010 06:00:53 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[University of Arizona]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1308</guid>
		<description><![CDATA[This is the official job offer from the University of Arizona. I've been waiting for this for over three weeks!]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/06/Screen-shot-2010-06-21-at-10.41.02-PM.png" alt="" title="Screen shot 2010-06-21 at 10.41.02 PM" width="480" height="385" class="aligncenter size-full wp-image-1309" /></p>

<p>This is the official job offer from the University of Arizona. I've been waiting for this for over three weeks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1308/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diploma Finally Arrived</title>
		<link>http://blog.sumin.us/archives/1304</link>
		<comments>http://blog.sumin.us/archives/1304#comments</comments>
		<pubDate>Sun, 20 Jun 2010 08:12:02 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1304</guid>
		<description><![CDATA[This is probably the most expensive piece of paper that I've ever owned in my entire life!]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/06/DSC_8271.jpg" alt="" title="DSC_8271" width="480" height="320" class="aligncenter size-full wp-image-1305" /></p>

<p>This is probably the most expensive piece of paper that I've ever owned in my entire life!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1304/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Coding, Programming, and Software Development</title>
		<link>http://blog.sumin.us/archives/1299</link>
		<comments>http://blog.sumin.us/archives/1299#comments</comments>
		<pubDate>Fri, 11 Jun 2010 21:36:56 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1299</guid>
		<description><![CDATA[This is entirely my personal opinion, but I don't think it's not much different from the formal definition, if there is any. Coding = an action of writing code Programming = coding + problem solving Software development = programming + re-usable and maintainable software design + final product quality assurance + schedule and budget management [...]]]></description>
			<content:encoded><![CDATA[<p>This is entirely my personal opinion, but I don't think it's not much different from the formal definition, if there is any.</p>

<ul>
<li>Coding = an action of writing code</li>
<li>Programming = coding + problem solving</li>
<li>Software development = programming + re-usable and maintainable software design + final product quality assurance + schedule and budget management (+ a bunch of meetings)</li>
</ul>

<p>So if you call me a coder, that's an insult. Under-evaluation of my abilities and skills.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1299/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running wxPython on Mac OS X</title>
		<link>http://blog.sumin.us/archives/1291</link>
		<comments>http://blog.sumin.us/archives/1291#comments</comments>
		<pubDate>Fri, 30 Apr 2010 19:47:08 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Carbon]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1291</guid>
		<description><![CDATA[If you try to run a wxPython application on a 64-bit Mac, you will get a similar message as following. ImportError: /usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode) The reason is that wxPython currently relies on Carbon, and thus 64-bit APIs are not available. As far as I know, [...]]]></description>
			<content:encoded><![CDATA[<p>If you try to run a wxPython application on a 64-bit Mac, you will get a similar message as following.</p>

<pre><code>ImportError: /usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
</code></pre>

<p>The reason is that wxPython currently relies on <a href="http://en.wikipedia.org/wiki/Carbon_(API)">Carbon</a>, and thus 64-bit APIs are not available. As far as I know, there are two workarounds.</p>

<p>If you want a temporary solution, you can run the following command in Terminal. Then you will be able to run a Python script in a 32-bit mode.</p>

<pre><code>export VERSIONER_PYTHON_PREFER_32_BIT=yes
</code></pre>

<p>If you want to make Python to run in a 32-bit mode all time, you can run the following command.</p>

<pre><code>defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1291/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My First Drawing on an iPad</title>
		<link>http://blog.sumin.us/archives/1282</link>
		<comments>http://blog.sumin.us/archives/1282#comments</comments>
		<pubDate>Sun, 04 Apr 2010 00:08:07 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1282</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/04/idea.jpg" alt="" title="idea" width="320" height="487" style="border:0;" class="aligncenter size-full wp-image-1287" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1282/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple Magic Mouse</title>
		<link>http://blog.sumin.us/archives/1267</link>
		<comments>http://blog.sumin.us/archives/1267#comments</comments>
		<pubDate>Fri, 12 Mar 2010 07:55:30 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Magic Mouse]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1267</guid>
		<description><![CDATA[I ordered an Apple Magic Mouse yesterday on Amazon with the 2nd day shipping option, and, surprisingly, it came through today. Since I'm on Amazon Prime trial period, it was pretty much a free overnight shipping. Even though everyone says it's a great mouse, there are things I like and things I don't like. Pros [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.sumin.us/wp-content/uploads/2010/03/DSC_7549.jpg" alt="Apple Magic Mouse" title="DSC_7549" width="480" height="320" class="aligncenter size-full wp-image-1266" /></p>

<p>I ordered an Apple Magic Mouse yesterday on Amazon with the 2nd day shipping option, and, surprisingly, it came through today. Since I'm on <a href="http://www.amazon.com/gp/subs/primeclub/signup/main.html">Amazon Prime</a> trial period, it was pretty much a free overnight shipping.</p>

<p>Even though everyone says it's a great mouse, there are things I like and things I don't like.</p>

<h2>Pros</h2>

<p>I love how the scrolling feels.<br />
No <em>cheap</em> feeling when I grab it.<br />
It uses AA batteries unlike my old mouse that uses AAA. Rechargeable batteries of size AA that I have have almost three times more capacity than AAAs I have.</p>

<h2>Cons</h2>

<p>Easily scratchable surface.<br />
The tracking speed is so damn slow! Virtually unusable even with the maximum speed in the system preferences. I even tried</p>

<pre><code> defaults write -g com.apple.mouse.scaling 12.0
</code></pre>

<p>but it seems that it only changes how it accelerates and it doesn't change the tracking speed. If I don't find a better solution for this, I might return the mouse.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1267/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Steve Jobs&#8217; 2005 Stanford Commencement Address</title>
		<link>http://blog.sumin.us/archives/1247</link>
		<comments>http://blog.sumin.us/archives/1247#comments</comments>
		<pubDate>Mon, 08 Mar 2010 13:39:26 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[2005]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Stanford]]></category>
		<category><![CDATA[Steve Jobs]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1247</guid>
		<description><![CDATA[I think this is a great speech. I hope one day I become another person who can say those thing in front of people. In the speech, Steve Jobs gave me some clues that lead me to an answer that I've been looking for a long time. Jobs said, Your time is limited, so don't [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Hd_ptbiPoXM&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Hd_ptbiPoXM&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>

<p>I think this is a great speech. I hope one day I become another person who can say those thing in front of people. In the speech, Steve Jobs gave me some clues that lead me to an answer that I've been looking for a long time. Jobs said,</p>

<blockquote>
  <p>Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.</p>
</blockquote>

<p>Even though the statement he made was highly abstract and conceptual, it forced me to re-think about everything I was doing and I have been doing. Ever since I decided to study computer science, I thought I already knew what I want to do. But there were too much of noise from others, temptations and uncertainties. Computer science is indeed a broad subject and it doesn't define me. It is just one of things I am interested in.</p>

<p>I don't think anyone else can answer to this question for me; what do I really want to become? If someone else answers to the question, it's probably not what I truly want to become. Thus I shall be the one who ultimately answers to the question, and hopefully not too late.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1247/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Project Euler Problem #20</title>
		<link>http://blog.sumin.us/archives/1244</link>
		<comments>http://blog.sumin.us/archives/1244#comments</comments>
		<pubDate>Sun, 07 Mar 2010 12:27:21 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1244</guid>
		<description><![CDATA[Problem #20 is to find the sum of the digits in the number 100! This can be easily solved with Python as the math package comes with factorial function. from math import factorial reduce(lambda x, y: int(x)+int(y), str(factorial(100)))]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=20">Problem #20</a> is to find the sum of the digits in the number 100!</p>

<p>This can be easily solved with Python as the <code>math</code> package comes with <code>factorial</code> function.</p>

<pre><code>from math import factorial
reduce(lambda x, y: int(x)+int(y), str(factorial(100)))
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1244/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler Problem #8</title>
		<link>http://blog.sumin.us/archives/1241</link>
		<comments>http://blog.sumin.us/archives/1241#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:22:56 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[amusement]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1241</guid>
		<description><![CDATA[A friend of mine, Leon, told me about the Project Euler. One of the problems is to find the greatest product of five consecutive digits in the 1000-digit number. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 66896648950445244523161731856403098711121722383113 62229893423380308135336276614282806444486645238749 30358907296290491560440772390713810515859307960866 70172427121883998797908792274921901699720888093776 65727333001053367881220235421809751254540594752243 52584907711670556013604839586446706324415722155397 53697817977846174064955149290862569321978468622482 83972241375657056057490261407972968652414535100474 82166370484403199890008895243450658541227588666881 16427171479924442928230863465674813919123162824586 17866458359124566529476545682848912883142607690042 24219022671055626321111109370544217506941658960408 07198403850962455444362981230987879927244284909188 84580156166097919133875499200524063689912560717606 05886116467109405077541002256983155200055935729725 71636269561882670428252483600823257530420752963450 Here's my one-line Python solution. l [...]]]></description>
			<content:encoded><![CDATA[<p>A friend of mine, Leon, told me about the <a href="http://projecteuler.net">Project Euler</a>. <a href="http://projecteuler.net/index.php?section=problems&amp;id=8">One of the problems</a> is to find the greatest product of five consecutive digits in the 1000-digit number.</p>

<pre><code>73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450
</code></pre>

<p>Here's my one-line Python solution. <code>l</code> is a string that contains all 1000 digits above.</p>

<pre><code>max(map(lambda a,b,c,d,e: int(a)*int(b)*int(c)*int(d)*int(e), l[:-4], l[1:-3], l[2:-2], l[3:-1], l[4:]))
</code></pre>

<p>Python for the win!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1241/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Ternary Operator</title>
		<link>http://blog.sumin.us/archives/1236</link>
		<comments>http://blog.sumin.us/archives/1236#comments</comments>
		<pubDate>Mon, 01 Mar 2010 20:08:24 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1236</guid>
		<description><![CDATA[I've been using a tuple as a substitution of a ternary operator in Python. Even though it is not exactly a ternary operator and has some drawbacks, but it works fine in most cases. w = (u, v)[x &#60; y] When x &#60; y is true, the whole expression of the tuple, (u, v)[x &#60; [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using a tuple as a substitution of a ternary operator in Python. Even though it is not exactly a ternary operator and has some drawbacks, but it works fine in most cases.</p>

<pre><code>w = (u, v)[x &lt; y]
</code></pre>

<p>When <code>x &lt; y</code> is true, the whole expression of the tuple, <code>(u, v)[x &lt; y]</code>, will be evaluated as <code>v</code> because true means 1 here. Likewise, false will cause the tuple expression to be evaluated as <code>u</code>.</p>

<p>I had another trick to use with lambda functions.</p>

<pre><code>lambda w: x &lt; y and v or u
</code></pre>

<p>This might be a little less obvious to see what's going on. When <code>x &lt; y</code> is false, the following part, <code>and v</code>, will not be evaluated due to <a href="http://en.wikipedia.org/wiki/Short-circuit_evaluation">short-circuit evaluation</a>, and it will jump to the next part, <code>or u</code>. Thus, this whole expression is to be evaluated as <code>u</code>. Similarly, when <code>x &lt; y</code> is true, <code>and v</code> part has to be evaluated so it the whole expression will be evaluated as <code>v</code>.</p>

<p>However, as acute readers might already noticed, this trick has a major drawback. When <code>v</code> is a <em>falsy</em> value such as <code>0</code>, <code>False</code> or <code>None</code>, the whole expression will be evaluated as <code>u</code> regardless of the result of <code>x &lt; y</code>. So, one should refrain from using this trick unless it is impossible for <code>v</code> to be a falsy value.</p>

<p>Last Saturday, Cody told me that there is a ternary operator equivalent in Python.</p>

<pre><code>w = v if x &lt; y else u
</code></pre>

<p>Strictly speaking, it is not a ternary <em>operator</em>, rather an expression. But, in my opinion, it is more intuitive thus it makes it easier to maintain the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1236/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>한자-한글 변환</title>
		<link>http://blog.sumin.us/archives/1230</link>
		<comments>http://blog.sumin.us/archives/1230#comments</comments>
		<pubDate>Sun, 14 Feb 2010 10:06:22 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[한글]]></category>
		<category><![CDATA[한자]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1230</guid>
		<description><![CDATA[오랜만의 한국어 포스팅이다. 나는 어렸을 때 한자 공부를 열심히 하지 않아서 그런지, 이런 글을 보면 무언가 거부감이 든다. 한자와 한글의 병용을 주장하는 글을 한자 혼용으로 작성해놓은 이유는 무엇인가. 본문에 따르자면 한자를 배워야 하는 이유를 다음의 몇가지로 요약할 수 있다. 성명의 한자 표기를 통해 자기의 근본을 알고 자기 정체성을 확립한다. 어휘력을 풍부하게 한다. 단어의 뜻을 명확하게 [...]]]></description>
			<content:encoded><![CDATA[<p>오랜만의 한국어 포스팅이다.</p>

<p>나는 어렸을 때 한자 공부를 열심히 하지 않아서 그런지, <a href="http://www.hanja-edu.com/bbs/view.php?id=magazine_article&amp;no=368">이런</a> 글을 보면 무언가 거부감이 든다. 한자와 한글의 병용을 주장하는 글을 한자 혼용으로 작성해놓은 이유는 무엇인가.</p>

<p>본문에 따르자면 한자를 배워야 하는 이유를 다음의 몇가지로 요약할 수 있다.</p>

<ol>
<li>성명의 한자 표기를 통해 자기의 근본을 알고 자기 정체성을 확립한다.</li>
<li>어휘력을 풍부하게 한다.</li>
<li>단어의 뜻을 명확하게 알 수 있다.</li>
</ol>

<p>먼저, 자기의 성과 이름을 한자로 쓸 줄 알고 자기의 근본을 알고 자기정체성을 확립하는 것과 일상 생활에서 한자를 병용하는것은 별 관계가 없어보인다. 또, 흔한 경우는 아니지만, 한글 전용으로 인해 특정 단어의 의미가 명확하지 않은 경우가 있을수도 있는데, 이런 경우에 한해서만 괄호 안에 대응되는 한자를 넣어주는 한자 병용으로 문제를 해결할 수 있다. 대부분의 경우에 한글 전용으로도 의미가 확실히 전달되는데에도 불구하고 굳이 한자를 쓰는것은 대단한 자원의 낭비라고 생각된다.</p>

<p>본문 중에 다음과 같은 내용이 있다.</p>

<blockquote>
  <p>例를 들어 여기 흔히 쓰이는 정신 나간 사람이라고 할 때 ‘井神, 定身, 廷臣, 精神, 挺身, 正信, 貞臣, 淨神, 正身, 情神, 鼎臣’ 등이 있는데 이 중 어느 정신인지 漢字를 모르면 구분이 잘 안 된다.</p>
</blockquote>

<p>주장하고자 하는 바가 무엇인지 대략 짐작이 가지만, 예를 조금 잘못 선택한것 같다. 위의 문맥에서 쓰인 '정신'이 어떤 뜻의 정신인지 모르면 정말로 정신 나간 사람이 아닐까 한다.</p>

<p>이것 이외에도 적절하지 않은 뒷받침 내용이나, 출처나 사실 여부를 알 수 없는 서술문, 논리적 오류가 보이지만, 이 글을 쓰는 목적이 위의 글을 비판하기 위함이 아니므로 본론으로 넘어가도록 하겠다.</p>

<p>오늘 이 글을 쓰는 목적은 <a href="http://labs.sumin.us/hanja">한자-한글 변환기</a>를 공개하는 것이다. 이것 덕분에 위의 한자 혼용 글도 읽고 이해할 수 있었다.</p>

<p>일단, 약 3만개의 한자-한글 매핑 데이터를 <a href="http://kore.wikia.com/wiki/사용자:Masoris/hani_converter.js">여기</a>서 얻어왔다. 이것을 파이썬의 사전(dictionary) 형식으로 표현하고, 변환할 문자열에서 한 글자씩 한자에서 한글로 변환하는 방식이다. 핵심 기능을 하는 코드는 다음의 한 줄이 전부이고, 나머지는 사용자의 입력을 받고 결과물을 보여주기 위한 코드이다.</p>

<pre><code>map(lambda x: x in dict and dict[x] or x, post['query'])
</code></pre>

<p><code>map</code> 함수가 어떤 기능을 하는 것인지 모르겠으면 <a href="http://docs.python.org/library/functions.html#map">이 문서</a>를 읽어보길 바란다. <code>map</code>, <code>reduce</code>, <code>filter</code> 과 같은 <a href="http://en.wikipedia.org/wiki/Higher-order_function">higher-order function</a> 들을 잘 쓰면 프로그램을 간결하면서도 효과적으로 작성할 수 있다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1230/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Programming Contest: 4-function Calculator</title>
		<link>http://blog.sumin.us/archives/1222</link>
		<comments>http://blog.sumin.us/archives/1222#comments</comments>
		<pubDate>Fri, 05 Feb 2010 06:34:51 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[pymt]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1222</guid>
		<description><![CDATA[Today's programming contest, sponsored by Jude Nelson, was to make a 4-function calculator using PyMT. There were some extra credits for additional features such as support for trigonometric functions, parenthesis for changing orders of operations, and so on. Even though I was the winner (thanks to Google), I admit I wrote an embarrasingly low quality [...]]]></description>
			<content:encoded><![CDATA[<p>Today's programming contest, sponsored by Jude Nelson, was to make a 4-function calculator using PyMT. There were some extra credits for additional features such as support for trigonometric functions, parenthesis for changing orders of operations, and so on.</p>

<p>Even though I was the winner (thanks to Google), I admit I wrote an embarrasingly low quality code, but I think I have legitimate excuses; I've never dealt with PyMT until few hours ago, and we had a very tight time constraint.</p>

<p>So, here I'm posting the full source code at the request of Charles and a couple more people.</p>

<pre><code>import urllib, urllib2, re
from pymt import *

# Google search would give me a 403 error so I had to "pretend" to be a real web browser.
useragent = 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.1.6) Gecko/20091215 Ubuntu/9.10 (karmic) Firefox/3.5.6'

# This is how you get things done.
url = 'http://www.google.com/search?'

m = MTWidget()

button0 = MTButton(label='0', pos=(0, 0), size=(90, 90))
buttonpr = MTButton(label='.', pos=(100,0), size=(90, 90))
buttonok = MTButton(label='=', pos=(200,0), size=(90, 90))

button1 = MTButton(label='1', pos=(0,100), size=(90, 90))
button2 = MTButton(label='2', pos=(100,100), size=(90, 90))
button3 = MTButton(label='3', pos=(200,100), size=(90, 90))

button4 = MTButton(label='4', pos=(0,200), size=(90, 90))
button5 = MTButton(label='5', pos=(100,200), size=(90, 90))
button6 = MTButton(label='6', pos=(200,200), size=(90, 90))

button7 = MTButton(label='7', pos=(0,300), size=(90, 90))
button8 = MTButton(label='8', pos=(100,300), size=(90, 90))
button9 = MTButton(label='9', pos=(200,300), size=(90, 90))

m.add_widget(button0)
m.add_widget(buttonpr)
m.add_widget(buttonok)
m.add_widget(button1)
m.add_widget(button2)
m.add_widget(button3)
m.add_widget(button4)
m.add_widget(button5)
m.add_widget(button6)
m.add_widget(button7)
m.add_widget(button8)
m.add_widget(button9)

buttonlp = MTButton(label='(', pos=(400,0), size=(90, 90))
buttonrp = MTButton(label=')', pos=(500,0), size=(90, 90))

m.add_widget(buttonlp)
m.add_widget(buttonrp)

buttonp = MTButton(label='+', pos=(300,300), size=(90, 90))
buttons = MTButton(label='-', pos=(300,200), size=(90, 90))
buttonm = MTButton(label='*', pos=(300,100), size=(90, 90))
buttond = MTButton(label='/', pos=(300,0), size=(90, 90))

m.add_widget(buttonp)
m.add_widget(buttons)
m.add_widget(buttonm)
m.add_widget(buttond)

buttonbs = MTButton(label='&lt;-', pos=(400,100), size=(90, 90))
buttoncl = MTButton(label='CL', pos=(400,200), size=(90, 90))

m.add_widget(buttonbs)
m.add_widget(buttoncl)

buttonsin = MTButton(label='sin', pos=(500,300), size=(90, 90))
buttoncos = MTButton(label='cos', pos=(500,200), size=(90, 90))
buttontan = MTButton(label='tan', pos=(500,100), size=(90, 90))

m.add_widget(buttonsin)
m.add_widget(buttoncos)
m.add_widget(buttontan)

buttonhex = MTButton(label='0x', pos=(600,0), size=(90, 90))
buttonbin = MTButton(label='0b', pos=(600,100), size=(90, 90))

m.add_widget(buttonhex)
m.add_widget(buttonbin)

inputl = MTLabel(label='', pos=(0, 400), size=(90, 300))
m.add_widget(inputl)

#@button0.event
#def on_press(*largs):
#   print 'on_press()', button0.state, largs

@button0.event
def on_release(*largs):
    inputl.label += '0'

@button1.event
def on_release(*largs):
    inputl.label += '1'

@button2.event
def on_release(*largs):
    inputl.label += '2'

@button3.event
def on_release(*largs):
    inputl.label += '3'

@button4.event
def on_release(*largs):
    inputl.label += '4'

@button5.event
def on_release(*largs):
    inputl.label += '5'

@button6.event
def on_release(*largs):
    inputl.label += '6'

@button7.event
def on_release(*largs):
    inputl.label += '7'

@button8.event
def on_release(*largs):
    inputl.label += '8'

@button9.event
def on_release(*largs):
    inputl.label += '9'

@buttonlp.event
def on_release(*largs):
    inputl.label += '('

@buttonrp.event
def on_release(*largs):
    inputl.label += ')'

@buttonp.event
def on_release(*largs):
    inputl.label += '+'

@buttons.event
def on_release(*largs):
    inputl.label += '-'

@buttonm.event
def on_release(*largs):
    inputl.label += '*'

@buttond.event
def on_release(*largs):
    inputl.label += '/'

@buttonpr.event
def on_release(*largs):
    inputl.label += '.'

@buttonbs.event
def on_release(*largs):
    inputl.label = inputl.label[:-1]

@buttoncl.event
def on_release(*largs):
    inputl.label = ''

@buttonsin.event
def on_release(*largs):
    inputl.label += 'sin('

@buttoncos.event
def on_release(*largs):
    inputl.label += 'cos('

@buttontan.event
def on_release(*largs):
    inputl.label += 'tan('

@buttonhex.event
def on_release(*largs):
    inputl.label += '0x'

@buttonbin.event
def on_release(*largs):
    inputl.label += '0b'

@buttonok.event
def on_release(*largs):
    inputl.label = get_result(inputl.label)

def get_result(query):
    headers = {'User-Agent':useragent}
    req = urllib2.Request(url + urllib.urlencode({'q':query}), None, headers)
    r = urllib2.urlopen(req)
    result = r.read()

    m1 = re.search('&lt;td nowrap &gt;&lt;h2 class=r style="font-size:138%"&gt;&lt;b&gt;', result)
    if m1 is None:
        return 'Invalid expression'

    m2 = re.search('&lt;/b&gt;', result[m1.end():])

    return result[m1.end():(m1.end()+m2.start())]


runTouchApp(m)
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1222/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Languages of the Year 2009</title>
		<link>http://blog.sumin.us/archives/1200</link>
		<comments>http://blog.sumin.us/archives/1200#comments</comments>
		<pubDate>Wed, 23 Dec 2009 00:42:44 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[prolog]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1200</guid>
		<description><![CDATA[It's almost the end of the year 2009. This year is special because I've never dealt with so many languages in a year. Objective C, Python, Java, C++, PHP, JavaScript, Haskell, Prolog, Ruby, C#, and probably more. Some of them were for work, some for school, and others were for my personal projects. I have [...]]]></description>
			<content:encoded><![CDATA[<p>It's almost the end of the year 2009. This year is special because I've never dealt with so many languages in a year. Objective C, Python, Java, C++, PHP, JavaScript, Haskell, Prolog, Ruby, C#, and probably more. Some of them were for work, some for school, and others were for my personal projects. I have plenty of stories for each language, but I'll try to keep them brief.</p>

<h3>Objective C</h3>

<p><a href="http://cqube.mobi">CQube</a> iPhone edition was released back in March, and as you know Objective C is the language you use for iPhone application development. Objective C is a strict superset of C, so it didn't take too much effort to learn. Rather, I spent most of time to learn the Cocoa framework. All those magic keywords like <code>@property</code>, <code>@synthesize</code>, and <code>@dynamic</code> were nice to have.</p>

<h3>Python</h3>

<p>I love Python. I used Python for many different things; from disposable command line utilities to implementation of Apple Push Notification service. I also used this language to conduct a <em>classified operation</em>. After I learned Haskell, which is what I'm going to talk about in a minute, I started enjoying use of higher order functions such as <code>map</code>, <code>reduce</code>, <code>filter</code>, and so on.</p>

<h3>Java</h3>

<p>I also use Java a lot. I built a Java mobile application at my work. I also built a nearest neighbor search engine, an HTTP based real time communication framework, and a Luca compiler. There are probably more, but these are the ones I remember. There are few things that I really wish to have in Java: automatic getter/setter, operator overriding, and delegate. Could someone give me these as a Christmas gift? ;-)</p>

<h3>C++</h3>

<p>To be honest with you, I'm kind of scared of this magic language. I would say it's quite difficult and takes a considerable amount of practice to use this language properly and effectively. Well, in my compiler class, I had to use either C or C++ to implement a Luca interpreter with indirect threading.</p>

<h3>PHP</h3>

<p>I'm not a big fan of this language. Ironically, this is probably one of the top three languages that I spent most time with so far. I had a web application development job over the summer. It was a lot of PHP programming. I also had to build server side components at my current work. I wanted to use Python, but apparently not many people know Python. So, I had stick with whatever language that most people can deal with.</p>

<h3>JavaScript</h3>

<p>You would imagine using JavaScript to manipulate the DOM structure of a web page. But, this is not the only case. I used this language to build a Firefox extension (thanks to <a href="http://groups.google.com/group/ua-developers/web/firefox-extension-development-tutorial---part-1">Justin Samuel's Firefox extension development tutorial</a>). I can't tell you what it is though because it's a part of a classified operation.</p>

<h3>Haskell</h3>

<p>Haskell changed a lot of things in my point of view of programming. All the functional programming features and its imperativeness really blew my mind. Basically it made me a better developer in general. Even though I have no intention to use Haskell in production environment, I will be using things I learned from this language.</p>

<h3>Prolog</h3>

<p>Cody Jorgensen:</p>

<blockquote>
  <p>Why can't I get an element from the god damn list?</p>
</blockquote>

<h3>Ruby</h3>

<p>It was very joyful to learn Ruby as I already know how to use Python. Ruby is very similar to Python in many different aspects as C# is similar to Java. I see blocks and the yield keyword as a giant lambda function, and I kind of like it. One thing I like from this language over Python is that there's <code>end</code> keyword so that you don't have to be super careful about indentation. Because of this, there's no need to make a new template language in web application framework such as Ruby on Rails, whereas it is necessary in Python based frameworks such as Django. Oh, it's also very nice to have built-in regular expression features.</p>

<h3>C&#35;</h3>

<p>We decided to switch from Nokia's Symbian to Microsoft Windows Mobile platform at my work. I was hoping the Java code I've been writing works just fine on the Windows Mobile, but few things didn't really work out well. So, I decided to re-write the whole application in C#, and I did it over the last weekend. I wouldn't be able to make all these happen without Visual Studio's great help. Not to mention I didn't have to re-write all the server side components.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1200/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Gram Matrix</title>
		<link>http://blog.sumin.us/archives/1196</link>
		<comments>http://blog.sumin.us/archives/1196#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:07:37 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[mathematics]]></category>
		<category><![CDATA[linear algebra]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/?p=1196</guid>
		<description><![CDATA[Matrix manipulation by hand is often times pain in the neck when it comes to anything bigger than 2 by 2 matrices as it involves a quite amount of arithmetic operations. Well, I've got an Intel Core 2 Duo processor and Python. No reason not to take advantage of them ;-) Source Code __author__ = [...]]]></description>
			<content:encoded><![CDATA[<p>Matrix manipulation by hand is often times pain in the neck when it comes to anything bigger than 2 by 2 matrices as it involves a quite amount of arithmetic operations. Well, I've got an Intel Core 2 Duo processor and Python. No reason not to take advantage of them ;-)</p>

<h3>Source Code</h3>

<pre><code>__author__ = 'Sumin Byeon &lt;sumin@cs.arizona.edu&gt;'

from Numeric import *

# u and v are lists of same lengths
def inner_product(u, v):
    return reduce(int.__add__, map(lambda x: x[0]*x[1], zip(u, v)))

# vs: a list of vectors
def gram_matrix(*vs):
    n = len(vs)
    mx = zeros((n, n))
    for i in range(0, n):
        for j in range(0, n):
            mx[i,j] = inner_product(vs[i], vs[j])
    return mx
</code></pre>

<h3>Result</h3>

<pre><code>&gt;&gt;&gt; gram_matrix([1,0,0,1], [-2,1,0,0], [-1,0,-1,0], [0,2,-3,0])
[[ 2 -2 -1  0]
 [-2  5  2  2]
 [-1  2  2  3]
 [ 0  2  3 13]]
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/1196/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
