<?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>Ulrich Scheller, Software Developer</title>
	<atom:link href="http://www.ulrich-scheller.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ulrich-scheller.de</link>
	<description>About software development</description>
	<lastBuildDate>Fri, 27 Jan 2012 21:43:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Multiple targets from one Android source (the better way)</title>
		<link>http://www.ulrich-scheller.de/2011/10/multiple-targets-from-one-android-source-the-better-way/</link>
		<comments>http://www.ulrich-scheller.de/2011/10/multiple-targets-from-one-android-source-the-better-way/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 17:45:46 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=222</guid>
		<description><![CDATA[Some of you might have read my article Android: Deploying multiple targets from one project. It describes how to create customized versions of the same software and therefore benefit from multiple apps with the same featureset. That deployment with an Ant script has proven to work well. For example our GMX Mail App is available [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you might have read my article <a href="http://www.ulrich-scheller.de/?p=4">Android: Deploying multiple targets from one project</a>. It describes how to create customized versions of the same software and therefore benefit from multiple apps with the same featureset. That deployment with an Ant script has proven to work well. For example our <a href="https://market.android.com/details?id=de.gmx.mobile.android.mail&amp;feature=search_result">GMX Mail App</a> is available in four different customizations, for different brands, and uses a similar approach with maven.</p>
<p>However, there is a better way now to handle multiple targets. It is less complex and gives you even more options to customize the different targets. By using an <strong>Android Library Project</strong>, you still have the benefit of sharing resources and code, without the <em>hacky</em> Ant script. Remember, the Ant script would go through <strong>every Java source file</strong> and change an import statement, just to resolve the different package name of the R File. Switching between Targets required an Ant build with a refresh of the workspace. Not any more. Now switching between projects is as simple as clicking the run button in Eclipse. Especially for bigger projects this is a huge benefit, because refreshing the workspace can take quite some time.</p>
<p><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-09-um-19.20.03.png"><img class="aligncenter size-full wp-image-223" title="Is Library" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-09-um-19.20.03.png" alt="" width="402" height="198" /></a></p>
<p>So what is the new setup? You need to create one base project, with everything common inside, and declare it as an <strong>Android Library Project</strong>. This option is available under project properties in the Android tab. Then you create the first one of your targets as a different Android Project in Eclipse. On the same properties tab of the new project, you add the base project as a library. Repeat it for another project, which will be your second target. Now you will have somthing similar to this:</p>
<p><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Multiple-Targets-in-Eclipse.png"><img class="aligncenter size-full wp-image-224" title="Multiple Targets in Eclipse" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Multiple-Targets-in-Eclipse.png" alt="" width="306" height="530" /></a></p>
<p>For the showcase, I deleted all source files of the custom projects. Since we want to re-use the majority of our sourcecode from the base project, we don&#8217;t need any custom-sources right now. There is one little fix we need to apply to the <strong>AndroidManifest.xml</strong> file. The Android Wizard in Eclipse uses relative references to our Activities. This does not work if we want to use our Activity from the base project, because it uses a different package than our custom project. Therefore, we have to specify the full package name to the specific Activity. In my sample the important part looks like this:</p>
<p><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-09-um-19.30.42.png"><img class="aligncenter size-full wp-image-225" title="AndroidManifest" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-09-um-19.30.42.png" alt="" width="589" height="149" /></a></p>
<p>That&#8217;s it. You can now overwrite all your base resources and source files in the custom projects. Every new feature developed in the base project is immediately available everywhere. Only if there is a need for updating the AndroidManifest, you have to edit it in all custom projects. But this also means you have a fine grained control over the manifest file.</p>
<p>I updated my old <a href="http://code.google.com/p/multiple-targets-on-android/">example project on Google Code</a>. Feel free to use it as a start for your own project with multiple targets. Feedback and contributions are always welcome.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;count=none&amp;text=Multiple%20targets%20from%20one%20Android%20source%20%28the%20better%20way%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;count=none&amp;text=Multiple%20targets%20from%20one%20Android%20source%20%28the%20better%20way%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F10%2Fmultiple-targets-from-one-android-source-the-better-way%2F&amp;title=Multiple%20targets%20from%20one%20Android%20source%20%28the%20better%20way%29" id="wpa2a_2"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/10/multiple-targets-from-one-android-source-the-better-way/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Key learnings from analytics</title>
		<link>http://www.ulrich-scheller.de/2011/07/key-learnings-from-analytics/</link>
		<comments>http://www.ulrich-scheller.de/2011/07/key-learnings-from-analytics/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 20:02:37 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=207</guid>
		<description><![CDATA[Enough time has passed since I put Google Analytics into my Android game Laska. It has been collecting statistics for nearly a month now. Therefore, I want to share some data and show the key learnings I got out of it. The majority of my users are from China and Poland This was quite unexpected [...]]]></description>
			<content:encoded><![CDATA[<p>Enough time has passed since I put Google Analytics into my <a href="https://market.android.com/search?q=laska">Android game Laska</a>. It has been collecting statistics for nearly a month now. Therefore, I want to share some data and show the key learnings I got out of it.</p>
<p><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-25-um-23.39.43.png"><img class="aligncenter size-full wp-image-208" title="Visits by country" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-25-um-23.39.43.png" alt="" width="426" height="377" /></a></p>
<p><strong>The majority of my users are from China and Poland</strong></p>
<p>This was quite unexpected for me. The game is pretty german. It is even named after <a href="http://en.wikipedia.org/wiki/Emanuel_Lasker">Emmanuel Lasker</a>, the famous chess player. However, Germany is responsible for only a very small part of the visits. It is interesting for future localizations, because a mandarin translation might make a lot more sense than a german one.</p>
<p style="text-align: center;"><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-26-um-21.48.26.png"><img class="aligncenter size-full wp-image-210" title="Usermap of China" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-26-um-21.48.26.png" alt="" width="460" height="327" /></a></p>
<p><strong>There is always more to track</strong></p>
<p>I started off with only tracking the in-app pages and a variable for won/lost games. But with this new information, there is already the next pending question. How many games were played at the easy level? How many at hard? What is the percentage of won games on hard? There is always more to measure and I will implement it in future versions of the game.</p>
<p style="text-align: center;"><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-26-um-21.48.02.png"><img class="aligncenter size-full wp-image-211" title="Display sizes" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/07/Bildschirmfoto-2011-07-26-um-21.48.02.png" alt="" width="571" height="194" /></a></p>
<p><strong>Devices used</strong></p>
<p>The Samsung Galaxy S and HTC Wildfire are responsible for nearly half the usage. The most common display size is 480 x 800 with 42% of the visits, followed by 240 x 320 with nearly 30%. I did not expect the small display devices to have such a big share of the visits. One reason might be, that users in China and Poland are more likely to use lower end android devices than in the US or Germany.</p>
<p>&nbsp;</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;count=none&amp;text=Key%20learnings%20from%20analytics" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;count=none&amp;text=Key%20learnings%20from%20analytics" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F07%2Fkey-learnings-from-analytics%2F&amp;title=Key%20learnings%20from%20analytics" id="wpa2a_4"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/07/key-learnings-from-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start measuring</title>
		<link>http://www.ulrich-scheller.de/2011/06/start-measuring/</link>
		<comments>http://www.ulrich-scheller.de/2011/06/start-measuring/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 19:51:17 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=199</guid>
		<description><![CDATA[I have been missing one important part of improving my software for a long time. But after starting my new job at 1&#38;1 in Munich, I was reminded of how important it is. always measure Whatever you are trying to build is probably been used by an audience of users. Especially in the mobile sector, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been missing one important part of improving my software for a long time. But after starting my new job at 1&amp;1 in Munich, I was reminded of how important it is.</p>
<blockquote><p>always measure</p></blockquote>
<p>Whatever you are trying to build is probably been used by an audience of users. Especially in the mobile sector, most of the software is built for a mass market. Therefore, good quality of an app is a requirement (but not a guarantee) for success. And for improving your software, you want to know which parts users are really using.</p>
<p>Does anyone care about the help document? How many percent of users ever opened it? How much time did they spend reading it? Where are your users from? It is possible to get some information out of Appstore/Market statistics, but only plain download numbers.</p>
<p>If you think measuring only makes sense for high traffic websites, consider this: I am using Google Analytics at this website for some time now. It tracks the location of every user and shows them in a world map. This is accurate enough to show the city of every visitor. With the relatively low number of users, I can have a pretty good guess which citizen of Tartu would visit my homepage. Or if any possible new employer checked out my homepage before the interview. You will find plenty of other interesting questions that can be answered by those numbers.</p>
<p>So head over to the <a href="http://code.google.com/intl/de-DE/mobile/analytics/docs/">Google Analytics for Mobile</a> website, see how easy it is to integrate into your app and start measuring right away.</p>
<p>&nbsp;</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;count=none&amp;text=Start%20measuring" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;count=none&amp;text=Start%20measuring" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F06%2Fstart-measuring%2F&amp;title=Start%20measuring" id="wpa2a_6"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/06/start-measuring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something is happening on the protocol front</title>
		<link>http://www.ulrich-scheller.de/2011/04/something-is-happening-on-the-protocol-front/</link>
		<comments>http://www.ulrich-scheller.de/2011/04/something-is-happening-on-the-protocol-front/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 07:52:12 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=156</guid>
		<description><![CDATA[For many years the basic layers of network communication have been unquestioned. TCP and HTTP are doing a solid job of delivering static and dynamic content to our browsers. But in some aspects those protocols could do a better job. Especially the TCP Slow Start is noticeable to end users and many big IT companies [...]]]></description>
			<content:encoded><![CDATA[<p>For many years the basic layers of network communication have been unquestioned. TCP and HTTP are doing a solid job of delivering static and dynamic content to our browsers. But in some aspects those protocols could do a better job. Especially the <a href="http://en.wikipedia.org/wiki/Slow-start">TCP Slow Start</a> is noticeable to end users and many big IT companies are <a href="http://blog.benstrong.com/2010/11/google-and-microsoft-cheat-on-slow.html">cheating on this parameter</a>. In the past, when bandwidth has been scarce, the slow start had less impact on network performance than today. Now, latency becomes the critical parameter, because it makes out for a more and more important part of the delay. Just to give a rough estimate:</p>
<p>The <a href="https://encrypted.google.com/search?hl=en&amp;source=hp&amp;q=speed+of+light&amp;aq=f&amp;aqi=&amp;oq=&amp;gs_rfai=">speed of light</a> is 299.792.458 m/s, or around 299.792 km/s. Now let&#8217;s assume our webserver is located in California, while the client is from Germany. This is a distance of nearly 10.000 km or a round-trip of 20.000 km. For such a distance, the light could only travel 299.792 / 20.000 = ~ 15 times per second, therefore a round trip takes 67 ms. As long as we can not send data faster than the speed of light, this is our theoretical minimum. A Three Way Handshake can&#8217;t be made in less than 100 ms. A brief explanation of this latency problem can be found in the article <a href="http://docs.google.com/a/chromium.org/viewer?a=v&amp;pid=sites&amp;srcid=Y2hyb21pdW0ub3JnfGRldnxneDoxMzcyOWI1N2I4YzI3NzE2">More Bandwidth Doesn’t Matter (much)</a>.</p>
<p>There is a new experimental protocol named <a href="http://www.chromium.org/spdy">SPDY</a> (SPeeDY) trying to get more speed out of HTTP. It is based on some very interesting ideas. Concurrent HTTP connections can be bundled into one SPDY connection, the server is able to notify a client via push and HTTP headers are automatically compressed. On a sidenode, all the traffic is encrypted by SSL. The <a href="http://www.chromium.org/spdy/spdy-whitepaper">project overview</a> explains in more detail, how it works and gives some test results.</p>
<p><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/04/soarjOjSeS5hoFYvjtAnxCg.png"><img class="aligncenter size-full wp-image-166" title="SPDY in the network layers" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/04/soarjOjSeS5hoFYvjtAnxCg.png" alt="" width="267" height="132" /></a></p>
<p>While SPDY definitely improves the current state, it will not be easy to push a new protocol into the market. The question is, will these improvements just be a bit faster or will they enable a new class of web applications?</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;count=none&amp;text=Something%20is%20happening%20on%20the%20protocol%20front" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;count=none&amp;text=Something%20is%20happening%20on%20the%20protocol%20front" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fsomething-is-happening-on-the-protocol-front%2F&amp;title=Something%20is%20happening%20on%20the%20protocol%20front" id="wpa2a_8"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/04/something-is-happening-on-the-protocol-front/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gain productivity by scripting your workflow</title>
		<link>http://www.ulrich-scheller.de/2011/04/gain-productivity-by-scripting-your-workflow/</link>
		<comments>http://www.ulrich-scheller.de/2011/04/gain-productivity-by-scripting-your-workflow/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 13:17:38 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=140</guid>
		<description><![CDATA[One thing that helps me a lot during my everyday routine is having shortcuts for every simple action I perform. For example uninstalling a specific Android app opening the current XCode project opening a &#8216;tail -f&#8217; on the logfile of our server can be reached with two mouseclicks from the dock. Some of those are [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that helps me a lot during my everyday routine is having shortcuts for every simple action I perform. For example</p>
<ul>
<li>uninstalling a specific Android app</li>
<li>opening the current XCode project</li>
<li>opening a &#8216;tail -f&#8217; on the logfile of our server</li>
</ul>
<p>can be reached with two mouseclicks from the dock. Some of those are nothing more than a <em>copy</em> and <em>paste shortcut</em>, the others are one line of shell script. There is really no magic inside, every decent developer should be able to do that. However, at my current workplace, out of ~20 developers, I have never seen anybody creating his own. So take this article as a reminder for reviewing your daily routine and automate the most mundane tasks.</p>
<p>Because creating shortcuts is too easy and doesn&#8217;t deserve a howto, I will focus on scripting actions on a remote server. Be sure to use <a href="http://www.ece.uci.edu/~chou/ssh-key.html">private/public key authentication</a>, so there is no need for typing passwords 20 times a day. This doesn&#8217;t require a Unix-style operating system, it is also possible with the <a href="http://searchenterpriselinux.techtarget.com/tip/How-to-use-SSH-Public-Private-keys-in-PuTTY">Putty Tools on Windows</a>. With that, you can execute remote scripts on a server.</p>
<p>My most often used script looks like this:</p>
<pre class="brush:shell">ssh root@myserver.com</pre>
<p>Which gives me a logged-in terminal at this server when executed. It is also very helpful to access logfiles with just one click. Just append the remote command to the commandline:</p>
<pre class="brush:shell">ssh tomcat@myserver.com "tail -f /opt/apache-tomcat-6.0.20/logs/catalina.out -n 1000"</pre>
<p>That prints the last 1000 lines of the logfile and keeps appending more lines. You might think of many more useful cases already. For example, restarting a server process, watching the network traffic with <strong>ngrep</strong> or printing the server load. You can also put these scripts into version control and use them with a team of developers.</p>
<p>Scripts like that saved me a lot of time already, and only take a few minutes to set up. And the much more important benefit is, that I use the available information much more often. If it takes 3 seconds to open the logfile, I will look into it even for small problems. But if it takes 30 seconds of a mundane and repetitive workflow&#8230;</p>
<p>&nbsp;</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;count=none&amp;text=Gain%20productivity%20by%20scripting%20your%20workflow" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;count=none&amp;text=Gain%20productivity%20by%20scripting%20your%20workflow" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F04%2Fgain-productivity-by-scripting-your-workflow%2F&amp;title=Gain%20productivity%20by%20scripting%20your%20workflow" id="wpa2a_10"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/04/gain-productivity-by-scripting-your-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android AppRater</title>
		<link>http://www.ulrich-scheller.de/2011/03/android-apprater/</link>
		<comments>http://www.ulrich-scheller.de/2011/03/android-apprater/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 13:36:21 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=123</guid>
		<description><![CDATA[The Android AppRater is a little tool in form of a source code snippet for getting better ratings in the Android Market. Its basic idea is to kindly ask users to rate your application, after they have been using it for a while. Which is a fair deal, because many users only give negative ratings [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.androidsnippets.com/prompt-engaged-users-to-rate-your-app-in-the-android-market-appirater">Android AppRater</a> is a little tool in form of a source code snippet for getting better ratings in the Android Market. Its basic idea is to kindly ask users to rate your application, after they have been using it for a while. Which is a fair deal, because many users only give negative ratings right before uninstalling an application. This way, you only ask those users that are actively using your application.</p>
<p>For my own Android game <a href="https://market.android.com/details?id=com.laska.full">Laska</a> (<a href="https://market.android.com/details?id=com.android.laska">light-version</a>) the AppRater is not yet integrated in the current Market version. But it will be part of the next update. The dialog will only be shown if the app is installed for more than three days and has been launched at least seven times. And if you dismiss the dialog, it will not pop up again. This is what it looks like:</p>
<p style="text-align: center;"><a href="http://www.ulrich-scheller.de/wp-content/uploads/2011/03/device.png"><img class="aligncenter size-full wp-image-124" title="device" src="http://www.ulrich-scheller.de/wp-content/uploads/2011/03/device.png" alt="" width="288" height="480" /></a></p>
<p style="text-align: center;">Of course, if the application is a piece of crap, this doesn&#8217;t help in any way. But for all other apps, it might be worth the effort.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;count=none&amp;text=Android%20AppRater" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;count=none&amp;text=Android%20AppRater" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F03%2Fandroid-apprater%2F&amp;title=Android%20AppRater" id="wpa2a_12"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/03/android-apprater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concurrency in java (german)</title>
		<link>http://www.ulrich-scheller.de/2011/02/concurrency-in-java-german/</link>
		<comments>http://www.ulrich-scheller.de/2011/02/concurrency-in-java-german/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 18:26:42 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=70</guid>
		<description><![CDATA[The Free Lunch Is Over &#8211; that is the famous headline of an article about how the evolution of hardware alone will not solve our performance problems anymore. With the rise of multicore CPUs, software developers have to put effort into their code, to see further performance gains. Even on mobile phones, as the Tegra [...]]]></description>
			<content:encoded><![CDATA[<div id="__ss_6908895" style="width: 425px;"><a href="http://www.gotw.ca/publications/concurrency-ddj.htm">The Free Lunch Is Over</a> &#8211; that is the famous headline of an article about how the evolution of hardware alone will not solve our performance problems anymore. With the rise of multicore CPUs, software developers have to put effort into their code, to see further performance gains. Even on mobile phones, as the Tegra 2 shows, we will see more and more multicore CPUs. Therefore, there is a good reason for using concurrency in your application. However, it can also be dangerous and lead to unpredictable errors.</div>
<p style="width: 425px;">&nbsp;</p>
<div style="width: 425px;">The following is a talk I have given to co-workers about concurrency in general and how to do it in java. It focuses less on academic problems like deadlocks, but shows how painful multi-threading is with the standard library. And there are some best-practices for how to reduce the likeliness of errors.</div>
<p style="width: 425px;">&nbsp;</p>
<div style="width: 425px;"><object id="__sse6908895" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=concurrencyinjava-110213033009-phpapp01&amp;stripped_title=concurrency-in-java&amp;userName=UlrichScheller" /><param name="name" value="__sse6908895" /><param name="allowfullscreen" value="true" /><embed id="__sse6908895" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=concurrencyinjava-110213033009-phpapp01&amp;stripped_title=concurrency-in-java&amp;userName=UlrichScheller" name="__sse6908895" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;count=none&amp;text=Concurrency%20in%20java%20%28german%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;count=none&amp;text=Concurrency%20in%20java%20%28german%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Fconcurrency-in-java-german%2F&amp;title=Concurrency%20in%20java%20%28german%29" id="wpa2a_14"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/02/concurrency-in-java-german/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a very easy text classifier in python</title>
		<link>http://www.ulrich-scheller.de/2011/02/testposting/</link>
		<comments>http://www.ulrich-scheller.de/2011/02/testposting/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 19:49:10 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=52</guid>
		<description><![CDATA[Some of the developers at match2blue are creating a text-interest-matcher. Leaving buzzword bingo aside, that means the software calculates whether a text is interesting based on users&#8217; interests. So basically you, as a user, have to enter some interests and will be presented some pieces of data in order of their relevance. You can also [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the developers at match2blue are creating a text-interest-matcher. Leaving buzzword bingo aside, that means the software calculates whether a text is interesting based on users&#8217; interests. So basically you, as a user, have to enter some interests and will be presented some pieces of data in order of their relevance. You can also think of it as text classification into either good or bad.</p>
<p>This software has become quite complicated, because it is necessary to have some kind of semantic knowledge about the interests. But there are different methods of text classification. I was curious about how hard it is to write the most simple text classifier that gives you decent results. Well, turns out it is remarkably simple. Creating the classifier took less than two hours. And here is the source code:</p>
<pre class="brush:py">import os
j = os.path.join

def train(text):
	"""
	Train a dictionary with the given text. Returns a dictionary of dictionaries,
	that describes the probabilities of all word-folling-ocurrences in the text.

	For example, the string "a test" gives this result:
	&gt;&gt;&gt; train("a test")
	{'': {'a': 1}, 'a': {'test': 1}}
	Meaning that the empty string '' has been followed once by 'a' and 'a' has been
	followed by 'test' as well.

	A longer example leads to a more complex dictionary:
	&gt;&gt;&gt; train("this is a test oh what a test")
	{'': {'this': 1}, 'a': {'test': 2}, 'what': {'a': 1}, 'oh': {'what': 1}, 'this': {'is': 1}, 'is': {'a': 1}, 'test': {'oh': 1}}
	"""
	c = {}
	lastword = ""
	for word in text.split():
		word = word.lower()
		if c.has_key(lastword):
			inner = c[lastword]
			if inner.has_key(word):
				inner[word] += 1
			else:
				inner[word] = 1
		else:
			c[lastword] = {word: 1}
		lastword = word
	return c

def probability_of(dict, lastword, word):
	"""
	Helper function for calculating the probability of word following lastword
	in the category given by dict.

	&gt;&gt;&gt; category = train("this is a test")
	&gt;&gt;&gt; probability_of(category, "a", "test")
	1.0

	&gt;&gt;&gt; probability_of(category, "any", "words")
	0
	"""
	word = word.lower()
	if dict.has_key(lastword):
		inner = dict[lastword]
		sumvalues = sum([v for v in inner.values()])
		if inner.has_key(word):
			return inner[word] / (sumvalues * 1.0)
	return 0

def classify(text, dict):
	"""
	Returns the probability that a text is from the given category. For every pair of
	words the probability_of value is calculated, summarized and divided by the amount
	of words in the text.

	&gt;&gt;&gt; category = train("this is a test")
	&gt;&gt;&gt; classify("a test with some words", category)
	0.2

	&gt;&gt;&gt; classify("just writing test or a doesn't improve the ranking", category)
	0.0
	"""
	lastword = ""
	probabilities = 0
	for word in text.split():
		probabilities += probability_of(dict, lastword, word)
		lastword = word
	return probabilities / (len(text.split()) * 1.0)

if __name__ == "__main__":
	"""
	Calculate the category, that the text in ../test matches best.
	"""
	ranking = []
	os.chdir("..")
	for file in os.listdir("categories"):
		trained = train(open(j("categories", file)).read())
		value = classify(open("test").read(), trained)
		print "test is", file, "with", value, "% probability"
		ranking.append((value, file))

	ranking.sort()
	print
	print "The test text is probably from", ranking[-1][1]
	print "(second guess is", ranking[-2][1] + ")"</pre>
<p>How does it work? There are two very simple steps it does. First, the classifier has to be trained with existing textfiles. The result is a dictionary that consists of many inner dictionaries. Let&#8217;s feed it with some text to see what happens.</p>
<pre class="brush:py">In [5]: train("a test a good test a good good test")

Out[5]:
{'': {'a': 1},
 'a': {'good': 2, 'test': 1},
 'good': {'good': 1, 'test': 2},
 'test': {'a': 2}}</pre>
<p>In the result we can see that three words followed &#8216;a&#8217;. Two times it was &#8216;good&#8217; and one time &#8216;test&#8217;. This is all we need for classifying. Now we can apply the classify function. It goes through the text to classify and looks for known word follow-ups. If there is a known one, the probability of this follow-up is added. So, in our example the probability of &#8216;a good&#8217; is 2/3 and for &#8216;a test&#8217; it is 1/3.</p>
<pre class="brush:py">In [2]: a = train("a test a good test a good good test")

In [3]: classify("is it a good test", a)

Out[3]: 0.26666666666666666

In [4]: classify("text good but different style", a)

Out[4]: 0.0</pre>
<p>The first example has similar words and ordering as the trained text. The second one also has some exact same words, but they are in a different order. Therefore, the probability of this text beeing <strong>a</strong> is 0.0.</p>
<p>If you want to try it with some longer text, you can <a href="http://code.google.com/p/textclassify/">download the classifier from Google Code</a>. It is easy to create your own categories by adding a file in the appropriate folder. Just make sure you have a decent amount of data. Three sentences are not enough for a good classification.</p>
<p>In my tests I got quite good results even for classifying authors writing about the same topic.</p>
<pre class="brush:shell">cd classify/src/
python classify.py</pre>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;count=none&amp;text=Building%20a%20very%20easy%20text%20classifier%20in%20python" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;count=none&amp;text=Building%20a%20very%20easy%20text%20classifier%20in%20python" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2011%2F02%2Ftestposting%2F&amp;title=Building%20a%20very%20easy%20text%20classifier%20in%20python" id="wpa2a_16"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2011/02/testposting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I am missing in Android development</title>
		<link>http://www.ulrich-scheller.de/2010/03/9/</link>
		<comments>http://www.ulrich-scheller.de/2010/03/9/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 13:16:07 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=9</guid>
		<description><![CDATA[This is a list of things I would like to see for Android to improve the development of apps. Don&#8217;t get me wrong, Android is one of the best platforms out there, but this doesn&#8217;t mean it can not improve anymore. Hot Code Replacement It always takes a while to deploy your application on the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list of things I would like to see for Android to improve the  development of apps. Don&#8217;t get me wrong, Android is one of the best  platforms out there, but this doesn&#8217;t mean it can not improve anymore.</p>
<p><strong><span>Hot Code Replacement</span></strong><br />
It  always takes a while to deploy your application on the mobile phone or  in the emulator. If you just want to find out what is happening in the  code this deployment cycle adds up to quite some time. I know it is hard  to replace Dalvik code from a Sun Java machine, but it would help a  lot. We even had hot code replacement with our Robocup machines while  they were playing soccer. Another possibility would be to use something  like <a href="http://pypi.python.org/pypi/hotswap/0.1">hotswap for python</a>. It monitors changes of source files and applies them to the running process as soon as possible.</p>
<p><strong><span>Flawless USB Connection</span></strong><br />
There are many cases where you have to unplug and plugin the development phone again. For example when I <span>adb uninstall</span> an app, it can not be installed again until the USB connection has been  reset. The same goes for installing an apk from the SD card. You have  to connect the phone as an external device, copy the apk and unplug  again, before installing the app.<br />
Another thing is that LogCat most  of the time does not recognize when the phone is plugged in again. So  you always need to switch to the DDMS view in Eclipse, click on the  device and go back to the Java view again.</p>
<p><strong><span>Simple caching of files</span></strong><br />
Some time ago I had <a href="http://stackoverflow.com/questions/847664/where-to-save-pictures-on-android">this question on StackOverflow</a>.  Disk space is extremely limited on current Android phones. On the  iPhone you can easily bundle 20 Megabytes of data with your application,  because the app partition is huge. In contrary, most G1 users don&#8217;t  even have 3 Megabytes of space on their phones. So until every Android  device has a huge app partition (or could use the sdcard for it), we  need to cache files and delete them on demand. There should be a  standard way of caching, like RomainGuy described it with SoftReferences  for storing images in memory.</p>
<p><strong><span>Just in Time Compiler</span></strong><br />
Now  this one is already in the works, but it might still be a while until  it sees the light of day. But obviously the overall performance is not  even close to the iPhone right now. A JIT compiler should be able to  nearly close the gap.</p>
<p><strong><span>Hardware Graphics Acceleration</span></strong><br />
The  hardware of most Android devices is capable of handling a lot of 3D  objects and textures with high framerates. In the standard user  interface, this acceleration is not used. Hardware acceleration with  OpenGL should speed up the overall performance a lot.</p>
<p>What kind of things can you think of? Put your own wishlist in the comments.</p>
<p><em>(this entry is cross-posted from my old blogger site)</em></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;count=none&amp;text=Things%20I%20am%20missing%20in%20Android%20development" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;count=none&amp;text=Things%20I%20am%20missing%20in%20Android%20development" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2010%2F03%2F9%2F&amp;title=Things%20I%20am%20missing%20in%20Android%20development" id="wpa2a_18"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2010/03/9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Fundamentals talk</title>
		<link>http://www.ulrich-scheller.de/2009/12/android-fundamentals/</link>
		<comments>http://www.ulrich-scheller.de/2009/12/android-fundamentals/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 16:33:32 +0000</pubDate>
		<dc:creator>Ulrich Scheller</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.ulrich-scheller.de/?p=28</guid>
		<description><![CDATA[This is the screencast and voice of my Android Fundamentals talk from december 2009. It was given on the 29th floor of our jentower for the towerbyte.]]></description>
			<content:encoded><![CDATA[<p>This is the screencast and voice of my <em>Android Fundamentals</em> talk from december 2009. It was given on the 29th floor of our jentower for the towerbyte.</p>
<p><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/ng7CfXTBRWw" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/ng7CfXTBRWw"></embed></object></p>
<p><span id="more-28"></span></p>
<p><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/BfDmmI00oho" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/BfDmmI00oho"></embed></object></p>
<p><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/6T_tjNJlGJY&amp;feature" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/6T_tjNJlGJY&amp;feature"></embed></object></p>
<p><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/dR4ZC_q8ur4&amp;feature" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/dR4ZC_q8ur4&amp;feature"></embed></object></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;count=none&amp;text=Android%20Fundamentals%20talk" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;counturl=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;count=none&amp;text=Android%20Fundamentals%20talk" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ulrich-scheller.de%2F2009%2F12%2Fandroid-fundamentals%2F&amp;title=Android%20Fundamentals%20talk" id="wpa2a_20"><img src="http://www.ulrich-scheller.de/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ulrich-scheller.de/2009/12/android-fundamentals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

