<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.6" -->
<rss version="0.92">
	<channel>
		<title>depthq - ccm|mac</title>
		<link>http://www.cheeming.com/blog/index.php</link>
		<description>a malaysian programmer's attempt to express his thoughts about life and code</description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
				<item>
			<title>Plans and stuff</title>
						<description>&lt;p&gt;I haven't written in a long while. It is almost going to be a year since my last blog post and as I type this I don't really know what to write about.&lt;/p&gt;

&lt;p&gt;Hmmm, how about some future plans?&lt;/p&gt;

&lt;p&gt;Initially I thought that I would just treat this blog simply as a brain dump. But I have found that it is not really useful for anyone except for myself. So I would like to split this blog into 2 separate ones. One for just software development and other technical mumbo jumbo and another for random thoughts.&lt;/p&gt;

&lt;p&gt;So I have a bunch of stuff I would need to do before I can move forward with my new plans. Gotta upgrade this blog engine I am using or change to another one altogether. And probably need to find a nice and simple theme. Gotta make it more updated since it looks quite dated at the moment.&lt;/p&gt;

&lt;p&gt;OK, thats all for now. Happy Merdeka fellow Malaysians and Happy 10th anniversary &lt;a href=&quot;http://www.exoweb.net/&quot;&gt;Exoweb&lt;/a&gt;!&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2010/08/31/plans-and-stuff&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2010/08/31/plans-and-stuff</link>
							</item>
				<item>
			<title>A minor update after 6 months absence</title>
						<description>&lt;p&gt;I haven't written for about 6 months. My mind is just filled with so many things that I forgot that I have a place to actually vent and rant properly (other than &lt;a href=&quot;http://www.twitter.com/cheeming&quot;&gt;my twitter&lt;/a&gt; but only 140 characters at a time).&lt;/p&gt;

&lt;p&gt;Quite a bit has happened since.&lt;/p&gt;

&lt;p&gt;I am working on &lt;a href=&quot;http://www.adexcel.com&quot;&gt;my startup&lt;/a&gt; and we're constantly trying &lt;a href=&quot;http://www.twitpub.com&quot;&gt;different&lt;/a&gt; &lt;a href=&quot;http://www.adtopsy.com/&quot;&gt;ideas&lt;/a&gt;. Life is hectic and hard to predict but it can get pretty exciting like a roller coaster ride. We've raised some money and recently participated in &lt;a href=&quot;http://picasaweb.google.com/blueenzyme/Techcrunch50&quot;&gt;Techcrunch50&lt;/a&gt; in San Francisco. We met a lot of influential and interesting people and hope we can make our new found connections work well for us.&lt;/p&gt;

&lt;p&gt;I feel that I've changed my view a bit about the Malaysian life in these 9 months of being back. I guess I've been poisoned by &lt;a href=&quot;http://en.wikipedia.org/wiki/Yasmin_Ahmad&quot;&gt;Yasmin&lt;/a&gt;'s work. I loved &lt;a href=&quot;http://www.imdb.com/title/tt0433692/&quot;&gt;Sepet&lt;/a&gt;, &lt;a href=&quot;http://www.imdb.com/title/tt1351669/&quot;&gt;Talentime&lt;/a&gt; and &lt;a href=&quot;http://www.imdb.com/title/tt0863091/&quot;&gt;Mukhsin&lt;/a&gt;. &lt;a href=&quot;http://www.imdb.com/title/tt0484355/&quot;&gt;Gubra&lt;/a&gt;'s story was a bit too dark for me. Her work reminds me of my childhood and the beauty of life here. Nothing is perfect but maybe that is beauty in itself. Oh I am getting mellow...&lt;/p&gt;

&lt;p&gt;&lt;em&gt;... listening to &lt;a href=&quot;http://www.imdb.com/title/tt1069238/&quot;&gt;Okuribito&lt;/a&gt; soundtrack as I write ...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my free time, I try to run and cycle a bit. I've done a bunch of quarter and half marathons. Slowly getting better each time but still far off from my target. I still can't imagine doing a full marathon yet. Running really sucks out a lot of your mental and physical energy but it also, as my close friend says, &quot;never takes more than it gives&quot;.&lt;/p&gt;

&lt;p&gt;I have this minor obsession with bicycles and cameras. Sometimes I can surf endlessly just reading and learning about cameras and bicycles. My current fad is looking into Russian cameras, like &lt;a href=&quot;http://www.google.com.my/search?q=fed+camera&quot;&gt;FED&lt;/a&gt; and &lt;a href=&quot;http://www.google.com.my/search?q=kiev+camera&quot;&gt;Kiev&lt;/a&gt;. They are basically Leica and Contax clones.&lt;/p&gt;

&lt;p&gt;I recently bought a &lt;a href=&quot;http://picasaweb.google.com/blueenzyme/MalaysianStillLife#5386034319915211858&quot;&gt;FED Micron&lt;/a&gt; from Ebay. It is an interesting camera due to it taking half frame pictures from 35mm film. But my first roll of film was a total disaster. I think the film wasn't setup properly and only got about 10-20 shots out of 72 shots. I'll probably try again but playing with film is not as cheap as digital. My other two targets are Russian rangefinders, namely &lt;a href=&quot;http://galactinus.net/vilva/retro/fed-2.html&quot;&gt;FED 2&lt;/a&gt; and &lt;a href=&quot;http://www.mattdentonphoto.com/cameras/kiev_4.html&quot;&gt;Kiev 4&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My recent visit to San Francisco has reignited my passion for cycling. My long distance bike touring trip (3 months on the road?) is still a naive idea in my mind. Or maybe a month long backpacking trip to quench my thirst for some travel adventure. I wish I can find the time and energy to do it in the future when I am less busy and committed to my work.&lt;/p&gt;

&lt;p&gt;Enough writing English, need to write some Python codes now &lt;img src=&quot;http://www.cheeming.com/blog/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/09/27/a-minor-update-after-6-months-absence&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/09/27/a-minor-update-after-6-months-absence</link>
							</item>
				<item>
			<title>Make svnserve support multiple SVN users for one SSH account</title>
						<description>&lt;p&gt;I am using &lt;a href=&quot;http://www.asmallorange.com/&quot;&gt;A Small Orange&lt;/a&gt; to host some of my stuff and I wanted to setup Subversion (SVN) to work there. It was &lt;a href=&quot;http://forums.asmallorange.com/index.php?showtopic=2803&quot;&gt;pretty simple&lt;/a&gt; since this hosting company supports SVN through &lt;a href=&quot;http://svnbook.red-bean.com/nightly/en/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.sshtricks&quot;&gt;svnserve&lt;/a&gt;. How cool is that? &lt;img src=&quot;http://www.cheeming.com/blog/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/p&gt;

&lt;p&gt;But the problem that I encountered with this is that I wanted to support more than one user. In the beginning I was thinking that I needed to share the single username and password with everyone that is working on the same SVN repository (or share a single private key). Oh the security implications that would bring!&lt;/p&gt;

&lt;p&gt;But I soon realised that with svnserve and some SSH config tricks I can support multiple users on the repository. And the good thing is that I don't have to mange these damn passwords. I always preferred password-less setups with key pairs (many thanks to all the work done by people to make PKI possible).&lt;br /&gt;
And another good advantage is that you can restrict the user that is logging through SSH to only have access to some specific directory.&lt;/p&gt;

&lt;p&gt;I found the details for this &lt;a href=&quot;http://forums.asmallorange.com/index.php?showtopic=8703&amp;amp;st=0&amp;amp;p=67769&amp;amp;#entry67769&quot;&gt;here&lt;/a&gt; (I think the A Small Orange community is really helpful). The only thing to look out for is that in Ubuntu 8.10 when you run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh-keygen -t dsa -f dev-dsa -P '' -C developer001&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The password is not actually empty, it would be better to drop the &lt;strong&gt;-P&lt;/strong&gt; and then enter an empty password in the input, instead of entering empty string at the command line. The same command worked fine in my Mac OSX 10.5.6.&lt;/p&gt;

&lt;p&gt;And finally the new URL to access the repository is slightly different, it will be relative to the virtual directory that you point each user in your authorized_keys file to.&lt;/p&gt;

&lt;p&gt;I actually use git svn quite a lot these days and I haven't really tested this with my git svn setup because the URL to the path of the SVN repository has changed and I am not sure what implications it would have on the git svn repository that is still referring to the old URL. I am keeping the old and new style for now until I figure things out.&lt;/p&gt;

&lt;p&gt;I just wanted to share that although hosting a SVN repo behind Apache is probably one of the most popular ways to deploy Subversion repositories but I think this method has some distinct advantages and its quite flexible if you want finer grain control of security options, permissions and access controls.&lt;/p&gt;

&lt;p&gt;Hope this hint help others out there and if anyone has done some work with git svn and changing of svn remote URLs, then it would be nice to hear from you.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/29/make-svnserve-support-multiple-users-for&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/29/make-svnserve-support-multiple-users-for</link>
							</item>
				<item>
			<title>Checking PostgreSQL to ensure it works with SSL or non-SSL ports</title>
						<description>&lt;p&gt;If you want to check to ensure your SSL or non-SSL ports in PostgreSQL are working properly, read further to find out how.&lt;/p&gt;

&lt;p&gt;For SSL support, you need to setup your PostgreSQL to work with SSL properly. Just turn on the &lt;strong&gt;ssl&lt;/strong&gt; flag in &lt;em&gt;postgresql.conf&lt;/em&gt; and then make sure you've setup the &lt;em&gt;server.crt&lt;/em&gt; as mentioned in PostgreSQL docs about &lt;a href=&quot;http://www.postgresql.org/docs/8.1/static/ssl-tcp.html&quot;&gt;Secure TCP/IP Connections with SSL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want force &lt;em&gt;psql&lt;/em&gt; to use non-SSL for the connection, you need to set the &lt;strong&gt;PGSSLMODE&lt;/strong&gt; environment variable. If you're using &lt;em&gt;bash&lt;/em&gt;, do something like this:&lt;/p&gt;

&lt;pre&gt;export PGSSLMODE=disable&lt;/pre&gt;

&lt;p&gt;And then try to run the &lt;em&gt;psql&lt;/em&gt; to connect to the server. I would suggest that you be explicit in your &lt;em&gt;pg_hba.conf&lt;/em&gt; to specify that you want &lt;strong&gt;hostnossl&lt;/strong&gt;, so that the server will not accept SSL connections.&lt;/p&gt;

&lt;p&gt;If you got things configured correctly, it should work without problems. On the other hand, you can force it to use SSL, like this:&lt;/p&gt;

&lt;pre&gt;export PGSSLMODE=require&lt;/pre&gt;

&lt;p&gt;You should see a fatal error message from &lt;em&gt;psql&lt;/em&gt;, stating that there is no &lt;em&gt;pg_hba.conf&lt;/em&gt; entry for &lt;strong&gt;SSL on&lt;/strong&gt;. You can use the same method to test for SSL-only connections by using &lt;strong&gt;hostssl&lt;/strong&gt; instead in &lt;em&gt;pg_hba.conf&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This environment variable works not only for &lt;em&gt;psql&lt;/em&gt; but also for any library or tool that uses libpq. For example, I include the console output for testing the &lt;em&gt;psycopg&lt;/em&gt; library. I have already set up the PostgreSQL to work with SSL only.&lt;/p&gt;

&lt;pre style=&quot;font-size:10px;&quot;&gt;
silviana:~ cheeming$ export PGSSLMODE=disable
silviana:~ cheeming$ python2.4
Python 2.4.5 (#1, Jul 15 2008, 23:37:00) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import psycopg
&gt;&gt;&gt; psycopg.__version__
'1.1.21'
&gt;&gt;&gt; psycopg.connect('host=127.0.0.1 dbname=mydatabase')
Traceback (most recent call last):
  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in ?
psycopg.OperationalError: FATAL:  no pg_hba.conf entry for host &quot;127.0.0.1&quot;, 
    user &quot;cheeming&quot;, database &quot;mydatabase&quot;, SSL off
&gt;&gt;&gt; psycopg.connect('host=127.0.0.1 dbname=mydatabase sslmode=require')
&amp;lt;connection object at 0x6a180&amp;gt;
&gt;&gt;&gt; 
silviana:~ cheeming$ export PGSSLMODE=require
silviana:~ cheeming$ python2.4
Python 2.4.5 (#1, Jul 15 2008, 23:37:00) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import psycopg
&gt;&gt;&gt; psycopg.connect('host=127.0.0.1 dbname=mydatabase')
&amp;lt;connection object at 0x6a1d8&amp;gt;
&lt;/pre&gt;

&lt;p&gt;As I tried out using the environment variable way, I realised that you can also change the data source name to include &lt;strong&gt;sslmode=require&lt;/strong&gt;, the same like the &lt;strong&gt;PGSSLMODE&lt;/strong&gt; environment variable. I have updated the console listing above to show that as well.&lt;/p&gt;

&lt;p&gt;Oh by the way, I heard a rumour that psycopg 1 doesn't support SSL. I am not 100% sure about it. Its quite hard to find out for sure (as I have tried on google, maybe I am not RTFM-ing enough) other than just testing it. The only info I found indicating this is &lt;a href=&quot;http://lists.initd.org/pipermail/psycopg/2006-March/004550.html&quot;&gt;some guy complaining about ssl not being supported in Windows&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Looking at the &lt;em&gt;psycopg&lt;/em&gt; source code shows that there is &lt;a href=&quot;http://www.koders.com/c/fid2EE0B04B35ABC53FDF5A218E13D8832D4527812D.aspx&quot;&gt;support for something called &lt;strong&gt;sslmode&lt;/strong&gt;&lt;/a&gt;. And in the &lt;em&gt;&lt;a href=&quot;http://www.google.com.my/url?sa=U&amp;amp;start=3&amp;amp;q=http://initd.org/svn/psycopg/psycopg1/trunk/ChangeLog&amp;amp;ei=YNXASZSkMZjC6gO-qo2vDQ&amp;amp;usg=AFQjCNEgx4uZNDqzkNE_C-jBr0ApUu5C5g&quot;&gt;ChangeLog&lt;/a&gt;&lt;/em&gt; file, its stated as follows:&lt;/p&gt;

&lt;pre style=&quot;font-size:10px;&quot;&gt;
2004-01-10  Federico Di Gregorio  &amp;lt;fog@debian.org&amp;gt;

    * module.c (psyco_connect): added &quot;sslmode&quot; parameter.
&lt;/pre&gt;

&lt;p&gt;There are more environment variables that you can tweak to change the behaviour of the &lt;em&gt;libpq&lt;/em&gt; C library and its stated &lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/libpq-envars.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope this is useful for future PostgreSQL bug hunters!&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/18/checking-postgresql-to-ensure-it-works-w&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/18/checking-postgresql-to-ensure-it-works-w</link>
							</item>
				<item>
			<title>Some hints on integrating with Worldpay</title>
						<description>&lt;p&gt;&lt;img src=&quot;http://www.cheeming.com/blog/media/blogs/cheeming/worldpay.gif&quot; alt=&quot;&quot; title=&quot;Worldpay&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I just want to write a short piece to document some of my experiences in working with the &lt;a href=&quot;http://www.worldpay.com/&quot;&gt;Worldpay payment system&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is pretty similar to Paypal, you just need to POST a bunch of HTML form variables to a URL and its done. Worldpay has an option to send a &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/paymentresponse/pr1100.html&quot;&gt;Payment Response&lt;/a&gt; back to your server. Using this response you can do some integration with your backend to identify that payments have been made.&lt;/p&gt;

&lt;p&gt;For Worldpay, it works for both single payment transactions or recurring payment transactions. To support this, Worldpay is flexible enough to not charge for the initial transaction and it acts more like a registration step, which is suitable for recurring payment. You can read more about it in Worldpay FuturePay's documentation &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/recurringpayments/rpfp7001.html&quot;&gt;on Regular Agreement Options&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A lot of information is passed back but I think the following are the most important:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;transStatus&lt;/li&gt;
  &lt;li&gt;cartId&lt;/li&gt;
  &lt;li&gt;futurePayId&lt;/li&gt;
  &lt;li&gt;amount&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the transaction deducts money, it will include a &lt;em&gt;transId&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If the transaction is a cancellation, the fields that are important are &lt;em&gt;futurePayStatusChange&lt;/em&gt; and &lt;em&gt;futurePayId&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;There is a big list of fields that might be returned in the Payment Response and its documented &lt;strong&gt;&lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/paymentresponse/pr5201.html&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the user selected a different currency as you initially set, it will be indicated in the group of variables with the &lt;em&gt;authXXXX&lt;/em&gt; convention. Worldpay has also written a bit about &lt;a href=&quot;http://www.worldpay.com/support/content.php?page=account&amp;amp;sub=finance&amp;amp;subsub=exchange&quot;&gt;their Exchange Rates&lt;/a&gt; and how it works.&lt;/p&gt;

&lt;p&gt;To fully support the Worldpay FuturePay with dynamic recurring amounts or payment dates, there is a &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/recurringpayments/rpfp8000.html&quot;&gt;Remote Administration Interface (RAI)&lt;/a&gt; that you use programatically. But do note that you need an installation id that is specifically setup for RAI.&lt;/p&gt;

&lt;p&gt;There are some security recommendations by Worldpay such as &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/paymentresponse/pr5305.html&quot;&gt;ensure the request is from Worldpay&lt;/a&gt;, &lt;a href=&quot;http://worldpay.com/support/kb/mergedProjects/htmlredirect/rhtml5800.html&quot;&gt;MD5 security&lt;/a&gt; and &lt;a href=&quot;http://worldpay.com/support/kb/mergedProjects/htmlredirect/rhtml5803.html&quot;&gt;make transactions more time dependent&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One thing that bugged me is how user defined variables are passed back to the Payment Response. The recurring and cancelled Payment Response would never include user defined variables because they don't store it in their system, as indicate &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/paymentresponse/pr5203.html&quot;&gt;here&lt;/a&gt;. So you'll have to create a system that would need to work in a more flexible way for those cancellation and recurring Payment Responses. I suppose this makes the system a bit more robust, but I am lazy and wish that recurring Payment Responses could send me back the user defined variables. I would view that as more consistent and simpler API to use. &lt;/p&gt;

&lt;p&gt;Oh yea and finally, you can have a Shopper Response that will be shown to the user once the payment (or registration) is done. The Shopper Response is generated by the same callback that handles the Payment Response but it works slightly differently. It will take the HTML that you generate and then render it as part of their final payment confirmation page. The URL of that page is not the callback that handles the Payment Response but their own URL. Its like they are doing a copy and paste. But the copy is done by reading off the HTML that you generate by the Payment Response callback. Also there are some restrictions because you need to include a compulsory banner code, which will be expanded (or filled in) by Worldpay to include more details.&lt;/p&gt;

&lt;p&gt;Worldpay has written some documentation on &lt;a href=&quot;http://www.worldpay.com/support/kb/mergedProjects/paymentresponse/pr5402.html&quot;&gt;creating a Shopper Response&lt;/a&gt; but it took a while and a lot of reading to understand how it roughly works. I am still scratching my head over it and sort of given up. There is still whole interface that you can use to configure the Shopper Response page and change all the styles and colours but I think its just too damn difficult at the moment and I've kind of lost interest in doing further for now.&lt;/p&gt;

&lt;p&gt;Okay I think that is all for now until I figure this Shopper Response crap...&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/17/integrating-with-worldpay&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/17/integrating-with-worldpay</link>
							</item>
				<item>
			<title>Tracking Forex with Python and Flot (and also a bit of Django)</title>
						<description>&lt;p&gt;I have always been interested with visualisation of data. I like to generate graphs from data. I have some ideas in my head for a while but never got around to actually doing it. &lt;a href=&quot;http://www.google.com/finance?q=EURMYR&quot;&gt;Google Finance &lt;/a&gt;has a really nice visualisation for tracking stock prices and foreign exchange. So since I am interested in tracking the foreign exchange of the local banks in Malaysia I decided to do a bit of hacking to make &lt;a href=&quot;http://finance.cheeming4u.com/rhb-forex-flot-latest.html&quot;&gt;my own Google Finance-ish interface&lt;/a&gt; to the data. The graph that I render is actually the percentage of change as compared to the forex rate of 4.77. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://finance.cheeming4u.com/rhb-forex-flot-latest.html&quot;&gt;&lt;/p&gt;&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://www.cheeming.com/blog/media/blogs/cheeming/flot1.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;381&quot; height=&quot;192&quot; /&gt;&lt;/div&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I've been scraping the foreign exchange data from RHB Bank website for a while and wanted to plot the data into a graph. I looked around a bit for some open source graphing and data visualisation tools and found &lt;a href=&quot;http://code.google.com/p/flot/&quot;&gt;Flot&lt;/a&gt; to be quite nice and its developed by some Django and jQuery fans, so maybe I am biased. Flot is a pure Javascript plotting library.&lt;/p&gt;

&lt;p&gt;So I have a cron script that will scrape data from the RHB Bank website and writes it into a CSV file. I used &lt;a href=&quot;http://www.crummy.com/software/BeautifulSoup/&quot;&gt;BeautifulSoup&lt;/a&gt; to easily extract the data out of the HTML. I setup another cron script that will use the data from the CSV file and it will generate the HTML that will contain all data that is needed by Flot to draw the graph.&lt;/p&gt;

&lt;p&gt;Flot is pretty easy to use and the basic conventions are pretty good. Since its a pure Javascript library all the code is on the HTML page and you can check it out if you want. I was thinking of adding it to Github gist but I think its not necessary at the moment since the code is very specific to my own needs. The documentation and examples are pretty good and its quite easy to learn. I particularly like the autoscaleMargin property for configuring how much margin it should automatically add to the axes so that the min and max value for the data would not be rendered on the edge of the grid. I also particularly like how easy it is to do selection and zooming. Just a few lines of code and its done.&lt;/p&gt;

&lt;p&gt;So why did I mention I used a bit of Django? &lt;img src=&quot;http://www.cheeming.com/blog/rsc/smilies/icon_biggrin.gif&quot; alt=&quot;&amp;#58;&amp;#68;&quot; class=&quot;middle&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I was lazy to find (and learn and setup) another templating language and decided to use Django's templating engine instead since the setup of that server that I am using works with Django. The HTML file that is generated is rendered off a Django template file using render_to_string() and I just pipe the stdout to a file. The only unsavoury thing is that I need to setup the &lt;code&gt;DJANGO_SETTINGS_MODULE=settings&lt;/code&gt; and the settings.py file has only the TEMPLATE_DIRS setting.&lt;/p&gt;

&lt;p&gt;Okay, so the next step is to add some news feed with the forex data to put more context while looking at the data. I guess that would be another weekend and another blog post then.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/08/tracking-forex-with-python-and-flot-and&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/08/tracking-forex-with-python-and-flot-and</link>
							</item>
				<item>
			<title>Make your own album cover meme</title>
						<description>&lt;p&gt;I read this initially from &lt;a href=&quot;http://yoonkit.blogspot.com/2009/02/my-new-album.html&quot;&gt;Yoon Kit's blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I am lazy to repost the rules, you can check it out above.&lt;/p&gt;

&lt;p&gt;I am no artist, so here it goes:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://www.cheeming.com/blog/media/blogs/cheeming/meme-bestalbumcover.jpg&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;473&quot; height=&quot;498&quot; /&gt;&lt;/div&gt;

&lt;p&gt;Not too bad I guess...&lt;/p&gt;

&lt;p&gt;Details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The random wiki article (band name): &lt;a href=&quot;http://en.wikipedia.org/wiki/Quebec_Autoroute_10&quot;&gt;http://en.wikipedia.org/wiki/Quebec_Autoroute_10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The random flickr picture (album art): &lt;a href=&quot;http://www.flickr.com/photos/26637167@N08/3326019488/&quot;&gt;http://www.flickr.com/photos/26637167@N08/3326019488/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The random quote (album name): &lt;a href=&quot;http://www.quotationspage.com/quote/33751.html&quot;&gt;http://www.quotationspage.com/quote/33751.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/06/make-your-own-album-cover-meme&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/06/make-your-own-album-cover-meme</link>
							</item>
				<item>
			<title>Hacking Ubiquity for better Identi.ca/Twitter usage</title>
						<description>&lt;p&gt;&lt;img src=&quot;http://azarask.in/gfx/ubiquity_side.png&quot; alt=&quot;Ubiquity&quot; title=&quot;Ubiquity&quot; /&gt; &lt;/p&gt;

&lt;p&gt;I've been using &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; plugin with Firefox for quite a while, mostly for Tinyurl-ing and Identi.ca-ing/Twitter-ing. &lt;/p&gt;

&lt;p&gt;For those who don't know what it is: it is a Quicksilver-ish clone but for Firefox and it allows you to create shortcuts for a lot of the web related tasks that you might normally perform. For example: converting a URL to tinyurl, you just need to hit a shortcut, type a command and voila, its done. No need to copy and paste or click on some button. Or send a quick tweet; no need to switch application or create a new tab and login to twitter.com.&lt;/p&gt;

&lt;p&gt;And for those who don't know what is Quicksilver: its a very cool program launcher for the OSX and it actually does a lot more than a simple program launcher, although I don't use much of the other, more powerful functions.&lt;/p&gt;

&lt;p&gt;Ubiquity is a pretty good idea and quite good to use, minus &lt;a href=&quot;http://ubiquity.mozilla.com/trac/ticket/19&quot;&gt;the bug #19&lt;/a&gt; (broken growl notification) that drives me crazy, but I am getting used to it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://theme.identi.ca/identica/logo.png&quot; alt=&quot;Identi.ca&quot; title=&quot;Identi.ca&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Since I am a programmer I guess I should hack on more code to make my life easier (Hmmm, maybe I should fix that bug #19). I've been using &lt;a href=&quot;http://identi.ca/&quot;&gt;Identi.ca&lt;/a&gt; to post my tweets and because I was lazy I wanted to do it in Ubiquity and I got a Ubiquity script from &lt;a href=&quot;http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/14fcb5653c33a673/a046a069f0236938#a046a069f0236938&quot;&gt;the Ubiquity Firefox Google Groups&lt;/a&gt; that would do the trick.&lt;/p&gt;

&lt;p&gt;I've been using it for quite a while and realised I have the tendency to make a mistake when replying to tweets (using @nickname) in Ubiquity. So I thought that it would be useful to change the script to make the experience slightly better.&lt;/p&gt;

&lt;p&gt;Before I start, I would like to just talk about my micro-blog setup: I have setup my Identi.ca to post my tweets to Twitter. And my normal use case is to tweet using Identi.ca and then check the feed with all those that I following in Twitter since I have more activity there. So if I see anything interesting that I would like to reply to or retweet I can just type in the username in my status message. But the problem I have is that I might type wrongly so I just wanted a way to make it less error prone.&lt;/p&gt;

&lt;p&gt;So what I did was to hack the original Identi.ca script and added a simple check when I type the @ symbol in my message. It will extract all the Twitter usernames from the current active webpage when I activated the Ubiquity command prompt and then display in the Ubiquity preview panel as a list of candidates.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.cheeming.com/blog/media/blogs/cheeming/ubiquity.jpg&quot; alt=&quot;ubiquity and identi.ca with username candiate list&quot; title=&quot;ubiquity and identi.ca with username candiate list&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As I slowly complete the nickname, it will drill down the list of candidates based on the character by character matching. If I make a typo, then there would be no candidate names in the list. Its just a very simple hack but I think it would make my replying a bit less error prone. The next step would be to have an easy way to match the reply to the correct tweet. I wonder if there is a way to do it in my case, since I am using Identi.ca. I haven't really explored the API at all.&lt;/p&gt;

&lt;p&gt;Because of this small itch I managed to learn a bit about hacking Ubiquity and I have to say that its really straightforward and the fact that I can use jQuery makes programming in Javascript almost &lt;em&gt;fun&lt;/em&gt;. I would rather code in Python but I think I can live with this.&lt;/p&gt;

&lt;p&gt;So if anyone wants to try out the hack I made, the code is hosted as &lt;a href=&quot;http://gist.github.com/70649&quot;&gt;a Gist in GitHub&lt;/a&gt;. Do give me some feedback, whether you find it useful or useless.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.cheeming.com/blog/index.php/2009/03/01/hacking-ubiquity-for-better-identi-ca-tw&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<link>http://www.cheeming.com/blog/index.php/2009/03/01/hacking-ubiquity-for-better-identi-ca-tw</link>
							</item>
			</channel>
</rss>
