<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>Jan'uary</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=cLQTEc_Q3RGGXiz8bLsjiw</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=cLQTEc_Q3RGGXiz8bLsjiw&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 01 Oct 2015 23:25:31 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>One Week on Node</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/8bewIBTDrZo/one-week-on-node.html</link>
         <description>&lt;span style=&quot;font-family:Georgia, serif;font-size:100%;font-variant:normal;font-weight:normal;line-height:normal;font-style:italic;&quot;&gt;Just want to write down some feelings on a small nodejs project I worked on last week.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Fast. Everything is fast (attribute to Google v8 and node guys). REPL opened in a twinkle, tests finish before I grab my teacup. No more waiting for &quot;warm up&quot;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;* NPM. It's so good. I like the idea to install all dependencies locally in project directory. Mentally, dependencies are part of your application, it make sense for them to live together. Physically, put dependencies in project directory will solve dependency conflicts between applications naturally; besides that,  it enables you to jump into deeper (library) code more easily, if you use a decent editor like vim or textmate, because all files are in one place so a simple search will find them all.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;* Library boom. Maybe a requirement to success, but it goes a little wild. In some area like testing, tons of immature tools are there, no one can tell a best practice. I have to examine all these tools to find a best fit to my project. I really miss something like rails guide or ruby-toolbox.com here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;* Asynchronization is still hard. It's hard for the same reason GOTO statement is hard, or lazy evaluation is hard. It messes up my tiny little brain easily by disrupts the execution order. The weird exception backtrace only make the situation worse (however this should be fixable). The little piece of asynchronous code is like virus, it gradually infects the rest parts of your application (IO monad: ah?). The co-routine tricks/tools people used to dress asynchronous code up to synchronous code still looks awkward (and here's another area suffers the library boom problem). I will be very careful if someone propose to write an entire application in node, it would be better if I can restrict asynchronous code on a small land. I bet node is better in polyglot paradigm, e.g. node as my ajax push server, rails to power most web pages.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Node is great! Be careful with asynchronous calls!&lt;/b&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/8bewIBTDrZo&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-7981438747052785916</guid>
         <pubDate>Mon, 02 Jan 2012 17:33:00 +0000</pubDate>
      </item>
      <item>
         <title>Running Rails 3.1.1 on Heroku</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/PMI-Bqq8jlc/running-rails-311-on-heroku.html</link>
         <description>&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting&quot;&gt;Heroku officially supports rails 3.1.1 on their Cedar stack now&lt;/a&gt;, unfortunately, you may still fail on deploy. The trouble maker is the assets:precompile rake task in rails 3.1. Heroku runs 'rake assets:precompile' for you when deploy, at a time many application dependencies, e.g. database server, redis, are NOT ready, so if there's any database/redis/any-other-not-ready-dependency use in your rails initialization process, assets:precompile will fail.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The tricky thing is, even you know the underlying theory, it's hard to find the exact place caused the problem, because heroku deployment do not use '--trace' flag when running precompile task, the limited error output is almost useless; and rails initialization process walks through so many files it's stupid to check them one by one. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For example, this is the error I got today when I deploy to heroku:&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;rake aborted!&lt;br /&gt;bad URI(is not URI?):&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Can you spot the broken code with so few information? I can't ... Fortunately, we can ask rake to give detail error stack without passing it '--trace' option, by adding this line in your Rakefile:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;Rake.application.options.trace = true if %w(staging production).include?(Rails.env)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Then another problem pops up, I now found the broken code, how to fix it? Since the broken code uses something that is not ready when assets:precompile task running, an easy way would be:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;# in Rakefile&lt;br /&gt;if %w(staging production).include? Rails.env&lt;br /&gt;$heroku_deploying = true if File.basename($0) == 'rake' &amp;amp;&amp;amp; ARGV.include?('assets:precompile')&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# in some initializers:&lt;br /&gt;# reference to UsersController will trigger operation on database&lt;br /&gt;provider :identity, :fields =&amp;gt; [:name, :email, :nickname], :on_failed_registration =&amp;gt; UsersController.action(:new) unless $heroku_deploying&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;With this duct tape kind fix, you may have $heroku_deploying scattered in your code ..  it's ugly but works. Let me know if you have better idea :-)&lt;br /&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/PMI-Bqq8jlc&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-4228650112031285152</guid>
         <pubDate>Mon, 26 Sep 2011 03:32:00 +0000</pubDate>
      </item>
      <item>
         <title>[ANN] Rubytest.vim 1.1.0 Released!</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/Tu_yjTAvv7k/ann-rubytestvim-110-released.html</link>
         <description>There're two major changes in this release:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;* Remember last run: &amp;lt;leader&amp;gt; l to run last run test (thanks John Weir!)&lt;/div&gt;&lt;div&gt;* Default support to rspec2. You need to customize g:rubytest_cmd_spec to work with rspec 1.*&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Download [1][2] and copy/overwrite to install/upgrade!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.vim.org/scripts/script.php?script_id=2612&quot;&gt;http://www.vim.org/scripts/script.php?script_id=2612&lt;/a&gt;&lt;/div&gt;&lt;div&gt;2. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/janx/vim-rubytest/tree/master&quot;&gt;http://github.com/janx/vim-rubytest/tree/master&lt;/a&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/Tu_yjTAvv7k&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-1854040633961875408</guid>
         <pubDate>Fri, 17 Jun 2011 01:47:00 +0000</pubDate>
      </item>
      <item>
         <title>ZJU the Champions of ACM-ICPC World Finals 2011!</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/17s9Ci8RLxs/zju-champions-of-acm-icpc-world-finals.html</link>
         <description>&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-p77b2hNE6PA/TeRsV3TjtTI/AAAAAAAAAQo/dArBvpX0vxA/s1600/ugmbbc_103252786400877_small.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer;cursor:hand;width:320px;height:214px;&quot; src=&quot;http://1.bp.blogspot.com/-p77b2hNE6PA/TeRsV3TjtTI/AAAAAAAAAQo/dArBvpX0vxA/s320/ugmbbc_103252786400877_small.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5612730158489515314&quot;/&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;Finally, finally, congratulations ~ &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cm.baylor.edu/ICPCWiki/Wiki.jsp?page=Results%20World%20Finals%202011&quot;&gt;Rankings&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/17s9Ci8RLxs&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-711152810209230454</guid>
         <pubDate>Mon, 30 May 2011 21:17:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-p77b2hNE6PA/TeRsV3TjtTI/AAAAAAAAAQo/dArBvpX0vxA/s72-c/ugmbbc_103252786400877_small.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Angry Terminal</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/tjiEcsbfvuk/angry-terminal.html</link>
         <description>Last night I got the idea that using different colors in shell prompt to tell the user about the result of last command executed, e.g. red for failed execution and green for success.&lt;br /&gt;&lt;br /&gt;It's really easy to do that in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.zsh.org/&quot;&gt;the ultimate shell&lt;/a&gt;, all I need is a function and a prompt using it:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;function prompt_base_color() {&lt;br /&gt; if [[ $? == &quot;0&quot; ]]; then&lt;br /&gt;   echo $PR_GREEN&lt;br /&gt; else&lt;br /&gt;   echo &quot;$PR_RED&quot;&lt;br /&gt; fi&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}$(prompt_base_color)%D{%H:%M} $PR_GREEN%~ $PR_RED$(git_prompt_info)$PR_NO_COLOUR'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;It make your terminal look like this:&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/_P15G6MgiUyU/TUEGK6J8QqI/AAAAAAAAAQE/9NZb7FfCoeI/s1600/screenshot_022.png&quot;&gt;&lt;img src=&quot;http://3.bp.blogspot.com/_P15G6MgiUyU/TUEGK6J8QqI/AAAAAAAAAQE/9NZb7FfCoeI/s320/screenshot_022.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5566737398886056610&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Then I realized I can go one step further to help terminal express her feeling, I always feel she is angry with me.&lt;br /&gt;&lt;br /&gt;So I changed the function a bit, like this:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;function prompt_base_color() {&lt;br /&gt; if [[ $? == &quot;0&quot; ]]; then&lt;br /&gt;   echo $PR_GREEN&lt;br /&gt; else&lt;br /&gt;   txt=`cat ~/.zsh/my_ass.txt`&lt;br /&gt;   echo &quot;$txt&amp;#92;n$PR_RED&quot;&lt;br /&gt; fi&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;And put the feeling in a file by `cowsay My ASS &amp;gt; ~/.zsh/my_ass.txt`.&lt;br /&gt;&lt;br /&gt;Now Miss Terminal can tell me what she thinks when I do something wrong!&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/_P15G6MgiUyU/TUEGrmQ8cJI/AAAAAAAAAQM/jxjwdOHWRjA/s1600/screenshot_023.png&quot;&gt;&lt;img style=&quot;cursor:pointer;width:320px;height:149px;&quot; src=&quot;http://2.bp.blogspot.com/_P15G6MgiUyU/TUEGrmQ8cJI/AAAAAAAAAQM/jxjwdOHWRjA/s320/screenshot_023.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5566737960482402450&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/tjiEcsbfvuk&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-4763899533057630302</guid>
         <pubDate>Wed, 26 Jan 2011 21:31:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/_P15G6MgiUyU/TUEGK6J8QqI/AAAAAAAAAQE/9NZb7FfCoeI/s72-c/screenshot_022.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>QorCMS preview</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/_UK7NNtaDHs/qorcms-preview.html</link>
         <description>Qor is the admin tool &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://theplant.jp&quot;&gt;we&lt;/a&gt; build for rails. It's not public released yet but already used by some of our clients. It's like the Django one but only better!&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://vimeo.com/17209929&quot;&gt;Qor Enterprise CMS Demo&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://vimeo.com/user5308918&quot;&gt;Felix Sun&lt;/a&gt; on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/_UK7NNtaDHs&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-3103516915132601566</guid>
         <pubDate>Fri, 26 Nov 2010 09:32:00 +0000</pubDate>
      </item>
      <item>
         <title>Compiling Google mod_pagespeed on Archlinux</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/SQJ60bHY7Kk/compiling-google-modpagespeed-on.html</link>
         <description>Google released its awesome apache module &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.modpagespeed.com/&quot;&gt;mod&lt;/a&gt;_&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://code.google.com/p/modpagespeed/&quot;&gt;pagespeed&lt;/a&gt; recently. Unfortunately only .deb/.rpm packages are provided officially. For arch user, we have to compile it by ourselves.&lt;br /&gt;&lt;br /&gt;Based on google's howto, we need &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.chromium.org/developers/how-tos/depottools&quot;&gt;depot_tools&lt;/a&gt; to compile mod_pagespeed. There is an aur package &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://aur.archlinux.org/packages.php?ID=25861&quot;&gt;depot_tools-svn&lt;/a&gt;, but seems not work now because arch switched to python 3.&lt;br /&gt;&lt;br /&gt;So I downloaded depot_tools myself and put it in my ~/scripts/depot_tools.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;  mkdir -p ~/scripts&lt;br /&gt; cd ~/scripts&lt;br /&gt; svn co http://src.chromium.org/svn/trunk/tools/depot_tools&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To make depot_tools work, you need to switch to python2:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sudo rm /usr/bin/python&lt;br /&gt;sudo ln -s /usr/bin/python2 /usr/bin/python&lt;br /&gt;sudo rm /usr/bin/python-config&lt;br /&gt;sudo ln -s /usr/bin/python2-config /usr/bin/python-config&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Next step we download mod_pagespeed source code use depot_tools:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;  mkdir ~/mod_pagespeed    # any directory is fine&lt;br /&gt; cd ~/mod_pagespeed&lt;br /&gt; gclient config http://modpagespeed.googlecode.com/svn/trunk/src&lt;br /&gt; gclient sync --force     # this will download all source code&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;You're ready to compile now.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;  cd ~/mod_pagespeed/src&lt;br /&gt; make BUILDTYPE=Release   # BUILDTYPE defaults to 'Debug'&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I got an error when I compile it on my box:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/c++/4.5.1/utility:71:0,&lt;br /&gt;                from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/c++/4.5.1/algorithm:61,&lt;br /&gt;                from ./net/instaweb/util/fetcher_test.h:24,&lt;br /&gt;                from ./net/instaweb/util/cache_fetcher_test.h:27,&lt;br /&gt;                from net/instaweb/util/cache_fetcher_test.cc:19:&lt;br /&gt;...&lt;br /&gt;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_map.h:87:5:   instantiated from here&lt;br /&gt;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:77:11: error: ?std::pair&amp;lt;_t1,&amp;gt;::second? has incomplete type&lt;br /&gt;./net/instaweb/util/public/cache_interface.h:28:7: error: forward declaration of ?struct net_instaweb::SharedString?&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;After digging a while, I made this patch to fix the error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Index: net/instaweb/util/public/cache_interface.h&lt;br /&gt;===================================================================&lt;br /&gt;--- net/instaweb/util/public/cache_interface.h (revision 137)&lt;br /&gt;+++ net/instaweb/util/public/cache_interface.h (working copy)&lt;br /&gt;@@ -21,6 +21,7 @@&lt;br /&gt;&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &quot;net/instaweb/util/public/string_util.h&quot;&lt;br /&gt;+#include &quot;net/instaweb/util/public/shared_string.h&quot;&lt;br /&gt;&lt;br /&gt;namespace net_instaweb {&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;ps: I also deployed mod_pagespeed to our centos staging server, the whole process is very smooth. The result is also very impressive: gzip, cache-control, inline assets, etc. etc. all suddenly work like a charm. The only problem is with extend_cache filter: it modified asset name correctly, but when brower send request to those assets, the server reponds with 404 error. I have to disable rewrite_javascript and extend_cache filter to make our sites work correctly:&lt;br /&gt;&lt;br /&gt; &lt;blockquote&gt;   ModPagespeedDisableFilters rewrite_javascript&lt;br /&gt;    ModPagespeedDisableFilters extend_cache&lt;/blockquote&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/SQJ60bHY7Kk&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-7814826226431125193</guid>
         <pubDate>Thu, 04 Nov 2010 23:35:00 +0000</pubDate>
      </item>
      <item>
         <title>On Vim again</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/eA5WWyg-wuo/on-vim-again.html</link>
         <description>There's only 10 kinds of people, those who use Vim, and those who use Emacs.&lt;br /&gt;&lt;br /&gt;Two months ago I don't know whether I'm wrong on choosing Vim as my editor, now I know I made a right decision, one of those few right decisions in my life.&lt;br /&gt;&lt;br /&gt;Emacs can do everything, except editing texts, everyone knows it. But I didn't expect that I can't simply *copy a line* before I learned to use it. I can copy a line by press y twice in Vim by one finger while the other hand is filling my mouth with cookies; I need to move the cursor to the beginning of a line, press C-S-e, then press M-w to copy the damn line.&lt;br /&gt;&lt;br /&gt;Of course I can write a macro and map the copy-line macro to my favorite keys. Yes, I can also write a text editor myself. Those two doesn't have much differences, no?&lt;br /&gt;&lt;br /&gt;Be serious: I really wrote a macro to do that, the problem is when I tried to map it to some key I failed - there's no reasonable key combination left for me to use. C-y? that's for yank, C-c? that's a common prefix, etc. etc. I don't want to match copy-line to something like C-c C-t C-y, that just won't save my time and stupid.&lt;br /&gt;&lt;br /&gt;Luckily Emacs do leave some key combination possibilities for me, so I can quick access find file/buffer functions. I'd say &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.emacswiki.org/emacs/InteractivelyDoThings&quot;&gt;ido&lt;/a&gt; is really awesome, that's what I miss when I switch back to Vim. Vim lacks a decent file navigator. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.vim.org/scripts/script.php?script_id=1984&quot;&gt;FuzzyFinder&lt;/a&gt; is cool, but it's turtle slow on large project.&lt;br /&gt;&lt;br /&gt;I also miss ruby-test-mode, which can do exactly the same thing but faster than my little &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.vim.org/scripts/script.php?script_id=2612&quot;&gt;rubytest.vim&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Emacs follows totally different philosophy than Vim: Emacs included everything in itself, while Vim leave everything but editing to others. An example is &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.gnu.org/software/tramp/&quot;&gt;Tramp&lt;/a&gt;. Tramp is really cool because you can prefix the file name with 'su::/' or 'su:root@hostfoo' when you want to edit a file you have no privileges or on a remote server,  it's not convenient to do the same thing in Vim. But I found myself more like to open a terminal and sudo vim /etc/hosts. (btw. emacs in console sucks.) I believe Emacs fits certain people, people who like to do everything in one place.&lt;br /&gt;&lt;br /&gt;Sometimes I think Emacs is for people who're using poor window manager. Because if you're using something like Gnom's default metacity, it's hard to create a new console, do something there while reading stuff in your text editor, then switch back to your editor. In short, most window managers doesn't allow you to manipulate layout between your editor and task windows easily. But if you're using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Tiling_window_manager&quot;&gt;tiling window manager&lt;/a&gt; like &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://xmonad.org/&quot;&gt;XMonad&lt;/a&gt;, I think Vim is the best fit because you can always do something in a new window easily while looking at your editor.&lt;br /&gt;&lt;br /&gt;Emacs is cool. I just like Vim more.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://imgs.xkcd.com/comics/real_programmers.png&quot;&gt;&lt;img src=&quot;http://imgs.xkcd.com/comics/real_programmers.png&quot; width=&quot;420&quot;/&gt;&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/eA5WWyg-wuo&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-2404294325125447480</guid>
         <pubDate>Tue, 26 Oct 2010 03:21:00 +0000</pubDate>
      </item>
      <item>
         <title>Find missing git ref</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/Rc5rQTv5LOg/find-missing-git-ref.html</link>
         <description>I was a fool this morning: I rsynced old source code from my macbook to my new thinkpad w510. I have been working on the new thinkpad since Tuesday, without a push to github (ye, fool again), so all recent works exist only on thinkpad. After the rsync, I found the last commit in my git repo is committed 2 days ago ..&lt;br /&gt;&lt;br /&gt;After a period of a mix of jump/cry/smoke/hit walls with my head/... I calmed down. Git saves any new file after you commit, it also save the tree and commit as object files, then it modify the ref to point to the new commit file. Rsync only ruined my refs, overwrite them to point to the old commit file, but the new source file, tree, commit should be still there on my dear harddisk. If I can find the last commit file of yesterday, then modify the ref to that commit manually, I may get all my changes back!&lt;br /&gt;&lt;br /&gt;First I need to list all object files related to the yesterday's last commit. A while later I find them with:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;cd .git&lt;br /&gt;find . -newer &amp;lt;the newest file in current corrupted repo&amp;gt;  -type f | xargs ls -l | grep object | grep &quot;Aug 25 19:09&quot; | awk '{print $9}'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The result is like this:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;./objects/0d/34526c4149e4c89c436a058c66d1b69850dcea&lt;br /&gt;./objects/0d/3d1caf38f65e6b7f2b7b693d721b66c6cda45d&lt;br /&gt;./objects/0e/e7efbe5eeb7a320c09046011e9fc5e10e51a88&lt;br /&gt;./objects/36/d3fdab703e5e080bf63bb76c069fa51a456a24&lt;br /&gt;./objects/59/3371c18e1657d786265b46deb747f3d8cc8d00&lt;br /&gt;./objects/76/3da4c776fae22d4cbee789703790f81fcfaed5&lt;br /&gt;./objects/a0/9a140235ce52747157a6b199c99a464a5545a4&lt;br /&gt;./objects/b1/a080cda86596501ee5bd88181c89fae1d5f07d&lt;br /&gt;./objects/bb/a640a7830fafa3d9ae352a2b060df600a4d5e7&lt;br /&gt;./objects/cb/ddce9d6079a720e13492c4ea055fb61b6e908b&lt;br /&gt;./objects/e3/5a4ba7d374dd96f70a763d128ac849be173b86&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The next step is to check the contents and find the commit in these object files. I tried with `git cat-file` first, but it just report &quot;fatal: Not a valid object name 3fc43a817252e031f6d0c387930539b4c613bc&quot; again and again, because the new object is not in the old repo really.&lt;br /&gt;&lt;br /&gt;After a google around I found a one-liner python script to inspect the content of object file, that's what I need exactly:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;python -c 'import sys,zlib; sys.stdout.write(zlib.decompress(open(sys.argv[1]).read()))' &amp;lt;path-to-object-file&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Next is easy: I just checked each object file manually, and found the lovely commit object file at the 9th try:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;commit 232tree b1a080cda86596501ee5bd88181c89fae1d5f07d&lt;br /&gt;parent 09f4a0cd1374d848bffffba6c02fa6830aea587a&lt;br /&gt;author Jan &amp;lt;j@xxxxxxxx.xx&amp;gt; 1282734563 +0800&lt;br /&gt;committer Jan &amp;lt;j@xxxxxxxx.xx&amp;gt; 1282734563 +0800&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The file name of the commit is ./objects/bb/a640a7830fafa3d9ae352a2b060df600a4d5e7, so I just modified the content of refs/head/branch-name to bba640a7830fafa3d9ae352a2b060df600a4d5e7.&lt;br /&gt;&lt;br /&gt;The last step is go back to the repo, clean the repo with 'git reset --hard' because the files are still in old revision. Then everything just come back!&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/Rc5rQTv5LOg&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-1567271089772817788</guid>
         <pubDate>Wed, 25 Aug 2010 21:38:00 +0000</pubDate>
      </item>
      <item>
         <title>Universal Quantification, Bound and Existential Quantification</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/Y8VYfxYpbSA/universal-quantification-bound-and.html</link>
         <description>Universal quantification is usually not very useful. Inside the body of a universal quantified function, what you know about the argument is very general, because the argument can be *any* type. Suppose you're writing a function with type *-&amp;gt;Int, what do you think the function can do? The only implementation I can think of is a constant function:&lt;br /&gt;&lt;br /&gt;(pseudo codes)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  f1 :: [forall a] a -&amp;gt; Int&lt;br /&gt;  f1 x = 1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In contrast, existential quantified functions are very useful, because there're always *some* types can do certain things. Use the same example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  f2 :: [exist a] a -&amp;gt; Int&lt;br /&gt;  f2 x = length x&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I can do nearly anything inside f2, because there's always some x will satify the operations applied on them.&lt;br /&gt;&lt;br /&gt;You should notice that only functions or Bottom can have universal quantified type.&lt;br /&gt;&lt;br /&gt;Bound helps universal quantification a lot. When you give a bound to universal quantification, you give it extra informations.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/Y8VYfxYpbSA&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-981404386302312303</guid>
         <pubDate>Thu, 01 Jul 2010 01:39:00 +0000</pubDate>
      </item>
      <item>
         <title>Ruby 1.8.7 and openssl 1.0.0</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/zgK7YBoukqA/ruby-187-and-openssl-100.html</link>
         <description>Archlinux upgrade openssl from 0.9.8 to 1.0.0 recently, which caused a big headache for me: all ruby distributions, except the latest ruby source code in svn, failed to compile with the new openssl, e.g. (compile error of 1.8.7):&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;ossl_ssl.c: In function ?ossl_sslctx_get_ciphers?:&lt;/div&gt;&lt;div&gt;ossl_ssl.c:626:19: error: ?STACK? undeclared (first use in this function)&lt;/div&gt;&lt;div&gt;ossl_ssl.c:626:19: note: each undeclared identifier is reported only once for each function it appears in&lt;/div&gt;&lt;div&gt;ossl_ssl.c:626:25: error: expected expression before ?)? token&lt;/div&gt;&lt;div&gt;ossl_ssl.c:629:47: error: expected expression before ?)? token&lt;/div&gt;&lt;div&gt;ossl_ssl.c:629:47: error: too few arguments to function ?sk_value?&lt;/div&gt;&lt;div&gt;/usr/include/openssl/stack.h:80:7: note: declared here&lt;/div&gt;&lt;div&gt;ossl_ssl.c: In function ?ossl_ssl_get_peer_cert_chain?:&lt;/div&gt;&lt;div&gt;ossl_ssl.c:1199:5: warning: passing argument 1 of ?sk_num? from incompatible pointer type&lt;/div&gt;&lt;div&gt;/usr/include/openssl/stack.h:79:5: note: expected ?const struct _STACK *? but argument is of type ?struct stack_st_X509 *?&lt;/div&gt;&lt;div&gt;ossl_ssl.c:1202:2: warning: passing argument 1 of ?sk_value? from incompatible pointer type&lt;/div&gt;&lt;div&gt;/usr/include/openssl/stack.h:80:7: note: expected ?const struct _STACK *? but argument is of type ?struct stack_st_X509 *?&lt;/div&gt;&lt;div&gt;ossl_ssl.c: In function ?ossl_ssl_get_cipher?:&lt;/div&gt;&lt;div&gt;ossl_ssl.c:1224:12: warning: assignment discards qualifiers from pointer target type&lt;/div&gt;&lt;div&gt;make[1]: *** [ossl_ssl.o] Error 1&lt;/div&gt;&lt;div&gt;make: *** [all] Error 1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://gist.github.com/391947&quot;&gt;Here's a patch for 1.8.7&lt;/a&gt;, it's a modified version of &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cvs.fedoraproject.org/viewvc/rpms/ruby/F-12/ruby-openssl-1.0.patch?view=log&quot;&gt;this&lt;/a&gt;. Copy and save it as openssl.patch in 1.8.7 source directory, run 'patch -p0 &amp;lt; openssl.patch' and recompile, there should be no errors anymore.&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/zgK7YBoukqA&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-971354260129952611</guid>
         <pubDate>Thu, 06 May 2010 01:57:00 +0000</pubDate>
      </item>
      <item>
         <title>GoF's refactoring draft of the old 23 design patterns</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/oyAGvHJzMDY/refactoring-draft-of-old-23-design.html</link>
         <description>* Interpreter and Flyweight should be moved into a separate category that we referred to as &quot;Other/Compound&quot; since they really are different beasts than the other patterns. Factory Method would be generalized to Factory.&lt;br /&gt;&lt;br /&gt;* The categories are: Core, Creational, Peripheral and Other. The intent here is to emphasize the important patterns and to separate them from the less frequently used ones.&lt;br /&gt;&lt;br /&gt;* The new members are: Null Object, Type Object, Dependency Injection, and Extension Object/Interface (see &quot;Extension Object&quot; in Pattern Languages of Program Design 3, Addison- Wesley, 1997).&lt;br /&gt;&lt;br /&gt;* These were the categories:&lt;br /&gt;&amp;nbsp;&amp;nbsp;+ Core: Composite, Strategy, State, Command, Iterator, Proxy, Template Method, Facade&lt;br /&gt;&amp;nbsp;&amp;nbsp;+ Creational: Factory, Prototype, Builder, Dependency Injection&lt;br /&gt;&amp;nbsp;&amp;nbsp;+ Peripheral: Abstract Factory, Visitor, Decorator, Mediator, Type Object, Null Object, Extension Object&lt;br /&gt;&amp;nbsp;&amp;nbsp;+ Other: Flyweight, Interpreter&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.informit.com/articles/article.aspx?p=1404056&quot;&gt;via&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/oyAGvHJzMDY&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-2474384058800818202</guid>
         <pubDate>Thu, 25 Mar 2010 00:38:00 +0000</pubDate>
      </item>
      <item>
         <title>[ANN] Rubytest.vim 1.0.0 Released</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/GnXygnz0d2k/ann-rubytestvim-100-released.html</link>
         <description>Rubytest.vim is a vim (http://www.vim.org) plugin, which helps you to  run tests/specs/features in vim, in order to accelerate your red-green development circle.&lt;br /&gt;&lt;br /&gt;Within this realease, rubytest.vim supports almost all popular TDD/BDD frameworks in ruby community: testunit, rspec, shoulda, cucumber ...&lt;br /&gt;&lt;br /&gt;Happy hacking!&lt;br /&gt;&lt;br /&gt;Changelog&lt;br /&gt;---------&lt;br /&gt;&lt;br /&gt;* Support cucumber features&lt;br /&gt;* Support rspec drb mode&lt;br /&gt;* Serveral bug fixes&lt;br /&gt;&lt;br /&gt;Get it here: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.vim.org/scripts/script.php?script_id=2612&quot;&gt;http://www.vim.org/scripts/script.php?script_id=2612&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/GnXygnz0d2k&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-641606942972146433</guid>
         <pubDate>Wed, 10 Mar 2010 20:49:00 +0000</pubDate>
      </item>
      <item>
         <title>TokyoTyrant vs MongoDB vs CouchDB, simple benchmarks</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/mhvE6YdyD2Y/tokyotyrant-vs-mongodb-vs-couchdb.html</link>
         <description>Jeffery Zhao published &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.cnblogs.com/JeffreyZhao/archive/2010/02/24/mongodb-tokyo-tyrant-benchmark-1-basic-cru-operations.html&quot;&gt;a simple benchmark&lt;/a&gt; of 2 '&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Nosql&quot;&gt;NoSQL&lt;/a&gt;' databases recently. In that article only basic CRU operations are compared. On macbook unibody+osx, which is the platform Jeff use, &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/MongoDB&quot;&gt;MongoDB&lt;/a&gt; got slightly better scores than &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1978th.net/tokyotyrant/&quot;&gt;TokyoTyrant&lt;/a&gt; on almost every aspect.&lt;br /&gt;&lt;br /&gt;We're very interested in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://couchdb.apache.org/&quot;&gt;CouchDB&lt;/a&gt; these days, so I &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/janx/mdb-tt-benchmark&quot;&gt;cloned Jeff's benchmark suite, added scripts for CouchDB&lt;/a&gt;, and ran the benchmark on my platform, macbook unibody+archlinux again. However the result is really interesting - it's totally the opposite - TokyoTyrant is much more faster than MongoDB on my box.&lt;br /&gt;&lt;br /&gt;Results:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CouchDB is really slow compared to TT or MongoDB, so I just give up it after serveral round.&lt;br /&gt;&lt;br /&gt;The only difference between Jeff's and mine platform seems operating system: he use OSX while I use linux. I'm not sure whether this is the reason we get different results, or because TT is well optimized by gcc on linux?&lt;br /&gt;&lt;br /&gt;Try it yourself: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/janx/mdb-tt-benchmark&quot;&gt;Simple NoSQL Bench&lt;/a&gt; (The suite is written in Ruby)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;update: After changed from Net::HTTP to Curb, couchdb benchmarks improved about 1/3. Config couchdb [uuids] algorithm to sequential (in default.ini) has no effect on result. All 3 drivers connect to database through network, but only couchdb use http protocol, this is a bottleneck, or, trade off.&lt;/span&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/mhvE6YdyD2Y&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-8613328031398632316</guid>
         <pubDate>Sun, 28 Feb 2010 18:17:00 +0000</pubDate>
      </item>
      <item>
         <title>Not Invented Here</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/HueZbA6jIhQ/not-invented-here.html</link>
         <description>'In programming, it is also common to refer to the NIH Syndrome as the tendency towards reinventing the wheel (reimplementing something that is already available) based on the flawed belief that in-house developments are inherently better suited, more secure or more controlled than existing implementations. This argument is accepted as flawed because wide usage is much more likely to uncover any existing defects than reimplementation. Even more, peer review of source code in the case of a Free Software or Open Source alternative tends to follow Linus' Law: &quot;given enough eyeballs, all bugs are shallow&quot;'&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/NIH_syndrome&quot;&gt;Not Invented Here&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/HueZbA6jIhQ&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-2278884282354223435</guid>
         <pubDate>Sun, 28 Feb 2010 17:49:00 +0000</pubDate>
      </item>
      <item>
         <title>Patent System</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/dK5sHbZg9eE/patent-system.html</link>
         <description>&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://news.slashdot.org/comments.pl?sid=1560168&amp;amp;cid=31244084&quot;&gt;HungryHobo's comment&lt;/a&gt; on /.:&lt;br /&gt;&lt;br /&gt;Without patents:&lt;br /&gt;&lt;br /&gt;1: I write some nice software and sell it.&lt;br /&gt;2a: I make a little money, not enough to quit my day job.&lt;br /&gt;2b: I don't make money, all I've lost is time.&lt;br /&gt;&lt;br /&gt;With patents:&lt;br /&gt;&lt;br /&gt;1: I try to research previous patents, they're almost unreadable..... I have no money to hire a patent lawyer(barrier to entry one)... so I can't be certain if my idea has already been patented.&lt;br /&gt;2a: I stop for fear of infringing on someones patent and being sued into the ground.(barrier to entry 2)&lt;br /&gt;2b: I keep going and write my app... it might be infringing but I don't think it is....&lt;br /&gt;3a: I make a little money.&lt;br /&gt;3b: I make no money.&lt;br /&gt;4: Someone sues me.&lt;br /&gt;5a: It is infringing- well they pull out records that yes I did view their patent in the course of my research in step 1 and obviously stole their idea. They get tripple damages I lose my house. (barrier to entry 3)&lt;br /&gt;5b: It is not infringing - so what. I don't have the money for a good lawyer, they win I lose my house.(barrier to entry 4)&lt;br /&gt;5c: It is not infringing - by some miracle I win.... I'm still left with a pile of legal bills and I lose my house.(barrier to entry 5)&lt;br /&gt;&lt;br /&gt;In theory the patent system could help me by letting me be just like the guys who sue in the above but I don't have the thousands of dollars it takes to get a patent through nor the time.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/dK5sHbZg9eE&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-5024403375155236629</guid>
         <pubDate>Tue, 23 Feb 2010 19:12:00 +0000</pubDate>
      </item>
      <item>
         <title>Random thoughts on AI</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/48QI7MNg2XU/random-thoughs-on-ai.html</link>
         <description>I'm always pessimistic about AI.&lt;br /&gt;&lt;br /&gt;Our current computation model is deterministic. Do you remember how Dijkstra 'proves' goto statement is harmful? He use one (or serveral) natural number(s) to represent the state of your process. We can map serveral natural numbers to a rational number, so in fact we can represent any state of any process as a rational number. A Turing Machine program has only two possible results: either terminate in finite time, like finite numbers, or trap in a infinite loop, like repeating decimals. Lambda calculus is proven to be a equivalence of Turing Machine.&lt;br /&gt;&lt;br /&gt;But our brain is non-deterministic. I have a strong feeling that you can't describe the state of brain by a rational number, but a irrational number. You can predict what's the n-th digit of a rational number, while you can't predict the n-th digit of a irrational number, you won't know it until your computation reached that point.&lt;br /&gt;&lt;br /&gt;The problem is that rational numbers live in a closure. You can't get an irrational number by applying basic arithmetic on rational number. If we can't get irrational number from rational number, can we get a brain from Turing machine? Maybe, if we find which state does PI represent of in a program.&lt;br /&gt;&lt;br /&gt;The foundation of our world is non-deterministic. It seems easy to build deterministic base on non-deterministic, but hard in reverse. So I guess it will be hard to build a brain base on Turing Machine. Fortunately we have a new hope at our age, named Quantum Computing, which is based on non-deterministic mechanism. I know little about how it works, but it looks totally different from old fashion computation models.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/48QI7MNg2XU&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-5831265371378699136</guid>
         <pubDate>Tue, 05 Jan 2010 19:54:00 +0000</pubDate>
      </item>
      <item>
         <title>CS Education</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/UHDRHfwY9o8/cs-education.html</link>
         <description>&quot;Programming is usually taught by examples. Experience shows that the success of a programming course critically depends on the choice of these examples. Unfortunately, they are too often selected with the prime intent to demonstrate what a computer can do. Instead, a main criterion for selection should be their suitability to exhibit certain widely applicable techniques. Furthermore, examples of programs are commonly presented as finished &quot;products&quot; followed by explanations of their purpose and their linguistic details. But active programming consists of the design of new programs, rather than contemplation of old programs. As a consequence of these teaching methods, the student obtains the impression that programming consists mainly of mastering a language (with all the peculiarities and intricacies so abundant in modern PL's) and relying on one's intuition to somehow transform ideas into finished programs. Clearly, programming courses should teach methods of design and construction, and the selected examples should be such that a gradual development can be nicely demonstrated. &quot;&lt;br /&gt;&lt;br /&gt;- &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sunnyday.mit.edu/16.355/wirth-refinement.html&quot;&gt;&quot;Program Development by Stepwise Refinement&quot;&lt;/a&gt;, Niklaus Wirth, 1995&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/UHDRHfwY9o8&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-9037816770731536292</guid>
         <pubDate>Thu, 26 Nov 2009 23:03:00 +0000</pubDate>
      </item>
      <item>
         <title>Browserless Web Development</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/gpQQCkggPiM/browserless-web-development.html</link>
         <description>&lt;span style=&quot;font-style:italic;&quot;&gt;note: &quot;Web development&quot; in this article doesn't include UI design/implementation, which means all (backend, database, html etc.) except css/javascript.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I just found a new measure on code/web-developer recently. A traditional web development loop may look like this:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;read new feature/story&lt;/li&gt;&lt;li&gt;code&lt;/li&gt;&lt;li&gt;try it in browser, if there's any problem, goto 2 (goto considered useful here)&lt;/li&gt;&lt;li&gt;commit your code&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;An obvious problem here is, there's no room left for *automated* test. You may write *automated* test in step 2, but no one force you to do it. A better process (I think) should be like this:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;read new feature/story&lt;/li&gt;&lt;li&gt;code&lt;/li&gt;&lt;li style=&quot;font-weight:bold;&quot;&gt;write a piece of code to test code in step 2, if there's any problem, goto 2&lt;/li&gt;&lt;li&gt;commit your code&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;So we change step 3 only, removed browser from our process. *Automated* test become an explicit step here. You can switch step 2/3 in the latter process, so you'll write test first in that case, that's not the point here so I left them unchanged. The point is if you don't have a browser at hand you'll be forced to test your code by writing code, which is automated, reusable and cool. You'll find you're working in TDD style naturally even you don't know what TDD is.&lt;br /&gt;&lt;br /&gt;That's what I called Browserless Web Development. The less a web developer use browser to validate his work, the better he and his code are.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/gpQQCkggPiM&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-7998622422017099157</guid>
         <pubDate>Tue, 24 Nov 2009 19:13:00 +0000</pubDate>
      </item>
      <item>
         <title>Software Engineering is ...</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/_VnXlH7qQOw/software-engineering-is.html</link>
         <description>You know, Dijkstra is really awesome.&lt;br /&gt;&lt;br /&gt;&quot;Ours is the task to remember (and to remind) that, in what is now called “software engineering”, not a single sound engineering principle is involved. (On the contrary: its spokesmen take the trouble of arguing the irrelevance of the engineering principles known.) Software Engineering as it is today is just humbug; from an academic —i.e. scientific and educational— point of view it is a sham, a fraud.&quot;&lt;br /&gt;&lt;br /&gt;&quot;Universities are always faced with something of a problem when there is a marked discrepancy between what society asks for and what society needs. In our case the need is clear: the professional competence of the Mathematical Engineer, familiar with discrete systems design and knowing how to use formal techniques for preventing unmastered complexity from creeping in. But said war “out there” all but prevents this need from being perceived, and what our immediate industrial environment overwhelmingly seems to ask for is different brands of snake oil, Software Engineering, of course, being one of them. And as, with the recession lasting longer and longer, the external pressures on the Universities to do the wrong things only mount, it is only to be expected that part of the campus is going to be included in the battlefield.&quot;&lt;br /&gt;&lt;br /&gt;&quot;The task of the first-class University, however, is absolutely clear. Industry being its customer, consultancy must tell industry what it wants to hear; it is the task of the first-class University to tell industry what it does not want to hear, whereby it is the rôle of its scientific authority to ensure that the sting of the academic gadfly really hurts.&quot;&lt;br /&gt;&lt;br /&gt;-- Edsger W. Dijkstra, &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.cs.utexas.edu/users/EWD/transcriptions/EWD11xx/EWD1165.html&quot;&gt;http://www.cs.utexas.edu/users/EWD/transcriptions/EWD11xx/EWD1165.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;&lt;br /&gt;It's interesting just after I read Dijkstra's article, Joel Spolsky published a new blog post &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.joelonsoftware.com/items/2009/10/26.html&quot;&gt;&quot;Capstone projects and time management&quot;&lt;/a&gt;, to some extent on the opposite side of Dijkstra. Joel wrote lots with wisdom, but this new post just looks like an april fool's joke. A smart guy wrote a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://stochasticgeometry.wordpress.com/2009/10/27/joel-spolsky-snake-oil-salesman/&quot;&gt;perfect answer&lt;/a&gt; to Joel already.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/_VnXlH7qQOw&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-6143607137501379962</guid>
         <pubDate>Mon, 26 Oct 2009 19:44:00 +0000</pubDate>
      </item>
      <item>
         <title>The Correct Refactor Flow</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/SC8p2xqYdsY/correct-refactor-flow.html</link>
         <description>&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;Get assigned a task to implement a new feature.&lt;/li&gt;&lt;li&gt;Refactor the code until that feature is as easy to add as possible.&lt;/li&gt;&lt;li&gt;Add the feature.&lt;/li&gt;&lt;li&gt;Submit.&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;Read this enlightening piece &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.reddit.com/r/programming/comments/9scll/askproggit_help_me_find_flaw_in_this_logic_if_we/c0e7ndm&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;update: I found this is indeed originated from Martin Fowler's amazing book &quot;Refactoring&quot;, which is filled with ideas originated from practices of smalltalk. It's a shame I didn't read that book earlier :-( &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262011447&amp;amp;sr=8-1&quot;&gt;&quot;Refactoring&quot;&lt;/a&gt; (or &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/Refactoring-Ruby-Jay-Fields/dp/0321603508/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262011451&amp;amp;sr=8-1&quot;&gt;&quot;Refactoring: Ruby Edition&quot;&lt;/a&gt;) is a must read.&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/SC8p2xqYdsY&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-7353392853246253189</guid>
         <pubDate>Fri, 09 Oct 2009 20:28:00 +0000</pubDate>
      </item>
      <item>
         <title>Notes on Alan Kay's &quot;The Early History of Smalltalk&quot;</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/8lEA3ct3r-8/notes-on-alan-kays-early-history-of.html</link>
         <description>&lt;span&gt;&quot;In computer terms, Smalltalk is a recursion on the notion of computer itself. Instead of dividing &quot;computer stuff&quot; into things each less strong than the whole--like data structures, procedures, and functions which are the usual paraphernalia of programming languages--each Smalltalk object is a recursion on the entire possibilities of the computer. Thus its semantics are a bit like having thousands and thousands of computer all hooked together by a very fast network.&quot;&lt;/span&gt;  &lt;span style=&quot;font-style:italic;&quot;&gt;(I never think OO in this way before I read this, it changes my view of programming, made so many design pattern look naturally. This is a whole different way to explain why recursion is the root of computer (you know the original way is by lambda calculus))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;Programming languages can be categorized in a number of ways: imperative, applicative,    logic-based, problem-oriented, etc.  But they all seem to be either an &quot;agglutination of features&quot;   or a &quot;crystallization of style.&quot;  COBOL, PL/1, Ada, etc., belong to the first kind; LISP, APL--   and Smalltalk--are the second kind.  It is probably not an accident that the agglutinative languages   all seem to have been instigated by committees, and the crystallization languages by a single person.&quot;  &lt;span style=&quot;font-style:italic;&quot;&gt;(Very interesting observation. It seems single-person languages are more popular today)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;I could hardly believe how beautiful and wonderful the idea of LISP was. I say it this way because LISP had not only been around enough to get some honest barnacles, but worse, there wee deep falws in its logical foundations. By this, I mean that the pure language was supposed to be based on functions, but its most important components---such as lambda expressions quotes, and conds--where not functions at all, and insted ere called special forms. Landin and others had been able to get quotes and cons in terms of lambda by tricks that were variously clever and useful, but the flaw remained in the jewel. In the practical language things were better. There were not just EXPRs (which evaluated their arguments0, but FEXPRs (which did not). My next questions was, why on earth call it a functional language? Why not just base everuything on FEXPRs and force evaluation on the receiving side when needed?&quot;  &lt;span style=&quot;font-style:italic;&quot;&gt;(I like Alan Kay's criticism because what he wanted LISP to be looks exactly like Haskell :) He used an interesting description for LISP: 'surface beauty'. My opinion is LISP is still great, but not in practical sense now. All gurus suggest learning lisp but only for 'think different', not for using it in daily work.  Alan Kay tell an incident later and said:  &lt;/span&gt;&quot;Watching a famous guy much smarter than I struggle for more than 30 minutes to not quite solve the problem his way (there was a bug) made quite an impression. It brought home to me once again that &quot;point of view is worth 80 IQ points.&quot; I wasn't smarter but I had a much better internal thinking tool to amplify my abilities.&quot; &lt;span style=&quot;font-style:italic;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;I didn't like meetings: didn't believe brainstorming could substitute for cool sustained thought.&quot;&lt;br /&gt;&lt;br /&gt;&quot;The actual beauty of LISP came more from the promise of its metastrcutures than its actual model. I spent a fair amount of time thinking about how objects could be characterized as universal computers without having to have any exceptions in the central metaphor. What seemed to be needed was complete control over what was passed in a message send; in particular &lt;span style=&quot;font-weight:bold;&quot;&gt;when &lt;/span&gt;and &lt;span style=&quot;font-weight:bold;&quot;&gt;in what environment&lt;/span&gt; did expressions get evaluted? &quot;&lt;br /&gt;&lt;br /&gt;&quot;A simple and small system that can do interesing things also needs a &quot;high slope&quot;--that is a good match between the degree of interestingness and the level of complexity needed to express it. &quot;&lt;br /&gt;&lt;br /&gt;&quot;The latter was deemed to be hard and would be handled by the usual method for hard problems, namely, give them to grad students. &quot;&lt;br /&gt;&lt;br /&gt;&quot;Of course, the whole idea of Smalltalk (and OOP in general) is to define everything &lt;span style=&quot;font-weight:bold;&quot;&gt;intensionally&lt;/span&gt;. &quot;&lt;br /&gt;&lt;br /&gt;&quot;Perhaps the most important principle--again derived from operating system architectures--is that when you give someone a structure, rarely do you want them to have unlimited priviledges with it. Just doing type-matching isn't even close to what's needed. Nor is it terribly useful to have some objects protected and others not. Make them all first class citizens and protect all. &quot;&lt;br /&gt;&lt;br /&gt;&quot;... this led to a 90 degree rotation of the purposed of the user interface from&quot;access to functionality&quot; to &quot;environment in which users learn by doing.&quot;&quot; &lt;span style=&quot;font-style:italic;&quot;&gt;(This is how overlapping windows user interface came out. I think this is also a proof why a programmer should work with keyboard+tilling windown manager: overlapping windows system, and in fact all GUI, is for end users who 'learn by doing'. Programmers are professionals, they should have already learnd their tools before doing anything, they shouldn't learn by doing. I never found a great programmer who mainly use mouse/GUI.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;By now it was already 1979, and we found ourselves doing one of our many demos, but this time for a very interested audience: Steve Jobs, JeffRaskin, and other technical people from Apple. They had started a project called Lisa but weren't quite sure what it shouldbe like, until Jeff said to Steve, &quot;You should really come over to PARC and see what they ae doing.&quot; Thus, more than eight years after overlapping windows had been invented and more than six years after the ALTO started running, the people who could really do something about the ideas, finally to to see them. The machine used was the Dorado, a very fast &quot;big brother&quot; of the ALTO, whose Smalltalk microcode had been largely written by Bruce Horn, one of our original &quot;Smalltalk kids&quot; who was still only a teen-ager. Larry Tesler gave the main part of the demo with Dan sitting in the copilot's chair and Adele and I watched from the rear. One of the best parts of the demo was when Steve Jobs said he didn't like the blt-style scrolling we were using and asked if we cold do it in a smooth continuous style. In less than a minute Dan found the methods involved, made the (relatively major) changes and scrolling was now continuous! This shocked the visitors, espeicially the programmers among them, as they had never seen a really powerful incremental system before. Steve tried to get and/or buy the technology from Xerox (which was one of Apple's minority venture captialists), but Xerox would neither part with it nor would come up with the resources to continue to develop it in house by funding a better NoteTaker cum Smalltalk. &quot; &lt;span style=&quot;font-style:italic;&quot;&gt;(How stupid Xerox is. In fact Alan Kay has predicted personal computing 30 years ago and reported his vision to Xerox many times. But Xerox just ignored those reports. If Xerox took Alan's work/suggestions seriously, it's very likely to be Microsoft+Apple today, not merely a laser printer company.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&quot;One way to think about progress in software is that a lot of it has been about finding ways to late-bind&quot;&lt;br /&gt;&lt;br /&gt;&quot;Hardware is really just software crystallized early. It is there to make program schemes run as efficiently as possible. But far too often the hardware has been presented as a given and it is up to software designers to make it appear reasonable. This has caused low-level techniques and excessive optimization to hold back progress in program design. ... In short, most hardware designs today are just re-optimizations of moribund architectures. &quot;&lt;br /&gt;&lt;br /&gt;&quot;Objects made on different machines and with different languages should be able to talk to each other--and will have-to in the future.&quot;&lt;br /&gt;&lt;br /&gt;&quot;I think the enormous commercialization of personal computering has smothered much of the kind of work that used to go on in universities and research labs, by sucking the talented kids towards practical applications. With companies so risk-adverse towards doing their own HW, and the HW companies betraying no real understanding of SW, the result has been a great step backwards in most respects. &quot;&lt;br /&gt;&lt;br /&gt;Ref. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://gagne.homedns.org/%7Etgagne/contrib/EarlyHistoryST.html?repost=repost&quot;&gt;&quot;The Early History of Smalltalk&quot;&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/8lEA3ct3r-8&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-8173544118964381428</guid>
         <pubDate>Thu, 10 Sep 2009 23:06:00 +0000</pubDate>
      </item>
      <item>
         <title>Cross-VM Attack on EC2</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/C3u4_LvNDzU/cross-vm-attack-on-ec2.html</link>
         <description>Researchers from UCSD and MIT published a paper which shows vulnerability of cloud computing: cross-vm attack. With this technique a malicious user can run a new ec2 instance on the same physical machine as target vm instance, and exploit information leakage of target vm.&lt;br /&gt;&lt;br /&gt;Read it: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://people.csail.mit.edu/tromer/papers/cloudsec.pdf&quot;&gt;http://people.csail.mit.edu/tromer/papers/cloudsec.pdf&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/C3u4_LvNDzU&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-6327458527674607469</guid>
         <pubDate>Wed, 02 Sep 2009 07:46:00 +0000</pubDate>
      </item>
      <item>
         <title>Dunning-Kruger effect</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/w_dYoVXGyZ0/dunning-kruger-effect.html</link>
         <description>&quot;The Dunning-Kruger effect is an example of cognitive bias in which '...people reach erroneous conclusions and make unfortunate choices but their incompetence robs them of the metacognitive ability to realize it'.&quot;&lt;br /&gt;&lt;br /&gt;&quot;They therefore suffer an illusory superiority, rating their own ability as above average. This leads to a perverse result where people with less competence will rate their ability more highly than people with relatively more competence.&quot;&lt;br /&gt;&lt;br /&gt;&quot;It also explains why competence may weaken the projection of confidence because competent individuals falsely assume others are of equivalent understanding 'Thus, the miscalibration of the incompetent stems from an error about the self, whereas the miscalibration of the highly competent stems from an error about others.'&quot;&lt;br /&gt;&lt;br /&gt;see &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Dunning-Kruger_effect&quot;&gt;Wikipedia&lt;/a&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/w_dYoVXGyZ0&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-2823354233908303960</guid>
         <pubDate>Wed, 29 Jul 2009 19:40:00 +0000</pubDate>
      </item>
      <item>
         <title>Ubiquitous Monad</title>
         <link>http://feedproxy.google.com/~r/ReadWriteSleep/~3/51fdXXwAZ2A/ubiquitous-monad.html</link>
         <description>It seems I had an 'aha!' time with monad today, finally. It seems monad is everywhere.&lt;br /&gt;&lt;br /&gt;In a functional world with currying, we can think all functions are in the type x -&amp;gt; y. We can divide those functions into two category:&lt;br /&gt;&lt;br /&gt;  1. a -&amp;gt; a, these are functions who have same input and output type&lt;br /&gt;  2. a -&amp;gt; b, there are the functions who have different input and output type&lt;br /&gt;&lt;br /&gt;Functions in category one can work with functions have the same type as them easily, suppose you have f::Int-&amp;gt;Int and g::Int-&amp;gt;Int, you can combine them as you wish, like f.f.f.g.g.g.f.g.g.f. This is why people like functional programming.&lt;br /&gt;&lt;br /&gt;But this is not true for functions in 2rd category. Suppose you have f::Int-&amp;gt;Float and g::Int-&amp;gt;Float, how would you combine them? You can do neither f.g nor g.f, the types just don't match. As you can feel, there's much more functions in 2rd category than those in 1st category in real world. So monad comes to rescue.&lt;br /&gt;&lt;br /&gt;Monad helps functions in 2rd category behave like those ones in 1st category - it can 'lift' a 2rd category function to 1st category, with one of its core functions named bind:&lt;br /&gt;&lt;br /&gt;  bind :: (a -&amp;gt; b) -&amp;gt; (b -&amp;gt; b)&lt;br /&gt;&lt;br /&gt;In haskell b is a Monad. If you have read a tutorial take Maybe monad as example, you may have an intuition that monad is a 'wrapper' which wrap something. That's not exactly. The key here is to define a way to convert a value of type a to a value to type b, and vice vesa. Wrap a value is an easy and intuitive way to do the conversion, but not the only way (e.g. List Monad is a good example). So you can think everything as Monad, because type a -&amp;gt; b function is everywhere. Yes Float is monad, because there is a function in type Int -&amp;gt; Float and you can define a bind in type (Int -&amp;gt; Float) -&amp;gt; (Float -&amp;gt; Float).&lt;img src=&quot;http://feeds.feedburner.com/~r/ReadWriteSleep/~4/51fdXXwAZ2A&quot; height=&quot;1&quot; width=&quot;1&quot; alt=&quot;&quot;/&gt;</description>
         <author>Jan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6265706250887913030.post-4205740799660150820</guid>
         <pubDate>Mon, 27 Jul 2009 04:34:00 +0000</pubDate>
      </item>
      <item>
         <title>拜大神.. 这种速度和难度和艺术性之下一个桩都没倒啊混蛋！！</title>
         <link>http://jan.ycool.com/post.4603449.html</link>
         <description>热爱踢桩的ksj同学这次不知道吃什么药了... 又一个经典套路诞生～～ Orzzz&lt;br /&gt;&lt;br /&gt;&lt;embed src=&quot;http://player.youku.com/player.php/sid/XMjk3NzQ0MTky/v.swf&quot; width=&quot;480&quot; height=&quot;400&quot; align=&quot;middle&quot; type=&quot;application/x-shockwave-flash&quot;/&gt;...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4603449.html</guid>
         <pubDate>Fri, 26 Aug 2011 02:08:29 +0000</pubDate>
      </item>
      <item>
         <title>漂亮的话儿，不知道谁说的</title>
         <link>http://jan.ycool.com/post.4600120.html</link>
         <description>&quot;最好的爱是两个人彼此做个伴。不要束缚，不要缠绕，不要占有，不要渴望从对方的身上挖掘到意义，那是注定要落空的东西。而应该是，我们两个人，并排站在一起，看看这个落寞的人间。&quot;...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4600120.html</guid>
         <pubDate>Fri, 01 Jul 2011 18:07:49 +0000</pubDate>
      </item>
      <item>
         <title>浙江大学获ACM-ICPC World Finals 2011冠军</title>
         <link>http://jan.ycool.com/post.4597345.html</link>
         <description>太霸气了，太霸气了，一代更比一代浪阿&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cm.baylor.edu/ICPCWiki/Wiki.jsp?page=Results%20World%20Finals%202011&quot;&gt;https://cm.baylor.edu/ICPCWiki/Wiki.jsp?page=Results%20World%20Finals%202011&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://node0.foto.ycstatic.com/201105/31/6/28996566.jpg&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4597345.html</guid>
         <pubDate>Tue, 31 May 2011 04:05:51 +0000</pubDate>
      </item>
      <item>
         <title>夏</title>
         <link>http://jan.ycool.com/post.4595066.html</link>
         <description>不知不觉的，走在路上又会冒汗了。不知不觉已经不记得有多久没有平花，断绝一切有关这项运动的消息，直到突然看见比赛的报名表上一片生机勃勃的18岁选手，应了老婆不久前的一句饭间吐槽，谢谢老了。从来都最喜欢夏天。春天莫名生长，秋天享受果实，冬天挂在墙上，是夏天你有能力流下汗水，改变世界。&lt;br /&gt;&lt;br /&gt;企图在房间摆个字画，一直没想好要哪几个字。看到老婆轰隆隆的到处面试，决定了。&lt;br /&gt;&lt;br /&gt;“跳出三界外，不在五行中”&lt;br /&gt;&lt;br /&gt;霸气极了。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4595066.html</guid>
         <pubDate>Fri, 29 Apr 2011 06:04:53 +0000</pubDate>
      </item>
      <item>
         <title>今天貌似是个节日</title>
         <link>http://jan.ycool.com/post.4582631.html</link>
         <description>写字楼下面好不热闹，一片喜气洋洋。&lt;br /&gt;&lt;br /&gt;上个礼拜把我那可心肝可宝贝儿的胃给吃坏了。话说叔叔我小时候看过很多遍《&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://fifid.com/site_search?cx=003017831450918707819%3Ae2pgfm8nybw&amp;cof=FORID%3A10&amp;ie=UTF-8&amp;q=%E9%82%8B%E9%81%A2%E5%A4%A7%E7%8E%8B%E5%8E%86%E9%99%A9%E8%AE%B0&quot;&gt;邋遢大王历险记&lt;/a&gt;》，那小子后面的悲惨遭遇没记太住，那句&quot;不干不净吃了没病&quot;是印在脑海中时刻准备着。其实我的运气也挺好的，从小到大吃了那么多不干不净的东西一直没出什么事，导致我有种不死鸟一辉附体的错觉。其实对面百脑汇五楼餐厅的卫生状况之令人发指我已经领教过多次 ，可惜即使是在那儿的牛腩米粉中吃出了钢丝球之后我还是死不悔改的继续光顾，在错误的道路上越走越远，终于倒在了那碗看上去特别人畜无害的片儿川上。&lt;br /&gt;&lt;br /&gt;开始是吐，后来是泄，叔叔也算是老骨头中比较牛b的那把，硬是挺了三天才拖着两条棉花腿硬沉一口丹田气去的医院。不过也正是这样我才彻底感受到输液这发明的伟大，它是那样的雷厉风行，直捣黄龙，以至于输液之前已经在肚子酝酿的那泡在点滴打完后都魂飞魄散鸟，让人禁不住意气风发，让人想起了主席他老人家说的敢上九天揽月，敢下五洋捉鳖。&lt;br /&gt;&lt;br /&gt;医院输液区几乎都是小孩。有个小孩特别闹，一直疯狂的哭个不停，要买玩具，这教育算是失败了；有个奶奶陪着个小女孩，一直说你妈都不来了，不要你了，不明白为什么要对小孩子说这样的话；对面做着貌似姐姐陪着妹妹，小女孩拿着手机玩；右边小孩特别可怜，手脚都扎满了针眼，头上扎了五针，最后还是在脚上扎成功。&lt;br /&gt;&lt;br /&gt;一位爸爸带了个小男孩，吊瓶子之前父子俩在玩石头剪刀布，吊瓶子之后一起下强手棋，小男孩从头到尾都乐呵呵的。真佩服那位爸爸，那天是星期五，他也许请了假。&lt;br /&gt;...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4582631.html</guid>
         <pubDate>Fri, 24 Dec 2010 11:12:50 +0000</pubDate>
      </item>
      <item>
         <title>很多钱</title>
         <link>http://jan.ycool.com/post.4576628.html</link>
         <description>不去看电影，贵&lt;br /&gt;不去划船，贵&lt;br /&gt;不去打电动，贵&lt;br /&gt;不去吃大餐，贵&lt;br /&gt;不去旅游，贵&lt;br /&gt;&lt;br /&gt;有人翻着相册，想着以前的快乐&lt;br /&gt;有人看着存折，觉得自己有很多钱&lt;br /&gt;...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4576628.html</guid>
         <pubDate>Thu, 04 Nov 2010 09:11:46 +0000</pubDate>
      </item>
      <item>
         <title>转载</title>
         <link>http://jan.ycool.com/post.4575056.html</link>
         <description>一个连街头的小偷都不敢呵斥的民族，却有勇气高呼灭了小日本。这个连活着同胞的苦痛都漠不关心的民族，却有脸说不忘死去的同胞。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4575056.html</guid>
         <pubDate>Fri, 22 Oct 2010 10:10:43 +0000</pubDate>
      </item>
      <item>
         <title>日</title>
         <link>http://jan.ycool.com/post.4574549.html</link>
         <description>“一个个都他妈忠臣良将的模样，这日本兵就在城外头，打去啊！敢情欺负的还是中国人呀！” “瞎哄呗，学生们不都没娶过媳妇吗？火力壮，又没钱找姑娘，总得找个地方煞煞火不是？”—《&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://fifid.com/site_search?cx=003017831450918707819%3Ae2pgfm8nybw&amp;cof=FORID%3A10&amp;ie=UTF-8&amp;q=%E9%9C%B8%E7%8E%8B%E5%88%AB%E5%A7%AC&quot;&gt;霸王别姬&lt;/a&gt;》...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4574549.html</guid>
         <pubDate>Mon, 18 Oct 2010 07:10:25 +0000</pubDate>
      </item>
      <item>
         <title>爱自由</title>
         <link>http://jan.ycool.com/post.4571487.html</link>
         <description>“儿女不是父母的私产，爱也不应当成为一种强迫别人放弃自由意志的勒索手段。父母让子女内疚，子女让父母内疚，用负罪感互相胁持，用良心互相折磨，人人是人人的人质，这就是中国某些家庭的真实写照。”&lt;br /&gt;&lt;br /&gt;于是同理可知，爱人不是爱人的私产，爱也不应当成为一种强迫别人放弃自由意志的勒索手段。他让她内疚，她让他内疚，用负罪感互相胁持，用良心互相折磨，人人是人人的人质，这也是中国某些家庭的真实写照。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4571487.html</guid>
         <pubDate>Fri, 24 Sep 2010 01:09:17 +0000</pubDate>
      </item>
      <item>
         <title>人们有那么蠢吗</title>
         <link>http://jan.ycool.com/post.4560529.html</link>
         <description>今天在某处看到某人转载了一篇文章，名字叫做《&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://fifid.com/site_search?cx=003017831450918707819%3Ae2pgfm8nybw&amp;cof=FORID%3A10&amp;ie=UTF-8&amp;q=%E9%9D%92%E8%9B%99%E6%9C%89%E9%82%A3%E4%B9%88%E8%A0%A2%E5%90%97%EF%BC%9F&quot;&gt;青蛙有那么蠢吗？&lt;/a&gt;》。里面提到了一个女教师带领众学生打破常规的故事。原文在此 &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blog.ifeng.com/article/6859110-9.html&quot;&gt;http://blog.ifeng.com/article/6859110-9.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

于是我想看看此人说的到底靠不靠谱，随便google了一把，找到了wiki上某页 &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Boiling_frog&quot;&gt;http://en.wikipedia.org/wiki/Boiling_frog&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

我觉得至少能说明的是，温水煮青蛙这东西，并不是本国的发明，也不是只在本国流行。&lt;br/&gt;&lt;br/&gt;

其次貌似能说明的是，别动不动就被什么什么的改变一生，那是读者文摘，知音，故事会 。。&lt;br/&gt;&lt;br/&gt;

再次能说明的是，现在有google了，拜托。&lt;br/&gt;&lt;br/&gt;

再再次能说明的是，人总是容易被自己蒙蔽。问了一个朋友不知道，结论就是全地球的洋人都不知道，这是典型的伪科学思维。&lt;br/&gt;&lt;br/&gt;

再再再次能说明的是，本国人民真是说得多做得少，那么多评论的没一个随便搜了一把的。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4560529.html</guid>
         <pubDate>Thu, 12 Aug 2010 13:08:41 +0000</pubDate>
      </item>
      <item>
         <title>妈的</title>
         <link>http://jan.ycool.com/post.4541434.html</link>
         <description>巴西居然挂了，挂在Melo一个人身上，巴西世界杯史上第一个乌龙，我也算见证了回历史。于是twitter也挂了，贝利说巴西和阿根廷要进决赛，目前为止已经应验了50%。&lt;br /&gt;
&lt;br /&gt;
祝荷兰早日回家。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4541434.html</guid>
         <pubDate>Fri, 02 Jul 2010 16:07:11 +0000</pubDate>
      </item>
      <item>
         <title>钱钟书说</title>
         <link>http://jan.ycool.com/post.4530479.html</link>
         <description>&quot;三十岁的妇人是不会夸二十四五岁的少妇漂亮的，反而去夸十四五岁的小姑娘，因为小姑娘没有威胁。&quot;

同理的是，女人可以整天把美女挂在嘴边，那不是因为这个世界真的充满美女，而是因为姿色平平的太多。眼前如果有真的美女，女人就要沉默了。

男人则无所谓了，是个男人他就帅嘛。...</description>
         <guid isPermaLink="false">http://jan.ycool.com/post.4530479.html</guid>
         <pubDate>Sun, 13 Jun 2010 02:06:48 +0000</pubDate>
      </item>
   </channel>
</rss>
<!-- fe7.yql.bf1.yahoo.com compressed/chunked Thu Oct  1 23:25:31 UTC 2015 -->
