<?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-8652019172422577813</id><updated>2011-12-31T04:10:33.897+05:30</updated><category term='automatic screenshots'/><category term='Python'/><category term='convert to touchscreen'/><category term='debug'/><category term='burning desktop'/><category term='world map wallpaper'/><category term='wii hacks'/><category term='screenshot in python'/><category term='PWI'/><category term='click and drag'/><category term='ubuntu wallpaper'/><category term='extracting audio'/><category term='organize music'/><category term='temperature monitor'/><category term='wii'/><category term='world map'/><category term='multi touch'/><category term='batch rename'/><category term='cheap tablet'/><category term='thread management'/><category term='drag buttons'/><category term='widgets'/><category term='drag and drop'/><category term='pycon'/><category term='wxPython'/><category term='wiihacks'/><category term='Wii remote'/><category term='python and wii'/><category term='gui for python help'/><category term='pyqt'/><category term='pwi audio'/><category term='convert to tablet'/><category term='PWI to wave'/><category term='automatic wallpaper'/><category term='wii on linux'/><category term='frontend'/><category term='python temperature'/><category term='python help'/><category term='rename music'/><category term='remote control for pc'/><category term='CPU heating'/><category term='ubuntu temperature'/><category term='GUI in python'/><category term='touchless'/><category term='threads in python'/><category term='Drag GUI'/><category term='desktop on fire'/><category term='logger in python'/><title type='text'>/* Baniya Ki Duniya */</title><subtitle type='html'>&lt;a href="mailto:asim.mittal@gmail.com"&gt;email&lt;/a&gt; | &lt;a href="http://baniyakiduniya.mobstac.com"&gt;Mobile site&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-6607486781048801188</id><published>2010-10-19T16:19:00.001+05:30</published><updated>2010-10-19T16:33:37.066+05:30</updated><title type='text'>Moving to Wordpress...</title><content type='html'>My blog has moved to a new location: &lt;a href="http://asimmittal.net"&gt;http://asimmittal.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You will be redirected shortly...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-6607486781048801188?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/6607486781048801188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/moving-to-wordpress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6607486781048801188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6607486781048801188'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/moving-to-wordpress.html' title='Moving to Wordpress...'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-4805299522805888995</id><published>2010-10-08T13:00:00.001+05:30</published><updated>2010-10-08T13:00:53.514+05:30</updated><title type='text'>Robin Hood of the Future: Robot Archer iClub</title><content type='html'>&lt;p&gt;Researchers at the Italian Institute of Technology have created the first robot archer. It grips a bow and uses computer vision to aim at the target. It learns on the fly from failed attempts. It was a project led by Petar Kormushev, and is a fruit of open-source development. The robot or humanoid looks really good, standing 3.5 feet tall and has illuminated facial features and big round eyes. It mimics the learning behavior of a growing child. Watch the robot in action:&lt;/p&gt;&lt;p&gt;&lt;object width="480" height="385"&gt;&lt;br /&gt;&lt;param name="movie" value="http://www.youtube.com/v/QCXvAqIDpIw?fs=1&amp;amp;hl=en_US" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/QCXvAqIDpIw?fs=1&amp;amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-4805299522805888995?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/4805299522805888995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/robin-hood-of-future-robot-archer-iclub.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4805299522805888995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4805299522805888995'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/robin-hood-of-future-robot-archer-iclub.html' title='Robin Hood of the Future: Robot Archer iClub'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-709836001199666335</id><published>2010-10-07T02:17:00.001+05:30</published><updated>2010-10-07T02:17:29.767+05:30</updated><title type='text'>My own domain ---&gt; http://asimmittal.net</title><content type='html'>&lt;p&gt;Hey everyone, I’ve recently bought a domain name at justHost.com and my website goes live today. You can follow my blog through the site.&lt;/p&gt;  &lt;p&gt;The URL is : &lt;a href="http://asimmittal.net"&gt;http://asimmittal.net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The blog has been changed visually and is now integrated with the website. You can still follow it via RSS. The website will also contain views into my youtube channel and contain the most relevant project work that I’ve done in the last year or so.&lt;/p&gt;  &lt;p&gt;Please feel free to write to me with suggestions on how to improve the look and feel of my website. I have gone with a “Text/Image” only version to speed up loading and achieve a neat and clean look.&lt;/p&gt;  &lt;p&gt;Hope you like it! &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-709836001199666335?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/709836001199666335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/my-own-domain-httpasimmittalnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/709836001199666335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/709836001199666335'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/my-own-domain-httpasimmittalnet.html' title='My own domain ---&amp;gt; http://asimmittal.net'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-5063561098092661167</id><published>2010-10-06T20:10:00.001+05:30</published><updated>2010-10-06T20:10:31.166+05:30</updated><title type='text'>Note to Self : Google Not Found!</title><content type='html'>&lt;p&gt;Today a peculiar thing happened. My web browsers (IE, Firefox and Chrome) couldn’t locate Google.com!&lt;/p&gt;  &lt;p&gt;The fix was resetting the TCP/IP service using the NetShell utility from the command line. Here’s the syntax (do remember to run the command prompt in “Admin” mode):&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Courier New"&gt;&lt;strong&gt;&amp;gt; netsh int ip reset C:\resetlog.txt&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-5063561098092661167?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/5063561098092661167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/note-to-self-google-not-found.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5063561098092661167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5063561098092661167'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/note-to-self-google-not-found.html' title='Note to Self : Google Not Found!'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-6379063936579069304</id><published>2010-10-02T18:46:00.005+05:30</published><updated>2010-10-02T18:59:28.612+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='python and wii'/><category scheme='http://www.blogger.com/atom/ns#' term='wiihacks'/><category scheme='http://www.blogger.com/atom/ns#' term='pycon'/><category scheme='http://www.blogger.com/atom/ns#' term='touchless'/><category scheme='http://www.blogger.com/atom/ns#' term='multi touch'/><title type='text'>Multi point "touchless" Workspace using Wii + Python</title><content type='html'>Hey, due to popular demand, I'm uploading a video of the final section of my presentation @ PyCon India 2010. This video shows how the Wii can be combined with some nifty Python code to create a touch less workspace, with more than one point of control (a touch less multi touch... goofy!)&lt;br /&gt;&lt;br /&gt;The source is available on the projects page (runPuzzle.py is the file you wanna peek into). I'm currently working on implementing a 3D workspace for viewing photos and playing movies, that would respond to gestures and the motion of my fingers, using the same principle of course. Anyone interested in contributing, give me a buzz. I'm gonna need a little help with OpenGL on Python.&lt;br /&gt;&lt;br /&gt;Thanks everyone for making PyCon 2010 a roaring success! Ektitli.org is looking for volunteers to come forth and help us in any way they can. Contact Vaibhav @ &lt;a href="http://ektitli.org"&gt;ektitli.org&lt;/a&gt; for more info.&lt;br /&gt;&lt;br /&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/vgDA35QW7K4?fs=1&amp;amp;hl=en_US"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/vgDA35QW7K4?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="385" width="480"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-6379063936579069304?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/6379063936579069304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/multi-point-touchless-workspace-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6379063936579069304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6379063936579069304'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/10/multi-point-touchless-workspace-using.html' title='Multi point &quot;touchless&quot; Workspace using Wii + Python'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-4367467936885581434</id><published>2010-09-28T15:05:00.003+05:30</published><updated>2010-09-28T15:17:51.486+05:30</updated><title type='text'>Going Open Source with "Python + Wii = Intuitive Control"</title><content type='html'>Hey everyone, I have prepared a short document explaining the source code. The document is available along with the rest of the source and presentation files. Click &lt;a href="http://jumbofiles.com/tzi7lwbqbtxy"&gt;here&lt;/a&gt; to download the same. If you are having trouble with the link, you can also visit my talk's page on the PyCon 2010 website and download the files from there. I've recently uploaded all the source onto the PyCon website. Click &lt;a href="http://in.pycon.org/2010/talks/22-python-wii-intuitive-control"&gt;here to go to my PyCon page&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The documentation is about five pages and takes you through a line by line break down of the code for the first three applications of the presentation. Why only the first three!!!?!?! Well, I feel that they are the one's that lay the foundation of the concepts used in all the other applications. These were also the one's I spent the most time developing, simply as I had no precedents or references to begin with. The others just flowed as my understanding of the PyQt4 framework grew.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The applications which seemed to arouse maximum interest were the two games and the touchless workspace (or the puzzle). Those applications have &lt;u&gt;NOT&lt;/u&gt; been covered in this document. I would like you to fathom those on your own. They are not very complicated. Those apps are more about the UI than about the Nintendo Wii. I would like anyone downloading this project to give those applications a shot after having fully understood the basics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And besides, I'm only an email away ;-) Enjoy the Wii, and remember that you are only limited by your imagination!&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/8652019172422577813-4367467936885581434?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/4367467936885581434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/going-open-source-with-python-wii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4367467936885581434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4367467936885581434'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/going-open-source-with-python-wii.html' title='Going Open Source with &quot;Python + Wii = Intuitive Control&quot;'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-6029601807035922346</id><published>2010-09-25T22:34:00.003+05:30</published><updated>2010-09-28T15:04:02.327+05:30</updated><title type='text'>My PyCon 2010, Bangalore</title><content type='html'>It was my first PyCon, and honestly, I would be lying if I said that I wasn't the least bit nervous. I haven't felt the "butterflies" in my stomach for a while, and I was quite apprehensive about how my talk would be received by the Python community.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But the atmosphere at PyCon, really put me at ease and I'm grateful to one and all, organizer and attendee, for giving me the opportunity to share my ideas with programmers and enthusiasts from all over the country.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A special thanks to Noufal, who incidentally, was the first person I came across at the venue. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In tune with my promise of sharing the source of my talk, I have uploaded the source files and they are available for download &lt;a href="http://jumbofiles.com/tzi7lwbqbtxy"&gt;here&lt;/a&gt;. The file is a tar file, simply decompress it and use the wiigrab module. You may follow the sequence of examples as demonstrated in the presentation. Please ensure that you have the following packages installed before running the source:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;python-cwiid&lt;/li&gt;&lt;li&gt;xautomation&lt;/li&gt;&lt;li&gt;python-qt4&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The source would run smoothly on Ubuntu, provided these dependencies are met. I will be publishing more documentation shortly, explaining the structure of the source (something I couldn't do during the talk due to the shortage of time). &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please feel free to drop me a line if you have any queries or suggestions. Thanks again!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-6029601807035922346?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/6029601807035922346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/my-pycon-2010-bangalore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6029601807035922346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6029601807035922346'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/my-pycon-2010-bangalore.html' title='My PyCon 2010, Bangalore'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-5859157882376502658</id><published>2010-09-05T21:01:00.001+05:30</published><updated>2010-09-05T21:01:26.937+05:30</updated><title type='text'>How to make your blog mobile friendly in 5 mins!</title><content type='html'>If you have a lot of traffic coming from cell phone users, you might want to optimise your content for the cell phone browser. Its smaller, less powerful and is content centric. Almost all blogs have some sort of syndication using RSS or atom feeds. &lt;BR&gt;&lt;BR&gt;&lt;a href="http://www.mippin.com"&gt;http://www.mippin.com&lt;/a&gt; is a site that lets you distribute your blog in a mobile friendly format, using your blog's feed. Its a simple 3 step procedure and you can even host your mobile site through mippin.com, just don't forget to put a link to the mobile site on your blog template. I've added mine using my blog description (yes, it is just HTML).&lt;BR&gt;&lt;BR&gt;Do visit the mobile version, preferably using a cell phone. Happy moBLOGGING!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-5859157882376502658?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/5859157882376502658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/how-to-make-your-blog-mobile-friendly.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5859157882376502658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5859157882376502658'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/how-to-make-your-blog-mobile-friendly.html' title='How to make your blog mobile friendly in 5 mins!'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-6761621169210741172</id><published>2010-09-05T17:50:00.002+05:30</published><updated>2010-09-05T18:03:28.836+05:30</updated><title type='text'>Blogging from my s60...</title><content type='html'>My first blog post from my s60 phone. Feels like heaven. I've been searching for a mobile blogging client for quite a while now, and until today, i didn't have a viable solution. I came across Wavelog and within 5 minutes of using the trial version, i was hooked. You can even embed images and videos. Check out this video embedded straight out of youtube:&lt;div&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/PimbkQNKzb4"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.youtube.com/v/PimbkQNKzb4" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;Perfect for blogging on the go! I am loving my new toy.&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-6761621169210741172?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/6761621169210741172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/blogging-from-my-s60_4220.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6761621169210741172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6761621169210741172'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/blogging-from-my-s60_4220.html' title='Blogging from my s60...'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-5849301952873960126</id><published>2010-09-03T16:40:00.004+05:30</published><updated>2010-09-04T14:38:14.559+05:30</updated><title type='text'>Ek Titli @ PyCon, India 2010</title><content type='html'>&lt;div style="text-align: left;"&gt;Ektitli is an initiative that strives for a cleaner environment through proactivity, real world thinking and youthful effervescence. Today, I do mother earth proud by matching my step with EKT, hoping that one day, the grass is "green" everywhere I see.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I will be promoting their cause at PyCon India, 2010. Help me make this happen. On behalf of the EKT team, I call upon my fellow pythonistas, to open their minds and their code editors and help contribute towards the growth of this movement in anyway they can.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Together, we can redeem our planet... and what better way to do it than coding all the way! Visit &lt;a href="http://ektitli.org/"&gt;ektitli.org&lt;/a&gt; for more info about the initiative.&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_itfBLP0qW6o/TIDaekxgiYI/AAAAAAAAAJs/kyckBS6e-g0/s320/ektlogo.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5512646162703747458" /&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/8652019172422577813-5849301952873960126?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/5849301952873960126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/ek-titli-pycon-india-2010.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5849301952873960126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5849301952873960126'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/09/ek-titli-pycon-india-2010.html' title='Ek Titli @ PyCon, India 2010'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_itfBLP0qW6o/TIDaekxgiYI/AAAAAAAAAJs/kyckBS6e-g0/s72-c/ektlogo.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-7355605319785935160</id><published>2010-07-30T21:30:00.002+05:30</published><updated>2010-09-04T14:38:37.027+05:30</updated><title type='text'>Wii + Python = Motion Capture + Gesture recognition</title><content type='html'>&lt;p&gt;Here’s the second installment in the series of videos I’ve been uploading recently on using the Nintendo Wii and Python to provide intuitive means of controlling applications on Ubuntu.&lt;/p&gt;  &lt;p&gt;I plan to demonstrate this and much more at PyCon India, 2010, if my proposal is accepted. The Nintendo Wii has an IR Camera built into it with a really powerful on board controller (an SOC) that basically does a lot of hard work to present simplified coordinate based tracking. Each controller can track up to four points in two dimensional space (there is an element of depth as well, but more on that later). &lt;/p&gt;  &lt;p&gt;Using the “CWiiD” Project, an open source interface for the Wii remote on Linux, I have developed a small “sandbox” application that allows you to manipulate an object using my hands, as opposed to the traditional forms of control viz. the mouse and keyboard. What’s even more impressive is that the entire hardware will cost only under $50. This provides almost limitless possibilities for the amount of intuitiveness that we can add to an application. &lt;/p&gt;  &lt;p&gt;Currently, there is no device driver in place, but with a little help from the open source community and a little “rocket science” (basically a library for recognizing commonly used gestures), we can change the way we interact with our PCs forever.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=qmQgtMqMHSE"&gt;Here&lt;/a&gt; is the video. Hope you enjoy this as much as I enjoyed making it! Cheers to PyCon 2010. &lt;/p&gt;  &lt;p&gt;   &lt;/p&gt;&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:2896c3eb-cf02-4781-9d3a-48ddf05746cd" class="wlWriterEditableSmartContent"&gt;&lt;div id="a7e5a6c8-54e9-4471-887f-6342b9f19173" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/qmQgtMqMHSE&amp;amp;hl=en"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/qmQgtMqMHSE&amp;amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;If you like this video, comment on this post, share it with your peers and support PyCon in India and around the world. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-7355605319785935160?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/7355605319785935160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/wii-python-motion-capture-gesture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7355605319785935160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7355605319785935160'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/wii-python-motion-capture-gesture.html' title='Wii + Python = Motion Capture + Gesture recognition'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-2994035735409415009</id><published>2010-07-27T00:55:00.004+05:30</published><updated>2010-07-28T15:44:35.414+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='python and wii'/><category scheme='http://www.blogger.com/atom/ns#' term='wii'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop on fire'/><category scheme='http://www.blogger.com/atom/ns#' term='burning desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='wii on linux'/><category scheme='http://www.blogger.com/atom/ns#' term='wii hacks'/><title type='text'>Wii Remote + Python + Linux</title><content type='html'>Here’s a teaser on the applications that I’ve been building recently for my proposal to present a talk at PyCon India, 2010. The &lt;a href="http://abstrakraft.org/cwiid/"&gt;cwiid project&lt;/a&gt; provides a simple python wrapper which allows application developers to interface with the Nintendo Wii remote over bluetooth.  &lt;p&gt;I have build a small wrapper on top of the cwiid module that allows you to run a thread which connects to the Wii remote and sample data from it at regular intervals and feed that data to a designated callback routine. This approach improves the usability of the cwiid module and allows a developer to easily embed Wii remotes into their applications.&lt;/p&gt;  &lt;p&gt;Intuitive control is something that never comes cheap! Touch screens cost a fortune and are not supported by every application. Using the Wii, and some clever programming, gesture and pattern recognition can be brought to almost every desktop. Brian Peek’s library has been a rich source for developers on Windows using the .NET framework, but it seems like there is little happening on Linux as far as expanding or maintaining a decent Wii library is concerned. &lt;/p&gt;  &lt;p&gt;Here is a taste of what we can achieve with a little imagination and a few lines of code. Check out &lt;a href="http://www.youtube.com/watch?v=-t88048fs4U"&gt;this video&lt;/a&gt; I made today, that allows me to set my desktop on fire :D&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="padding: 0px; margin: 0px; display: inline; float: none;" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:b094cc49-909c-49a4-9486-c7594220486e" class="wlWriterEditableSmartContent"&gt;&lt;div id="db80a1af-6036-4258-891b-a46b143ab502" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=-t88048fs4U" target="_new"&gt;&lt;img src="http://lh4.ggpht.com/_itfBLP0qW6o/TE3hD6OvOoI/AAAAAAAAAIw/3Vm7qdQSozw/video369e726bea1e%5B3%5D.jpg?imgmax=800" style="border-style: none;" galleryimg="no" onload="var downlevelDiv = document.getElementById('db80a1af-6036-4258-891b-a46b143ab502'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/-t88048fs4U&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/-t88048fs4U&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;There will be more updates headed your way very soon. If you like what you’ve seen, comment on my blog or “like” this video on YouTube. Support PyCon India, this year and the next.&lt;/p&gt;&lt;p&gt;I dedicate this video to &lt;a href="http://www.brianpeek.com/blog/pages/wiimotelib.aspx"&gt;Brian Peek&lt;/a&gt;,  whose work on creating a Windows based library for the Wiimote inspired many others to take it beyond the barriers of operating systems and languages. Cheers to you mate!&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-2994035735409415009?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/2994035735409415009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/wii-remote-python-linux.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2994035735409415009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2994035735409415009'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/wii-remote-python-linux.html' title='Wii Remote + Python + Linux'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_itfBLP0qW6o/TE3hD6OvOoI/AAAAAAAAAIw/3Vm7qdQSozw/s72-c/video369e726bea1e%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1120174876835778003</id><published>2010-07-24T16:28:00.002+05:30</published><updated>2010-07-28T15:45:36.688+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='threads in python'/><category scheme='http://www.blogger.com/atom/ns#' term='CPU heating'/><category scheme='http://www.blogger.com/atom/ns#' term='temperature monitor'/><category scheme='http://www.blogger.com/atom/ns#' term='thread management'/><title type='text'>My thread burnt down my computer!!!</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I've been working on developing applications for my PC using the wii lately. In order to get me going, I found an open source library called "cwiid" with a python wrapper, "python-cwiid". Yesterday, while coding, I kept facing a peculiar problem. Every time I ran my application (which was merely something that connected the nearest wii remote and started receiving accelerometer and key press information from it), my laptop got extremely hot and my computer shut down.&lt;br /&gt;&lt;br /&gt;I was quick to understand that this had something to do with the CPU being pushed into thermal cutoff. Interestingly, a previous application that I wrote came in handy. My TempMonitor application allowed me to get a visual comparison of the CPU usage and temperature against time. So I decided to see for myself, how brutally my CPU was being ravaged by the wii application I had made. The results were quite astounding. My application pushed my CPU upto a 100 degrees centigrade in under 15 minutes (coupled with a few other apps like games or presentations for which the remote was suppose to act as a new interface) and caused it to shut down.&lt;br /&gt;&lt;br /&gt;So I took a deeper look at my code. My app was essentially a wrapper for the "Wiimote" class provided by python-cwiid. It allowed me to run a thread that received data from the wii remote and invoke a callback routine to handle the processing. This was extremely essential as it was the only way to abstract the nitty gritties of the wii from the actual application. After an hour or two of breaking my head, it hit me like a tonne of bricks.&lt;br /&gt;&lt;br /&gt;My main routine started the thread and died, making a "orphaned zombie"  (Now this might sound strange since, an orphan thread is one whose parent thread has died. A zombie process is a defunct or redundant entry in the process table. In our case, the cycle of calls is Python Interpreter --&amp;gt; main --&amp;gt; background process. Here, the main routine dies, but the interpreter doesn't. So the background thread has lost its parent but still has a grandparent viz. the interpreter. And technically, since the application is over after the death of the main routine, the python interpreter is a redundant entry that continues to live on in the process table. So the nomenclature!). I quickly added a semaphore to my main routine, that kept it alive until the background task was not complete,  and "peace was once again restored to the empire". But then I decided to put my theory to the test. I wrote a script that mimiced the structure of my Wii application.&lt;br /&gt;&lt;br /&gt;It had a background task with some heavy processing (well not as heavy as my app, but enough to put a little squeeze on the core), and in order to test its effect on the CPU load and temperature, i create three kinds of main routines:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the first one died after starting the background task, orphaning it&lt;br /&gt;&lt;/li&gt;&lt;li&gt;the second one had a semaphore but was a bigger time hog than the background task (i.e. it didn't sleep and fairly share time with the background task)&lt;/li&gt;&lt;li&gt;the third one had a semaphore that made the main routine doze every once in a while and provide more time to the background task&lt;/li&gt;&lt;/ul&gt;The processing was not too heavy, as i wanted to put just enough load to cause a steady rise in temperature. The background task's job was to open a JPEG and read out all the pixels (values between 0-255). Now the question to ask was, "what would be the threshold temperature"? I wanted each of the cases to eventually break down, and yet give comprehensive results on the effect a simple "sleep statement" can have. Normal range of operation of most cores is between 55 to 90 degrees centigrade. An average load on my computer is between 65-70% (which is higher than most regular computer users) and it usually works between 60 C to 70 C. So after a little deliberation, I chose 70 degrees centigrade as my threshold. The load that the application was going to put on my 2.8 GHz CPU was going to be much above ordinary and more importantly, it was going to be persistent (yes, that's something we normally don't face. Most applications have asynchronous demands which are resource heavy indeed but for brief periods of time. Therefore, we don't really feel the CPU running out of steam or heating up too much. Persistent applications are the best kind of load to make your CPU sweat!).&lt;br /&gt;&lt;br /&gt;Here is the script:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import time,sys&lt;br /&gt;from threading import Thread&lt;br /&gt;&lt;br /&gt;#---------------------------------------------------------------------------&lt;br /&gt;class backgroundTask (Thread):&lt;br /&gt; &lt;br /&gt; """ simple background task """&lt;br /&gt;&lt;br /&gt; def __init__(self):&lt;br /&gt;  """ simple thread constructor """&lt;br /&gt;  Thread.__init__(self)&lt;br /&gt;  self.stop = False&lt;br /&gt;  self.cnt  = 0&lt;br /&gt; #------------------------------------------------------------------&lt;br /&gt; def bizzareProcessing(self,num):&lt;br /&gt;  """ some heavy duty processing for testing pruposes """&lt;br /&gt;  fileRead = open('APPLE.jpg')&lt;br /&gt;  image = fileRead.read()&lt;br /&gt;  for eachbyte in image:&lt;br /&gt;   print ord(eachbyte)&lt;br /&gt;  fileRead.close() &lt;br /&gt;  print "_"*30&lt;br /&gt; #------------------------------------------------------------------&lt;br /&gt; def run(self):&lt;br /&gt;  """ worker routine for the thread """&lt;br /&gt;&lt;br /&gt;  print 'starting background task'  &lt;br /&gt;  while not self.stop:&lt;br /&gt;   &lt;br /&gt;   self.bizzareProcessing(self.cnt)&lt;br /&gt;   self.cnt+=1&lt;br /&gt;   time.sleep(0.1)&lt;br /&gt;  &lt;br /&gt;  print 'exiting backround task'&lt;br /&gt; #------------------------------------------------------------------&lt;br /&gt; def stop(self):&lt;br /&gt;  """ This is the kill switch """&lt;br /&gt;  self.stop = True&lt;br /&gt; #------------------------------------------------------------------&lt;br /&gt; def getCount(self): return self.cnt&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;#--------------------------------------------------------------------------- &lt;br /&gt;def mainZombie():&lt;br /&gt;&lt;br /&gt; bgTaskZombie = backgroundTask()&lt;br /&gt; bgTaskZombie.start()&lt;br /&gt; #now the parent thread, i.e. this function will die, but the&lt;br /&gt; #task bgTaskZombie is still going to be running&lt;br /&gt; print '\nMainZombie is dying now'&lt;br /&gt;#---------------------------------------------------------------------------&lt;br /&gt;def mainHog():&lt;br /&gt; &lt;br /&gt; bgTaskHog = backgroundTask()&lt;br /&gt; bgTaskHog.start()&lt;br /&gt; &lt;br /&gt; while bgTaskHog.getCount ==  20000: pass&lt;br /&gt; #the semaphore above keeps the parent thread from dying before&lt;br /&gt; #the child thread, therefore not making it a zombie but no&lt;br /&gt; #sleep in the loop causes the main routine to hog cpu&lt;br /&gt;&lt;br /&gt; print '\nMainHog is dying now'&lt;br /&gt;#---------------------------------------------------------------------------&lt;br /&gt;def mainProper():&lt;br /&gt; bgTaskProper = backgroundTask()&lt;br /&gt; bgTaskProper.start() &lt;br /&gt; &lt;br /&gt; while bgTaskProper.getCount == 20000: time.sleep(1)&lt;br /&gt; #same as the mainHog routine, only with a little nap for the main&lt;br /&gt; #routine. This causes the main routine to share time and stay alive&lt;br /&gt;&lt;br /&gt; print '\nMainProper is dying now'&lt;br /&gt;#---------------------------------------------------------------------------&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt; &lt;br /&gt; arg = int(sys.argv[1])&lt;br /&gt;&lt;br /&gt; if arg == 1: mainZombie()&lt;br /&gt; elif arg == 2: mainHog()&lt;br /&gt; elif arg == 3:  mainProper()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The results are shown below. My temperature monitor application uses google charts API to generate a few graphs of CPU load (blue trace) and CPU temperature (green trace) against time. It records the changes in these two quantities over the last 400 seconds. I ran each of the main routines and clobbered the images together for a clear comparison. Now I did run each main routine over five times to make sure there was consistency in my readings. Here are the plots for the last run:&lt;/p&gt;&lt;p&gt;&lt;img src="http://lh3.ggpht.com/_itfBLP0qW6o/TErBUWUXzMI/AAAAAAAAAIs/yEAgy7Bu3LE/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As you can see, it takes longer for the most properly structured application to reach the threshold, while the one with the zombie hanging around is quick to touch the threshold temperature in no time.&lt;/p&gt;&lt;p&gt;Problems like this may go undetected and surface in an untimely fashion to make your life a living hell. So structure your threads well. Make sure  all the babies have their parents and everyone gets enough sleep.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-1120174876835778003?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1120174876835778003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/my-thread-burnt-down-my-computer_24.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1120174876835778003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1120174876835778003'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/my-thread-burnt-down-my-computer_24.html' title='My thread burnt down my computer!!!'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_itfBLP0qW6o/TErBUWUXzMI/AAAAAAAAAIs/yEAgy7Bu3LE/s72-c/%5BUNSET%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-2714154278849246050</id><published>2010-07-22T12:38:00.003+05:30</published><updated>2010-07-28T15:46:16.961+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='world map'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu wallpaper'/><category scheme='http://www.blogger.com/atom/ns#' term='world map wallpaper'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic wallpaper'/><title type='text'>Automated Wallpapers for your Ubuntu Desktop</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;I was quite bored with the ill written dynamic wallpaper utility on Ubunutu. It uses the wallpapers stored in /usr/share/backgrounds directory in union with an XML file, to change your desktop wallpapers. If you wanted to add your own collection of wallpapers, you'd have to put them in that directory and edit the XML file and god save you if you accidentally deleted some wallpapers, 'cause then you're going to get a plain screen every time it tries to load a dead link.&lt;/p&gt;&lt;p&gt;So I wrote my own little desktop utility called "Wallshaker". It allows you to load multiple directories as sources of images, monitors them and doesn't load dead links. If new images are added to any of the monitored directories, they are picked up as well. You can even configure the timing between wallpapers (in seconds). But hey, this is pretty regular stuff. You get a truckload of applications that do just the same thing. "DRAPES" for one is a decent app and is available through the repositories. So what is it that sets this application aside.&lt;/p&gt;&lt;p&gt;Well, my little app has a checkbox that reads "Live World Map". If you click that, satellite images of the sunlight map of the world is grabbed from the web and set as your wallpaper. The map is refreshed multiple times during the day as and when new images are available. Cloud patterns are update every few hours and you can actually see how one part of the world moves from light to darkness during the course of the day.&lt;/p&gt;&lt;p&gt;Now you can simply look at your desktop and see which parts of the world are "awake" or "asleep" :D&lt;/p&gt;&lt;p&gt;But simply using this was not enough. So I wrote another utility that would grab my desktop every now and then and made a movie out of it. Its a small clip, spanning almost six to seven hours of the day squeezed into 15 seconds. But it clearly shows you how your desktop changes as the earth moves about its axis and as the day blends into the night.&lt;/p&gt;&lt;p&gt;Here's the &lt;a target="_blank" title="World View on your desktop" href="http://www.youtube.com/watch?v=n1_y7H5y3Z4"&gt;link to the video&lt;/a&gt;. As always, you can download the app from &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;my projects page&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-18504f4b93908aaa" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v8.nonxt3.googlevideo.com/videoplayback?id%3D18504f4b93908aaa%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1329899116%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D71182FF0482893D3EF96B7C6DDEA738482635681.2A23DE5665E42646C98E8FC6E55D6EF0F87F03E9%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D18504f4b93908aaa%26offsetms%3D5000%26itag%3Dw160%26sigh%3D75jidOb6R2t9n7EXTt3Qo41OVjE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v8.nonxt3.googlevideo.com/videoplayback?id%3D18504f4b93908aaa%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1329899116%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D71182FF0482893D3EF96B7C6DDEA738482635681.2A23DE5665E42646C98E8FC6E55D6EF0F87F03E9%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D18504f4b93908aaa%26offsetms%3D5000%26itag%3Dw160%26sigh%3D75jidOb6R2t9n7EXTt3Qo41OVjE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/p&gt;&lt;p&gt;=-=-=-=-=&lt;br /&gt;&lt;i&gt;Powered by &lt;b&gt;&lt;a href="http://blogilo.gnufolks.org/"&gt;Blogilo&lt;/a&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-2714154278849246050?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/2714154278849246050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/automated-wallpapers-for-your-ubuntu.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2714154278849246050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2714154278849246050'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/automated-wallpapers-for-your-ubuntu.html' title='Automated Wallpapers for your Ubuntu Desktop'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1608427824431958253</id><published>2010-07-21T14:03:00.015+05:30</published><updated>2010-09-04T14:21:04.148+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='automatic screenshots'/><category scheme='http://www.blogger.com/atom/ns#' term='screenshot in python'/><title type='text'>Taking periodic snapshots of your Ubuntu Desktop</title><content type='html'>&lt;p&gt;I've been working an application (will be posting more about that a bit later), but in order to test it, i needed a tool that would constantly take snapshots of my desktop every few minutes and save those snapshots in my home folder.&lt;br /&gt;&lt;/p&gt;I thought long about doing this, without support from external applications and using only those that were native to gnome. Unfortunately, that didn't work out too well, simply because the snapshot tool in gnome captures the image and pops up a save dialog box with a preview of the snapshot taken. I didn't want to sit and record a macro as they don't always work too well.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;That's when the guys at google tossed out "imageMagick" a.k.a "import" at me. This is a utility that comes packaged with Ubuntu (i'm using 10.04 LTS). And it works purely off the command line without any confirmations or dialogs. Here's a sample of how its used:&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;code&gt;&lt;strong&gt;shell$ import -window root some_filename.png&lt;/strong&gt;&lt;/code&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;This saves the image "some_filename.png" into the current working directory. Its really compact and works inline at the shell. The next thing I wanted to do was to minimize all the applications (CTRL + ALT + D, show the desktop basically) before the snapshot was taken and restore them after my work was done. This is where I feel the .NET framework's SendKeys("keys") makes so much sense. You can use that to send any key combination to the OS. Unfortunately, none of that was available to me on Ubuntu, so I found another command line utility (a really really neat one at that!) called "wmctrl". It can be used for a variety of tasks, and here's how it can be used for minimizing and maximizing all windows:&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;code&gt;&lt;strong&gt;shell$ wmctrl -k on #minimize all windows to show desktop&lt;/strong&gt;&lt;/code&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;code&gt;&lt;strong&gt;shell$ wmctrl -k off #maximize all windows&lt;/strong&gt;&lt;/code&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;Finally, combining the two, I came up with a small python script, that allowed me to take snapshots of my desktop at regular intervals. The interval, in minutes, can also be specified at the shell. Here's &lt;a href="http://jumbofiles.com/iuebntbbfyoc"&gt;the script&lt;/a&gt;.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre&gt;&lt;filename&gt;&lt;filename&gt;&lt;br /&gt;&lt;/filename&gt;&lt;/filename&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-1608427824431958253?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1608427824431958253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/ive-been-working-application-will-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1608427824431958253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1608427824431958253'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/ive-been-working-application-will-be.html' title='Taking periodic snapshots of your Ubuntu Desktop'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-768071502696545464</id><published>2010-07-20T14:52:00.004+05:30</published><updated>2010-09-04T14:25:09.428+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='logger in python'/><title type='text'>Small program "logger" module in Python</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt; I was sitting around and a thought crossed my mind, "How can I get the function name of a function that the trace is in?". I thought about it for a few minutes, and said to myself, "The stack must know". But how do I read the function names of the stack in Python??&lt;br /&gt;For all these system level hacks, usually the sys module has something to offer, and this case was no exception. Here's how you can do it (using something called a "frame object"): &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;print sys._getframe().f_code.co_name&lt;/code&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; Another useful modification of the snippet above can give us the name of the function that is calling the current function. This is how it looks: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;print sys._getframe(1).f_code.co_name&lt;/code&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; So as you saw, the argument of sys._getFrame() can take you up or down the stack as your need may be. This utility of the sys module is extremely useful while logging for errors. Almost every good programmer uses some kind of logging in his code. So far most of my logging was using independant file writes or console writes. With my newfound knowledge, all that was going to change, so I wrote myself a small, yet handy logger for my forthcoming projects. Here's &lt;a href="http://jumbofiles.com/qo6kerpv1sbk"&gt;the script.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I integrated this into one of the apps I was making and well, it was simply fantastic. Now I just piped out the log messages to this module and it would automatically determine which function was sending the messages. I wrote an app with a GUI in PyQt4, and as will all GUI apps, tracking events of widgets is extremely important in figuring out what went wrong during debugging. This is what the output of my new logger looked like:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:32:53 2010: &amp;lt;loadAppData()&amp;gt; Trying to load application data&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:32:53 2010: &amp;lt;loadAppData()&amp;gt; Values picked up from appdata file. Interval:43; Dirs:[]&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:32:53 2010: &amp;lt;loadAppData()&amp;gt; Application data loaded successfully&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:32:56 2010: &amp;lt;btnAdd_Click()&amp;gt; Add button clicked&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:12 2010: &amp;lt;saveAppData()&amp;gt; Trying to save application data&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:12 2010: &amp;lt;saveAppData()&amp;gt; Application data saved successfully!&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:26 2010: &amp;lt;trayIcon_Click()&amp;gt; Tray icon clicked. Current visible status:True&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:26 2010: &amp;lt;trayIcon_Click()&amp;gt; Tray icon event complete. Current visible status:False&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:30 2010: &amp;lt;trayIcon_Click()&amp;gt; Tray icon clicked. Current visible status:False&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:30 2010: &amp;lt;trayIcon_Click()&amp;gt; Tray icon event complete. Current visible status:True&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:35 2010: &amp;lt;closeEvent()&amp;gt; Form close event raised&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:35 2010: &amp;lt;saveAppData()&amp;gt; Trying to save application data&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:35 2010: &amp;lt;saveAppData()&amp;gt; Application data saved successfully!&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Tue Jul 20 12:33:35 2010: &amp;lt;closeEvent()&amp;gt; Program is exiting.&lt;/code&gt;&lt;br /&gt;This is so neat :D&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/tracker/8652019172422577813-768071502696545464?l=baniyakiduniya.blogspot.com" height="1" width="1" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-768071502696545464?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/768071502696545464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/small-program-module-in-python.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/768071502696545464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/768071502696545464'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/small-program-module-in-python.html' title='Small program &amp;quot;logger&amp;quot; module in Python'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-7941898234126234215</id><published>2010-07-12T14:14:00.002+05:30</published><updated>2010-07-28T15:48:35.725+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wii remote'/><category scheme='http://www.blogger.com/atom/ns#' term='remote control for pc'/><category scheme='http://www.blogger.com/atom/ns#' term='wii hacks'/><title type='text'>Remote control your PC using a Wii remote</title><content type='html'>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;I’ve been tripping on the Wii lately, and another application that I cooked up over the last couple of days was something I like to call “WiiCONTROL”. Its an application that allows me to control navigation on Windows 7 using the Nintendo Wii remote.&lt;/p&gt;  &lt;p&gt;I have built my app on top of Brian Peek’s Wiimote library. I hope you’re reading this Brian :D&lt;/p&gt;  &lt;p&gt;The need for the application arose while I was watching a movie a night ago, and I realized that using a wireless keyboard while lying in the comfort of my bed was rather annoying. I needed something that didn’t take much space and was “like a remote”. Lying next to my computer was the Wiimote I’ve been using off late.&lt;/p&gt;  &lt;p&gt;The application took me nearly a day to make. The major portion of the app was figuring out how the navigation on windows could work solely through keyboard events and then tying them up to the button press events generated by the Wiimote.&lt;/p&gt;  &lt;p&gt;Here’s what it looks like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_itfBLP0qW6o/TDrV3rDz3gI/AAAAAAAAAIU/vdH4g4AXGIQ/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border: 0px none; display: inline;" title="image" alt="image" src="http://lh3.ggpht.com/_itfBLP0qW6o/TDrV6ZT79YI/AAAAAAAAAIY/LpejqC5AUBs/image_thumb%5B1%5D.png?imgmax=800" height="378" width="438" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can clearly see which functions are tied up to which buttons and the battery indicator gives you a rough idea about how much juice you have left in your remote. The experience counter may be used to control how responsive (key de-bouncing is such a pain!) your remote should be. The preset value works really well for me. The box titled “function” can be used to check which key corresponds to which function. You push a button and it shows up on that box. &lt;/p&gt;  &lt;p&gt;Here’s my personal favorite. When you click “test feedback”, the app sends a signal back to your remote causing it to vibrate momentarily :D confirming a closed loop between your PC and your remote.&lt;/p&gt;  &lt;p&gt;The app iconizes to your system tray and can be brought back to focus by double clicking the “YODA” icon (heehee!!!) therein.&lt;/p&gt;  &lt;p&gt;Whats cooler, is that if you use VLC player, you can use the same remote to Play/Pause/FF/Rewind/Control Volume.&lt;/p&gt;  &lt;p&gt;Here’s a video I made last night of me using the app on my home computer. Its a bit fuzzy thanks to the compression, but you can see what the deal is all about.&lt;/p&gt;  &lt;div style="padding: 0px; margin: 0px; display: inline; float: none;" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:1e0ffc14-cf85-4989-adf5-03b081ac3f14" class="wlWriterEditableSmartContent"&gt;&lt;div id="45bccc53-968c-49e6-b156-c31025cc7619" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=_B_MbtJK8QY" target="_new"&gt;&lt;img src="http://lh3.ggpht.com/_itfBLP0qW6o/TDrV8FEgGzI/AAAAAAAAAIc/2emeL7ysad8/video7f169a000d19%5B3%5D.jpg?imgmax=800" style="border-style: none;" galleryimg="no" onload="var downlevelDiv = document.getElementById('45bccc53-968c-49e6-b156-c31025cc7619'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/_B_MbtJK8QY&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/_B_MbtJK8QY&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Go to my &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;projects page&lt;/a&gt; to download the app. Please note that you have to hook up your Wiimote to your PC before starting the app. If the Wii is not found, it will simply notify you and exit. For a tutorial on how to connect your Wiimote to your Windows PC, go &lt;a href="http://www.youtube.com/watch?v=4_pQSGYzfKU"&gt;here&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/8652019172422577813-7941898234126234215?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/7941898234126234215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/remote-control-your-pc-using-wii-remote.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7941898234126234215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7941898234126234215'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/07/remote-control-your-pc-using-wii-remote.html' title='Remote control your PC using a Wii remote'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_itfBLP0qW6o/TDrV6ZT79YI/AAAAAAAAAIY/LpejqC5AUBs/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-5281287994336864818</id><published>2010-06-25T15:50:00.003+05:30</published><updated>2010-07-28T15:50:38.813+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='convert to touchscreen'/><category scheme='http://www.blogger.com/atom/ns#' term='convert to tablet'/><category scheme='http://www.blogger.com/atom/ns#' term='wii hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='cheap tablet'/><title type='text'>Scribbling and drawing on your computer's desktop</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;This is a follow up to my previous post, where in, I demonstrated the use of Johnny Lee's application to manipulate any display or surface using an IR stylus. Since Lee's application was open source, I decided to extend that application and add a few features that presenters and educationists might find extremely useful. These features help increase the usability of the app by allowing the user to annotate on anything on his desktop.&lt;br /&gt;&lt;br /&gt;Educationists might find the "Black board" feature extremely useful as it allows them to blank out the screen and draw and erase on it in multiple colors. The snapshot feature allows you to share your annotations in the form of images that you could create using any simple app like Microsoft Paint. My goal is to make this application feature rich and convenient to use. I need your help in understanding what you'd like to do with this application. If your suggestions are practical and feasible, you might find them in final release of the application and your name in the credits :-)&lt;br /&gt;&lt;br /&gt;I have made a small video highlighting what the current feature set can allow users to do. Check it out and comment or mail me about what you think. If you like this app, then spread the word and let your friends know as well. This effort is made in a bid to dissuade users from using commercial applications which essentially work on the same technology at their core, but insist on a payment of around $35-$40. Great technology is one that is easy to use and that is easily available. I don't believe something so simple and so much fun should have a price tag on it. Help me in my endeavor to expand the scope of this application!&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://www.youtube.com/watch?v=OaIxqcfP5Vw" target="_blank"&gt;link to the video&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/OaIxqcfP5Vw&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/OaIxqcfP5Vw&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="385" width="480"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-5281287994336864818?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/5281287994336864818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/06/scribbling-and-drawing-on-your-computer.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5281287994336864818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/5281287994336864818'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/06/scribbling-and-drawing-on-your-computer.html' title='Scribbling and drawing on your computer&amp;#39;s desktop'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-7624771362273105331</id><published>2010-05-23T17:21:00.003+05:30</published><updated>2010-05-24T22:49:25.028+05:30</updated><title type='text'>Make any display a Tablet... for under 40 Dollars!!!</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;So yesterday, I was browsing around the web looking for Human Machine Interfaces, and I chanced upon Johnny Lee. The creator of a simple, yet powerful tool that allows you to use a Wii remote and a home-made IR pen, to create a tablet like (stylus sensitive) display out of any thing from a computer screen to a wall or any other surface that is capable of acting as a screen.   &lt;br /&gt;    &lt;br /&gt;The hack is brilliant and Lee has gone a step ahead to build up a few crazy applications based on Wii's motion sensing technology.    &lt;br /&gt;    &lt;br /&gt;Here's my video on how my Compaq CQ45 transformed into a tablet. After a preliminary run, I modified my IR stylus for more power and distance and started playing around with CAD. The experience is simply unlike anything I’ve used before. A little more development, and this could potentially change the way designers work. &lt;/div&gt;  &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;My IR stylus allows more current flow through the LED (within tolerance limits), allowing me to perform, what I call a “grab” and “drop”. It lets me grab an object on screen and move it around from nearly a foot away. Almost felt like waving a magic wand!&lt;/div&gt;  &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Here’s a video I made while testing out my latest mod to Lee’s electronic whiteboard system.&lt;/div&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:fbe246f1-b346-468b-a679-b2ea297e889c" class="wlWriterEditableSmartContent"&gt;&lt;div id="eed36f1e-0bb9-4d19-b57d-a31660634f1b" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=kfI3l5hK6Vk" target="_new"&gt;&lt;img src="http://lh5.ggpht.com/_itfBLP0qW6o/S_q1G8knI1I/AAAAAAAAAHo/MBK8Dlshfwg/videodaec0163fdbe%5B3%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('eed36f1e-0bb9-4d19-b57d-a31660634f1b'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/kfI3l5hK6Vk&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/kfI3l5hK6Vk&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;   &lt;br /&gt;    &lt;br /&gt;This has already taken the world of electronic whiteboards and projection systems by storm. What's more, is that it costs you nothing but a remote and under a buck to make the IR Pen (if you can cook it up on your own, else commercial products are also available). Visit &lt;a href="http://www.johnnylee.net/" target="_blank"&gt;Johnny Lee's site&lt;/a&gt; for more info.    &lt;br /&gt;    &lt;br /&gt;There is surely going to be a lot more “Wii” in my forthcoming projects!&lt;/div&gt;  &lt;div class="zemanta-pixie" xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=2ef78b17-ac34-86e2-96ca-6b12b65a0306" /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-7624771362273105331?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/7624771362273105331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/make-any-display-tablet-for-under-40.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7624771362273105331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7624771362273105331'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/make-any-display-tablet-for-under-40.html' title='Make any display a Tablet... for under 40 Dollars!!!'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_itfBLP0qW6o/S_q1G8knI1I/AAAAAAAAAHo/MBK8Dlshfwg/s72-c/videodaec0163fdbe%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-4453325317721646897</id><published>2010-05-22T02:20:00.001+05:30</published><updated>2010-05-22T02:20:33.075+05:30</updated><title type='text'>Feeding password to sudo over command line</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;I'm sure all linux users (ubuntu) have had a day when the security features of the OS, just seemed a tad more annoying than ever before. Specially when you have to put your password into sudo for every menial task. Or perhaps all you wanted to do was install a package using apt-get and didn't care to press "Y" in front of every question that followed.&lt;/p&gt;Here's something you can do to minimize user intervention after you press the enter key in order to execute a command. To feed your password to sudo, use the following construct:&lt;br/&gt;&lt;p&gt;&lt;code&gt;user-laptop$ echo &amp;lt;&lt;/code&gt;&lt;span style='color: rgb(0, 0, 192);'&gt;&lt;code&gt;&lt;strong&gt;password&lt;/strong&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; | sudo &lt;/code&gt;&lt;span style='color: rgb(255, 0, 0);'&gt;&lt;code&gt;&lt;strong&gt;-S&lt;/strong&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt; apt-get install blogilo&lt;/code&gt;&lt;/p&gt;Using the -S switch allows you to feed the password through a pipe using echo over the command line. In order to skip the crazy prompts for apt-get, use the following construct:&lt;br/&gt;&lt;p&gt;&lt;code&gt;user-laptop$ sudo apt-get &lt;/code&gt;&lt;span style='color: rgb(255, 0, 0);'&gt;&lt;code&gt;&lt;strong&gt;-y&lt;/strong&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt; install blogilo&lt;/code&gt;&lt;/p&gt;Here's something that combines the two:&lt;code&gt;user-laptop$ echo &lt;/code&gt;&lt;code&gt;&lt;strong&gt;&amp;lt;password&amp;gt;&lt;/strong&gt;&lt;/code&gt;&lt;code&gt; | sudo &lt;/code&gt;&lt;code&gt;&lt;strong&gt;-S&lt;/strong&gt;&lt;/code&gt;&lt;code&gt; apt-get &lt;/code&gt;&lt;code&gt;&lt;strong&gt;-y&lt;/strong&gt;&lt;/code&gt;&lt;code&gt; install blogilo&lt;/code&gt;&lt;br/&gt;&lt;p&gt;P.S.:&lt;/p&gt;This is my first post using "Blogilo". Just moved to Kubuntu (KDE4 for ubuntu. Download the &lt;em&gt;kubuntu-kde4-desktop&lt;/em&gt; package if you're on v10.04). Loving the new UI and the cool desktop effects. Konsole (the default terminal for KDE, sucks... no transparency!) has still miles to go before i leave gnome-terminal. Empathy and Gnome-terminal are the only GNOME apps that I'm still hung over. The rest is good. Desktop effects is really the area where KDE takes the cake. You can toggle between desktop effects based on your power options too. So if you're running on battery power, you may wanna keep these effects to the minimum, and turn them back on when you're plugged into a power socket. You can have as many desktop workspaces as you want, and toggle between them using a mouse or keyboard. Miss the simplicity of GNOME, but for now, KDE is gonna stay :D !!&lt;br/&gt;&lt;br/&gt;Check out the video below, to get a glimpse of KDE has to offer. This is just the tip of the iceberg.&lt;br/&gt;&lt;br/&gt;&lt;p/&gt;&lt;div class='youtube-video'&gt;&lt;object width='425' height='355'&gt;&lt;param value='http://www.youtube.com/v/4jfDbt0-9Sg&amp;amp;feature=youtube_gdata' name='movie'&gt; &lt;/param&gt;&lt;param value='transparent' name='wmode'&gt; &lt;/param&gt;&lt;embed width='425' height='355' wmode='transparent' type='application/x-shockwave-flash' src='http://www.youtube.com/v/4jfDbt0-9Sg&amp;amp;feature=youtube_gdata'&gt; &lt;/embed&gt; &lt;/object&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;KDE 4.3 desktop effects&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-4453325317721646897?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/4453325317721646897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/feeding-password-to-sudo-over-command.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4453325317721646897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/4453325317721646897'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/feeding-password-to-sudo-over-command.html' title='Feeding password to sudo over command line'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-7280921372554946945</id><published>2010-05-16T11:45:00.003+05:30</published><updated>2010-05-16T12:19:59.631+05:30</updated><title type='text'>FireUploader - Mass Media Uploader for Ubuntu</title><content type='html'>I've been using Ubuntu for a long time and its evolution over time has been a thing of beauty. The latest version (10.04) is the best Ubuntu so far. It combines great look and feel with the stability and security of Linux. Canonical has worked hard at addressing the various issues and incompatibilities users around the world faced with the release of 9.10. I remember how I could never wake up from a hibernation as my keyboard and mouse would be rendered useless. Power consumption was another sore point, which has been improved in the latest release. Clearly, their proactive attitude has put Ubuntu on the path to becoming a household name among people who don't want to pay an exorbitant licensing fee, recover from system crashes or never be able to figure out which anti-virus to use for Big Brother's Windows.&lt;br /&gt;&lt;br /&gt;The only drawback (arguably!), I feel, is the lack of support for non commercial applications. Windows, being the most popular operating system, is preferred by a major chunk of software developers and companies (specially based in Asia) as a target OS. Even companies like Google, who pioneered the integration of mankind and hyperspace, have now begun to turn their back on Ubuntu (Google video and voice!!!! SCREEEECH!!!). A lot of software and plugins for existing software, unfortunately never make it beyond Mac OS and Windows. Mass uploading of media onto various file sharing and microblogging sites is yet another grey area, with little to help the world's most popular free OS.&lt;br /&gt;&lt;br /&gt;Uploading content to Facebook (pictures and videos) and Flickr was rather tideous. With Adobe's Flash Plugin adding insult to injury, one was restricted to using the basic uploading utilities which needed constant monitoring and were rather unsuccessful on many an occasion. I, personally, have faced so much trouble posting pictures onto Facebook using the basic uploader that I had given up taking pictures all together. While third party plugins were being released for Picasa, on Windows, allowing users to export their entire library or parts of it onto facebook and flickr, all I could do, was be patient or make unsuccessful attempts to "wine" these applications.&lt;br /&gt;&lt;br /&gt;Alas, Mozilla stepped up with FireUploader. An add on that allows users on all platforms (windows or linux) to upload their media content onto a multitude of social networking and file sharing sites.&lt;br /&gt;&lt;br /&gt;Its extremely easy to use and authorize. It's UI is simple and elegant and it has an upload manager that allows you to pause and resume your uploads as and when necessary. Here's what it looks like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_itfBLP0qW6o/S--SR1qOtRI/AAAAAAAAAHg/XX7C0wBqU20/s1600/fireuploader.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 198px;" src="http://3.bp.blogspot.com/_itfBLP0qW6o/S--SR1qOtRI/AAAAAAAAAHg/XX7C0wBqU20/s320/fireuploader.png" alt="" id="BLOGGER_PHOTO_ID_5471752907438077202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This add on, along with Download Helper and Yoonoo are among the most popular plugins for Firefox. I recommend users on Windows and Linux alike to give this a try. It definitely gets my vote!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-7280921372554946945?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/7280921372554946945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/fireuploader-mass-media-uploader-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7280921372554946945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7280921372554946945'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/fireuploader-mass-media-uploader-for.html' title='FireUploader - Mass Media Uploader for Ubuntu'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_itfBLP0qW6o/S--SR1qOtRI/AAAAAAAAAHg/XX7C0wBqU20/s72-c/fireuploader.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-8588207368801543895</id><published>2010-05-14T05:07:00.004+05:30</published><updated>2010-07-28T15:51:25.654+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='organize music'/><category scheme='http://www.blogger.com/atom/ns#' term='batch rename'/><category scheme='http://www.blogger.com/atom/ns#' term='rename music'/><category scheme='http://www.blogger.com/atom/ns#' term='pyqt'/><title type='text'>Appellation - Smart renaming for your music files</title><content type='html'>A while back I had posted a little command line tool called "Appellation", that would essentially help you rename your music files from meaningless default names (e.g. track 1 etc.) to more appropriate ones with artist and song title in the filename (e.g. JayZ-Empire State of mind.mp3). &lt;br /&gt;&lt;br /&gt;&lt;a href="http://baniyakiduniya.blogspot.com/2010/04/appellation-smart-rename-utility-for.html"&gt;Here&lt;/a&gt; is the link to that post. &lt;br /&gt;&lt;br /&gt;This may not seem all that useful, but greatly improves locatability and file system indexing, yielding to faster results during a search of your hard drive. It also creates a more visually appealing structure to your music and allows you to store all your music files in one big folder without worrying about organising it through a buch of sub folders. &lt;br /&gt;I was sitting around with a little itch that I simply had to scratch. I had to create a simple GUI for this utility. God knows console applications can be speedy but look worse than a 500 pounder without his underpants. &lt;br /&gt;&lt;br /&gt;As usual, the GUI is in PyQt4. So in order to run this application, you'll need to have this toolkit installed along with Python 2.6 or higher. This application should work on both Windows and Linux without much difficulty provided all the dependancies are met. &lt;br /&gt;&lt;br /&gt;Here's a screenshot of what the application looks like: &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_itfBLP0qW6o/S-yQFSoxdgI/AAAAAAAAAHY/ZUEVamXH1QU/s1600/Screenshot-Appellation.png"&gt;&lt;img style="text-align: center; margin: 0px auto 10px; width: 200px; display: block; height: 172px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5470906067924907522" alt="" src="http://1.bp.blogspot.com/_itfBLP0qW6o/S-yQFSoxdgI/AAAAAAAAAHY/ZUEVamXH1QU/s200/Screenshot-Appellation.png" border="0" /&gt;&lt;/a&gt; &lt;br /&gt;You can go to my projects page to &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;download&lt;/a&gt; the source code for this application (look for "appellation"). The application scans through an entire directory recursively, searching for music files and trying to extract the artist and song names from the ID3 tag present in the file. If the ID3 tag present is not the latest version, it may not be read properly. Backward compatibility with older versions of the tag are not supported. Perhaps that is something I can toss out in the next version of this application. &lt;br /&gt;&lt;br /&gt;The UI is fairly simple. Select the directory to search for music files using the Browse button. Click 'Start Renaming Music Files' to start the search and renaming process. At any time if you feel like stopping the search, click the small button marked 'X' near the progress bar, both of which come alive when the search is commenced. The summary of operations is displayed in the text browser widget and a total count of failures and files parsed is also displayed. &lt;br /&gt;&lt;br /&gt;Good app to kick off your appetite on PyQt4. Hope you enjoy the app!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-8588207368801543895?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/8588207368801543895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/appellation-smart-renaming-for-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/8588207368801543895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/8588207368801543895'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/05/appellation-smart-renaming-for-your.html' title='Appellation - Smart renaming for your music files'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_itfBLP0qW6o/S-yQFSoxdgI/AAAAAAAAAHY/ZUEVamXH1QU/s72-c/Screenshot-Appellation.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1915253434814894123</id><published>2010-04-13T15:17:00.001+05:30</published><updated>2010-04-13T15:17:16.217+05:30</updated><title type='text'>Review: Traffic Shaper for Windows (Freeware for limiting bandwidth usage)</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I was recently at the office blitzing a download for Visual Basic 2008 express on the High speed DSL line. Suddenly the folks around me started grimacing and cursing their computers in unison. I realized that my download was putting a lot of work on hold, and so I was forced to close it and wait for a more opportune time. &lt;/p&gt;  &lt;p&gt;Whenever I’m in a situation like this, I start thinking about code. That makes me wonder if there was a way to control the traffic on every workstation in the network. I was quite sure that there would be many applications available to professional network administrators to aid in the task at hand. Making one from scratch would be a worthwhile waste of time :D But I had way too much work to sit and break my head over this right now. So a ready made solution it had to be…!&lt;/p&gt;  &lt;p&gt;A few Google searches later I stumbled upon “Traffic Shaper XP” (click &lt;a href="http://bandwidthcontroller.com/trafficShaperXp.html"&gt;here&lt;/a&gt; to download). This is what it looks like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_itfBLP0qW6o/S8Q9OaQF-YI/AAAAAAAAAHI/Q1ELSfIw-x4/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_itfBLP0qW6o/S8Q9dioisSI/AAAAAAAAAHM/YxB6X0l1zM4/image_thumb%5B2%5D.png?imgmax=800" width="626" height="403" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_itfBLP0qW6o/S8Q9hg1-7XI/AAAAAAAAAHQ/ebxxUVQyMHI/s1600-h/image%5B9%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_itfBLP0qW6o/S8Q9oHHquII/AAAAAAAAAHU/-GlwA1HqqVU/image_thumb%5B5%5D.png?imgmax=800" width="628" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To start checking your bandwidth, simply go to View&amp;gt; Options &amp;gt; Internet. Here choose a bandwidth limit for uploads and downloads from this computer. That’s all there is to it. Just be careful, as the settings you choose are in kiloBITS per second. So divide the number by 8 to get the limit value in kiloBYTES per second. I set my download limit to 512 kbits/sec allowing me upto 64 kBytes/sec. This download limit is now shared between all the active downloads on my computer.&lt;/p&gt;  &lt;p&gt;So all you downloaders out there, download with ethics. “Surf and let surf”. Cheers!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-1915253434814894123?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1915253434814894123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/review-traffic-shaper-for-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1915253434814894123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1915253434814894123'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/review-traffic-shaper-for-windows.html' title='Review: Traffic Shaper for Windows (Freeware for limiting bandwidth usage)'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_itfBLP0qW6o/S8Q9dioisSI/AAAAAAAAAHM/YxB6X0l1zM4/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-8101388009402218521</id><published>2010-04-13T00:51:00.002+05:30</published><updated>2010-09-04T14:34:01.110+05:30</updated><title type='text'>Appellation - Smart rename utility for your music (Core Python)</title><content type='html'>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;Haven’t you always wished that your music was well organized but were too lazy to do it yourself. Here is an app that addresses the first step towards organizing your music collection viz. “Nomenclature”. Personally, I have always preferred my music files to be saved on disk in “&amp;lt;artist name&amp;gt;-&amp;lt;song title&amp;gt;” format. &lt;/p&gt;  &lt;p&gt;Recently I had written a post on extracting ID3 tags from music files (read it &lt;a href="http://baniyakiduniya.blogspot.com/2010/03/how-to-extracting-id3-tags-from-mp3-or.html"&gt;here&lt;/a&gt;). I decided to extend that module and create an application which could be used to rename all my music files in the format mentioned above. The application would simply accept the path of destination directory and recursively search it for music files. If the ID3 tags present in the file are the latest version, the renaming process would occur without much difficulty. However, if the version of ID3 tags is very old, the process might not occur, leaving the filename unaltered. Another case of failure is when the artist information is not present in the file (No frame id TPE1 found… the app won’t look for anything else as the performer name!)&lt;/p&gt;  &lt;p&gt;I was too lazy to create a GUI… so you are most likely to see a console when you run this app. But fear not, there is little you have to do. Simply copy and paste the path of the destination directory into the console and press enter. The progress of the entire operation is displayed on the console itself.&lt;/p&gt;  &lt;p&gt;You can download the application from my projects page (click &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;here&lt;/a&gt;). Look for a file “appellation.rar”. Simply extract the files into a folder and run the launcher script “run.py” using python. &lt;/p&gt;  &lt;p&gt;The app is open source, so feel free to browse through the meagre amount of code. Perhaps if you feel like extending the app, you can drop me a line. Someone please make a UI if possible. I’m too bummed out with GUI for the moment to make this any better than its current (and ugly) form :)&lt;/p&gt;  &lt;p&gt;I ran this on my collection and got pretty decent results. The summary towards the end of the program displayed a sum total of 20 files (out of 16 GiB of music) that had failed. Hopefully you have similar or better results.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-8101388009402218521?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/8101388009402218521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/appellation-smart-rename-utility-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/8101388009402218521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/8101388009402218521'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/appellation-smart-rename-utility-for.html' title='Appellation - Smart rename utility for your music (Core Python)'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-7425650874475290237</id><published>2010-04-04T17:33:00.011+05:30</published><updated>2010-07-28T15:52:16.038+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='python temperature'/><category scheme='http://www.blogger.com/atom/ns#' term='temperature monitor'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu temperature'/><title type='text'>How To: PyQt4 - Temperature Monitor with Google Charts support for Ubuntu 9.10</title><content type='html'>I was recently using various system monitors on my Ubuntu 9.10, the most popular being "System Monitor" (the default gnome application for this purpose), and I realised that neither of these utilities presented any information about the CPU core temperature. &lt;br /&gt;&lt;br /&gt;Perhaps its not such a big requirement, but I'd really like to know how hot my CPU core gets under different load conditions. For instance, when I run a massive search on my filesystem, I find my laptop getting a little warmer (a little too warm sometimes!!). The CPU core will always be at a higher temperature than the body/ambient environment since it's always at work. The operating range of most CPUs is between 55 to 85 degree centigrade. So if the ambient temperature (temperature of the body) seems to have risen by a small margin, there is a good chance that the increase is considerable inside your core. &lt;br /&gt;&lt;br /&gt;So I decide to compliment the existing utilities by making an application of my own - TempMon. I decided to use PyQt4 for my application as its easy to use and fits perfectly with Python, my language of choice. Before I began, I penned down the goals for this application. Here they are: &lt;br /&gt;&lt;span style="font-size:85%;"&gt;  &lt;br /&gt;&lt;/span&gt;  &lt;ul&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;The application must display the core temperature of the CPU at all times&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;The application must also display the average CPU load (a.k.a CPU Usage). This is usually represented as a percentage by many system monitors. Since I have a dual core 64 bit AMD at the heart of my motherboard, I will compute the "AVERAGE" cpu load. Gnome's system monitor provides individual load percentages for each core&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;The application must allow me to trigger an alert/alarm if the core temperature exceeds a particular threshold value that can be user defined&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;The application must be dockable to the taskbar or system tray      &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;Finally, all the data assimilated (temperature and usage i&lt;/span&gt;&lt;span style="font-size:85%;"&gt;nfo) over a certain period of time must be displayed using a plotter or a graph&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; Firstly, its important to understand your data source for this application. Where does the application get the temperature and CPU usage data from? On Linux, this information is available on the local filesystem on the following files: &lt;br /&gt;&lt;span style="font-size:85%;"&gt;  &lt;br /&gt;&lt;/span&gt;  &lt;ul&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;'/proc/acpi/thermal_zone/TZ01/temperature'&lt;/span&gt; contains a string that contains the immediate value of the temperature. In fact, this file has only one line that says "temperature: 64 C". Makes my life a lot easier :)&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;'/proc/stat'&lt;/span&gt; contains the information about CPU usage. There is a lot of information available on this file and not all of it is relevant to our need. The first line is all we need. It lo&lt;/span&gt;&lt;span style="font-size:85%;"&gt;oks something like 'cpu &lt;span style="font-weight: bold;"&gt;936808 309 246585 14286660&lt;/span&gt; 39745 3447 13778 0 0'. Only the values in bold digits are important to us.       &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;So how do we calculate the CPU usage? Its rather simple. In the above example, consider the four numbers (in bold). Let them be u1, s1, t1 and i1. At another time (usually on a successive read of this file), let the values for the same numbers be u2, s2, t2 and i2. Now we will calculate two quantities (since we need a ratio for a percentage): usage(U) and total usage(T). The ration of these two values multiplied by 100 will be the percentage of CPU usage&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="font-size:85%;"&gt;U = (u2-u1)+(s2-s1)+(t2-t1); T = U + (i2 - i1); CPU Usage = (U/T) x 100 %      &lt;br /&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; I quickly opened up Qt Designer, and a few clicks later, the GUI was ready. Small and compact but very informative. Here's what the UI looked like: &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_itfBLP0qW6o/S7iHjPQ9_yI/AAAAAAAAAHA/woYokUhVC3g/s1600/Screenshot-TempMon.png"&gt;&lt;img style="text-align: center; margin: 0px auto 10px; width: 171px; display: block; height: 195px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5456259988022230818" alt="" src="http://4.bp.blogspot.com/_itfBLP0qW6o/S7iHjPQ9_yI/AAAAAAAAAHA/woYokUhVC3g/s320/Screenshot-TempMon.png" border="0" /&gt;&lt;/a&gt; &lt;br /&gt;Two labels that displayed the temperature and usage percentage, one spin box to set the threshold value for temperature, a checkbox and a push button. Thats pretty much it. Once I was done, I saved the file as "fontend.ui" and subsequently converted the GUI into a python source file using pyuic4: &lt;br /&gt;&lt;br /&gt; &lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;shell$pyuic4 frontend.ui &amp;gt; frontend.py&lt;/span&gt;   &lt;br /&gt;&lt;/div&gt; &lt;br /&gt; &lt;div style="text-align: left;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;A file "frontend.py" is generated and contains a class for this dialog. That class has a method called &lt;span style="font-family:courier new;"&gt;setupUi&lt;/span&gt; that draws the form shown above. Now, I'm ready to start coding the core of the app. I create another file called "tempmonitor.py". You can download the entire source code from &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;here&lt;/a&gt; (Look for a file labelled "Temperature Monitor").   &lt;br /&gt;  &lt;br /&gt;In the init routine of the main class of "tempmonitor.py", I created a system tray icon object:   &lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;    &lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;self.trayIcon = QtGui.QSystemTrayIcon(QtGui.QIcon("trayicon.png"),self)&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;   &lt;br /&gt;Following which I connected this tray icon to a slot where in I toggled the form's visibility:   &lt;br /&gt;  &lt;br /&gt;   &lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;self.connect(self.trayIcon,SIGNAL("activated(QSystemTrayIcon::ActivationReason)"),self.toggleVisibility)&lt;/span&gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;     &lt;div style="text-align: left;"&gt;&lt;span style="font-size:100%;"&gt;This creates a system tray icon, which allows me to show/hide the form by simply clicking it. The &lt;span style="font-family:courier new;"&gt;self.toggleVisibility&lt;/span&gt; routine simply changes the visibility status of the form to the opposite of its current state.         &lt;br /&gt;        &lt;br /&gt;Next up, its time to write the actual tasks of polling the temperature and usage values from the respective files. That is done using &lt;span style="font-family:courier new;"&gt;self.getTemp&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;self.getCpuUsage&lt;/span&gt; methods. Both these methods read the respective files (mentioned above), and process the data within to create two strings, one for temperature and another for CPU usage. Once all the hard work is done, each of these methods, emits a custom signal viz. "tempUpdate" and "cpuUpdate" respectively.         &lt;br /&gt;        &lt;br /&gt;These signals are very important. Since these routines do the "heavy work", its only natural to run them as a thread in the background (in order to prevent the GUI event loop from being interrupted). Now if they're going to run as concurrent children threads, directly providing them with access to the widgets on the form is risky business. Signals help us solve this problem. The background threads emit signals which the parent thread (GUI event loop) comes to know about. Each of these signals is tied to a slot (a method basically, that allows us the parent thread to "do" something when it discovers the signal). The following statements help redirect these signals to their respective slots.         &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;        &lt;div style="text-align: center;"&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;self.connect(self,SIGNAL("tempUpdate"),self.tempUpdate)&lt;/span&gt; &lt;span style=";font-family:courier new;font-size:100%;"  &gt;self.connect(self,SIGNAL("cpuUpdate"),self.cpuUpdate)&lt;/span&gt;         &lt;br /&gt;        &lt;br /&gt;         &lt;div style="text-align: left;"&gt;Now these slots are tied up to the &lt;span style="font-family:courier new;"&gt;self.tempUpdate&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;self.cpuUdate&lt;/span&gt; slots respectively. These slots are simple methods of the class, which can now be used to update the text in the labels for temperature and CPU Usage.           &lt;br /&gt;          &lt;br /&gt;So the heavy work is done. Its time to actually spawn a thread that will run do all the heavy work. This thread must run until the parent thread dies (application is closed). I put up all the methods which I want to run, into a single routine called &lt;span style="font-family:courier new;"&gt;self.idleTime&lt;/span&gt;, which is now run in the background using the following statement:           &lt;br /&gt;          &lt;br /&gt;           &lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;thread.start_new_thread(self.idleTime,())&lt;/span&gt;             &lt;br /&gt;            &lt;br /&gt;             &lt;div style="text-align: left;"&gt;The empty parentheses indicate that no arguments are being passed to this routine. This routine periodically runs all the other methods which will read the temperature and usage data from the files, process this information and emit signals to indicate that their work is done. After every iteration of these methods, I put the thread to sleep for a couple of seconds (this allows for context switching, and since the data we read isn't changing drastically every moment, this resolution is pretty good).              &lt;br /&gt;              &lt;br /&gt;We're almost done, except for the last criterion that demands a graphical display of the assimilated data. If you notice, in the source for &lt;span style="font-family:courier new;"&gt;self.tempUpdate&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;self.cpuUpdate&lt;/span&gt; (slots for the signals we spoke about earlier), the values that are read are stored as tuples of (temperature, cpu percentage) in a list called data. This list is going to serve as our source of information when we plot the temperature and usage values graphically using &lt;a href="http://code.google.com/apis/charttools/index.html"&gt;Google Charts&lt;/a&gt;.               &lt;br /&gt;              &lt;br /&gt;The Google Charts API is really easy to use and the best part is that it works easily using simple GET requests. So all you really have to do is take all the data you want to plot and formulate a URL. That URL can be opened in a web browser and your chart is ready. As a hack I used the QWebView widget to dynamically generate the URL for the chart every few seconds, thereby giving the appearance of a real time graph/plot (just like system monitor does). Anyway, that is not part of this tutorial, so let's stay on point.               &lt;br /&gt;              &lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;self.getChartLink &lt;/span&gt;method generates the URL based on the values present in the list ''data". This routine is also added to the idle task routine. So now, the worker thread that runs in the background will read the temperature, the CPU usage and generate the URL for a graph based on the values stored in data. Since Google Charts API has a limit to how many points can be plotted in a single chart, I've restricted the plot to the last 200 values that were sampled. Currently I'm sampling the values at an interval of 2 seconds (sleep time for the worker thread), thereby giving myself a plot of the temperature and CPU usage over the last 400 seconds or roughly 6 minutes. Here is what the chart looks like:               &lt;br /&gt;              &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://chart.apis.google.com/chart?cht=lc&amp;amp;chxt=x,y&amp;amp;chxr=0,0,400,40&amp;amp;chs=1000x300&amp;amp;chd=t:60,60,60,60,59,59,59,60,60,60,60,59,60,60,61,61,61,60,60,60,60,59,60,60,60,60,60,60,60,59,59,59,59,59,60,59,59,59,59,62,62,62,60,61,61,60,60,60,62,63,63,62,61,63,63,61,61,61,65,61,65,65,64,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,60,60,61,60,60,60,60,60,60,61,60,60,60,60,60,60,60,60,60,62,61,61,60,60,60,60,62,61,61,60,60,60,60,61,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,59,60,60,60,60,60,60,60,60,60,60,60,62,62,62,63,63,63,61,61,61,62,61,61,61,61,61,61,62,61,61,61,63,63,62,62,62,62,66,62,62,62,62,62,66,62,62%7C10.0,11.4,8.1,5.5,6.3,5.1,8.8,7.8,10.2,8.8,7.1,32.6,6.7,6.4,12.9,11.2,12.1,8.3,9.0,9.2,5.2,12.3,12.0,8.9,17.5,12.7,10.7,9.0,10.1,6.2,8.0,10.0,8.1,6.7,9.3,10.1,6.1,11.3,13.5,21.6,17.5,12.6,20.0,27.8,20.4,14.9,12.8,28.0,34.3,40.2,32.2,13.0,6.6,11.2,10.0,22.9,16.1,16.3,40.8,9.8,19.7,18.1,25.5,16.0,13.2,16.7,13.8,8.8,26.6,9.5,16.7,16.2,6.9,5.0,6.4,10.9,13.8,7.6,6.9,9.2,12.3,8.6,22.9,24.6,8.9,16.4,19.4,10.6,13.5,14.5,7.4,10.1,7.9,6.4,6.0,7.7,10.4,6.9,11.8,11.8,6.7,8.5,8.4,7.2,10.0,5.3,8.9,6.0,16.6,16.3,13.7,10.8,7.3,9.1,13.9,15.7,25.2,14.7,8.4,6.4,8.2,8.6,10.6,11.8,7.3,26.8,20.0,11.0,9.9,8.1,11.0,9.1,7.0,8.9,5.2,6.4,6.2,7.8,7.2,10.2,11.3,12.7,8.8,7.3,9.5,6.0,6.0,7.0,7.4,6.0,6.0,8.7,5.5,8.6,17.4,9.2,7.9,12.5,17.6,18.9,20.3,6.7,15.4,19.3,22.2,27.5,31.0,53.1,21.3,23.4,30.9,13.3,15.0,19.5,26.7,16.2,11.0,12.8,12.8,15.9,18.2,25.4,10.8,13.9,14.0,25.0,19.4,14.7,25.5,17.3,48.5,38.3,16.2,20.0,11.7,21.1,12.9,45.8,21.9,20.1&amp;amp;chco=00ff00,0000ff"&gt;&lt;img style="text-align: center; margin: 0px auto 10px; width: 1000px; display: block; height: 300px; cursor: pointer;" alt="" src="http://chart.apis.google.com/chart?cht=lc&amp;amp;chxt=x,y&amp;amp;chxr=0,0,400,40&amp;amp;chs=1000x300&amp;amp;chd=t:60,60,60,60,59,59,59,60,60,60,60,59,60,60,61,61,61,60,60,60,60,59,60,60,60,60,60,60,60,59,59,59,59,59,60,59,59,59,59,62,62,62,60,61,61,60,60,60,62,63,63,62,61,63,63,61,61,61,65,61,65,65,64,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,60,60,61,60,60,60,60,60,60,61,60,60,60,60,60,60,60,60,60,62,61,61,60,60,60,60,62,61,61,60,60,60,60,61,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,59,60,60,60,60,60,60,60,60,60,60,60,62,62,62,63,63,63,61,61,61,62,61,61,61,61,61,61,62,61,61,61,63,63,62,62,62,62,66,62,62,62,62,62,66,62,62%7C10.0,11.4,8.1,5.5,6.3,5.1,8.8,7.8,10.2,8.8,7.1,32.6,6.7,6.4,12.9,11.2,12.1,8.3,9.0,9.2,5.2,12.3,12.0,8.9,17.5,12.7,10.7,9.0,10.1,6.2,8.0,10.0,8.1,6.7,9.3,10.1,6.1,11.3,13.5,21.6,17.5,12.6,20.0,27.8,20.4,14.9,12.8,28.0,34.3,40.2,32.2,13.0,6.6,11.2,10.0,22.9,16.1,16.3,40.8,9.8,19.7,18.1,25.5,16.0,13.2,16.7,13.8,8.8,26.6,9.5,16.7,16.2,6.9,5.0,6.4,10.9,13.8,7.6,6.9,9.2,12.3,8.6,22.9,24.6,8.9,16.4,19.4,10.6,13.5,14.5,7.4,10.1,7.9,6.4,6.0,7.7,10.4,6.9,11.8,11.8,6.7,8.5,8.4,7.2,10.0,5.3,8.9,6.0,16.6,16.3,13.7,10.8,7.3,9.1,13.9,15.7,25.2,14.7,8.4,6.4,8.2,8.6,10.6,11.8,7.3,26.8,20.0,11.0,9.9,8.1,11.0,9.1,7.0,8.9,5.2,6.4,6.2,7.8,7.2,10.2,11.3,12.7,8.8,7.3,9.5,6.0,6.0,7.0,7.4,6.0,6.0,8.7,5.5,8.6,17.4,9.2,7.9,12.5,17.6,18.9,20.3,6.7,15.4,19.3,22.2,27.5,31.0,53.1,21.3,23.4,30.9,13.3,15.0,19.5,26.7,16.2,11.0,12.8,12.8,15.9,18.2,25.4,10.8,13.9,14.0,25.0,19.4,14.7,25.5,17.3,48.5,38.3,16.2,20.0,11.7,21.1,12.9,45.8,21.9,20.1&amp;amp;chco=00ff00,0000ff" border="0" /&gt;&lt;/a&gt;               &lt;br /&gt;The green trace represents the CPU temperature (in centigrade) and the blue trace represents the CPU usage (in percentage).               &lt;br /&gt;              &lt;br /&gt;Download the source from my &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;projects page&lt;/a&gt; (look for Temperature Monitor). In order to run this project you will need to have PyQt4 installed along with Python (&amp;gt;=v2.5.0).               &lt;br /&gt;              &lt;br /&gt;And that is how its done!               &lt;br /&gt;              &lt;br /&gt;&lt;/div&gt;           &lt;/div&gt;           &lt;br /&gt;          &lt;br /&gt;&lt;/div&gt;       &lt;/div&gt;       &lt;span style="font-size:100%;"&gt;        &lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/div&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;/div&gt; &lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-7425650874475290237?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/7425650874475290237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/how-to-pyqt4-temperature-monitor-with.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7425650874475290237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/7425650874475290237'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/04/how-to-pyqt4-temperature-monitor-with.html' title='How To: PyQt4 - Temperature Monitor with Google Charts support for Ubuntu 9.10'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_itfBLP0qW6o/S7iHjPQ9_yI/AAAAAAAAAHA/woYokUhVC3g/s72-c/Screenshot-TempMon.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1710142903191293172</id><published>2010-03-31T17:39:00.002+05:30</published><updated>2010-09-04T14:36:25.314+05:30</updated><title type='text'>How To: Extracting ID3 Tags from MP3 or Music files</title><content type='html'>&lt;p&gt;Just the other day I was using Rhythmbox to play a few songs I had downloaded. I don’t remember what it was that struck me about the album cover image that was automatically loaded in the bottom left corner of my screen, but it made me wonder how that had happened? I mean, not all my songs had album cover images loading every now and then. Then what was special about this particular song (oh btw, the song was Amplifier by Imran Khan)? I also happened to notice that the recently downloaded music files were a little larger in size in comparison to the songs from yesteryear. &lt;/p&gt;  &lt;p&gt;I knew about album art being put inside the same folder as the audio files (a lame image titled folder.jpg), but this was different. There was no such image present in the album directory. So I guessed that it must be part of the file header. A few Google searches later, I affirmed my hypothesis and found myself going through the entire spec for the latest version of ID3 tags at &lt;a title="http://www.id3.org/Developer_Information" href="http://www.id3.org/Developer_Information"&gt;http://www.id3.org/Developer_Information&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ID3 tags have been around for slightly over a decade with the first version ( a simplistic “TAG” appended towards the end of the file) released in 1997. Over the years, they have evolved along with the quality of sound they represent. The current ID3 tags (v3.2.4) are capable of storing more information about a song, than perhaps musicians and producers can even provide. What’s more interesting is that these tags allow for variable length fields. So your information is not confined (unlike the earlier versions where names and other information had to be squeezed within 30 bytes). &lt;/p&gt;  &lt;p&gt;A review of the ID3 tags specification will tell you that all the metadata about a song is organized as “frames”. Each frame represents a unique field. For instance you have one frame (TPE1) telling you the name of the performing artist and another frame (TALB) bearing the name of the album. The album art may be found under yet another frame (titled APIC, yes.. the entire jpeg image is actually stored against this frame in the file). All frame IDs are four bytes long (TPE1, APIC, TALB, TRDC… etc).You can find a more comprehensive list of frames at &lt;a title="http://www.id3.org/id3v2.4.0-frames" href="http://www.id3.org/id3v2.4.0-frames"&gt;http://www.id3.org/id3v2.4.0-frames&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;From a programmer’s perspective, what one needs to know is:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;how much part of the file must be parsed? It makes little sense to go on from the first byte to the last when the info you need is only present in the beginning of the file &lt;/li&gt;    &lt;li&gt;how do we know how much data to parse after each frame ID (the data is variable length right?) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Firstly, the size of the entire ID3 tag can be got by checking the size field of the ID3 tag. This info can be found in the ID3 header (first ten bytes of the file that look like this: “ID3 XXXXXXX”).  Attention must be paid to the fact that the bytes that will be read in hexadecimal format, and if you’re going to read one byte at a time, you will have to clobber a few of them together to construct the size field. I had to write a small routine that would convert a hex string to an integer so that I could compute the value of the size field. So getting hold of this value will solve the first issue.&lt;/p&gt;  &lt;p&gt;Each frame ID is followed by a size field as well. This value indicates the length of data corresponding to each frame. So we simply use that to solve the second issue. &lt;/p&gt;  &lt;p&gt;Another point to note is that not all tags listed in the specification, will be present in the file stream. Most mp3 files will contain basic info about the performers and producers, the album and a jpeg for the album art if you’re lucky. &lt;/p&gt;  &lt;p&gt;I created a class called TagParser, which basically creates a sliding window (4 bytes long) and rolls all the bytes in the file through this window. Whenever the window holds a valid frame id, it looks for the size field for that frame and proceeds to extract the metadata for that frame based on the value of the size field. &lt;/p&gt;  &lt;p&gt;The extracted data is stored against the corresponding frame id in a dictionary. The parser scans the entire ID3 Tag in a file and extracts any frame that can be found.  (I made an app using this module called "Appellation". Go to &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;my project page&lt;/a&gt; and download the app.)&lt;/p&gt;  &lt;p&gt;The object of this class invokes a method called ‘parser’ which accepts a path to a file as an argument and returns a dictionary containing the frame IDs as keys and a tuple of (description, metadata) as the value against each key. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-1710142903191293172?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1710142903191293172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/how-to-extracting-id3-tags-from-mp3-or.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1710142903191293172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1710142903191293172'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/how-to-extracting-id3-tags-from-mp3-or.html' title='How To: Extracting ID3 Tags from MP3 or Music files'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-2565963009913457965</id><published>2010-03-13T16:55:00.005+05:30</published><updated>2010-06-14T16:20:18.340+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='extracting audio'/><category scheme='http://www.blogger.com/atom/ns#' term='pwi audio'/><category scheme='http://www.blogger.com/atom/ns#' term='PWI to wave'/><category scheme='http://www.blogger.com/atom/ns#' term='PWI'/><title type='text'>Extracting audio from PWI files</title><content type='html'>My father has been using a Windows mobile phone (IMATE Jasjar) for quite some time now, and makes voice recordings using the Notes application that comes along with it.&lt;br /&gt;&lt;br /&gt;These notes are saved as .PWI files. The good part about the notes is that they combine text and voice all in the same file. He did a lot of reading online, about how to use MS Word to manipulate .pwi files. But when nothing really worked out for him, he came to me with the problem.&lt;br /&gt;&lt;br /&gt;So I wrote him a command line utility in python, that would help him extract all the audio from his files. In order to do this, I first opened the file in a hex editor (I use Bless Hex Editor on Ubuntu). Within a minute I realized that the format was extremely simplistic. All the audio was saved in the files as RIFF Wave (yes.. really really old). And what was even more convenient was the fact that all the audio was stored after a "RIFF" tag in the file.&lt;br /&gt;&lt;br /&gt;Another point to note here was, that a single PWI file could store several audio snippets, each one starting out with a 'RIFF' tag.&lt;br /&gt;&lt;br /&gt;This is what the file looked like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_itfBLP0qW6o/S5t3AojVlGI/AAAAAAAAAGY/75pczByqClA/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_itfBLP0qW6o/S5t3AojVlGI/AAAAAAAAAGY/75pczByqClA/s320/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5448079027004085346" border="0" /&gt;&lt;/a&gt;So all you have to do is extract the pieces of the file starting with the 'RIFF' tags. Python, as always, would prove to be the most efficient language for a task like this. Simply read the entire file. Split the content into pieces using the 'RIFF' identifier. Ignore the first piece. Each successive piece would be an individual audio file. Take each piece and write it into an independant wave file.&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;########################################################################&lt;br /&gt;# filename :    pwi2wave.py&lt;br /&gt;# utility  :    converts .pwi files to .wav files (handles multiple wave&lt;br /&gt;#               files stored in the same pwi note)&lt;br /&gt;# author   :    Asim Mittal&lt;br /&gt;#&lt;br /&gt;########################################################################&lt;br /&gt;&lt;br /&gt;import os,sys&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;&lt;br /&gt;   filename = sys.argv[1]&lt;br /&gt;   filename.lstrip().rstrip()&lt;br /&gt;&lt;br /&gt;   if os.path.isfile(filename) is True: #check if the path provided was indeed a file&lt;br /&gt;       name,extension = os.path.splitext(filename)&lt;br /&gt;       try:&lt;br /&gt;           fRead = open(filename,'rb')&lt;br /&gt;       except:&lt;br /&gt;           print '\n\nError reading file!! Exiting'&lt;br /&gt;           sys.exit(0)&lt;br /&gt;&lt;br /&gt;       content = fRead.read()    #read the entire file&lt;br /&gt;       lstPieces = content.split('RIFF') #split the file into pieces using the RIFF tag&lt;br /&gt;       fRead.close()      #close the file i/o stream&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       #now lstpieces contains all the parts of the file separated&lt;br /&gt;       #by the RIFF tag. The first element of this list is not important&lt;br /&gt;       #so we'll take everything starting after.&lt;br /&gt;       #also note, when storing the wave part of the file, we will have to&lt;br /&gt;       #add the 'RIFF' tag again&lt;br /&gt;&lt;br /&gt;       del lstPieces[0] #not of interest to us&lt;br /&gt;&lt;br /&gt;       for index in range(0,len(lstPieces)):&lt;br /&gt;           newname = name + '_wave_' + str(index) + '.wav'&lt;br /&gt;           newContent = 'RIFF'+lstPieces[index]&lt;br /&gt;           fWrite = open(newname,'wb')&lt;br /&gt;           fWrite.write(newContent)&lt;br /&gt;           fWrite.close()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       #the above loop creates as many wave files as there are audio segments&lt;br /&gt;       #in the pwi file&lt;br /&gt;&lt;br /&gt;   else:&lt;br /&gt;&lt;br /&gt;       #the filename didn't point to a file. tell the user about it&lt;br /&gt;       print '\n\nBad path provided. Please give the path to an actual file.'&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And that is how its done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-2565963009913457965?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/2565963009913457965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/my-father-has-been-using-windows-mobile.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2565963009913457965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/2565963009913457965'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/my-father-has-been-using-windows-mobile.html' title='Extracting audio from PWI files'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_itfBLP0qW6o/S5t3AojVlGI/AAAAAAAAAGY/75pczByqClA/s72-c/Screenshot.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-179773913622515621</id><published>2010-03-10T05:19:00.004+05:30</published><updated>2010-07-28T15:53:01.115+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='frontend'/><category scheme='http://www.blogger.com/atom/ns#' term='python help'/><category scheme='http://www.blogger.com/atom/ns#' term='gui for python help'/><category scheme='http://www.blogger.com/atom/ns#' term='pyqt'/><title type='text'>How to: Building a front end for Python help</title><content type='html'>I'm sure most python programmers out there who have used the Python interpreter's built in help utility and regretted not being able to perform a simple "Find" operation on everything that was visible. So I decided, that it was about time, this was taken care of. &lt;br /&gt;&lt;br /&gt;A good front end for an extremely useful help utility was lacking in Python, and so, I named my application "Venom" (something a python doesn't have, but could really do wonders with!). It is a really simple tool that consists of a single widget form that looks something like this: &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_itfBLP0qW6o/S5bf7zgaP1I/AAAAAAAAAFk/NdC6I7Saxkw/s1600-h/Screenshot-Venom+-+Python+help.png"&gt;&lt;img style="text-align: center; margin: 0px auto 10px; width: 320px; display: block; height: 26px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5446787017882615634" alt="" src="http://2.bp.blogspot.com/_itfBLP0qW6o/S5bf7zgaP1I/AAAAAAAAAFk/NdC6I7Saxkw/s320/Screenshot-Venom+-+Python+help.png" border="0" /&gt;&lt;/a&gt; &lt;br /&gt;Its only a text box!!! Its simple design was inspired by the Google desktop search utility. All you have to do is enter the module name (as you would have done at the 'help' utility prompt) and press the enter key. &lt;br /&gt;&lt;br /&gt;This tool also remembers all the searches made during every run, and you can scroll through earlier queries simply by using the up/down arrow keys. Another interesting feature is that, this tool can be hidden onto the taskbar or system tray. There is an icon placed in the system tray, clicking which toggles the visibility of the tool. &lt;br /&gt;&lt;br /&gt;When you press enter, the query is validated and if the help utility does dish something out, it is stored and displayed to you in your web browser as a simple HTML file. You can then perform simple search/find operations, which were not possible when the interpreter was executed directly from the shell. &lt;br /&gt;&lt;br /&gt;The entire utility is built using PyQt4. The application is completely cross platform and I have tested it out on Ubuntu and Windows 7. You must have the PyQt site-packages and a Python 2.6 interpreter installed. PyQt4 is free and may be downloaded from the &lt;a href="http://www.riverbankcomputing.co.uk/software/pyqt/download"&gt;Riverbank Software Website&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;From a programmer's perspective, this utility was a great way to understand how to create and use a system tray icon in PyQt (using the QSystemTrayIcon class). The UI was designed using Qt Designer and converted into Python code using pyuic4. &lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://baniyakiduniya.blogspot.com/p/project-listing.html"&gt;here&lt;/a&gt; to download the source!! (look for Venom) &lt;br /&gt;&lt;br /&gt;Hope you like it... Its really made searching for help on Python a lot simpler. A funny thing I noticed was that the system tray icon was appearing in full color only when the utility was being run from the terminal. When I ran this application from anywhere else, the system tray icon didn't appear or was vague, but space was made available in the system tray for this icon. In order to prevent more confusion, I added a tooltip. Clicking on the system tray icon will toggle the visibility of this application. &lt;br /&gt;&lt;br /&gt;Any ideas on how this may be expanded further...?? Please comment on this post or mail me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-179773913622515621?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/179773913622515621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/how-to-building-front-end-for-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/179773913622515621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/179773913622515621'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/how-to-building-front-end-for-python.html' title='How to: Building a front end for Python help'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_itfBLP0qW6o/S5bf7zgaP1I/AAAAAAAAAFk/NdC6I7Saxkw/s72-c/Screenshot-Venom+-+Python+help.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1909555541390145333</id><published>2010-03-09T07:01:00.000+05:30</published><updated>2010-03-09T01:41:00.990+05:30</updated><title type='text'>A Small PING utility to keep the network awake</title><content type='html'>I recently set up a small home network on windows, and was using samba to access the same using Ubuntu.&lt;br /&gt;&lt;br /&gt;I realized over a period of time that some computers on the network have a tendency to fall asleep, preventing me from being able to access shared data. A simple solution to this was a simple "ping". But the task of facing "access denied" and then running a terminal to ping the particular computer was getting too tedious. Moreover, since I have a wireless router in between, the IP addresses for all the machines keep hovering in an around my current IP address.&lt;br /&gt;&lt;br /&gt;Today I decided that enough was enough, and I had to squash this issue once and for all. So I wrote something called "pingTEN"  ('ten' being the reverse of 'net' .. heehee!)&lt;br /&gt;&lt;br /&gt;Its a really simple utility which allows my computer to ping X number of IP addresses on either side of my current IP address. Since this operation can be a major CPU hog, you can also program Y number of seconds, for which the program will sleep once all the pings are complete. It performs a single packet quiet ping.&lt;br /&gt;&lt;br /&gt;Since I usually have about two to three computers active on my home network at any time, I simply type this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;shell:~$python pingten.py 2 10&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now 2 (is X) and 10 (is Y). Another cute feature I've added is that everything that is put out on the console (if you're running it from the terminal), will be written down periodically into a file, with a timestamp. Why is this important?? Simply because, I can now choose to run this in the background (using the System &gt; preferences &gt; startup applications menu) and be able to monitor if it is still active. It runs as if it were a daemon or a background process.&lt;br /&gt;&lt;br /&gt;If I simply open nautilus (or whatever file browser utility is available), I can actually see the file size changing from 270 bytes to 0 bytes to 270 bytes... and so on. With every set of pings, the file is overwritten with 270 bytes of data. The program then sleeps for ten seconds and rewrites the file when it wakes up, causing the size to get nullified.&lt;br /&gt;&lt;br /&gt;Its a really simple way to keep track of my application, which I cannot see without the terminal.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://groups.google.com/group/baniyakiduniya"&gt;Click here to download the source!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-1909555541390145333?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1909555541390145333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/small-ping-utility-to-keep-network.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1909555541390145333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1909555541390145333'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/small-ping-utility-to-keep-network.html' title='A Small PING utility to keep the network awake'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-6621815094850743671</id><published>2010-03-06T11:31:00.003+05:30</published><updated>2010-03-06T12:04:43.691+05:30</updated><title type='text'>Adding your Windows partition to the GRUB</title><content type='html'>So I've been toying around with Windows 7 and decided to install Ubuntu 9.10 to go with it. Obviously Windows 7 was the first to be installed (that way, I hoped that the GRUB loader would recognise a Windows installation and automatically add it to the list of operating systems to choose from); however, to my disbelief, the GRUB tricked me and Windows was nowhere to be found in the list.&lt;br /&gt;&lt;br /&gt;My first reaction was of frustration, but I decided to use the existing installation of Ubuntu to help me figure out how to go about getting my access to Windows back.&lt;br /&gt;&lt;br /&gt;Here's what I did:&lt;br /&gt;&lt;br /&gt;Firstly, when Ubuntu loads up, mount the windows partition (as if it were just another hard drive). There is a folder boot (which may/may not contain a sub-folder called grub). However, this is of no consequence to us. Then there is another folder called "Boot" (capital 'B') which contains all the boot files.Rename the former ('boot', the not so important one) to XYZ and rename the latter ("Boot", more valuable) to 'boot'. Yes all we did was change the case of 'Boot' to 'boot'.&lt;br /&gt;&lt;br /&gt;Now open a terminal, perform a simple 'fdisk':&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;Shell:~$ sudo fdisk -l /dev/sda&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Device    Boot      Start End      Blocks    Id  System&lt;/span&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/dev/sda1   *         1           4080        32771576      7    HPFS/NTFS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/dev/sda3           8585       30401      175245052+ b    W95 FAT32&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/dev/sda5                      4081        8323        34081866     83   Linux&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/dev/sda6                      8324        8584         2096451      82   Linux swap / Solaris&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;This is what I got. Here my Windows 7 is loaded on /dev/sda1 which is NTFS. Now create a file in /etc/grub.d/  called 11_Windows&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;Shell:~$sudo nano /etc/grub.d/11_Windows  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nano is my text editor of choice. You can use anything you like ('gedit' etc.). In this file, write the following:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;#!/bin/sh -e&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;echo "Adding Windows"&gt;&amp;amp;2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;cat&lt;&lt;eof&gt;&lt;/eof&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;menuentry "Windows 7"{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;set root=(hd0,1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;chainloader --force+1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;" &gt;EOF&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Save it. Close it and return to the terminal. Now let's recap. You made the "Boot" folder of your windows partition "boot" and created a file in the /etc/grub.d/ directory.&lt;br /&gt;&lt;br /&gt;Now simply run the utility to update the grub. You can do this by entering the following at the terminal:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;font-size:85%;"  &gt;Shell:~$sudo update-grub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Output (on my system):&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:courier new;font-size:85%;"  &gt;Generating grub.cfg ...&lt;br /&gt;Found linux image: /boot/vmlinuz-2.6.31-20-generic&lt;br /&gt;Found initrd image: /boot/initrd.img-2.6.31-20-generic&lt;br /&gt;Found linux image: /boot/vmlinuz-2.6.31-14-generic&lt;br /&gt;Found initrd image: /boot/initrd.img-2.6.31-14-generic&lt;br /&gt;Adding Windows&lt;br /&gt;Found memtest86+ image: /boot/memtest86+.bin&lt;br /&gt;Found Windows 7 (loader) on /dev/sda1&lt;br /&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice how the "Adding Windows" appears. That happens to be the cute little script we just wrote tipping the odds in our favor. And voila!! Windows 7 is found on /dev/sda1 (which we verified manually a little while back)&lt;br /&gt;&lt;br /&gt;Thats all there is to it. Hope this helps.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-6621815094850743671?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/6621815094850743671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/adding-your-windows-partition-to-grub.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6621815094850743671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/6621815094850743671'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/03/adding-your-windows-partition-to-grub.html' title='Adding your Windows partition to the GRUB'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-3240940955723486957</id><published>2010-02-24T03:57:00.004+05:30</published><updated>2010-02-24T04:39:27.198+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='GUI in python'/><category scheme='http://www.blogger.com/atom/ns#' term='drag buttons'/><category scheme='http://www.blogger.com/atom/ns#' term='drag and drop'/><category scheme='http://www.blogger.com/atom/ns#' term='widgets'/><category scheme='http://www.blogger.com/atom/ns#' term='Drag GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='wxPython'/><category scheme='http://www.blogger.com/atom/ns#' term='click and drag'/><title type='text'>Click, Drag and Drop widgets in wxPython</title><content type='html'>Recently, I was running through a few posts at http://python-forum.org during my free time today and I came across someone who need help in creating a frame, where in the widgets (namely a push button) could be pressed and dragged around the frame, and dropped off at any part of the frame once it was depressed.&lt;br /&gt;&lt;br /&gt;At first, I thought it was nothing to break my head over. In fact I wrote a little snipped of code in IDLE (on Windows Vista) and it worked! What was a bit disconcerting was the fact that the widget moved around alright, but didn't really flow smoothly along the frame. The transition from one point to the other was really jarring.&lt;br /&gt;&lt;br /&gt;I have worked extensively on wxPython and know how faulty its behavior is on Windows. The true test for an application in wxPython is on a Linux box. I booted into my Linux partition, in a hope to recreate the effect that I had so easily created in windows. A few shell commands later, I could see the familiar window, but to my disappointment, the buttons didn't drag. They just sat there in one place, doing nothing.&lt;br /&gt;&lt;br /&gt;Determined to solve this issue, I dug deeper into wxPython. Starting out with penning down the sequence of events that occur, I understood that we have to organize the events starting with the pressing of the left mouse button (only when the pointer is on the push button); followed by the drag/motion event of the mouse and finally concluding with the mouse up event.&lt;br /&gt;&lt;br /&gt;However, what was challenging was the fact that once the mouse button was pressed down, the event loop didn't recognize any other mouse events on the button. So how does one go about recognizing the drag/motion event?? I tried to skip (event.Skip()) after receiving the mouse down event, but that didn't seem to work. After about an hour of google, I devised a mechanism to complete the desired effect.&lt;br /&gt;&lt;br /&gt;After receiving the mouse down event, we turn on something called "mouse capture" - this focuses all the events coming from the mouse (motion, right click etc) to be directed to the frame and not to the button or the panel. That way, I was able to catch and handle the motion/dragging event. This was bound to the frame and not to any widget in particular. Once the dragging around of the button was complete, the mouse button is depressed causing the "mouse up" event to be released (again directed/bound to the frame, not to any widget in particular). In the handler for the mouse up event, I make a simple check to see if the mouse capture is turned on. If it is, then we simply "release capture" of mouse events, restoring the frame back to its original state.&lt;br /&gt;&lt;br /&gt;Here is what the results looked like:&lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-9ee5a41f759f5a71" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v8.nonxt5.googlevideo.com/videoplayback?id%3D9ee5a41f759f5a71%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1329899116%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5A8E17DB0969E7C67C35559F28616F80D92A9657.574C7FF8BB94694889D7A9A19CA84BDBA31496D3%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9ee5a41f759f5a71%26offsetms%3D5000%26itag%3Dw160%26sigh%3DDk09Q6YCZQyDokPz9CmH3syolNg&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v8.nonxt5.googlevideo.com/videoplayback?id%3D9ee5a41f759f5a71%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1329899116%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5A8E17DB0969E7C67C35559F28616F80D92A9657.574C7FF8BB94694889D7A9A19CA84BDBA31496D3%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9ee5a41f759f5a71%26offsetms%3D5000%26itag%3Dw160%26sigh%3DDk09Q6YCZQyDokPz9CmH3syolNg&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;The source code for the same is available &lt;a href="http://groups.google.com/group/baniyakiduniya/files"&gt;here&lt;/a&gt; (look for a file named wx_DragButtons.py).&lt;br /&gt;&lt;br /&gt;The code contains the bulk of the documentation. This is a small, yet elegant solution, which only makes me wonder the kind of effort that goes into creating dynamic user interfaces. Alas, I hope the folks at the forum find this post useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8652019172422577813-3240940955723486957?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/3240940955723486957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/02/click-drag-and-drop-widgets-in-wxpython.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/3240940955723486957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/3240940955723486957'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/02/click-drag-and-drop-widgets-in-wxpython.html' title='Click, Drag and Drop widgets in wxPython'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8652019172422577813.post-1417687931586768026</id><published>2010-02-22T17:48:00.001+05:30</published><updated>2010-02-23T18:21:01.945+05:30</updated><title type='text'>Iron ‘Mic(rosoft)’ Python – Creating a simple app from ground up</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I have heard a lot about Microsoft’s initiative to include Python programming into their existing .NET framework. DotNET is selling like hot cake nowadays and almost every one I know writing professional application level software seems to have sold his soul to the devil.I have resisted this temptation time and time again, and perhaps, the inclusion of Python was what was needed to tip me over the cliff.&lt;/p&gt;  &lt;p&gt;So before I signed the thousand page contract with Elizabeth Hurley, and watch her turn into a grotesque red faced monster, I decided to poke around and whet my appetite. I have been toying around with the idea of crossing over to .NET for a while, and I guess with the advent of IronPython, I had run out of excuses.&lt;/p&gt;  &lt;p&gt;I started reading ‘Pro IronPython’ by Alan Harris. I always like to get my hands on some well organized reading material to get a feel of what I’m getting into. The book was surprisingly short (it was 300+ pages, but there was little worth reading in it!); and I skimmed through the nine chapters at leisure. The first five chapters were enough reading material for any experienced Python programmer to gauge what IPY was all about. &lt;/p&gt;  &lt;p&gt;I downloaded “SharpDevelop”; an open source equivalent to Visual Studio, but only ten times lighter. Along with that I got a hold of the IronPython interpreter from &lt;a href="http://codeplex.com/IronPython"&gt;http://codeplex.com/IronPython&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That was perhaps the bare minimum that was needed to kick of some reptilian development. The next step is perhaps very important and I, like most programmers or computer geeks, like to delve into a new programming language by making an application of some sort. Something not too big but with a usage that spans many areas of programming. I had an idea loitering around in my cranium for a while, but sheer lassitude and lethargy was preventing me from coding it. I recently got a huge chunk of music from a friend, who was extremely meticulous in organizing his MP3 files. Over 16 GB of music was stored on my filesystem in multiple directories. Here’s how it looked:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_itfBLP0qW6o/S4J11b-CcfI/AAAAAAAAAEI/Dz9l1VN6_10/s1600-h/image%5B46%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="474" alt="image" src="http://lh5.ggpht.com/_itfBLP0qW6o/S4J14Yg93JI/AAAAAAAAAEM/vPk6HBptGrM/image_thumb%5B30%5D.png?imgmax=800" width="400" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The music files were segregated by language and then further classified based on the artist. So I had a whole load of files, stored in over 1000 folders (artist folders). I usually like my music stored in a single directory with the file name in this format :&amp;lt;artist name&amp;gt;&amp;lt;hyphen&amp;gt;&amp;lt;song&amp;gt;.mp3&lt;/p&gt;  &lt;p&gt;Obviously, I wasn’t going to sit and manually cut and paste each file, and search utility on Vista is perhaps the lamest application ever. So I took it upon myself to create a small app to do this for me. &lt;/p&gt;  &lt;p&gt;I had made a command line application for recursively searching, indexing and organizing my files before, using Python on Linux. I wanted to check if IPY would work with previously designed core python modules as well.&lt;/p&gt;  &lt;p&gt;So, &lt;strong&gt;&lt;u&gt;objectives&lt;/u&gt;&lt;/strong&gt; for this application:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Get a feel of GUI design and associated generated code in IPY &lt;/li&gt;    &lt;li&gt;Check if IPY plays well with core Python modules &lt;/li&gt;    &lt;li&gt;Create an application that will allow the user to recursively search any directory for files of one or more extenstions/file types, and allow him to cut/copy all these files from their respective source directories to a specified destination &lt;/li&gt;    &lt;li&gt;Understand IPY’s peculiarities with respect to worker threads and their independence of the UI threads &lt;/li&gt;    &lt;li&gt;Assess convenience in application deployment &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;STEP 1 : Creating the GUI&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_itfBLP0qW6o/S4J16BL0SxI/AAAAAAAAAEQ/T9z3qh_s64A/s1600-h/image%5B45%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="258" alt="image" src="http://lh6.ggpht.com/_itfBLP0qW6o/S4J17TDaPfI/AAAAAAAAAEU/9chfCks43LE/image_thumb%5B29%5D.png?imgmax=800" width="410" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Voila !!! &lt;strong&gt;EXODUS &lt;/strong&gt;is born !!! &lt;/p&gt;  &lt;h4&gt;&lt;a href="http://groups.google.com/group/baniyakiduniya"&gt;Download the source from my groups page (look for exodus.rar)!!&lt;/a&gt;&lt;/h4&gt;  &lt;h2&gt;&lt;/h2&gt;  &lt;p&gt;There was nothing to creating a GUI. The one thing (also the only thing) I’ve always loved about MS, was that they made GUI creation so simple. No long hours of coding… a few mouse clicks and my GUI was ready.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;PITTFALL : &lt;/u&gt;&lt;/strong&gt;There is however one problem with GUI creation and code generation in IPY. I didn’t face this while working with Visual Basic Express 2008. When you create a widget or tool (e.g. the push button, or a text box etc.); you must decide on the “name” of the object then and there. If you accidentally switch to the code view before appropriately naming the object, the code is generated for that widget/object with the standard names that the IDE gives them. So you’re going to have names like ‘textBox1’ and ‘button1’ sitting all over your GUI code. In Visual Basic, this wasn’t such a big issue, because you could go and rename the object later on, and the generated code would be changed accordingly… NO SUCH FEATURE WITH IPY!!! So name first, code later.&lt;/p&gt;  &lt;p&gt;Barring that, there was no other problem in designing the GUI. You can pick out a widget of your choice from the toolbox panel (dockable… so look hard!)&lt;/p&gt;  &lt;p&gt;The GUI code (auto generated) appears as a class with the class name as the name of the form. So I accidently ended up with a form called “MainForm” (default name given to the form) and the class created was also given the same name. This didn’t worry me so much as my application was only a single form application. But if you’re working on more than one form, things might get a bit difficult. So I re-iterate myself… name first, code later. In this form was a method titled &lt;strong&gt;InitializeComponent(self).&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This method is very readable and neatly organizes the code for all the widgets that you have created. Some properties of these widgets are also assigned in this part of the code. This method is the first to be called from the class constructor or __init__(self) method.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;STEP 2 – Creating the event handlers for widgets&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The GUI is good to look at and that is all that it is worth, without any code a.k.a “Wiring”. My application had been designed keeping the following in mind:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use at least four to five different widgets (buttons, radio buttons, checked style list box, text boxes, status strip with a progress bar) &lt;/li&gt;    &lt;li&gt;There must be some kind of background task (a long running process), which in our case is the copying or moving of files from the source folder to the destination. This will help illustrate the effectiveness of the UI-worker thread independence &lt;/li&gt;    &lt;li&gt;Use at least one file/folder/print/open/save dialog box – this will help us understand how dialog boxes return selected information &lt;/li&gt;    &lt;li&gt;Use at least one message box or alert box to display passive messages to the user or draw attention to something &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can code a handler for a particular widget, or generate it by double clicking on it in the design view. Automatically, the code for the handler associated with that event and widget (e.g. click event for a button widget) will be generated. The body of this handler will be a simple “pass” statement. You have to write your code in that handler. &lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Note:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you want to code an event handler, read this note. Consider a button widget with the name &lt;strong&gt;btnOK &lt;/strong&gt;and you want to code the handler for a ‘&lt;strong&gt;Click&lt;/strong&gt;’ event. Now all you have to do is &lt;em&gt;bind&lt;/em&gt; the widget to its handler. Let’s also say that you have written a routine called ‘&lt;strong&gt;btnOKClicked(self,sender,event)&lt;/strong&gt;’ which you want to invoke once this button is clicked.&lt;/p&gt;  &lt;p&gt;To bind the method to the widget for the event, the code looks like this:&lt;/p&gt;  &lt;p&gt;&amp;lt;widget_name&amp;gt;.&amp;lt;event_name&amp;gt; += self.&amp;lt;method_name&amp;gt;&lt;/p&gt;  &lt;p&gt;In the above scenario, you’ll have:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;self._btnOK.Click += self.btnOKClicked&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="verd"&gt;The code generation scheme does exactly the same thing and saves you the trouble of doing it manually.&lt;/font&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;My application demanded that I’d be able to use a folder browse dialog box to select both source and destination directories; have a list box with commonly used extensions – for this I have used a checked list box so that one may select more than one extension; a text box is provided so that one may enter an extension (e.g: .rtf, .xyz etc) that is not present in the list – this allows flexibility since new file formats will come out every now and then and there is no way to know what type of files the user wants to move. &lt;/p&gt;  &lt;p&gt;If you seek information about widgets and their associated members or methods, you can refer to any resource on C# or VB for the .NET framework. IPY implements the same methods as well. All the assemblies from .NET are available in IPY.&lt;/p&gt;  &lt;p&gt;For instance the checked list box widget, implements a method called Add. Let’s assume that we have a widget with the name clbExtension (a checked list box). In Visual Basic, you’d probably access this as follows:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#0000a0"&gt;clbExtension.Items.Add(“Item number 1”) &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In IPY, the usage is exactly the same. The only difference being that since there is a class in place for the entire form, all widgets on that form are members of this class. All event handlers are also part of the class for the form. Here’s how it goes in IPY, pay close attention to the last line:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_itfBLP0qW6o/S4J18l76S5I/AAAAAAAAAEY/eRJ__5l7-QQ/s1600-h/image%5B17%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="435" alt="image" src="http://lh4.ggpht.com/_itfBLP0qW6o/S4J1_MKFwcI/AAAAAAAAAEc/FQPw5Bv3y70/image_thumb%5B9%5D.png?imgmax=800" width="535" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So IPY preserves the same methods that are consistent with the rest of the .NET framework. If you’re familiar with widget objects and their members and have used them on VB or C#, you only have to master Python syntax and its libraries. Even if you’re not and are having a hard time finding resources specific to IronPython for a particular widget; fret not, all you have to do is find a VB or C# equivalent. That combined with a little common sense will have you coding away.&lt;/p&gt;  &lt;p&gt;Please note, that in the snippet above, the only part that you actually code is the handler. The rest is generated by the IDE :-) just like it is in Visual Basic. Double click a particular widget or you can use the pull down menus at the top of the code view to generate an empty handler for a particular widget. Then simply feed in your code into that handler.&lt;/p&gt;  &lt;p&gt;If you were paying close attention, you’d notice that in the snippet above, the component for the checked list box has been created and the code for the event handler has been put down. But there is no code to bind the handler to the widget. This is because, I typed out the snippet by hand. Be rest assured that the IDE will make no such blunders :D&lt;/p&gt;  &lt;p&gt;If you’re familiar with Python syntax, you’d realize that the underscore (_) before the name of every widget object is used/generated to ensure that these widgets have private access only. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;STEP 3 – Understanding a Background Worker&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When designing GUI, one must understand, that any front end that responds to events (clicks, text entry etc.) has a process that runs in a continuous loop to sample these incoming events. This is commonly called the ‘UI Event loop’ or the UI thread.&lt;/p&gt;  &lt;p&gt;If you interrupt this thread (run a really long for loop in the same thread), you’ll realize that the UI becomes unresponsive and freezes. To avoid this, all “heavy duty” work or long running or time consuming processes must run in separate threads that are concurrent with the UI thread. This will allow your application’s UI to remain responsive and prevent your operating system’s scheduler or process manager, from declaring your application as a passive process.&lt;/p&gt;  &lt;p&gt;Here too, there are a few subtle techniques. Imagine a scenario with a form having a button. When clicked, the form starts downloading a really large file from the web, and reports its status using a progress bar. Another common feature is disabling this button when the download begins and enabling it when the download is complete.&lt;/p&gt;  &lt;p&gt;Now, in order to do that you have to know the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;when the download has commenced &lt;/li&gt;    &lt;li&gt;the current status of the download &lt;/li&gt;    &lt;li&gt;and when the download is complete &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Since we have to run our download in a separate thread, to allow for the UI to be updated, the downloader thread must communicate with the UI thread. Each GUI toolkit offers some mechanism or the other for this communication to take place (PyQT for instance employs a signal and slot mechanism, it is one of the simplest and most effective mechanisms till date and offers the programmer complete flexibility). IronPython, like the remainder of the .NET framework uses something called a “Background Worker”&lt;/p&gt;  &lt;p&gt;A background worker is basically an object with the following characteristics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;it has a property that stores the name of the routine which is the primary task &lt;strong&gt;viz. DoWork&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;it has a property that stores the name of the routine which must be invoked, when the primary task is complete &lt;strong&gt;viz. RunWorkerCompleted&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;and another property that stores the name of the routine which will update the UI on the progress of the primary task viz. &lt;strong&gt;ReportProgress &lt;/strong&gt;(in my application I have not utilized this property. Instead I’ve directly invoked the routine to update the GUI) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Lets take a look at the code:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_itfBLP0qW6o/S4J1_2V3ycI/AAAAAAAAAEg/h7Jz1mBcm_U/s1600-h/image%5B23%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="90" alt="image" src="http://lh5.ggpht.com/_itfBLP0qW6o/S4J2BPO-eNI/AAAAAAAAAEk/4cbA6zdQMRg/image_thumb%5B13%5D.png?imgmax=800" width="370" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first line creates a member called bgWorker which is an object of the type BackgroundWorker. The second line indicates that this worker object reports the progress of the task. The third and final line in the snippet above, indicate the two properties mentioned above. &lt;strong&gt;searchFilterAndMove &lt;/strong&gt;&amp;amp;&lt;strong&gt; resetUI &lt;/strong&gt;are two methods that perform the primary task (copying the files from source to destination) and reset the UI, once the primary task is complete (a cleanup task after the heavy work is over). &lt;/p&gt;  &lt;p&gt;That was about the creation and initialization of the background worker. Now lets see how we can get some real work done. I have a button on my form that reads “MOVE IT!”; which when clicked, causes the movement of files from source to destination. Here is the event handler for that button:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_itfBLP0qW6o/S4J2BzMSAXI/AAAAAAAAAEo/ABbZpt5KjEs/s1600-h/image%5B29%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="image" src="http://lh3.ggpht.com/_itfBLP0qW6o/S4J2C6XldkI/AAAAAAAAAEs/f732V2YlHFc/image_thumb%5B17%5D.png?imgmax=800" width="383" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The lines indicated the intermediary processing that happens before the background worker is told to start doing its work. The last line is the most important one. The &lt;strong&gt;RunWorkerAsync() &lt;/strong&gt;method of the bgWorker object, causes the routine &lt;strong&gt;searchFilterAndMove &lt;/strong&gt;to get activated. Moreover, this routine now runs asynchronously of the UI thread, thereby helping us achieve our objective. When the &lt;strong&gt;searchFitlerAndMove &lt;/strong&gt;routine is complete, it will call the &lt;strong&gt;resetUI&lt;/strong&gt; method as discussed earlier. The routine to update the GUI is called from within &lt;strong&gt;searchFilterAndMove.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You may look up the definitions of these routines to get a better understanding of how they work by downloading the source.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;STEP 4 – Mixing up IPY and Core PY&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;At the beginning of this article, I had enlisted out the collaboration of IronPython with core Python modules as an important issue. Well, to say the least, its not smooth. But with a little work, anything is possible :-)&lt;/p&gt;  &lt;p&gt;I had created a library (just another .py file) with some helpful functions. I call this module “helpermodules.py”&lt;/p&gt;  &lt;p&gt;It contained a routine that would recursively scan a source directory for all its children, another routine to validate the extension (manual entry) and two routines to cut or copy files from one place to another.&lt;/p&gt;  &lt;p&gt;In designing these, I had used modules such as &lt;strong&gt;os, shutils and glob.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I wanted to know how well the IPY interpreter would handle these. When I was working with the SharpDevelop IDE, I would use the in built compiler/interpreter, to run my code. Initially, while testing the widget related methods, all was well. But the moment I included routines that required core Python modules, a lot of errors started showing up. Therefore, I had a form with widgets that would look nice and seem hale and hearty on the UI front, but had little or no real functionality.&lt;/p&gt;  &lt;p&gt;A few Google searches later, I realized that a lot of people were complaining about the use of various core Python modules. But I had come too far to turn back now. What was more disconcerting was the fact that imports of the core python modules worked brilliantly at the IPY interpreter shell, and failed miserably on the SharpDevelop IDE’s run. I finally found a post that bailed me out of my predicament. Apparently, there is a certain addition one has to make to allow IPY to use the core Python modules. Here it is:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_itfBLP0qW6o/S4J2FlQV45I/AAAAAAAAAEw/yixoWcCHyUc/s1600-h/image%5B44%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="328" alt="image" src="http://lh5.ggpht.com/_itfBLP0qW6o/S4J2HvhIgxI/AAAAAAAAAE0/D4b21vAQp8I/image_thumb%5B28%5D.png?imgmax=800" width="540" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first two sections are what need to be added to the code generated by SharpDevelop. The logic of these statements is merely to provide a link between the IPY (which is the python interpreter) and the CLR (Common Language Runtime of the .NET framework). This way, all the resources that CLR (and hence, .NET) has to offer will be made available to the IronPython interpreter.&lt;/p&gt;  &lt;p&gt;Another queer observation was that after this was done, the design file of the project (which is nothing but the design of the GUI which we have made by dragging widgets from the toolbox to the form etc.) was corrupted. Hence, SharpDevelop couldn’t display the design of my form. Thankfully, at this stage, I was through with the design of the UI, but if I needed to make a few changes later on, it would have been only through code and not through an interactive UI designer. I think this had more to do with the SharpDevelop IDE than with IronPython. Still trying to figure out why exactly did something likes this cause a ripple :D&lt;/p&gt;  &lt;p&gt;Now this code file ran beautifully using the IronPython interpreter at the command line. The same effect can be achieved by running the project through SharpDevelop’s built in IronPython interpreter (Ctrl+Shift+W).&lt;/p&gt;  &lt;p&gt;What is more important is that the core python modules worked flawlessly. The form takes a little time to pop up but that is simply because IronPython is built on C# and really doesn’t create an intermediate bytecode like Python does (which is also the reason for its superior performance). &lt;/p&gt;  &lt;p&gt;There is a large part of core Python that is still not supported by IPY (there is a little dispute over this issue), but perhaps that will change in times to come. &lt;/p&gt;  &lt;p&gt;My application is currently in its raw state and has not been deployed. I hope to understand deployment shortly and want to check out Microsoft’s IronPython Studio to see if they have “click once deployment” (like in Visual Basic 2008); that helps in creating a ready to use bundle for your application.&lt;/p&gt;  &lt;p&gt;This project was purely for a didactical purpose. Hopefully, I was able to help you find what you were looking for. I will be immersing myself into IronPython in the days to come, and target more specific topics in forthcoming posts.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;GUI design using SharpDevelop IDE &lt;/li&gt;    &lt;li&gt;IronPython’s compatibility with Visual Basic.NET (or C#) &lt;/li&gt;    &lt;li&gt;Creating event handlers &lt;/li&gt;    &lt;li&gt;Using background worker objects &lt;/li&gt;    &lt;li&gt;Mixing IPY with core Python &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To download the source of the project, click &lt;a href="http://groups.google.com/group/baniyakiduniya"&gt;here&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/8652019172422577813-1417687931586768026?l=baniyakiduniya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baniyakiduniya.blogspot.com/feeds/1417687931586768026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/02/iron-microsoft-python-creating-simple.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1417687931586768026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8652019172422577813/posts/default/1417687931586768026'/><link rel='alternate' type='text/html' href='http://baniyakiduniya.blogspot.com/2010/02/iron-microsoft-python-creating-simple.html' title='Iron ‘Mic(rosoft)’ Python – Creating a simple app from ground up'/><author><name>Asim Mittal</name><uri>http://www.blogger.com/profile/09291984592799422039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/-UqYC0dWiyMs/TjhchbZKkeI/AAAAAAAAAOo/zCVBwiDsEIw/s1600/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_itfBLP0qW6o/S4J14Yg93JI/AAAAAAAAAEM/vPk6HBptGrM/s72-c/image_thumb%5B30%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
