<?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>Zsolt Török</title>
	<atom:link href="http://zsolttorok.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zsolttorok.com</link>
	<description></description>
	<lastBuildDate>Fri, 28 Oct 2011 21:17:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The corporations and me</title>
		<link>http://zsolttorok.com/2011/01/08/the-corporations-and-me/</link>
		<comments>http://zsolttorok.com/2011/01/08/the-corporations-and-me/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 20:42:40 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=276</guid>
		<description><![CDATA[The other day I was listening to the Linux Outlaws podcast during my commute; it was a special episode to look back on the year 2010. At the end of the episode Dan, Fab and their guest Ade Bradshaw each picked something they will remember this year by, and Dan said for him it was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://zsolttorok.com/wp-content/uploads/2011/01/stockvault-dollar-3d-text112966.jpg"><img class="size-full wp-image-283 alignleft" title="stockvault-dollar-3d-text112966" src="http://zsolttorok.com/wp-content/uploads/2011/01/stockvault-dollar-3d-text112966.jpg" alt="" width="300" height="240" /></a>The other day I was listening to the <a href="http://linuxoutlaws.com">Linux Outlaws</a> podcast during my commute; it was a <a href="http://linuxoutlaws.com/podcast/183">special episode to look back on the year 2010</a>. At the end of the episode Dan, Fab and their guest Ade Bradshaw each picked something they will remember this year by, and Dan said for him it was the &#8221; [...] year of mergers and lawsuits and aquisitions [...]&#8220;. Thinking back on these things it suddenly hit me: my life as a software engineer in Hungary is surprisingly strongly affected by large US-based corporations.</p>
<p>I&#8217;m making a living developing Java applications, and the current turmoil around Java worries me somewhat. Hopefully Oracle will learn from its recent mistakes that upset a big part of the community, and Java will continue to thrive. However, I&#8217;m actively looking at languages and technologies <a href="http://zsolttorok.com/2010/06/18/venturing-beyond-java/">beyond Java</a>, so as not to put all my eggs in Oracle&#8217;s basket.</p>
<p>I&#8217;m using several bits of Apple hardware: a home MacBook, a work MacBook Pro and an iPod Classic. Both laptops are running Mac OS X, and I haven&#8217;t hacked the iPod either, so there is definitely a strong link to Cupertino. However, I just couldn&#8217;t bring myself to buy an iPhone, when Android started catching up.</p>
<p>This brings us to the next West Coast company I&#8217;m relying on: Google. I have three Google accounts (two personal, one work), all linked to my Android phone. Although I do have a fairly up-to-date offline backup of my mailboxes, a disturbingly significant part of my online communication and identity relies on Google <a href="http://en.wikipedia.org/wiki/Don%27t_be_evil">not being evil</a> or not screwing up.</p>
<p>I could go on and mention Microsoft, Facebook, Twitter and all the rest, but I think I have made my point. Part of me thinks it&#8217;s amazing, that we have all these great companies and services we can use to learn, communicate and create in ways previous generations would have never imagined. On the other hand it&#8217;s somewhat unsettling to think of the implications of placing so much of our data, money and career in the hands of executive committees thousands of miles away.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2011/01/08/the-corporations-and-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Developing an XBMC plugin — Part 2: The anatomy of an XBMC plugin</title>
		<link>http://zsolttorok.com/2010/09/26/developing-an-xbmc-plugin-part-2/</link>
		<comments>http://zsolttorok.com/2010/09/26/developing-an-xbmc-plugin-part-2/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 17:04:34 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[XBMC]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=184</guid>
		<description><![CDATA[This post is the second part of my series on XBMC plugin development. In Part 1 — Documentation and tools I discussed the documentation and tools necessary to get started. If you haven&#8217;t read that, I suggest to do so. In this installment I will go over the steps of importing a simple example project [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the second part of my series on XBMC plugin development. In <a href="http://zsolttorok.com/2010/09/19/developing-an-xbmc-plugin-part-1/"><strong>Part 1 — Documentation and tools</strong></a> I discussed the documentation and tools necessary to get started. If you haven&#8217;t read that, I suggest to do so.<br />
In this installment I will go over the steps of importing a simple example project into PyDev, and walk you through the actual Python code.</p>
<h2>Getting the source</h2>
<p>You can get the <a href="http://github.com/zstorok/xbmc-plugin-tutorial">source code from GitHub</a>, or you can simply download <a href="http://zsolttorok.com/downloads/xbmc-plugin-tutorial.zip">this ZIPped Eclipse PyDev project</a>. Either way, the first step is to put the files in the <em>addons</em> folder of your XBMC installation. The location of this folder depends on your operating system:</p>
<ul>
<li>Linux: <em>~/.xbmc/addons</em></li>
<li>Mac OS X: <em>~/Library/Application Support/XBMC/addons</em></li>
<li>Windows: <em>C:\Program Files\XBMC\addons</em></li>
</ul>
<h3>Using Git</h3>
<p>Creating a new folder called <em>plugin.audio.tutorial</em>, and run <code>git checkout</code> from there. The repository location is: <em>git://github.com/zstorok/xbmc-soundcloud-plugin.git</em>.</p>
<h3>Using the ZIP file</h3>
<p>If you are using the ZIP file, you can simply extract it in the <em>addons </em>folder, since it already includes the <em>plugin.audio.tutorial</em> folder.</p>
<h3>Testing with XBMC</h3>
<p>Although the location of the addon folders should be unambiguous, it&#8217;s best to make sure and check if XBMC actually finds the newly added plugin. Launch XBMC and go to <em>Music | Music Add-ons</em> to see if the plugin is picked up by XBMC. You should see an <em>XBMC Plugin Tutorial</em> item in the list, just like in the screenshot below. Go ahead and explore the tutorial plugin to explore what it does.</p>
<p style="text-align: center;"><a href="http://zsolttorok.com/wp-content/uploads/2010/09/XBMC-Music-Add-ons.png"><img class="aligncenter size-full wp-image-223" title="XBMC Music Add-ons" src="http://zsolttorok.com/wp-content/uploads/2010/09/XBMC-Music-Add-ons.png" alt="" width="448" height="303" /></a></p>
<p><span id="more-184"></span></p>
<h3>Importing into Eclipse</h3>
<p>The next step is to get the code into Eclipse. Go to <em>File | New&#8230; | PyDev project</em> and give the new project a name. Uncheck the <em>Use default</em> checkbox under <em>Project contents</em>, and browse for the <em>plugin.audio.tutorial</em> folder in your <em>addons</em> folder. Set <em>Grammar Version</em> to <em>2.4</em> and <em>Interpreter</em> to <em>Default</em>, and also make sure to uncheck the <em>Create default &#8216;src&#8217; folder&#8230;</em> checkbox. See the screenshot below for how it should look on Mac OS X; other platforms will only differ in the directory location. Click <em>Finish</em> to accept all the other defaults.</p>
<p style="text-align: center;"><a href="http://zsolttorok.com/wp-content/uploads/2010/09/PyDev-Project-Wizard.png"><img class="aligncenter size-full wp-image-226" title="PyDev Project Wizard" src="http://zsolttorok.com/wp-content/uploads/2010/09/PyDev-Project-Wizard.png" alt="" width="474" height="432" /></a></p>
<p>Next, right-click on the newly created project and select <em>Properties</em>. Go to the <em>PyDev &#8211; PYTHONPATH</em> property page and add the project folder as a source folder, like it is shown in the screenshot below.</p>
<p style="text-align: left;"><a href="http://zsolttorok.com/wp-content/uploads/2010/09/Edit-PYTHONPATH.png"><img class="aligncenter size-full wp-image-228" title="Edit PYTHONPATH" src="http://zsolttorok.com/wp-content/uploads/2010/09/Edit-PYTHONPATH.png" alt="" width="472" height="325" /></a></p>
<h2>Exploring the files</h2>
<p>Now you&#8217;re all set to begin working with the code. The newly created PyDev project contains the following files:</p>
<ul>
<li><strong>addon.xml</strong> (the plugin metadata descriptor)</li>
<li><strong>default.py</strong> (and the actual Python code)</li>
<li><strong>icon.png</strong> (plugin icon, 256&#215;256 PNG)</li>
</ul>
<h3>addon.xml</h3>
<p>This XML file contains various bits of metadata about the addon, for example: name, version, author, dependencies, etc. The <a href="http://wiki.xbmc.org/index.php?title=Addons_for_XBMC">XBMC Wiki</a> goes into the syntax and purpose of this file in detail.</p>
<h3>default.py</h3>
<p>This is where the meat is: the actual Python code. I will go over the main sections of it in detail, and I suggest keeping the <a href="http://xbmc.sourceforge.net/python-docs/">XBMC Python module documentation</a> handy to quickly look up the relevant API classes and functions.<br />
One thing to keep in mind is, that the code is run by XBMC every time you enter a directory in your plugin. As you will see, the usual practice to pass information (subdirectory location, query parameters, etc.) between subsequent invocations is to encode them as <a href="http://en.wikipedia.org/wiki/Query_string">query strings</a> in the list item URLs. On each invocation, the URL is provided as a command line argument in <em><a href="http://docs.python.org/library/sys.html">sys.argv</a></em>, which is then parsed to obtain the parameter names and values. This will make a lot more sense once you see it in action, so let&#8217;s dive into the code.<br />
First we import the three XBMC modules, <em>sys</em> for handling command line arguments and <em>urllib</em> for encoding and decoding parameters in URLs.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> xbmc, xbmcgui, xbmcplugin
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib</span></pre></div></div>

<p>Next we initialize some constants, you will see how these are used a bit later.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># plugin modes</span>
<span style="color: #808080; font-style: italic;"># plugin modes</span>
MODE_FIRST = <span style="color: #ff4500;">10</span>
MODE_SECOND = <span style="color: #ff4500;">20</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># parameter keys</span>
PARAMETER_KEY_MODE = <span style="color: #483d8b;">&quot;mode&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># menu item names</span>
FIRST_SUBMENU = <span style="color: #483d8b;">&quot;First Submenu&quot;</span>
SECOND_SUBMENU = <span style="color: #483d8b;">&quot;Second Submenu&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># plugin handle</span>
handle = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Next up are two utility functions: the first is for converting URL parameters to a Python dict, the second one is for adding an item to the directory listing in XBMC. The latter contains the first truly XBMC specific code. First it creates a <em><a href="http://xbmc.sourceforge.net/python-docs/xbmcgui.html#ListItem">ListItem</a></em>, then calls <em><a href="http://xbmc.sourceforge.net/python-docs/xbmcplugin.html#-addDirectoryItem">xbmcplugin.addDirectoryItem(&#8230;)</a></em> to add it to the current directory listing. Also, it encodes various parameters we want to pass on to the next invocation of our plugin script into the directory item&#8217;s URL. Remember, <em>default.py</em> is run each time you select a list item in the UI, and we need to pass on some information about where we are in the menu structure.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># utility functions</span>
<span style="color: #ff7700;font-weight:bold;">def</span> parameters_string_to_dict<span style="color: black;">&#40;</span>parameters<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">' Convert parameters encoded in a URL to a dict. '</span><span style="color: #483d8b;">''</span>
    paramDict = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> parameters:
        paramPairs = parameters<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&amp;amp;&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> paramsPair <span style="color: #ff7700;font-weight:bold;">in</span> paramPairs:
            paramSplits = paramsPair.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'='</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>paramSplits<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> == <span style="color: #ff4500;">2</span>:
                paramDict<span style="color: black;">&#91;</span>paramSplits<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span> = paramSplits<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> paramDict
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> addDirectoryItem<span style="color: black;">&#40;</span>name, isFolder=<span style="color: #008000;">True</span>, parameters=<span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">' Add a list item to the XBMC UI.'</span><span style="color: #483d8b;">''</span>
    li = xbmcgui.<span style="color: black;">ListItem</span><span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span>
    url = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">'?'</span> + <span style="color: #dc143c;">urllib</span>.<span style="color: black;">urlencode</span><span style="color: black;">&#40;</span>parameters<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> xbmcplugin.<span style="color: black;">addDirectoryItem</span><span style="color: black;">&#40;</span>handle=<span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>, url=url, listitem=li, isFolder=isFolder<span style="color: black;">&#41;</span></pre></div></div>

<p>Now we are getting to the part where the root menu and the two submenus are created. These functions make use of the <em>addDirectoryItem(&#8230;)</em> function defined above.<br />
The <em>show_root_menu()</em> function adds two folder items, and specifies the mode associated with the item via the <em>parameters</em> argument. Since it&#8217;s a <em>dict</em>, you could put any kind of information here, but to keep it simple, this example only sets the mode. After the two items are added, it calls <a href="http://xbmc.sourceforge.net/python-docs/xbmcplugin.html#-endOfDirectory">xbmcplugin.endOfDirectory(&#8230;)</a> to indicate, that we don&#8217;t want to add any more items to the list.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># UI builder functions</span>
<span style="color: #ff7700;font-weight:bold;">def</span> show_root_menu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">' Show the plugin root menu. '</span><span style="color: #483d8b;">''</span>
    addDirectoryItem<span style="color: black;">&#40;</span>name=FIRST_SUBMENU, parameters=<span style="color: black;">&#123;</span> PARAMETER_KEY_MODE: MODE_FIRST <span style="color: black;">&#125;</span>, isFolder=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    addDirectoryItem<span style="color: black;">&#40;</span>name=SECOND_SUBMENU, parameters=<span style="color: black;">&#123;</span> PARAMETER_KEY_MODE: MODE_SECOND <span style="color: black;">&#125;</span>, isFolder=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    xbmcplugin.<span style="color: black;">endOfDirectory</span><span style="color: black;">&#40;</span>handle=handle, succeeded=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></div></div>

<p>The <em>show_first_submenu()</em> and <em>show_second_submenu()</em> functions simply create and insert a few dummy items into the submenus. Note that these are not folder items, so in a real plugin these would be the actual media files (images, audio and video clips). Of course you can create a menu structure of any depth, but in this example I kept it as simple as possible.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> show_first_submenu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">' Show first submenu. '</span><span style="color: #483d8b;">''</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">5</span><span style="color: black;">&#41;</span>:
        name = <span style="color: #483d8b;">&quot;%s Item %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>FIRST_SUBMENU, i<span style="color: black;">&#41;</span>
        addDirectoryItem<span style="color: black;">&#40;</span>name, isFolder=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    xbmcplugin.<span style="color: black;">endOfDirectory</span><span style="color: black;">&#40;</span>handle=handle, succeeded=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> show_second_submenu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">' Show second submenu. '</span><span style="color: #483d8b;">''</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>:
        name = <span style="color: #483d8b;">&quot;%s Item %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>SECOND_SUBMENU, i<span style="color: black;">&#41;</span>
        addDirectoryItem<span style="color: black;">&#40;</span>name, isFolder=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    xbmcplugin.<span style="color: black;">endOfDirectory</span><span style="color: black;">&#40;</span>handle=handle, succeeded=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></div></div>

<p>The last part of the code is the most important: this is where the parameters encoded in the URL are parsed to decide which function to invoke to display the expected menu.<br />
If <em>sys.argv[2]</em> is unspecified it means that we are at the top level, so the root menu should be displayed. The actual submenus have a mode associated with them, which is encoded into their item URLs when they are added to the root menu.<br />
If you want to follow what is happening when running a plugin, you can take a look at the XBMC log. In this example, the mode is printed into the log at each invocation.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># parameter values</span>
params = parameters_string_to_dict<span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
mode = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>params.<span style="color: black;">get</span><span style="color: black;">&#40;</span>PARAMETER_KEY_MODE, <span style="color: #483d8b;">&quot;0&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;##########################################################&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Mode: %s&quot;</span> <span style="color: #66cc66;">%</span> mode<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;##########################################################&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Depending on the mode, call the appropriate function to build the UI.</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>:
    <span style="color: #808080; font-style: italic;"># new start</span>
    ok = show_root_menu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">elif</span> mode == MODE_FIRST:
    ok = show_first_submenu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">elif</span> mode == MODE_SECOND:
    ok = show_second_submenu<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This is all that&#8217;s required to have a simple, executable XBMC plugin. Of course currently it&#8217;s not very useful, since the items are not tied to actual media files. In the next part I will show you how to connect to the SoundCloud API and stream music directly in XBMC.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/09/26/developing-an-xbmc-plugin-part-2/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Developing an XBMC plugin — Part 1: Documentation and tools</title>
		<link>http://zsolttorok.com/2010/09/19/developing-an-xbmc-plugin-part-1/</link>
		<comments>http://zsolttorok.com/2010/09/19/developing-an-xbmc-plugin-part-1/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 13:13:29 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SoundCloud]]></category>
		<category><![CDATA[XBMC]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=132</guid>
		<description><![CDATA[Being a fan of the XBMC cross-platform media center application — which can be extended with Python scripts — and the SoundCloud music sharing website — which exposes a nicely designed RESTful API — I decided to develop a music plugin for XBMC to access music shared on SoundCloud.]]></description>
			<content:encoded><![CDATA[<p><a href="http://zsolttorok.com/wp-content/uploads/2010/09/XBMC-SoundCloud-logo-512x512.png"><img class="alignleft size-full wp-image-173" style="margin: 10px;" title="XBMC-SoundCloud-logo-512x512" src="http://zsolttorok.com/wp-content/uploads/2010/09/XBMC-SoundCloud-logo-512x512.png" alt="" width="200" height="200" /></a>In one of my previous posts I wrote about <a href="http://zsolttorok.com/2010/06/18/venturing-beyond-java/">learning up-and-coming programming languages</a> and listed a few I was particularly interested in. One of these languages was Python, and in the last few weeks I spent a couple of hours getting familiar with the language and the built-in class library. Being an avid Eclipse user I installed <a href="http://pydev.org">PyDev</a>, which was a great help with its content assist and syntax checking.</p>
<p>However, I prefer learning by doing, so after a while I started thinking about a real-life problem to solve with Python. Being a fan of the <a href="http://xbmc.org">XBMC cross-platform media center</a> application — which can be extended with Python scripts — and the <a href="http://soundcloud.com">SoundCloud music sharing website</a> — which exposes a nicely designed RESTful API — I decided to develop a <a href="http://github.com/zstorok/xbmc-soundcloud-plugin">music plugin for XBMC to access music shared on SoundCloud</a>.</p>
<p>In the first post of this multi-part series I will provide an overview of the documentation and tools available at the time of writing. Stay tuned for the next parts, where I will go into more detail and post some actual code. The outline of things to come:</p>
<ul>
<li>Part 1: Documentation and tools</li>
<li><a href="http://zsolttorok.com/2010/09/26/developing-an-xbmc-plugin-part-2/">Part 2: The anatomy of an XBMC plugin</a></li>
<li>Part 3: Accessing public resources on SoundCloud</li>
<li>Part 4: Putting it all together</li>
</ul>
<p><span id="more-132"></span></p>
<h2>SoundCloud API</h2>
<p>A quick glance at the <a href="http://github.com/soundcloud/api/wiki">SoundCloud API page on GitHub</a> revealed an existing Python API wrapper, but unfortunately it wasn&#8217;t compatible with XBMC&#8217;s built-in Python 2.4 runtime. This meant that I had to roll my own, which proved to be fairly easy once I hunted down the required third-party dependencies, like <a href="http://code.google.com/p/simplejson/">simplejson</a>, <a href="http://code.google.com/p/httplib2/">httplib2</a> and <a href="http://github.com/simplegeo/python-oauth2">oauth2</a>. I haven&#8217;t had the time yet to dig into SoundCloud&#8217;s OAuth-based authentication, so for the first version I decided to provide access to publicly available resources only, and implement authentication, favorite tracks, followed/follower users, etc. in a future iteration.</p>
<p>The <a href="http://wiki.github.com/soundcloud/api/01-introduction">SoundCloud API documentation</a> is very detailed and well-structured. SoundCloud even provides a <a href="http://soundcloud.com/developers/console">web console</a> with plenty of examples for experimenting with the API to see how it responds to various requests. This is just awesome, every RESTful web service should provide one of these; it is a lot more tangible than API documentation, and easier than firing up <em>curl</em> or a full-fledged web browser and copying example URLs from the documentation. After hacking together a quick and dirty Python command-line client, I was ready to integrate it with XBMC.</p>
<h2>XBMC Plugin Development</h2>
<p>The <a href="http://wiki.xbmc.org/index.php?title=HOW-TO_write_plugins_for_XBMC">XBMC plugin development HOW-TO</a> is not very well organized and is missing some details. I had to do a fair amount of googling and bookmarking to get a complete picture of how plugins hook into the application and what the best practices are. The most helpful resources I could find were the following:</p>
<ul>
<li>The single most important resource is the <a href="http://xbmc.sourceforge.net/python-docs/">Python module documentation,</a> which is unfortunately not very easy to find. Here you can find all the classes and methods exposed to Python scripts and plugins by XBMC.</li>
<li>Since I was using PyDev for development I was very happy to find this excellent tutorial on <a href="http://wiki.xbmc.org/index.php?title=HOW-TO_debug_Python_Scripts_with_Eclipse">how to debug XBMC plugins with PyDev</a>.</li>
<li>When preparing for this blog post I stumbled upon a PyDev script, which provides <a href="http://forum.xbmc.org/showthread.php?p=585749">content assist for XBMC modules</a>. This is necessary, because the XBMC modules are implemented in C++ and are exposed directly via the Python runtime in XBMC. This means, that PyDev has no <em>.py</em> files to work with when trying to determine the contents of a given module. I will try to get it working and update this post accordingly.</li>
</ul>
<p>While I was digging into the idiosyncrasies of XBMC plugin development, the XBMC community started to prepare for the upcoming Dharma release, in which they made some changes to the add-on infrastructure, and extended <a href="http://wiki.xbmc.org/index.php?title=Addons_for_XBMC">the add-on developer documentation</a> on their Wiki. I decided to target the upcoming release with my plugin, which turned out to require creating an addon.xml file and some minor tweaking of the code itself, but I will get to that in <em>Part 2</em>.</p>
<p>This concludes the first part of the series. In <a href="http://zsolttorok.com/2010/09/26/developing-an-xbmc-plugin-part-2/"><em>Part 2</em></a> I will go into more details on how to develop an XBMC plugin, provide some advice to prevent common pitfalls and show some simple code snippets.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/09/19/developing-an-xbmc-plugin-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to identify a counterfeit Nokia BP-6MT battery</title>
		<link>http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/</link>
		<comments>http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 22:09:37 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[counterfeit]]></category>
		<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=109</guid>
		<description><![CDATA[A few weeks ago I purchased a Nokia BP-6MT battery at a mobile phone shop (Fortuna GSM) in a local shopping mall (Pólus Center). I was looking for a replacement battery for my Nokia N82, because the battery I&#8217;ve been using for more than 2 years started to swell and even slightly deformed the back [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I purchased a Nokia BP-6MT battery at a mobile phone shop (<a href="http://www.fortunagsm.hu/">Fortuna GSM</a>) in a local shopping mall (<a href="http://www.polus.hu/">Pólus Center</a>). I was looking for a replacement battery for my Nokia N82, because the battery I&#8217;ve been using for more than 2 years started to swell and even slightly deformed the back cover of the phone. The official Nokia store in the same mall didn&#8217;t have this particular battery in stock, but I kept looking around in other stores nearby, and eventually stumbled upon one in the above mentioned store. The packaging looked good, it even had a Nokia hologram — albeit a bit darker than the one on my original battery, but I haven&#8217;t noticed that in the store.<br />
When I took it home and opened the packaging, I decided to google for <a href="http://europe.nokia.com/support/product-support/check-your-battery">instructions on how to check the authenticity of a Nokia battery</a>. The hologram obviously failed the test, as you will see from my photos below. After that I started to notice other small signs, like the low quality printing of the included package insert. I decided not to risk damaging my phone or myself by using a counterfeit Nokia battery — they have the reputation to explode —, so I went out and bought an original from an official Nokia shop in a different shopping mall. The differences were painfully obvious after comparing the counterfeit and the original battery, so I decided to take a few pictures and post them here, maybe I can save somebody from buying a counterfeit Nokia BP-6MT battery.<span id="more-109"></span><br />

<a href='http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/nokia-b6-mt-packaging-front/' title='Nokia BP-6MT Packaging (front)'><img width="150" height="112" src="http://zsolttorok.com/wp-content/uploads/2010/08/Nokia-B6-MT-Packaging-front.jpg" class="attachment-thumbnail" alt="Nokia BP-6MT Packaging (front)" title="Nokia BP-6MT Packaging (front)" /></a>
<a href='http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/nokia-b6-mt-packaging-back/' title='Nokia BP-6MT Packaging (back)'><img width="150" height="112" src="http://zsolttorok.com/wp-content/uploads/2010/08/Nokia-B6-MT-Packaging-back.jpg" class="attachment-thumbnail" alt="Nokia BP-6MT Packaging (back)" title="Nokia BP-6MT Packaging (back)" /></a>
<a href='http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/nokia-b6-mt-batteries-front/' title='Nokia BP-6MT Batteries (front)'><img width="150" height="92" src="http://zsolttorok.com/wp-content/uploads/2010/08/Nokia-B6-MT-Batteries-front.jpg" class="attachment-thumbnail" alt="Nokia BP-6MT Batteries (front)" title="Nokia BP-6MT Batteries (front)" /></a>
<a href='http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/nokia-b6-mt-batteries-back/' title='Nokia BP-6MT Batteries (back)'><img width="150" height="88" src="http://zsolttorok.com/wp-content/uploads/2010/08/Nokia-B6-MT-Batteries-back.jpg" class="attachment-thumbnail" alt="Nokia BP-6MT Batteries (back)" title="Nokia BP-6MT Batteries (back)" /></a>
<a href='http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/nokia-b6-mt-batteries-top/' title='Nokia BP-6MT Batteries (top)'><img width="150" height="29" src="http://zsolttorok.com/wp-content/uploads/2010/08/Nokia-B6-MT-Batteries-top.jpg" class="attachment-thumbnail" alt="Nokia BP-6MT Batteries (top)" title="Nokia BP-6MT Batteries (top)" /></a>
<br />
The packaging of the counterfeit battery is quite different from the original, maybe they copied an older Nokia design. However, the colors and visual elements definitely have the Nokia feel, so they did a very good job at that. They even included a low-quality copy of the Nokia package insert, which — quite ironically — includes instructions on how to identify counterfeit batteries. But the most important clue when looking at the packaging from the front is the hologram sticker on the battery itself, which is a lot darker and lower quality on the counterfeit battery, presumably to keep the manufacturing costs down. The back of the packaging is less interesting, no obvious tell-tale signs there.<br />
The shots of the batteries themselves show the differences between the holograms even better, and they also reveal a couple of minor differences in their shapes: the original battery has rounded corners and a little hole on both sides. Also, the label seems to fit a lot better on the original battery.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/08/24/how-to-identify-a-counterfeit-nokia-bp-6mt-battery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to load and compare arbitrary XML files with EMF</title>
		<link>http://zsolttorok.com/2010/08/01/how-to-load-and-compare-arbitrary-xml-files-with-emf/</link>
		<comments>http://zsolttorok.com/2010/08/01/how-to-load-and-compare-arbitrary-xml-files-with-emf/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 20:51:05 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSD]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=68</guid>
		<description><![CDATA[In this article I will show you how to load an arbitrary XML file — provided you have the schema for it — into EMF, without generating any additional artifacts.]]></description>
			<content:encoded><![CDATA[<p>If you are somewhat familiar with the Eclipse Modeling Framework (EMF) you might know, that you can generate Ecore meta-models from UML, XSD and annotated Java interfaces. This feature is well-documented and it is a great way to lower the barrier of entry for new users. However, the textbook approach requires you to generate an Ecore meta-model, and the corresponding Java implementation.<br />
In this article I will show you how to load an arbitrary XML file — provided you have the schema for it — into EMF, without generating any additional artifacts. Why would anyone want to do that, and deal with instances of <code>DynamicEObjectImpl</code>s as opposed to meaningfully named domain model classes? In my case I only needed a way to feed the loaded objects directly into <a href="http://www.eclipse.org/modeling/emf/?project=compare#compare">EMF Compare</a>, in order to compare two XML files by content, as opposed to textual representation.</p>
<p><span id="more-68"></span><br />
First the source code, then some explanation.</p>
<pre>// generate EPackages from schemas
XSDEcoreBuilder xsdEcoreBuilder = new XSDEcoreBuilder();
Collection generatedPackages = xsdEcoreBuilder.generate(schemaURI);

// register the packages loaded from XSD
for (EObject generatedEObject : generatedPackages) {
    if (generatedEObject instanceof EPackage) {
        EPackage generatedPackage = (EPackage) generatedEObject;
        EPackage.Registry.INSTANCE.put(generatedPackage.getNsURI(),
            generatedPackage);
    }
}

// add file extension to registry
ResourceFactoryRegistryImpl.INSTANCE.getExtensionToFactoryMap()
    .put(MY_FILE_EXTENSION, new GenericXMLResourceFactoryImpl());
</pre>
<p>The first step is loading the schemas and generating <code>EPackage</code>s from them. <code>XSDEcoreBuilder</code> provides a convenient method which does both. The return value is of the type <code>Collection&lt;EObject&gt;</code> as opposed to <code>Collection&lt;EPackage&gt;</code>, so the next step is iterating over that collection, casting the items and registering them in the global package registry. This ensures that the generated packages will be available in the whole application. Finally, if your XML files have a custom extension, add that as a key to the resource factory registry, with an <code>GenericXMLResourceFactoryImpl</code> instance as the value. By doing that you make sure, that EMF will know which resource factory to use when loading or saving files of this type.<br />
After that you can load you XML files like you would normally do:</p>
<pre>
ResourceSet resourceSet = ResourceSetFactory.createResourceSet();
Resource resource = resourceSet.getResource(xmlURI, true);
resource.load(Collections.EMPTY_MAP);
EObject root = resource.getContents().get(0);
...
</pre>
<p>If you want to compare the contents of two XML files you just loaded, you can use EMF Compare&#8217;s fairly easy and clean API:</p>
<pre>
MatchModel match = MatchService.doMatch(model1, model2,
	Collections.<String, Object> emptyMap());
DiffModel diff = DiffService.doDiff(match, false);
</pre>
<p>For more details on how to use the API, see the <a href="http://wiki.eclipse.org/EMF_Compare/FAQ#How_can_I_use_EMF_Compare_programmatically.3F">EMF Compare FAQ</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/08/01/how-to-load-and-compare-arbitrary-xml-files-with-emf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great news for Android and Maven fans</title>
		<link>http://zsolttorok.com/2010/07/09/great-news-for-android-and-maven-fans/</link>
		<comments>http://zsolttorok.com/2010/07/09/great-news-for-android-and-maven-fans/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 17:38:11 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=63</guid>
		<description><![CDATA[Although the official Android SDK caters for most needs of Android developers, it seems that the Android community is willing to improve the existing tools to suit their taste. A prime example of this is the m2eclipse Android integration and the addition of Android artifacts to the Maven Central repository (see Jason van Zyl&#8217;s post [...]]]></description>
			<content:encoded><![CDATA[<p>Although the official Android SDK caters for most needs of Android developers, it seems that the Android community is willing to improve the existing tools to suit their taste. A prime example of this is the <a title="m2eclipse Android integration" href="http://code.google.com/p/maven-android-plugin">m2eclipse Android integration</a> and the addition of Android artifacts to the Maven Central repository (see <a href="http://www.sonatype.com/people/2010/07/droid-does-maven/">Jason van Zyl&#8217;s post at the Sonatype blog</a> for more information).</p>
<p>Looks like it&#8217;s easier than ever to get started with Android development in Eclipse, I will have to try that for myself this weekend&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/07/09/great-news-for-android-and-maven-fans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android and OSGi</title>
		<link>http://zsolttorok.com/2010/07/07/android-and-osgi/</link>
		<comments>http://zsolttorok.com/2010/07/07/android-and-osgi/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 21:35:14 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[OSGi]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=44</guid>
		<description><![CDATA[It&#8217;s official: I *want* an Android phone. I&#8217;ve spent quite some time eyeballing the most recently released ones, but haven&#8217;t made up my mind yet. One of my colleagues got an HTC Desire recently, so I will wait a bit and see how well it works for him. His biggest gripe so far – in [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s official: I *want* an Android phone. I&#8217;ve spent quite some time eyeballing the most recently released ones, but haven&#8217;t made up my mind yet. One of my colleagues got an <a href="http://www.htc.com/www/product/desire/overview.html">HTC Desire</a> recently, so I will wait a bit and see how well it works for him. His biggest gripe so far – in line with most opinions I read online –  seems to be the battery life: it needs to be charged every day. Also – he explained to me – you don&#8217;t really quit Android apps when you close them, they hang around in the background, ready to be reactivated. This strange behaviour got me intrigued, so I did some online research on this topic. <span id="more-44"></span>
<p style="text-align: left;">Eventually I found a very interesting and extremely detailed <a href="http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238#2034238">StackOverflow response</a> regarding the <strong>Android application lifecycle</strong> and why it is different from desktop applications and more similar to web applications. Another thorough explanation of what is happening with applications in the background is presented in this video by an Android team member:</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/fL6gSd4ugSI" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/fL6gSd4ugSI"></embed></object></p>
<p style="text-align: left;">Another interesting thing caught my eye while browsing for Android related bits and pieces: apparently there is a lot of activity regarding<strong> OSGi on Android</strong>. <a href="http://opensource.luminis.net/wiki/display/SITE/Apache+Felix+on+Androids">Apache Felix</a> and <a href="http://www.eclipsecon.org/2008/index.php?page=sub/&amp;id=380">Equinox</a> were both successfully patched to run on Android, and ProSyst released their <a href="http://prosyst.com/index.php/de/html/content/46/Mobile-OSGi-Runtimes/">free OSGi runtime</a> for several major mobile platforms, including Android. <a href="http://njbartlett.name">Neil Bartlett</a>, one of the developers experimenting with Equinox on Android talks about this activity in a video interview with <a href="http://www.redmonk.com/cote/">Michael Coté</a>:</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="318" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blip.tv/play/gdMGwYJ8Ag%2Em4v" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="318" src="http://blip.tv/play/gdMGwYJ8Ag%2Em4v" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/07/07/android-and-osgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Venturing beyond Java</title>
		<link>http://zsolttorok.com/2010/06/18/venturing-beyond-java/</link>
		<comments>http://zsolttorok.com/2010/06/18/venturing-beyond-java/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 20:49:33 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=14</guid>
		<description><![CDATA[Lately I&#8217;ve been thinking about doing something a bit adventurous: venturing into the land of the &#8220;cool&#8221; programming languages. I really like programming in Java. However, after all the time I spent learning various aspects of the language itself and numerous useful third-party libraries, I would like to broaden my horizons. After looking around on [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking about doing something a bit adventurous: venturing into the land of the &#8220;cool&#8221; programming languages.</p>
<p>I really like programming in Java. However, after all the time I spent learning various aspects of the language itself and numerous useful third-party libraries, I would like to broaden my horizons. After looking around on the web I found a great <a href="http://www.hotscripts.com/blog/determining-programming-language-popularity/">summary of various methods to measure the popularity of programming languages</a>. <span id="more-14"></span>Out of the methods mentioned there, I liked LangPop&#8217;s approach the most, since it combines different sources into a normalized comparison. You can even modify the weights assigned to the data sources, if you feel that for example the number of projects using a specific programming language on Google Code is more relevant than the job listings on Craiglist. See the chart embedded below for the most recent normalized popularity comparison.</p>
<div align="center"><script src="http://www.langpop.com/javascripts/chartr.js" type="text/javascript"></script> <script src="http://www.langpop.com/javascripts/langpop-small.js" type="text/javascript"></script></div>
<p/>
<p>Github was not considered in the comparison, but the website has a page with <a href="http://github.com/languages">statistics on the most popular programming languages</a>:</p>
<p/><a href="http://zsolttorok.com/wp-content/uploads/2010/06/github-languages.png"><img class="aligncenter size-full wp-image-26" style="border: 20px none;" title="github languages" src="http://zsolttorok.com/wp-content/uploads/2010/06/github-languages.png" alt="" width="583" height="373" /></a></p>
<p/>
<p><strong><a href="http://www.python.org/">Python</a></strong> is quite high on both of these charts, and I&#8217;ve already read some online tutorials about it, which left me quite impressed. I have yet to try the Eclipse tooling for Python, but <a href="http://pydev.org/">Pydev</a> seems to be a mature project, so I have high hopes in that regard. <strong><a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a></strong> is obviously very popular and one of the <em>de facto</em> web programming languages, so it comes as a close second on my list. <strong><a href="http://www.scala-lang.org/">Scala</a></strong> is an interesting one: not really popular, but apparently a very good choice for parallel programming on the JVM. Again, this is something I&#8217;ve never tried but seems to gain lots of momentum with the widespread adoption of multi-core processors.</p>
<p>I will try to find some time to dig into these exciting new technologies, it will be interesting to learn new approaches and paradigms beyond what Java and OOP taught me.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/06/18/venturing-beyond-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unofficial Eclipse client for StackOverflow.com</title>
		<link>http://zsolttorok.com/2010/06/13/example-eclipse-client-for-stackoverflow-com/</link>
		<comments>http://zsolttorok.com/2010/06/13/example-eclipse-client-for-stackoverflow-com/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 21:25:50 +0000</pubDate>
		<dc:creator>Zsolt</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[DemoCamp]]></category>
		<category><![CDATA[ECF]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Helios]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[StackOverflow]]></category>

		<guid isPermaLink="false">http://zsolttorok.com/?p=8</guid>
		<description><![CDATA[A few weeks ago I gave a quick demo of the new RESTful capabilities of the Eclipse Communication Framework (ECF) at the Eclipse Helios DemoCamp in Budapest. I created a small Eclipse plugin, which contributed a view and a preference page to the UI and utilized the public REST API of StackOverflow.com to retrieve various [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I gave a quick demo of the <a href="http://eclipseecf.blogspot.com/2010/01/soap-rest-and-ecf-remote-services.html">new RESTful capabilities of the Eclipse Communication Framework (ECF)</a> at the <a href="http://wiki.eclipse.org/Eclipse_DemoCamps_Helios_2010/Budapest">Eclipse Helios DemoCamp in Budapest</a>.</p>
<p><div id="attachment_24" class="wp-caption aligncenter" style="width: 626px"><a href="http://zsolttorok.com/wp-content/uploads/2010/06/se4ecf_screenshot.png"><img class="size-medium wp-image-24 " title="se4ecf_screenshot" src="http://zsolttorok.com/wp-content/uploads/2010/06/se4ecf_screenshot.png" alt="" width="616" height="355" /></a><p class="wp-caption-text">Screenshot of the unofficial StackExchange Eclipse client plug-in</p></div><br />
<span id="more-8"></span><br />
I created a small Eclipse plugin, which contributed a view and a preference page to the UI and utilized the public REST API of <a href="http://stackoverflow.com">StackOverflow.com</a> to retrieve various bits of user data, including a Gravatar image. Since my time was limited, I couldn&#8217;t put all the fancy features in it which I initially planned, for example regular polling of user data, notification bubbles, etc.</p>
<p>Actually, I was somewhat surprised, that there is no<a href="http://wiki.eclipse.org/Platform_UI/Notifications"> built-in support for notifications in Eclipse,</a> but allegedly the Mylyn implementation will be migrated to the main Eclipse Platform code base sometime in the future. However, there is a <a href="http://hexapixel.com/2009/06/30/creating-a-notification-popup-widget">short and sweet example of how to implement a notification popup widget from scratch</a>,which I plan to use for this pet project.</p>
<p>Since the RESTful client capabilities of ECF are quite new I struggled a bit with learning how to do things, but I managed to get the hang of it by dissecting the relevant JUnit tests. I might have gotten some things wrong, or just not so pretty, but it worked for the demo. I created an <a href="http://code.google.com/a/eclipselabs.org/p/se4ecf/">Eclipse Labs project</a> to host the code, and I will continue to work on it in my spare time. Hopefully this example code will help someone to learn the ropes of ECF Remote Services, and maybe eventually people might even want to use it to stay connected to StackOverflow.com even in their IDE.</p>
]]></content:encoded>
			<wfw:commentRss>http://zsolttorok.com/2010/06/13/example-eclipse-client-for-stackoverflow-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

