<?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>Site With The Lamp</title>
	<atom:link href="http://www.raditha.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.raditha.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 14 Mar 2010 06:22:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mysql Sphinx Storage Engine</title>
		<link>http://www.raditha.com/blog/archives/mysql-sphinx-storage-engine.html</link>
		<comments>http://www.raditha.com/blog/archives/mysql-sphinx-storage-engine.html#comments</comments>
		<pubDate>Sun, 14 Mar 2010 06:22:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[voice]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/mysql-sphinx-storage-engine.html</guid>
		<description><![CDATA[I have blogged about Sphinx in that past, but that was about CMU Sphinx, a Speech Recognition Engine, this Sphinx is different. This sphinx is a Search Engine. Pretty good one too. The Sphinx search daemon has a mysql compatible API, which means you can use your trusty old mysql console or query browser to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.raditha.com/blog/archives/360.html">I have blogged about Sphinx</a> in that past, but that was about CMU Sphinx, a Speech Recognition Engine, this Sphinx is different. This <a href="http://sphinxsearch.com/">sphinx is a Search Engin</a>e. Pretty good one too. The Sphinx search daemon has a <a href="http://mysql.com">mysql</a> compatible API, which means you can use your trusty old mysql console or query browser to do a search. You can even use the PHP mysql API if you wanted to, but there is no need to do that because PHP has support for the default Sphinx protocol. However if your preferred programming language didn&#8217;t include support for Sphinx you could still use the mysql compatible mode.</p>
<p>The sphinx index isn&#8217;t really a mySQL database, so you cannot join it to your other tables. That&#8217;s where the Sphinx storage engine comes into the picture. It allows you to create a table in your existing databases to represent the Sphinx index. That would allow you to actually use the sphinx data in a join or sub query. You might ask why goto all this trouble? Why not just use full text? Full text search has it&#8217;s limitations, most notable being how slow it is when you have large table. A full text search on a table with 8 million rows (which is about as much as we have on Pitupasa.com at the moment) will take 10-15 seconds to complete. Sphinx on the other hand returns the results in a fraction of a second.</p>
<p>At first glance, it seems that enabling the sphinx storage engine is kidstuff. Just download the sphinx and mysql source tarballs, copy a set of files from sphinx into the mysql source tree, do a BUILD/autorun.sh followed by ./configure &#8211;with-plugins=sphinx  (see full instructions at <a href="http://www.sphinxsearch.com/docs/current.html#sphinxse-mysql50">http://www.sphinxsearch.com/docs/current.html#sphinxse-mysql50</a> ). Except that it doesn&#8217;t work.</p>
<p style="padding-left: 30px;"><span style="color: #993300;">configure error: unknown plugin: sphinx</span></p>
<p>Yes, I know what I am doing. No there weren&#8217;t any typos. I am not the first one to run into it. The others who ran into this problem don&#8217;t seem to have found the solution either. Then I ran into another set of instructions at <a href="http://www.sphinxsearch.com/wiki/doku.php?id=sphinx_sphinxse_on_rhel">http://www.sphinxsearch.com/wiki/doku.php?id=sphinx_sphinxse_on_rhel</a> there the instruction is to use &#8216;-with-plugin&#8217; but shouldn&#8217;t that be &#8216;&#8211;with-plugins&#8217; ? since I have already tried &#8216;&#8211;with-plugins&#8217; I tried &#8216;&#8211;with-plugin&#8217; (note the s). I tried &#8216;&#8211;with-plugin&#8217; and the compiler didn&#8217;t complain about the missing sphinx plugin as above. But still the sources in the sphinx folder were not getting built. By the way, &#8216;configure &#8211;help&#8217; shows the correct parameter to be &#8211;with-plugins. But then none of these things will result in the sphinx storage engine being built.</p>
<p>The docs refer to a prepatched mysql source tarball, unfortunatley it appears to have been taken off line. There is a patch for mysql 5.0.x but I don&#8217;t want to use that because I want to be able to partition the table and indexes (a feature that is not available in mysql 5.0.x). Oh well looks like it&#8217;s time to look at <a href="http://www.mnogosearch.org/">mnogosearch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/mysql-sphinx-storage-engine.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centos 5.4  , PHP 5.3 and Harvard Referencing.</title>
		<link>http://www.raditha.com/blog/archives/centos-5.4-php-5.3-and-harvard-referencing..html</link>
		<comments>http://www.raditha.com/blog/archives/centos-5.4-php-5.3-and-harvard-referencing..html#comments</comments>
		<pubDate>Mon, 01 Mar 2010 11:45:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rad Inks]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[deadinedue]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/centos-5.4-php-5.3-and-harvard-referencing..html</guid>
		<description><![CDATA[A couple of days back, we did an update to Deadlinedue, the Harvard reference generator, the moment the database was updated and the new code was put in place, PHP started segfaulting. It was time to decide whether to roll back or press forward. I chose the latter and it resulted in the site been [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days back, we did an update to <a href="http://deadlinedue.com/">Deadlinedue</a>, the Harvard reference generator, the moment the database was updated and the new code was put in place, PHP started segfaulting. It was time to decide whether to roll back or press forward. I chose the latter and it resulted in the site been offline for <a href="http://deadlinedue.com/blog/more-accurate-citations.html">around an hour</a>.</p>
<p style="padding-left: 30px;">I<span style="color: #993300;">t is not possible to assign complex types to nodes in /var/www/deadline/ISBN.php on line 480, referer: http://deadlinedue.com/index.php?lookf<br />
or=http%3A%2F%2Fraditha.com&amp;find=find<br />
*** glibc detected *** /usr/sbin/httpd: double free or corruption (fasttop): 0&#215;81cdfc78 ***</span></p>
<p>PHP is pretty old now, it&#8217;s not something that you expect to segfault, so initially I thought the culprit would be APC &#8211; Advanced PHP Cache. These PHP accelerators or caches are known to crash every once in a while. That can be easily fixed by removing the accelerator. In this case we could afford to do so since we had upgraded the server very recently and optimized the code which resulted in a speed boost and reduced memory usage. I was barking up the wrong tree,  disabling APC didn&#8217;t do any good. So guess it&#8217;s time to upgrade PHP?</p>
<p>Now you might ask, shouldn&#8217;t we have used the same version of PHP in our development and production servers to ensure that this sort of thing didn&#8217;t happen? Right you are but who expects PHP of all things to crash like this. It&#8217;s really rediculous that deadlinedue is hosted in the cloud. So we could easily have made a snapshot of it and started another server in less than 5 minute. We could have tested with that guinea pig and then gone live, but no, I was too cocky.</p>
<p>This is <a href="http://centos.org/">Centos</a> 5.4 and there are no RPMs available for PHP 5.3.1, So it was time to compile from scratch. Which usually means you need to run ./configure about half a dozen times, fixing each of the missing dependencies it rep<span style="color: #000000;">o</span>rts until it completes without error. Fortunately there is plenty of bandwidth on <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> and the servers are blazing fast. Most deps can be installed in less time than it takes to type out the yum install command.</p>
<p>After all this the problem still wasn&#8217;t solved, a lot of modules we needed like JSON , DOM and heck even Mysqli were not getting added!</p>
<p style="padding-left: 30px;"><span style="color: #993300;">PHP Warning:  PHP Startup: apc: Unable to initialize module\nModule compiled with module API=20050922\nPHP    compiled with module API=20090626\nThese optio<br />
ns need to match\n in Unknown on line 0<br />
PHP Warning:  PHP Startup: dbase: Unable to initialize module\nModule compiled with module API=20050922\nPHP    compiled with module API=20090626\nThese opt<br />
ions need to match\n in Unknown on line 0<br />
PHP Warning:  PHP Startup: dom: Unable to initialize module\nModule compiled with module API=20050922\nPHP    compiled with module API=20090626\nThese optio<br />
ns need to match\n in Unknown on line 0<br />
PHP Warning:  PHP Startup: json: Unable to initialize module\nModule compiled with module API=20050922\nPHP    compiled with module API=20090626\nThese opti<br />
ons need to match\n in Unknown on line 0</span></p>
<p>Given enough time, I can track down their causes and fix these errors, but time was exactly what I was not having on my hands. So tried looking around to find out if there are any RPMs available from third party repositories that would update PHP to version 5.3.1. Fortunately there was.  The repo is called <a href="http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/">Web Tactic</a>. Update using the RPMs took just seconds and good news, no more segmentation faults. The bad news is that APC is no longer available.  I tried  I tried &#8216;yum install php-pecl-apc&#8217;  without success. Then tried &#8216;pecl install apc&#8217; and got the following error:</p>
<p style="padding-left: 30px;"><span style="color: #993300;">/tmp/pear/temp/APC/php_apc.c: In function &#8216;zif_apc_compile_file&#8217;:<br />
/tmp/pear/temp/APC/php_apc.c:881: warning: unused variable &#8216;eg_class_table&#8217;<br />
/tmp/pear/temp/APC/php_apc.c:881: warning: unused variable &#8216;eg_function_table&#8217;<br />
/tmp/pear/temp/APC/php_apc.c: At top level:<br />
/tmp/pear/temp/APC/php_apc.c:959: error: duplicate &#8217;static&#8217;<br />
make: *** [php_apc.lo] Error 1<br />
ERROR: `make&#8217; failed</span></p>
<p>Oh well, can live without APC for the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/centos-5.4-php-5.3-and-harvard-referencing..html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug in Twitter list get members?</title>
		<link>http://www.raditha.com/blog/archives/bug-in-twitter-list-get-members.html</link>
		<comments>http://www.raditha.com/blog/archives/bug-in-twitter-list-get-members.html#comments</comments>
		<pubDate>Sun, 07 Feb 2010 01:32:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/bug-in-twitter-list-get-members.html</guid>
		<description><![CDATA[If you add yourself to a list and then call the get list members method you might be surprised by the result.

One of the data items returned by the get list id method includes the number of members in your list. The get list members method returns 20 members at a time and you need [...]]]></description>
			<content:encoded><![CDATA[<p>If you add yourself to a list and then call the <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-GET-list-memberships">get list members</a> method you might be surprised by the result.</p>
<p style="text-align: center; margin-top: 25px; margin-bottom:25px"><img class="aligncenter" src="/blog/images/twitter/e4c5-lists.png" alt="Add user to a list" /></p>
<p>One of the data items returned by the <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-GET-list-id">get list id</a> method includes the number of members in your list. The <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-GET-list-memberships">get list members</a> method returns 20 members at a time and you need to call the it multiple times using different cursor locations to retrieve the complete membership. When you count them and compare against the number returned by the get list id method, you will find that they do not match. Your own account is not part of the dataset that is returned.</p>
<p style="text-align: center; margin-top: 25px; margin-bottom:25px"><img class="aligncenter" src="/blog/images/twitter/election-xml.png" alt="the XML from the twitter api call" /></p>
<p>By the time you are reading this post, the list might have changed. So I have saved a copy of the XML <a href="/blog/images/list-members.xml">here.</a> On the other hand when you access the list through twitter.com, you can see that I am included in my own list. In fact my screen name (e4c5) appears twice!</p>
<p style="text-align: center; margin-top:25px; margin-bottom:25px"><img class="aligncenter" src="/blog/images/twitter/election-2010.png" alt="the twitter list" /></p>
<p>The work around I suppose is to not rely on the members count returned by the get list id method.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/bug-in-twitter-list-get-members.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 11 on amazon ec2</title>
		<link>http://www.raditha.com/blog/archives/fedora-11-on-amazon-ec2.html</link>
		<comments>http://www.raditha.com/blog/archives/fedora-11-on-amazon-ec2.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 07:14:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/fedora-11-on-amazon-ec2.html</guid>
		<description><![CDATA[Amazon has been offering cloud hosting services for longer than most unfortuntely they don&#8217;t seem to have updated their Amazon Machine Images since they started operation. Well, it&#8217;s not exactly accurate, they have reasonably upto date images for some linux distributions and for windows. However many of the linux images are actually owned by third [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://aws.amazon.com/ec2/">Amazon</a> has been offering cloud hosting services for longer than most unfortuntely they don&#8217;t seem to have updated their Amazon Machine Images since they started operation. Well, it&#8217;s not exactly accurate, they have reasonably upto date images for some linux distributions and for windows. However many of the linux images are actually owned by third parties and not by amazon itself. As for my favourite distribution Fedora, what&#8217;s available is Fedora 8! After reading the discussion at <a href="http://developer.amazonwebservices.com/connect/message.jspa?messageID=141707">http://developer.amazonwebservices.com/connect/message.jspa?messageID=141707</a> I thought to try my hand at creating my own Fedora 11 or 12 AMI.</p>
<p>Unfortunately I didn&#8217;t meet with a lot of success the Fedora 11 AMI refused to boot but trouble started even before, first with yum reported numerous depsolving errors. I tried to sort them out by using the &#8211;skip-broken flag to no avail.</p>
<p style="padding-left: 30px;"><span style="color: #800000;"><br />
</span></p>
<p style="padding-left: 30px;"><span style="color: #800000;">Total size: 252 M<br />
Is this ok [y/N]: y<br />
Downloading Packages:<br />
Running rpm_check_debug<br />
ERROR with rpm_check_debug vs depsolve:<br />
libcrypto.so.7 is needed by (installed) httpd-tools-2.2.14-1.fc10.i386<br />
libssl.so.7 is needed by (installed) httpd-tools-2.2.14-1.fc10.i386<br />
Complete!<br />
(1, [u'Please report this error in http://yum.baseurl.org/report'])</span></p>
<p>I worked around this by uninstalling the complaining RPM (yum remove httpd-tools-2.2.14-1.fc10.i386) and putting it back after the upgrade had completed. Nevertheless the machine reused to boot up. I tried to do this as a two step process, stopping at F10, booting up that image and then upgrading to F11. Unfortunately that didn&#8217;t quite work out either. The terminal displayed by the Amazon Management Console remains blank without anything ever showing up on it. Then I tried changing the RAM Disk and Kernel,  tried  using aki-20c12649 as the kernel and ari-21c12648 as the ramdisk with the same result.</p>
<p>In the end I gave up on this temporarily and used a third party Centos 5.4 image (uploaded by <a href="http://www.rightscale.com/">RightScale</a>) for the task at hand. Going to come back to this problem later. Want to try installing a new image on the loopback device.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/fedora-11-on-amazon-ec2.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Netbeans, Aptana and Debugging AIR Apps</title>
		<link>http://www.raditha.com/blog/archives/netbeans-aptana-and-debugging-air-apps.html</link>
		<comments>http://www.raditha.com/blog/archives/netbeans-aptana-and-debugging-air-apps.html#comments</comments>
		<pubDate>Sat, 26 Dec 2009 03:07:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/netbeans-aptana-and-debugging-air-apps.html</guid>
		<description><![CDATA[It&#8217;s been a while since Aptana 2.0 came out. I ignored it till version 2.02 was out. As usually happens with most software, what worked in previous versions doesn&#8217;t work in the new version. Now if this had been with version 2.0, you could have just said someone forgot to do a regression test but [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since Aptana 2.0 came out. I ignored it till version 2.02 was out. As usually happens with most software, what worked in previous versions doesn&#8217;t work in the new version. Now if this had been with version 2.0, you could have just said someone forgot to do a regression test but not so with 2.02</p>
<p>So what doesn&#8217;t work? The Adobe AIR debugger. It gets stuck at &#8216;Launching New_Configuration&#8217; and this dialog pops up without the air app starting up.</p>
<p align="center"><img src="/blog/images/aptana-debug.png" alt="Aptana error dialog" /></p>
<p>Sounds like a socket error but this is running on localhost and all my ports are open to the local machine. As usual when I run into a problem there is nothing on google and there is nothing on the log file. At this stage I would gladly switch to Netbeans. I use for almost everything other than air. Unfortunatley I never figured out how to use the netbeans debugger with AIR. Couldn&#8217;t find any howto either.</p>
<p>Next I came across a reference to a third party debugger that you can use with any AIR app, regardless of the IDE that you use. It looks like a great project. Unfortunately the developers forget to create some documentation. There isn&#8217;t even a getting started guide.</p>
<p>I am on holiday so I am doing this on my Mac the only options available are to go back to version 1.5 or to wait till I get back home next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/netbeans-aptana-and-debugging-air-apps.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnash WTF?</title>
		<link>http://www.raditha.com/blog/archives/gnash-wtf.html</link>
		<comments>http://www.raditha.com/blog/archives/gnash-wtf.html#comments</comments>
		<pubDate>Sun, 13 Dec 2009 05:34:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[weird]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/gnash-wtf.html</guid>
		<description><![CDATA[My machine got really slowed down all of a sudden I suspected Netbeans and did a `ps -ef &#124; grep java` to find it&#8217;s pid and kill it. The output from ps floored me:
raditha  11263     1  1 Dec10 ?        01:00:02  /usr/java/1.6/bin/java [...]]]></description>
			<content:encoded><![CDATA[<p>My machine got really slowed down all of a sudden I suspected Netbeans and did a `ps -ef | grep java` to find it&#8217;s pid and kill it. The output from ps floored me:</p>
<div style="margin: 15px; overflow: auto; height: 200px;">raditha  11263     1  1 Dec10 ?        01:00:02  /usr/java/1.6/bin/java -Djdk.home=/usr/java/1.6 -classpath /usr/local/netbeans-6.8beta/platform11/lib/boot.jar:/usr/local/netbeans-6.8beta/platform11/lib/org-openide-modules.jar:/usr/local/netbeans-6.8beta/platform11/lib/org-openide-util.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/boot_ja.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/boot_pt_BR.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/boot_zh_CN.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-modules_ja.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-modules_pt_BR.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-modules_zh_CN.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-util_ja.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-util_pt_BR.jar:/usr/local/netbeans-6.8beta/platform11/lib/locale/org-openide-util_zh_CN.jar:/usr/java/1.6/lib/dt.jar:/usr/java/1.6/lib/tools.jar -Dnetbeans.system_http_proxy=DIRECT -Dnetbeans.system_http_non_proxy_hosts= -Dnetbeans.dirs=/usr/local/netbeans-6.8beta/nb6.8:/usr/local/netbeans-6.8beta/bin/../ergonomics2:/usr/local/netbeans-6.8beta/ide12:/usr/local/netbeans-6.8beta/bin/../java3:/usr/local/netbeans-6.8beta/bin/../xml2:/usr/local/netbeans-6.8beta/bin/../apisupport1:/usr/local/netbeans-6.8beta/bin/../webcommon1:/usr/local/netbeans-6.8beta/websvccommon1:/usr/local/netbeans-6.8beta/bin/../enterprise6:/usr/local/netbeans-6.8beta/bin/../mobility8:/usr/local/netbeans-6.8beta/bin/../profiler3:/usr/local/netbeans-6.8beta/bin/../ruby2:/usr/local/netbeans-6.8beta/bin/../python1:/usr/local/netbeans-6.8beta/php1:/usr/local/netbeans-6.8beta/bin/../visualweb2:/usr/local/netbeans-6.8beta/bin/../soa2:/usr/local/netbeans-6.8beta/bin/../identity2:/usr/local/netbeans-6.8beta/bin/../uml6:/usr/local/netbeans-6.8beta/bin/../harness:/usr/local/netbeans-6.8beta/bin/../cnd3:/usr/local/netbeans-6.8beta/bin/../dlight2:/usr/local/netbeans-6.8beta/bin/../groovy2:/usr/local/netbeans-6.8beta/bin/../extra:/usr/local/netbeans-6.8beta/bin/../javafx2:/usr/local/netbeans-6.8beta/bin/../javacard1: -Dnetbeans.home=/usr/local/netbeans-6.8beta/platform11 -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xmx512m -Dorg.glassfish.v3ee6.installRoot=/usr/local/glassfish-v3-prelude -Dcom.sun.aas.installRoot=/usr/local/glassfish-v2.1 -client -Xverify:none -Xss2m -Xms32m -XX:PermSize=32m -XX:MaxPermSize=200m -Dnetbeans.logger.console=true -ea -Dapple.laf.useScreenMenuBar=true -Dsun.java2d.noddraw=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/raditha/.netbeans/6.8beta/var/log/heapdump.hprof org.netbeans.Main &#8211;userdir /home/raditha/.netbeans/6.8beta &#8211;branding nb<br />
raditha  11992 11899  0 Dec10 ?        00:13:52 /usr/bin/gtk-gnash -x 81788981 -j 250 -k 250 -u http://pagead2.googlesyndication.com/pagead/imgad?id=CM-h38ij_5DanwEQ-gEY-gEyCDEGjWlZTOVn -F 14 -U http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1352004480420876&amp;output=html&amp;h=250&amp;slotname=3285550185&amp;w=250&amp;lmt=1258513226&amp;flash=9.0.999.%20Gnash%200.8.5%2C%20the%20GNU%20SWF%20Player.%20%20%20Copyright%20%26copy%3B%202006%2C%202007%2C%202008%20%3Ca%20href%3D%22http%3A%2F%2Fwww.fsf.org%22%3EFree%20Software%20%20%20Foundation%3C%2Fa%3E%2C%20Inc.%20%3Cbr%3E%20%20%20Gnash%20comes%20with%20NO%20WARRANTY%2C%20to%20the%20extent%20permitted%20by%20law.%20%20%20You%20may%20redistribute%20copies%20of%20Gnash%20under%20the%20terms%20of%20the%20%20%20%3Ca%20href%3D%22http%3A%2F%2Fwww.gnu.org%2Flicenses%2Fgpl.html%22%3EGNU%20General%20Public%20%20%20License%3C%2Fa%3E.%20For%20more%20information%20about%20Gnash%2C%20see%20%3Ca%20%20%20href%3D%22http%3A%2F%2Fwww.gnu.org%2Fsoftware%2Fgnash%2F%22%3E%20%20%20http%3A%2F%2Fwww.gnu.org%2Fsoftware%2Fgnash%3C%2Fa%3E.%20%20%20Compatible%20Shockwave%20Flash%209.0%20r999.&amp;url=http%3A%2F%2Fwww.bitrebels.com%2Fgeek%2Flost-inside-google-wave-5-waves-to-make-your-life-easier%2F&amp;dt=1258513238576&amp;correlator=1258513238578&amp;frm=0&amp;ga_vid=1321434809.1258513230&amp;ga_sid=1258513230&amp;ga_hid=1759684983&amp;ga_fc=1&amp;u_tz=300&amp;u_his=1&amp;u_java=1&amp;u_h=900&amp;u_w=1600&amp;u_ah=875&amp;u_aw=1600&amp;u_cd=24&amp;u_nplug=13&amp;u_nmime=351&amp;biw=1577&amp;bih=660&amp;ref=http%3A%2F%2Ftwitter.com%2F&amp;fu=0&amp;ifi=1&amp;dtd=223&amp;xpc=bzbonGxyqd&amp;p=http%3A//www.bitrebels.com -P allowscriptaccess=never -P flashvars=clickTAG=http://googleads.g.doubleclick.net/aclk%3Fsa%3Dl%26ai%3DB2KrK6uggS7eLJYq5jQfFwJTwDteKyowBsZ7IzgrAjbcBkE4QARgBIJD0zAo4AFDj0NFTYJEBoAHl-dr5A7IBEXd3dy5iaXRyZWJlbHMuY29tugEKMjUweDI1MF9hc8gBBNoBV2h0dHA6Ly93d3cuYml0cmViZWxzLmNvbS9nZWVrL2xvc3QtaW5zaWRlLWdvb2dsZS13YXZlLTUtd2F2ZXMtdG8tbWFrZS15b3VyLWxpZmUtZWFzaWVyL7gCGKgDAfUDAAAAhA%26num%3D1%26sig%3DAGiWqtyRVOXsNj9Q7HH3OPiRTjJRuSTKVg%26client%3Dca-pub-1352004480420876%26adurl%3Dhttp://uc.gamestotal.com/o_in_strategy.cfm%253Fref%253Dadworda_strategy_flash250uc2 -P height=250 -P id=google_flash_embed -P pluginspage=http://www.macromedia.com/go/getflashplayer -P src=http://pagead2.googlesyndication.com/pagead/imgad?id=CM-h38ij_5DanwEQ-gEY-gEyCDEGjWlZTOVn -P type=application/x-shockwave-flash -P width=250 -P wmode=opaque -</div>
<p>You think I have a large list of java apps running? look closely, it&#8217;s just two! One is <a href="http://www.nebeans.org">Netbeans</a>. Netbeans is a Sun project, so you have to expect it to behave weirdly but look at the second one. It&#8217;s Gnash; the open source replacement for the Adobe Flash player. That line is just massive. Looks like <a href="http://www.gnu.org/software/gnash/">Gnash</a> is adding all the HTTP variables into the environment. No hang on a second, Firefox is sending all the HTTP variables to Gnash through the command line. What the hell? is this how browser plugins are supposed to work? Surely this is not secure?</p>
<p>If you URL decode the out put of ps it&#8217;s double WTF.</p>
<div style="margin: 15px; overflow: auto; height: 200px;">raditha  11992 11899  0 Dec10 ?        00:13:52 /usr/bin/gtk-gnash -x 81788981 -j 250 -k 250 -u http://pagead2.googlesyndication.com/pagead/imgad?id=CM-h38ij_5DanwEQ-gEY-gEyCDEGjWlZTOVn -F 14 -U http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1352004480420876&amp;output=html&amp;h=250&amp;slotname=3285550185&amp;w=250&amp;lmt=1258513226&amp;flash=9.0.999. Gnash 0.8.5, the GNU SWF Player.   Copyright © 2006, 2007, 2008 <a href="http://www.fsf.org">Free Software   Foundation</a>, Inc.<br />
Gnash comes with NO WARRANTY, to the extent permitted by law.   You may redistribute copies of Gnash under the terms of the   <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public   License</a>. For more information about Gnash, see <a href="http://www.gnu.org/software/gnash/"> http://www.gnu.org/software/gnash</a>.   Compatible Shockwave Flash 9.0 r999.&amp;url=http://www.bitrebels.com/geek/lost-inside-google-wave-5-waves-to-make-your-life-easier/&amp;dt=1258513238576&amp;correlator=1258513238578&amp;frm=0&amp;ga_vid=1321434809.1258513230&amp;ga_sid=1258513230&amp;ga_hid=1759684983&amp;ga_fc=1&amp;u_tz=300&amp;u_his=1&amp;u_java=1&amp;u_h=900&amp;u_w=1600&amp;u_ah=875&amp;u_aw=1600&amp;u_cd=24&amp;u_nplug=13&amp;u_nmime=351&amp;biw=1577&amp;bih=660&amp;ref=http://twitter.com/&amp;fu=0&amp;ifi=1&amp;dtd=223&amp;xpc=bzbonGxyqd&amp;p=http://www.bitrebels.com -P allowscriptaccess=never -P flashvars=clickTAG=http://googleads.g.doubleclick.net/aclk?sa=l&amp;ai=B2KrK6uggS7eLJYq5jQfFwJTwDteKyowBsZ7IzgrAjbcBkE4QARgBIJD0zAo4AFDj0NFTYJEBoAHl-dr5A7IBEXd3dy5iaXRyZWJlbHMuY29tugEKMjUweDI1MF9hc8gBBNoBV2h0dHA6Ly93d3cuYml0cmViZWxzLmNvbS9nZWVrL2xvc3QtaW5zaWRlLWdvb2dsZS13YXZlLTUtd2F2ZXMtdG8tbWFrZS15b3VyLWxpZmUtZWFzaWVyL7gCGKgDAfUDAAAAhA&amp;num=1&amp;sig=AGiWqtyRVOXsNj9Q7HH3OPiRTjJRuSTKVg&amp;client=ca-pub-1352004480420876&amp;adurl=http://uc.gamestotal.com/o_in_strategy.cfm%3Fref%3Dadworda_strategy_flash250uc2 -P height=250 -P id=google_flash_embed -P pluginspage=http://www.macromedia.com/go/getflashplayer -P src=http://pagead2.googlesyndication.com/pagead/imgad?id=CM-h38ij_5DanwEQ-gEY-gEyCDEGjWlZTOVn -P type=application/x-shockwave-flash -P width=250 -P wmode=opaque -</div>
<p>Even a copyright notice is passed as a parameter!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/gnash-wtf.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter Search API inconsistency</title>
		<link>http://www.raditha.com/blog/archives/twitter-search-api-inconsistency.html</link>
		<comments>http://www.raditha.com/blog/archives/twitter-search-api-inconsistency.html#comments</comments>
		<pubDate>Sun, 29 Nov 2009 13:43:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/twitter-search-api-inconsistency.html</guid>
		<description><![CDATA[In recent weeks, it seems like I spent most of my time finding bugs in the twitter API or third party libraries. Maybe I should get a job in their testing team. This latest bug was discovered in the twitter search API. The from_user and the from_user_id fields do not quite match. Here are some [...]]]></description>
			<content:encoded><![CDATA[<p>In recent weeks, it seems like I spent most of my time finding bugs in the <a href="http://apiwiki.twitter.com">twitter API</a> or third party libraries. Maybe I should get a job in their testing team. This latest bug was discovered in the twitter search API. The <em>from_user</em> and the <em>from_user_id</em> fields do not quite match. Here are some examples:</p>
<p style="padding-left: 30px;"><span style="color: #993300;">{&#8220;profile_image_url&#8221;:&#8221;http://a1.twimg.com/profile_images/311054570/SecuritySystemPlaza.comLogo_normal.jpg&#8221;,&#8221;created_at&#8221;:&#8221;Sun, 29 Nov 2009 12:39:51 +0000&#8243;,&#8221;from_user&#8221;:&#8221;SecurityPlaza&#8221;,&#8221;to_user_id&#8221;:null,&#8221;text&#8221;:&#8221;GE SECURITY &#8211; USA TX6010011 ONLY<br />
$78.66 AT WWW.SECURITYSYSTEMPLAZA.COM&#8221;,&#8221;id&#8221;:6168853273,&#8221;from_user_id&#8221;:28463195,&#8221;geo&#8221;:null,&#8221;iso_language_code&#8221;:&#8221;en&#8221;,&#8221;source&#8221;:&#8221;&amp;lt;a href=&amp;quot;http://apiwiki.<br />
twitter.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;API&amp;lt;/a&amp;gt;&#8221;}</span></p>
<p>Here the from_user field is given as SecurityPlaza and the from_user_id field shows a value of 28463195, if you look at http://twitter.com/users/28463195.xml you will see that the user id of 28463195 corresponds to <a href="http://twitter.com/ballercoolkid">@ballercoolkid</a> on the other hand http://twitter.com/users/show.xml?screen_name=SecurityPlaza  gives a user id of 56297110 to &lt;a href=&#8221;http://twitter.com/SecurityPlaza&#8221;&gt;@SecurityPlaza&lt;/a&gt;.  So which one of these users sent out the tweet? it was @SecurityPlaza</p>
<p>Here is the second example:</p>
<p style="padding-left: 30px;"><span style="color: #993300;">{&#8220;profile_image_url&#8221;:&#8221;http://a1.twimg.com/profile_images/364463510/logo_normal.jpg&#8221;,&#8221;created_at&#8221;:&#8221;Sun, 29 Nov 2009 09:32:56 +0000&#8243;,&#8221;from_user&#8221;:&#8221;hindichannels&#8221;,&#8221;to_user_id&#8221;:null,&#8221;text&#8221;:&#8221;Sacked opposition party member to spearhead campaign against Genera<br />
l Fonseka: Nov 29, Colombo: A member of the main&#8230; http://bit.ly/8OBKwS&#8221;,&#8221;id&#8221;:6166287234,&#8221;from_user_id&#8221;:32271894,&#8221;geo&#8221;:null,&#8221;iso_language_code&#8221;:&#8221;en&#8221;,&#8221;source<br />
&#8220;:&#8221;&amp;lt;a href=&amp;quot;http://twitterfeed.com&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;twitterfeed&amp;lt;/a&amp;gt;&#8221;}</span></p>
<p>Here the user hindichannels has been associated with the userId of 32271894 where as that ID really belongs to <a href="http://twitter.com/mrsdraz">@mrsdraz</a> the correct id for <a href="http://twitter.com/hindichannels">@hindichannels</a> is 61683443 interestingly the results are easily reproducable. Two different searches produced the same errornous output (&#8216;<a href="http://search.twitter.com/search.json?q=colombo&amp;rpp=100&amp;show_user=true&amp;page=1">fonseka</a>&#8216; and &#8216;<a href="http://search.twitter.com/search.json?q=colombo&amp;rpp=100&amp;show_user=true&amp;page=1">colombo</a>&#8216;)</p>
<p>I tried these searches between 6:00-7:00pm on Nov 29th by the time that you try these web API calls on your own, the search results would have changed dramatically. So <a href="raditha.com/blog/images/twit-json-samples.tar.gz">here is a cached copy</a> for you. By the way, the search results may have contained other inaccuracies but these are the only ones that I noticed thanks to some safety checks we have in the <a href="http://pitupasa.com/">Pitupasa</a> code base.</p>
<p>The XML search results does not have this problem due to the simple fact that the user ids are not included in it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/twitter-search-api-inconsistency.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving a Twitter OAuth and Incorrect Signatures Mystery</title>
		<link>http://www.raditha.com/blog/archives/solving-a-twitter-oauth-and-incorrect-signatures-mystery.html</link>
		<comments>http://www.raditha.com/blog/archives/solving-a-twitter-oauth-and-incorrect-signatures-mystery.html#comments</comments>
		<pubDate>Wed, 25 Nov 2009 10:28:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/solving-a-twitter-oauth-and-incorrect-signatures-mystery.html</guid>
		<description><![CDATA[If you see a Twitter or Facebook app that asks for your username and password you should run a mile. Admittedly OAuth is not anymore secure than CHAP authentication but there is a crucial difference; most people use the same username/password (or at least the same password ) on multiple websites, email addresses, memory cards [...]]]></description>
			<content:encoded><![CDATA[<p>If you see a <a href="http://twitter.com/">Twitter</a> or Facebook app that asks for your username and password you should run a mile. Admittedly <a href="http://oauth.net/">OAuth</a> is not anymore secure than CHAP authentication but there is a crucial difference; most people use the same username/password (or at least the same password ) on multiple websites, email addresses, memory cards and what have you. By necessity when a web app saves your password for Twitter or Facebook or any other site, it has to be encrypted with a symmetric key, which means the plain text version can be easily obtained.</p>
<p>Users don&#8217;t need any special effort for Oauth but developers do. Writing an application that uses OAuth instead of passwords is supposed to take just a wee bit more effort, (but all seasoned programmers know what exactly that means).</p>
<p>One of the issues we ran into was caused by Twitter returning an &#8216;Incorrect signature&#8217; error for List Delete member api calls. The signature was being generated using the <a href="http://github.com/abraham/twitteroauth">TwitterOauthLib</a>. The signature was correct. It worked fine for all other methods excepts for DELETE calls. If you passed in the same parameters to a different Oauth library, you would get the exact same signature so are we seeing a bug in the twitter API?  You might also suspect that this is because the underlying HTTP client library didn&#8217;t support the DELETE HTTP method. In this case it&#8217;s curl and the DELETE method is supported. Nevertheless I tried using an HTTP POST while sending the _method=DELETE parameter as suggested by the <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-DELETE-list-members">Twitter API documentation</a> with out any luck.</p>
<p>On further investigation I found that all the parameters were being posted for both DELETE and POST requests. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">RFC 2616</a> doesn&#8217;t specify how you should pass parameters (request body or query string) for DELETE requests. I decided to change the TwitterOauth code to include the parameters as query strings (get the <a href="http://www.raditha.com/blog/images/oauth-patch.txt">patch</a>). Sure enough twitter accepted the request without the incorrect signature error.  The modified code now looks like this:</p>
<div style="margin: 20px; overflow: auto; height: 200px;">
<pre>  function http($url, $method, $postfields = NULL) {

    $ci = curl_init();

    /* Curl settings */

    curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this-&gt;connecttimeout);

    curl_setopt($ci, CURLOPT_TIMEOUT, $this-&gt;timeout);

    curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);

    curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));

    curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this-&gt;ssl_verifypeer);

    switch ($method) {

      case 'POST':

        curl_setopt($ci, CURLOPT_URL, $url);

        curl_setopt($ci, CURLOPT_POST, TRUE);

        if (isset($postfields)) {

          curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);

        }

        break;

      case 'DELETE':

        curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');

        if (isset($postfields)) {

            curl_setopt($ci, CURLOPT_URL, "{$url}?{$postfields}");

        }

        else

        {

            curl_setopt($ci, CURLOPT_URL, $url);

        }

        break;

      default:

            curl_setopt($ci, CURLOPT_URL, $url);

            break;

    }

    $response = curl_exec($ci);

    $this-&gt;http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);

    $this-&gt;last_api_call = $url;

    curl_close ($ci);

    //if ($this-&gt;format === 'json' &amp;&amp; $this-&gt;decode_json) {

    //  return json_decode($response);

    //}

    return $response;

  }</pre>
</div>
<p>Also had to do a modification to the oAuthRequest method, which was automatically appending the twitterId to the url it&#8217;s not required (and in fact leads to an incorrect link for list methods). That means if you have been using an unpatched TwitterOauth library and have been passing in the twitterId as a parameter, you will have to change that.</p>
<p>Oh and btw, <a href="http://twitter.com/e4c5">follow me on twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/solving-a-twitter-oauth-and-incorrect-signatures-mystery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 12 Post Install Cleanup.</title>
		<link>http://www.raditha.com/blog/archives/fedora-12-post-install-cleanup..html</link>
		<comments>http://www.raditha.com/blog/archives/fedora-12-post-install-cleanup..html#comments</comments>
		<pubDate>Sat, 21 Nov 2009 08:24:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[lame]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/fedora-12-post-install-cleanup..html</guid>
		<description><![CDATA[Upgrading Fedora is easy. It&#8217;s the post upgrade clean up that kills you. As already mentioned, the move from version 11 to 12, left behind 581 packages from F11. These should ideally be removed to avoid unexpected segfaults, system crashes and inconsistent behavior. It shouldn&#8217;t happen but it does happen, if you don&#8217;t cleanup now, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Upgrading Fedora is easy. It&#8217;s the post upgrade clean up that kills you. As already mentioned, <a href="http://www.raditha.com/blog/archives/fedora-12-rant.html">the move from version 11 to 12,</a> left behind 581 packages from F11. These should ideally be removed to avoid unexpected segfaults, system crashes and inconsistent behavior. It shouldn&#8217;t happen but it does happen, if you don&#8217;t cleanup now, later you will have a hard time figuring out some programs will not start up or package updates cannot be applied.  `package-cleanup &#8211;cleandupes` is a good starting point. This command will remove the older version from the system when there are two versions of the same package. Well that&#8217;s what it&#8217;s supp<span style="color: #000000;">osed to do, but it choked:</span></p>
<p style="text-align: left; padding-left: 30px;"><span style="color: #ff0000;">service fuse does not support chkconfig<br />
error: %preun(fuse-2.7.4-3.fc11.x86_64) scriptlet failed, exit status 1</span></p>
<p style="text-align: left; padding-left: 30px;">
<p style="text-align: left;"><span style="color: #ff0000;"><span style="color: #000000;">Trying to manually remove the fuse package with yum gets you nowhere fast:</span></span></p>
<p style="text-align: left; padding-left: 30px;"><span style="color: #ff0000;">Running Transaction<br />
service fuse does not support chkconfig<br />
Error in PREUN scriptlet in rpm package fuse<br />
fuse-2.7.4-3.fc11.x86_64 was supposed to be removed but is not!</span></p>
<p style="text-align: left;">
<p style="text-align: left;"><span style="color: #ff0000;"><span style="color: #000000;">Using `rpm -e` produces the exact same error as package-cleanup (which is because package-cleanup was merely passing through the error message it received from rpm). Fortunately the &#8211;noscripts paramter to rpm can be used to force the uninstall.</span></span></p>
<p style="text-align: left; padding-left: 30px;">rpm -e &#8211;noscripts fuse-2.7.4-3.fc11.x86_64 fuse-2.8.1-1.fc11.x86_64</p>
<p style="text-align: left;">After the rpm command was executed in this manner, package-cleanup also would run to completion with out any errors. But it has a funny idea about what completion is; there are still 433  .fc11 rpms lying about. Most of these packages are from third party repos such as RPM fusion. A yum update ought to fix it and indeed the applying 684MB of updates resulted in all but 68 of the fedora 11 rpms disappearing from the system. Some of these are old kernels/kernels headers which can be removed with `package-cleanup &#8211;oldkernels` that still leaves around 60 rpms that you might have to manually uninstall and re install. You might also right the following simple command to remove them all en mass:</p>
<p style="text-align: left; padding-left: 30px;">yum remove `rpm -qa | grep fc11`</p>
<p style="text-align: left;">The only catch is that it might remove some other important packages but putting those back in might be easier than removing 60 rpms one at a time. BTW why are these rpms tagged as FC11 or FC12, with FC standing for Fedora Core when the OS itself is no longer called Fedora Core? That name hasn&#8217;t been used for ages. Now it&#8217;s just Fedora</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;"><span style="color: #ff0000;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/fedora-12-post-install-cleanup..html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fedora 12 (Rant)</title>
		<link>http://www.raditha.com/blog/archives/fedora-12-rant.html</link>
		<comments>http://www.raditha.com/blog/archives/fedora-12-rant.html#comments</comments>
		<pubDate>Fri, 20 Nov 2009 02:45:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/fedora-12-rant.html</guid>
		<description><![CDATA[It is said that thanks to Fedora&#8217;s half yearly release cycle, you always get to use cutting edge technology. Bleeding edge would be more appropriate and it is no surprise that some RPM repositories do have a branch labeled &#8216;bleeding&#8217;.
Every Fedora upgrade introduces more problems than it solves which makes you wonder if this is [...]]]></description>
			<content:encoded><![CDATA[<p>It is said that thanks to Fedora&#8217;s half yearly release cycle, you always get to use cutting edge technology. Bleeding edge would be more appropriate and it is no surprise that some RPM repositories do have a branch labeled &#8216;bleeding&#8217;.</p>
<p>Every Fedora upgrade introduces more problems than it solves which makes you wonder if this is any different from Windows. The new features are usually not even worthy of a blog post and <a href="http://www.raditha.com/blog/archives/the-never-ending-problems-with-fedora-updates..html">an upgrade never goes smoothly</a>. So why bother? Well each time I install a new version, I sweart that I will skip the next upgrade but after six months of using a buggy OS, you get tired of it and want to get those problems fixed the new version will usually do that but introduce a new set of problems.</p>
<p>The major issue with the current version F11 is that X server keeps crashing for no apparent reason. Ctrl-Alt-backspace (annoyingly disabled in most new xorg versions, you need to enable it by editing the key mappings) will not kill the server. Ctrl-Alt F2 , F3 etc will not get you a console. Yet the machine is not dead. You can very easily SSH into it from another computer. You can even kill x from the shell but X refuses to die. Well it does die but the screen does not change. It remains steadfastly stuck on the last screen that you worked on. Even those annoying Ajax spinners are frozen for once. The only fix is to go all the way down to runlevel one and then do an init 5 from there. But who has the patience of all that stuff? I usually just hit the reboot button.</p>
<p>So my desktop, which once upon a long ago would run continuously for weeks at a time, now needs to be restarted several times a day. One sad day, X crashed thrice. Surely even m$ can do better than that?</p>
<p>If that&#8217;s not bad enough the update makes things worse. X wouldn&#8217;t start at all. There is absolutely nothing in the Xorg.log file either but it would start up when you type startx from the shell! explain that!!</p>
<p>I suspect the reason has lots to do with F11 and F12 RPMS getting mixed up. Each Fedora installation leaves an unbelievable number of packages from the previous version lying around. This version has left 581 F11 rpms behind. The worst was when the first 64bit version came out. There were so many 32bit RPMs left behind that almost nothing would  run, even the boot process got stuck.</p>
<p>In the past I got <a href="http://www.raditha.com/blog/archives/001423.html">so fed up with fedora</a> that I even tried Ubuntu and Debian only to find that they are <a href="http://www.raditha.com/blog/archives/001458.html">even more annoying</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/fedora-12-rant.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Broadband speedtest</title>
		<link>http://www.raditha.com/blog/archives/broadband-speedtest.html</link>
		<comments>http://www.raditha.com/blog/archives/broadband-speedtest.html#comments</comments>
		<pubDate>Thu, 29 Oct 2009 09:14:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[broadband]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/broadband-speedtest.html</guid>
		<description><![CDATA[The other day, an idiot from SLT, tried to convince me that their 512kb/s ADSL line is as fast as a 2048kb/s WiMax link. You can expect people at SLT to make statements like that. Many of them probably hadn&#8217;t seen a computer till they joined the company. There is a huge shortage of geeks [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, an idiot from SLT, tried to convince me that their 512kb/s ADSL line is as fast as a 2048kb/s WiMax link. You can expect people at SLT to make statements like that. Many of them probably hadn&#8217;t seen a computer till they joined the company. There is a huge shortage of geeks at Telecom companies in Sri Lanka.</p>
<p>In actual fact, a 512kbps SLT ADSL line only gives about 430kb/s</p>
<p><img src="http://www.speedtest.net/result/598385338.png" alt="SLT speed" /></p>
<p>Notice that this test is being carried out against, SLT&#8217;s own speedtest server in Colombo. It&#8217;s only about 10 Kilometers away but it still takes 32 milliseconds for a ping. Remember Electronic signals travel at 300,000km/s so this indicates slow routers.</p>
<p>How does SLT perform when you test against a distance server? Much worse.</p>
<p><img src="http://www.speedtest.net/result/598384647.png" alt="SLT speed" /></p>
<p>Right, now let&#8217;s see how Lanka Bell WiMax Performs:<br />
<img src="http://www.speedtest.net/result/598380855.png" alt="SLT speed" /></p>
<p><img src="http://www.speedtest.net/result/598382364.png" alt="SLT speed" /></p>
<p>Lankabell&#8217;s ping isn&#8217;t so good either but the upload and download speeds are right up there. You get more than 90% of the advertised speed. SLT&#8217;s subsidiary Mobitel has a mobile broadband service. Here is the speed test:</p>
<p><img src="http://www.speedtest.net/result/601408823.png" alt="SLT speed" /><br/><br />
<img src="http://www.speedtest.net/result/601409842.png" alt="SLT speed" /></p>
<p>I even stepped outdoors to see if that would improve the speed (since 3.5g signals don&#8217;t travel well through masonry).</p>
<p>So in short, if you want an ADSL line that can be compared to a 2mbps WiMax link, you will have to get a 4mbps line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/broadband-speedtest.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cloud Hosting or an Apples and Oranges Comparision</title>
		<link>http://www.raditha.com/blog/archives/cloud-hosting-or-an-apples-and-oranges-comparision.html</link>
		<comments>http://www.raditha.com/blog/archives/cloud-hosting-or-an-apples-and-oranges-comparision.html#comments</comments>
		<pubDate>Fri, 23 Oct 2009 04:20:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[etc]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/cloud-hosting-or-an-apples-and-oranges-comparision.html</guid>
		<description><![CDATA[Comparing the offering of different cloud computing service providers is pretty much like comparing Apples and Oranges. However on the websites of many cloud hosting providers you do find a feature comparison table (usually against amazon EC2). Not surprisingly EC2 always comes off second best. In spite of that EC2 is still in business which [...]]]></description>
			<content:encoded><![CDATA[<p>Comparing the offering of different cloud computing service providers is pretty much like comparing Apples and Oranges. However on the websites of many cloud hosting providers you do find a feature comparison table (usually against amazon EC2). Not surprisingly EC2 always comes off second best. In spite of that EC2 is still in business which means there is something worth investigating. But first a full disclosure: <a href="http://www.radinks.com/">our company</a> is already using Amazon EC2 and we are happy with it. Our DeadlineDue.com site is hosted on an EC2 instance and also relies on the Amazon Associates API to fetch book information. Other than that there is no other factor influencing the contents of this post.</p>
<p>Comparison between different service providers has been made difficult by the fact that some of them charge you for RAM while other don&#8217;t. Similarly you may or may not be charged for a virtual hard drive. To make matters worse different providers provide different virtual CPUs sometimes the CPU is described rather vaguely:</p>
<p>&#8220;We believe that customers will typically get results similar to a 2ghz processor, but it can vary depending on the applications requirements.&#8221;<br />
(<a href="http://www.flexiscale.com/faqs.php">Flexiscale</a>)</p>
<p>What&#8217;s that a P4? a Xeon? or perhaps it&#8217;s a Celeron. It&#8217;s actually none of those. All the virtual servers have virtual CPUs but it would be nice if the service provider can say something like &#8220;EC2 Compute Unit (ECU) – One EC2 Compute Unit (ECU) provides the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor.&#8221;  (&lt; a href=&#8221;http://aws.amazon.com/ec2/#instance&#8221;&gt;Amazon) so you know what you are getting into.</p>
<p>The first step in comparing these services would be to normalize them so that we are comparing various citrus fruits rather than apples against oranges. But normalizing the CPU isn&#8217;t so easy. Most people would tell you that a 2.0GHz Xeon is better than a 2.0GHz Core 2 Duo but by how much? You will not easily find a definitive answer. One reason is that different processors are better for different things. Your Core 2 Duo might even perform better on your desktop when used for gaming.</p>
<p>Because of the lack of scientific data, we are forced to split our applications into two different types &#8211; CPU intensive apps and non CPU intensive apps. A Spam filter will likely fall into the former category and a web server delivering mostly static content into the latter. For Non CPU intensive apps we will lump all the Xeons and non Xeons together. For CPU intensive apps we will multiply the processor speed by a factor. In the same manner, we will lump together all the RAM regardless of their nominal speeds. Hard drive speeds will also be different but they will suffer the same fate as the RAM and the CPU</p>
<p>to be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/cloud-hosting-or-an-apples-and-oranges-comparision.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloud hosting</title>
		<link>http://www.raditha.com/blog/archives/cloud-hosting.html</link>
		<comments>http://www.raditha.com/blog/archives/cloud-hosting.html#comments</comments>
		<pubDate>Wed, 21 Oct 2009 11:33:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[etc]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/cloud-hosting.html</guid>
		<description><![CDATA[If you believe everything that cloud hosting companies tell you, thanks to them, small businesses, startups or someone trying out an online venture no longer needs to invest a fortune on servers. In actual fact, the credit for that should go to the thousands of small web hosting companies that made it possible for you [...]]]></description>
			<content:encoded><![CDATA[<p>If you believe everything that cloud hosting companies tell you, thanks to them, small businesses, startups or someone trying out an online venture no longer needs to invest a fortune on servers. In actual fact, the credit for that should go to the thousands of small web hosting companies that made it possible for you to rent (rent not buy) servers right in your own town.</p>
<p>Cloud hosting companies should however be credited for further reducing the barrier to entry. (If the server is not in your basement it doesn&#8217;t matter whether it&#8217;s on the other side of town or the other side of the world).  Cloud hosting makes it possible to start with the lowest price option and automatically scale upwards should your service or website become successful or has a sudden spike in traffic.</p>
<p>Cloud hosting isn&#8217;t as abundant as virtual or dedicated hosting right now. <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>, <a href="http://www.opsourcecloud.net/">Opsource</a>, <a href="http://www.rackspacecloud.com/">Rackcloud</a> and <a href="http://www.gogrid.com/">GoGrid</a> are some of the names that come to (my) mind.  Because each company has different price models, offers different virtual CPUs , virtual storage options and non virtual SLAs it&#8217;s very hard to do a comparison between them to find out which option is the best for you.</p>
<p>There are some cases where virtual hosting or even dedicated hosting might be more cost effective than cloud hosting. Additionally there are situations where combining virtual hosting with cloud storage (eg amazon s3) might be the best option.</p>
<p>Over the next few days, I plan to dig deep into the services provided by these companies and try to figure out which option is most cost effective &#8216;bit for bit&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/cloud-hosting.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chess Databases.</title>
		<link>http://www.raditha.com/blog/archives/chess-databases..html</link>
		<comments>http://www.raditha.com/blog/archives/chess-databases..html#comments</comments>
		<pubDate>Tue, 13 Oct 2009 15:31:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/chess-databases..html</guid>
		<description><![CDATA[Once upon a long ago, pre match preparation meant spending  a great deal of time pouring over their ECO or a BCO or an MCO (perhaps even all three) and a bunch of Šahovski Informator plus half a dozen monograms to end up being thoroughly confused. The next day, after the game is over, they [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a long ago, pre match preparation meant spending  a great deal of time pouring over their ECO or a BCO or an MCO (perhaps even all three) and a bunch of <a href="http://en.wikipedia.org/wiki/Chess_Informant">Šahovski Informator</a> plus half a dozen monograms to end up being thoroughly confused. The next day, after the game is over, they inevitably need to take all those books out again to find out where they went wrong. Fortunately or unfortunately, during my playing days, the number of copies of opening encyclopedia available in Sri Lanka could be counted in your fingers. Now things have become a lot easier thanks to games databases. If your opponent is highly rated, you can analyze all his games and prepare and ambush.</p>
<p>There are several commercial and free desktop games databases but there are quite a few online databases too. <a href="http://www.chess.com/explorer/">Chess.com Game Explorer</a> is one such database. During a game you can quickly hit the explore button and track the master games or your own games. It is even possible to browse your opponents or any other players completed games as well. The term &#8216;master games&#8217; should be treated with a pinch of salt, there are about 2.5 million games in this database but not all of them have been played by FMs, IMs or GMs. According to the rules at chess.com, it&#8217;s not illegal to resort to an electronic database during correspondence chess but you cannot use an engine.  However you are not allowed to resort to a database for blitz or rapid chess (which they call live chess). It should also be added that only premium members can use the games explorer.</p>
<p>Another online chess database is at <a href="http://www.chessgames.com/">chessgames.com</a> but only 530,000 games are available, however unlike at chess.com, master games really have been played by masters. The UI isn&#8217;t all that great but it still beats going through books and having to setup the board over and over again. There are many other similar sites but the number of games are far too few.</p>
<p>When it comes to desktop databases windows users sadly have more of a choice than those using linux. Every commercial chess engine seems to be a bundled with at least a small collection of games. For many years, linux users have been limited to Scid. Perhaps being limited to isn&#8217;t the right choice of words because Scid is actually a very good program.</p>
<p>I stopped taking part in competitive chess in 2000 and didn&#8217;t play at all until 2008 when I started to play online. By that time <a href="http://scid.sourceforge.net/index.html">Scid</a> had almost become abandonware. I guess the authors thought it was feature complete and didn&#8217;t bother to update it anymore. Instead a fork named <a href="http://chessdb.sourceforge.net/">chessDB</a> (which in turn had not been updated since 2006) had become available. It ships with a database of over 4 million games. So chessDB is what I used to keep track of openings and to manage the games I have played at chess.com for a while now. I knew that it was more than just a database &#8211; it&#8217;s a xboard/UCI client as well. What&#8217;s more several engines are bundled with it too. However I never managed to get it to analyze a game properly with any of those engines.</p>
<p style="text-align: center;"><img class="aligncenter" src="/blog/images/chess/chessdb-err.png" alt="chessdb error message when starting an engine" /></p>
<p>For the life of me, I could never figure out why the xboard interface should complain about a difference of 32 and 64 bit systems. This is a client/server system after all it matters not whether one has a 64 bit OS while the other has a 32 bit OS. The other mystery is about why the error message mentions windows (isn&#8217;t windows an 8 bit system?). So just out of curiosity, I decided to take a look at Scid. Lo and Behold, there has been an update just last month! This new version (4) has a new structure for the database but you can convert scid 3 databases to version 4. Scid 3 (.si3) is the format used by chessDB and those files including the 4million games database was easily imported.</p>
<p>Scid 4 easily interacts with engines and what&#8217;s more, it comes bundled with three of them (Toga II, Scidlet and Phalanx ). It takes a little while to figure out how game can be completely analyzed by the engine without having it produce a list of variations as long as your arm for even the most trivial alternatives. But it looks good. Real good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/chess-databases..html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chess On Linux</title>
		<link>http://www.raditha.com/blog/archives/chess-on-linux.html</link>
		<comments>http://www.raditha.com/blog/archives/chess-on-linux.html#comments</comments>
		<pubDate>Mon, 05 Oct 2009 11:11:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/chess-on-linux.html</guid>
		<description><![CDATA[It is widely believed that the gnuchess and xboard is all that you need to play a game of chess on a linux computer. While it&#8217;s certainly enough to get you started, it&#8217;s certainly not the last word. Besides, playing against the computer is just a waste of time, computers should be used only for [...]]]></description>
			<content:encoded><![CDATA[<p>It is widely believed that the <a href="http://www.gnu.org/software/chess/">gnuchess</a> and <a href="http://www.tim-mann.org/xboard.html">xboard</a> is all that you need to play a game of chess on a linux computer. While it&#8217;s certainly enough to get you started, it&#8217;s certainly not the last word. Besides, <a href="http://www.raditha.com/blog/archives/chess-engines-and-databases.html">playing against the computer is just a waste of time</a>, computers should be used only for post mortem analysis.  The Xboard user interface is rather archaic and it wouldn&#8217;t even start up on one of my linux boxes (xboard: no fonts match pattern -*-helvetica-bold-r-normal&#8211;*-*-*-*-*-*-*-*).</p>
<p style="text-align: center;"><a title="xboard screenshot" href="/blog/images/chess/xboard.png"><img class="aligncenter" src="http://raditha.com/blog/images/chess/xboard-t.png" alt="xboard screenshot" /></a></p>
<p>With most non-commercial chess engines you need a separate client software to provide a GUI for the engine (sometimes you do find them bundled together you can even find packages that include all three; opening database, client and engine). Such clients are often based on the Xboard protocol (sometimes called the winboard protocol). Xboard of course is the grand daddy of all xboard (and winboard) clients. There are many xboard implementations for windows but only a few for Linux and OS X. Fortunately many of the software written for windows can be installed under wine. But first lets look at the native apps. The next one I tried though wasn&#8217;t really native, it was a Java app named <a href="http://code.google.com/p/decaf-chess-interface/">Decaf</a>. It turns out that Decaf is a front end for the &lt;a href=&#8221;http://www.freechess.org/&#8221;&gt;free internet chess server&lt;/a&gt; and cannot be used with an engine.</p>
<p style="text-align: center;"><a title="eboard screenshot" href="/blog/images/chess/eboard.png"><img class="aligncenter" src="/blog/images/chess/eboard-t.png" alt="eboard screenshot" /></a></p>
<p>The next one I looked at was Eboard. This again is better suited as a frontend for the FICS. According to the online documentation eboard can be used to analyze a game but the documentation doesn&#8217;t tell you how exactly that can be done. As with xboard, the UI is a bit archaic so I decided to look beyond.  I looked past <a href="http://knights.sourceforge.net/news_archive.php">Knights</a> , <a href="http://primates.ximian.com/~jpr/gnome-chess/">Gnome Chess</a> (not updated in ages) and <a href="http://www.jinchess.com/">Jin</a> (FICS client) before taking a closer look at <a href="http://slibo.sourceforge.net/">Slibo</a>. It hasn&#8217;t been updated since 2003 either but the screenshots looked impressive. Unfortunately I never got to install it. There are no binaries available and the source wouldn&#8217;t compiled (it&#8217;s looking for Qt 3 headers/libraries &#8211; the current version is Qt is 4.5.2 ).</p>
<p style="text-align: center;"><a title="pychess screenshot" href="/blog/images/chess/pychess.png"><img class="aligncenter" src="/blog/images/chess/pychess-t.png" alt="pychess screenshot" /></a></p>
<p>Next option was <a href="http://pychess.googlepages.com/screenshots">pychess</a> &#8211; it could be easily installed with yum and it&#8217;s user interface looks decent.  That seems to pretty much exhaust the list of chess clients available for linux. I guess it&#8217;s time to look at windows apps that can be installed under wine or to look for a combined engine/client.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/chess-on-linux.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chess Engines and Databases</title>
		<link>http://www.raditha.com/blog/archives/chess-engines-and-databases.html</link>
		<comments>http://www.raditha.com/blog/archives/chess-engines-and-databases.html#comments</comments>
		<pubDate>Sun, 04 Oct 2009 11:16:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/chess-engines-and-databases.html</guid>
		<description><![CDATA[Only an utter moron would choose to play chess against the computer. It&#8217;s dead boring and if you had not already acquired a taste for it through over the board play, you might even erroneously conclude that it is the game that is boring. There is second reason too; it&#8217;s well nigh impossible to beat [...]]]></description>
			<content:encoded><![CDATA[<p>Only an utter moron would choose to play chess against the computer. It&#8217;s dead boring and if you had not already acquired a taste for it through over the board play, you might even erroneously conclude that it is the game that is boring. There is second reason too; it&#8217;s well nigh impossible to beat a modern computer at chess. A super GM might be able to beat another one in OTB play but that same player would struggle to beat a chess engine that plays at 2500 strength. That&#8217;s because half the game is across outside the board. It&#8217;s gamesmanship and psychological tactics. You can stifle a yawn or snigger at the computer to make it feel that it made a blunder.</p>
<p>Chess software has it&#8217;s uses to too. Gone are the days when players swore by print copies of the ECO or the BCO (here in Sri Lanka, we never had them anyway). They have been replaced by openings databases. You no longer need to subscribe to the <a href="http://en.wikipedia.org/wiki/Chess_Informant">Šahovski Informator</a> to keep your openings knowledge upto date. Nowadays you can download a pgn file from the <a href="http://www.chesscenter.com/twic/twic.html">The Week in Chess</a></p>
<p>The other useful purpose served by chess software is in Post Mortem analysis. You no longer have to go begging to a strong player to have a complicated game analyzed. Even then the analysis may not be perfect (unless your friend is a GM). On the other hand, a chess engine given sufficient time to ponder rarely makes any mistakes. So a Chess Engine plus an Openings database (sometimes you need a client software too) are essential tools for anyone who takes chess seriously. Well, I take chess very seriously but I haven&#8217;t had an engine installed on my computer for nine years! That&#8217;s because I retired from the game in 2000 however I started playing online at yahoo chess the day <a href="http://en.wikipedia.org/wiki/Bobby_Fischer">Bobby Fischer</a> died (what a sad day that was). Many players on yahoo chess are said to use chess engines for cheating. So I switched to <a href="http://www.chess.com/">chess.com</a> early this year and started playing seriously again about the middle of the year.</p>
<p>I have slowly begun to find my touch and my ratings are going up slowly in fits and starts. I have been using chess.com &#8217;s post mortem analysis engine to analyze my games but i&#8217;ve become fed up with it of late because the analysis is woefully inaccurate. I suspect the reason for this is because it analyzes hundreds if not thousands of games each day and thus allocates limited CPU for each game. The analysis is so bad, I have even see it miss mates, not once but twice. So the time has come to finally install an engine. While there are hundreds of engines for Windows, there are precious few for linux. I am planning to go through them and find something suitable tomorrow. So tune in again</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/chess-engines-and-databases.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to sell computers running linux (part 2).</title>
		<link>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux-part-2..html</link>
		<comments>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux-part-2..html#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:24:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[etc]]></category>
		<category><![CDATA[lame]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux-part-2..html</guid>
		<description><![CDATA[Having successfully persuaded one of my friends to buy an Ezy SlimTop, which is an Intel Atom based computer that runs with Linux, I recommended it to another friend. When she tried to buy one they were out of stock. This was less than a week after the product was launched so we can safely [...]]]></description>
			<content:encoded><![CDATA[<p>Having successfully persuaded one of my friends to buy an <em>Ezy SlimTop</em>, which is an Intel Atom based computer that runs with Linux, I recommended it to another friend. When she tried to buy one they were out of stock. This was less than a week after the product was launched so we can safely assume that it has been selling like hot cakes. A couple of days later my friend did get hold of one.</p>
<p>After successfully copying her old files the first thing she tried was to start Thunderbird to check mail. Where the heck is Thunderbird on this thing? Well it&#8217;s not there. Ezy Slim Top ships with a customized version of Ubuntu. I have never been a fan of Ubuntu but surely the Thunderbird package is included in the Ubuntu DVD? why couldn&#8217;t those Moron&#8217;s install it? I told my friend all she needed to do was to download the tarball, expand it, look for a file called thunderbird or mozilla-thunderbird or something similar and just click on it, it will run. No dice. She says nothing happens! She was adamant that she did everything right. I was getting rather irritated with her but finally asked her to send it over for me to have a look. What happens when I click on the thunderbird binary? nothing!</p>
<p>Thunderbired fails silently but when your run it from the command line a set of errors about missing stdc++ libraries show up. The obvious thing to do is to install Thunderbird with apt-get. That will result in all the dependencies being installed. But for that you need the root password. Or do you? Well on Ubuntu you can do without the root password. They encourage using sudo instead of a root login. Sudo will prompt you for a password but what you need to enter is <em>your own password</em>. Right so what is the default user&#8217;s password? no one knows! </p>
<p>This Slim Top is configured to login automatically with the default user account (named ezy) and that default user&#8217;s password is not included anywhere you cannot look it up from the website cause they don&#8217;t have a website. The day the product was launched, their site just said &#8216;coming soon&#8230;&#8217; and that&#8217;s all you can still find on the it more than a month later.</p>
<p>Any password can be reset by booting up in single user mode. When I tried it, I was sent a weird recovery console with an even weirder keyboard mapping. So rebooted giving bash as the init script (of course you can use any other shell too (append init=/bin/bash in the grub bootup line)). I reset the password for both the accounts and rebooted. Yet, no matter how I try, it refuses to accept the passwords that I just chose!</p>
<p>I rebooted again and reset the passwords again, still sudo and su both refuse my password. I tried for a third time, This time, I checked the /etc/shadow file before and after the reset to make sure that the changes have taken place. They haven&#8217;t, the hash is exactly the same. It was then that it occurred to me that the file system might be mounted in read only mode. It is. So I remounted in R/W mode and reset the passwords one more time. This time it worked but why didn&#8217;t the <em>passwd</em> program produce an error when the file system was mounted in read only mode? All this hassle could have been avoided if they had included the password in the booklet (well handbill more likely) that comes with the computer.</p>
<p>The next day, I returned the computer to the owner but only to receive another complaint; the printer doesn&#8217;t work. Shouldn&#8217;t they be complaining to the vendor? well the vendor doesn&#8217;t have a clue. Wearily I asked her to send it back (by this time, I had forgotten the password so had to go through the reset process one more time). The printer is an HP 1020, it has a driver for linux (name <a href="http://foo2zjs.rkkda.com/">foo2zjs</a>). On their site, they say in bold letters: &#8220;DON&#8217;T USE the foo2zjs package from: Ubuntu, SUSE, Mandrake/Manrivia, Debian, RedHat, &#8230;&#8221;. Now if easy Slim Top ships with a customized version of Ubuntu, why can&#8217;t they replace the bad driver from the install DVD and replace it with the direct download from the site?</p>
<p>These are two issues that any ordinary user will not be able to solve on their own. Others encountering these sort of problems probably format the machine and install XP or Vista on it. Vista would crawl and XP wouldn&#8217;t be much better and it would most likely be a pirate copy of windows as well. So by this half baked approach to linux, Browns is harming both linux and themselves.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux-part-2..html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to sell computers running linux.</title>
		<link>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux..html</link>
		<comments>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux..html#comments</comments>
		<pubDate>Fri, 25 Sep 2009 06:00:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux..html</guid>
		<description><![CDATA[About a month ago, a friend of mine, a first time computer buyer bought a budget computer with an Intel Atom chip and Linux on my recommendation. I haven&#8217;t heard from him since, either he doesn&#8217;t have any complaints and is deliriously happy or he is not talking to me anymore.
Recently, one of Sri Lanka&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>About a month ago, a friend of mine, a first time computer buyer bought a budget computer with an Intel Atom chip and Linux on my recommendation. I haven&#8217;t heard from him since, either he doesn&#8217;t have any complaints and is deliriously happy or he is not talking to me anymore.</p>
<p>Recently, one of Sri Lanka&#8217;s best established companies (Browns PLC) started selling Intel Atom based PCs powered by Linux. The very first day they started operations, a friend of mine from one of the most remote and backward parts of Sri Lanka (yes I do have such friends) bought one of those machines (the Ezy Slim Top). The other alternatives were to buy a branded box with a dual core chip or to get one from Unity Plaza. Most of the vendors in Unity Plaza are not to be trusted (sure there are a few good ones but it&#8217;s darned hard to tell the difference). To make matters to make a warranty claim you need to bring your computer to Colombo (not very easy when you are living in the middle of no where and don&#8217;t have your own car) and argue with them till the cows come home. What convinced him was seeing a girl who was about 12 years old, lugging her computer into one of the shops to get it repaired.</p>
<p>The other option is just pay a lot of extra money for a powerful CPU which you will never utilize to the full (just check now how much of your processor you are using, bet it&#8217;s less than 10%). The second problem is that most of the branded machines ship with Vista or XP, I simply cannot understand why people pay so much money for garbage. Since money was at a premium it wasn&#8217;t hard to convince him on this point either.</p>
<p>Having read so far, you might wonder what all this has to do with the topic of the post ; &#8216;how not to sell computers running linux&#8217;, well the trouble started the second time I recommended this same computer to a friend. This time it&#8217;s someone who&#8217;s been using one for years to do word processing. I can see you roll your eyes in your head but I got such friends too. But this is enough today, check back tomorrow for the next episode</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/how-not-to-sell-computers-running-linux..html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Apple Tries To Turn People Off Java?</title>
		<link>http://www.raditha.com/blog/archives/apple-tries-to-turn-people-off-java.html</link>
		<comments>http://www.raditha.com/blog/archives/apple-tries-to-turn-people-off-java.html#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:02:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[lame]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/apple-tries-to-turn-people-off-java.html</guid>
		<description><![CDATA[Tried to load a page with an applet in FF for the first time since upgrading from Tiger to Snow Leopard and this dialog pops up.

I don&#8217;t quite see the need to convert the applets in the applet cache in this manner. What the heck is the conversion anyway? any applet compiled with java 1.4+ [...]]]></description>
			<content:encoded><![CDATA[<p>Tried to load a page with an applet in FF for the first time since upgrading from Tiger to Snow Leopard and this dialog pops up.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://raditha.com/blog/images/applet-cache.png" alt="converting cached applets" /></p>
<p>I don&#8217;t quite see the need to convert the applets in the applet cache in this manner. What the heck is the conversion anyway? any applet compiled with java 1.4+ will run on Java 6 (though the reverse is not true).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/apple-tries-to-turn-people-off-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thawing out the Snow Leopard</title>
		<link>http://www.raditha.com/blog/archives/thawing-out-the-snow-leopard.html</link>
		<comments>http://www.raditha.com/blog/archives/thawing-out-the-snow-leopard.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 12:18:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macbook]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/thawing-out-the-snow-leopard.html</guid>
		<description><![CDATA[The other day, I upgraded from to OS X Snow Leopard and I wasn&#8217;t entirely pleased with Apple. However having used it for a while I have become less resentful. One of the reasons is that Snow Leopard is fast much much faster than Tiger. This is probably due to the new version being a [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I upgraded from to OS X Snow Leopard and I wasn&#8217;t entirely pleased with Apple. However having used it for a while I have become less resentful. One of the reasons is that Snow Leopard is fast much much faster than Tiger. This is probably due to the new version being a real 64 bit operating system. The second reason is that I now have a fresh install (I couldn&#8217;t upgrade because the installer didn&#8217;t like my partition table) so there isn&#8217;t any blubber lying around. Last but not least I now have a hard drive that is three times as big as the drive that originally shipped on this mac. <a href="http://www.raditha.com/linux/drive-speed.php">Larger hard drives generally tend to be faster</a> than smaller ones.</p>
<p>Once I rsynced the bakups into the home folders, most of the newly re-installed applications continued from where they left off as if nothing had happened (well, they are running a little bit faster). Right so the Snow Leopard is speedy but what else? hmmm, well there&#8217;s &#8217;stacks&#8217; but even though this is trumpeted as a great feature this doesn&#8217;t look at all like a novelty for a linux user. It is widely believed Windows is heavily influenced by OS X but what many people don&#8217;t know is that OS X is heavily influenced by X Window. There is something similar to the stacks feature in linux desktops that places all open windows of a given application together in the task bar as a stack. As for spaces,  it&#8217;s been available on X Window systems for at least 15 years!</p>
<p>Other new features includes Safari 4 (if you could call it a new feature, much of what is new in Snow Leopard is actually refinements of what shipped with Leopard.) but who uses Safari? And then there is support for Microsoft Exchange so what? who cares about exchange? A worse piece of software has never been written.</p>
<p>Other than the speed the only thing I have found useful is a new feature they are not even shouting about: More reliable disk eject!  In tiger, when I pressed the eject button to remove a CD or DVD from the drive, the eject mechanism would continue to try to eject the disk long after it has been ejected. That&#8217;s right, every few seconds you will hear the familiar sound the drive makes when it ejects a disk but there is no disk in the drive!</p>
<p>I was in fact contemplating getting a replacement drive. There are no OEM drives in Colombo that would fit, so I would have had to ask a friend or relative abroad to buy it or get it from the local agents and pay through the nose (and wait three weeks for delivery). Upgrading to Snow Leopard seems to have sorted out this disk eject problem so the money hasn&#8217;t been wasted after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/thawing-out-the-snow-leopard.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Shivering Snow Leopard</title>
		<link>http://www.raditha.com/blog/archives/a-shivering-snow-leopard.html</link>
		<comments>http://www.raditha.com/blog/archives/a-shivering-snow-leopard.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:12:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[Macbook]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/a-shivering-snow-leopard.html</guid>
		<description><![CDATA[Apple&#8217;s much hyped OS X 10.6, aka Snow Leopard is here. I didn&#8217;t bother to update from Tiger to Leopard and there was a pre release discount available, so I thought of grabbing it and started off on a long and tedious process that left me feeling like a fool. Apple&#8217;s online store in the [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s much hyped OS X 10.6, aka Snow Leopard is here. I didn&#8217;t bother to update from Tiger to Leopard and there was a pre release discount available, so I thought of grabbing it and started off on a long and tedious process that left me feeling like a fool. Apple&#8217;s online store in the US ships only to addresses with in the US. Similarly the store in the UK ships only to UK addresses and the one in Singapore only ships within Singapore.</p>
<p>Sri Lanka supposedly has three authorized agents for Apple products but I seriously doubt if Apple Inc is even  aware of their existence. Come to think of it, Steve Jobs and other blokes at Apple might be vaguely aware of a place call Mexico and another called Canada but they are blissfully unaware of the world outside (still trying to figure out how macs ended up being manufactured in China). So it&#8217;s no surprise that we don&#8217;t have an official apple store for Sri Lanka. I ordered from the US one giving the address of a friend in New York. That was on the 26th of August. My friend re posted it when he got his hands on it and it arrived in Colombo yesterday. Today I tried to upgrade my system and now I am beginning to regret it.</p>
<p>After backing up, changing the boot device and going through the first few steps of the installer, I was presented with this very annoying message:</p>
<p style="text-align: center;"><img class="aligncenter" src="/blog/images/mac-install.jpg" alt="Install Error" /></p>
<p>That&#8217;s right, the installer doesn&#8217;t like the partition system. Less than a month ago, <a href="http://www.raditha.com/blog/archives/macbook-hard-drive-toasted.html">the drive on my macbook pulled a hamstring </a> when I replaced it, I created three partitions, intending to  restore the existing tiger installation on one of them, I planned to put Fedora on the second (but didn&#8217;t because the Fedora DVD wouldn&#8217;t boot on the macbook (more on that later)) and third was kept aside to install Leopard or Snow Leopard. Apparently the partition table type cannot now be changed without losing all the data on the drive. Very annoying but I decided to go ahead with it cause I have bakups.</p>
<p>The bakup was created with rsync (yeah I am a linux man), in hindsight, it would have been much better to use <a href="http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html">superduper</a> instead cause at the &#8216;migrate your old stuff&#8217; stage, the installer didn&#8217;t detect the contents of the external drive on which the bakups were placed. I said never mind and skipped it. It was only after booting up that I realized what a fool I&#8217;ve been. iPhoto, one of the most usefull products on OS X is missing. Yeah right iPhoto, which is part of iLife is bundled with all new Macs but if you lose your copy you need to cough up another USD 79 for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/a-shivering-snow-leopard.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery TableSorter and XSL Transformation</title>
		<link>http://www.raditha.com/blog/archives/jquery-tablesorter-and-xsl-transformation.html</link>
		<comments>http://www.raditha.com/blog/archives/jquery-tablesorter-and-xsl-transformation.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 07:36:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[etc]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/jquery-tablesorter-and-xsl-transformation.html</guid>
		<description><![CDATA[Jquery and it&#8217;s plugins are so popular  because they allow you to do in a couple of lines of code what might otherwise take days and days of effort.. The tablesorter plugin is one that allows you to sort an HTML table by clicking on any of the column names in the table header. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.com">Jquery</a> and it&#8217;s plugins are so popular  because they allow you to do in a couple of lines of code what might otherwise take days and days of effort.. The <a href="http://tablesorter.com/docs/">tablesorter</a> plugin is one that allows you to sort an HTML table by clicking on any of the column names in the table header. I am talking of a real HTML table not one that is made with UL and LI. Tabular data should be represented by TABLE, TR and TD tags but some people go overboard with LIs and use them even for tabular data.</p>
<p>The table sorter plugin can sort both static and dynamic data inserted into the HTML through user interaction. It can also cope with data retrieved from remote sources (with an XHR). Here is an example straight out of the docs:</p>
<pre>    $(<span>document</span>).ready(<span>function</span>() {
    $(<span>"table"</span>).tablesorter();
    $(<span>"#ajax-append"</span>).click(<span>function</span>() {
         $.get(<span>"assets/ajax-content.html"</span>, <span>function</span>(html) {
             <span>// append the "ajax'd" data to the table body</span>
             $(<span>"table tbody"</span>).append(html);
            <span>// let the plugin know that we made a update</span>
            $(<span>"table"</span>).trigger(<span>"update"</span>);
            <span>// set sorting column and direction, this will sort on the first and third column</span>
            <span>var</span> sorting = [[<span>2</span>,<span>1</span>],[<span>0</span>,<span>0</span>]];
            <span>// sort on the first column</span>
            $(<span>"table"</span>).trigger(<span>"sorton"</span>,[sorting]);
        });
        <span>return</span> <span>false</span>;
    });
});</pre>
<p>What if your webservice only produced XML and you had to rely on an XSL Tranformation to convert it to HTML? Well I found out the hard way that this otherwise excellent plugin has trouble with that. The data would be inserted into the table but the rows would not be sorted. Only the original content (the data that was statically included would be included). So I ran into a funny situation where only the top half of a table would have it&#8217;s row order changed while the bottom half remained obstinately fixed! Here is the fragment of code that fetched the data, transformed it and appended it into the TBODY.</p>
<pre>
    $.get('report.xsl', function(tr){
        xsl_pages = tr;
        xProcPrimary.importStylesheet(tr);

        $.get('report.php', function(data){
            xmlMain = data;
            var fragment = xProcPrimary.transformToFragment(xmlMain, document);
            $("#msummary tbody").append(fragment);
            $("#msummary").trigger("update");
        });
    } );
</pre>
<p>After a couple of hours of head scratching and the tedium; I figured out that the
<li>DocumentFragment</li>
<p> is being appended to the table in some weird way, fixing bugs in your own code is hard enough so I never entertained any thoughts of finding the cause of the problem in the tablesorter codebase. Instead, I came up with a work around: Add the DocumentFragment to a hidden HTML element, then call the jQuery.html() method on that element to generate the HTML source for it and append that HTML into the table. In other words, I cam up with a quick and painless way to convert a DocumentFragment into HTML source.</p>
<pre>
    $.get('report.xsl', function(tr){<br />
        xsl_pages = tr;<br />
        xProcPrimary.importStylesheet(tr);</p>
<p>        $.get('report.php', function(data){<br />
            xmlMain = data;<br />
            var fragment = xProcPrimary.transformToFragment(xmlMain, document);<br />
            $("div.sortable").html(fragment);<br />
            alert(fragment);<br />
            $("#msummary tbody").append($("div.sortable").html());<br />
            $("div.sortable").html();<br />
            $("#msummary").trigger("update");<br />
        });<br />
    } );</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/jquery-tablesorter-and-xsl-transformation.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wierd Firefox Errors</title>
		<link>http://www.raditha.com/blog/archives/wierd-firefox-errors.html</link>
		<comments>http://www.raditha.com/blog/archives/wierd-firefox-errors.html#comments</comments>
		<pubDate>Thu, 20 Aug 2009 12:23:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[weird]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/wierd-firefox-errors.html</guid>
		<description><![CDATA[Every once in a while I get fed up with Firefox and switch to Konqueror, only to return a few days later. The latest annoyance with ff is an old one; when you type in a text into the search box, an error pops up.
ASSERT: *** Search: _installLocation: engine has no file!
Stack Trace:
0:ENSURE_WARN(false,_installLocation: engine has [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in a while I get fed up with Firefox and switch to <a href="http://www.konqueror.org/">Konqueror</a>, only to return a few days later. The latest annoyance with ff is an old one; when you type in a text into the search box, an error pops up.</p>
<p style="padding-left: 60px;"><span style="color: #800000;">ASSERT: *** Search: _installLocation: engine has no file!<br />
Stack Trace:<br />
0:ENSURE_WARN(false,_installLocation: engine has no file!,2147500037)<br />
1:()<br />
2:()<br />
3:SRCH_ENG_getSubmission(wad,application/x-suggestions+json)<br />
4:getSubmission(wad,application/x-suggestions+json)<br />
5:(wad,searchbar-history,null,[xpconnect wrapped nsIAutoCompleteObserver])</span></p>
<p>Fortunately it&#8217;s not very serious and can be made to go away by just restarting FF. On this occasion, I was too lazy to do even that and continued with my work until some JavaScript started to misbehave. Then I tried to view source, only to run into this error:</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;"><span style="color: #800000;">XML Parsing Error: undefined entity<br />
Location: chrome://global/content/viewSource.xul<br />
Line Number 16, Column 1:&lt;window id=&#8221;viewSource&#8221;</span></p>
<p style="padding-left: 30px;">
<p>This time though, I am not going to switch back to Konqueror, cause I know that the culprit here isn&#8217;t Firefox but yum!. That&#8217;s right, you see this sort of error most often when the system has been updated. When firefox is updated it has to be restarted but when you do the update with yum it doesn&#8217;t happen automatically.</p>
<p style="padding-left: 30px;">
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/wierd-firefox-errors.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macbook Hard drive toasted</title>
		<link>http://www.raditha.com/blog/archives/macbook-hard-drive-toasted.html</link>
		<comments>http://www.raditha.com/blog/archives/macbook-hard-drive-toasted.html#comments</comments>
		<pubDate>Wed, 19 Aug 2009 15:20:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macbook]]></category>
		<category><![CDATA[toast]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/macbook-hard-drive-toasted.html</guid>
		<description><![CDATA[On August 8th I left for a well deserved ten day vacation (working vacation mind you) so it was only natural that my Macbook hard drive died shortly before that. I am thankful that the drive didn&#8217;t roll kick the bucket on the first day of the vacation. That would have forced an immediate return [...]]]></description>
			<content:encoded><![CDATA[<p>On August 8th I left for a well deserved ten day vacation (working vacation mind you) so it was only natural that my Macbook hard drive died shortly before that. I am thankful that the drive didn&#8217;t roll kick the bucket on the first day of the vacation. That would have forced an immediate return to Colombo and force me to lug my desktop (monitor and all) back with me!</p>
<p>It all started when the Macbook suddenly froze up while I was browsing and wouldn&#8217;t respond at all and had to be shutdown with a long press of the power button. When I tried to start it up again, a screen with a flashing folder + question mark icon popped. Immediately I knew this had to be a toasted hard drive. This was confirmed in 2 seconds by Google.</p>
<p style="text-align: center;"><a title="A question mark" href="/blog/images/apple-question.jpg"><img class="aligncenter" src="/blog/images/apple-question-t.jpg" alt="A question mark with a folder icon" /></a></p>
<p>I was pretty sure my backups were up to date but having once tossed out a dead hard drive thinking the backups were upto when they were not, I was really determined to take a close look at the drive&#8217;s contents before tossing it. That meant buying a firewire cable to attempt to connect the macbook to another in target mode. I knew the chances of it working were remote so I bought a hard drive enclosure as well. The idea was to freeze it and put it in the enclosure. Obviously you cannot put in a frozen drive back in the macbook because it would cause condensation and cause more damage. If it condensates in the enclosure you will probably be able to dry it out with a blower and still manage to reuse the enclosure later on.</p>
<p>You might our read that freezing a drive to recover data is a myth  or an urban legend. I can assure you that it works, when one of the hard drives on our company&#8217;s server died, the hosting company (<a href="http://www.webquarry.com">The Webquarry</a>) admin put the drive in the freezer and managed to recover quite a bit  of the data.</p>
<p>Much to my chagrin I found that I need not have bothered with any of this. The problem was with the contacts. The SATA connector appeared to have shaken itself lose. I discovered this after taking out the hard drive and putting it back in (with fingers firmly crossed of course) and it just worked!! So it was the new drive that went into the enclosure. Then I used superduper to clone the old drive into a partition on the new drive ( The old drive is only 80GB but the new one has 320GB). Then I swapped the drives and booted up with the new one. Thanks to <a href="http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html">superduper</a> the process was painless.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/macbook-hard-drive-toasted.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>json_encode/json_decode vs serialize/unserialize and fools vs idiots.</title>
		<link>http://www.raditha.com/blog/archives/json_encodejson_decode-vs-serializeunserialize-and-fools-vs-idiots..html</link>
		<comments>http://www.raditha.com/blog/archives/json_encodejson_decode-vs-serializeunserialize-and-fools-vs-idiots..html#comments</comments>
		<pubDate>Sat, 01 Aug 2009 01:01:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[religion]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.raditha.com/blog/archives/json_encodejson_decode-vs-serializeunserialize-and-fools-vs-idiots..html</guid>
		<description><![CDATA[If you want to write good , fast, memory efficient code (pick any three) you need to start off with good fast memory efficient algorithms. Using fprintf instead of fwrite or  java.util.ArrayList instead of java.util.Vector or $.ajax instead of $.get doesn&#8217;t really make any difference at all. If you spend your life trying to figure [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to write good , fast, memory efficient code (pick any three) you need to start off with good fast memory efficient algorithms. Using fprintf instead of fwrite or  java.util.ArrayList instead of java.util.Vector or $.ajax instead of $.get doesn&#8217;t really make any difference at all. If you spend your life trying to figure out which is faster or takes up less memory you will never get anything done. Sometimes <a href="http://www.raditha.com/blog/archives/readfile-vs-include-echo-vs-print-dont-bother.html">people who ought to know better even shout from the rooftops</a> that you should waste your time trying to shave off a few milliseconds here and there but fortunately there are more wiser heads to shoot them down.</p>
<p>Since PHP added support for JSON encode and decode a lot has been written about how it&#8217;s more efficient than serialize / unserialize and the have got the numbers to proove it too. In one study it was pointed out that json_encode takes 0.63 milli seconds to convert a certain object to text while the serialize function took just 0.41 milliseconds however that author suggests that all existing code that uses serialize/unserialize should be changed to json_encode/json_decode because decode/unserialize more often than encode/serialize and json_decode takes just 1.42ms vs 2.28 ms for unserialize. Another mutt had reproduced the same sort of results on eight different servers. Sure that&#8217;s about a 50% improvement in speed. And if your script just happens to be executed 1,000,000 times you will save a whopping 860 seconds! you will probably get a 100% increment at your next evaluation too.</p>
<p>Most often you want to convert and object to a string because you want to send it over the wire or save it in a database. If your applications appears to be slow it&#8217;s probably because the database query is slow or it takes a lot of time to retrieve the data from the remote server. If it takes two seconds to retrieve/store  the data what difference does it make to shave of 0.0005 of a second by changing from json to php serialize?</p>
<p>I am not saying you should not make any effort to optimize your code at all. Wordpress and Windows OS are examples that scream out for optimization. What I am saying is that you should write your code with a decent algorithm (but don&#8217;t rupture yourself looking for one), then test your app. If you find it&#8217;s slow and doesn&#8217;t scale well, run it through a profiler to find the bottleneck. You will usually find that about 20% of the code takes up about 80% of the execution time sometims it&#8217;s worse. All you need to do is to look at that part of the code and optimize it or perhaps even change the algorithm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raditha.com/blog/archives/json_encodejson_decode-vs-serializeunserialize-and-fools-vs-idiots..html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.765 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-17 04:50:02 -->
