<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5092100069771220562</id><updated>2012-02-16T07:29:44.233-08:00</updated><category term='Python'/><category term='pty'/><category term='rxvt'/><category term='MingW'/><category term='system information'/><category term='development'/><category term='hang'/><category term='carriage return'/><category term='fetchmail'/><category term='environment'/><category term='info'/><category term='Windows'/><category term='GNU'/><category term='explorer shell extention'/><category term='ipython'/><category term='context menu'/><category term='diff-cmd'/><category term='LN'/><category term='mutt'/><category term='backward-delete-char'/><category term='pyreadline'/><category term='extension'/><category term='handle'/><category term='Console'/><category term='grep'/><category term='msys shell'/><category term='ssmtp'/><category term='Vimperator'/><category term='Control-H'/><category term='cygwin'/><category term='tool'/><category term='PyQt'/><category term='msys'/><category term='DLL'/><category term='diff'/><category term='API'/><category term='CR'/><category term='wxPython'/><category term='building'/><category term='Vim'/><category term='Firefox'/><category term='open here'/><category term='Linux'/><category term='line feed'/><category term='end-of-line'/><category term='cygwin shell'/><category term='command line'/><category term='mail client'/><category term='release'/><category term='vim diff mode'/><category term='procmail'/><category term='svn'/><title type='text'>Kun's Hacking</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-8705404029236130664</id><published>2010-06-20T05:57:00.000-07:00</published><updated>2010-06-20T06:06:20.197-07:00</updated><title type='text'>Convert audios on Mac</title><content type='html'>Nowadays, on the Internet, there are really diverse formats of audio files. I often&lt;br /&gt;find the need to convert files from one format to another. For naive users, this&lt;br /&gt;can be a challenging task. But actually it can be a trivial script or set of commands&lt;br /&gt;if you know how to tap the power of all the marvelous open source tools, esp.&lt;br /&gt;mplayer and lame, etc.&lt;br /&gt;&lt;br /&gt;These two links show the basic example.&lt;br /&gt;http://www.linuxquestions.org/questions/linux-general-1/converting-m4a-to-mp3-170553/&lt;br /&gt;http://gimpel.gi.funpic.de/wiki/index.php?title=Howto:convert_aac/mp4_to_wav/mp3/ogg_on_Linux&lt;br /&gt;&lt;br /&gt;You can also convert other formats, like flash, too, as long as you have all the plugins.&lt;br /&gt;The Mac specific build of MPlayer is here:&lt;br /&gt;http://mplayerosxext.googlecode.com/files/MPlayer-OSX-Extended_rev13.zip&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-8705404029236130664?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/8705404029236130664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2010/06/convert-audios-on-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8705404029236130664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8705404029236130664'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2010/06/convert-audios-on-mac.html' title='Convert audios on Mac'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-8570621999417497295</id><published>2010-01-28T22:31:00.000-08:00</published><updated>2010-01-28T22:42:22.358-08:00</updated><title type='text'>Misc tricks on Windows Development</title><content type='html'>Another two trick I discovered recently:&lt;br /&gt;&lt;br /&gt;1. How to unlock a file/directory that is locked by a unfriendly process?&lt;br /&gt;         On Windows, you cannot delete or rename (move) a file/directory if it is&lt;br /&gt;         locked by a process. There is a way to do it (CreateRemoteThread).  See&lt;br /&gt;         &lt;a href="http://social.msdn.microsoft.com/Forums/en-SG/csharpgeneral/thread/9e2044c5-ae5d-4552-a335-01cc567dfc58"&gt;http://social.msdn.microsoft.com/Forums/en-SG/csharpgeneral/thread/9e2044c5-ae5d-4552-a335-01cc567dfc58&lt;/a&gt;. But if I want a tool to do it, then,&lt;br /&gt;        &lt;a href="http://cedrick.collomb.perso.sfr.fr/unlocker/#download"&gt;Unlocker &lt;/a&gt;is all you need.&lt;br /&gt;&lt;br /&gt;2. How to check memory leak on Windows?&lt;br /&gt;        Well, using MSVC runtime, you can use the crtdbg interface. The post is here:&lt;br /&gt;         &lt;a href="http://msdn.microsoft.com/en-us/library/e5ewb1h3%28VS.80%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/e5ewb1h3%28VS.80%29.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-8570621999417497295?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/8570621999417497295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2010/01/misc-tricks-on-windows-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8570621999417497295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8570621999417497295'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2010/01/misc-tricks-on-windows-development.html' title='Misc tricks on Windows Development'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-5110944561441540138</id><published>2010-01-28T20:29:00.000-08:00</published><updated>2010-01-28T22:30:25.801-08:00</updated><title type='text'>NTP on Windows</title><content type='html'>Time is important. Very! Few Windows users really care about&lt;br /&gt;whether there computer clock is right or not. But as an IT professional,&lt;br /&gt;we all know very well that. The time is IMPORTANT.&lt;br /&gt;&lt;br /&gt;Recently, I have been annoyed by the fact that my Thunderbird order&lt;br /&gt;my emails wrongly because of my local Windows machine's time is not&lt;br /&gt;correct. Well the time stamp in the email is the client-side's time stamp,&lt;br /&gt;not the server-side one. What can I do? I think I can just ensure that&lt;br /&gt;at least, my machine has the correct time. I know very well how to set up&lt;br /&gt;a NTP client in the *NIX world. But how to do it on Windows? I didn't find&lt;br /&gt;a way from the GUI (Control Panel). So I Google researched a bit.&lt;br /&gt;Below is the excerpt from the Microsoft site:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To configure a client computer for automatic domain time synchronization      &lt;/strong&gt;       &lt;ol class="ordered"&gt;&lt;li&gt;           &lt;p&gt;Open a Command Prompt.&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;           &lt;p&gt;Type the following command and then press ENTER:&lt;/p&gt;           &lt;p&gt;             &lt;strong&gt;w32tm /config /syncfromflags:domhier /update&lt;/strong&gt;           &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;           &lt;p&gt;Type the following command and then press ENTER:&lt;/p&gt;           &lt;p&gt;             &lt;strong&gt;net stop w32time&lt;/strong&gt;           &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;           &lt;p&gt;Type the following command and then press ENTER:&lt;/p&gt;           &lt;p&gt;             &lt;strong&gt;net start w32time&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;This way, your Windows machine get the time from the domain controller.&lt;br /&gt;You can also get the time from specified NTP server.  Just need to change&lt;br /&gt;to :&lt;br /&gt;&lt;strong&gt;       w32tm /config /syncfromflags:manual /manualpeerlist:servername&lt;servername&gt; /update&lt;br /&gt;&lt;/servername&gt;&lt;/strong&gt;&lt;br /&gt;I love command line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-5110944561441540138?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/5110944561441540138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2010/01/time-is-important.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5110944561441540138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5110944561441540138'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2010/01/time-is-important.html' title='NTP on Windows'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-2395047583878919342</id><published>2009-11-24T16:00:00.000-08:00</published><updated>2009-11-24T16:01:44.348-08:00</updated><title type='text'>Bash conditional</title><content type='html'>I have been always confused by the Bash conditional tests. This link is a great&lt;br /&gt;tutorial.&lt;br /&gt;&lt;a href="http://www.linuxtutorialblog.com/post/tutorial-conditions-in-bash-scripting-if-statements"&gt;http://www.linuxtutorialblog.com/post/tutorial-conditions-in-bash-scripting-if-statements&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-2395047583878919342?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/2395047583878919342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/11/bash-conditional.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2395047583878919342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2395047583878919342'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/11/bash-conditional.html' title='Bash conditional'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-1796677557044564490</id><published>2009-10-27T21:49:00.000-07:00</published><updated>2009-10-27T21:56:28.054-07:00</updated><title type='text'>Running cron in cygwin</title><content type='html'>I setup my cron job in cygwin today. The correct way to start the cron&lt;br /&gt;daemon is using the /usr/bin/cron-config tool that comes with the cron&lt;br /&gt;package. You can choose to run cron daemon with you own user account&lt;br /&gt;or as a SYSTEM account process. The difference is explained in&lt;br /&gt;/usr/share/doc/Cygwin/cron-VERSION.README. I chose to run cron&lt;br /&gt;as SYSTEM process. This gave me a bit trouble. Because the job spec&lt;br /&gt;I edited is owned by my own user account. The cron daemon process&lt;br /&gt;cannot load a crobtab file with different owner than its process owner.&lt;br /&gt;(Maybe not correct, but once I change my crontab file to be owned by&lt;br /&gt;SYSTEM, it worked). I got this fixed by using the cronevents.exe tool,&lt;br /&gt;which is really really helpful. Also, you might want to cron_diagnose.sh&lt;br /&gt;script to check if various configuration is correct, such as the /var dir's&lt;br /&gt;permission.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-1796677557044564490?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/1796677557044564490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/10/running-cron-in-cygwin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/1796677557044564490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/1796677557044564490'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/10/running-cron-in-cygwin.html' title='Running cron in cygwin'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-5687962409037505608</id><published>2009-10-27T00:20:00.000-07:00</published><updated>2009-10-27T00:35:52.028-07:00</updated><title type='text'>Svn repository mirror using svnsync</title><content type='html'>Because my company's main svn repo is in a different city, we constantly&lt;br /&gt;suffer from the slow network during development. The idea of setting up&lt;br /&gt;a read-only mirror has come to my mind for a long time. But I haven't had&lt;br /&gt;the time to implement it. Today, I spent half a day to set it up finally.&lt;br /&gt;&lt;br /&gt;Here is the note to record what I read and did to make it work:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Read this &lt;a href="http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/"&gt;post&lt;/a&gt; It tells almost everything you need to know to set it up, of course, you need to have some basic svn knowledge.&lt;/li&gt;&lt;li&gt;For me the sync was not working due to failing the acquire a write-lock. The error message is: "svnsync: Can't open file '/var/svn/pim_12_mirror/db/write-lock':Permission denied". I fix it by chowning everything under the repo to be owned by svn user.&lt;/li&gt;&lt;li&gt;Because the mirror is read-only. Using 'svn switch' sub-command will greatly help you to get the best of the mirror while being able to commit the original repo.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-5687962409037505608?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/5687962409037505608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/10/svn-repository-mirror-using-svnsync.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5687962409037505608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5687962409037505608'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/10/svn-repository-mirror-using-svnsync.html' title='Svn repository mirror using svnsync'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-5433977859118347733</id><published>2009-09-15T22:05:00.000-07:00</published><updated>2009-09-15T22:13:49.586-07:00</updated><title type='text'>Vim with mlcscope</title><content type='html'>It's been a while since my last post...&lt;br /&gt;&lt;br /&gt;You know, my IDE is bash + Vim + exuberant ctags + cscope + GNU&lt;br /&gt;global(optional), normally. This is almost perfect when I am doing C/C++&lt;br /&gt;development. But now, I spend quite a lot of time doing Python programming.&lt;br /&gt;ctags for python is not enough. GNU global is not supporting Python at all.&lt;br /&gt;So I am looking into the multi-lingual verion of cscope, that is, mlcscope.&lt;br /&gt;&lt;br /&gt;But getting Vim to work with mlcscope is a bit problematic. I searched Google&lt;br /&gt;for the solution. The top post is &lt;a href="http://www.cygwin.com/ml/cygwin/2006-10/msg00554.html"&gt;this one&lt;/a&gt;, which is dated and no good solution &lt;br /&gt;provided. So what I am going to do here is to put my solution into the &lt;br /&gt;WWW database. To let Vim use the cscope.out file generated by mlcscope,&lt;br /&gt;you just need to "set cscopeprg=mlcscope" in your vim start setting file.&lt;br /&gt;Obviously, the cscope.out file generated by mlcscope cannot be read correctly&lt;br /&gt;by the original cscope.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-5433977859118347733?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/5433977859118347733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/09/vim-with-mlcscope.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5433977859118347733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5433977859118347733'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/09/vim-with-mlcscope.html' title='Vim with mlcscope'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-734928426168125052</id><published>2009-07-21T23:16:00.001-07:00</published><updated>2009-07-25T07:17:38.624-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system information'/><category scheme='http://www.blogger.com/atom/ns#' term='info'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><title type='text'>Command to check cygwin installation information</title><content type='html'>Command to check cygwin info:&lt;br /&gt;&lt;br /&gt;cygcheck -s -v -r -h&lt;br /&gt;&lt;br /&gt;It dumps:&lt;br /&gt;&lt;br /&gt;1. Windows system version&lt;br /&gt;2. Windows system path&lt;br /&gt;3. User ID&lt;br /&gt;4. System directories and variables that affect cygwin&lt;br /&gt;5. Environment variables when you run in cygwin&lt;br /&gt;6. Cynus related registry entries&lt;br /&gt;7. Mount drives&lt;br /&gt;8. Cygwin entries for the mount drives.&lt;br /&gt;9. List important binaries locations&lt;br /&gt;10. List Cygwin DLLs' information&lt;br /&gt;11. Installed cygwin services&lt;br /&gt;12. Cygwin packages information&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-734928426168125052?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/734928426168125052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/07/command-to-check-cygwin-info-cygcheck-s.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/734928426168125052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/734928426168125052'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/07/command-to-check-cygwin-info-cygcheck-s.html' title='Command to check cygwin installation information'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-7500197988027340265</id><published>2009-07-21T17:56:00.000-07:00</published><updated>2009-07-25T07:16:42.416-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='line feed'/><category scheme='http://www.blogger.com/atom/ns#' term='msys'/><category scheme='http://www.blogger.com/atom/ns#' term='carriage return'/><category scheme='http://www.blogger.com/atom/ns#' term='CR'/><category scheme='http://www.blogger.com/atom/ns#' term='LN'/><category scheme='http://www.blogger.com/atom/ns#' term='grep'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='end-of-line'/><title type='text'>Binmode, textmode, cygwin, msys and grep</title><content type='html'>In the UNIX world, I guess, not many people care about the file is opened&lt;br /&gt;in text mode or binary mode. In fact, most of us probably are just using&lt;br /&gt;binary mode. But when it comes to the Windows world, the difference is &lt;br /&gt;becoming a pain in the arse. Because in Windows, when you open a file in &lt;br /&gt;text mode, every time you write a line of text, Windows makes it end with&lt;br /&gt;'CRLN' instead of 'LN'. I don't intend to make a detailed explanation here&lt;br /&gt;and reinvent the wheel. The best explanation is here: &lt;br /&gt;http://www.cygwin.com/cygwin-ug-net/using-textbinary.html&lt;br /&gt;But that link just talk about cygwin, how about MSYS. Is MSYS doing the same?&lt;br /&gt;Yes, it is. By default, MSYS is in binmode. So whatever is passed in will&lt;br /&gt;be pass through (the shell here I mean, including the pipes, redirected file&lt;br /&gt;descriptors) untouched. So what I was trying to find out and puttting down here&lt;br /&gt;is: If you run a Python program (using Windows python), the output pass through&lt;br /&gt;a cygwin/msys shell (pipe), what is the end-of-line marker? My non-authorative &lt;br /&gt;answer is: whatever the python program outputing and when you run the Windows&lt;br /&gt;version of python, every text line is output with 'CRLN' end-of-line'. &lt;br /&gt;So this is 'fine', as long as it is consistent on Windows. The thing is driving&lt;br /&gt;you mad, when some programs is doing the correct thing, that is, stripping the &lt;br /&gt;'\r' off the input/output lines. Which programs fall into this category, I now&lt;br /&gt;find one for sure, that is grep, one of the most useful POSIX tool. The MSYS grep &lt;br /&gt;will silently strip off the '\r' (CR) on each line, which the cygwin one will not.&lt;br /&gt;Imagine what this will cost you! So to be safe, I decide to always use the &lt;br /&gt;-U (--binary) switch. &lt;br /&gt;&lt;br /&gt;Below is a test program to verify this. I wrote a python script:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;import os&lt;br /&gt;&lt;br /&gt;print 'hello world'&lt;br /&gt;&lt;br /&gt;f = os.fdopen(1, 'wb', 0)&lt;br /&gt;f.write('hello world\n')&lt;br /&gt;f.write('hello world\r\n')&lt;br /&gt;&lt;br /&gt;import sys&lt;br /&gt;sys.stdout.close()&lt;br /&gt;sys.stdout = f&lt;br /&gt;&lt;br /&gt;print 'hello world'&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Run it with command:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;python test.py | xxd&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;See what is the output!&lt;br /&gt;&lt;br /&gt;Run it under MSYS with this command:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;python test.py | grep -v 'asdf' | xxd&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You will see it is end with 'LN'.&lt;br /&gt;Now run it with this:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;python test.py | grep -U -v 'asdf' | xxd&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You will see it is end with 'CRLN'.&lt;br /&gt;&lt;br /&gt;Try the two commands on cygwin, both have the same output.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-7500197988027340265?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/7500197988027340265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/07/binmode-textmode-cygwin-msys-and-grep.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/7500197988027340265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/7500197988027340265'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/07/binmode-textmode-cygwin-msys-and-grep.html' title='Binmode, textmode, cygwin, msys and grep'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-9183553993471518579</id><published>2009-07-02T21:15:00.000-07:00</published><updated>2009-07-21T18:41:46.242-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open here'/><category scheme='http://www.blogger.com/atom/ns#' term='context menu'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin shell'/><category scheme='http://www.blogger.com/atom/ns#' term='msys shell'/><category scheme='http://www.blogger.com/atom/ns#' term='explorer shell extention'/><title type='text'>Open cygwin/msys shell from Explorer window context menu</title><content type='html'>If you are a cygwin/msys user on Windows like me, you may find the&lt;br /&gt;need to open a shell window from the Windows explorer. This can be&lt;br /&gt;done via a context menu entry for a folder. Right-click on a folder,&lt;br /&gt;and open a shell window with that folder as the current working&lt;br /&gt;directory. That will be really nice, right. Windows itself also&lt;br /&gt;has a toy called &lt;a href="http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe"&gt;cmdhere&lt;/a&gt;, which does the&lt;br /&gt;similar thing but brings up the cmd.exe window.&lt;br /&gt;So how to do the cygwin/msys shell window? I search around a bit.&lt;br /&gt;There are many post on the Web. But I think I settle down on this&lt;br /&gt;simple one. First you need to write a bat file that take one&lt;br /&gt;argument, which is the working directory. Second, you need to&lt;br /&gt;modify the registry entry to add context menu for this bat file&lt;br /&gt;for the folder type context menu. The bat files for my cygwin&lt;br /&gt;shell is like this:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;@echo off&lt;br /&gt;start /min C:\cygwin\bin\bash --login -i -c 'cd "`cygpath %1`"; rxvt +sb +vb '&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The msys version bat is like this:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:100px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;@echo off&lt;br /&gt;start /min C:\cygwin\bin\bash --login -i -c 'cd "`cygpath %1`"; rxvt +sb +vb '&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Then add a new key under the "My ComputerHKEY_CLASSES_ROOT\Folder\shell"&lt;br /&gt;registry entry. The new key's name can be something lik Cygwin_here/msys_here.&lt;br /&gt;Then add a new key called "command" under this new entry, with the value&lt;br /&gt;to be your bat file with the "%1" argument. My exported registry entry is&lt;br /&gt;like these:&lt;br /&gt;&lt;div style="background-color:#E1D4C0; color:black; overflow:auto; height:200px; width:500px;"&gt;&lt;br /&gt;&lt;pre style="margin-top:0"&gt;Windows Registry Editor Version 5.00&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\Folder\shell\Cygwin_Here]&lt;br /&gt;@="Cygwin Here"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\Folder\shell\Cygwin_Here\command]&lt;br /&gt;@="C:\\cygwin\\rxvt_here \"%1\""&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\Folder\shell\Msys_Here]&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\Folder\shell\Msys_Here\command]&lt;br /&gt;@="c:\\msys\\1.0\\msys_here \"%1\""&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-9183553993471518579?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/9183553993471518579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/07/open-cygwinmsys-shell-from-explorer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/9183553993471518579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/9183553993471518579'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/07/open-cygwinmsys-shell-from-explorer.html' title='Open cygwin/msys shell from Explorer window context menu'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-4483293913126738846</id><published>2009-06-30T18:43:00.000-07:00</published><updated>2009-06-30T18:48:01.192-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='extension'/><category scheme='http://www.blogger.com/atom/ns#' term='release'/><category scheme='http://www.blogger.com/atom/ns#' term='DLL'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='handle'/><title type='text'>How to unload a python extension dll</title><content type='html'>I haven't found the answer. But I would like to put here&lt;br /&gt;as a place holder. Also hoping if an expert can comment&lt;br /&gt;on it. :)&lt;br /&gt;&lt;br /&gt;Basically, the problem is: I have a python extension&lt;br /&gt;written in C/C++. As a python module, I import it&lt;br /&gt;in my interactive shell (IPython indeed). I modified&lt;br /&gt;the C/C++ code, rebuild the extension, and want to &lt;br /&gt;test it out in my python shell. But even I deleted the&lt;br /&gt;module from the interactive shell namespace, the python&lt;br /&gt;process is still holding a handle to the DLL (pyd). I &lt;br /&gt;have to kill the python process and restart the testing &lt;br /&gt;from beginning again. It will be nice if I can ask python&lt;br /&gt;VM to release the handle of the pyd module and re-import&lt;br /&gt;the module again. &lt;br /&gt;&lt;br /&gt;Can I do it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-4483293913126738846?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/4483293913126738846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-unload-python-extension-dll.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4483293913126738846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4483293913126738846'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-unload-python-extension-dll.html' title='How to unload a python extension dll'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-516656546816844881</id><published>2009-06-28T18:15:00.000-07:00</published><updated>2009-06-28T18:20:59.830-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system information'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>How to find out system information on Window</title><content type='html'>Sometimes, we need to know the properties of the OS we are running on,&lt;br /&gt;such information of interests include, page size, etc. On Linux this &lt;br /&gt;is quite easy to get, because Linux has the proc file system to export&lt;br /&gt;kernel information to user land as a file systems. On Windows I haven't&lt;br /&gt;known a good and easy way. But Win32 API has a GetSystemInfo call, &lt;br /&gt;which fulfills most of the need. Below is the sample code to print out&lt;br /&gt;the page size of Windows.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;windows.h&amp;gt;&lt;br /&gt; &lt;br /&gt;int main() {&lt;br /&gt; SYSTEM_INFO si;&lt;br /&gt; GetSystemInfo(&amp;si);&lt;br /&gt; &lt;br /&gt; printf("The page size for this system is %u bytes.\n", si.dwPageSize);&lt;br /&gt; &lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-516656546816844881?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/516656546816844881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-find-out-system-information-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/516656546816844881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/516656546816844881'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-find-out-system-information-on.html' title='How to find out system information on Window'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-3740025962628247706</id><published>2009-06-25T01:37:00.000-07:00</published><updated>2009-06-25T04:12:13.495-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><category scheme='http://www.blogger.com/atom/ns#' term='diff-cmd'/><category scheme='http://www.blogger.com/atom/ns#' term='vim diff mode'/><category scheme='http://www.blogger.com/atom/ns#' term='diff'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>GVim diff mode integration with svn on windows</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ucIFvkRqBLo/SkM7RhulPqI/AAAAAAAAADg/rT-pZXubbtY/s1600-h/tortoise_svn_diff_viewer.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 160px; height: 107px;" src="http://1.bp.blogspot.com/_ucIFvkRqBLo/SkM7RhulPqI/AAAAAAAAADg/rT-pZXubbtY/s320/tortoise_svn_diff_viewer.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5351185954543845026" /&gt;&lt;/a&gt;&lt;br /&gt;How to use GVim diff mode as the diff viewer for svn&lt;br /&gt;has been a research task for me for a long time.&lt;br /&gt;Today, finally, I got a chance to devote some time&lt;br /&gt;to set it up once and for all.  On Windows, I use&lt;br /&gt;two svn client. The GUI Tortoise svn client, and the&lt;br /&gt;command line CollabNet client. &lt;br /&gt;For the GUI client, it is quite easy to set up.  Fire up the Tortoise svn&lt;br /&gt;settings diaglog. Change the Diff Viewer setting to where your Windows GVim exe&lt;br /&gt;is. Put the command line swith '-d' following the exe location. That is it.&lt;br /&gt;Mine is like this:&lt;br /&gt;C:\Program Files\Vim\vim72\gvim.exe -s "C:\Program Files\Vim\vimfiles\scripts\vimdiffSize.vim" -d %base %mine&lt;br /&gt;&lt;br /&gt;Why I have another '-s' swith with argument? That's because&lt;br /&gt;I want the diff window to be big and the two diff window split&lt;br /&gt;equally. There may be other ways to do it. But mine way is giving&lt;br /&gt;a vim command script to do it. The content of the command script&lt;br /&gt;is like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;:winsize 300 100^M&lt;br /&gt;^W=&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The '^M' and '^W' is one character, Control-M and Control-W. How to &lt;br /&gt;enter it? In Vim type: Ctrl-V Ctrl-M and Ctrl-V Ctrl-W. &lt;br /&gt;&lt;br /&gt;How about on the command line. svn has a config file. On Windows &lt;br /&gt;it is in: c:\Documents and Settings\$UserName\Application Data\Subversion\config.&lt;br /&gt;In this config file you can specify the option for diff-cmd,&lt;br /&gt;which is equivalent to the --diff-cmd swith for 'svn diff' command.&lt;br /&gt;The argument for this option need to be a Windows executable. So &lt;br /&gt;you need a bat file to wrap you GVim exe. My diff-cmd option&lt;br /&gt;setting is like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;diff-cmd = "c:\msys\1.0\home\khong\bin\svndiff.bat"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The content of the svndiff.bat file is as following:&lt;br /&gt;&lt;br /&gt;@ECHO OFF&lt;br /&gt;&lt;br /&gt;REM Configure your favorite diff program here.&lt;br /&gt;SET DIFF="C:\msys\1.0\opt\GVimPortable\gvim.exe"&lt;br /&gt;&lt;br /&gt;REM Subversion provides the paths we need as the last two parameters.&lt;br /&gt;REM These are parameters 6 and 7 (unless you use svn diff -x, in&lt;br /&gt;REM which case, all bets are off).&lt;br /&gt;SET LEFT=%6&lt;br /&gt;SET RIGHT=%7&lt;br /&gt;&lt;br /&gt;REM Call the diff command (change the following line to make sense for&lt;br /&gt;REM your diff program).&lt;br /&gt;%DIFF%  -s c:\msys\1.0\home\khong\.vim\scripts\vimdiffSize.vim -d %LEFT% %RIGHT%&lt;br /&gt;&lt;br /&gt;REM Return an errorcode of 0 if no differences were detected, 1 if some were.&lt;br /&gt;REM Any other errorcode will be treated as fatal.&lt;br /&gt;&lt;br /&gt;I am not the author. I got it from the (I think) svn official site.&lt;br /&gt;The original name is svnwrap.bat.&lt;br /&gt;&lt;br /&gt;Anyway, now I can use GVim diff mode to view diffs from svn.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-3740025962628247706?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/3740025962628247706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/gvim-diff-mode-integration-with-svn-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/3740025962628247706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/3740025962628247706'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/gvim-diff-mode-integration-with-svn-on.html' title='GVim diff mode integration with svn on windows'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ucIFvkRqBLo/SkM7RhulPqI/AAAAAAAAADg/rT-pZXubbtY/s72-c/tortoise_svn_diff_viewer.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-2118697945611383007</id><published>2009-06-21T00:33:00.001-07:00</published><updated>2009-06-21T00:36:32.776-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='procmail'/><category scheme='http://www.blogger.com/atom/ns#' term='mutt'/><category scheme='http://www.blogger.com/atom/ns#' term='mail client'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='fetchmail'/><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><category scheme='http://www.blogger.com/atom/ns#' term='ssmtp'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><title type='text'>Setting up command line mail client on Windows</title><content type='html'>Command line email client? There is nothing wrong with it if you hate the &lt;br /&gt;sluggishness and tediousness of firing up a slow GUI email client.&lt;br /&gt;So I set up mutt/fetchmail/procmail/ssmtp on my Windows box (on cygwin of course).&lt;br /&gt;This is the post I follow to set them up. Works like a breeze!&lt;br /&gt;&lt;br /&gt;http://www.gentoo.org/doc/en/guide-to-mutt.xml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-2118697945611383007?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/2118697945611383007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/setting-up-command-line-mail-client-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2118697945611383007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2118697945611383007'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/setting-up-command-line-mail-client-on.html' title='Setting up command line mail client on Windows'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-2474526592148433193</id><published>2009-06-21T00:27:00.001-07:00</published><updated>2009-06-21T00:32:56.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='extension'/><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><category scheme='http://www.blogger.com/atom/ns#' term='Vimperator'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Firefox plugins</title><content type='html'>You know, I am a hardcore Vim user. I even want my browsing experience to be&lt;br /&gt;like Vim as much as possible. There are two Firefox plugins that I highly &lt;br /&gt;recommend. &lt;br /&gt;&lt;br /&gt;The first one is "It's all text!". It is a Firefox extension that allow you&lt;br /&gt;to edit textareas in a webpage in external editor of choice. In my case&lt;br /&gt;of course it is Vim. :) "It's all text!" homepage is here:&lt;br /&gt;https://addons.mozilla.org/en-US/firefox/addon/4125&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The second one is Vimperator. It is live changing for me. &lt;br /&gt;It can be found here: http://vimperator.org/trac/wiki/vimperator&lt;br /&gt;&lt;br /&gt;Happy Vimming!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-2474526592148433193?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/2474526592148433193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/firefox-plugins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2474526592148433193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/2474526592148433193'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/firefox-plugins.html' title='Firefox plugins'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-5394479782485055965</id><published>2009-06-19T22:14:00.000-07:00</published><updated>2009-06-19T22:19:33.827-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pyreadline'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Control-H'/><category scheme='http://www.blogger.com/atom/ns#' term='backward-delete-char'/><title type='text'>How to make IPython shell Ctrl-h working on Windows</title><content type='html'>Although I am a vim user. I like the shell emacs binding.&lt;br /&gt;I can't live without it. I have been using IPython a lot&lt;br /&gt;on Windows. IPython's pyreadline is marvalous. But it has&lt;br /&gt;one shortcoming (defect?). That is the 'Ctrl-h' key doesn't&lt;br /&gt;work like 'backward-delete-char'. I have been searching for&lt;br /&gt;a solution, for a long time. Only when I found this post,&lt;br /&gt;has the problem been sovled:&lt;br /&gt;http://makunouchi.jp/zope3/9900417093&lt;br /&gt;&lt;br /&gt;:) It is in Japanese. But who minds. Apply the patch to your&lt;br /&gt;pyreadline's keysyms.py file. Ctrl-h is back!!&lt;br /&gt;&lt;br /&gt;Post the patch below if the Japanese link scares you.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;--- pyreadline/keysyms/keysyms.py.orig&lt;br /&gt;+++ pyreadline/keysyms/keysyms.py&lt;br /&gt;@@ -119,6 +119,10 @@&lt;br /&gt;        char = chr(VkKeyScan(ord(char)) &amp; 0xff)&lt;br /&gt;     elif control:&lt;br /&gt;         char=chr(keycode)&lt;br /&gt;+    if control and ord(char)==8 and keycode==72:&lt;br /&gt;+        keycode=8&lt;br /&gt;+        control=False&lt;br /&gt;+        state &amp;= 0xfffffff7&lt;br /&gt;     try:&lt;br /&gt;         keyname=code2sym_map[keycode]&lt;br /&gt;     except KeyError:&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-5394479782485055965?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/5394479782485055965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-make-ipython-shell-ctrl-h.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5394479782485055965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/5394479782485055965'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/how-to-make-ipython-shell-ctrl-h.html' title='How to make IPython shell Ctrl-h working on Windows'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-4331406506264467481</id><published>2009-06-19T17:59:00.000-07:00</published><updated>2009-06-19T18:59:31.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hang'/><category scheme='http://www.blogger.com/atom/ns#' term='msys'/><category scheme='http://www.blogger.com/atom/ns#' term='pty'/><category scheme='http://www.blogger.com/atom/ns#' term='ipython'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='rxvt'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Console'/><title type='text'>Explanation of why Windows console-based app hangs on Rxvt</title><content type='html'>http://code.google.com/p/mintty/issues/detail?id=56&lt;br /&gt;This post is clear and comprehensive. I am glad I found it.&lt;br /&gt;&lt;br /&gt;But it doesn't solve the problem totally... I can now run&lt;br /&gt;ipython shell in the msys Rxvt terminal. But the pyreadline&lt;br /&gt;key bindings are screwed up totally. :( Still stay with Console2&lt;br /&gt;for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-4331406506264467481?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/4331406506264467481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/explanation-of-why-windows-console.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4331406506264467481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4331406506264467481'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/explanation-of-why-windows-console.html' title='Explanation of why Windows console-based app hangs on Rxvt'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-6494159647331602007</id><published>2009-06-18T17:19:00.000-07:00</published><updated>2009-06-22T18:26:13.114-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='environment'/><title type='text'>Productivity Tool on Windows (For the GNU/Linux minded) -- Third</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ucIFvkRqBLo/SkAqBmQW3fI/AAAAAAAAADY/an45xtbA7l0/s1600-h/tkdiff_diff_prev_svn.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 140px; height: 80px;" src="http://3.bp.blogspot.com/_ucIFvkRqBLo/SkAqBmQW3fI/AAAAAAAAADY/an45xtbA7l0/s320/tkdiff_diff_prev_svn.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5350322564253539826" /&gt;&lt;/a&gt;&lt;br /&gt;Today, I want to recommend a graphical diff tool on Windows.&lt;br /&gt;I think most developers will always have their favorite diff&lt;br /&gt;tool. But if you need to develop on 3 or more platforms, for&lt;br /&gt;example, Mac OS X, Linux and Windows, having one favorite is&lt;br /&gt;not that easy. If you are also using multiple revision&lt;br /&gt;control systems on all these platforms. It will be even&lt;br /&gt;harder.  I am a Vim user. Whenever possible I use Vim, even&lt;br /&gt;diff with Vim. Vim can run on all the above OSs. The only&lt;br /&gt;problem I found is using Vim diff mode with different&lt;br /&gt;revision control systems. I need to write script to let Vim&lt;br /&gt;integrate with different revision control system. I am a&lt;br /&gt;lazy person.  Even though I like Vim, I don't like this&lt;br /&gt;inconvenience. &lt;br /&gt;&lt;br /&gt;So I heard about Tkdiff. Tkdiff is written in Tcl/Tk toolkit. You may &lt;br /&gt;have a little despisement in your heart, right? Well, as the Chinese&lt;br /&gt;saying goes: A man can not be judged by his appearance. Tkdiff is, in&lt;br /&gt;my opinion, powerful, yet simple. The features I found useful are as&lt;br /&gt;following:&lt;br /&gt;&lt;br /&gt;1. Understand multiple revision control tools. Can diff different&lt;br /&gt;   versions of the file (work with revision control tools). &lt;br /&gt;   Currently tkdiff can work with cvs, subversion, perforce out of&lt;br /&gt;   the box. But with some patch, it can work with bazaar and mercurial.&lt;br /&gt;2. Easy navigation. Can navigate to differnt diff region easily with &lt;br /&gt;   single key press, like 'N', 'P', 'C', etc.&lt;br /&gt;3. Can integrate with external editor, such as gvim to edit the file.&lt;br /&gt;4. Easy refreshing the diff. Just one key press 'R'&lt;br /&gt;5. Run on multiple platform. As long as there is Tcl for that platform.&lt;br /&gt;&lt;br /&gt;In a word. TkDiff is a marvelous tool, with humble appearance and name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-6494159647331602007?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/6494159647331602007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for_18.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6494159647331602007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6494159647331602007'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for_18.html' title='Productivity Tool on Windows (For the GNU/Linux minded) -- Third'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ucIFvkRqBLo/SkAqBmQW3fI/AAAAAAAAADY/an45xtbA7l0/s72-c/tkdiff_diff_prev_svn.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-8727772745720137618</id><published>2009-06-17T03:41:00.000-07:00</published><updated>2009-06-19T18:02:50.747-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PyQt'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Installing pyQt</title><content type='html'>Today I installed PyQt on both Windows and Mac. The Windows version is quite easy.&lt;br /&gt;It is just an executable installer. Run it and that is it. The Mac version takes me&lt;br /&gt;a bit of effort. I follow the instructions on this link &lt;br /&gt;(http://kdl.nobugware.com/post/2008/06/05/PyQt-4-on-Mac-Os-X/). You may need to &lt;br /&gt;search for the newest packages since this post is a bit old now. But anyway, &lt;br /&gt;it works. The only hickup is: I am also using fink packages on my Mac and there is&lt;br /&gt;qt3 fink package installed. I need to tweak the path to eliminate the '/sw/bin'&lt;br /&gt;and '/sw/usr/bin' (the fink's binary path) from PATH before I ran the configuration&lt;br /&gt;step. So the configure.py script will not think it find the Qt installation in&lt;br /&gt;the fink package locations. OK. Time to learn some PyQt and wxPython.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-8727772745720137618?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/8727772745720137618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/installing-pyqt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8727772745720137618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/8727772745720137618'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/installing-pyqt.html' title='Installing pyQt'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-4958802146589138485</id><published>2009-06-16T03:09:00.000-07:00</published><updated>2009-06-16T03:26:34.062-07:00</updated><title type='text'>Productivity Tool on Windows (For the GNU/Linux minded) - Second</title><content type='html'>It is great to have a proper terminal window and proper shell on Windows. But&lt;br /&gt;sometimes, this is not applicable to run some programs that relying on the&lt;br /&gt;cmd.exe terminal. Python and iPython for Windows unfortunately falls into this&lt;br /&gt;category.  The native Windows Python build (not Python in cygwin) has to be run&lt;br /&gt;in cmd.exe terminals (so is the iPython Windows native build, which runs with&lt;br /&gt;the native Python).  If we run Windows Python within a Rxvt (or xterm)&lt;br /&gt;terminal, it just hangs without any input and output. Yuck! What is the &lt;br /&gt;problem? I don't really know, either. (If someone knows, please tell. Better&lt;br /&gt;if you have a good hack to solve it :). But anyway, I have to run Windows&lt;br /&gt;Python and iPython, and I cannot use Rxvt for that. So it triggers my search &lt;br /&gt;for a better cmd.exe terminal that won't hang Python. The result is &lt;br /&gt;Console2! http://sourceforge.net/projects/console/. In Console2 you can &lt;br /&gt;copy and paste terminal text just like Rxvt (with correct settings),&lt;br /&gt;left mouse key select, middle button paste. It can even has transparency!&lt;br /&gt;Truetype font, Multi-tab, customized tab names and settings... You name it.&lt;br /&gt;It is just incredible. Now I run my python shell and ipython shell in &lt;br /&gt;Console2. No more pain-in-the-arse cmd.exe copy/paste retardedness.&lt;br /&gt;I hope this helps you, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-4958802146589138485?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/4958802146589138485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4958802146589138485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/4958802146589138485'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for_16.html' title='Productivity Tool on Windows (For the GNU/Linux minded) - Second'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-6819466043194701902</id><published>2009-06-15T01:29:00.000-07:00</published><updated>2009-06-19T18:02:17.186-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='environment'/><title type='text'>Productivity Tool on Windows (For the GNU/Linux minded) -- First</title><content type='html'>I myself is a follower of open source software and also an addict of &lt;br /&gt;GNU/Linux software tools. I cannot live without GNU tools, nor can I &lt;br /&gt;program without OSS software. But in my current job, I am stuck with Windows&lt;br /&gt;platform... Nevertheless, I gradually found my way to the old comfort&lt;br /&gt;and joy all the GNU and other OSS software brought to me. Now, my Windows&lt;br /&gt;development environment is good enough that I can live with all the short-&lt;br /&gt;comings of Windows. I would like to share in my blog my experience. Hope&lt;br /&gt;it will help all similar-minded others, too.&lt;br /&gt;&lt;br /&gt;Foremost and most importantly, of course, is the shell. God knows why&lt;br /&gt;Windows is still stuck with cmd.exe command line. That is really insanely&lt;br /&gt;inconvenient. So a bash shell and a xterm like terminal window is of the&lt;br /&gt;utmost importance. &lt;br /&gt;&lt;br /&gt;I think most people will know the cygwin environment. Yes, that is also my&lt;br /&gt;first choice. I will not talk about how to install cygwin here, as it is&lt;br /&gt;so easy and www.cygwin.com is so easy to find. But I do want to point out &lt;br /&gt;that, even some people install cygwin, they are still using the cmd.exe&lt;br /&gt;terminal, which is default after cygwin installed. I would highly recommend&lt;br /&gt;using the rxvt terminal of cygwin instead. As this make you copy and paste&lt;br /&gt;from the command line so much easier than using the cmd.exe terminal. This is&lt;br /&gt;easy to do. After cygwin installation, there will be a shortcut to the cygwin&lt;br /&gt;lauch bat file on the Desktop (normally, unless you choose not to). Right-click&lt;br /&gt;on it to bring up the context menu. Choose edit to edit the actual bat file's&lt;br /&gt;content. Put something like this in it:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@echo off&lt;br /&gt;&lt;br /&gt;REM C:&lt;br /&gt;REM chdir C:\cygwin\bin&lt;br /&gt;&lt;br /&gt;c:\cygwin\bin\rxvt --loginShell &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There you go. Rxvt and bash! See you stupid cmd.exe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-6819466043194701902?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/6819466043194701902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6819466043194701902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6819466043194701902'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/productivity-tool-on-windows-for.html' title='Productivity Tool on Windows (For the GNU/Linux minded) -- First'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-6270268338580332435</id><published>2009-06-12T17:26:00.000-07:00</published><updated>2009-06-13T04:39:06.238-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MingW'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='building'/><category scheme='http://www.blogger.com/atom/ns#' term='wxPython'/><title type='text'>Building wxWidgets on Windows</title><content type='html'>I just learned how to compile wxWidgets on Windows recently. Don't want to&lt;br /&gt;forget about it. So just make a blog entry. May help others, too, if the&lt;br /&gt;search engines rank it high enough...&lt;br /&gt;&lt;br /&gt;wxWidget can be compile on Windows for different compiler tools. For&lt;br /&gt;example, VC, MingW, borland C++, etc. I am only interested in VC and&lt;br /&gt;MingW. If you are interested in commercial native tools, VC is sufficient&lt;br /&gt;(just use the free beer version). If you are interested in OSS tools,&lt;br /&gt;nothing is better than MingW. OK, that is my opinion anyway. I am very&lt;br /&gt;glad to find out wxWidget support these two builds very easily and well.&lt;br /&gt;Espeically the VC build can be just invoking the nmake tools. Hehe, go&lt;br /&gt;to hell VC XML project files... The MingW build is simple enough, any&lt;br /&gt;autoconf/automake user knows how to do it. Configure and make. Life is&lt;br /&gt;so good!&lt;br /&gt;&lt;br /&gt;I learned most of the knowledge from these two posts:&lt;br /&gt;http://www.freelists.org/post/programmingblind/Tutorials-for-compilation-of-wxWidgets-on-Microsoft-windows&lt;br /&gt;http://www.freelists.org/post/programmingblind/tutorials-for-compilation-of-wxWidgets-on-windows-part-2A-wxWidgets-and-MinGW&lt;br /&gt;&lt;br /&gt;If there was ever a chance that these links are broken. Use a search engine&lt;br /&gt;to search these keywords "compilation of wxWidgets on windows" (without quote).&lt;br /&gt;A link can be broken, but Internet history will never die.&lt;br /&gt;&lt;br /&gt;The only thing I think I should put down here is that, how to tweak various&lt;br /&gt;settings of the build. wxWidgets has different build flavour, most importantly,&lt;br /&gt;monolithic build or multi-lib build, unicode build or non-unicode build,&lt;br /&gt;static lib build or DLL lib build, debug build or non-debug build, etc.&lt;br /&gt;For VC build, these settings are tweaked through the config.vc file under&lt;br /&gt;build/msw subdir of the wx Windows source tree. While for MingW build, the&lt;br /&gt;settings are tweak on the configure script command line options. Running&lt;br /&gt;./configure --help will show all the tweakable options.&lt;br /&gt;&lt;br /&gt;After setting config.vc correctly, to build VC build, just need to invoke&lt;br /&gt;nmake /f makefile.vc. Slick! For MingW build, run ./configure on top level&lt;br /&gt;and then make. Nothing simpler!&lt;br /&gt;&lt;br /&gt;OK. So much for wxWidgets building. Time to hack the code.&lt;br /&gt;&lt;br /&gt;PS. Comiling wxWidget on Mac is no different than compiling it on Linux&lt;br /&gt;or other UNIX system. Configure and make is the way to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-6270268338580332435?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/6270268338580332435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/building-wxwidgets-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6270268338580332435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/6270268338580332435'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/building-wxwidgets-on-windows.html' title='Building wxWidgets on Windows'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5092100069771220562.post-127539472937448158</id><published>2009-06-12T04:05:00.000-07:00</published><updated>2009-06-12T04:40:02.381-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PyQt'/><category scheme='http://www.blogger.com/atom/ns#' term='wxPython'/><title type='text'>PyQt vs wxPython</title><content type='html'>Recently, because of my job (I am a programmer working with C++, Python, GUI,&lt;br /&gt;image processing, embedded system, Linux, Windows and Mac), I need to choose a&lt;br /&gt;GUI framework for Python that are mature and cross-platform. Of course, the&lt;br /&gt;best of the breed are wxPython and PyQt. But it seems to be hard to make a choice&lt;br /&gt;between these two. The top search result of 'wxPython vs PyQt' is about 4 years&lt;br /&gt;old. Qt/PyQt has gone through great changes. So is wxPython I believe. By&lt;br /&gt;reading the old post doesn't seem to help me make a decision.  I think the old&lt;br /&gt;license issue (especially on Windows) is not very big an issue any more, since&lt;br /&gt;Qt is open source (in the true sense) on Windows already. Yet, of course, the&lt;br /&gt;GPL license is still scaring off quite a lot of people. I guess what&lt;br /&gt;differentiate will be API beauty/neatness, documentation, support and maturity.&lt;br /&gt;I used Qt before in the Qt2 days. I kind of think its API is neat. But some&lt;br /&gt;post about PyQt pointed out that PyQt is not *Pythonic* enough. So I am not so&lt;br /&gt;sure about the beauty of PyQt's API. From bits and pieces of reading, I think&lt;br /&gt;now PyQt has improved a lot in this aspect, but I am not sure. If any one has&lt;br /&gt;any experience, please leave a comment. Finally, I guess you don't really know,&lt;br /&gt;until you try. Knowledge learn from other people's mouth is always not as good&lt;br /&gt;as your own experience. I think I am going to give both PyQt and wxPython a&lt;br /&gt;try.&lt;br /&gt;&lt;br /&gt;I hear, I forget.&lt;br /&gt;I see, I remember.&lt;br /&gt;I do, I understand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092100069771220562-127539472937448158?l=kun-hong.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kun-hong.blogspot.com/feeds/127539472937448158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kun-hong.blogspot.com/2009/06/pyqt-vs-wxpython.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/127539472937448158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5092100069771220562/posts/default/127539472937448158'/><link rel='alternate' type='text/html' href='http://kun-hong.blogspot.com/2009/06/pyqt-vs-wxpython.html' title='PyQt vs wxPython'/><author><name>Kun</name><uri>http://www.blogger.com/profile/06275176382795970163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
