<?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>ITworks &#187; fun</title>
	<atom:link href="http://itworks.hu/category/fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://itworks.hu</link>
	<description>Random musings in IT</description>
	<lastBuildDate>Mon, 09 Jan 2012 08:01:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Chinese tablets recapped</title>
		<link>http://itworks.hu/2011/11/07/chinese-tablets-recapped/</link>
		<comments>http://itworks.hu/2011/11/07/chinese-tablets-recapped/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 18:06:48 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[chinese]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://m.itworks.hu/2011/11/07/chinese-tablets-recapped/</guid>
		<description><![CDATA[First I tried the wm8650 that I broke. Literally broke, as I just dropped it from about half a meter and the touch screen shattered. Then I got myself a &#8220;Superpad III&#8221; clone which died no later than a day &#8230; <a href="http://itworks.hu/2011/11/07/chinese-tablets-recapped/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First I tried the wm8650 that I broke. Literally broke, as I just dropped it from about half a meter and the touch screen shattered. Then I got myself a &#8220;Superpad III&#8221; clone which died no later than a day after I got it.</p>
<p>Know I&#8217;m typing on my brand new ZT-280  I received today.<br />
I can&#8217;t say I&#8217;m impressed, the tablet is about half the size of the Superpad and is also smaller than the wm8650. The capacitive screen is a bit hectic or oversensitive. It has no haptic feedback, but I can live with that. </p>
<p>It&#8217;s exterior is superb compared to the previous mentions, and is bordering on acceptable. I don&#8217;t like the reddish metal finish on the sides too much, but it&#8217;s not all that bad. I can&#8217;t understand the mini USB connectors really. After all micro sockets are taking over, don&#8217;t they? Also I don&#8217;t get why a separate power input is needed, when it could use the 5v straight from the port. As far as I&#8217;m concerned it should have two micro USB and scrap the rest.</p>
<p>The tablet came with the connector cables for both pc to tablet and external device to tablet connection, a power adapter and the usual EU socket adapter. It has a little deep socket for the micro sd card, but it&#8217;s reasonable, as I don&#8217;t want to change it too frequently anyway.</p>
<p>And so I used the pad for a day or so with the following issues. </p>
<p>The touch is a bit laggy, there are times, when the strength registers a &#8220;click &#8221; at a previous position. I seems like a driver issue and I don&#8217;t think it would be dealt with anytime soon.</p>
<p>The firmware is definitely based on cyanogen 7 so it promise a relatively long usability period. Unfortunately it doesn&#8217;t use clockwork boot loader, and has a legacy package format too. It still begs the question weather it can be used to do incremental upgrades, or only full updates are possible. The supplier released new firmware packs about monthly, and I can only hope they keep it up for the release of the icecream sandwich of cyanogen. </p>
<p>Now again, I&#8217;m kind of late on publishing, so here&#8217;s an update. A new release is available from the manufacturer &#8216;s site as of November 4th. I only did a partial update, so a new kernel is running on the pad. This seems to have resolved the touch issues. I&#8217;ve also recalibrated the battery, so now it provides a little bit more reliable info. This doesn&#8217;t solve the standard charge  issue of the pad. That only affects the charge level display so it only shows the range between 97% (uncharged) to 100% fully charged.  I don&#8217;t mind, as I leave office charge overnight anyway. </p>
<p>It does have a five point touch screen which looks nice in Fruit ninja, that I used to test 3d, where I could use 5 blades to slice through tons of fruit in seconds. <img src='http://itworks.hu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I really miss the light sensor. It boggles my mind trying to understand what made the designers think to omit such a cheap, but vital component from this otherwise well built tablet? It also shows that Android heavily relies on its existence. There is only a very limited possibility of customizing it properly, even with the notorious Cyanogen. One cannot set the actual levels to use in the power applet or the status bar, you can only select some predefined level combinations, all of which contain an auto option, despite the missing sensor. </p>
<p>Rooting the device is pretty simple. Connect with the provided cable, remount system with adb, copy su and superuser.apk cynosure the su and done. You can than use all rooted applications. This is required if you want to clean up the crappy preinstalled applications. </p>
<p>Chainfire works out of the box but I&#8217;m not a gamer, so I have no idea what&#8217;s the point. I did some fooling Around in Fruit Ninja and Angry Birds but I can&#8217;t tell the difference. </p>
<p>I wrote this article on the subway, using my ZTE Blade as a Wi-Fi hotspot to publish it.</p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2011/11/07/chinese-tablets-recapped/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regexp fun</title>
		<link>http://itworks.hu/2009/11/25/regexp-fun/</link>
		<comments>http://itworks.hu/2009/11/25/regexp-fun/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 21:57:31 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=95</guid>
		<description><![CDATA[Reading the post about useful regular expressions,  remembered what my favourite solution is to one of  the questions of the test we give to junior Java developers. The task is to write a method that takes a string as a &#8230; <a href="http://itworks.hu/2009/11/25/regexp-fun/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Reading the post about<a href="http://www.mkyong.com/regular-expressions/10-java-regular-expression-examples-you-should-know/"> useful regular expressions</a>,  remembered what my favourite solution is to one of  the questions of the test we give to junior Java developers.</p>
<p>The task is to write a method that takes a string as a parameter and returns the acronym of the string in uppercase made up of the first letters of the words in the string. The acronym must ignore the words &#8220;the&#8221;, &#8220;of&#8221; and &#8220;and&#8221;.</p>
<p>The usual solutions are either to sequentially step through the string (Yuck!) or split it up or use a StringTokenizer class. The people usually overlook the fact, that the input strings can be padded with whitespace, or contain multiple spaces, and they usually ignore, that the keywords that are to be omitted might be found on the begining of a valid word. Thus my test &#8221; United   States of Andorra&#8221; string breaks most of the methods.  The ones who have time to write the answer down, usually forget to return the value from the method, or to change it to uppercase and sometimes even ignore that it should be a method to start with! This is my favourite question, as it can really show how the applicant can handle stressful situations.</p>
<p>I was tired after several interviews one day and tried to come up with the  shortest possible solution. Naturally it contains regular expressions.</p>
<p>My solution looked  something like this (OK I just reproduced it for the sake of the article, using nano and javac, so it might have overlooked flaws in it):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Acronym <span style="color: #009900;">&#123;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> toAcronym<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> str.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.
                        <span style="color: #006633;">replaceAll</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(THE|OF|AND)(<span style="color: #000099; font-weight: bold;">\\</span>W+|$)&quot;</span>,<span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.
                        <span style="color: #006633;">replaceAll</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(<span style="color: #000099; font-weight: bold;">\\</span>w)<span style="color: #000099; font-weight: bold;">\\</span>w*<span style="color: #000099; font-weight: bold;">\\</span>W*&quot;</span>,<span style="color: #0000ff;">&quot;$1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> args<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>args.<span style="color: #006633;">length</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>toAcronym<span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2009/11/25/regexp-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Parable of the Object Oriented Programmer and Breakfast</title>
		<link>http://itworks.hu/2007/06/15/the-parable-of-the-object-oriented-programmer-and-breakfast/</link>
		<comments>http://itworks.hu/2007/06/15/the-parable-of-the-object-oriented-programmer-and-breakfast/#comments</comments>
		<pubDate>Fri, 15 Jun 2007 11:00:12 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=16</guid>
		<description><![CDATA[This is the English version of a tale I&#8217;ve recently found in my archive mailbox from 2001. Looking at ongoing projects, I think it still has a point. Once upon a time, in a kingdom not far from here, a &#8230; <a href="http://itworks.hu/2007/06/15/the-parable-of-the-object-oriented-programmer-and-breakfast/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is the English version of a tale I&#8217;ve recently found in my archive mailbox from 2001. Looking at ongoing projects, I think it still has a point.</p>
<blockquote><p>Once upon a time, in a kingdom not far from here, a king summoned two of his advisors for a test. He showed them both a shiny metal box with two slots in the top, a control knob, and a lever. &#8220;<em>What do you think this is?</em>&#8221;<br />
<span id="more-16"></span></p>
<p>One advisor, an engineer, answered first. &#8220;<em>It is a toaster,</em>&#8221; he said. The king asked, &#8220;<em>How would you design an embedded computer for it?</em>&#8221; The engineer replied, &#8220;<em>Using a four-bit microcontroller, I would write a simple program that reads the darkness knob and quantizes its position to one of 16 shades of darkness, from snow white to coal black. The program would use that darkness level as the index to a 16-element table of initial timer values. Then it would turn on the heating elements and start the timer with the initial value selected from the table. At the end of the time delay, it would turn off the heat and pop up the toast. Come back next week, and I&#8217;ll show you a working prototype.</em>&#8221;</p>
<p>The second advisor, a Java developer, highly skilled in object oriented design, immediately recognized the danger of such short-sighted thinking. He said, &#8220;<em>Toasters don&#8217;t just turn bread into toast, they are also used to warm frozen waffles. What you see before you is really a breakfast food cooker. As the subjects of your kingdom become more sophisticated, they will demand more capabilities. They will need a breakfast food cooker that can also cook sausage, fry bacon, and make scrambled eggs. A toaster that only makes toast will soon be obsolete. If we don&#8217;t look to the future, we will have to completely redesign the toaster in just a few years.</em>&#8221;</p>
<p>&#8220;<em>With this in mind, we can formulate a more intelligent solution to the problem. First, create a class of breakfast foods. Specialize this class into subclasses: grains, pork, and poultry. The specialization process should be repeated with grains divided into toast, muffins, pancakes, and waffles; pork divided into sausage, links, and bacon; and poultry divided into scrambled eggs, hard-boiled eggs, poached eggs, fried eggs, and various omelet classes.</em>&#8221;</p>
<p>&#8220;<em>The ham and cheese omelet class is worth special attention because it must inherit characteristics from the pork, dairy, and poultry classes. Thus, we see that the problem cannot be properly solved without multiple inheritance. At run time, the program must create the proper object and send a message to the object that says, &#8220;<code>Cook yourself.</code>&#8221; The semantics of this message depend, of course, on the kind of object, so they have a different meaning to a piece of toast than to scrambled eggs.</em>&#8221;</p>
<p>&#8220;<em>Reviewing the process so far, we see that the analysis phase has revealed that the primary requirement is to cook any kind of breakfast food. In the design phase, we have discovered some derived requirements. Specifically, we need an object-oriented language with multiple inheritance. Of course, users don&#8217;t want the eggs to get cold while the bacon is frying, so concurrent processing is required, too.</em>&#8221;</p>
<p>&#8220;<em>We must not forget the user interface. The lever that lowers the food lacks versatility, and the darkness knob is confusing. Users won&#8217;t buy the product unless it has a user-friendly, graphical interface. When the breakfast cooker is plugged in, users should see a cowboy boot on the screen. Users click on it, and the message &#8220;<code>Booting Application Breakfast v1.2</code>&#8221; appears on the screen. (Breakfast v1.2 should be out by the time the product gets to the market.) Users can pull down a menu and click on the foods they want to cook.</em>&#8221;</p>
<p>&#8220;<em>Having made the wise decision of specifying the software first in the design phase, all that remains is to pick an adequate hardware platform for the implementation phase. An Intel Pentium 1.86GHz with 1.2GB of memory, a 220GB hard disk, and a TFT monitor should be sufficient. Selecting a multitasking, object oriented language that supports multiple inheritance and has a built-in GUI, means writing the program will be a snap. (Imagine the difficulty we would have had if we had foolishly allowed a hardware-first design strategy to lock us into a four-bit microcontroller!).</em>&#8221;</p>
<p>The king had the computer scientist thrown in the moat, and they all lived happily ever after.</p></blockquote>
<p>NB. The story mentions a Java developer and thus provides a valuable insight: Java coders are lazy and provide specs they don&#8217;t have to develop when possible. This is why the multiple inheritance was suggested, instead of AOP.<br />
Actually the story is way older than Java, and in those times developers actually knew languages and didn&#8217;t try to design everything so it can be solved in their language of choice. <img src='http://itworks.hu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2007/06/15/the-parable-of-the-object-oriented-programmer-and-breakfast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to use Java key stores</title>
		<link>http://itworks.hu/2007/05/23/how-not-to-use-java-key-stores/</link>
		<comments>http://itworks.hu/2007/05/23/how-not-to-use-java-key-stores/#comments</comments>
		<pubDate>Wed, 23 May 2007 12:23:03 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=13</guid>
		<description><![CDATA[I spent half a day today trying to see why a the web start application created and deployed using a simple build script didn&#8217;t work after I&#8217;ve created a new certificate as our previous was about to expire. First I &#8230; <a href="http://itworks.hu/2007/05/23/how-not-to-use-java-key-stores/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spent half a day today trying to see why a the web start application created and deployed using a simple build script didn&#8217;t work after I&#8217;ve created a new certificate as our previous was about to expire.</p>
<p>First I suspected it was because I signed the application using SUN JDK 1.6, and it might have some compatibility issues (as if) then I suspected it was the IBM JDK 1.5&#8242;s ikeytool I used to create the key (NB. I&#8217;m lazy to learn the keytool paramers, so I prefer to use a GUI for creating keys)</p>
<p>It turned out I was presuming the keys use UTF internally, like most Java applications should, so when entering the locality I used &#8220;Vác&#8221; with accented characters. Neither ikeytool, neither keytool warned me about this. Once creating a new key without the accent the application started working straight away.</p>
<p>Since &#8220;Budapest&#8221; doesn&#8217;t have any special characters, I never noticed this, but I think it deserves to be mentioned, so others won&#8217;t run into this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2007/05/23/how-not-to-use-java-key-stores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Push-puppet toy</title>
		<link>http://itworks.hu/2007/05/10/diy-push-puppet-toy/</link>
		<comments>http://itworks.hu/2007/05/10/diy-push-puppet-toy/#comments</comments>
		<pubDate>Thu, 10 May 2007 07:39:09 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[toys]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=11</guid>
		<description><![CDATA[Remember the push-puppets you had when you were a kid? These little puppets collapse instantly when you push the button on the base they stand, providing hours of quality entertainment to kids like myself. Now it has returned from exile &#8230; <a href="http://itworks.hu/2007/05/10/diy-push-puppet-toy/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Remember the push-puppets you had when you were a kid? These little puppets collapse instantly when you push the button on the base they stand, providing hours of quality entertainment to kids like myself. Now it has returned from exile and is back grouped up with new technology to provide hours of entertainment to IT people like myself.<br />
<a href="http://itworks.hu/wp-content/uploads/2007/05/puppet_up.jpg" title="Puppet"><img src="http://itworks.hu/wp-content/uploads/2007/05/puppet_up.thumbnail.jpg" alt="Puppet" align="right" /></a></p>
<p>For the original concept see:<a href="http://schulzeandwebb.com/2006/availabot/">Availabot</a></p>
<p>For the cuter Linux version visit <a href="http://users.skynet.be/ppc/push_puppet_toy/">Push puppet toy</a></p>
<p>I can imagine my desk full of these puppets each representing a friend I usually talk to, these puppets would dance up and down all day depending on who&#8217;s leaving for lunch.</p>
<p>Also it would be great to have this extended to have an intermediary stage, ie. when the button is half pushed these puppets usually start letting their head down. So when the contact is not offline, but only away they could show how said they are to be away from their computer, and when they are offline they are completely splattered.</p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2007/05/10/diy-push-puppet-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The story behind a name..</title>
		<link>http://itworks.hu/2007/05/03/the-story-behind-a-name/</link>
		<comments>http://itworks.hu/2007/05/03/the-story-behind-a-name/#comments</comments>
		<pubDate>Thu, 03 May 2007 11:13:05 +0000</pubDate>
		<dc:creator>dyn</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=7</guid>
		<description><![CDATA[I just came around the Winstone servlet container (related to the Hudson CI server). The project itself is fairly interesting, but it&#8217;s the naming choice which got me completely amazed.. Winstone is the name of a rather large Jamaican man &#8230; <a href="http://itworks.hu/2007/05/03/the-story-behind-a-name/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just came around the <a href="http://winstone.sourceforge.net/">Winstone</a> servlet container (related to the <a href="http://hudson.dev.java.net/">Hudson</a> CI server). The project itself is fairly interesting, but it&#8217;s the naming choice which got me completely amazed..</p>
<blockquote><p> Winstone is the name of a rather large Jamaican man a friend of mine met one night, while he was out clubbing in the Roppongi area of Tokyo. He (my friend) was a little liquored up at the time, and when Winstone suggested they head to &#8220;this really cool club&#8221; he knew, he didn&#8217;t think anything was wrong. It wasn&#8217;t until Winstone led him down a dark stairwell and dropped his trousers that my friend clued in and ran like hell.</p>
<p>It was too good a story to let die, so I named this project Winstone so that said friend will continue to be reminded of it.</p></blockquote>
<p>Now who claims java devs should get a life? <img src='http://itworks.hu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2007/05/03/the-story-behind-a-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

