<?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-4574925891333430710</id><updated>2012-02-16T16:25:59.114-08:00</updated><category term='linux'/><category term='pcl'/><category term='firefox'/><category term='theory'/><category term='ngwallpaper'/><category term='docs'/><category term='ai'/><category term='Bugs'/><category term='python'/><category term='Patch'/><category term='tips'/><category term='Notes'/><category term='livejornal'/><category term='lisp'/><category term='vim'/><category term='fixes'/><category term='project'/><category term='soc'/><category term='fortune'/><category term='Task'/><title type='text'>Simple is better than complex.</title><subtitle type='html'>This is O.R.Senthil Kumaran's blogspot on programming and technical things.  The title is a line from "Zen of Python".</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default?start-index=101&amp;max-results=100'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>378</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-9032513136365040444</id><published>2010-11-30T20:16:00.000-08:00</published><updated>2010-11-30T20:16:41.003-08:00</updated><title type='text'>sudo NOPASSWD in ubuntu</title><content type='html'>In Ubuntu, do&lt;br /&gt;&lt;br /&gt;1.&lt;i&gt; sudo visudo&lt;/i&gt;&lt;br /&gt;2. Go to the last line and add&lt;br /&gt;&lt;i&gt;username &amp;nbsp;ALL=(ALL) NOPASSWD: ALL&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;I could not change the default editor to use vim by exporting the EDITOR variable. I had to use nano only, which has some quirks like it asks you the save in DOS Format or Mac Format ( I choose Mac). Btw, while using uxterm, you cannot use nano editor, because the Meta key is &amp;nbsp;bound by uxterm and you wont be able to save it. I had to xfce4-terminal to do the first step. Phew!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-9032513136365040444?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/9032513136365040444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=9032513136365040444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9032513136365040444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9032513136365040444'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/11/sudo-nopasswd-in-ubuntu.html' title='sudo NOPASSWD in ubuntu'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5440736081556513069</id><published>2010-11-13T23:18:00.000-08:00</published><updated>2010-11-13T23:18:04.083-08:00</updated><title type='text'>Installing VirtualBox Guest additions on Ubuntu Guest</title><content type='html'>1. Mount the cdrom from within the Guest OS, so that the guest additions will be available.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;sudo mount /dev/cdrom /mount/cdrom&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. There is a VBoxGuestAdditions.bin script which you will have to execute.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Accessing the Shared Folder. From the VirtualBox Interface, a select folder in your Host Operating System as the folder which you would like to share on the Guest OS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Remember the name of the shared folder and access it from within the Ubuntu Guest OS like this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;sudo mount -t &lt;b&gt;vboxsf &amp;nbsp;&lt;/b&gt;sharedfoldername mountpoint&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Twice I made a mistake of typing vbox&lt;b&gt;fs&lt;/b&gt; instead of vbox&lt;b&gt;sf &lt;/b&gt;, so be careful with the spelling.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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/4574925891333430710-5440736081556513069?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5440736081556513069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5440736081556513069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5440736081556513069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5440736081556513069'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/11/installing-virtualbox-guest-additions.html' title='Installing VirtualBox Guest additions on Ubuntu Guest'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2113427314965770010</id><published>2010-10-31T23:58:00.001-07:00</published><updated>2010-10-31T23:58:27.674-07:00</updated><title type='text'>Virtualbox Tip (Ubuntu Host, Windows Guest)</title><content type='html'>&lt;h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: #2963a6; font-family: sans-serif; font-size: 19px; font-weight: normal; line-height: 19px; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em;"&gt;&lt;span class="mw-headline"&gt;Accessing a Shared Folder from a Windows Guest&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"&gt;On Windows guests, the shared folder should appear as a standard Windows network share listed under&amp;nbsp;&lt;i&gt;VirtualBox Shared Folders&lt;/i&gt;, accessible from the&amp;nbsp;&lt;i&gt;&lt;a class="kLink" href="http://www.virtuatopia.com/index.php/VirtualBox_Shared_Folders#" id="KonaLink6" style="background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-color: transparent !important; border-bottom-style: none !important; border-bottom-width: 0px !important; border-left-color: transparent !important; border-left-style: none !important; border-left-width: 0px !important; border-right-color: transparent !important; border-right-style: none !important; border-right-width: 0px !important; border-top-color: transparent !important; border-top-style: none !important; border-top-width: 0px !important; bottom: 0px; color: blue !important; cursor: pointer; display: inline !important; font-family: verdana; font-variant: normal; left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static; right: 0px; text-decoration: underline !important; text-transform: none !important; top: 0px;" target="undefined"&gt;&lt;span style="color: blue !important; font-family: sans-serif; font-size: 13px; font-weight: normal; position: static;"&gt;&lt;span class="kLink" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: initial !important; border-left-style: none !important; border-left-width: 0px !important; border-right-color: initial !important; border-right-style: none !important; border-right-width: 0px !important; border-top-color: initial !important; border-top-style: none !important; border-top-width: 0px !important; color: blue !important; display: inline !important; float: none !important; font-family: sans-serif; font-size: 13px; font-weight: normal; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static; width: auto !important;"&gt;Network&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&amp;nbsp;option in the&amp;nbsp;&lt;i&gt;Start&lt;/i&gt;&amp;nbsp;menu. If the shared folder is not visible within the Network window (as can sometime be the case), it may be mapped to a disk drive in a command prompt window by issuing the following command:&lt;/div&gt;&lt;div style="font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;dl style="font-family: sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.5em; margin-top: 0.2em;"&gt;&lt;dd style="line-height: 1.5em; margin-bottom: 0.1em; margin-left: 2em;"&gt;&lt;tt&gt;net use &lt;drive&gt;: \\vboxsvr\&lt;share name=""&gt;&lt;/share&gt;&lt;/drive&gt;&lt;/tt&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style="font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;"&gt;&lt;br /&gt;where&amp;nbsp;&lt;i&gt;&lt;drive&gt;:&lt;/drive&gt;&lt;/i&gt;&amp;nbsp;represents the drive letter to be mapped to the shared folder and&amp;nbsp;&lt;i&gt;&lt;share name=""&gt;&amp;gt; is the name assigned to the shared folder during the creation process outlined above. For example, to map a shared folder named&amp;nbsp;&lt;/share&gt;&lt;/i&gt;TempFiles&lt;i&gt;&amp;nbsp;to the S:&amp;nbsp;&lt;a class="kLink" href="http://www.virtuatopia.com/index.php/VirtualBox_Shared_Folders#" id="KonaLink7" style="background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-color: transparent !important; border-bottom-style: none !important; border-bottom-width: 0px !important; border-left-color: transparent !important; border-left-style: none !important; border-left-width: 0px !important; border-right-color: transparent !important; border-right-style: none !important; border-right-width: 0px !important; border-top-color: transparent !important; border-top-style: none !important; border-top-width: 0px !important; bottom: 0px; color: blue !important; cursor: pointer; display: inline !important; font-family: verdana; font-variant: normal; left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static; right: 0px; text-decoration: underline !important; text-transform: none !important; top: 0px;" target="undefined"&gt;&lt;span style="color: blue !important; font-family: sans-serif; font-size: 13px; font-weight: normal; position: static;"&gt;&lt;span class="kLink" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: initial !important; border-left-style: none !important; border-left-width: 0px !important; border-right-color: initial !important; border-right-style: none !important; border-right-width: 0px !important; border-top-color: initial !important; border-top-style: none !important; border-top-width: 0px !important; color: blue !important; display: inline !important; float: none !important; font-family: sans-serif; font-size: 13px; font-weight: normal; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static; width: auto !important;"&gt;drive&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&amp;nbsp;on the guest operating system:&lt;/i&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px;"&gt;&lt;pre style="background-color: #f9f9f9; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; color: black; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;"&gt;C:\Users\vbox&amp;gt; net use s: \\vboxsrv\TempFiles&lt;br /&gt;The command completed successfully.&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2113427314965770010?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2113427314965770010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2113427314965770010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2113427314965770010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2113427314965770010'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/virtualbox-tip-ubuntu-host-windows.html' title='Virtualbox Tip (Ubuntu Host, Windows Guest)'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3409460497007700017</id><published>2010-10-29T00:07:00.000-07:00</published><updated>2010-10-29T00:07:26.619-07:00</updated><title type='text'>My Ubuntu Install</title><content type='html'>&lt;ol&gt;&lt;li&gt;Install Ubuntu using Ubuntu mini iso&lt;/li&gt;&lt;li&gt;sudo aptitude install xorg&lt;/li&gt;&lt;li&gt;sudo aptitude install ratpoison&lt;/li&gt;&lt;li&gt;sudo aptitude install build-essential checkinstall&lt;/li&gt;&lt;li&gt;sudo aptitude install vim&lt;/li&gt;&lt;li&gt;sudo aptitude install subversion&lt;/li&gt;&lt;li&gt;sudo aptitude install chromium-browser&lt;/li&gt;&lt;li&gt;sudo aptitude install mutt&lt;/li&gt;&lt;li&gt;sudo aptitude install ssh&lt;/li&gt;&lt;li&gt;sudo aptitude install socat&lt;/li&gt;&lt;li&gt;sudo aptitude install msmtp&lt;/li&gt;&lt;li&gt;sudo aptitude install fetchmail&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;sudo aptitude install virtualbox-ose&lt;/li&gt;&lt;li&gt;sudo aptitude install flashplugin-nonfree&lt;/li&gt;&lt;li&gt;sudo aptitude install openssl ca-certificates&lt;/li&gt;&lt;li&gt;sudo aptitude install procmail and follow&amp;nbsp;http://ubuntuforums.org/showthread.php?t=565326&lt;/li&gt;&lt;li&gt;sudo aptitude install alsa and&amp;nbsp;alsactl init&lt;/li&gt;&lt;li&gt;sudo aptitude install xfonts-terminus-oblique xfonts-terminus-dos xfonts-terminus console-terminus&lt;/li&gt;&lt;li&gt;sudo aptitude install irssi&lt;/li&gt;&lt;li&gt;sudo aptitude install ttf-inconsolata&lt;/li&gt;&lt;li&gt;sudo aptitude install fortune fortunes&lt;/li&gt;&lt;li&gt;search and run google-repo-setup.sh&lt;/li&gt;&lt;li&gt;sudo aptitude install picasa&lt;/li&gt;&lt;li&gt;sudo aptitude install cowsay xcowsay&lt;/li&gt;&lt;li&gt;sudo visudo and then write&amp;nbsp;senthil ALL=NOPASSWD: ALL&lt;/li&gt;&lt;li&gt;sudo aptitude install urlview&lt;/li&gt;&lt;li&gt;sudo aptitude install xscreensaver xscreensaver-data&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&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/4574925891333430710-3409460497007700017?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3409460497007700017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3409460497007700017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3409460497007700017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3409460497007700017'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/my-ubuntu-install.html' title='My Ubuntu Install'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3449922400036216015</id><published>2010-10-27T18:41:00.000-07:00</published><updated>2010-10-27T18:41:01.941-07:00</updated><title type='text'>Making xterm beautiful</title><content type='html'>I thought it was not possible. I was pleasantly surprised to be proved wrong.&lt;br /&gt;&lt;br /&gt;Do the following steps.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo aptitude install ttf-inconsolata&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Open your &lt;b&gt;.Xresources&lt;/b&gt; file and type&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;XTerm*faceName: Inconsolata&lt;/b&gt;&lt;br /&gt;&lt;b&gt;XTerm*faceSize: 16&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Do an&lt;br /&gt;&lt;br /&gt;&lt;b&gt;xrdb -merge .Xresources&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Thanks to &lt;a href="http://www.levien.com/type/myfonts/inconsolata.html"&gt;levin&lt;/a&gt;, this answered my question on "What's there in a font and why are so many of them?" very well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3449922400036216015?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3449922400036216015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3449922400036216015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3449922400036216015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3449922400036216015'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/making-xterm-beautiful.html' title='Making xterm beautiful'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1552527310882589864</id><published>2010-10-26T23:47:00.000-07:00</published><updated>2010-10-26T23:47:03.667-07:00</updated><title type='text'>Remote empty directories</title><content type='html'>find -depth -type d -empty -exec rmdir {} \;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1552527310882589864?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1552527310882589864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1552527310882589864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1552527310882589864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1552527310882589864'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/remote-empty-directories.html' title='Remote empty directories'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6808583248154480797</id><published>2010-10-26T12:18:00.000-07:00</published><updated>2010-10-26T12:20:55.384-07:00</updated><title type='text'>Jump in and Code</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_ny1HYbb2lDw/TMcqAg9IXlI/AAAAAAAAKM4/zL-MM9Bo-5U/s1600/jump.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="140" src="http://2.bp.blogspot.com/_ny1HYbb2lDw/TMcqAg9IXlI/AAAAAAAAKM4/zL-MM9Bo-5U/s320/jump.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Complete the Projects which you want to do.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6808583248154480797?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6808583248154480797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6808583248154480797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6808583248154480797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6808583248154480797'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/jump-in-and-code.html' title='Jump in and Code'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ny1HYbb2lDw/TMcqAg9IXlI/AAAAAAAAKM4/zL-MM9Bo-5U/s72-c/jump.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8567981486733608324</id><published>2010-10-23T23:52:00.000-07:00</published><updated>2010-10-23T23:52:35.497-07:00</updated><title type='text'>Cyanogen Mod Upgrade on ADP2</title><content type='html'>Android 1.6 OS&lt;br /&gt;Dimension (LxWxTmm) 113 x 55.56 x 14.65&lt;br /&gt;Display Size 3.17&lt;br /&gt;HVGA Resolution&lt;br /&gt;Capacitive touch screen&lt;br /&gt;512MB FLASH Memory&lt;br /&gt;192MB RAM&lt;br /&gt;MSM7200A,528MHz chipset&lt;br /&gt;GSM/GPRS/EDGE Quad band&lt;br /&gt;850/900/1800/1900 MHz&lt;br /&gt;WCDMA 1700/2100 MHz : BC4&lt;br /&gt;2100 MHz : BC1&lt;br /&gt;HSPA Speed HSDPA 7.2 Mbps&lt;br /&gt;HSUPA 2 Mbps&lt;br /&gt;Blutooth 2.0 with EDR&lt;br /&gt;WiFi 802.11b/g&lt;br /&gt;3MP Auto Focus Camera&lt;br /&gt;1340 Battery(mAh)&lt;br /&gt;microSD Memory Slot&lt;br /&gt;USB 2.0&lt;br /&gt;GPS/AGPS&lt;br /&gt;Mailing list&lt;br /&gt;----&lt;br /&gt;ADP2 is SAPPHIRE PVT 32B DEV S-ON G&lt;br /&gt;HBOOT-1.33.3007 (SAPP30000)&lt;br /&gt;CPLD-10&lt;br /&gt;RADIO-2.22.19.26I&lt;br /&gt;Sep 25 2009, 16:22:56&lt;br /&gt;----&lt;br /&gt;PVT32B handsets have 192MB total RAM (96MB usable by OS) and use the Qualcomm MSM7201A CPU.&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Follow the instructions here:&lt;br /&gt;http://wiki.cyanogenmod.com/index.php?title=Full_Update_Guide_-_HTC_Magic_(32B)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8567981486733608324?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8567981486733608324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8567981486733608324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8567981486733608324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8567981486733608324'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/cyanogen-mod-upgrade-on-adp2.html' title='Cyanogen Mod Upgrade on ADP2'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-62184753430317933</id><published>2010-10-19T23:35:00.001-07:00</published><updated>2010-10-19T23:36:09.344-07:00</updated><title type='text'>startopenbox</title><content type='html'>When using Ratpoison, I have F8 set to openbox Window Manager.&lt;br /&gt;This is what my settings are.  I do a startopenbox.sh to load the second window manager.&lt;br /&gt;&lt;br /&gt;File: openbox.xinitrc&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;xrdb -load $HOME/.Xresources&lt;br /&gt;xsetroot -solid gray &amp;&lt;br /&gt;feh --bg-scale /home/senthil/sentosa.jpg &amp;&lt;br /&gt;xclock -g 50x50-0+0 -bw 0 &amp;&lt;br /&gt;xterm &amp;&lt;br /&gt;openbox&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;File: startopenbox.sh&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;xinit ./openbox.xinitrc -display :1 -- :1 2&gt;/dev/null &amp; &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/4574925891333430710-62184753430317933?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/62184753430317933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=62184753430317933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/62184753430317933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/62184753430317933'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/text.html' title='startopenbox'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1770704315877761626</id><published>2010-10-17T09:46:00.001-07:00</published><updated>2010-10-17T09:46:05.927-07:00</updated><title type='text'>Any Advice for young programmers ?</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial, Verdana, sans-serif; font-size: 10px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Wired.com:&lt;/strong&gt;&amp;nbsp;Any advice for young programmers?&lt;/div&gt;&lt;div style="margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Stroustrup:&lt;/strong&gt;&amp;nbsp;I guess giving advice is easy compared to taking it. Know your fundamentals (algorithms, data structures, machine architecture, systems) and know several programming languages to the point where you can use them idiomatically.&lt;/div&gt;&lt;div style="margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Know some non-computer field of study well — math, biology, history, optics, whatever. Learn to communicate effectively in speech and in writing. Spend an unreasonable amount of time on some difficult topic to really master it. Try to do something that might make a difference in the world.&lt;/div&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;Read More&amp;nbsp;&lt;a href="http://www.wired.com/thisdayintech/2010/10/1014cplusplus-released/all/1#ixzz12dSGVsJC" style="color: #003399; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;http://www.wired.com/thisdayintech/2010/10/1014cplusplus-released/all/1#ixzz12dSGVsJC&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1770704315877761626?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1770704315877761626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1770704315877761626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1770704315877761626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1770704315877761626'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/any-advice-for-young-programmers.html' title='Any Advice for young programmers ?'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5864606759459343135</id><published>2010-10-15T04:54:00.000-07:00</published><updated>2010-10-15T04:54:03.881-07:00</updated><title type='text'>Bjarne Stroustrup's old interview</title><content type='html'>&lt;i&gt;&lt;b&gt;Computer:&lt;/b&gt; I know you've been heavily involved in the C++ standards process, but what other projects are you involved in currently and how will you continue working to evolve C++?&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Stroustrup: &amp;nbsp;&lt;/b&gt;I'm suffering from having successfully completed a very large project. The ISO C++ standard is done. The third edition of The C++ Programming Language is there to acquaint serious programmers with what Standard C++ has to offer and how best to use it. And The Design and Evolution documents the design decisions that shaped C++. There is more to be done, but nothing that requires a full-time language designer. Now is the time to enjoy the flexibility and power of C++ by writing code, rather than focusing on possible changes.&lt;br /&gt;&lt;br /&gt;Apart from that, I'm taking the opportunity to learn a few things-a couple of new languages and something about how software is used in a large business-and planning some experiments in distributed computing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5864606759459343135?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5864606759459343135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5864606759459343135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5864606759459343135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5864606759459343135'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/bjarne-stroustrups-old-interview.html' title='Bjarne Stroustrup&apos;s old interview'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4163229795395899941</id><published>2010-10-15T04:27:00.001-07:00</published><updated>2010-10-15T04:27:26.198-07:00</updated><title type='text'>C++ Standard Library</title><content type='html'>&lt;i&gt;&lt;b&gt;Computer: How was the Standard Library defined and what impact will it have on the C++ community?&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Stroustrup: The most novel and interesting part of the standard library is the general and extensible framework for containers and algorithms. It is often called the STL and is primarily the work of Alex Stepanov (then at Hewlett-Packard Labs, now at Silicon Graphics).&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Alex worked on providing uncompromisingly general and uncompromisingly efficient fundamental algorithms which, for example, find an element in a data structure, sort a container, or count the occurrences of a value in a data structure. Such algorithms are fundamental to much computing.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4163229795395899941?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4163229795395899941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4163229795395899941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4163229795395899941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4163229795395899941'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/c-standard-library.html' title='C++ Standard Library'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6664378544579165674</id><published>2010-10-14T02:06:00.001-07:00</published><updated>2010-10-14T02:06:27.645-07:00</updated><title type='text'>recording script using recordmydesktop command</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# Warning: this does not have robust error checking!&lt;br /&gt;&lt;br /&gt;bad=67&lt;br /&gt;if [ $# -lt 1 ]&lt;br /&gt;then&lt;br /&gt;echo "Usage: $0 [filename] [[optional time]]"&lt;br /&gt;exit $bad&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ $# -eq 1 ] #check for arguments&lt;br /&gt;then&lt;br /&gt;time=3 #if one (only filename) exists, sleep for 3 seconds&lt;br /&gt;filename=$1 #set filename&lt;br /&gt;else&lt;br /&gt;time=$2 #else, we'll sleep for $2 seconds&lt;br /&gt;filename=$1 #set filename&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;recordmydesktop -windowid `xwininfo |grep "Window id:"|sed -e "s/xwininfo\:\ Window id:\ //;s/\ .*//"` -o $filename.ogv -delay $time --no-sound&lt;br /&gt;&lt;br /&gt;ffmpeg -i $filename.ogv -b 384000 -s 640x480 -pass 1 -passlogfile log-file $filename.flv&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6664378544579165674?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6664378544579165674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6664378544579165674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6664378544579165674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6664378544579165674'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/recording-script-using-recordmydesktop.html' title='recording script using recordmydesktop command'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1547536987826794513</id><published>2010-10-01T01:38:00.000-07:00</published><updated>2010-10-01T01:38:11.251-07:00</updated><title type='text'>SSH - Swiss Army Knife</title><content type='html'>Doing remote file operations using SSH is covered well in this link: http://ultra.ap.krakow.pl/~bar/DOC/ssh_backup.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1547536987826794513?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1547536987826794513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1547536987826794513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1547536987826794513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1547536987826794513'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/10/ssh-swiss-army-knife.html' title='SSH - Swiss Army Knife'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2312835733976212066</id><published>2010-09-29T07:50:00.001-07:00</published><updated>2010-09-29T07:50:10.892-07:00</updated><title type='text'>Download Picasaweb Album  on Linux</title><content type='html'>Using this project: http://sourceforge.net/projects/picasaalbumdown/&lt;br /&gt;&lt;br /&gt;Direct download to Picasa does not work. It works on Windows.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2312835733976212066?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2312835733976212066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2312835733976212066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2312835733976212066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2312835733976212066'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/download-picasaweb-album-on-linux.html' title='Download Picasaweb Album  on Linux'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2957300542095632727</id><published>2010-09-29T00:25:00.000-07:00</published><updated>2010-09-29T00:25:19.139-07:00</updated><title type='text'>James Gosling on Development of Java</title><content type='html'>&lt;blockquote&gt;&lt;br /&gt;James Gosling:So long as they do that. The development of Java is not an inexpensive thing. It takes a fair amount of funding. It's not just about writing code. Learning the code is two or three percent of the expense. You're shipping fifteen million copies a week, just the bandwith is horrible. The QA when you have to worry about something that has thirty issues. When you've got everything, every stock exchange, every phone company on the planet. Their security depends on Java. So it's not a causual piece of testing.&lt;br /&gt;&lt;br /&gt;You know, when it comes to open source contributions, our history with contributions over the years have been kinda snarky. We'd get lost of people sending code and fixes. But on average, we'd get a submission that fixed the bug but it caused three or four more. And it probably didn't fix the bug for everybody. It probably only fixed the bug for their one case. And trying to get people in the community to actually think about the whole code base and not just their particular issue today. Doing one line of change means an immense amount of testing.&lt;br /&gt;&lt;br /&gt;Most open source projects are way too casual for that. Sometimes when you get bugs that are potential security issues, you have to move fast, you have to put immense resources on getting it done. Maybe it's just one engineer fixing one character in one line, but then testing it and making sure you didn't introduce a bug. The harder stuff is if you have a bug, there are probably people out there who have worked around that bug, so how many of the workarounds are you going to break. And when you've got nine or ten million in the developer community you have enormous applications, trivial fixes are not trivial. And open source projects, the way the average open source projects are constituted. IT's easy to get people to do the fun stuff. It's hard to get people to do the hard stuff.&lt;br /&gt;&lt;br /&gt;Like QAing the math libraries. Like doing QA on sine and cosine, you absolutely have to have a PHd in Mathematics. Sine and cosine: it sounds really simple, but there is unbelievable amount of depths of subtlety in there. There are extraordinarily few people on the planet qualified to QA that type of stuff.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;http://www.basementcoders.com/transcripts/James_Gosling_Transcript.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2957300542095632727?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2957300542095632727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2957300542095632727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2957300542095632727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2957300542095632727'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/james-gosling-on-development-of-java.html' title='James Gosling on Development of Java'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6527396087069020683</id><published>2010-09-27T08:36:00.001-07:00</published><updated>2010-09-27T08:36:15.437-07:00</updated><title type='text'>Quote HTML Function in python</title><content type='html'>&lt;blockquote&gt;def _quote_html(html):&lt;br /&gt;    return html.replace("&amp;", "&amp;amp;").replace("&lt;", "&amp;lt;").replace("&gt;", "&amp;gt;")&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6527396087069020683?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6527396087069020683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6527396087069020683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6527396087069020683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6527396087069020683'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/quote-html-function-in-python.html' title='Quote HTML Function in python'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-9086551754660755087</id><published>2010-09-26T23:29:00.001-07:00</published><updated>2010-09-26T23:29:55.871-07:00</updated><title type='text'>Android Dev Phone 1</title><content type='html'>For all purposes, it is same as &lt;b&gt;HTC Dream or G1&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-9086551754660755087?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/9086551754660755087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=9086551754660755087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9086551754660755087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9086551754660755087'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/android-dev-phone-1.html' title='Android Dev Phone 1'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8782853308700740740</id><published>2010-09-26T23:04:00.001-07:00</published><updated>2010-09-26T23:04:11.203-07:00</updated><title type='text'>Additional X Server on Ubuntu</title><content type='html'>&lt;blockquote&gt;xinit -display :n+1 -- :n+1&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8782853308700740740?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8782853308700740740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8782853308700740740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8782853308700740740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8782853308700740740'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/additional-x-server-on-ubuntu.html' title='Additional X Server on Ubuntu'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5482458253853613227</id><published>2010-09-22T00:21:00.000-07:00</published><updated>2010-09-22T00:21:32.086-07:00</updated><title type='text'>-bash: /bin/ls: Argument list too long</title><content type='html'>In bash, doing a &lt;pre&gt;ls *-output.log&lt;/pre&gt;on directory containing 7000 files fails with the error&lt;br /&gt;&lt;br /&gt;&lt;b&gt;-bash: /bin/ls: Argument list too long&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The best way to go about with this is:&lt;br /&gt;&lt;br /&gt;&lt;b&gt; find . -name '*-output.log' | xargs ls -l &lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5482458253853613227?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5482458253853613227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5482458253853613227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5482458253853613227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5482458253853613227'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/bash-binls-argument-list-too-long.html' title='-bash: /bin/ls: Argument list too long'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6549566128952576222</id><published>2010-09-21T20:13:00.000-07:00</published><updated>2010-09-26T23:07:43.181-07:00</updated><title type='text'>Nice join methods in python</title><content type='html'>&lt;blockquote&gt;_nulljoin = ''.join&lt;br /&gt;_semispacejoin = '; '.join                                                                                           &lt;br /&gt;_spacejoin = ' '.join&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6549566128952576222?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6549566128952576222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6549566128952576222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6549566128952576222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6549566128952576222'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/nice-join-methods-in-python.html' title='Nice join methods in python'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8267255937098496901</id><published>2010-09-21T00:06:00.000-07:00</published><updated>2010-09-21T00:06:44.772-07:00</updated><title type='text'>using imapfilter</title><content type='html'>http://moiristo.wordpress.com/2008/11/18/sorting-imap-mail-with-imapfilter/&lt;br /&gt;&lt;br /&gt;I struggled a bit to use imapfilter to delete the mails at the server.&lt;br /&gt;The following was configuration&lt;br /&gt;&lt;br /&gt;--------------&lt;br /&gt;--  Options  --&lt;br /&gt;---------------&lt;br /&gt;&lt;br /&gt;options.timeout = 120&lt;br /&gt;options.subscribe = true&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------&lt;br /&gt;--  Accounts  --&lt;br /&gt;----------------&lt;br /&gt;&lt;br /&gt;-- Connects to "imap1.mail.server", as user "user1" with "secret1" as&lt;br /&gt;-- password.&lt;br /&gt;account1 = IMAP {&lt;br /&gt;    server = 'myserver.com',&lt;br /&gt;    port = 993,&lt;br /&gt;    username = 'username',&lt;br /&gt;    password = 'password.',&lt;br /&gt;    ssl = 'tls1',&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;results = account1.INBOX:contain_subject('Subject')&lt;br /&gt;-- Delete messages. This DOES NOT Work.&lt;br /&gt;-- results:delete_messages()&lt;br /&gt;&lt;br /&gt;-- This Works&lt;br /&gt;&lt;br /&gt;account1.INBOX:delete_messages(results)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8267255937098496901?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8267255937098496901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8267255937098496901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8267255937098496901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8267255937098496901'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/using-imapfilter.html' title='using imapfilter'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2313713606414808826</id><published>2010-09-20T18:35:00.000-07:00</published><updated>2010-09-20T18:35:00.912-07:00</updated><title type='text'>urlopen with multiple retries</title><content type='html'>A good example from &lt;b&gt;test_urllib2net&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;def _retry_thrice(func, exc, *args, **kwargs):&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for i in range(3):&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try:&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return func(*args, **kwargs)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;except exc, last_exc:&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;continue&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;except:&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;raise&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;raise last_exc&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;def _wrap_with_retry_thrice(func, exc):&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;def wrapped(*args, **kwargs):&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _retry_thrice(func, exc, *args, **kwargs)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return wrapped&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;# Connecting to remote hosts is flaky. &amp;nbsp;Make it more robust by retrying&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;# the connection several times.&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;_urlopen_with_retry = _wrap_with_retry_thrice(urllib2.urlopen, urllib2.URLError)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2313713606414808826?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2313713606414808826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2313713606414808826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2313713606414808826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2313713606414808826'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/urlopen-with-multiple-retries.html' title='urlopen with multiple retries'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4288506078009849301</id><published>2010-09-15T00:26:00.000-07:00</published><updated>2010-09-15T00:26:32.795-07:00</updated><title type='text'>Constructing a command for subprocess execution</title><content type='html'>Python module, subprocess's Popen call takes a list as its first argument, with name of the command as the first element of the list. Most often, we do "command line sentence".split() to get the list for the subprocess.Popen call. &amp;nbsp;It is very suboptimal way, especially when you have double-quotes characters which served as shell escape characters.&lt;br /&gt;&lt;br /&gt;Consider the following command and see how shlex module makes it more suitable for subprocess.Popen&lt;br /&gt;&lt;br /&gt;&lt;b&gt;/bin/vikings -input eggs.txt -output "spam spam.txt" -cmd "echo '$MONEY'"&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;import shlex&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;cmd = """/bin/vikings -input eggs.txt -output "spam spam.txt" -cmd "echo '$MONEY'" """&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;list_cmd1 = cmd.split(' ')&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;list_cmd2 = shlex.split(cmd)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;print list_cmd1&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;print list_cmd2&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div&gt;$python prog.py&amp;nbsp;&lt;/div&gt;&lt;/b&gt;&lt;b&gt;['/bin/vikings', '-input', 'eggs.txt', '-output', '"spam', 'spam.txt"', '-cmd', '"echo', '\'$MONEY\'"', '']&lt;/b&gt;&lt;br /&gt;&lt;b&gt;['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', "echo '$MONEY'"]&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Isn't the second version much simpler?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4288506078009849301?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4288506078009849301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4288506078009849301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4288506078009849301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4288506078009849301'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/constructing-command-for-subprocess.html' title='Constructing a command for subprocess execution'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3311642377341269362</id><published>2010-09-14T21:22:00.000-07:00</published><updated>2010-09-14T21:23:10.971-07:00</updated><title type='text'>Least used Modules from Python Standard Library</title><content type='html'>Geremy Condra Wrote in the Python-dev mailing list.&lt;p&gt;I (Geremy Condra) ran some statistics (over pypi) on the number of&lt;br&gt;times modules out of the stdlib got imported a few months ago and came&lt;br&gt;up with a reasonably comprehensive  list of the least-used things in&lt;br&gt;the stdlib. For the record, since I wound up parsing import statements&lt;br&gt;and know some garbage data got in, its reasonable to assume that a few&lt;br&gt;otherwise  valid imports aren&amp;#39;t recorded here. But enough with the&lt;br&gt;disclaimers.&lt;p&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;AL&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;ColorPicker&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;DEVICE&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;FL&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;FrameWork&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;Nav&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;PixMapWrapper&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;SUNAUDIODEV&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;aepack&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;aetypes&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;al&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;applesingle&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;autoGIL&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;buildtools&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;cd&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;cfmfile&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;dbhash&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;dl&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;dummy_threading&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;findertools&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;flp&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;fm&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;fpectl&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;gensuitemodule&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;icopen&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;imageop&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;imgfile&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;jpeg&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;macerrors&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;macostools&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;macresource&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;nis&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;posixfile&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;spwd&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;sunaudiodev&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;symtable&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;videoreader&lt;br&gt;0 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;winsound&lt;br&gt;1 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;Tix&lt;br&gt;1 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;audioop&lt;br&gt;2 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;ic&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;Bastion&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;binhex&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;dumbdbm&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;dummy_thread&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;fractions&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;future_builtins&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;mailcap&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;ossaudiodev&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;tabnanny&lt;br&gt;3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;xdrlib&lt;br&gt;4 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;ScrolledText&lt;br&gt;4 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;macpath&lt;br&gt;4 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;stringprep&lt;br&gt;5 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;DocXMLRPCServer&lt;br&gt;5 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;GL&lt;br&gt;5 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;aifc&lt;br&gt;5 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;mimify&lt;br&gt;5 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;sunau&lt;br&gt;6 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;fl&lt;br&gt;6 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;pickletools&lt;br&gt;6 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;statvfs&lt;br&gt;6 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;turtle&lt;br&gt;7 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;W&lt;br&gt;8 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;codeop&lt;br&gt;8 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;multifile&lt;br&gt;8 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;nntplib&lt;br&gt;8 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;poplib&lt;br&gt;8 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;sndhdr&lt;br&gt;9 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;EasyDialogs&lt;br&gt;9 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;pipes&lt;br&gt;9 &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;pyclbr&lt;br&gt;10 &amp;#160; &amp;#160; &amp;#160; &amp;#160; dbm&lt;br&gt;10 &amp;#160; &amp;#160; &amp;#160; &amp;#160; gdbm&lt;br&gt;10 &amp;#160; &amp;#160; &amp;#160; &amp;#160; imputil&lt;br&gt;11 &amp;#160; &amp;#160; &amp;#160; &amp;#160; MiniAEFrame&lt;br&gt;11 &amp;#160; &amp;#160; &amp;#160; &amp;#160; fpformat&lt;br&gt;11 &amp;#160; &amp;#160; &amp;#160; &amp;#160; numbers&lt;br&gt;14 &amp;#160; &amp;#160; &amp;#160; &amp;#160; CGIHTTPServer&lt;br&gt;14 &amp;#160; &amp;#160; &amp;#160; &amp;#160; pty&lt;br&gt;16 &amp;#160; &amp;#160; &amp;#160; &amp;#160; rexec&lt;br&gt;18 &amp;#160; &amp;#160; &amp;#160; &amp;#160; netrc&lt;br&gt;19 &amp;#160; &amp;#160; &amp;#160; &amp;#160; msvcrt&lt;br&gt;19 &amp;#160; &amp;#160; &amp;#160; &amp;#160; uu&lt;br&gt;20 &amp;#160; &amp;#160; &amp;#160; &amp;#160; rlcompleter&lt;br&gt;21 &amp;#160; &amp;#160; &amp;#160; &amp;#160; compileall&lt;br&gt;22 &amp;#160; &amp;#160; &amp;#160; &amp;#160; tty&lt;br&gt;24 &amp;#160; &amp;#160; &amp;#160; &amp;#160; lib2to3&lt;br&gt;24 &amp;#160; &amp;#160; &amp;#160; &amp;#160; mutex&lt;br&gt;25 &amp;#160; &amp;#160; &amp;#160; &amp;#160; chunk&lt;br&gt;25 &amp;#160; &amp;#160; &amp;#160; &amp;#160; mhlib&lt;br&gt;27 &amp;#160; &amp;#160; &amp;#160; &amp;#160; whichdb&lt;br&gt;28 &amp;#160; &amp;#160; &amp;#160; &amp;#160; robotparser&lt;br&gt;29 &amp;#160; &amp;#160; &amp;#160; &amp;#160; ssl&lt;br&gt;30 &amp;#160; &amp;#160; &amp;#160; &amp;#160; dircache&lt;br&gt;32 &amp;#160; &amp;#160; &amp;#160; &amp;#160; gl&lt;br&gt;33 &amp;#160; &amp;#160; &amp;#160; &amp;#160; runpy&lt;br&gt;34 &amp;#160; &amp;#160; &amp;#160; &amp;#160; posix&lt;br&gt;36 &amp;#160; &amp;#160; &amp;#160; &amp;#160; aetools&lt;br&gt;36 &amp;#160; &amp;#160; &amp;#160; &amp;#160; wave&lt;br&gt;37 &amp;#160; &amp;#160; &amp;#160; &amp;#160; termios&lt;br&gt;42 &amp;#160; &amp;#160; &amp;#160; &amp;#160; bdb&lt;br&gt;44 &amp;#160; &amp;#160; &amp;#160; &amp;#160; imaplib&lt;br&gt;46 &amp;#160; &amp;#160; &amp;#160; &amp;#160; ast&lt;br&gt;47 &amp;#160; &amp;#160; &amp;#160; &amp;#160; bsddb&lt;br&gt;47 &amp;#160; &amp;#160; &amp;#160; &amp;#160; imghdr&lt;br&gt;50 &amp;#160; &amp;#160; &amp;#160; &amp;#160; crypt&lt;br&gt;50 &amp;#160; &amp;#160; &amp;#160; &amp;#160; smtpd&lt;br&gt;53 &amp;#160; &amp;#160; &amp;#160; &amp;#160; Carbon&lt;br&gt;57 &amp;#160; &amp;#160; &amp;#160; &amp;#160; MimeWriter&lt;br&gt;57 &amp;#160; &amp;#160; &amp;#160; &amp;#160; msilib&lt;br&gt;60 &amp;#160; &amp;#160; &amp;#160; &amp;#160; cmath&lt;br&gt;66 &amp;#160; &amp;#160; &amp;#160; &amp;#160; filecmp&lt;br&gt;67 &amp;#160; &amp;#160; &amp;#160; &amp;#160; syslog&lt;br&gt;68 &amp;#160; &amp;#160; &amp;#160; &amp;#160; MacOS&lt;br&gt;73 &amp;#160; &amp;#160; &amp;#160; &amp;#160; cProfile&lt;br&gt;74 &amp;#160; &amp;#160; &amp;#160; &amp;#160; asynchat&lt;br&gt;74 &amp;#160; &amp;#160; &amp;#160; &amp;#160; repr&lt;br&gt;75 &amp;#160; &amp;#160; &amp;#160; &amp;#160; ftplib&lt;br&gt;76 &amp;#160; &amp;#160; &amp;#160; &amp;#160; htmllib&lt;br&gt;83 &amp;#160; &amp;#160; &amp;#160; &amp;#160; abc&lt;br&gt;91 &amp;#160; &amp;#160; &amp;#160; &amp;#160; quopri&lt;br&gt;93 &amp;#160; &amp;#160; &amp;#160; &amp;#160; pkgutil&lt;br&gt;98 &amp;#160; &amp;#160; &amp;#160; &amp;#160; anydbm&lt;br&gt;98 &amp;#160; &amp;#160; &amp;#160; &amp;#160; telnetlib&lt;br&gt;99 &amp;#160; &amp;#160; &amp;#160; &amp;#160; trace&lt;br&gt;102 &amp;#160; &amp;#160; &amp;#160; &amp;#160;formatter&lt;br&gt;104 &amp;#160; &amp;#160; &amp;#160; &amp;#160;__main__&lt;br&gt;104 &amp;#160; &amp;#160; &amp;#160; &amp;#160;readline&lt;br&gt;105 &amp;#160; &amp;#160; &amp;#160; &amp;#160;colorsys&lt;br&gt;110 &amp;#160; &amp;#160; &amp;#160; &amp;#160;_winreg&lt;br&gt;111 &amp;#160; &amp;#160; &amp;#160; &amp;#160;curses&lt;br&gt;113 &amp;#160; &amp;#160; &amp;#160; &amp;#160;plistlib&lt;br&gt;115 &amp;#160; &amp;#160; &amp;#160; &amp;#160;modulefinder&lt;br&gt;116 &amp;#160; &amp;#160; &amp;#160; &amp;#160;UserString&lt;br&gt;121 &amp;#160; &amp;#160; &amp;#160; &amp;#160;cookielib&lt;br&gt;125 &amp;#160; &amp;#160; &amp;#160; &amp;#160;mailbox&lt;br&gt;126 &amp;#160; &amp;#160; &amp;#160; &amp;#160;cgitb&lt;br&gt;128 &amp;#160; &amp;#160; &amp;#160; &amp;#160;bz2&lt;br&gt;128 &amp;#160; &amp;#160; &amp;#160; &amp;#160;sched&lt;br&gt;134 &amp;#160; &amp;#160; &amp;#160; &amp;#160;io&lt;br&gt;146 &amp;#160; &amp;#160; &amp;#160; &amp;#160;mimetools&lt;br&gt;147 &amp;#160; &amp;#160; &amp;#160; &amp;#160;pydoc&lt;br&gt;148 &amp;#160; &amp;#160; &amp;#160; &amp;#160;SimpleXMLRPCServer&lt;br&gt;154 &amp;#160; &amp;#160; &amp;#160; &amp;#160;mmap&lt;br&gt;155 &amp;#160; &amp;#160; &amp;#160; &amp;#160;user&lt;br&gt;156 &amp;#160; &amp;#160; &amp;#160; &amp;#160;site&lt;br&gt;157 &amp;#160; &amp;#160; &amp;#160; &amp;#160;symbol&lt;br&gt;159 &amp;#160; &amp;#160; &amp;#160; &amp;#160;zipimport&lt;br&gt;166 &amp;#160; &amp;#160; &amp;#160; &amp;#160;pstats&lt;br&gt;172 &amp;#160; &amp;#160; &amp;#160; &amp;#160;fileinput&lt;br&gt;173 &amp;#160; &amp;#160; &amp;#160; &amp;#160;encodings&lt;br&gt;179 &amp;#160; &amp;#160; &amp;#160; &amp;#160;py_compile&lt;br&gt;180 &amp;#160; &amp;#160; &amp;#160; &amp;#160;SimpleHTTPServer&lt;br&gt;181 &amp;#160; &amp;#160; &amp;#160; &amp;#160;profile&lt;br&gt;183 &amp;#160; &amp;#160; &amp;#160; &amp;#160;cmd&lt;br&gt;198 &amp;#160; &amp;#160; &amp;#160; &amp;#160;Tkinter&lt;br&gt;200 &amp;#160; &amp;#160; &amp;#160; &amp;#160;fcntl&lt;br&gt;206 &amp;#160; &amp;#160; &amp;#160; &amp;#160;copy_reg&lt;br&gt;225 &amp;#160; &amp;#160; &amp;#160; &amp;#160;linecache&lt;br&gt;226 &amp;#160; &amp;#160; &amp;#160; &amp;#160;hotshot&lt;br&gt;234 &amp;#160; &amp;#160; &amp;#160; &amp;#160;multiprocessing&lt;br&gt;262 &amp;#160; &amp;#160; &amp;#160; &amp;#160;dis&lt;br&gt;273 &amp;#160; &amp;#160; &amp;#160; &amp;#160;UserList&lt;br&gt;273 &amp;#160; &amp;#160; &amp;#160; &amp;#160;resource&lt;br&gt;287 &amp;#160; &amp;#160; &amp;#160; &amp;#160;SocketServer&lt;br&gt;289 &amp;#160; &amp;#160; &amp;#160; &amp;#160;shelve&lt;br&gt;297 &amp;#160; &amp;#160; &amp;#160; &amp;#160;sqlite3&lt;br&gt;317 &amp;#160; &amp;#160; &amp;#160; &amp;#160;grp&lt;br&gt;322 &amp;#160; &amp;#160; &amp;#160; &amp;#160;asyncore&lt;br&gt;335 &amp;#160; &amp;#160; &amp;#160; &amp;#160;timeit&lt;br&gt;339 &amp;#160; &amp;#160; &amp;#160; &amp;#160;keyword&lt;br&gt;345 &amp;#160; &amp;#160; &amp;#160; &amp;#160;sgmllib&lt;br&gt;363 &amp;#160; &amp;#160; &amp;#160; &amp;#160;token&lt;br&gt;367 &amp;#160; &amp;#160; &amp;#160; &amp;#160;test&lt;br&gt;383 &amp;#160; &amp;#160; &amp;#160; &amp;#160;parser&lt;br&gt;386 &amp;#160; &amp;#160; &amp;#160; &amp;#160;shlex&lt;br&gt;421 &amp;#160; &amp;#160; &amp;#160; &amp;#160;wsgiref&lt;br&gt;451 &amp;#160; &amp;#160; &amp;#160; &amp;#160;contextlib&lt;br&gt;458 &amp;#160; &amp;#160; &amp;#160; &amp;#160;unicodedata&lt;br&gt;471 &amp;#160; &amp;#160; &amp;#160; &amp;#160;tokenize&lt;br&gt;472 &amp;#160; &amp;#160; &amp;#160; &amp;#160;pwd&lt;br&gt;487 &amp;#160; &amp;#160; &amp;#160; &amp;#160;webbrowser&lt;br&gt;526 &amp;#160; &amp;#160; &amp;#160; &amp;#160;hmac&lt;br&gt;529 &amp;#160; &amp;#160; &amp;#160; &amp;#160;heapq&lt;br&gt;542 &amp;#160; &amp;#160; &amp;#160; &amp;#160;platform&lt;br&gt;573 &amp;#160; &amp;#160; &amp;#160; &amp;#160;gettext&lt;br&gt;594 &amp;#160; &amp;#160; &amp;#160; &amp;#160;pdb&lt;br&gt;597 &amp;#160; &amp;#160; &amp;#160; &amp;#160;popen2&lt;br&gt;607 &amp;#160; &amp;#160; &amp;#160; &amp;#160;json&lt;br&gt;608 &amp;#160; &amp;#160; &amp;#160; &amp;#160;marshal&lt;br&gt;619 &amp;#160; &amp;#160; &amp;#160; &amp;#160;smtplib&lt;br&gt;621 &amp;#160; &amp;#160; &amp;#160; &amp;#160;bisect&lt;br&gt;637 &amp;#160; &amp;#160; &amp;#160; &amp;#160;difflib&lt;br&gt;647 &amp;#160; &amp;#160; &amp;#160; &amp;#160;commands&lt;br&gt;657 &amp;#160; &amp;#160; &amp;#160; &amp;#160;BaseHTTPServer&lt;br&gt;677 &amp;#160; &amp;#160; &amp;#160; &amp;#160;Cookie&lt;br&gt;688 &amp;#160; &amp;#160; &amp;#160; &amp;#160;locale&lt;br&gt;695 &amp;#160; &amp;#160; &amp;#160; &amp;#160;zlib&lt;br&gt;708 &amp;#160; &amp;#160; &amp;#160; &amp;#160;HTMLParser&lt;br&gt;710 &amp;#160; &amp;#160; &amp;#160; &amp;#160;code&lt;br&gt;721 &amp;#160; &amp;#160; &amp;#160; &amp;#160;rfc822&lt;br&gt;748 &amp;#160; &amp;#160; &amp;#160; &amp;#160;compiler&lt;br&gt;759 &amp;#160; &amp;#160; &amp;#160; &amp;#160;gzip&lt;br&gt;759 &amp;#160; &amp;#160; &amp;#160; &amp;#160;select&lt;br&gt;771 &amp;#160; &amp;#160; &amp;#160; &amp;#160;ctypes&lt;br&gt;788 &amp;#160; &amp;#160; &amp;#160; &amp;#160;gc&lt;br&gt;796 &amp;#160; &amp;#160; &amp;#160; &amp;#160;binascii&lt;br&gt;812 &amp;#160; &amp;#160; &amp;#160; &amp;#160;getpass&lt;br&gt;822 &amp;#160; &amp;#160; &amp;#160; &amp;#160;__builtin__&lt;br&gt;854 &amp;#160; &amp;#160; &amp;#160; &amp;#160;htmlentitydefs&lt;br&gt;857 &amp;#160; &amp;#160; &amp;#160; &amp;#160;tarfile&lt;br&gt;869 &amp;#160; &amp;#160; &amp;#160; &amp;#160;decimal&lt;br&gt;872 &amp;#160; &amp;#160; &amp;#160; &amp;#160;xmlrpclib&lt;br&gt;903 &amp;#160; &amp;#160; &amp;#160; &amp;#160;csv&lt;br&gt;933 &amp;#160; &amp;#160; &amp;#160; &amp;#160;atexit&lt;br&gt;943 &amp;#160; &amp;#160; &amp;#160; &amp;#160;functools&lt;br&gt;946 &amp;#160; &amp;#160; &amp;#160; &amp;#160;exceptions&lt;br&gt;976 &amp;#160; &amp;#160; &amp;#160; &amp;#160;array&lt;br&gt;979 &amp;#160; &amp;#160; &amp;#160; &amp;#160;sha&lt;br&gt;1044 &amp;#160; &amp;#160; &amp;#160; thread&lt;br&gt;1056 &amp;#160; &amp;#160; &amp;#160; calendar&lt;br&gt;1064 &amp;#160; &amp;#160; &amp;#160; zipfile&lt;br&gt;1070 &amp;#160; &amp;#160; &amp;#160; UserDict&lt;br&gt;1078 &amp;#160; &amp;#160; &amp;#160; new&lt;br&gt;1102 &amp;#160; &amp;#160; &amp;#160; uuid&lt;br&gt;1148 &amp;#160; &amp;#160; &amp;#160; Queue&lt;br&gt;1159 &amp;#160; &amp;#160; &amp;#160; sets&lt;br&gt;1172 &amp;#160; &amp;#160; &amp;#160; signal&lt;br&gt;1213 &amp;#160; &amp;#160; &amp;#160; hashlib&lt;br&gt;1242 &amp;#160; &amp;#160; &amp;#160; getopt&lt;br&gt;1276 &amp;#160; &amp;#160; &amp;#160; email&lt;br&gt;1310 &amp;#160; &amp;#160; &amp;#160; imp&lt;br&gt;1321 &amp;#160; &amp;#160; &amp;#160; fnmatch&lt;br&gt;1328 &amp;#160; &amp;#160; &amp;#160; mimetypes&lt;br&gt;1348 &amp;#160; &amp;#160; &amp;#160; collections&lt;br&gt;1442 &amp;#160; &amp;#160; &amp;#160; httplib&lt;br&gt;1469 &amp;#160; &amp;#160; &amp;#160; cPickle&lt;br&gt;1505 &amp;#160; &amp;#160; &amp;#160; md5&lt;br&gt;1614 &amp;#160; &amp;#160; &amp;#160; weakref&lt;br&gt;1618 &amp;#160; &amp;#160; &amp;#160; textwrap&lt;br&gt;1654 &amp;#160; &amp;#160; &amp;#160; pickle&lt;br&gt;1722 &amp;#160; &amp;#160; &amp;#160; errno&lt;br&gt;1729 &amp;#160; &amp;#160; &amp;#160; stat&lt;br&gt;2020 &amp;#160; &amp;#160; &amp;#160; pprint&lt;br&gt;2060 &amp;#160; &amp;#160; &amp;#160; struct&lt;br&gt;2389 &amp;#160; &amp;#160; &amp;#160; codecs&lt;br&gt;2391 &amp;#160; &amp;#160; &amp;#160; ConfigParser&lt;br&gt;2406 &amp;#160; &amp;#160; &amp;#160; operator&lt;br&gt;2578 &amp;#160; &amp;#160; &amp;#160; math&lt;br&gt;2626 &amp;#160; &amp;#160; &amp;#160; base64&lt;br&gt;2925 &amp;#160; &amp;#160; &amp;#160; inspect&lt;br&gt;3013 &amp;#160; &amp;#160; &amp;#160; cgi&lt;br&gt;3105 &amp;#160; &amp;#160; &amp;#160; itertools&lt;br&gt;3250 &amp;#160; &amp;#160; &amp;#160; xml&lt;br&gt;3318 &amp;#160; &amp;#160; &amp;#160; glob&lt;br&gt;3402 &amp;#160; &amp;#160; &amp;#160; __future__&lt;br&gt;3505 &amp;#160; &amp;#160; &amp;#160; warnings&lt;br&gt;3549 &amp;#160; &amp;#160; &amp;#160; socket&lt;br&gt;3722 &amp;#160; &amp;#160; &amp;#160; urlparse&lt;br&gt;4014 &amp;#160; &amp;#160; &amp;#160; traceback&lt;br&gt;4142 &amp;#160; &amp;#160; &amp;#160; subprocess&lt;br&gt;4194 &amp;#160; &amp;#160; &amp;#160; threading&lt;br&gt;4198 &amp;#160; &amp;#160; &amp;#160; cStringIO&lt;br&gt;4224 &amp;#160; &amp;#160; &amp;#160; string&lt;br&gt;4501 &amp;#160; &amp;#160; &amp;#160; copy&lt;br&gt;4696 &amp;#160; &amp;#160; &amp;#160; random&lt;br&gt;5088 &amp;#160; &amp;#160; &amp;#160; shutil&lt;br&gt;5392 &amp;#160; &amp;#160; &amp;#160; tempfile&lt;br&gt;5426 &amp;#160; &amp;#160; &amp;#160; doctest&lt;br&gt;5642 &amp;#160; &amp;#160; &amp;#160; optparse&lt;br&gt;5913 &amp;#160; &amp;#160; &amp;#160; types&lt;br&gt;6185 &amp;#160; &amp;#160; &amp;#160; StringIO&lt;br&gt;6522 &amp;#160; &amp;#160; &amp;#160; urllib&lt;br&gt;7346 &amp;#160; &amp;#160; &amp;#160; distutils&lt;br&gt;7930 &amp;#160; &amp;#160; &amp;#160; datetime&lt;br&gt;8416 &amp;#160; &amp;#160; &amp;#160; urllib2&lt;br&gt;9567 &amp;#160; &amp;#160; &amp;#160; logging&lt;br&gt;9906 &amp;#160; &amp;#160; &amp;#160; time&lt;br&gt;13019 &amp;#160; &amp;#160; &amp;#160;re&lt;br&gt;14714 &amp;#160; &amp;#160; &amp;#160;unittest&lt;br&gt;18334 &amp;#160; &amp;#160; &amp;#160;sys&lt;br&gt;27468 &amp;#160; &amp;#160; &amp;#160;os&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3311642377341269362?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3311642377341269362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3311642377341269362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3311642377341269362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3311642377341269362'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/09/least-used-modules-from-python-standard.html' title='Least used Modules from Python Standard Library'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7326718459297389754</id><published>2010-08-24T17:34:00.000-07:00</published><updated>2010-09-16T23:21:51.238-07:00</updated><title type='text'>How to charge canon fs 200 camcoder.</title><content type='html'>I did not know how to charge my canon fs200 camcoder, the charging button is hidden in the side. This video helped me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7326718459297389754?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7326718459297389754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7326718459297389754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7326718459297389754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7326718459297389754'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/08/how-to-charge-canon-fs-200-camcoder.html' title='How to charge canon fs 200 camcoder.'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5210084054075921826</id><published>2010-08-19T16:57:00.000-07:00</published><updated>2010-09-16T23:21:51.247-07:00</updated><title type='text'>perforce tip - p4 describe changelist</title><content type='html'>We usually attach the perforce changelist numbers in our bug reports. I used to wonder as how do we use those changelist numbers and to see the diff of whats changed.&lt;br/&gt;&lt;br/&gt;The command is:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;p4 describe -du changenumber&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;-du stands for unified diff which is often more helpful than others.&lt;br/&gt;&lt;br/&gt;Look for &lt;b&gt;p4 help describe&lt;/b&gt; for more information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5210084054075921826?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5210084054075921826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5210084054075921826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5210084054075921826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5210084054075921826'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/08/perforce-tip-p4-describe-changelist.html' title='perforce tip - p4 describe changelist'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4835142483141294042</id><published>2010-08-07T11:12:00.000-07:00</published><updated>2010-09-16T23:21:51.249-07:00</updated><title type='text'>CD Creation in Ubuntu</title><content type='html'>There is a this program by name &lt;b&gt;wodim&lt;/b&gt;. Just use that as &lt;pre&gt;wodim name_of_iso&lt;/pre&gt;. I have used it thrice and everytime I forget the name. Speak of poorly named programs, I would give this a high rank.&lt;br/&gt;&lt;br/&gt;If you want to create an iso, there is &lt;b&gt;genisoimage&lt;/b&gt; program too. I have not used it yet, but I would be using it now. Spent 15 minutes today to findout the name of 'wodim' program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4835142483141294042?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4835142483141294042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4835142483141294042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4835142483141294042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4835142483141294042'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/08/cd-creation-in-ubuntu.html' title='CD Creation in Ubuntu'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-495780124865608938</id><published>2010-08-06T01:45:00.000-07:00</published><updated>2010-09-16T23:21:51.251-07:00</updated><title type='text'>PubSubHubBub</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-495780124865608938?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/495780124865608938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=495780124865608938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/495780124865608938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/495780124865608938'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/08/pubsubhubbub.html' title='PubSubHubBub'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2304398398051745373</id><published>2010-07-30T10:36:00.000-07:00</published><updated>2010-09-16T23:21:51.253-07:00</updated><title type='text'>Linux Tip - ^</title><content type='html'>Ubuntu Server Tip: If you need to perform a command a second time on a different file, you can use command replacement with the ^ symbol. e.g. "cp foo.txt /to/some/directory" then "^foo^bar", expanding to: "cp bar.txt  /to/some/directory".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2304398398051745373?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2304398398051745373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2304398398051745373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2304398398051745373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2304398398051745373'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/07/linux-tip.html' title='Linux Tip - ^'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8224428535149821709</id><published>2010-07-18T07:03:00.000-07:00</published><updated>2010-09-16T23:21:51.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Simple Countdown Clock - Python and xdaliclock</title><content type='html'>Here is a simple countdown clock script which you can use.  It is simply&lt;br/&gt;sending -countdown argument properly to the xdaliclock binary.&lt;br/&gt;&lt;br/&gt;I find having this script in my /usr/local/bin pretty useful.&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;#!/usr/bin/python&lt;br/&gt;# A Simple Countdown Clock using xdaliclock&lt;br/&gt;# usage: countdown [time]&lt;br/&gt;#        time defaults to 1 hour.&lt;br/&gt;&lt;br/&gt;import time&lt;br/&gt;import sys&lt;br/&gt;import subprocess&lt;br/&gt;&lt;br/&gt;try:&lt;br/&gt;    hours = float(sys.argv[1])&lt;br/&gt;except IndexError:&lt;br/&gt;    hours = 1&lt;br/&gt;hours = int(time.time()) + int(hours * 3600)&lt;br/&gt;command = 'xdaliclock -countdown %d' % hours&lt;br/&gt;subprocess.Popen(command.split())&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/4574925891333430710-8224428535149821709?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8224428535149821709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8224428535149821709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8224428535149821709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8224428535149821709'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/07/simple-countdown-clock-python-and.html' title='Simple Countdown Clock - Python and xdaliclock'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8520579328024197890</id><published>2010-06-26T17:36:00.000-07:00</published><updated>2010-09-16T23:21:51.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>power 2 in python using lshift</title><content type='html'>left shifting 1 in python does a pow 2 operation. I was just doing some performance comparison and here is an interesting result.&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;$ python -mtimeit 'pow(2,64)'&lt;br/&gt;1000000 loops, best of 3: 1.18 usec per loop&lt;br/&gt;12:31 AM:senthil@:~&lt;br/&gt;$ python -mtimeit 'getattr(1,"__lshift__")(64)'&lt;br/&gt;1000000 loops, best of 3: 0.356 usec per loop&lt;br/&gt;12:32 AM:senthil@:~&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;br/&gt;I don't know the reason for this difference, I shall update the post when i find out why.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8520579328024197890?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8520579328024197890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8520579328024197890' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8520579328024197890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8520579328024197890'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/06/power-2-in-python-using-lshift.html' title='power 2 in python using lshift'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6731296934331912651</id><published>2010-06-17T06:57:00.000-07:00</published><updated>2010-09-16T23:21:51.260-07:00</updated><title type='text'>How to find if a port is free or occupied</title><content type='html'>One of the ways is:&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;netstat -tulnap&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/4574925891333430710-6731296934331912651?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6731296934331912651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6731296934331912651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6731296934331912651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6731296934331912651'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/06/how-to-find-if-port-is-free-or-occupied.html' title='How to find if a port is free or occupied'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4515373975231652180</id><published>2010-06-15T04:02:00.000-07:00</published><updated>2010-09-16T23:21:51.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Py3k PEPS at APAC PyCon</title><content type='html'>I went to Singapore to attend &lt;a href="http://apac.pycon.org/"&gt;APAC PyCon&lt;/a&gt; and also to meet Shalini. It was a good 4 days for me. I presented a talk on &lt;a href="http://uthcode.sarovar.org/pyconapac10/py3kpepshandout.html"&gt;Py3K PEPS&lt;/a&gt; at APAC Pycon.&lt;br/&gt;&lt;br/&gt;The Conference Experience was very good. I had a chance to meet Mark Hammond and discuss a lot of Windows Related things with him with. His presentation on raindrop, couch db and and his perspective on Windows development was very good.  It was good to meet in person Liew Beng Keat, the organizer of the Conference who had done a lot of hard work to put this together. I also met Steve Holden, who was present along with his wife, I assume they had a good holiday time at SG, as it is a shopper's paradise. It was good to the warmth in Steve's welcome and this makes him a very good organizer, I guess.&lt;br/&gt;&lt;br/&gt;On the first day, the talks I enjoyed the most were Mark's Couch DB talk, wherein I gained good knowledge of JSON based Non-Relational database and a javascript based map-reduce framework. The concept was very interesting. The final talk by Wesley Chun drew in a huge enthusiasm. Wesley did a very nice presentation on Py3k and explaining its features and kind of potrayed the picture that it would take long time for people to move to Py3k. Well, it could be true, but as I debated with him, it would be very good to just potray positively how Py3k is a more symmetrical in many ways that Py2k. His point of view was pragmatism and training for corporations. I tend to agree with him to an extent, but I still believe that for some "good programmer" to start learning Python, Python 3 is a very well designed a symmetrical one rather than Python 2. The libraries and packages will catch up soon.&lt;br/&gt;&lt;br/&gt;I also enjoyed Graham Dumpleton's short pitch on mod_wsgi and flask. I still use mod_python and plan to move to more web-development related libraries soon.&lt;br/&gt;&lt;br/&gt;My presentation on Py3k PEPS was on next day, it went well and was attended by a small interested audience. Following Presentation by Martin Faassen was very good too.  He presented a perspecive on creating libraries, the creative aspect of development of software. Steve Holden's Metaclass Madness talk was enlightening too. It was  short presentation and a consise one. It would good to write an article based on his presentation if its not already there. Because Python Metaclasses are something which does not have a lot of literature around in the web. The Q&amp;amp;A in the Metaclass'es talk was good one, as one person asked as when do the metaclasses take effective if we were to wrap teh private methods ( which was denoted by startswith('__') and and it turned out that Class mangles them to _Classname__privatemethod and the metaclass wrapper comes to affect later only). If I write an article, I shall discuss this in more detail. There are some interesting studies which can be done on Metaclass vs Class decorators. &lt;br/&gt;&lt;br/&gt;I also attended Noufal's game related talk. It was good one which was attended by a sizable audience. He walked through the code and explained the physics of the game. It was good to see that if developing games we can use real world physics in games using libraries, Interesting. Also, I am not sure, how effective showing a lot of code in the talk is effective. It is very difficult to follow through. Somethings slides with less bullets and easily chew-able points make the presentation more grasping and provide useful inputs to the audience. &lt;br/&gt;&lt;br/&gt;The singpass coder's tournament was good one too. I managed to come into Second round. My trials some with functional programming and mis-reading of problem statements cost me some time. But it was a very enjoyable game. A person by name 'Che' from China won the iPad and Noufal got the $100 Amazon Web-services coupon.&lt;br/&gt;&lt;br/&gt;On Both days, Shalini came to pick me up from the conference and we went for a stroll in the nearby park of Fort Canning. It was good to talk, walking in the park and saw a lot of people practicing tai-chi.  On Saturday we visited a lot of friends, inviting them for our marriage reception at Singapore, we also went to Jackie Chan movie, "The Karate Kid", it was fun. I liked the part where the kid shows his dancing skills on DDR to his girlfriend and she in turn amazes him after acting very shy. The concept of kung-fu as a way of life is also good. On Sunday we did some purchasing, spent a wonderful afternoon at home and in the evening I headed back to India.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4515373975231652180?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4515373975231652180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4515373975231652180' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4515373975231652180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4515373975231652180'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/06/py3k-peps-at-apac-pycon.html' title='Py3k PEPS at APAC PyCon'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2027369489631824610</id><published>2010-06-01T05:56:00.000-07:00</published><updated>2010-09-16T23:21:51.265-07:00</updated><title type='text'>Latin Characters in xterm</title><content type='html'>Pressing the ALT key and pressing the key gives the Latin characters&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;br/&gt;A - á  Á&lt;br/&gt;B - â  Â&lt;br/&gt;C - ã  Ã&lt;br/&gt;D - ä  Ä&lt;br/&gt;E - å  Å&lt;br/&gt;F - æ  Æ&lt;br/&gt;G - ç  Ç&lt;br/&gt;H - è  È&lt;br/&gt;I - é  É&lt;br/&gt;J - ê  Ê&lt;br/&gt;K - ë  Ë&lt;br/&gt;L - ì  Ì&lt;br/&gt;M - í  Í&lt;br/&gt;N - î  Î&lt;br/&gt;O - ï  Ï&lt;br/&gt;P - ð  Ð&lt;br/&gt;Q - ñ  Ñ&lt;br/&gt;R - ò  Ò&lt;br/&gt;S - ó  Ó&lt;br/&gt;T - ô  Ô&lt;br/&gt;U - õ  Õ&lt;br/&gt;V - ö  Ö&lt;br/&gt;W - ÷  ×&lt;br/&gt;X - ø  Ø&lt;br/&gt;Y - ã  Ù&lt;br/&gt;Z - ú  Ú&lt;br/&gt;&lt;br/&gt;Martin Vön Löwis&lt;br/&gt;Résumé&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/4574925891333430710-2027369489631824610?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2027369489631824610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2027369489631824610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2027369489631824610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2027369489631824610'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/06/latin-characters-in-xterm.html' title='Latin Characters in xterm'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4976149483425104449</id><published>2010-05-02T07:52:00.000-07:00</published><updated>2010-09-16T23:21:51.268-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>float.as_integer_ration</title><content type='html'>From python2.6, you can get a the integer ratio of a float.&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;$ ./python &lt;br/&gt;Python 2.7b1+ (trunk:80674M, May  1 2010, 08:23:48) &lt;br/&gt;[GCC 4.4.1] on linux2&lt;br/&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 3.14.as_integer_ratio()&lt;br/&gt;(7070651414971679, 2251799813685248)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; x*1.0/y&lt;br/&gt;3.14&lt;br/&gt;&amp;gt;&amp;gt;&amp;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/4574925891333430710-4976149483425104449?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4976149483425104449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4976149483425104449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4976149483425104449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4976149483425104449'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/05/floatasintegerration.html' title='float.as_integer_ration'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4309718455280239439</id><published>2010-04-09T03:44:00.000-07:00</published><updated>2010-09-16T23:21:51.272-07:00</updated><title type='text'>Posting via Jabber</title><content type='html'>Posting this via Jabber, that is LJ talk. Noticed today that Live journal user page has a forceful ad serving. You got to wait and press on the top right x to close it and then access your account page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4309718455280239439?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4309718455280239439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4309718455280239439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4309718455280239439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4309718455280239439'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/04/posting-via-jabber.html' title='Posting via Jabber'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1053667260681004037</id><published>2010-04-08T17:27:00.000-07:00</published><updated>2010-09-16T23:21:51.274-07:00</updated><title type='text'>Video Chat on Ubuntu</title><content type='html'>If you would like to do a Video Chat on Ubuntu, then&lt;br/&gt;1. Install Skype 2.0 on Ubuntu.&lt;br/&gt;2. Follow the instructions &lt;a href="https://answers.launchpad.net/ubuntu/+question/49739"&gt;mentioned here&lt;/a&gt; to make the Video option work fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1053667260681004037?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1053667260681004037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1053667260681004037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1053667260681004037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1053667260681004037'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/04/video-chat-on-ubuntu.html' title='Video Chat on Ubuntu'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2548060608608755101</id><published>2010-02-15T02:48:00.000-08:00</published><updated>2010-09-16T23:21:51.277-07:00</updated><title type='text'>How to Use Math Symbols in gnome-terminal</title><content type='html'>HOLD CTRL+SHIFT + U + CODEPOINT.  That's it.&lt;br/&gt;&lt;br/&gt;For e.g. CTRL + SHIFT + U + 2200 will output ∀ After typing CTRL + SHIFT + U,&lt;br/&gt;when the terminal identifies that what follows is unicode, you might leave the&lt;br/&gt;keypresses and just type the codepoint.&lt;br/&gt;&lt;br/&gt;∀ U2200&lt;br/&gt;∁ U2201&lt;br/&gt;∂ U2202&lt;br/&gt;∃ U2203&lt;br/&gt;∄ U2204&lt;br/&gt;∅ U2205&lt;br/&gt;∆ U2206&lt;br/&gt;  U2207&lt;br/&gt;  U2208&lt;br/&gt;∉ U2209&lt;br/&gt;∊ U220A&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2548060608608755101?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2548060608608755101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2548060608608755101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2548060608608755101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2548060608608755101'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2010/02/how-to-use-math-symbols-in-gnome.html' title='How to Use Math Symbols in gnome-terminal'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2443642152700398157</id><published>2009-11-01T23:02:00.000-08:00</published><updated>2010-09-16T23:21:51.279-07:00</updated><title type='text'>C++0x support in gcc</title><content type='html'>http://gcc.gnu.org/projects/cxx0x.html &lt;br/&gt;&lt;br/&gt;Some of the features are already available in gcc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2443642152700398157?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2443642152700398157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2443642152700398157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2443642152700398157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2443642152700398157'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/11/c0x-support-in-gcc.html' title='C++0x support in gcc'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4731335742565239399</id><published>2009-10-20T23:29:00.000-07:00</published><updated>2010-09-16T23:21:51.282-07:00</updated><title type='text'>Python Strings as Comments</title><content type='html'>The question was:&lt;br/&gt;&lt;br/&gt;In Python we can emulate multiline comments using triple-quoted&lt;br/&gt;strings, but conceptually strings and comments are very different.&lt;br/&gt;I.e. strings are objects, comments are auxillary text discarded at&lt;br/&gt;compile time. Strings are objects created at runtime, comments are&lt;br/&gt;not.&lt;br/&gt;&lt;br/&gt;The answer from Steven D'Aprano:&lt;br/&gt;&lt;br/&gt;Guido's time-machine strikes again.&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; import dis&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; def test():&lt;br/&gt;...     x = 1&lt;br/&gt;...     """&lt;br/&gt;...     This is a triple-quote comment.&lt;br/&gt;...     """&lt;br/&gt;...     return x&lt;br/&gt;...&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; dis.dis(test)&lt;br/&gt;  2           0 LOAD_CONST               1 (1)&lt;br/&gt;              3 STORE_FAST               0 (x)&lt;br/&gt;&lt;br/&gt;  6           6 LOAD_FAST                0 (x)&lt;br/&gt;              9 RETURN_VALUE&lt;br/&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;String literals -- not just triple-quoted strings, but any string &lt;br/&gt;literal -- that don't go anywhere are discarded by the Python compiler, &lt;br/&gt;precisely so they can be used as comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4731335742565239399?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4731335742565239399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4731335742565239399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4731335742565239399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4731335742565239399'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/10/python-strings-as-comments.html' title='Python Strings as Comments'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-629630856989208813</id><published>2009-10-12T15:58:00.000-07:00</published><updated>2010-09-16T23:21:51.285-07:00</updated><title type='text'>ln explained best</title><content type='html'>At this article titled &lt;a href="http://betterexplained.com/articles/demystifying-the-natural-logarithm-ln/"&gt;Demystifying the Natural Logarithm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;His entire series of get an intuition articles on Maths is very good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-629630856989208813?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/629630856989208813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=629630856989208813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/629630856989208813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/629630856989208813'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/10/ln-explained-best.html' title='ln explained best'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6463047202003609577</id><published>2009-10-09T13:56:00.000-07:00</published><updated>2010-09-16T23:21:51.288-07:00</updated><title type='text'>Pell's Equation</title><content type='html'>x^2 - n y^2 = 1 	&lt;br/&gt;&lt;br/&gt;(Pell's equation) which is named after the English mathematician John Pell. It was studied by Brahmagupta in the 7th century, as well as by Fermat in the 17th century.&lt;br/&gt;&lt;br/&gt;http://en.wikipedia.org/wiki/Pell%27s_equation&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6463047202003609577?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6463047202003609577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6463047202003609577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6463047202003609577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6463047202003609577'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/10/pell-equation.html' title='Pell&amp;#39;s Equation'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1497147502418456391</id><published>2009-10-01T13:45:00.000-07:00</published><updated>2010-09-16T23:21:51.293-07:00</updated><title type='text'>8 Bit Byte</title><content type='html'>Factors behind the ubiquity of the eight bit byte include the popularity of the IBM System/360 architecture, introduced in the 1960s, and the 8-bit microprocessors, introduced in the 1970s. The term octet unambiguously specifies an eight-bit byte (such as in protocol definitions, for example)&lt;br/&gt;&lt;br/&gt;http://en.wikipedia.org/wiki/Byte&lt;br/&gt;&lt;br/&gt;Otherwise, people have tried with 12 bit byte. Varying byte length in PDP 10. 6, 7 and 9 bits in Univac computers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1497147502418456391?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1497147502418456391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1497147502418456391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1497147502418456391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1497147502418456391'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/10/8-bit-byte.html' title='8 Bit Byte'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6163982515997699632</id><published>2009-09-28T12:03:00.000-07:00</published><updated>2010-09-16T23:21:51.295-07:00</updated><title type='text'>Brainfuck</title><content type='html'>+++ +++ +++ +[&amp;gt;&lt;br/&gt;               +++ +++ +&lt;br/&gt;              &amp;gt;&lt;br/&gt;               +++ +++ +++ +&lt;br/&gt;             &amp;lt;++ .&lt;br/&gt;&amp;gt;+++ ++ .&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Brainfuck is easy and interesting.&lt;br/&gt;We work on cells, like if you know c, cell is like ptr = unsigned char *&lt;br/&gt;+ stands for increment like ++*ptr&lt;br/&gt;- stands for decrement like  --*ptr&lt;br/&gt;&amp;gt; goes one cell right  like ++ptr&lt;br/&gt;&amp;lt; goes one cell left  like --ptr&lt;br/&gt;. spits out output like putchar(*ptr)&lt;br/&gt;, expects input.  like *ptr = getchar(stdin)&lt;br/&gt;[ is the start of while block test condition (for non-zero) which is like while(*ptr) {&lt;br/&gt;]  is the end of the block }&lt;br/&gt;And everything else is comment, like the these sentences.&lt;br/&gt;The above program is designed to output &amp;quot;Hi&amp;quot; and if you include these&lt;br/&gt;sentenses too, it will print &amp;quot;Hii&amp;quot; and wait for some input and enter&lt;br/&gt;presses till the cell becomes zero.&lt;br/&gt;&lt;br/&gt;Isn&amp;#039;t it cool? :) &lt;br/&gt;&lt;br/&gt;BTW, you can run this program using an interpretor called (bf) just an apt-get away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6163982515997699632?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6163982515997699632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6163982515997699632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6163982515997699632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6163982515997699632'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/09/brainfuck.html' title='Brainfuck'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4825939707716270319</id><published>2009-08-01T23:23:00.000-07:00</published><updated>2010-09-16T23:21:51.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='theory'/><title type='text'>Kavka's toxin puzzle</title><content type='html'>In its original form, it is:&lt;br/&gt;&lt;i&gt;An eccentric billionaire places before you a vial of toxin that, if you drink it, will make you painfully ill for a day, but will not threaten your life or have any lasting effects. The billionaire will pay you one million dollars tomorrow morning if, at midnight tonight, you intend to drink the toxin tomorrow afternoon. He emphasizes that you need not drink the toxin to receive the money; in fact, the money will already be in your bank account hours before the time for drinking it arrives, if you succeed. All you have to do is. . . intend at midnight tonight to drink the stuff tomorrow afternoon. You are perfectly free to change your mind after receiving the money and not drink the toxin.&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;Kavka's theory is that, one cannot intend to do something which one won't do.&lt;br/&gt;&lt;br/&gt;There is &lt;a href="http://en.wikipedia.org/wiki/Kavka%27s_toxin_puzzle"&gt;an analysis&lt;/a&gt; of payoffs from different scenarios and the real-world example of this puzzle is:&lt;br/&gt;&lt;br/&gt;&lt;i&gt;&lt;br/&gt;...the Political Manifesto. Before an election, a political party will release a written document outlining their policies and plans should they win office. Many of these promises may be difficult or impossible to implement in practice. Having won, the party is not obligated to follow the manifesto even if they would have lost without it.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4825939707716270319?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4825939707716270319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4825939707716270319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4825939707716270319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4825939707716270319'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/08/kavka-toxin-puzzle.html' title='Kavka&amp;#39;s toxin puzzle'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3731596308185564759</id><published>2009-07-30T09:47:00.000-07:00</published><updated>2010-09-16T23:21:51.300-07:00</updated><title type='text'>X Window joke</title><content type='html'>X window: The ultimate bottleneck. Flawed beyond belief. The only thing you have to fear. Somewhere between chaos and insanity. On autopilot to oblivion. The joke that kills. A disgrace you can be proud of. A mistake carried out to perfection. Belongs more to the problem set than the solution set. To err is X windows. Ignorance is our most important resource. Complex nonsolutions to simple nonproblems. Built to fall apart. Nullifying centuries of progress. Falling to new depths of inefficiency. The last thing you need. The defacto substandard. Elevating brain damage to an art form. X window.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3731596308185564759?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3731596308185564759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3731596308185564759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3731596308185564759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3731596308185564759'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/07/x-window-joke.html' title='X Window joke'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1036000242587149576</id><published>2009-07-10T03:02:00.000-07:00</published><updated>2010-09-16T23:21:51.303-07:00</updated><title type='text'>Password-less root shell in ubuntu</title><content type='html'>If you forgot you password for your ubuntu system you can recover using the following steps&lt;br/&gt;&lt;br/&gt;1. Turn your computer on.&lt;br/&gt;2. Press ESC at the grub prompt.&lt;br/&gt;3. Press e for edit.&lt;br/&gt;4. Highlight the line that begins kernel ………, press e&lt;br/&gt;5. Go to the very end of the line, add &lt;b&gt;rw init=/bin/bash&lt;/b&gt;&lt;br/&gt;6. Press enter, then press b to boot your system.&lt;br/&gt;7. Your system will boot up to a passwordless root shell.&lt;br/&gt; &lt;br/&gt;&lt;a href="http://www.ubuntugeek.com/how-to-recover-password-under-ubuntu.html"&gt;Source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1036000242587149576?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1036000242587149576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1036000242587149576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1036000242587149576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1036000242587149576'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/07/password-less-root-shell-in-ubuntu.html' title='Password-less root shell in ubuntu'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4475564482903202490</id><published>2009-07-06T02:30:00.000-07:00</published><updated>2010-09-16T23:21:51.305-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Signature in Evolution</title><content type='html'>You can have evolution to execute a script as your signature. I had set it so, but whatever I do:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;#!/usr/bin/sh&lt;br/&gt;echo "-- "&lt;br/&gt;echo "Senthil"&lt;br/&gt;exec fortune -s&lt;br/&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Resulted in something like this:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;-- Senthil BOFH excuse #261: The Usenet news is out of date&lt;br/&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Finally figured out with the help of &lt;a href="http://www.cameratim.com/computing/linux/evolution-signatures"&gt;this post&lt;/a&gt;(thanks man!), that evolution is actually storing every compose action as HTML so &lt;br/&gt;&lt;br/&gt;I would need to wrap it in HTML the output of my script to make it a legible signature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4475564482903202490?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4475564482903202490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4475564482903202490' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4475564482903202490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4475564482903202490'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/07/signature-in-evolution.html' title='Signature in Evolution'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3722732043610182456</id><published>2009-06-24T15:52:00.000-07:00</published><updated>2010-09-16T23:21:51.308-07:00</updated><title type='text'>There is a web interface for CUPS</title><content type='html'>http://127.0.0.1:631 &lt;br/&gt;&lt;br/&gt;Stumbled upon this one today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3722732043610182456?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3722732043610182456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3722732043610182456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3722732043610182456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3722732043610182456'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/06/there-is-web-interface-for-cups.html' title='There is a web interface for CUPS'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6506472931533759139</id><published>2009-06-20T21:51:00.001-07:00</published><updated>2009-06-20T23:50:57.810-07:00</updated><title type='text'>_GLOBAL_DEFAULT_TIMEOUT in socket.py</title><content type='html'>In python 2.6, the timeout attribute of the socket from various higher level modules (like urllib2) is passed as socket._GLOBAL_DEFAULT_TIMEOUT.&lt;br /&gt;If you look at socket.py in Lib, you will find that &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;_GLOBAL_DEFAULT_TIMEOUT = object()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;a) This kind of a construct was new to me, why should _GLOBAL_DEFAULT_TIMEOUT be set to an object() than say None.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update:&lt;/span&gt; Because None for a timeout is a special value that would set the socket in blocking mode. That is the reason None is not used.&lt;br /&gt;&lt;br /&gt;b) If this is just for a global value holding, why not just&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;global _GLOBAL_DEFAULT_TIMEOUT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is my understanding, the reason for having _GLOBAL_DEFAULT_TIMEOUT is to have a global default timeout value that can be accessible via various application layer modules (like ftplib, httplib, urllib).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update:&lt;/span&gt; Correct&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;But the default value of the timeout is written at the lower layer socket module and is returned by &lt;pre&gt;socket.getdefaulttimeout()&lt;/pre&gt; and may be set via socket.setdefaulttimeout or via timeout parameters at the application opening functions (like urllib2.urlopen('url',timeout=42).&lt;/strike&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update: &lt;/span&gt;So what?. Wrong.&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;&lt;br /&gt;Get socket.getdefaulttimeout() is implemented in C; and to be preserve the value between C methods and the python library methods, an object() would be essential instead of a global.&lt;br /&gt;&lt;br /&gt;object() might essentially provide an address location for the variable which would be global.&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;&lt;br /&gt;Am I confused? The way the C implementation works is the value is set to a global variable inside of C and its accessed by interfaces like getdefaulttime and setdefaulttime.&lt;br /&gt;&lt;br /&gt;Nothing to maintain global values between Python and modules written in C. Are they sharable? I dont know.&lt;br /&gt;&lt;br /&gt;This kind of construct is used to have a object to maintain a global state.&lt;br /&gt;&lt;br /&gt;global myobj is just a declaration to the compiler that it is global. declared somewhere else and start using the same value. It is not setting things or even defining for the myobj to be used as global. OKay? &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;a = 100&lt;br /&gt;print id(a)&lt;br /&gt;&lt;br /&gt;def foo():&lt;br /&gt;    global a&lt;br /&gt;    print a, id(a)&lt;br /&gt;&lt;br /&gt;foo()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[12:17:45 senthil]$python a1.py &lt;br /&gt;23379248&lt;br /&gt;100 23379248&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, in effect:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;_GLOBAL_DEFAULT_TIMEOUT = object() is a just creating a empty object whose value can be shared. &lt;br /&gt;&lt;br /&gt;Thats it and None is not a good option because, None in this case means that socket be a blocking one.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here are some experimentations with urllib2 and new socket._GLOBAL_DEFAULT_TIMEOUT&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Python 2.7a0 (trunk:72879M, May 24 2009, 12:51:19) &lt;br /&gt;[GCC 4.3.3] on linux2&lt;br /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;&gt;&gt;&gt; import socket&lt;br /&gt;&gt;&gt;&gt; print socket.getdefaulttimeout()&lt;br /&gt;None&lt;br /&gt;&gt;&gt;&gt; socket.setdefaulttimeout(42)&lt;br /&gt;&gt;&gt;&gt; print socket.getdefaulttimeout()&lt;br /&gt;42.0&lt;br /&gt;&gt;&gt;&gt; import urllib2&lt;br /&gt;&gt;&gt;&gt; obj = urllib2.urlopen("http://www.google.com")&lt;br /&gt;&gt;&gt;&gt; dir(obj)&lt;br /&gt;['__doc__', '__init__', '__iter__', '__module__', '__repr__', 'close', 'code', 'fileno', 'fp', 'getcode', 'geturl', 'headers', 'info', 'msg', 'next', 'read', 'readline', 'readlines', 'url']&lt;br /&gt;&gt;&gt;&gt; dir(obj.fp)&lt;br /&gt;['__class__', '__del__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_close', '_getclosed', '_rbuf', '_rbufsize', '_sock', '_wbuf', '_wbuf_len', '_wbufsize', 'bufsize', 'close', 'closed', 'default_bufsize', 'fileno', 'flush', 'mode', 'name', 'next', 'read', 'readline', 'readlines', 'softspace', 'write', 'writelines']&lt;br /&gt;&gt;&gt;&gt; dir(obj.fp._sock)&lt;br /&gt;['__doc__', '__init__', '__module__', '_check_close', '_method', '_read_chunked', '_read_status', '_safe_read', 'begin', 'chunk_left', 'chunked', 'close', 'debuglevel', 'fp', 'getheader', 'getheaders', 'isclosed', 'length', 'msg', 'read', 'reason', 'recv', 'status', 'strict', 'version', 'will_close']&lt;br /&gt;&gt;&gt;&gt; dir(obj.fp._sock.fp)&lt;br /&gt;['__class__', '__del__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_close', '_getclosed', '_rbuf', '_rbufsize', '_sock', '_wbuf', '_wbuf_len', '_wbufsize', 'bufsize', 'close', 'closed', 'default_bufsize', 'fileno', 'flush', 'mode', 'name', 'next', 'read', 'readline', 'readlines', 'softspace', 'write', 'writelines']&lt;br /&gt;&gt;&gt;&gt; dir(obj.fp._sock.fp._sock)&lt;br /&gt;['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'accept', 'bind', 'close', 'connect', 'connect_ex', 'dup', 'family', 'fileno', 'getpeername', 'getsockname', 'getsockopt', 'gettimeout', 'listen', 'makefile', 'proto', 'recv', 'recv_into', 'recvfrom', 'recvfrom_into', 'send', 'sendall', 'sendto', 'setblocking', 'setsockopt', 'settimeout', 'shutdown', 'timeout', 'type']&lt;br /&gt;&gt;&gt;&gt; dir(obj.fp._sock.fp._sock.gettimeout)&lt;br /&gt;['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']&lt;br /&gt;&gt;&gt;&gt; print(obj.fp._sock.fp._sock.gettimeout)&lt;br /&gt;&lt;built-in method gettimeout of _socket.socket object at 0x24b7bd0&gt;&lt;br /&gt;&gt;&gt;&gt; print(obj.fp._sock.fp._sock.gettimeout())&lt;br /&gt;42.0&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/4574925891333430710-6506472931533759139?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6506472931533759139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6506472931533759139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6506472931533759139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6506472931533759139'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/06/globaldefaulttimeout-in-socketpy.html' title='_GLOBAL_DEFAULT_TIMEOUT in socket.py'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1085110587394800634</id><published>2009-06-20T02:45:00.000-07:00</published><updated>2009-06-20T18:33:40.319-07:00</updated><title type='text'>Redirect business again</title><content type='html'>.htaccess file has&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Redirect 302 /index.html "http://localhost/new file.html"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But still when I do:&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;obj = urllib2.urlopen("http://localhost/index.html")&lt;br /&gt;&gt;&gt;&gt;print obj.code()&lt;br /&gt;200&lt;br /&gt;&gt;&gt;&gt;&lt;br /&gt;Funny, what am I doing and why am I getting it this way? Figuring that out. Because the direct is happening transparently, one is not able to capture the redirect code.&lt;br /&gt;&lt;br /&gt;If one needs to the capture redirect code, here is how it is done.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import urllib2&lt;br /&gt;&lt;br /&gt;class SmartRedirectHandler(urllib2.HTTPRedirectHandler):&lt;br /&gt;    def http_error_302(self, req, fp, code, msg, headers):&lt;br /&gt;        result = urllib2.HTTPRedirectHandler.http_error_302(self,  req, fp,code, msg,headers)&lt;br /&gt;&lt;br /&gt;        result.status = code&lt;br /&gt;        return result&lt;br /&gt;&lt;br /&gt;request = urllib2.Request("http://localhost/index.html")&lt;br /&gt;opener = urllib2.build_opener(SmartRedirectHandler())&lt;br /&gt;obj = opener.open(request)&lt;br /&gt;print 'I capture the http redirect code:', obj.status&lt;br /&gt;print 'Its been redirected to:', obj.url&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the output from the session will be:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[06:59:14 senthil]$python smartredirecthandler.py &lt;br /&gt;I capture the http redirect code: 302&lt;br /&gt;Its been redirected to: http://localhost/new%20file.html&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/4574925891333430710-1085110587394800634?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1085110587394800634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1085110587394800634' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1085110587394800634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1085110587394800634'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/06/redirect-business-again.html' title='Redirect business again'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6256821095223089905</id><published>2009-06-16T13:29:00.000-07:00</published><updated>2010-09-16T23:21:51.309-07:00</updated><title type='text'>The pasta theory of design</title><content type='html'>The pasta theory of design:&lt;br/&gt;&lt;br/&gt;    * Spaghetti: each piece of code interacts with every other piece of code [can be implemented with GOTO, functions, objects]&lt;br/&gt;&lt;br/&gt;    * Lasagna: code has carefully designed layers. Each layer is, in theory independent. However low-level layers usually cannot be used easily, and high-level layers depend on low-level layers.&lt;br/&gt;&lt;br/&gt;    * Ravioli: each part of the code is useful by itself. There is a thin layer of interfaces between various parts [the sauce]. Each part can be usefully be used elsewhere.&lt;br/&gt;&lt;br/&gt;    * ...but sometimes, the user just wants to order "Ravioli", so one coarse-grain easily definable layer of abstraction on top of it all can be useful.&lt;br/&gt;&lt;br/&gt;An application design using Twisted's Aspect Oriented Programming Design is that special Ravioli.&lt;br/&gt;&lt;br/&gt;http://twistedmatrix.com/projects/core/documentation/howto/tutorial/library.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6256821095223089905?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6256821095223089905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6256821095223089905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6256821095223089905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6256821095223089905'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/06/pasta-theory-of-design.html' title='The pasta theory of design'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8260002125725848380</id><published>2009-06-14T01:57:00.000-07:00</published><updated>2010-09-16T23:21:51.311-07:00</updated><title type='text'>Dismal Google Search</title><content type='html'>Every technical query returns, results from:&lt;br/&gt;&lt;br/&gt;www.daniweb.com/forums/thread97401.html&lt;br/&gt;www.daniweb.com/forums/thread110548.html&lt;br/&gt;www.gidforums.com/t-3560.html&lt;br/&gt;www.velocityreviews.com/forums/t280081-floating-point-exception.html&lt;br/&gt;&lt;br/&gt;And those pages are invariably filled with advertisements and and sometimes asks me to register to view the result too. I am dismayed, either got to have custom google search to exclude these or try other search engine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8260002125725848380?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8260002125725848380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8260002125725848380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8260002125725848380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8260002125725848380'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/06/dismal-google-search.html' title='Dismal Google Search'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5179608238992580646</id><published>2009-05-24T04:49:00.000-07:00</published><updated>2010-09-16T23:21:51.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='docs'/><title type='text'>All your (http,https) traffic belongs to squid</title><content type='html'>&lt;b&gt;phoe6:&lt;/b&gt; hello, I have setup a &lt;a href="https://help.ubuntu.com/community/Squid"&gt;squid proxy&lt;/a&gt; running at port 3128; I want all my HTTP as well as HTTPS to proxy to through this one only. what should I do? (the tutorials are too wide and I think I am impatient too :( )&lt;br/&gt;&lt;br/&gt;&lt;b&gt;rob0:&lt;/b&gt; um, hire someone to do it for you?&lt;br/&gt;&lt;br/&gt;&lt;b&gt;phoe6:&lt;/b&gt; :) well, it is just two lines rob0. :) I am trying it out.,&lt;br/&gt;&lt;br/&gt;&lt;b&gt;phoe6:&lt;/b&gt; Sorry, if I sounded offending with the question. Let me try it and ask specific quesitons.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;rob0:&lt;/b&gt; np, that is how to do it: try things, read manuals, ask specific questions when you get stuck.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;phoe6:&lt;/b&gt;  well I just had to write a filter rule to accept packets through squid-user and any traffic to port 80, pot 443 to reject. by this way my browsing is through squid proxy only. &lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;$iptables -t filter -A OUTPUT -m owner --uid-owner 13 -j ACCEPT&lt;br/&gt;$iptables -t filter -A OUTPUT -p tcp --dport 80 -j REJECT&lt;br/&gt;$iptables -t filter -A OUTPUT -p tcp --dport 443 -j REJECT&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Helpful entry: http://stuvel.eu/transproxy&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5179608238992580646?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5179608238992580646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5179608238992580646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5179608238992580646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5179608238992580646'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/05/all-your-httphttps-traffic-belongs-to.html' title='All your (http,https) traffic belongs to squid'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1169069887125153105</id><published>2009-05-10T02:07:00.000-07:00</published><updated>2010-09-16T23:21:51.315-07:00</updated><title type='text'>Manually removing a corruped .deb install</title><content type='html'>I was getting this error, on a corruped install of a debian package.&lt;br/&gt;""The package 'printers-bangalore' is in an inconsistent state and needs to be reinstalled, but no archive can be found for it. Please reinstall the package manually or remove it from the system"&lt;br/&gt;&lt;br/&gt;To solve this issue, I followed these steps.&lt;br/&gt;&lt;br/&gt;1) I edited /var/lib/dpkg/status and remove all references of that package.  (Note that this is a tricky step; in my case it was simple)&lt;br/&gt;&lt;br/&gt;2) sudo dpkg --configure -a&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1169069887125153105?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1169069887125153105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1169069887125153105' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1169069887125153105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1169069887125153105'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/05/manually-removing-corruped-deb-install.html' title='Manually removing a corruped .deb install'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3974452026176836668</id><published>2009-05-06T18:32:00.000-07:00</published><updated>2010-09-16T23:21:51.318-07:00</updated><title type='text'>World's longest domain name</title><content type='html'>&lt;a href="http://www.oreillynet.com/onlamp/blog/2005/06/the_worlds_longest_domain_name.html"&gt;Some Trivia&lt;/a&gt;. I liked the pi value domain name. &lt;br/&gt;&lt;br/&gt;BTW, it goes like this:&lt;br/&gt;1) Each domain name can be maximum upto 63 octets. (Octets is 8bits; can safely be considered 1 English Character).&lt;br/&gt;2) The sub-division of domains like (cs.univ.edu;math.univ.edu) can go upto 127 levels.&lt;br/&gt;3) But the entire domain name may not exceed 253 octets.&lt;br/&gt;&lt;br/&gt;So, if we are to search for the longest domain name (including sub-domains), we will end up with 253 english character long string. ( That would be like a page of characters). :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3974452026176836668?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3974452026176836668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3974452026176836668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3974452026176836668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3974452026176836668'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/05/world-longest-domain-name.html' title='World&amp;#39;s longest domain name'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1034849524229777742</id><published>2009-05-05T11:40:00.000-07:00</published><updated>2010-09-16T23:21:51.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Upgraded Ubuntu from 8.10 to 9.04</title><content type='html'>This was on my Thinkpad T400 laptop, where Ubuntu is installed through Wubi.&lt;br/&gt;&lt;br/&gt;After upgrade, X could not start. No GUI No Window Manager.&lt;br/&gt;&lt;br/&gt;Followed the steps mentioned &lt;a href="http://ubuntuforums.org/archive/index.php/t-1142890.html"&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;The problem was with fglrx driver.&lt;br/&gt;&lt;br/&gt;1) Go to Recovery mode during boot.&lt;br/&gt;2) Choose to drop into Shell with networking support &lt;br/&gt;&lt;br/&gt;and do&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;sudo apt-get remove xorg-driver-fglrx&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Reboot. It started working for me. &lt;br/&gt;&lt;br/&gt;First thing you will notice in 9.04 is the &lt;a href="http://www.markshuttleworth.com/archives/253"&gt;notification system&lt;/a&gt; it has. Nice eye candy stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1034849524229777742?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1034849524229777742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1034849524229777742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1034849524229777742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1034849524229777742'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/05/upgraded-ubuntu-from-810-to-904.html' title='Upgraded Ubuntu from 8.10 to 9.04'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7084628609833510650</id><published>2009-05-02T20:42:00.000-07:00</published><updated>2010-09-16T23:21:51.324-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fixes'/><title type='text'>IOError: decoder jpeg not available</title><content type='html'>Following &lt;a href="http://www.answermysearches.com/fixing-pil-ioerror-decoder-jpeg-not-available/320/"&gt;these steps&lt;/a&gt; fixed the issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7084628609833510650?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7084628609833510650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7084628609833510650' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7084628609833510650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7084628609833510650'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/05/ioerror-decoder-jpeg-not-available.html' title='IOError: decoder jpeg not available'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3687301208761927224</id><published>2009-04-28T02:31:00.000-07:00</published><updated>2010-09-16T23:21:51.326-07:00</updated><title type='text'>Upgraded to Ubuntu 8.10 from 8.04</title><content type='html'>Used the Update Manager from the System-&amp;gt; Administration menu.&lt;br/&gt;&lt;br/&gt;* Attempts to update through Indian Servers failed.&lt;br/&gt;* There were constant interview dialogues. I got to look out for a configuration file, which can provide an interrupted/quiet upgrade.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3687301208761927224?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3687301208761927224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3687301208761927224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3687301208761927224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3687301208761927224'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/04/upgraded-to-ubuntu-810-from-804.html' title='Upgraded to Ubuntu 8.10 from 8.04'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-255498849818806373</id><published>2009-04-15T17:22:00.001-07:00</published><updated>2009-04-15T17:25:36.569-07:00</updated><title type='text'>Setting up http redirect</title><content type='html'>I was trying to setup a http redirect on ubuntu. Spent quite some time.&lt;br /&gt;1) Ubuntu has a &lt;pre&gt;/etc/apache2/sites-available/default&lt;/pre&gt; file where you will have to change the AllowOverride option from None to All. &lt;br /&gt;Only this step will enable you to use .htaccess file.&lt;br /&gt;2) In the .htaccess file, I was doing&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Redirect 302 ./index.html http://localhost/new.html&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Spent more than a hour to figure out, why the redirect is not happening. The problem was, I was doing &lt;pre&gt;./index.html&lt;/pre&gt; instead of just &lt;pre&gt;/index.html&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-255498849818806373?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/255498849818806373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=255498849818806373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/255498849818806373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/255498849818806373'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/04/setting-up-http-redirect.html' title='Setting up http redirect'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4940376054627710254</id><published>2009-04-11T18:26:00.000-07:00</published><updated>2009-04-11T18:31:55.740-07:00</updated><title type='text'>Bytes and String in Py3k</title><content type='html'>Martin's Explaination:&lt;br /&gt;&lt;br /&gt;It's really very similar to 2.x: the "bytes" type is to used in all&lt;br /&gt;interfaces that operate on byte sequences that may or may not represent characters; in particular, for interface where the operating system deliberately uses bytes - ie. low-level file IO and socket IO; also for cases where the encoding is embedded in the stream that still needs to be processed (e.g. XML parsing).&lt;br /&gt;&lt;br /&gt;(Unicode) strings should be used where the data is truly text by&lt;br /&gt;nature, i.e. where no encoding information is necessary to find out&lt;br /&gt;what characters are intended. It's used on interfaces where the&lt;br /&gt;encoding is known (e.g. text IO, where the encoding is specified&lt;br /&gt;on opening, XML parser results, with the declared encoding, and&lt;br /&gt;GUI libraries, which naturally expect text).&lt;br /&gt;&lt;br /&gt;- base64.encodestring expects bytes (naturally, since it is supposed to&lt;br /&gt; encode arbitrary binary data), and produces bytes (debatably)&lt;br /&gt;- binascii.b2a_hex likewise (expect and produce bytes)&lt;br /&gt;- pickle.dumps produces bytes (uniformly, both for binary and text&lt;br /&gt; pickles)&lt;br /&gt;- marshal.dumps likewise&lt;br /&gt;- email.message.Message().as_string produces a (unicode) string&lt;br /&gt; (see Barry's recent thread on whether that's a good thing; the&lt;br /&gt; email package hasn't been fully ported to 3k, either)&lt;br /&gt;- the XML libraries (continue to) parse bytes, and produce&lt;br /&gt; Unicode strings&lt;br /&gt;- for the IO libraries, see above&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4940376054627710254?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4940376054627710254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4940376054627710254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4940376054627710254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4940376054627710254'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/04/bytes-and-string-in-py3k.html' title='Bytes and String in Py3k'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5219115234030977106</id><published>2009-03-31T04:15:00.001-07:00</published><updated>2009-03-31T04:15:19.146-07:00</updated><title type='text'>Backport this issue http://bugs.python.org/issue5542</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5219115234030977106?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5219115234030977106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5219115234030977106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5219115234030977106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5219115234030977106'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/backport-this-issue-httpbugspythonorgis.html' title='Backport this issue http://bugs.python.org/issue5542'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2523193115736549299</id><published>2009-03-31T04:09:00.001-07:00</published><updated>2009-03-31T04:09:40.835-07:00</updated><title type='text'>update urlparse to RFC 3986</title><content type='html'>Targetting to complete this by sprint. Issue1591035.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2523193115736549299?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2523193115736549299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2523193115736549299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2523193115736549299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2523193115736549299'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/update-urlparse-to-rfc-3986.html' title='update urlparse to RFC 3986'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3664169565600927558</id><published>2009-03-30T16:33:00.001-07:00</published><updated>2009-03-30T16:33:12.078-07:00</updated><title type='text'>Does parse_header really belong to cgi?</title><content type='html'>&lt;a href="http://bugs.python.org/issue3609"&gt;http://bugs.python.org/issue3609&lt;/a&gt;&lt;p&gt;Barry&amp;#39;s thought is it can be moved to email module.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3664169565600927558?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3664169565600927558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3664169565600927558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3664169565600927558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3664169565600927558'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/does-parseheader-really-belong-to-cgi.html' title='Does parse_header really belong to cgi?'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-9134035390821730033</id><published>2009-03-30T15:22:00.000-07:00</published><updated>2009-03-30T15:24:54.135-07:00</updated><title type='text'>Bugs Fixed</title><content type='html'>Fixed Bugs:&lt;br /&gt;http://bugs.python.org/issue4675&lt;br /&gt;http://bugs.python.org/issue4962&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-9134035390821730033?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/9134035390821730033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=9134035390821730033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9134035390821730033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/9134035390821730033'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/bug-fixes.html' title='Bugs Fixed'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7011928510024810704</id><published>2009-03-28T23:17:00.000-07:00</published><updated>2009-03-28T23:24:04.877-07:00</updated><title type='text'>Simple CGIHTTPServer and Client in Python 3k</title><content type='html'>Python 3k - CGIHTTPRequestHandler example.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import http.server&lt;br /&gt;import http.server&lt;br /&gt;&lt;br /&gt;class Handler(http.server.CGIHTTPRequestHandler):&lt;br /&gt;    cgi_directories = ["/cgi"]&lt;br /&gt;&lt;br /&gt;server = http.server.HTTPServer(("",8000),Handler)&lt;br /&gt;server.serve_forever()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Run this server.&lt;br /&gt;&lt;br /&gt;Create a Directory 'cgi' in the directory you have the above server script and place the following python cgi code.&lt;br /&gt;&lt;br /&gt;filename: test.py&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/local/bin/python3.1&lt;br /&gt;&lt;br /&gt;import cgitb;cgitb.enable()&lt;br /&gt;&lt;br /&gt;print("Content-type: text/html")&lt;br /&gt;print()&lt;br /&gt;print("&amp;lt;title&amp;gt;CGI 101&amp;lt;/title&amp;gt;")&lt;br /&gt;print("&amp;lt;h1&amp;gt;First CGI Example&amp;lt;/h1&amp;gt;")&lt;br /&gt;print("&amp;lt;p&amp;gt;Hello, CGI World!&amp;lt;/p&amp;gt;")&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Open the Browser and point to http://localhost:8000/cgi/test.py&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7011928510024810704?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7011928510024810704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7011928510024810704' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7011928510024810704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7011928510024810704'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/simple-cgihttpserver-and-client-in.html' title='Simple CGIHTTPServer and Client in Python 3k'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7692580517798022398</id><published>2009-03-20T11:58:00.000-07:00</published><updated>2009-03-20T11:59:05.552-07:00</updated><title type='text'>file opening modes.</title><content type='html'>Possible values for the mode open are&lt;br /&gt;&lt;br /&gt;"r" or "rt"&lt;br /&gt;    Open for reading in text mode.&lt;br /&gt;"w" or "wt"&lt;br /&gt;    Open for writing in text mode.&lt;br /&gt;"a" or "at"&lt;br /&gt;    Open for appending in text mode.&lt;br /&gt;"rb"&lt;br /&gt;    Open for reading in binary mode.&lt;br /&gt;"wb"&lt;br /&gt;    Open for writing in binary mode.&lt;br /&gt;"ab"&lt;br /&gt;    Open for appending in binary mode.&lt;br /&gt;"r+", "r+b"&lt;br /&gt;    Open for reading and writing.&lt;br /&gt;"w+", "w+b"&lt;br /&gt;    Open for reading and writing, truncating file initially.&lt;br /&gt;"a+", "a+b"&lt;br /&gt;    Open for reading and appending.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7692580517798022398?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7692580517798022398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7692580517798022398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7692580517798022398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7692580517798022398'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/03/file-opening-modes.html' title='file opening modes.'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3042657130408601749</id><published>2009-02-15T08:03:00.000-08:00</published><updated>2010-09-16T23:21:51.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='project'/><title type='text'>Yahoo Hack Day India 2009</title><content type='html'>I developed an application using Y! BOSS Search APIs, Linguistics, Machine Learning and Google App engine.&lt;br/&gt;&lt;br/&gt;Here is the Application Live. Use it anytime:&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://yindiahack.appspot.com"&gt;Elementary, My dear Watson!&lt;/a&gt;&lt;/ul&gt;&lt;br/&gt;&lt;br/&gt;Here is the Source code for the Project:&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/yhackday-elementary/"&gt;yhackday-elementary&lt;/a&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3042657130408601749?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3042657130408601749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3042657130408601749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3042657130408601749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3042657130408601749'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/yahoo-hack-day-india-2009.html' title='Yahoo Hack Day India 2009'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6769144292655402301</id><published>2009-02-13T23:58:00.000-08:00</published><updated>2010-09-16T23:21:51.332-07:00</updated><title type='text'>unix_time_1234567890</title><content type='html'>&lt;a href="http://www.flickr.com/photos/phoe6/3277998360/" title="photo sharing"&gt;&lt;img src="http://farm4.static.flickr.com/3491/3277998360_ee16eea298_m.jpg" alt="" style="border:solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:.9em;margin-top:0;"&gt;&lt;a href="http://www.flickr.com/photos/phoe6/3277998360/"&gt;unix_time_1234567890&lt;/a&gt; &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;This was fun.  I could manage to capture it again. This time it was with Vijay.&lt;br /&gt;&lt;br /&gt;Previously, while at Dell, along with another friend, Raj, had captured 1111111111.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/phoe6/6761548/" title="Capturing History by phoe6, on Flickr"&gt;&lt;img src="http://farm1.static.flickr.com/5/6761548_645d3fb5aa.jpg" width="500" height="375" alt="Capturing History" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6769144292655402301?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6769144292655402301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6769144292655402301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6769144292655402301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6769144292655402301'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/unixtime1234567890.html' title='unix_time_1234567890'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3491/3277998360_ee16eea298_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2346957637774144693</id><published>2009-02-12T17:26:00.000-08:00</published><updated>2009-02-12T17:28:38.661-08:00</updated><title type='text'>Sent Form 8233</title><content type='html'>For the PyCon Tutorial Compenstation.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;I request you to print the attached PDF. Complete the Necessary&lt;br /&gt;details (lower half) from PSF and please FAX&lt;br /&gt;&lt;br /&gt;a) My Form 8233  with PSF details.&lt;br /&gt;b) PSF Authorization Letter.&lt;br /&gt;&lt;br /&gt;To my FAX Number: 91 80 30501090.&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/4574925891333430710-2346957637774144693?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2346957637774144693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2346957637774144693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2346957637774144693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2346957637774144693'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/sent-form-8233.html' title='Sent Form 8233'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4806675672527402970</id><published>2009-02-08T17:40:00.000-08:00</published><updated>2009-02-08T17:48:06.868-08:00</updated><title type='text'>Bugs to Work</title><content type='html'>http://bugs.python.org/issue5040&lt;br /&gt;http://bugs.python.org/issue5054&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4806675672527402970?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4806675672527402970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4806675672527402970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4806675672527402970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4806675672527402970'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/bugs-to-work.html' title='Bugs to Work'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6853811321928505070</id><published>2009-02-08T17:31:00.001-08:00</published><updated>2009-02-08T17:31:48.245-08:00</updated><title type='text'>Bug-queue -  http.client.HTTPMessage.getallmatchingheaders() always returns []</title><content type='html'>&amp;gt; Further investigation ( grep -r getallmatchingheaders Lib/* ) reveals &lt;br&gt;&amp;gt; that in addition to having no tests, and being implemented incorrectly &lt;br&gt;&amp;gt; in http.client, getallmatchingheaders() is called only once, in &lt;br&gt;&amp;gt; http.server; that code is also broken (I reported this yesterday in  &lt;br&gt;&amp;gt; #5053).&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Maybe Python 3 is where getallmatchingheaders can make a graceful &lt;br&gt;&amp;gt; goodbye (and a 2to3 conversion added?).&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Python tracker &lt;a href="http://bugs.python.org/issue5053"&gt;http://bugs.python.org/issue5053&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6853811321928505070?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6853811321928505070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6853811321928505070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6853811321928505070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6853811321928505070'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/bug-queue-httpclienthttpmessagegetallma.html' title='Bug-queue -  http.client.HTTPMessage.getallmatchingheaders() always returns []'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-5167797703300755407</id><published>2009-02-03T17:17:00.001-08:00</published><updated>2009-02-03T17:17:27.394-08:00</updated><title type='text'>PyCon Tax information</title><content type='html'>On a go forward basis, we are taking the position that the PSF won't issue tutorial payments without a W-9 for US persons (US citizen or resident alien) or an 8233 with ITIN for foreign persons (but see below).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Non-US Taxpayers&lt;br /&gt;============&lt;br /&gt;&lt;br /&gt;For non-US persons ('non-resident aliens', in the IRS lingo) we need to withhold 30% of the payment unless they are citizens of a country which&lt;br /&gt;has a tax treaty with the USA which allows a lesser rate on personal service income.  e.g. for Canada, UK, DE the withholding rate is currently zero.  The PSF has to file a 1042-S information return (which is equivalent to a 1099) regardless; there is no lower limit on the compensation.&lt;br /&gt;&lt;br /&gt;http://www.irs.gov/publications/p515/ar02.html   NRA Withholding&lt;br /&gt;http://www.irs.gov/pub/irs-pdf/p519.pdf          US Tax Guide for Aliens&lt;br /&gt;http://www.irs.gov/publications/p901/ar02.html   Countries with treaties&lt;br /&gt;&lt;br /&gt;To avoid withholding we need to get a Form 8233 from each presenter each year, assuming they are citizens of a treaty country.&lt;br /&gt;&lt;br /&gt;http://www.irs.gov/pub/irs-pdf/f8233.pdf         On-line Form 8233&lt;br /&gt;http://www.irs.gov/instructions/i8233/           Instructions&lt;br /&gt;&lt;br /&gt;This is very easy to complete, except that it requires an ITIN ('individual taxpayer identification number) the first time, and that is a bother:&lt;br /&gt;&lt;br /&gt;http://www.irs.gov/pub/irs-pdf/fw7.pdf            On-line Form W-7&lt;br /&gt;http://www.irs.gov/taxtopics/tc857.html           Instructions - short&lt;br /&gt;http://www.irs.gov/pub/irs-pdf/p1915.pdf          Instruction Booklet&lt;br /&gt;&lt;br /&gt;The catch on the W-7 is the US Social Security Administration has to deny a Social Security Number application and that denial has to be provided along with the W-7.  That's a separate application to the SSA.&lt;br /&gt;&lt;br /&gt;There is an exception to this: if the tutorial presentation compensation can be considered a honorarium, then a letter from the PSF to that effect will allow&lt;br /&gt;the SSA denial process to be skipped, per Exception 2a (page 25 of p1915).  The PSF has discussed this with the IRS, and they agree that the tutorial&lt;br /&gt;compensation can be considered an honorarium.  This means that the applicant would need a letter from the PSF requesting the tutorial presentation, and the applicant would fill in 'Python Software Foundation' on line 6g as the 'company' and provide a copy of the letter along with his/her W-7 application.&lt;br /&gt;&lt;br /&gt;So the process would be as follows, assuming the presenter doesn't already have a US ITIN:&lt;br /&gt;&lt;br /&gt;Fax the PSF an 8233 (without an ITIN) and a fax number.  The PSF will complete the lower half and FAX a copy back along with the authorizing letter.  Submit a W-7 with the 8233, acceptable identification documentation (see Pub 1915, typically a certified copy of a passport), and the authorizing letter to the IRS to get the ITIN.  This should take 4 - 6 weeks.  Send the ITIN back to the PSF on an updated 8233.  This will allow the PSF to avoid the withholding.  If the presenter has no other US source income, there would be no taxes owed on amounts lower than $3300, and no 1040NR need be filed in that case.&lt;br /&gt;&lt;br /&gt;http://www.irs.gov/localcontacts/article/0,,id=101292,00.html&lt;br /&gt;&lt;br /&gt;Without the ITIN, the PSF is required to withhold 30%.  To get it back by filing a 1040NR plus Schedule C, the presenter would need an ITIN, anyway.  So&lt;br /&gt;if he is a citizen of a treaty country and cares about the 30%, he should get an ITIN, send the 8233, and avoid both withholding and filing (assuming no&lt;br /&gt;other US income).&lt;br /&gt;&lt;br /&gt;The PSF will offer the option of 30% withholding if the presenter chooses not to supply the document, or cannot do so in time.  The presenter could later&lt;br /&gt;acquire an ITIN and file for a refund up to three years after the due date of the return.  At least, that is the filing deadline for a refund on a US 1040;&lt;br /&gt;the foreign filer should confirm that deadline for a 1040NR.  However, it is probably simpler for all concerned to delay payment until the ITIN is&lt;br /&gt;available for the 8233.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-5167797703300755407?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/5167797703300755407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=5167797703300755407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5167797703300755407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/5167797703300755407'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/02/pycon-tax-information.html' title='PyCon Tax information'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8174828333527929438</id><published>2009-01-15T08:43:00.001-08:00</published><updated>2009-01-15T08:43:29.626-08:00</updated><title type='text'>Python for Haiku</title><content type='html'>This bug tracks the effort to include Python on Haiku&lt;br&gt;&amp;lt;&lt;a href="http://bugs.python.org/issue4933"&gt;http://bugs.python.org/issue4933&lt;/a&gt;&amp;gt;&lt;br&gt;I find this effort interesting as people are working to bring up an&lt;br&gt;interesting OS up again! I would try Haiku at some-point, now that&lt;br&gt;Python should be available. &lt;p&gt;My musts for an OS are:&lt;br&gt;1) sh&lt;br&gt;2) vim&lt;br&gt;3) net&lt;br&gt;4) mutt&lt;br&gt;5) python&lt;br&gt;6) gcc&lt;br&gt;7) X Window System&lt;br&gt;8) firefox&lt;p&gt;Guido&amp;#39;s response on supporting Python on Haiku:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I&amp;#39;m with Martin. In these days of distributed version control systems, I&lt;br&gt;&amp;gt; would think that the effort for the Haiku folks to maintain a branch of&lt;br&gt;&amp;gt; Python in their own version control would be minimal. It is likely that&lt;br&gt;&amp;gt; for each new Python version that comes out, initially it is broken on&lt;br&gt;&amp;gt; Haiku, and then they have to go in and fix it. Doing that in their own&lt;br&gt;&amp;gt; version control has the advantage that they don&amp;#39;t have to worry about&lt;br&gt;&amp;gt; not breaking support for any other minority operating systems, so I&lt;br&gt;&amp;gt; expect that all in all the cost will be less for them than if they have&lt;br&gt;&amp;gt; to submit these patches to core Python; and since that will definitely&lt;br&gt;&amp;gt; be less work for core Python, I would call that a win-win solution.&lt;br&gt;&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8174828333527929438?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8174828333527929438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8174828333527929438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8174828333527929438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8174828333527929438'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/01/python-for-haiku.html' title='Python for Haiku'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6660222014961102375</id><published>2009-01-08T02:05:00.000-08:00</published><updated>2009-01-08T02:18:40.133-08:00</updated><title type='text'>Py3K, what to look for in brief</title><content type='html'>This &lt;a href="http://www.comp.leeds.ac.uk/nde/papers/teachpy3.html"&gt;article&lt;/a&gt; was referenced by Guido in the Python-Dev indicating certain interests from academic community. &lt;br /&gt;&lt;br /&gt;Actually thats a good article summarizing what to look for in Py3k.&lt;br /&gt;&lt;br /&gt;1) Simpler built-in types. &lt;br /&gt;Instead of having a built-in type for int and then for long as in Py26, have a single built-in type int in py3k, which will behave like long and serve for int as well.&lt;br /&gt;&lt;br /&gt;2) In py26, you and str and unicode. Now Its just str, which is internally unicode. So all strings are unicode in py3k.&lt;br /&gt;There is a separate bytes type for bytes of characters. &lt;br /&gt;&lt;br /&gt;3) 1/5 will be 0.2 in Python3k. If you want the result to be 0, like in Python26, do 1//5&lt;br /&gt;&lt;br /&gt;4) No comparisons supported between incompatible types. Documents from time immemorial advised the users to not to rely and it can change anytime. Well the change has happened.&lt;br /&gt;&lt;br /&gt;5) its print() function for output now, just like input() function input. &lt;br /&gt;Two things here. Previously in py2x, input() expected an object and raw_input() was actually used to input. Now in py3k, its just input() which will behave just like raw_input() before.&lt;br /&gt;&lt;br /&gt;And in py2x, print was a &lt;b&gt;statement&lt;/b&gt;, now its a function. &lt;br /&gt;The article mentioned at the start gives a good rationale.&lt;br /&gt;&lt;br /&gt;All you have do is, as soon as you type print, your fingers should automatically now get used to typing ( and proceed with what you were doing. More details on print function in py3k can be found in docs.&lt;br /&gt;&lt;br /&gt;6) Everything is a new style class. All classes that you define will implicitly be derived from the object class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7) There is refactoring tool developed by python hackers which can be used to port your py2x code to py3k. Everyones resounding advice is &lt;b&gt;Use It!&lt;/b&gt;. This will help in migration as well fix any issues with the refactoring tool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6660222014961102375?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6660222014961102375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6660222014961102375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6660222014961102375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6660222014961102375'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2009/01/py3k-what-to-look-for-in-brief.html' title='Py3K, what to look for in brief'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1329860922732996924</id><published>2008-12-28T00:47:00.000-08:00</published><updated>2010-09-16T23:21:51.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Greedy vs Non-Greedy in Re - Good Example</title><content type='html'>Here is a good example to explain greedy vs, non-greedy search using module &lt;a href="http://docs.python.org/library/re.html"&gt;re&lt;/a&gt; in Python.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;&lt;br/&gt;&lt;br/&gt;*?, +?, ??&lt;br/&gt;&lt;br/&gt;The '*', '+', and '?' qualifiers are all greedy; they match as much text as possible. Sometimes this behaviour isn’t desired; if the RE  is matched against '&amp;lt;H1&amp;gt;title&amp;lt;/H1&amp;gt;', it will match the entire string, and not just '&amp;lt;H1&amp;gt;'. Adding '?' after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. Using .*? in the previous expression will match only '&amp;lt;H1&amp;gt;'.&lt;br/&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1329860922732996924?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1329860922732996924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1329860922732996924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1329860922732996924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1329860922732996924'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/12/greedy-vs-non-greedy-in-re-good-example.html' title='Greedy vs Non-Greedy in Re - Good Example'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6348271207745318264</id><published>2008-12-23T11:30:00.000-08:00</published><updated>2010-09-16T23:21:51.342-07:00</updated><title type='text'>Once in a blue moon</title><content type='html'>A &lt;a href="http://en.wikipedia.org/wiki/Blue_moon"&gt;Blue moon&lt;/a&gt; is a name given to an irregularly timed full moon. Most years have twelve full moons which occur approximately monthly, but each calendar year contains those twelve full lunar cycles plus about eleven days to spare. The extra days accumulate, so that every two or three years there is an extra full moon (this happens every 2.72 years). (Source: Wikipedia)&lt;br/&gt;&lt;br/&gt;So, its frequency of occurrence would be:&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;1/ 2.72 * 365 * 24 * 60 * 60) = 1.16580118 × 10 ^ -8&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Now, &lt;a href="http://www.google.com/search?q=once+in+a+blue+moon"&gt;this one&lt;/a&gt; is good. Excellent humor! &lt;br/&gt;&lt;br/&gt;But don't get how they arrived at that number. Average considering the &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=(3*(1%2F(2.72*365*24*60*60))+%2B+(1%2F(2.72*366*24*60*60)))%2F4&amp;amp;btnG=Search"&gt;leap year&lt;/a&gt; does not result in that either.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6348271207745318264?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6348271207745318264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6348271207745318264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6348271207745318264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6348271207745318264'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/12/once-in-blue-moon.html' title='Once in a blue moon'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1105376663667241466</id><published>2008-12-19T08:24:00.000-08:00</published><updated>2008-12-19T08:25:27.547-08:00</updated><title type='text'>Python Types and Obects</title><content type='html'>http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html&lt;br /&gt;&lt;br /&gt;Good article to understand new style classes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1105376663667241466?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1105376663667241466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1105376663667241466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1105376663667241466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1105376663667241466'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/12/python-types-and-obects.html' title='Python Types and Obects'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2974346829445724525</id><published>2008-12-18T13:02:00.000-08:00</published><updated>2010-09-16T23:21:51.347-07:00</updated><title type='text'>Discussing English Grammar in the bug report.</title><content type='html'>Follow the discussion in this Python Documentation &lt;a href="http://bugs.python.org/issue4243"&gt;bug report.&lt;/a&gt;&lt;br/&gt;Its for correct usage of English and grammar.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;&lt;br/&gt;Terry J. Reedy  added the comment:&lt;br/&gt;&lt;br/&gt;Benjamin: I thank you too for verifying that I was not crazy.&lt;br/&gt;&lt;br/&gt;Martin: I noticed native/non-native split too, and chalked it up to a subtle difference between German and English.&lt;br/&gt;&lt;br/&gt;For future reference, the problem with the original, as I see it now, is a subtle interaction between syntax and semantics.  The original sentence combined two thoughts about has_key.  The two should be either&lt;br/&gt;coordinate (parallel in form) or one should be clearly subordinate.  A subordinate modifier should generally be closer to the subject, especially if it is much shorter.  Making that so was one of my suggestions.  The coordinate form would be 'but it is deprecated'.  But this does not work because 'it' would be somewhat ambiguous because of the particular first modifier.&lt;br/&gt;&lt;br/&gt;The following pair of sentences illustrate what I am trying to say.   Guido was once a Nederlander, but he moved to America. Guido was once a student of Professor X, but he moved to America.&lt;br/&gt;In English, the second 'he' is ambiguous because of the particular first modifier.&lt;br/&gt;&lt;br/&gt;So, to me, 'but deprecated' at the end of the sentence reads as either a misplaced subordinate form or as an abbreviated coordinate form that is at least somewhat ambiguous because of the meaning of the other modifier.&lt;br/&gt;&lt;br/&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2974346829445724525?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2974346829445724525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2974346829445724525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2974346829445724525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2974346829445724525'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/12/discussing-english-grammar-in-bug.html' title='Discussing English Grammar in the bug report.'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8744312157935307943</id><published>2008-11-17T13:42:00.000-08:00</published><updated>2010-09-16T23:21:51.350-07:00</updated><title type='text'>git</title><content type='html'>Linus Torvalds has quipped about the name "git", which is British English slang for a stupid or unpleasant person:&lt;br/&gt;&lt;i&gt;“ I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git.”&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;This self-deprecation is certainly tongue-in-cheek, insofar as Torvalds did not, in fact, name Linux after himself (see History of Linux).&lt;br/&gt;&lt;br/&gt;http://en.wikipedia.org/wiki/Git_(software)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8744312157935307943?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8744312157935307943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8744312157935307943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8744312157935307943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8744312157935307943'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/git.html' title='git'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-3913772481640410709</id><published>2008-11-13T20:11:00.001-08:00</published><updated>2008-11-13T20:11:54.757-08:00</updated><title type='text'>RFC Hierarchy for Related URL parsing</title><content type='html'>RFC Hierarchy for Relative URL formats&lt;br&gt;RFC3986(STD066) - This is the current and is the standard.&lt;br&gt;     |&lt;br&gt;RFC2396         - This was previous one.&lt;br&gt;     |&lt;br&gt;RFC2368&lt;br&gt;     |&lt;br&gt;RFC1808         - urlparse header says, it follows this. But this has been upgraded a lot times.&lt;br&gt;    |&lt;br&gt;RFC1738         - It started with this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-3913772481640410709?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/3913772481640410709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=3913772481640410709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3913772481640410709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/3913772481640410709'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/rfc-hierarchy-for-related-url-parsing.html' title='RFC Hierarchy for Related URL parsing'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8526070923396623375</id><published>2008-11-12T07:08:00.000-08:00</published><updated>2010-09-16T23:21:51.353-07:00</updated><title type='text'>console font and resolution in ubuntu (Hardy Heron)</title><content type='html'>When ubuntu (Hardy Heron) booted by default, the console resolution and font ( ALT-F[1-6]) were really awful. Searched a lot to arrive at this solution.&lt;br/&gt;&lt;br/&gt;To change your Console Resolution:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;sudo vim /boot/grub/menu.lst&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Go to your default kernel line and remove splash and add vga=791&lt;br/&gt;The vga argument can take values from 791 to 795, google for the resolutions.&lt;br/&gt;You have to remove splash term from that line, otherwise it wont get set.&lt;br/&gt;&lt;br/&gt;To change your console font.&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;sudo dpkg-reconfigure console-setup&lt;/pre&gt;&lt;br/&gt;Follow the interview screens and choose the font to your preference.&lt;br/&gt;For me, VGA with Size 16 worked best.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8526070923396623375?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8526070923396623375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8526070923396623375' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8526070923396623375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8526070923396623375'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/console-font-and-resolution-in-ubuntu.html' title='console font and resolution in ubuntu (Hardy Heron)'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4558657433674882922</id><published>2008-11-11T23:48:00.001-08:00</published><updated>2008-11-11T23:48:15.455-08:00</updated><title type='text'>Proposed Python 3.0 schedule</title><content type='html'>&amp;gt; 19-Nov-2008 3.0 rc 3&lt;br&gt;&amp;gt; 03-Dec-2008 3.0 final&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4558657433674882922?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4558657433674882922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4558657433674882922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4558657433674882922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4558657433674882922'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/proposed-python-30-schedule.html' title='Proposed Python 3.0 schedule'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4073860260545252179</id><published>2008-11-11T23:14:00.001-08:00</published><updated>2008-11-11T23:14:20.109-08:00</updated><title type='text'>TODO [issue4191] urlparse normalize URL path</title><content type='html'>&amp;gt; &amp;lt;&lt;a href="http://bugs.python.org/issue4191"&gt;http://bugs.python.org/issue4191&lt;/a&gt;&amp;gt;&lt;p&gt;By Nov 12.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4073860260545252179?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4073860260545252179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4073860260545252179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4073860260545252179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4073860260545252179'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/todo-issue4191-urlparse-normalize-url.html' title='TODO [issue4191] urlparse normalize URL path'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-165492623813175988</id><published>2008-11-11T21:55:00.001-08:00</published><updated>2008-11-11T21:55:50.192-08:00</updated><title type='text'>TODO: [issue3991] urllib.request.urlopen does not handle non-ASCII characters</title><content type='html'>&amp;lt;&lt;a href="http://bugs.python.org/issue3991"&gt;http://bugs.python.org/issue3991&lt;/a&gt;&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-165492623813175988?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/165492623813175988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=165492623813175988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/165492623813175988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/165492623813175988'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/todo-issue3991-urllibrequesturlopen.html' title='TODO: [issue3991] urllib.request.urlopen does not handle non-ASCII characters'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7475213767385793122</id><published>2008-11-11T21:35:00.001-08:00</published><updated>2008-11-11T21:35:35.500-08:00</updated><title type='text'>TODO: [issue3932] HTMLParser cannot handle '&amp;' and non-ascii characters in attribute names</title><content type='html'>&lt;a href="http://bugs.python.org/issue3932"&gt;http://bugs.python.org/issue3932&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7475213767385793122?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7475213767385793122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7475213767385793122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7475213767385793122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7475213767385793122'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/todo-issue3932-htmlparser-cannot-handle.html' title='TODO: [issue3932] HTMLParser cannot handle &apos;&amp;&apos; and non-ascii characters in attribute names'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7430843612268785472</id><published>2008-11-11T20:58:00.001-08:00</published><updated>2008-11-11T20:58:22.692-08:00</updated><title type='text'>Test Patch - [issue3924] cookielib chokes on non-integer cookie version, should ignore it instead</title><content type='html'>Test Patch - [issue3924] cookielib chokes on non-integer cookie&lt;br&gt;version, &lt;a href="http://bugs.python.org/issue3924"&gt;http://bugs.python.org/issue3924&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7430843612268785472?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7430843612268785472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7430843612268785472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7430843612268785472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7430843612268785472'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/11/test-patch-issue3924-cookielib-chokes.html' title='Test Patch - [issue3924] cookielib chokes on non-integer cookie version, should ignore it instead'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-469473037649228878</id><published>2008-10-24T11:47:00.000-07:00</published><updated>2010-09-16T23:21:51.355-07:00</updated><title type='text'>Bogosort</title><content type='html'>"In computer science, bogosort (also random sort, shotgun sort or monkey sort) is a particularly ineffective sorting algorithm. Its only use is for educational purposes, to contrast it with other more realistic algorithms. If bogosort were used to sort a deck of cards, it would consist of checking if the deck were in order, and if it were not, one would throw the deck into the air, pick up the cards up at random, and repeat the process until the deck is sorted."&lt;br/&gt;&lt;br/&gt;http://en.wikipedia.org/wiki/Bogosort&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-469473037649228878?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/469473037649228878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=469473037649228878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/469473037649228878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/469473037649228878'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/10/bogosort.html' title='Bogosort'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4021274943023973699</id><published>2008-09-29T09:56:00.001-07:00</published><updated>2008-09-29T09:56:48.991-07:00</updated><title type='text'>Conversations with Jeremy while working on urllib for py3k</title><content type='html'>(01:08:39) Senthil: Hi Jeremy!&lt;br&gt;(01:14:33) Jeremy: hi&lt;br&gt;(01:16:00) Senthil: The patch applied properly.. while executing the tests,&lt;br&gt;it was not able to view the parse.py&lt;br&gt;(01:16:10) Senthil: File &amp;quot;/usr/local/lib/python3.0/email/utils.py&amp;quot;, line 28,&lt;br&gt;in &amp;lt;module&amp;gt;&lt;br&gt;import urllib.parse&lt;br&gt;ImportError: No module named parse&lt;br&gt;(01:16:40) Jeremy: Be sure you delete urllib.py and urllib.pyc&lt;br&gt;(01:16:45) Senthil: python3.0 regrtest.py and python3.0 test_urllib.py would&lt;br&gt;give the same.&lt;br&gt;(01:16:47) Senthil: I did that.&lt;br&gt;(01:17:12) Jeremy: Can you import them interactively?&lt;br&gt;(01:17:18) Senthil: deleted the older urllib.py ( oops. let me check with&lt;br&gt;.pyc :) )&lt;br&gt;(01:17:42)  Jeremy:  &amp;gt;&amp;gt;&amp;gt; import urllib.parse &amp;gt;&amp;gt;&amp;gt; urllib.parse.__file__&lt;br&gt;&amp;#202;&amp;#188;/usr/local/google/home/jhylton/py3k/Lib/urllib/parse.py&amp;#202;&amp;#188;&lt;br&gt;(01:19:21) Senthil: [root@goofy python3.0]# python3.0&lt;br&gt;Python 3.0a5+ (py3k:64342M, Jun 18 2008, 00:51:20)&lt;br&gt;[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2&lt;br&gt;Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; import urllib.parse&lt;br&gt;Traceback (most recent call last):&lt;br&gt;File &amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;ImportError: No module named urllib.parse&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;(01:20:43) Senthil: Okay, just a min, Jeremy. I shall get back.. I think, I&lt;br&gt;know the prob, it with patch application...&lt;br&gt;(01:22:57) Jeremy: ok&lt;br&gt;(01:57:57) Senthil: Hi Jeremy, two (minor) changes in the patch.&lt;br&gt;(01:58:42) Senthil: 1) Add in the Makefile LIBSUBDIRS = urllib\ ( so that&lt;br&gt;make install creates that package dir).&lt;br&gt;(01:59:14) Senthil: 2) __init__.py in the urllib ( that was reason parse.py&lt;br&gt;was not getting imported. :) )&lt;br&gt;(02:02:25) Jeremy: oops&lt;br&gt;(02:03:17) Jeremy: Is the __init__.py not in the patch?&lt;br&gt;(02:03:22) Senthil: nope,&lt;br&gt;(02:03:40) Senthil: It is not. Atleast in one you sent me.&lt;br&gt;(02:04:13) Senthil: test_urllib.py has 1 failure.&lt;br&gt;(02:04:19) Senthil: FAIL: test_geturl (__main__.urlopen_FileTests)&lt;br&gt;----------------------------------------------------------------------&lt;br&gt;Traceback (most recent call last):&lt;br&gt;File &amp;quot;test_urllib.py&amp;quot;, line 103, in test_geturl&lt;br&gt;self.assertEqual(self.returned_obj.geturl(), self.pathname)&lt;br&gt;AssertionError: &amp;#39;file:///tmp/@test&amp;#39; != &amp;#39;/tmp/@test&amp;#39;&lt;br&gt;(02:04:36) Jeremy: It&amp;#202;&amp;#188;s in my local client, so I&amp;#202;&amp;#188;m not sure why some of the&lt;br&gt;new files get added and some don&amp;#202;&amp;#188;t.&lt;br&gt;(02:04:51) Senthil: ohh ok.&lt;br&gt;(02:05:00)  Jeremy:  That  really  baffling  error  I  mentioned is in&lt;br&gt;test_urllibnet.py&lt;br&gt;(02:07:44) Senthil: yup. I see that in my box too.&lt;br&gt;(02:08:13) Jeremy: It would really help to get a second set of eyes on that&lt;br&gt;one. I think many of the other ones are shallow.&lt;br&gt;(02:09:05) Senthil: Jeremy, &lt;a href="http://codereview.appspot.com"&gt;codereview.appspot.com&lt;/a&gt; seems to be giving 500&lt;br&gt;Server Error.&lt;br&gt;(02:09:18) Jeremy: I&amp;#202;&amp;#188;ve been getting a lot of errors, too.&lt;br&gt;(02:09:19) Senthil: Have you checkin your code in the sandbox or any other&lt;br&gt;location?&lt;br&gt;(02:09:29) Jeremy: I guess I can check it in on a branch.&lt;br&gt;(02:10:22) Senthil: Would be a very good idea. Coz, to submit patches,&lt;br&gt;verify the changes etc etc.&lt;br&gt;(02:16:47) Senthil: Jeremy, both the test_urllibnet.py are due to urlopen&lt;br&gt;method not returning the file-object ( which previous urllib.py&amp;#39;s urlopen ()&lt;br&gt;) returned.&lt;br&gt;(02:17:49) Jeremy: The HTTPResponse ought to behave like a file-object, I&lt;br&gt;thought.&lt;br&gt;(02:18:12) Senthil: the fix IMO, may not just be in the tests, but in what&lt;br&gt;to be decided upon for 2 urlopen from urllib.py and urllib2.py&lt;br&gt;(02:19:07) Senthil: In fact, both errors. One is test_fileno ( testing the&lt;br&gt;fileno  attribute  of file object and other test_readlines testing the&lt;br&gt;readlines method of the file object).&lt;br&gt;(02:20:49) Jeremy: Looking again, the both return an addinfourl() instance,&lt;br&gt;but...&lt;br&gt;(02:21:32) Jeremy: old urllib wraps a http client response and urllib2 wraps&lt;br&gt;an io.BufferedReader&lt;br&gt;(02:23:22) Jeremy: Doh! So a very small change seems to fix this particular&lt;br&gt;behavior.&lt;br&gt;(02:23:39)  Jeremy:  resp  =  urllib.response.addinfourl(r.fp,  r.msg,&lt;br&gt;req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp&lt;br&gt;(02:23:53) Jeremy: in urllib2 instead of wrapping it in a BufferedReader&lt;br&gt;(02:31:45)  Senthil:  am  looking  into it, digging through, trying to&lt;br&gt;understand/check it..&lt;br&gt;(02:32:10) Jeremy: I checked in my working copy in py3k-urllib branch!&lt;br&gt;(02:40:11) Jeremy: I&amp;#202;&amp;#188;m heading home now. I&amp;#202;&amp;#188;ll check in with you later. Feel&lt;br&gt;free to fix stuff on the branch and we&amp;#202;&amp;#188;ll see if we can get it checked in&lt;br&gt;first thing in the morning (US time :-).&lt;br&gt;(02:40:14) Senthil: Jeremy, where do you plan to add this code:&lt;br&gt;(02:40:16) Senthil: resp = urllib.response.addinfourl&lt;br&gt;(02:40:29) Senthil: :)&lt;br&gt;(02:40:30) Senthil: sure.&lt;br&gt;(02:40:37) Senthil: I am at India time :D&lt;br&gt;(02:47:08) Jeremy: At the end of AbstractHTTPHandler.do_open&lt;br&gt;(02:58:52) Jeremy logged out.&lt;br&gt;(02:58:56) Senthil: Okay, I get it. :) such a minor change.&lt;br&gt;(02:59:20) Senthil: btw, it solved the fileno test, but readlines still&lt;br&gt;giving issues and new issues cropping up.&lt;br&gt;(02:59:38) Senthil: I shall look into it, Jeremy, Bye.&lt;br&gt;-- &lt;br&gt;O.R.Senthil Kumaran&lt;br&gt;&lt;a href="http://uthcode.sarovar.org"&gt;http://uthcode.sarovar.org&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4021274943023973699?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4021274943023973699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4021274943023973699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4021274943023973699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4021274943023973699'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/09/conversations-with-jeremy-while-working.html' title='Conversations with Jeremy while working on urllib for py3k'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-177358295154216502</id><published>2008-09-29T09:54:00.001-07:00</published><updated>2008-09-29T09:54:17.696-07:00</updated><title type='text'>Notes while working on urllib patches</title><content type='html'>Following are some of the notes I took, while working on urllib patches.&lt;br&gt;It should be a handy reference when working on bugs again.&lt;p&gt;&lt;br&gt;RFC 3986 Notes:&lt;br&gt;Mon Aug 25 10:17:01 IST 2008&lt;p&gt;- A URI is a sequence of characters that is not always represented as a&lt;br&gt;  sequence of octets. ( What are octets? OCTETS means 8 Bits. Nothing else!)&lt;p&gt;- Percent-encoded octets may be used within a URI to represent characters&lt;br&gt;  outside the range of the US-ASCII coded character set.&lt;p&gt;- Specification uses Augmented Backus-Naur Form (ABNF) notation of [RFC2234],&lt;br&gt;  including the followig core ABNF syntax rules defined by that specification:&lt;br&gt;  ALPHA (letters), CR ( carriage return), DIGIT (decimal digits), DQUOTE&lt;br&gt;  (double quote), HEXDIG (hexadecimal digits), LF (line feed) and SP (space).&lt;p&gt;Section 1 of RFC3986 is very generic. Undestand that URI should be transferable&lt;br&gt;and single generic syntax should denote the whole range of URI schemes.&lt;p&gt;- URI Characters are, in turn, frequently encoded as octets for transport or&lt;br&gt;  presentation.&lt;br&gt;- This specification does not mandate any character encoding for mapping&lt;br&gt;  between URI characters and the octets used to store or transmit those&lt;br&gt;  characters.&lt;br&gt;	pct-encoded = &amp;quot;%&amp;quot; HEXDIG HEXDIG&lt;p&gt;- For consistency, uri producers and normalizers should use uppercase&lt;br&gt;  hexadecimal digits, for all percent - encodings.&lt;br&gt;      reserved    = gen-delims / sub-delims&lt;p&gt;      gen-delims  = &amp;quot;:&amp;quot; / &amp;quot;/&amp;quot; / &amp;quot;?&amp;quot; / &amp;quot;#&amp;quot; / &amp;quot;[&amp;quot; / &amp;quot;]&amp;quot; / &amp;quot;@&amp;quot;&lt;p&gt;      sub-delims  = &amp;quot;!&amp;quot; / &amp;quot;$&amp;quot; / &amp;quot;&amp;amp;&amp;quot; / &amp;quot;&amp;#39;&amp;quot; / &amp;quot;(&amp;quot; / &amp;quot;)&amp;quot;&lt;br&gt;                  / &amp;quot;*&amp;quot; / &amp;quot;+&amp;quot; / &amp;quot;,&amp;quot; / &amp;quot;;&amp;quot; / &amp;quot;=&amp;quot;&lt;p&gt;&lt;br&gt;      unreserved  = ALPHA / DIGIT / &amp;quot;-&amp;quot; / &amp;quot;.&amp;quot; / &amp;quot;_&amp;quot; / &amp;quot;~&amp;quot;&lt;p&gt;   When a new URI scheme defines a component that represents textual&lt;br&gt;   data consisting of characters from the Universal Character Set [UCS],&lt;br&gt;   the data should first be encoded as octets according to the UTF-8&lt;br&gt;   character encoding [STD63]; then only those octets that do not&lt;br&gt;   correspond to characters in the unreserved set should be percent-&lt;br&gt;   encoded.  For example, the character A would be represented as &amp;quot;A&amp;quot;,&lt;br&gt;   the character LATIN CAPITAL LETTER A WITH GRAVE would be represented&lt;br&gt;   as &amp;quot;%C3%80&amp;quot;, and the character KATAKANA LETTER A would be represented&lt;br&gt;   as &amp;quot;%E3%82%A2&amp;quot;.&lt;p&gt;Section 2, was on encoding and decoding the characters in the url scheme. How&lt;br&gt;that is being used encoding reservered characters within data. Transmission of&lt;br&gt;url from local to public when using a different encoding - translate at the&lt;br&gt;interface level.&lt;p&gt;      URI         = scheme &amp;quot;:&amp;quot; hier-part [ &amp;quot;?&amp;quot; query ] [ &amp;quot;#&amp;quot; fragment ]&lt;p&gt;      hier-part   = &amp;quot;//&amp;quot; authority path-abempty&lt;br&gt;                  / path-absolute&lt;br&gt;                  / path-rootless&lt;br&gt;                  / path-empty&lt;p&gt;Many URI schemes include a hierarchical element for a naming&lt;br&gt;authority so that governance of the name space defined by the&lt;br&gt;remainder of the URI is delegated to that authority (which may, in&lt;br&gt;turn, delegate it further).&lt;p&gt;      userinfo    = *( unreserved / pct-encoded / sub-delims / &amp;quot;:&amp;quot; )&lt;br&gt;      host        = IP-literal / IPv4address / reg-name&lt;p&gt;In order to disambiguate the syntax host between IPv4address and reg-name, we&lt;br&gt;apply the &amp;quot;first-match-wins&amp;quot; algorithm:&lt;p&gt;A host identified by an Internet Protocol literal address, version 6&lt;br&gt;[RFC3513] or later, is distinguished by enclosing the IP literal&lt;br&gt;within square brackets (&amp;quot;[&amp;quot; and &amp;quot;]&amp;quot;).  This is the only place where&lt;br&gt; square bracket characters are allowed in the URI syntax.&lt;p&gt;      IP-literal = &amp;quot;[&amp;quot; ( IPv6address / IPvFuture  ) &amp;quot;]&amp;quot;&lt;p&gt;      IPvFuture  = &amp;quot;v&amp;quot; 1*HEXDIG &amp;quot;.&amp;quot; 1*( unreserved / sub-delims / &amp;quot;:&amp;quot; )&lt;p&gt;   IPv6address =                            6( h16 &amp;quot;:&amp;quot; ) ls32&lt;br&gt;                  /                       &amp;quot;::&amp;quot; 5( h16 &amp;quot;:&amp;quot; ) ls32&lt;br&gt;                  / [               h16 ] &amp;quot;::&amp;quot; 4( h16 &amp;quot;:&amp;quot; ) ls32&lt;br&gt;                  / [ *1( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot; 3( h16 &amp;quot;:&amp;quot; ) ls32&lt;br&gt;                  / [ *2( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot; 2( h16 &amp;quot;:&amp;quot; ) ls32&lt;br&gt;                  / [ *3( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot;    h16 &amp;quot;:&amp;quot;   ls32&lt;br&gt;                  / [ *4( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot;              ls32&lt;br&gt;                  / [ *5( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot;              h16&lt;br&gt;                  / [ *6( h16 &amp;quot;:&amp;quot; ) h16 ] &amp;quot;::&amp;quot;&lt;p&gt;      ls32        = ( h16 &amp;quot;:&amp;quot; h16 ) / IPv4address&lt;br&gt;                  ; least-significant 32 bits of address&lt;p&gt;      h16         = 1*4HEXDIG&lt;br&gt;                  ; 16 bits of address represented in hexadecimal&lt;p&gt;   IPv4address = dec-octet &amp;quot;.&amp;quot; dec-octet &amp;quot;.&amp;quot; dec-octet &amp;quot;.&amp;quot; dec-octet&lt;p&gt;      dec-octet   = DIGIT                 ; 0-9&lt;br&gt;                  / %x31-39 DIGIT         ; 10-99&lt;br&gt;                  / &amp;quot;1&amp;quot; 2DIGIT            ; 100-199&lt;br&gt;                  / &amp;quot;2&amp;quot; %x30-34 DIGIT     ; 200-249&lt;br&gt;                  / &amp;quot;25&amp;quot; %x30-35          ; 250-255&lt;p&gt;      reg-name    = *( unreserved / pct-encoded / sub-delims )&lt;p&gt;Non-ASCII characters must first be encoded according to UTF-8 [STD63], and then&lt;br&gt;each octet of the corresponding UTF-8 sequence must be percent- encoded to be&lt;br&gt;represented as URI characters. &lt;p&gt;When a non-ASCII registered name represents an internationalized domain name&lt;br&gt;intended for resolution via the DNS, the name must be transformed to the IDNA&lt;br&gt;encoding [RFC3490] prior to name lookup. &lt;p&gt;Section 3 was about sub-components and their structure and if they are&lt;br&gt;represented in NON ASCII how to go about with encoding/decoding that.&lt;p&gt;      path          = path-abempty    ; begins with &amp;quot;/&amp;quot; or is empty&lt;br&gt;                    / path-absolute   ; begins with &amp;quot;/&amp;quot; but not &amp;quot;//&amp;quot;&lt;br&gt;                    / path-noscheme   ; begins with a non-colon segment&lt;br&gt;                    / path-rootless   ; begins with a segment&lt;br&gt;                    / path-empty      ; zero characters&lt;p&gt;      path-abempty  = *( &amp;quot;/&amp;quot; segment )&lt;br&gt;      path-absolute = &amp;quot;/&amp;quot; [ segment-nz *( &amp;quot;/&amp;quot; segment ) ]&lt;br&gt;      path-noscheme = segment-nz-nc *( &amp;quot;/&amp;quot; segment )&lt;br&gt;      path-rootless = segment-nz *( &amp;quot;/&amp;quot; segment )&lt;br&gt;      path-empty    = 0&amp;lt;pchar&amp;gt;&lt;br&gt;      segment       = *pchar&lt;br&gt;      segment-nz    = 1*pchar&lt;br&gt;      segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / &amp;quot;@&amp;quot; )&lt;br&gt;                    ; non-zero-length segment without any colon &amp;quot;:&amp;quot;&lt;p&gt;      pchar         = unreserved / pct-encoded / sub-delims / &amp;quot;:&amp;quot; / &amp;quot;@&amp;quot;&lt;p&gt;      relative-ref  = relative-part [ &amp;quot;?&amp;quot; query ] [ &amp;quot;#&amp;quot; fragment ]&lt;p&gt;      relative-part = &amp;quot;//&amp;quot; authority path-abempty&lt;br&gt;                    / path-absolute&lt;br&gt;                    / path-noscheme&lt;br&gt;                    / path-empty&lt;p&gt;Section 4 was on the usage aspects and heuristics used in determining in the&lt;br&gt;scheme in the normal usages where scheme is not given. &lt;p&gt;- Base uri must be stripped of any fragment components prior to it being used&lt;br&gt;  as a Base URI.&lt;p&gt;Section 5 was on relative reference implementation algorithm. I had covered&lt;br&gt;them practically in the Python urlparse module.&lt;p&gt;Section 6 was on Normalization of URIs for comparision and various&lt;br&gt;normalization practices that are used.&lt;p&gt;&lt;br&gt;========================================================================&lt;br&gt;Python playground:&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; if -1:&lt;br&gt;...     print True&lt;br&gt;...&lt;br&gt;True&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if 0:&lt;br&gt;...     print True&lt;br&gt;...&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&lt;p&gt;Use of namedtuple in py3k branch for urlparse.&lt;p&gt;========================================================================&lt;p&gt;Dissecting urlparse:&lt;p&gt;1) __all__ methods provides the public interfaces to all the methods like&lt;br&gt;urlparse, urlunparse, urljoin, urldefrag, urlsplit and urlunsplit.&lt;p&gt;2) then there is classification of schemes like uses_relative, uses_netloc,&lt;br&gt;non_hierarchical, uses_params, uses_query, uses_fragment&lt;br&gt;	- there should be defined in an rfc most probably 1808.&lt;br&gt;	- there is a special &amp;#39;&amp;#39; blank string, in certain classifications, which&lt;br&gt;	  means that apply by default.&lt;p&gt;3)valid characters in scheme name should be defined in 1808.&lt;p&gt;4) class ResultMixin is defined to provide username, password, hostname and&lt;br&gt;port.&lt;p&gt;5) from collections import namedtuple. This should be from python2.6.&lt;br&gt;namedtuple is pretty interesting feature. &lt;p&gt;6) SplitResult and ParseResult. Very good use of namedtuple and ResultMixin&lt;p&gt;7) The behaviour of the public methods urlparse, urlunparse, urlsplit and&lt;br&gt;urlunsplit and urldefrag matter most.&lt;p&gt;urlparse - scheme, netloc, path, params, query and fragment.&lt;br&gt;urlunparse will take those parameters and construct the url back.&lt;p&gt;urlsplit - scheme, netloc, path, query and fragment.&lt;br&gt;urlunsplit - takes these parameters (scheme, netloc, path, query and fragment)&lt;br&gt;and returns a url.&lt;p&gt;urlparse x urlunparse&lt;br&gt;urlsplit x urlunsplit&lt;br&gt;urldefrag&lt;br&gt;urljoin&lt;p&gt;&lt;p&gt;&lt;br&gt;Date: Tue Aug 19 20:40:46 IST 2008&lt;p&gt;	Changes to urlsplit functionality in urllib.&lt;br&gt;	As per the RFC3986, the url is split into:&lt;br&gt;		scheme, authority, path, query, frag = url&lt;p&gt;	The authority part in turn can be split into the sections:&lt;br&gt;		user, passwd, host, port = authority&lt;p&gt;	The following line is the regular expression for breaking-down a&lt;br&gt;	well-formed URI reference into its components.	&lt;p&gt;	^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?&lt;br&gt;     12            3  4          5       6  7        8 9&lt;p&gt;      scheme    = $2&lt;br&gt;      authority = $4&lt;br&gt;      path      = $5&lt;br&gt;      query     = $7&lt;br&gt;      fragment  = $9&lt;p&gt;	The urlsplit functionality in the urllib can be moved to new regular&lt;br&gt;	expression based parsing mechanism.&lt;p&gt;&lt;p&gt;&amp;gt;From man uri, which confirms to rfc2396 and HTML 4.0 specs.&lt;p&gt;- An absolute identifier refers to a resource independent of context, while a&lt;br&gt;  relative identifier refers to a resource by describing the difference from&lt;br&gt;  the current context.&lt;p&gt;- A path segment while contains a colon character &amp;#39;:&amp;#39; can&amp;#39;t be used as the&lt;br&gt;  first segment of a relative URI path. Use it like this &amp;#39;./file:path&amp;#39;&lt;p&gt;- A query can be given in the archaic &amp;quot;isindex&amp;quot; format, consisting of a word or&lt;br&gt;  a phrase and not including an equal sign (=). If = is there, then it must be&lt;br&gt;  after &amp;amp; like &amp;amp;key=value format.&lt;p&gt;Character Encodings:&lt;p&gt;- Reserved characters: ;/?:@&amp;amp;=+$,&lt;br&gt;- Unreserved characters: ALPHA, DIGITS, -_.!~*&amp;#39;()&lt;p&gt;An escaped octet is encoded as a character triplet consisting of the percent&lt;br&gt;character &amp;#39;%&amp;#39; followed by the two  hexadecimal digits representing the octet&lt;br&gt;code.&lt;p&gt;HTML 4.0 specification section B.2 recommends the following, which should be&lt;br&gt;considered best available current guidance:&lt;p&gt;1) Represent each non-ASCII character as UTF-8&lt;br&gt;2) Escape those bytes with the URI escaping mechanism, converting each byte to&lt;br&gt;%HH where HH is the hexadecimal notation of the byte value.&lt;p&gt;One of the important changes when adhering to RFC3986 is parsing of IPv6&lt;br&gt;addresses.&lt;p&gt;===============================================================================&lt;br&gt;1) Bug issue1285086: urllib2.quote is too slow&lt;p&gt;For the short-circuit path, the regexp can make quote 10x as fast in&lt;br&gt;exceptional cases, even comparing to the faster version in trunk. The&lt;br&gt;average win for short-circuit seems to be twice as fast as the map in my&lt;br&gt;timings. This sounds good.&lt;p&gt;For the normal path, the overhead can make quote 50% slower. This IMHO&lt;br&gt;makes it unfit for quote replacement. Perhaps good for a cookbook recipe?&lt;p&gt;Regarding the OP&amp;#39;s use case, I believe either adding a string cache to&lt;br&gt;quote or flagging stored strings as &amp;quot;safe&amp;quot; or &amp;quot;must quote&amp;quot; would result&lt;br&gt;in a much greater impact on performance.&lt;p&gt;Attaching patch against trunk. Web framework developers should be&lt;br&gt;interested in testing this and could provide the use cases/data needed&lt;br&gt;for settling this issue.&lt;p&gt;Index: urllib.py&lt;br&gt;===================================================================&lt;br&gt;--- urllib.py	(revision 62222)&lt;br&gt;+++ urllib.py	(working copy)&lt;br&gt;@@ -27,6 +27,7 @@&lt;br&gt; import os&lt;br&gt; import time&lt;br&gt; import sys&lt;br&gt;+import re&lt;br&gt; from urlparse import urljoin as basejoin&lt;br&gt; &lt;br&gt; __all__ = [&amp;quot;urlopen&amp;quot;, &amp;quot;URLopener&amp;quot;, &amp;quot;FancyURLopener&amp;quot;, &amp;quot;urlretrieve&amp;quot;,&lt;br&gt;@@ -1175,6 +1176,7 @@&lt;br&gt;                &amp;#39;abcdefghijklmnopqrstuvwxyz&amp;#39;&lt;br&gt;                &amp;#39;0123456789&amp;#39; &amp;#39;_.-&amp;#39;)&lt;br&gt; _safemaps = {}&lt;br&gt;+_must_quote = {}&lt;br&gt; &lt;br&gt; def quote(s, safe = &amp;#39;/&amp;#39;):&lt;br&gt;     &amp;quot;&amp;quot;&amp;quot;quote(&amp;#39;abc def&amp;#39;) -&amp;gt; &amp;#39;abc%20def&amp;#39;&lt;br&gt;@@ -1200,8 +1202,11 @@&lt;br&gt;     cachekey = (safe, always_safe)&lt;br&gt;     try:&lt;br&gt;         safe_map = _safemaps[cachekey]&lt;br&gt;+        if not _must_quote[cachekey].search(s):&lt;br&gt;+            return s&lt;br&gt;     except KeyError:&lt;br&gt;         safe += always_safe&lt;br&gt;+        _must_quote[cachekey] = re.compile(r&amp;#39;[^%s]&amp;#39; % safe)&lt;br&gt;         safe_map = {}&lt;br&gt;         for i in range(256):&lt;br&gt;             c = chr(i)&lt;p&gt;&lt;br&gt;----------------------------------------------------------------------&lt;br&gt;What does this construct imply?&lt;p&gt;x = lambda: None&lt;p&gt;----------------------------------------------------------------------&lt;br&gt;How can we differentiate if an expression used is a general expression or a boolean expression.&lt;p&gt;----------------------------------------------------------------------&lt;br&gt;Having a construct like:&lt;br&gt;def __init__(self, *args, **kwargs):&lt;br&gt;	BaseClass.__init__(self, *args, **kwargs)&lt;p&gt;But in the base class, I find that it is not taking the tuple and dict as&lt;br&gt;arguments.&lt;p&gt;I dont understand the &lt;br&gt;assert(proxies, &amp;#39;has_key&amp;#39;), &amp;quot;proxies must be mapping&amp;quot;&lt;p&gt;----------------------------------------------------------------------&lt;p&gt;* What is an addrinfo struct.&lt;p&gt;The getaddrinfo() function returns a list of 5-tuples with the following structure:&lt;br&gt;(family, socktype, proto, canonname, sockaddr)&lt;p&gt;family, socktype, proto are all integer and are meant to be passed to the socket() function. canonname is a string representing the canonical name of the host. It can be a numeric IPv4/v6 address when AI_CANONNAME is specified for a numeric host. &lt;p&gt;socket.gethostbyname(hostname)&lt;br&gt;    Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as &amp;#39;&lt;a href="http://100.50.200.5"&gt;100.50.200.5&lt;/a&gt;&amp;#39;. If the host name is an IPv4 address itself it is returned unchanged. See gethostbyname_ex() for a more complete interface. gethostbyname() does not support IPv6 name resolution, and getaddrinfo() should be used instead for IPv4/v6 dual stack support.&lt;p&gt;&lt;br&gt;We need to replace the gethostbyname socket call. Because it is only IPv4 specific. using the getaddrinfo() function can include the IPv4/v6 dual stack support.&lt;p&gt;import socket&lt;br&gt;print socket.gethostbyname(hostname)&lt;p&gt;def gethostbyname(hostname)&lt;br&gt;	family, socktype, proto, canonname, sockaddr = socket.getaddrinfo(hostname)&lt;br&gt;	return canonname&lt;p&gt;----------------------------------------------------------------------&lt;p&gt;Compare dates for cache control&lt;p&gt;RFC 1123 date format:&lt;br&gt;Thu, 01 Dec 1994 16:00:00 GMT&lt;p&gt;&amp;lt;pre&amp;gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; datereturned = &amp;quot;Thu, 01 Dec 1994 16:00:00 GMT&amp;quot;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; dateexpired = &amp;quot;Sun, 05 Aug 2007 03:25:42 GMT&amp;quot;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; obj1 = datetime.datetime(*time.strptime(datereturned, &amp;quot;%a, %d %b %Y %H:%M:%S %Z&amp;quot;)[0:6])&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; obj2 = datetime.datetime(*time.strptime(dateexpired, &amp;quot;%a, %d %b %Y %H:%M:%S %Z&amp;quot;)[0:6])&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if obj1 == obj2:&lt;br&gt;	print &amp;quot;Equal&amp;quot;&lt;br&gt;elif obj1 &amp;gt; obj2:&lt;br&gt;	print datereturned&lt;br&gt;elif obj1 &amp;lt; obj2:&lt;br&gt;	print dateexpired&lt;br&gt;&amp;lt;/pre&amp;gt;&lt;p&gt;&lt;br&gt;* Now you can compare the headers for expiry in cache control.&lt;p&gt;Header field definition:&lt;br&gt;&lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&lt;/a&gt;&lt;p&gt;Adding Header information to Apache:&lt;br&gt;&lt;a href="http://webmaster.info.aol.com/apache.html"&gt;http://webmaster.info.aol.com/apache.html&lt;/a&gt;&lt;p&gt;To add header:&lt;br&gt;Go to the /etc/httpd/conf/httpd.conf&lt;br&gt;For e.g:&lt;br&gt;Add the information on headers&lt;br&gt;Header set Author &amp;quot;Senthil&amp;quot;&lt;p&gt;&lt;br&gt;Q) Question is can I add a test for cache.&lt;br&gt;A) Its not a functionality, but its merely an internal optimization.&lt;p&gt;Q) If test for cache needs to be written, how will you write it?&lt;br&gt;A) request an url and redirect and request it again and verify that it is&lt;br&gt;coming frm a dictionary or the dictionary value is stored.&lt;p&gt;&lt;br&gt;from_url = &amp;quot;&lt;a href="http://example.com/a.html"&gt;http://example.com/a.html&lt;/a&gt;&amp;quot;&lt;br&gt;to_url = &amp;quot;&lt;a href="http://example.com/b.html"&gt;http://example.com/b.html&lt;/a&gt;&amp;quot;&lt;p&gt;h = urllib2.HTTPRedirectHandler()&lt;br&gt;o = h.parent = MockOpener()&lt;p&gt;req = Request(from_url)&lt;br&gt;def cached301redirect(h, req, url=to_url):&lt;br&gt;	h.http_error_301(req, MockFile(), 301, &amp;quot;Blah&amp;quot;, MockHeaders({&amp;quot;location&amp;quot;:url}))&lt;p&gt;# Why is Request object taking two parameters?&lt;p&gt;req = Request(from_url, origin_req_host=&amp;quot;&lt;a href="http://example.com"&gt;example.com&lt;/a&gt;&amp;quot;)&lt;br&gt;count = 0&lt;br&gt;try:&lt;br&gt;	while 1:&lt;br&gt;		redirect(h, req, &amp;quot;&lt;a href="http://example.com"&gt;http://example.com&lt;/a&gt;&amp;quot;)&lt;br&gt;		count = count + 1&lt;br&gt;		if count &amp;gt; 2:&lt;br&gt;			self.assertEqual(&amp;quot;&lt;a href="http://example.com"&gt;http://example.com&lt;/a&gt;&amp;quot;,&lt;br&gt;			urllib2.HTTPRedirectHandler().cache[req].geturl())&lt;br&gt;except urllib2.HTTPError:&lt;br&gt;	self.assertEqual(count, urllib2.HTTPRedirectHandler.max_repeats)	&lt;p&gt;CacheFTPHandler testcasesare hard to write.&lt;p&gt;-- &lt;br&gt;O.R.Senthil Kumaran&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-177358295154216502?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/177358295154216502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=177358295154216502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/177358295154216502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/177358295154216502'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/09/notes-while-working-on-urllib-patches.html' title='Notes while working on urllib patches'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-4555873489101371693</id><published>2008-09-24T04:02:00.000-07:00</published><updated>2010-09-16T23:21:51.357-07:00</updated><title type='text'>Ariane 5 Flight 501</title><content type='html'>While listening to an introductory programming class, came across the mention of this this "&lt;a href="http://en.wikipedia.org/wiki/Ariane_5_Flight_501"&gt;Ariane 5 Flight 501&lt;/a&gt;" failure incident, which was caused by Arithmetic Exception and Integer overflow resulted from automatic type casting float to integer in the ADA program. Very costly software bug.&lt;br/&gt;&lt;br/&gt;&lt;a href="http://www-aix.gsi.de/~giese/swr/ariane5.html"&gt;This German article&lt;/a&gt; discusses the issue. Below is the English translation of the same with the help of translate.google.com with &lt;i&gt;some comments&lt;/i&gt;.&lt;br/&gt;&lt;br/&gt;&lt;hr /&gt;&lt;br/&gt;    Ariane 5 - 501 (1-3) Ariane 5 - 501 (1-3)&lt;br/&gt;&lt;br/&gt;4th June 1996, Kourou / FRZ. Guyana, ESA Guyana, ESA&lt;br/&gt;&lt;br/&gt;Maiden flight of the new European launcher (weight: 740 tons, payload 7-18 t) with 4 Cluster satellites&lt;br/&gt;Development costs in 10 years: DM 11 800 million &lt;i&gt;I am not sure about 11 space 800 million. If it is, then its 4 trillion Rupees roughly.&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;Ada program of the inertial navigation system (excerpt):&lt;br/&gt;&lt;pre&gt;&lt;br/&gt; ... &lt;br/&gt; declare &lt;br/&gt;   vertical_veloc_sensor: float; &lt;br/&gt;   horizontal_veloc_sensor: float; &lt;br/&gt;   vertical_veloc_bias: integer; &lt;br/&gt;   horizontal_veloc_bias: integer; &lt;br/&gt;   ... &lt;br/&gt; begin &lt;br/&gt;   declare &lt;br/&gt;     pragma suppress(numeric_error, horizontal_veloc_bias);&lt;br/&gt;   begin &lt;br/&gt;     sensor_get (vertical_veloc_sensor); &lt;br/&gt;     sensor_get (horizontal_veloc_sensor); &lt;br/&gt;     vertical_veloc_bias := integer(vertical_veloc_sensor); &lt;br/&gt;     horizontal_veloc_bias := integer(horizontal_veloc_sensor); &lt;br/&gt;     ... &lt;br/&gt;   exception exceptionnelle &lt;br/&gt;     When numeric_error =&amp;gt; calculate_vertical_veloc (); &lt;br/&gt;     when others =&amp;gt; use_irs1 (); &lt;br/&gt;   end; &lt;br/&gt;  irs2 end;&lt;br/&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;Effect:&lt;br/&gt;37 seconds after ignition of the rocket (30 seconds after Liftoff) Ariane 5 reached 3700 m in altitude with a horizontal velocity of 32768.0 (internal units).This value was about five times higher than that of Ariane 4th&lt;br/&gt;&lt;br/&gt;The transformation into a whole number led to an overflow, but was not caught.&lt;br/&gt;&lt;br/&gt;The replacement computer (redundancy!) Had the same problem 72 msec before and immediately switched from &lt;i&gt;that&lt;/i&gt;.&lt;br/&gt;&lt;br/&gt;This resulted in that diagnostic data to the main computer were sent to this interpreted as trajectory data.Consequently, nonsensical control commands to the side, pivoting solid engines, and later to the main engine, to the deviate Flight no large (over 20 degrees) to correct them. &lt;br/&gt;&lt;br/&gt;The rocket, however, threatened damage control and tested all himself (39 sec). &lt;i&gt; I guess auto-destruct.&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;An intensive test of the navigation and main computer had not been undertaken since the software was in tested Ariane 4.&lt;br/&gt;&lt;br/&gt;Damage:&lt;br/&gt;DM 250 million start-up costs (&lt;i&gt;~ 8.5 billion INR&lt;/i&gt;)&lt;br/&gt;DM 850 million Cluster satellites (&lt;i&gt;~ 29 billion INR&lt;/i&gt;)&lt;br/&gt;DM 600 million for future improvements (&lt;i&gt;~ 20 billion INR&lt;/i&gt;)&lt;br/&gt;Loss of earnings for 2 to 3 years&lt;br/&gt;&lt;br/&gt;The next test flight was only 17 months later carried out - 1 Stage ended prematurely firing.&lt;br/&gt;&lt;br/&gt;The first commercial flight took place in December 1999.&lt;br/&gt;&lt;br/&gt;Tragedy:&lt;br/&gt;&lt;br/&gt;The problematic part of the program was only in preparation for the launch and the launch itself needed.&lt;br/&gt;It should only be a transitional period to be active, for security reasons: 50 sec, to the ground station at a launch control over the interruption would have.&lt;br/&gt;&lt;br/&gt;Despite the very different behavior of the Ariane 5 was nothing new about value.&lt;br/&gt;&lt;br/&gt;Optimization:&lt;br/&gt;Only 3 of 7 for a variables overflow examined - for the other 4 variables evidence existed that the values would remain small enough (Ariane 4).&lt;br/&gt;&lt;br/&gt;This evidence was not for the Ariane 5 and this was not even understood.&lt;br/&gt;Problem was with the of reuse of software!&lt;br/&gt;&lt;br/&gt;Incredible - after 40 years of software-defect findings:&lt;br/&gt;&lt;br/&gt;It was during program design assumes that only hardware failure may occur!&lt;br/&gt;Therefore, the replacement computers also identical software. The system specification established that in case of failure of the computer is off and the replacement computer einspringt. A restart of a computer was not useful, since the redefinition of the flying height is too expensive.&lt;br/&gt;&lt;br/&gt;PS: The attempt to establish new 4 Cluster satellites to launch, succeeded in July and August 2000 with two Russian launchers.&lt;br/&gt;&lt;br/&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-4555873489101371693?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/4555873489101371693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=4555873489101371693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4555873489101371693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/4555873489101371693'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/09/ariane-5-flight-501.html' title='Ariane 5 Flight 501'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1786485614956483261</id><published>2008-09-16T02:15:00.000-07:00</published><updated>2010-09-16T23:21:51.360-07:00</updated><title type='text'>Master Vim Help system</title><content type='html'>This &lt;a href="http://djcraven5.blogspot.com/2006/10/mastering-vim-help-system.html"&gt;article&lt;/a&gt;&lt;br/&gt;details steps on how to create your own help file in the vim help system.&lt;br/&gt;Should be very helpful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1786485614956483261?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1786485614956483261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1786485614956483261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1786485614956483261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1786485614956483261'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/09/master-vim-help-system.html' title='Master Vim Help system'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-8990934493353055128</id><published>2008-09-15T14:37:00.000-07:00</published><updated>2010-09-16T23:21:51.362-07:00</updated><title type='text'>fortune from pyljvim</title><content type='html'>Education is an admirable thing, but it is well to remember from time to&lt;br/&gt;time that nothing that is worth knowing can be taught.&lt;br/&gt;		-- Oscar Wilde, "The Critic as Artist"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-8990934493353055128?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/8990934493353055128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=8990934493353055128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8990934493353055128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/8990934493353055128'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/09/fortune-from-pyljvim.html' title='fortune from pyljvim'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7598952472958472624</id><published>2008-08-14T13:29:00.001-07:00</published><updated>2008-08-14T13:29:29.763-07:00</updated><title type='text'>[issue600362] relocate cgi.parse_qs() into urlparse</title><content type='html'>This issue/comments somehow escaped from my noticed, initially. I have&lt;br&gt;addressed your comments in the new set of patches.&lt;p&gt;1) Previous patch Docs had issues. Updated the Docs patch.&lt;br&gt;2) Included message in cgi.py about parse_qs, parse_qsl being present&lt;br&gt;for backward compatiblity.&lt;br&gt;3) The reason, py26 version of patch has quote function from urllib is&lt;br&gt;to avoid circular reference. urllib import urlparse for urljoin method.&lt;br&gt;So only way for us use quote is to have that portion of code in the&lt;br&gt;patch as well.&lt;p&gt;Please have a look the patches. &lt;br&gt;As this request has been present from a long time ( 2002-08-26 !), is it&lt;br&gt;possible to include this change in b3?&lt;p&gt;Thanks,&lt;br&gt;Senthil&lt;p&gt;Added file: &lt;a href="http://bugs.python.org/file11116/issue600362-py26-v2.diff"&gt;http://bugs.python.org/file11116/issue600362-py26-v2.diff&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7598952472958472624?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7598952472958472624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7598952472958472624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7598952472958472624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7598952472958472624'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/issue600362-relocate-cgiparseqs-into.html' title='[issue600362] relocate cgi.parse_qs() into urlparse'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1430991651831330373</id><published>2008-08-13T23:56:00.000-07:00</published><updated>2008-08-14T00:18:07.746-07:00</updated><title type='text'>issue2756: urllib2 add_header fails with existing unredirected_header</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; import urllib2&lt;br /&gt;&gt;&gt;&gt; url = 'http://www.whompbox.com/headertest.php'&lt;br /&gt;&gt;&gt;&gt; request = urllib2.Request(url)&lt;br /&gt;&gt;&gt;&gt; request.add_data("Spam")&lt;br /&gt;&gt;&gt;&gt; f = urllib2.urlopen(url)&lt;br /&gt;&gt;&gt;&gt; request.header_items()&lt;br /&gt;[]&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;[]&lt;br /&gt;&gt;&gt;&gt; f = urllib2.urlopen(request)&lt;br /&gt;&gt;&gt;&gt; request.header_items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/x-www-form-urlencoded'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/x-www-form-urlencoded'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Comment: This is fine. What is actually happening is do_request_ method in the http_open() is setting the unredirected_hdrs to above items.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; request.add_header('Content-type','application/xml')&lt;br /&gt;&gt;&gt;&gt; f = urllib2.urlopen(request)&lt;br /&gt;&gt;&gt;&gt; request.header_items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/xml'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Comment: When we add_header() the headers are indeed changed. Correct behavior. &lt;/b&gt;&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/x-www-form-urlencoded'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Comment: add_header() has not modified the unredirected_hdr. &lt;br /&gt;Is this the whole purpose of &lt;a href="http://bugs.python.org/issue2756"&gt;issue2756&lt;/a&gt;? If yes, then better understanding of unredirected_hdr is needed and in the do_request_ method of AbstractHTTPHandler, where it changes unredirected_hdrs based on the logic of "not request.has_header(...)" what is actually aimed for checking that.&lt;br /&gt;&lt;br /&gt;If add_header() is not supposed to change unredirected_hdrs but, add_unredirected_header() is the call to change unredirected_hdrs then, it is working fine and as expected.&lt;br /&gt;&lt;br /&gt;(This is an undocumented interface, items() call was used for viewing the headers, tough actual code might not be using it.&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt;request.add_unredirected_header('Content-type','application/xml')&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/xml'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;b&gt; Comment: add_unredirected_header() has correctly affected. &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;After application of the attached patch in issue report which modifies the add_header() and add_unredirected_header() method to remove the existing header of the same name. We will observe that the unredirected_hdr itself is removed and it is never added back.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;After application of attached patch:&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; url = 'http://www.whompbox.com/headertest.php'&lt;br /&gt;&gt;&gt;&gt; request = urllib2.Request(url)&lt;br /&gt;&gt;&gt;&gt; request.add_data("Spam")&lt;br /&gt;&gt;&gt;&gt; f = urllib2.urlopen(request)&lt;br /&gt;&gt;&gt;&gt; request.header_items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/x-www-form-urlencoded'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/x-www-form-urlencoded'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; request.add_header('Content-type','application/xml')&lt;br /&gt;&gt;&gt;&gt; f = urllib2.urlopen(request)&lt;br /&gt;&gt;&gt;&gt; request.header_items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Content-type', 'application/xml'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; request.unredirected_hdrs.items()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[('Content-length', '4'), ('Host', 'www.whompbox.com'), ('User-agent', 'Python-urllib/2.6')]&lt;br /&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;b&gt; Comment: Notice the absense of Content-type header. &lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1430991651831330373?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1430991651831330373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1430991651831330373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1430991651831330373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1430991651831330373'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/issue2756-urllib2-addheader-fails-with.html' title='issue2756: urllib2 add_header fails with existing unredirected_header'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-7545825457709619822</id><published>2008-08-13T10:28:00.000-07:00</published><updated>2008-08-13T10:29:04.570-07:00</updated><title type='text'>Issue 2756 - urllib2 add_header fails with existing unredirected header</title><content type='html'>The issue noticable here:&lt;p&gt;[ors@goofy ~]$ python&lt;br&gt;Python 2.6b2+ (trunk:65482M, Aug  4 2008, 14:26:01)&lt;br&gt;[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2&lt;br&gt;Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; url = &amp;#39;&lt;a href="http://hroch486.icpf.cas.cz/formpost.html"&gt;http://hroch486.icpf.cas.cz/formpost.html&lt;/a&gt;&amp;#39;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; import urllib2&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj = urllib2.Request(url)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.unredirected_hdrs&lt;br&gt;{}&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.add_data(&amp;quot;Spam&amp;quot;)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.unredirected_hdrs&lt;br&gt;{}&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; response = urllib2.urlopen(req_obj)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.unredirected_hdrs&lt;br&gt;{&amp;#39;Content-length&amp;#39;: &amp;#39;4&amp;#39;, &amp;#39;Content-type&amp;#39;: &amp;#39;application/x-www-form-urlencoded&amp;#39;,&lt;br&gt;&amp;#39;Host&amp;#39;: &amp;#39;&lt;a href="http://hroch486.icpf.cas.cz"&gt;hroch486.icpf.cas.cz&lt;/a&gt;&amp;#39;, &amp;#39;User-agent&amp;#39;: &amp;#39;Python-urllib/2.6&amp;#39;}&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.add_data(&amp;quot;SpamBar&amp;quot;)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.add_header(&amp;quot;Content-type&amp;quot;,&amp;quot;application/html&amp;quot;)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; response = urllib2.urlopen(req_obj)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.unredirected_hdrs&lt;br&gt;{&amp;#39;Content-length&amp;#39;: &amp;#39;4&amp;#39;, &amp;#39;Content-type&amp;#39;: &amp;#39;application/x-www-form-urlencoded&amp;#39;,&lt;br&gt;&amp;#39;Host&amp;#39;: &amp;#39;&lt;a href="http://hroch486.icpf.cas.cz"&gt;hroch486.icpf.cas.cz&lt;/a&gt;&amp;#39;, &amp;#39;User-agent&amp;#39;: &amp;#39;Python-urllib/2.6&amp;#39;}&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; req_obj.get_data()&lt;br&gt;&amp;#39;SpamBar&amp;#39;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&lt;p&gt;&lt;br&gt;In the final req_obj call, the unredirected_hdrs had not changed in neither&lt;br&gt;Content-length nor in Content-type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-7545825457709619822?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/7545825457709619822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=7545825457709619822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7545825457709619822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/7545825457709619822'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/issue-2756-urllib2-addheader-fails-with.html' title='Issue 2756 - urllib2 add_header fails with existing unredirected header'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-6458754744964563111</id><published>2008-08-12T09:24:00.000-07:00</published><updated>2008-08-12T09:25:04.257-07:00</updated><title type='text'>[issue2776] urllib2.urlopen() gets confused with path with // in it</title><content type='html'>I played around with pdb module today to debug this issue. pdb is really&lt;br&gt;helpful.&lt;br&gt;Here&amp;#39;s how the control goes.&lt;br&gt;1) There is an url with two &amp;#39;//&amp;#39;s in the path.&lt;br&gt;2) The call is data = urllib2.urlopen(url).read()&lt;br&gt;3) urlopen calls the build_opener. build_opener builds the opener using (tuple)&lt;br&gt;of handlers.&lt;br&gt;4) opener is an instance of OpenerDirector() and has default HTTPHandler and&lt;br&gt;HTTPSHandler.&lt;br&gt;5) When the Request call is made and the request has &amp;#39;http&amp;#39; protocol, then&lt;br&gt;http_request method is called.&lt;br&gt;6) HTTPHandler has http_request method which is&lt;br&gt;AbstractHTTPHandler.do_request_&lt;p&gt;Now, for this issue we get to the do_request_ method and see that&lt;p&gt;7) host is set in the do_request_ method in the get_host() call.&lt;br&gt;8) request.get_selector() is the call which is causing this particular issue&lt;br&gt;of &amp;quot;urllib2 getting confused with path containing //&amp;quot;.&lt;br&gt;.get_selector() method returns self.__r_host.&lt;br&gt;Now, when proxy is set using set_proxy(), self.__r_host is self.__original (&lt;br&gt;The original complete url itself), so the get_selector() call is returns the&lt;br&gt;sel_url properly and we can get teh host from the splithost() call on teh&lt;br&gt;sel_url.&lt;p&gt;When proxy is not set, and the url contains &amp;#39;//&amp;#39; in the path segment, then&lt;br&gt;.get_host() (step 7) call would have seperated the self.host and self.__r_host&lt;br&gt;(it pointing to the rest of the url) and .get_selector() simply returns this&lt;br&gt;(self.__r_host, rest of the url expect host. Thus causing call to fail.&lt;p&gt;9) Before the fix, request.add_unredirected_header(&amp;#39;Host&amp;#39;, sel_host or host)&lt;br&gt;had the escape mechanism set for proper urls wherein with sel_host is not set&lt;br&gt;and the host is used.  Unfortunately, that failed when this bug caused sel_host&lt;br&gt;to be set to self.__r_host and Host in the headers was being setup wrongly (&lt;br&gt;rest of the url).&lt;p&gt;The patch which was attached appropriately fixed the issue. I modified and&lt;br&gt;included for py3k.&lt;p&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I could reproduce this issue on trunk and p3k branch. The patch attached&lt;br&gt;&amp;gt; by Adrianna Pinska &amp;quot;appropriately&amp;quot; fixes this issue. I agree with the&lt;br&gt;&amp;gt; logic. Attaching the patch for py3k with the same fix.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Thanks,&lt;br&gt;&amp;gt; Senthil&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Added file: &lt;a href="http://bugs.python.org/file11103/issue2776-py3k.diff"&gt;http://bugs.python.org/file11103/issue2776-py3k.diff&lt;/a&gt;&lt;br&gt;&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-6458754744964563111?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/6458754744964563111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=6458754744964563111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6458754744964563111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/6458754744964563111'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/issue2776-urllib2urlopen-gets-confused.html' title='[issue2776] urllib2.urlopen() gets confused with path with // in it'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-1650854037961406716</id><published>2008-08-11T17:25:00.000-07:00</published><updated>2008-08-11T17:59:08.702-07:00</updated><title type='text'>Python urllib bugs roundup</title><content type='html'>From the &lt;a href="http://urllib-gsoc.blogspot.com/2008/06/urllib-issues-roundup.html"&gt;previous post&lt;/a&gt; of bugs round up, &lt;span style="font-weight:bold;"&gt;finished activities&lt;/span&gt; (bugs which are closed now) include:&lt;br /&gt;&lt;br /&gt;* http://bugs.python.org/issue1432 - Strange Behaviour of urlparse.urljoin&lt;br /&gt;* http://bugs.python.org/issue2275 - urllib2 header capitalization.&lt;br /&gt;* http://bugs.python.org/issue2916 - urlgrabber.grabber calls setdefaulttimeout&lt;br /&gt;* http://bugs.python.org/issue2195 - urlparse() does not handle URLs with port numbers properly. - Duplicate issue.&lt;br /&gt;* http://bugs.python.org/issue2829 - Copy cgi.parse_qs() to urllib.parse - Duplicate of issue600362.&lt;br /&gt;* http://bugs.python.org/issue2885 - Create the urllib package. (but the tests are still named &lt;span style="font-weight:bold;"&gt;test_urllib2, test_urlparse&lt;/span&gt; etc. I shall discuss with py-dev if names changes in tests is okay before beta3 and give a attempt).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Activities TODO:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;High- Priority:&lt;br /&gt;&lt;br /&gt;Now, the list of bugs which are partially completed and requires addressing of some issues mentioned in the patches.These would take up some higher priority, as addressing would result in closure sooner.&lt;br /&gt;&lt;br /&gt;* http://bugs.python.org/issue600362 - relocate cgi.parse_qs() into urlparse&lt;br /&gt;* http://bugs.python.org/issue2776 -  urllib2.urlopen() gets confused with path with // in it&lt;br /&gt;* http://bugs.python.org/issue2756 - urllib2 add_header fails with existing unredirected_header      Patch attached.&lt;br /&gt;* http://bugs.python.org/issue2464 -  urllib2 can't handle http://www.wikispaces.com&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Plan:&lt;/span&gt; &lt;br /&gt;I shall attempt to address all these issues before the release of Beta3 (That should be either on August 15 / August 23)&lt;br /&gt;&lt;br /&gt;The following were some of the &lt;span style="font-weight:bold;"&gt;main issues&lt;/span&gt; to be taken up during G-SOC.&lt;br /&gt;I see that as I have understood RFC 3986 better, I can work on issue1591035. I shall work on it on the branch and then discuss for inclusion in the trunk.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Feature Requests:&lt;br /&gt;&lt;br /&gt;* http://bugs.python.org/issue1591035 - update urlparse to RFC 3986.&lt;span style="font-weight:bold;"&gt;Plan:&lt;/span&gt; By August 23.&lt;br /&gt;* http://bugs.python.org/issue1462525 - URI parsing library - This will depend upon the previous issue, so we can assume Aug 23 for closure.&lt;br /&gt;* http://bugs.python.org/issue2987 - RFC2732 support for urlparse (e.g. http://[::1]:80/) This is related bug again and will conclude by the same time-line.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I shall take up the following listed bugs after completion of the above.&lt;br /&gt;&lt;br /&gt;* http://bugs.python.org/issue1448934 - urllib2+https+proxy not working. &lt;br /&gt;* http://bugs.python.org/issue1424152 - urllib/urllib2: HTTPS over (Squid) Proxy fails&lt;br /&gt;* http://bugs.python.org/issue1675455 - Use getaddrinfo() in urllib2.py for IPv6 support. Patch provided.&lt;br /&gt;&lt;br /&gt;Low priority.&lt;br /&gt;* http://bugs.python.org/issue1285086 - urllib.quote is too slow&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-1650854037961406716?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/1650854037961406716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=1650854037961406716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1650854037961406716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/1650854037961406716'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/python-urllib-bugs-roundup.html' title='Python urllib bugs roundup'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4574925891333430710.post-2288523657764714442</id><published>2008-08-11T17:13:00.000-07:00</published><updated>2008-08-11T17:23:23.105-07:00</updated><title type='text'>Issue 3300</title><content type='html'>There is a good amount of discussion going around with&lt;br&gt;&lt;a href="http://bugs.python.org/issue3300"&gt;http://bugs.python.org/issue3300&lt;/a&gt;, I had been following from the start and had&lt;br&gt;an inclination towards quote and quote_plus to support UTF-8. But as the&lt;br&gt;discussion went further, without strong point on which stance to take, I had to&lt;br&gt;refresh and improve my knowledge of unicode support in Python and espcially&lt;br&gt;Unicode Strings in Python 3.0. Hopefully this will come handy in other issues.&lt;p&gt;Here are some notes on Unicode and Python.&lt;p&gt;&lt;br&gt;What is Unicode?&lt;br&gt;In Computing, Unicode is an Industry Standard allowing Computers to&lt;br&gt;consistently display and manipulate text expressed in most of the world&amp;#39;s&lt;br&gt;writing systems.&lt;p&gt;Unicode provides a unique number for every character,&lt;br&gt;no matter what the platform,&lt;br&gt;no matter what the program,&lt;br&gt;no matter what the language.&lt;p&gt;What is Unicode Character Set?&lt;p&gt;What is character encoding?&lt;p&gt;What is Encoding?&lt;br&gt;Converting a Character (or Something) to Number, because Computer internally&lt;br&gt;store numbers only.&lt;p&gt;Unicode Strings are a set of Code Points represented from 0x000000 to 0x10FFFF.&lt;br&gt;This sequence needs to be represented as a set of bytes ( meaning, values from&lt;br&gt;0-255) in memory. The rules for translating the Unicode String into sequence of&lt;br&gt;bytes is called encoding.&lt;p&gt;The representation in the number format is required for homogenuity, otherwise&lt;br&gt;it will be difficult to convert to and from.&lt;p&gt;&lt;br&gt;What is Unicode Transformation Format?&lt;p&gt;What is UTF-8?&lt;p&gt;Unicode can be implented using a many character encodings. The most commonly&lt;br&gt;used one is utf-8, which uses 1 byte for all ASCII characters, which have the&lt;br&gt;same code values as in the standard ASCII encoding, and up to 4 bytes for other&lt;br&gt;characters.&lt;p&gt;When it \u the remaining the Unicode Code points which you will find defined&lt;br&gt;internationally from &lt;a href="http://unicode.org"&gt;unicode.org&lt;/a&gt;&lt;p&gt;Now, how to represent them in BINARY (Coz: Computer!), is the trick and you&lt;br&gt;will have different encodings to do so.&lt;br&gt;So UTF-8 is one encoding and UTF-16,ASCII are all different encodings.&lt;p&gt;So you construct a unicode string &lt;br&gt;mystr = u&amp;#39;\u0065\u0066\u0067\u0068&amp;#39;&lt;p&gt;mystr is a unicode object. It does not make sense to print it.&lt;br&gt;But if you wish to see the object, use repr&lt;br&gt;print repr(mystr)&lt;p&gt;Now, the unicode object can be coverted to Binary using encoding, and let us&lt;br&gt;use &amp;#39;ascii&amp;#39; and &amp;#39;utf-8&amp;#39;&lt;br&gt;so you would do &lt;br&gt;asciistr = mystr.encode(&amp;#39;ascii&amp;#39;)&lt;br&gt;utf8str = mystr.encode(&amp;#39;utf-8&amp;#39;)&lt;p&gt;Now, it is string object in BINARY&lt;p&gt;let us print asciistr, and utf8str&lt;p&gt;STILL NEED MORE UNDERSTANDING.&lt;p&gt;&lt;a href="http://boodebr.org/main/python/all-about-python-and-unicode"&gt;http://boodebr.org/main/python/all-about-python-and-unicode&lt;/a&gt;&lt;p&gt;A Unicode string holds characters from the Unicode character set.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4574925891333430710-2288523657764714442?l=uthcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uthcode.blogspot.com/feeds/2288523657764714442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4574925891333430710&amp;postID=2288523657764714442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2288523657764714442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4574925891333430710/posts/default/2288523657764714442'/><link rel='alternate' type='text/html' href='http://uthcode.blogspot.com/2008/08/issue-3300.html' title='Issue 3300'/><author><name>Senthil Kumaran</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-xzrzQ5Ehqr4/AAAAAAAAAAI/AAAAAAAAAAA/4xHGk-b3vAk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
