<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jeroens blog &#187; Python</title>
	<atom:link href="http://blog.bn2vs.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bn2vs.com</link>
	<description>Blog of Jeroen De Dauw. The latest news on my open source work and interests.</description>
	<lastBuildDate>Fri, 23 Dec 2011 14:44:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Some fun with Python</title>
		<link>http://blog.bn2vs.com/2011/05/05/some-fun-with-python/</link>
		<comments>http://blog.bn2vs.com/2011/05/05/some-fun-with-python/#comments</comments>
		<pubDate>Thu, 05 May 2011 00:31:46 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Aptana Studio]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[GNU GPL]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PyDev]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=1094</guid>
		<description><![CDATA[Yesterday I for some reason decided to have some fun with Python by writing a simple script to Find Dead Translation keys in MediaWiki extensions. The resulting script, titled FDT, can be found on GitHub, and is licenced under the GNU GPL v3+ (yes, the later probably comes as a shock to you!). What is [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I for some reason decided to have some fun with Python by writing a simple script to Find Dead Translation keys in <a href="http://www.mediawiki.org/wiki/">MediaWiki</a> extensions. The resulting script, titled FDT, can be found <a href="https://github.com/JeroenDeDauw/fdt">on GitHub</a>, and is licenced under the GNU GPL v3+ (yes, the later probably comes as a shock to you!).</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2011/05/fdt.png"><img class="alignnone size-full wp-image-1095" title="FDT (Find/Fix Dead Translations) script running on my laptop for the Maps MediaWiki extension" src="http://blog.bn2vs.com/wp-content/uploads/2011/05/fdt.png" alt="FDT (Find/Fix Dead Translations) script running on my laptop for the Maps MediaWiki extension" width="702" height="385" /></a></p>
<p><strong>What is does, and how</strong></p>
<p>The script works by first obtaining a list of defined language keys from the specified i18n file (which is done via an evil PHP subprocess, to avoid messy parsing of array keys), and then looping over all php files in the directory (recursively ofc) to check if they contain any of the keys, after which a list of not-found keys is returned. If there are not-found keys, the script offers to delete those from the i18n file, which also saves quite some work if they are assigned to for many languages. One important limitation is that the script finds key usage by doing a simple &#8220;in string&#8221; search on the whole contents of each file, which obviously will miss dynamically constructed strings. An example of the work this script did (for <a href="https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Extension:Semantic_Maps">Semantic Maps</a>) can be found in <a href="https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/87374">this commit</a>.</p>
<p><strong>Some more points of interest</strong></p>
<p>This was a nice little exercise in Python for me, making me more familiar with the language basics, which after several similar small projects, I now think I pretty much have mastered. Also fun was that this is the first project I did using <a href="http://www.aptana.com/products/studio3">Apatana Studio 3</a>, which was released very recently. It&#8217;s an <a href="http://www.eclipse.org/">Eclipse</a> based IDE aimed at Python and Ruby web development, including excellent support for JavaScript and various JS libraries such as jQuery and Ext. It also has some support for PHP, but that&#8217;s a bit meagre compared to Zend Studio or PhpStorm, an IntelliJ based IDE I&#8217;ve been trying out lately.</p>
<p><strong>More posts to come</strong></p>
<p>Over the past 2 years I&#8217;ve changed my blog posting style from posting casual updates about small stuff like this post, to only posting about new MediaWiki extensions or important updates to existing ones. I&#8217;ve decided to reverse this trend and post more lightweight for fun things, as opposed to only big release announcements <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2011/05/05/some-fun-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>from python import Modules, Classes, Namespaces</title>
		<link>http://blog.bn2vs.com/2009/11/10/from-python-import-modules-classes-namespaces/</link>
		<comments>http://blog.bn2vs.com/2009/11/10/from-python-import-modules-classes-namespaces/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 13:51:48 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Aptana Studio]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python 3]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=539</guid>
		<description><![CDATA[Last few days I had some time (while sitting on the train) to have a good look at the second part of the Python docs tutorial. I&#8217;ve now got a good understanding of everything up to classes, and know the most important language specific notations, behaviours and features. So far, Python strikes me as a [...]]]></description>
			<content:encoded><![CDATA[<p>Last few days I had some time (while sitting on the train) to have a good look at the second part of the <a href="http://docs.python.org/3.1/tutorial/index.html" target="_blank">Python docs tutorial</a>. I&#8217;ve now got a good understanding of everything up to classes, and know the most important language specific notations, behaviours and features.</p>
<p>So far, Python strikes me as a really nice language, with quite some features I haven&#8217;t come across before. Especially the data sequence types are neat, and you can do multi inheritance. There are a few things that I find rather odd though. These include the ability to simply add methods and fields dynamically to classes, and the inability to make class fields private, or write-only. This obviously goes against the encapsulation principle. A minor, but really awkward behaviour difference to the other languages I know is the working of the &#8216;whole division&#8217;-operator (in Python this is //). It works by doing a normal division and then math.floor&#8217;ing it. For positive numbers, this is no problems, but for negative numbers, you end up having a value that&#8217;s 1 off. For example, -7 // 2 will return -4, instead of -3.</p>
<p>Anyway, the final part of my Python studies will be to get a closer look at the Standard Library, how I can best compile applications into executables, and what GUI (and other) libraries I can use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/11/10/from-python-import-modules-classes-namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print(&#8220;Hai world&#8221;)</title>
		<link>http://blog.bn2vs.com/2009/11/05/printhai-world/</link>
		<comments>http://blog.bn2vs.com/2009/11/05/printhai-world/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:02:24 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Aptana Studio]]></category>
		<category><![CDATA[Hello world]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=515</guid>
		<description><![CDATA[Today I made quite some progress learning the basics of Python. After doing a traditional &#8220;O hai earf&#8221;, I went over the different core data types, control flow and data structures. Next in line are modules, I/O, exceptions and classes (yay!). I&#8217;m testing my understanding of the language in Aptana Studio, which I now have [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-531" title="Python" src="http://blog.bn2vs.com/wp-content/uploads/2009/11/python-logo.jpg" alt="Python" width="149" height="50" /><img class="size-full wp-image-532 alignright" title="LOLPython" src="http://blog.bn2vs.com/wp-content/uploads/2009/11/lolpython.png" alt="LOLPython" width="124" height="72" />Today I made quite some progress learning the basics of Python. After doing a traditional  &#8220;O hai earf&#8221;, I went over the different core data types, control flow and data structures. Next in line are modules, I/O, exceptions and classes (yay!).</p>
<p>I&#8217;m testing my understanding of the language in Aptana Studio, which I now have completely mobile, together with the Python 3.1 interpreter. Aptana Studio is so nice it also offers build in support for Jython and Iron Python, which I&#8217;m planning to mess around with later on. And, not to forget, LOLPython!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/11/05/printhai-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana Studio and Aptana RadRails</title>
		<link>http://blog.bn2vs.com/2009/10/30/aptana-studio-and-aptana-radrails/</link>
		<comments>http://blog.bn2vs.com/2009/10/30/aptana-studio-and-aptana-radrails/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:19:02 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Aptana Studio]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[RadRails]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=510</guid>
		<description><![CDATA[I&#8217;ve finally made up my mind about whether I&#8217;m going to learn Python or Ruby. I&#8217;ve been looking at both for nearly 2 months now, and could not really find a strong reason to use the one or the other. So I&#8217;ve simply decided to learn both. Both Ruby and Python have several good IDE&#8217;s. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally made up my mind about whether I&#8217;m going to learn <a href="http://en.wikipedia.org/wiki/Python_%28programming_language%29" target="_blank">Python</a> or <a href="http://en.wikipedia.org/wiki/Ruby_%28programming_language%29" target="_blank">Ruby</a>. I&#8217;ve been looking at both for nearly 2 months now, and could not really find a strong reason to use the one or the other. So I&#8217;ve simply decided to learn both.</p>
<p><a href="http://pydev.org/"><img class="alignleft size-full wp-image-512" title="Aptana PyDev" src="http://blog.bn2vs.com/wp-content/uploads/2009/10/pydev_banner2.gif" alt="Aptana PyDev" width="272" height="112" /></a>Both Ruby and Python have several good IDE&#8217;s. At <a href="http://blog.bn2vs.com/2009/10/16/arrrrcamp-gent-2009/" target="_blank">Arrrr Camp 2009</a>, I got recommended using <a href="http://www.radrails.org/" target="_blank">Aptana RadRails</a> for Ruby (on Rails) development. This IDE is based on Eclipse, so prompted an immediate download <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For Python, I&#8217;ve chosen <a href="http://pydev.org/" target="_blank">PyDev</a>, which is a plug-in for <a href="http://www.eclipse.org/" target="_blank">Eclipse</a> or <a href="http://en.wikipedia.org/wiki/Aptana_Studio" target="_blank">Aptana Studio</a>.<a href="http://www.radrails.org/"><img class="alignright size-full wp-image-511" title="Aptana RadRails" src="http://blog.bn2vs.com/wp-content/uploads/2009/10/radrails.png" alt="Aptana RadRails" width="187" height="56" /></a></p>
<p>I&#8217;ve put both IDE&#8217;s on my dev usb, and will start messing around with the languages as soon as I got some spare time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/10/30/aptana-studio-and-aptana-radrails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closing Zend and opening Visual Studio</title>
		<link>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/</link>
		<comments>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 01:37:23 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Class lirary]]></category>
		<category><![CDATA[DownloadLib]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[The Code Project]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Zend Studio]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=334</guid>
		<description><![CDATA[Now the Google Summer of Code coding period has finished, I can divide my attention between multiple projects again. Since I&#8217;ve been doing PHP and JavaScript only for over 2 months now, I&#8217;m starting off with taking a PHP-break. This means I won&#8217;t do any development of mayor new features for Maps or Semantic Maps, [...]]]></description>
			<content:encoded><![CDATA[<p>Now the <a href="http://blog.bn2vs.com/2009/04/26/google-summer-of-code-2009/" target="_blank">Google Summer of Code</a> coding period has finished, I can divide my attention between multiple projects again. Since I&#8217;ve been doing PHP and JavaScript only for over 2 months now, I&#8217;m starting off with taking a PHP-break. This means I won&#8217;t do any development of mayor new features for <a href="http://www.mediawiki.org/wiki/Extension:Maps#Description" target="_blank">Maps</a> or <a href="http://www.mediawiki.org/wiki/Extension:Semantic_Maps#Description" target="_blank">Semantic Maps</a>, and definitely won&#8217;t work on any other PHP project. Of course I&#8217;ll still ensure bugs get fixed for my mapping extensions, and help people out with code when needed, but that&#8217;s about it. So basically I&#8217;m closing my Zend Studio, which has become one of my most used applications in the last months, and starting my Visual Studio again. Now I think of it, this is really awkward. I used to start my VS practically every time I booted my computer for over a year, and then only opened it a handful of times in a 2 month period.</p>
<p>So, what am I going to work on now? One of my last projects before I started GSoC was a <a href="http://code.bn2vs.com/viewtopic.php?t=150" target="_blank">VB.Net background file downloader</a>, of which I released <a href="http://www.codeproject.com/KB/vb/FileDownloader.aspx" target="_blank">an article on The Code Project</a>, and later on created <a href="http://www.codeproject.com/KB/cs/BackgroundFileDownloader.aspx" target="_blank">a C# version</a>. I got quite some positive feedback on this project by people, although it was initially created with the sole purpose of helping that needed a simple downloader someone out, to improve my own skills, and to demonstrate how to create a simple to implement downloader. I&#8217;m now continuing this project, by rewriting it from scratch, to both add some mayor new features, and mess around with some multi-threading stuff I&#8217;ve been wanting to try out for months now.</p>
<p>The mayor new features that will be added are simultaneous downloads (the current classes only support one download at a time), segmented downloads (woot!), download priorities and bandwidth limitation options. This will require a nice OOP approach, with some more advanced multi-threading. I&#8217;m basing part of my code on <a href="http://www.codeproject.com/KB/IP/MyDownloader.aspx" target="_blank">MyDownloader</a>, an extremely nice C# downloader, which has quite some more functionality then what I&#8217;m doing. It&#8217;s more extensive then required for most people though, and not all that easy to implement. I also don&#8217;t really agree with some naming choices, and it lacks both code docs for devs that want to modify it, and devs that want to implement it. So clearly, I&#8217;ll put a lot of effort in keeping the new project as small and to-the-point as possible, and pay attention to easy of implementation, and usability. Another obvious difference is that this project is in VB.Net and not C#.Net. This has more advantages then disadvantages IMHO. If the project is compiled to a .dll or is used in a multi-project solution, it simply doesn&#8217;t matter what language it uses. A lot of casual programmers don&#8217;t know how to handle either, and the majority of these uses VB.Net, and not C#. And the ones that do know C# are more likely to know VB.Net then the other way around.</p>
<p>I&#8217;ve created a project on <a href="http://sourceforge.net" target="_blank">SourceForge</a> to host the code, and be able to commit to <a href="http://download-lib.svn.sourceforge.net/viewvc/download-lib/" target="_blank">the project&#8217;s SVN</a>. Since the project now contains multiple classes, I renamed it to <a href="https://sourceforge.net/projects/download-lib/" target="_blank">.Net DownloadLib</a>.</p>
<p>After that project I&#8217;m planing to put some real effort into my mapping extension for MediaWiki again, and possibly to have a look at Python and Ruby. When school starts again, somewhere half way through September, some new project opportunities will probably arise for me, but I guess I&#8217;ll see that then. I&#8217;m also looking forward to &#8216;learning to program&#8217; at school, which is destined to give me some great laughs. Luckily for me I&#8217;ll have to learn C++ at university, so I won&#8217;t be totally bored with it. I hope they don&#8217;t drive the low-level aspects of the language to far, since that&#8217;s pretty useless in today&#8217;s world IMHO.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

