tag:blogger.com,1999:blog-1502673826522798302024-03-09T03:52:48.064+05:30*coderthoughts = rand()Keerthi Shankarhttp://www.blogger.com/profile/08542195863251559063noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-150267382652279830.post-63826857066238334102010-11-18T19:04:00.000+05:302010-11-18T19:15:48.605+05:30The Daily Status<div>One of the ongoing frustrations for me at work is this:</div><div><br /></div><a href="http://dilbert.com/strips/comic/1995-02-17/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/20000/0000/800/20893/20893.strip.gif" border="0" alt="Dilbert.com" /></a>Keerthi Shankarhttp://www.blogger.com/profile/08542195863251559063noreply@blogger.com0tag:blogger.com,1999:blog-150267382652279830.post-58385239072835601402010-11-18T16:27:00.002+05:302010-11-18T16:34:18.318+05:30Multi-core programming with PythonI had given a talk on multi-core programming with Python at <a href="http://in.pycon.org/2010/">http://in.pycon.org/2010/</a>. Here is my talk: <a href="http://in.pycon.org/2010/talks/65-multi-core-programming-with-python">http://in.pycon.org/2010/talks/65-multi-core-programming-with-python</a>.<div><br /></div><div>I illustrated a multi-core merge sort using Python's multiprocessing module. Couldn't cover Stackless Python though! </div>Keerthi Shankarhttp://www.blogger.com/profile/08542195863251559063noreply@blogger.com0tag:blogger.com,1999:blog-150267382652279830.post-21612258397916745682010-02-20T14:17:00.005+05:302010-02-20T15:00:30.320+05:30College students bitten by Python<div>The Python India community (esp. the <a href="http://mail.python.org/mailman/listinfo/bangpypers">bangpypers</a>) had organized for a PyCon last year: <a href="http://in.pycon.org/2009/">http://in.pycon.org/2009/</a>. Being the first of its kind in India, it had attracted a good amount of Python people from colleges! </div><div><br /></div><div>It is interesting to see that these college students are becoming charming Pythonistas. These are the people who are going to join the startups in Bangalore and will spread Python virulently :)</div><div><br /></div><div>I had gone there to deliver a talk on IronPython: <a href="http://in.pycon.org/2009/talkfull/40/">http://in.pycon.org/2009/talkfull/40/</a>. I was the odd man out talking about Microsoft(.NET) in a conference where a majority of them were open source purists. Some of the attendees were even bashing people who were using proprietary software during presentations. I think it is just moot. As long as you either buy proprietary software or use a freeware, you are good. Using proprietary software without legally buying them or using open source software without adhering to their licensing terms are both bad. </div><div><br /></div><div>Anyway, it was a good event, and they have even posted a video of my talk: <a href="http://pyconindia.blip.tv/file/2714649/">http://pyconindia.blip.tv/file/2714649/</a></div><div><br /></div><div>Great work bangpypers!</div>Keerthi Shankarhttp://www.blogger.com/profile/08542195863251559063noreply@blogger.com0tag:blogger.com,1999:blog-150267382652279830.post-56978480275136009282008-02-06T00:29:00.000+05:302008-02-09T13:51:19.428+05:30Python aha moment #1 - cruising through a text fileI am planning to write a series of blogs documenting all my "aha" moments with Python. The "aha" moments are those times at which I come across some piece of Python code and murmur to myself - "Python seems to be really cool!"<br /><br />So here is my first aha moment - cruising through a text file:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">for line in file("C:\\Windows\\System32\\drivers\\etc\\hosts"):<br /> </span><span style="font-family:courier new;"> print line</span><br /></span><br />The above lines of Python code will:<br /><br />a) open the 'hosts' file<br />b) print every line of that file to the console, and<br />c) close the file after all the lines are read.<br /><br />This is a really productive way of parsing text files!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-150267382652279830.post-82674155651365518082008-01-25T21:47:00.000+05:302008-01-25T22:09:34.332+05:30Good programming practicesSometime back in life - precisely 2003, I came across a nice article in the web describing a gross list of good programming practices. I read it, found it amusing, took a print out of it, filed it and just forgotten about it.<br /><br />I was cleaning up my room after a very very long time and got noticed of that old print out that I took in 2003. Now, after 5 years with the eyes of experience I looked at it again. To my astonishment I found that the list is indeed a really really good list of programming practices. After fair amount of Googling, located <a href="http://lists.osafoundation.org/pipermail/dev/2002-November/000195.html">the original version of it</a>!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-150267382652279830.post-24267879830592048892007-09-24T19:03:00.000+05:302007-09-24T19:37:53.355+05:30IronPython - My .NET Exploration ToolWhenever I need to try out little things in .NET or find out how a .NET API works, I wrote C# files, compiled and executed them. Many a times I felt the compile-execute-recode cycle to be too much for experimenting. I wanted an interactive console where I can type code and see how it works. IronPython seems to be an answer for me. The advantage of IronPython over other Python implementations supporting .NET is that IronPython has been embraced by Microsoft. I think they have <a href="http://www.pythonthreads.com/news/latest/ironpython-on-msdn-tv-%21.html">hired</a> the IronPython creator too.<br /><br />So this is what I did with IronPython when trying to explore the Security classes in .NET:<br /><br /><span style="font-size:100%;"><span style="font-family:courier new;">>>> from System import *<br /></span><span style="font-family:courier new;">>>> from System.IO import *<br /></span><span style="font-family:courier new;">>>> from System.Security.Cryptography import *<br /></span><span style="font-family:courier new;">>>><br /></span><span style="font-family:courier new;">>>> stream = FileStream("C:/report.txt", FileMode.Open, FileAccess.Read)<br /></span><span style="font-family:courier new;">>>> sha1 = SHA1Managed()<br /></span><span style="font-family:courier new;">>>> Convert.ToBase64String(sha1.ComputeHash(stream))<br /></span><span style="font-family:courier new;">'2jmj7l5rSw0yVb/vlWAYkK/YBwk='<br /></span><span style="font-family:courier new;">>>><br /></span></span><br />Well if you are still wondering what the above code does, it just computes the SHA1 of a file called 'report.txt' in my C: drive. It prints the SHA1 as a Base64 formatted string (Base64 is a human readable formatting of binary data).<br /><br />I believe <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">Windows Power Shell</a> enables one to do such .NET explorations too. I don't want to jump into that until I get Vista.Unknownnoreply@blogger.com0