<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<copyright>Copyright 1998-2010 Tweakers.net</copyright>
		<pubDate>Sat, 20 Mar 2010 13:47:57 GMT</pubDate>
		<lastBuildDate>Sat, 20 Mar 2010 13:47:57 GMT</lastBuildDate>
		<docs>http://tweakers.net/reviews/76</docs>
		<description>Tweakblogs.net is the weblog service provided by Tweakers.net, the largest hardwaresite and techcommunity in the Netherlands.</description>
		<image>
			<link>http://tweakblogs.net/</link>
			<title>Tweakblogs.net</title>
			<url>http://tweakimg.net/g/if/logo.gif</url>
			<height>60</height>
			<width>60</width>
			<description>Tweakblogs.net</description>
		</image>
		<language>en</language>
		<link>http://confusion.tweakblogs.net</link>
		<title>Coding in an absurd reality</title>
		<webMaster>frontpage@tweakers.net</webMaster>
		<item>
			<title>Harvesting energy from WiFi and GSM networks?</title>
			<link>http://confusion.tweakblogs.net/blog/3378/harvesting-energy-from-wifi-and-gsm-networks.html</link>
			<description>Source: Oh Gizmo, Engadget

At CES 2010, a company called RCA has presented a device called &#39;Airnergy&#39;, which is supposedly able to harvest energy from WiFi (and GSM) networks, for instance to charge your cellphone. Now this raises immediate suspicions: if that is possible, why aren&#39;t mobile devices powered by these networks in the first place? However, given the feeling that we are surrounded by a vast multitude of such networks, it still sounds remotely plausible. The only way to determine whether this makes sense, is to actually crunch the numbers:

My phone has a 0.9 Ah battery, at 3.7V. This means the battery holds 12kJ. With an uptime of 200 hours, this means a mobile phone consumes 17 mW on average. 

A wireless accesspoint emits EM radiation in the order of of 100mW. If a device harvesting this power has an active area of 10x10cm and is, on average, located 1 meter from the accesspoint, it will pick up 0.01/(4*pi) * 100 = 0.08 mW, assuming the radiation is the same in all directions.

If the device in question can harvest 0.08 mW, it takes17/0.08 ~ 209 accesspoints and 200 hours to accumulate 12 kJ. My only conclusion can be that this product is completely bogus. Even at a conference, with perhaps 100 nearby cellphones as additional radiation sources, it wouldn&#39;t be useful.

This analysis grossly overestimates the power that could be harvested, as it assumes a 100% conversion of EM radiation into electricity and situates the accesspoints within one meter of the device. Is it a hoax? Is it fraud? Is it idiocy? Or is my calculation wrong?</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/3378/harvesting-energy-from-wifi-and-gsm-networks.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/3378</guid>
			<pubDate>Sun, 10 Jan 2010 20:21:07 GMT</pubDate>
		</item>
		<item>
			<title>I just started hating Java</title>
			<link>http://confusion.tweakblogs.net/blog/3360/i-just-started-hating-java.html</link>
			<description>A new year, a new hatred. I&#39;ve just officially begun hating the language in which I do most of my work: Java. The tiresome verboseness finally got to me. Please compare with me:

Java:123456789101112&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;private&#38;nbsp;static&#38;nbsp;String&#38;nbsp;joinObjectFields(final&#38;nbsp;List&#38;lt;SomeObject&#38;gt;&#38;nbsp;objects,&#38;nbsp;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;final&#38;nbsp;Character&#38;nbsp;seperator,&#38;nbsp;final&#38;nbsp;SomeObject&#38;nbsp;exclude)&#38;nbsp;{

&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;String&#38;nbsp;result&#38;nbsp;=&#38;nbsp;&#38;quot;&#38;quot;;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;for&#38;nbsp;(SomeObject&#38;nbsp;object:&#38;nbsp;objects)&#38;nbsp;{
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;if&#38;nbsp;(!object.equals(exclude))&#38;nbsp;{
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;result&#38;nbsp;+=&#38;nbsp;object.someField&#38;nbsp;+&#38;nbsp;seperator;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;//&#38;nbsp;Strip&#38;nbsp;last&#38;nbsp;;&#38;nbsp;(and&#38;nbsp;see&#38;nbsp;edit3)
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;return&#38;nbsp;result.substring(0,&#38;nbsp;result.length()&#38;nbsp;-&#38;nbsp;1);
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}

Python:1
2
3
4
def joinObjectFields(objects, seperator, exclude):

  fields = [object.someField for object in objects if object != exclude]
  return seperator.join(fields)

To prevent &#38;quot;these pieces of code don&#39;t do the same thing&#38;quot;, an alternate Java implementation, more like the Python one:
Java:1234567891011121314&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;private&#38;nbsp;static&#38;nbsp;String&#38;nbsp;joinObjectFields(final&#38;nbsp;List&#38;lt;SomeObject&#38;gt;&#38;nbsp;objects,&#38;nbsp;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;final&#38;nbsp;Character&#38;nbsp;seperator,&#38;nbsp;final&#38;nbsp;SomeObject&#38;nbsp;exclude)&#38;nbsp;{

&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;final&#38;nbsp;String[]&#38;nbsp;fields&#38;nbsp;=&#38;nbsp;new&#38;nbsp;String[objects.size()];
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;for&#38;nbsp;(int&#38;nbsp;i&#38;nbsp;=&#38;nbsp;0;&#38;nbsp;i&#38;nbsp;&#38;lt;&#38;nbsp;fields.length;&#38;nbsp;i++)&#38;nbsp;{
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;if&#38;nbsp;(!object.get(i).equals(exclude))&#38;nbsp;{
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;fields[i]&#38;nbsp;=&#38;nbsp;object.someField;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;else&#38;nbsp;{
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;fields[i]&#38;nbsp;=&#38;nbsp;&#38;quot;&#38;quot;;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;return&#38;nbsp;StringUtils.join(fields,&#38;nbsp;&#39;;&#39;);
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;}
Doesn&#39;t get much better, even if you would initialize the array to contain &#38;quot;&#38;quot; in every field using a utility method.

For extra hatred, consider the necessary changes to the code to enable the same method to join the contents of a different object field.

Edit: A colleague noted that cloning the list and removing the &#39;exclude&#39; would make matters slightly better.

Edit2: And before someone starts calling me a Python fanboy: you can also do this in a much shorter fashion in Scheme, Ruby, Perl, Scala, Lisp/Clojure, etc.

Edit3: And of course I stupidly forgot to check whether result.length() is actually &#38;gt; 0 in the first implementation.

Edit4: As JanDM rightly points out, I shouldn&#39;t use curly braces in Python .

Edit 5: This version in Java, posted by Markus in the comments, is far superior: I wasn&#39;t making any sense here: the code does a different thing.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/3360/i-just-started-hating-java.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/3360</guid>
			<pubDate>Thu, 07 Jan 2010 14:42:00 GMT</pubDate>
		</item>
		<item>
			<title>Debian, aptitude update: segmentation fault.</title>
			<link>http://confusion.tweakblogs.net/blog/3028/debian-aptitude-update-segmentation-fault.html</link>
			<description>Hmmm, my &#39;aptitude update&#39; currently ends with

E: Method rred has died unexpectedly!  
E: Sub-process rred received a segmentation fault.

I&#39;m not going to investigate the cause, but from http://ja.pastebin.ca/1655916, a workaround is toWorkaround: Until a solution is found, try updating your repositories with this: 
apt-get update -o Acquire::PDiffs=false

Or by setting 
Acquire::Pdiffs false;
in /etc/apt/apt.conf</description>
			<author>Confusion</author>
			<category></category>
			<comments>http://confusion.tweakblogs.net/blog/3028/debian-aptitude-update-segmentation-fault.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/3028</guid>
			<pubDate>Wed, 04 Nov 2009 10:38:42 GMT</pubDate>
		</item>
		<item>
			<title>Eten laten bezorgen in Amsterdam? Thai Kitchen!</title>
			<link>http://confusion.tweakblogs.net/blog/3027/eten-laten-bezorgen-in-amsterdam-thai-kitchen!.html</link>
			<description>Ik ben zeer tevreden over Thai Kitchen, een bezorgtoko in Amsterdam. Amsterdam Zuidoost is nogal een uithoek, maar ze bezorgen er gewoon. Het eten is lekker en de service is goed: ze zijn vriendelijk en als ze iets vergeten zijn, dan komen ze het netjes nabrengen. Het enige minpuntje is de bezorgtijd: hou er rekening mee dat het minstens een uur duurt. Het eten is echter wel altijd warm als het aankomt. 

Deze ervaring is gebaseerd op twee keer bestellen met ~7 man.</description>
			<author>Confusion</author>
			<category></category>
			<comments>http://confusion.tweakblogs.net/blog/3027/eten-laten-bezorgen-in-amsterdam-thai-kitchen!.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/3027</guid>
			<pubDate>Tue, 03 Nov 2009 21:14:41 GMT</pubDate>
		</item>
		<item>
			<title>Avoid storing configuration data in your revision control system</title>
			<link>http://confusion.tweakblogs.net/blog/2959/avoid-storing-configuration-data-in-your-revision-control-system.html</link>
			<description>After a discussion with a colleague this afternoon, I thought I&#39;d share the following: you should avoid storing configuration data in your revision control system. Especially authentication credentials should not be in there. Here&#39;s why:When securing servers and networks, things like the server hosting an RCS don&#39;t get the same priority as, say, your web facing production server. Mistakes are easy to make and you can simply use Google to find &#39;accidentally&#39; web facing RCS&#39;s that expose passwords.There will be plenty of copies &#39;out there&#39;, outside of your control. How many developers have that data stored on their machine? How careful are they with their laptops and your production passwords?Access to the configuration is limited to those that should be able to change it: no accidental changes by a junior performing a careless check in.If you can use the exact same build for your development, test/staging and production environment, then you can cleanly separate between code problems and configuration problems. If you need to rebuild a distributable archive to have the build process include environment-specific configuration, there will always be the doubt that some other difference may have sneaked in.It&#39;s much easier to change the configuration if you don&#39;t have to make a new build to deploy the change.Now I specifically say &#39;avoid&#39; and not &#39;do not ever&#39;, because many frameworks do not make this separation particularly easy. In the Java world, standard frameworks like Maven, Spring and Hibernate all impose obstacles to succeed at keeping sensitive configuration data out of RCS&#39;s. 

Maven is a build tool that offers all kinds of build-time placeholder substitution capabilities, which is diametrically opposed to this advice. Spring does dependency injection and the configuration to wire your application together strongly attracts other types of configuration data to be included with it. And if you are paranoid enough to give production databases different names, so you can never accidentally run a test against a production database: how do you get that name into your Hibernate OR mappings at startup time?

It takes careful thought and thorough understanding of the build and startup processes, but in my opinion it is well worth it. Every time I deploy a new version of the one application in which configuration and code are completely separated, where I just have to drop a new .jar and restart, I dance with joy.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2959/avoid-storing-configuration-data-in-your-revision-control-system.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2959</guid>
			<pubDate>Tue, 20 Oct 2009 20:02:27 GMT</pubDate>
		</item>
		<item>
			<title>Wikipedia can be funny</title>
			<link>http://confusion.tweakblogs.net/blog/2886/wikipedia-can-be-funny.html</link>
			<description>From the article about Daniel Dennett:In October 2006, Dennett was hospitalized due to an aortic dissection. After a nine-hour surgery, he was given a new aorta. In an essay posted on the Edge website, Dennett gives his firsthand account of his health problems, his consequent feelings of gratitude towards the scientists and doctors whose hard work made his recovery possible, and his complete lack of a &#38;quot;deathbed conversion&#38;quot;. By his account, upon having been told by friends and relatives that they had prayed for him, he resisted the urge to ask them, &#38;quot;Did you also sacrifice a goat?&#38;quot;This made me laugh out loud, even though I am completely alone in my home at the moment. I hope someone will sacrifice a goat if I&#39;m ever hospitalized.</description>
			<author>Confusion</author>
			<category>4</category>
			<comments>http://confusion.tweakblogs.net/blog/2886/wikipedia-can-be-funny.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2886</guid>
			<pubDate>Sat, 03 Oct 2009 16:11:19 GMT</pubDate>
		</item>
		<item>
			<title>Een pluim voor Dunea (voormalig Duinwaterbedrijf Zuid-Holland)</title>
			<link>http://confusion.tweakblogs.net/blog/2790/een-pluim-voor-dunea-(voormalig-duinwaterbedrijf-zuid-holland).html</link>
			<description>Altijd fijn als instantie vlot van zich laten horen na een vraag. Eergisteren halveerde de waterdruk in mijn appartement opeens en sindsdien varieert de druk tussen die helft en de normale druk. Dat is goed te overleven, hoewel het vervelend is als die variaties net voorkomen als je onder de douche staat, aangezien de temperatuur daar ook behoorlijk van gaat schommelen. Aangezien de druk van het koude water ook varieerde, vermoedde ik dat de oorzaak weleens buiten mijn appartement kon liggen. De buren bleken het inderdaad ook gemerkt te hebben, dus belde ik vanmorgen Dunea met de vraag: &#38;quot;Is er iets mis?&#38;quot;. Ze wisten het niet, maar zouden het uitzoeken. Nog geen twee uur later kreeg ik telefoon van Dunea: ze zijn in de buurt aan het werk en daardoor kan de druk inderdaad weleens varieren. De werkzaamheden zullen tot ongeveer maandag duren. Bravo.</description>
			<author>Confusion</author>
			<category></category>
			<comments>http://confusion.tweakblogs.net/blog/2790/een-pluim-voor-dunea-(voormalig-duinwaterbedrijf-zuid-holland).html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2790</guid>
			<pubDate>Fri, 18 Sep 2009 12:17:23 GMT</pubDate>
		</item>
		<item>
			<title>Telecomratten</title>
			<link>http://confusion.tweakblogs.net/blog/2357/telecomratten.html</link>
			<description>Telecombedrijven... ze hebben het tot kunst verheven om hun klanten te bedriegen en ze op die manier op torenhoge kosten te jagen. We kennen allemaal de verhalen van mensen die per ongeluk een dienst aan hadden staan op vakantie en honderden euro&#39;s moesten betalen, terwijl ze de dienst niet eens gebruikt hadden. Heel klantvriendelijk allemaal.

Sinds de nummerinformatie dienst in april 2007 is vrijgegeven werden we overspoeld met commercials voor weet-ik-veel hoeveel verschillende nummers. Dat moet natuurlijk ergens van betaald worden en vandaag vertelt de OPTA ons hoe: een aantal diensten heeft zo goed mogelijk verborgen geprobeerd te houden dat ze ook na het doorverbinden hun tarief van pakweg 70 cpm blijven rekenen. In het nieuwsbericht worden specifiek 1850 en 1888 genoemd. De eerste is een onafhankelijk bedrijf (lees: een lepe afzetter die vindt dat hij op deze manier flink mag cashen), maar de tweede is KPN. De van oudsher betrouwbaar geachte oervader van de telecom in Nederland... weer een reputatie door de plee.

Ratten zijn het, allemaal.</description>
			<author>Confusion</author>
			<category></category>
			<comments>http://confusion.tweakblogs.net/blog/2357/telecomratten.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2357</guid>
			<pubDate>Mon, 27 Jul 2009 07:15:32 GMT</pubDate>
		</item>
		<item>
			<title>Be sure to know enough of the language you are arguing against</title>
			<link>http://confusion.tweakblogs.net/blog/2125/be-sure-to-know-enough-of-the-language-you-are-arguing-against.html</link>
			<description>Act 1. Someone makes an outrageous claim about a programming language.[1]Act 2. Someone points that claim out to others.[2]Act 3. Someone compares a snippet of code in the original article to his version in his preferred language and asserts that language is superior.Act 4. Someone, in this case me, points out that the exact same solution is possible in the original language. [3][4]A flamewar ensues, where people try to show that their solution in their favorite language is better. Well, that didn&#39;t really happen, but it makes for a more dramatic ending.

[1] I don&#39;t claim he&#39;s serious. In fact, I think he just ends his post on a tongue-in-cheek, semi-hopeful note.
[2] Singling out the least interesting part of the blog post as the title of his submission, IMHO
[3] Which explains the title of this post: if you don&#39;t have at least that much understanding of a language that you know whether a certain solution is possible or not, than you probably shouldn&#39;t be commenting on it.
[4] Act 4 has many variations, but usually people produce a different solution in the original language that approaches the solution in the alternative language.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2125/be-sure-to-know-enough-of-the-language-you-are-arguing-against.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2125</guid>
			<pubDate>Mon, 22 Jun 2009 15:31:00 GMT</pubDate>
		</item>
		<item>
			<title>Installing DB2 Express C on linux</title>
			<link>http://confusion.tweakblogs.net/blog/2104/installing-db2-express-c-on-linux.html</link>
			<description>For anyone else trying to install DB2 Express C, the free community edition of IBM&#39;s DB2, on his linux system and running into problems:You need to source sqllib/db2profile in every shell where you are going to run commands from sqllib/bin: code:1
confusion@ulm:~$ . sqllib/db2profileRunning the db2val validation program multiple times in a row can yield different results. For instance, on the first attempt, it told me it couldn&#39;t find the sqllib/logs directory. However, that one was already present (perhaps created by db2val?) and when I ran the validation program again, it noticed that.If db2val fails to start your instance withSQL1220N  The database manager shared memory set cannot be allocated.then you probably need to increase the maximum amount of shared memory the kernel may allocate: code:1
sysctl -w kernel.shmmax=268435456
The default is 32M and this increases it to 256M, which turned out to be enough. For 64-bit systems, they advise pushing it to 1GB. 

Edit: As moto-moi points out in the comments, this is a temporary change that will disappear with a reboot. To make it permanent, follow his instructions.If running code:1
confusion@ulm:~$ sqllib/adm/db2start returnsSQL10007N Message &#38;quot;-1390&#38;quot; could not be retrieved.  Reason code: &#38;quot;3&#38;quot;.then you probably forgot the first step I described here.If you try to make a connection from your favorite programming language and you receiveROOT CAPABILITY REQUIREDthen  you probably did a non-root install. Unfortunately, DB2 doesn&#39;t have any DB-level users: all user management, including authentication, is delegated to the OS. On a *nix system, the routine checking the password usually requires root privileges. The problem is that the file sqllib/security/db2ckpw needs to be owned by root and needs to have its setuid bit set:
code:1
2
chown root db2ckpw
chmod u+s db2ckpw
I first found the file sqllib/security32/db2ckpw, but that doesn&#39;t seem to be used on linux. Might be the Windows version? Afterwards, perform a
code:1
2
3
db2 force applications all
db2stop
db2start
The first command breaks all connections, otherwise the db2stop probably won&#39;t work.Keep an eye on sqllib/db2dump/db2diag.log: that&#39;s where interesting logging about DB2&#39;s functioning ends up. The db2diag command can be used to extract information from that file and can be used to tail it, if you haven&#39;t done so already.A warning I encountered in the db2diag log wasThe user per process file descriptor limit of 1024 is less than the maxfilop setting of 30720This can be solved by issuing 
code:1
ulimit -n 32768
However, that usually won&#39;t work, as the default limits prevent you from going above 1024. To overcome that limit, add the following line to /etc/security/limits.conf
code:1
your_db2_user hard nofile 32768
After that, you need to open a new shell (for that user) (if you are running an X environment: restart X) and the new shell will have it maximum number of file descriptors set to 32768 after you issue the ulimit command. Now all you need to do is restart DB2.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2104/installing-db2-express-c-on-linux.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2104</guid>
			<pubDate>Sat, 20 Jun 2009 13:43:00 GMT</pubDate>
		</item>
		<item>
			<title>A simple Java puzzler</title>
			<link>http://confusion.tweakblogs.net/blog/2083/a-simple-java-puzzler.html</link>
			<description>Java:12&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;final&#38;nbsp;long&#38;nbsp;YEAR_IN_MS&#38;nbsp;=&#38;nbsp;1000&#38;nbsp;*&#38;nbsp;60&#38;nbsp;*&#38;nbsp;60&#38;nbsp;*&#38;nbsp;24&#38;nbsp;*&#38;nbsp;365;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;System.out.println(YEAR_IN_MS);
What will be printed?</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2083/a-simple-java-puzzler.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2083</guid>
			<pubDate>Thu, 18 Jun 2009 12:59:17 GMT</pubDate>
		</item>
		<item>
			<title>Undecipherable product descriptions</title>
			<link>http://confusion.tweakblogs.net/blog/2041/undecipherable-product-descriptions.html</link>
			<description>Today I had to merge a Flex frontend into a Java project. Inside the Flex project, in a &#39;lib&#39; directory, I found something called &#39;cairngorm.swc&#39;. Having no experience with development in Flex, I had no clue what this file was. The person responsible was not available at the moment, so I did the only natural thing: Google it. That turned up Adobe&#39;s homepage for Cairngorm. The first section, which your eye falls onto when you view the page, is titled &#39;Overview&#39; and reads:Cairngorm is the lightweight micro-architecture for Rich Internet Applications built in Flex or AIR. A collaboration of recognized design patterns, Cairngorm exemplifies and encourages best-practices for RIA development advocated by Adobe Consulting, encourages best-practice leverage of the underlying Flex framework, while making it easier for medium to large teams of software engineers deliver medium to large scale, mission-critical Rich Internet Applications.
[..]Ehmmm, yeah, right. Thanks for making me feel stupid. Now I still don&#39;t know whether it&#39;s a library that I need to include to get the application to run, a standalone Flex viewer/debugger or a collection of examples. By clicking &#38;quot;More information&#38;quot; and reading further, I didn&#39;t actually get more information. Only after a PgDn I finally encounteredThe Cairngorm microarchitecture is intended as a framework for Enterprise RIA developers.ah, framework. That&#39;s a word I know. So it&#39;s a library.

I have this kind of experience more often than I like to: I read an introduction to something and afterwards I still have no idea what the thing is. Is it just me or do you also feel introductions should start with the simple facts and purpose and maybe expand towards an all-encompassing vision of the developers towards the end, rather than starting out that way and leaving you at a plane of abstraction that causes you to miss the actual simplicity of the thing?</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2041/undecipherable-product-descriptions.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2041</guid>
			<pubDate>Fri, 12 Jun 2009 15:57:17 GMT</pubDate>
		</item>
		<item>
			<title>Nasty Java HashMap race condition</title>
			<link>http://confusion.tweakblogs.net/blog/2019/nasty-java-hashmap-race-condition.html</link>
			<description>After reading this I think I need to check some applications I wrote in the past.

The piece is excellent and details matter, but I&#39;ll attempt a summary anyway:
if you use a regular HashMap in a multithreaded environment, it seems the worst that can happen is that you incur some additional cache misses due to race conditions. In a lot of situations that is perfectly acceptable and since wrapping the HashMap with Collections.synchronizedMap() incurs quite a performance penalty (and at that point, that was basically the choice), you are tempted to just leave the HashMap in. Don&#39;t. The &#39;put&#39; operation may trigger a resize and redistribution of the internal data structure of the HashMap that can thoroughly hose it is concurrently accessed during the restructing , to the extent that your program goes into an infinite loop.

These days, there isn&#39;t any performance reason to decide in favor of the regular HashMap: the java.util.concurrent.ConcurrentHashMap has excellent performance, even in singlethreaded applications. However, I think I&#39;ve made the mistake of using a regular HashMap somewhere in the past. However, the application has never malfunctioned (as far as I know), so it may well be that the chances of this bug occurring are so small that they are negligible for all practical purposes. Nevertheless, unless you want to do the math, replacing it by a ConcurrentHashMap is a safe bet.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/2019/nasty-java-hashmap-race-condition.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/2019</guid>
			<pubDate>Tue, 09 Jun 2009 20:03:26 GMT</pubDate>
		</item>
		<item>
			<title>Will technological innovation ever end?</title>
			<link>http://confusion.tweakblogs.net/blog/1714/will-technological-innovation-ever-end.html</link>
			<description>Sometimes people seem to make sense, but when you think about it a bit longer, you discover they&#39;re just rambling. Take What if our tech is good enough. Based on observations of the sales of Blue-Ray discs, Windows Vista and some other technological advancess, the author concludes that the improvements these technologies offer are too small to attract consumers and consequently there is no more room for innovation. The article ends rather abruptly, but the unspoken implication is that the manufacturers are doomed and that, perhaps, even technology in general has reached an endpoint.

Given the examples (though not all of them), that seems to make sense: at some point something is just so good that you couldn&#39;t wish for a better version. If you can&#39;t buy a better version of something that will work for twenty years, then the number of products sold will decline fast and the manufacturer has a problem. However, that line of though misses three important pointsEvery product has always reached a mature phase and manufacturers are usually prepared for that to happen. There haven&#39;t been major improvements in world receiver radio&#39;s for quite some time, but they are still being produced and sold.When the improvement upon the previous model decreases, the time to general adoption grows. This is usually because the price lowers with time and the cost-benefit ratio increases. If the time grows too large, steps may be skipped: 100GB video discs may well be the next big thing, even if blu-ray fails.It is about perceived improvement more than about real improvement. Did I actually need this 32&#38;quot; LCD television? Is it actually that much better than my previous 24&#38;quot; CRT version? I don&#39;t think so, yet I bought it.Therefore, we can conclude that the author was just following a train of thought that he didn&#39;t follow far enough. The rather abrupt end indicates that he should have expanded upon his thoughts or should have thrown the article away and written about something else. 

Nevertheless, this does leave us with one really interesting question: will there ever be a time when no technological improvements are marketable anymore? When you have your range of Star Trek technology: holosuite, replicator, spaceship, transporter, ..., would there still be a consumer market for new technology? If not, then the question is when the effective end would be reached.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/1714/will-technological-innovation-ever-end.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1714</guid>
			<pubDate>Sun, 19 Apr 2009 09:16:00 GMT</pubDate>
		</item>
		<item>
			<title>Thoughts on telecommuting</title>
			<link>http://confusion.tweakblogs.net/blog/1701/thoughts-on-telecommuting.html</link>
			<description>The author of an interesting Nerd Handbook had some thoughts on working remote. He hits a few important nails, that should be on the mind of everyone that works remote, has co-workers working remote or supervises people working remote. As often, the Hacker News comments are also worthwhile.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/1701/thoughts-on-telecommuting.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1701</guid>
			<pubDate>Thu, 16 Apr 2009 19:00:28 GMT</pubDate>
		</item>
		<item>
			<title>We should be able to fire politicians.</title>
			<link>http://confusion.tweakblogs.net/blog/1642/we-should-be-able-to-fire-politicians.html</link>
			<description>Freakonomics reports on a proposal by an Oregan representative to tax bike ownership:bikes have used the roads in this state forever and have never contributed a pennyAs dozens of readers at Freakonomics point out:Cycling hardly cause any wearing of roadsDriving a bicycle instead of a car greatly reduces the costs of the transportation to society. If anything, cyclists should be subsidizedEveryone already contributes to bicycle infrastructure, in the same way they contribute to infrastructure for pedestrians: are they going to tax people for owning shoes as well?In fact, to add insult to injury, cyclists already do not &#39;use up&#39; their share of expenses, by paying for the -- much more expensive -- infrastructure for motorized transportation via al kinds of general taxes.In short, this proposal is just stupid. A lawmaker that proposes it is either too dumb to think of these reasons for himself or simply doesn&#39;t care and just seeks some way to impose an additional tax on the people. Either way, he&#39;s not fit to do his job and it would be good if we were able to force replacement of such people.</description>
			<author>Confusion</author>
			<category>4</category>
			<comments>http://confusion.tweakblogs.net/blog/1642/we-should-be-able-to-fire-politicians.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1642</guid>
			<pubDate>Sat, 04 Apr 2009 10:32:17 GMT</pubDate>
		</item>
		<item>
			<title>Reclame onzin: zilvermoleculen</title>
			<link>http://confusion.tweakblogs.net/blog/1590/reclame-onzin-zilvermoleculen.html</link>
			<description>&#38;quot;Nieuw Nivea For Men Silver Protect met zilvermoleculen&#38;quot; schreeuwt de radio. Ik hoop dat iedereen op dat moment denkt: .... pardon? Wat in vredesnaam zijn &#39;zilvermoleculen&#39;?! Ik kijk op de website: misschien dat daar iets zinnigs staat. Maar nee, daar wordt het alleen maar erger:Silver Protect is de eerste en enige deodorant op basis van uiterst effectieve en wetenschappelijk bewezen zilvertechnologie. De unieke formule bevat actieve zilvermoleculen [..]Wat een verzameling ongelovelijke flauwekul!Er bestaan geen zilvermoleculen. Er bestaan zilveratomen en er bestaan zilverdeeltjes. Niemand die daadwerkelijk iets van zilver weet en iets met zilver doet spreekt van &#39;zilvermoleculen&#39;, niet in de laatste plaats omdat &#39;molecuul&#39; gedefinieerd is als bestaande uit tenminste twee soorten atomen.Wat in vredesnaam is &#39;zilvertechnologie&#39;? Als die term al ergens gebruikelijk voor is, dan is het voor methoden om zilver te winnen of zilver te verwerken. De enige die zo&#39;n term in de context van een verzorgingsproduct hanteert is een marketeer die van toeten noch blazen weet.&#39;Wetenschappelijk bewezen ...technologie&#39;? Je kan de juistheid van hypothesen en theorieen bewijzen door het gebruik van wetenschappelijke methoden. Een technologie is de toepassing van dergelijke kennis teneinde een bepaald doel te bereiken, zoals het in deodorant stoppen van zilveratomen. Daar valt verder niets aan te bewijzen, tenzij ze bedoelen dat ze bewezen hebben dat er daadwerkelijk zilveratomen in de deodorant zitten. Nou, applaus...</description>
			<author>Confusion</author>
			<category></category>
			<comments>http://confusion.tweakblogs.net/blog/1590/reclame-onzin-zilvermoleculen.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1590</guid>
			<pubDate>Sat, 28 Mar 2009 09:19:00 GMT</pubDate>
		</item>
		<item>
			<title>Go forth and talk to strangers</title>
			<link>http://confusion.tweakblogs.net/blog/1566/go-forth-and-talk-to-strangers.html</link>
			<description>I sometimes wonder why I keep taking the trouble of rummaging through the thousands of bits of information that RSS feeds offer me on a daily basis. As always, I don&#39;t have to wonder for long, for behold, I stumble upon another wonderfully educational insight:When I was growing up, children were commonly taught: &#38;quot;don&#39;t talk to strangers.&#38;quot; Strangers might be bad, we were told, so it&#39;s prudent to steer clear of them.

As it turns out, this is profoundly bad advice. Most people are honest, kind, and generous, especially when someone asks them for help. If a small child is in trouble, the smartest thing he can do is find a nice-looking stranger and talk to him.

The advice in each of these paragraphs may seem to contradict each other, but they don&#39;t. The difference is that in the second instance, the child is choosing which stranger to talk to. Given that the overwhelming majority of people will help, the child is likely to get help if he chooses a random stranger. But if a stranger comes up to a child and talks to him or her, it&#39;s not a random choice. It&#39;s more likely, although still unlikely, that the stranger is up to no good.Bruce Schneier goes on to explain what the relevance of such an insight is for the trustworthiness of collaborative spam filtering,  Tor and Wikipedia.</description>
			<author>Confusion</author>
			<category>4</category>
			<comments>http://confusion.tweakblogs.net/blog/1566/go-forth-and-talk-to-strangers.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1566</guid>
			<pubDate>Mon, 23 Mar 2009 19:42:00 GMT</pubDate>
		</item>
		<item>
			<title>The ability to predict a decision does not disprove free will</title>
			<link>http://confusion.tweakblogs.net/blog/1093/the-ability-to-predict-a-decision-does-not-disprove-free-will.html</link>
			<description>Every once in a while an experiment is published that seems to disprove the existence of free will. For a recent case, see this /. article. The experiments are usually sophistications of Benjamin Libet&#39;s famous experiment, in which he showed that you can predict that someone is going to respond to a certain event, before the subject himself is consciously aware of the fact that he is going to respond. This fact, that your brain has already fired the signals to perform a certain action, while you have not yet consciously registered that you are going to perform that action, seems to leave very little room for free will. After all, doesn&#39;t free will require you to consciously deliberate the action that will be taken?

The answer is simple: no. It is perfectly possible for free will to exist without it requiring conscious deliberation. To understand how this works, it is required to rethink what &#39;consciousness&#39; is. Consciousness is often portrayed as the faculty that allows us to actively participate in our thought processes. We reflect on various ideas and possibilities and finally assemble a conclusion, that we can then use to undertake a certain action. However, and this is the essential point: this is not our usual mode of thinking. Most of the time, we respond to our environment in an immediate and involuntary way. When your are going to get a cup of coffee, you don&#39;t consciously deliberate &#38;quot;Hmmm, it seems I have decided to get a cup of coffee. Are there any objections to this? It seems not. Well then, let&#39;s start to contract the relevant muscles to stand up and start walking, etc. ...&#38;quot;. In fact, you just do it. Only after you got up and started walking towards the kitchen, you may consciously register &#38;quot;wait, there is still a used mug here; why don&#39;t I bring it along to the kitchen?&#38;quot;. The earlier decision, taken by unconscious (but not necessarily irrational) processes, registered itself in your consciousness a few moments after the decision was first reached and action was initiated. Conscious deliberation then still allows you to intervene.

As a result, the original experiments of Benjamin Libet, nor later sophistications, have anything to say about the existence of free will. At most, they have something to say about the time it takes the brain to reach a decision, compared to the time it takes the brain to become aware of its own decision.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/1093/the-ability-to-predict-a-decision-does-not-disprove-free-will.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1093</guid>
			<pubDate>Sun, 22 Mar 2009 16:56:00 GMT</pubDate>
		</item>
		<item>
			<title>Writing good code requires you to perform experiments</title>
			<link>http://confusion.tweakblogs.net/blog/1456/writing-good-code-requires-you-to-perform-experiments.html</link>
			<description>How often do you have to solve a small problem that is a part of a larger project and decide to take the time to perform some seperate experiments to solve the problem, before adding the partial solution to the whole? In the past, I hardly ever did that and everytime I encounter such a situation, I still have to resist the temptation to take the route that seems to be the shortest, but that has long proven to be the longest road to the solution.

As an example, suppose you need to extract some information from a string and decide the best way is to use a regular expression. You know that the problem isn&#39;t trivial and that you probably need a few attempts to get it right. Still, your initial inclination is to just put the regex in there and go through the motions of compiling the code, performing the steps required to invoke the code (click a button, enter some text, etc), find out that the regex doesn&#39;t work, modify it and go through the motions again and again and again, probably while making some other modifications. Because the cycles take relatively long, progress is slow and you start cursing every typo. If you recognize this, then I think you can become faster and happier at your problem solving by reading on.

The advantage of the &#39;intuitive&#39; approach is that, if the solution is right, you have immediately come closer to solving the larger problem. However, if the solution fails, the iterations to be informed of your failure and to verify subsequent modifications may soon take more time than developing a seperate solution to the subproblem would have taken. For some reason, we always seem to underestimate the amount of work it takes to get it right and consequently we opt for the small change that we will have the correct solution the first time around.

Some of you may now be thinking that the obvious solution is to write a proper unit test and run that unit test after every modification, until the code passes the test. I agree that goes a long way, but usually the test is part of a larger number of classes and running all those tests takes times, especially if it bootstraps an entire Spring-Hibernate application or something of the like. In such as case, it still takes more time than is needed.

My solution is not to be afraid to experiment. It seems to cost too much time to create a new script or class, seperate from the larger project, provide the correct libraries, run this small project multiple times to get feedback on your solution and finally copy-paste the solution back into the project your are working on. However, my experience is that it is well worth the time you need to do this, because it prevents the endless cycles of building-deploying the entire application and getting it to provide feedback. I hardly write a regular expression or SQL query without first testing it seperately from the application. Now these example are given at the smallest level, but it also holds for somewhat larger design issues and even for issues people call &#39;software architecture&#39;.

Another thing about these small experiments that I find a major advantage, is that it gives you the freedom to explore some avenues that you wouldn&#39;t dare put into the actual project. You can&#39;t just start switching libraries or refactoring relatively large parts of the code and changing too much is risky and frowned upon, even if you can easily revert your changes (assuming you are using a versioning system. If you aren&#39;t, stop reading, install Subversion and commit your code before continuining this article).

A third advantage of experimenting is that it encourages you to rewrite and polish the code that you are writing. You can go through more iterations in  experiments &#39;outside&#39; of the project, because you have a clear overview over the code involved. Modifications of code inside a larger project are less inviting to proper refactoring to do &#39;the right thing&#39;.

Painters, writers, craftsmen, even philosophers: if famous ones are asked for the secret of their succes, they always advise exercise and experimentation. I hope I have explained that it also simply makes sense. If you don&#39;t want to take it from them, take it from rationale.</description>
			<author>Confusion</author>
			<category>3</category>
			<comments>http://confusion.tweakblogs.net/blog/1456/writing-good-code-requires-you-to-perform-experiments.html#reacties</comments>
			<guid isPermaLink="false">http://confusion.tweakblogs.net/blog/1456</guid>
			<pubDate>Thu, 05 Mar 2009 06:52:00 GMT</pubDate>
		</item>
	</channel>
</rss>