$29.95 SanDisk Compact Flash 8GB Extreme III on Amazon
Posted by rp8 on Dec 01, 2008 -

I just ordered two of them. You can also get a $15 rebate from SanDisk. Here’s the rebate form.

Update 12/02/08: apprently the deal is no longer available on amazon.

.

Browser Compatibility on Lun (alpha)
Posted by rp8 on Dec 14, 2008 -

We have tested the following browsers on using Lun: Firefox 3.0.x, Chrome, IE 6 and 8 Beta and Opera 9.62. For cross-domain scripting, we use the ScriptTransport by Thierry Schellenbach and John-David Dalton. All browsers except IE 8 Beta have some kind of timing issues with Ajax.Request. We settled down on using callback in JSON instead of using onComplete event handler.

Charging BlackBerry on Linux
Posted by rp8 on Dec 01, 2008 -

RIM does not provide USB driver for BlackBerry on Linux. It’s been a pain for charging BlackBerry if you use Linux systems only.

Luckily, there’s Barry project on SourceForge that provides USB driver and some other utilities for sync and backup BlackBerry on Linux.

Here’re the steps to install it on Ubuntu.

How much is a web site worth?
Posted by rp8 on Dec 25, 2008 -

I found this site websiteoutlook.com that estimates the worth of any web site you enter. Here’re a few well known sites and how much they’re worthy:-)

google.com – $1.2B

cnn.com – $50M

yahoo.com – $2.4B

techcrunch.com – $632,000

Huddle Workspace Application Does not Work on LinkedIn
Posted by rp8 on Dec 14, 2008 -

Since adding Huddle Workspace into the LinkedIn, I have not been able to use it much due to various bugs or interoperbility issues. More than often Huddle would return errors like this.

Include Tag for Radiant CMS
Posted by rp8 on Dec 20, 2008 -

I have posted the include tag for Radiant at github.com. You can get it using “git clone git://github.com/rp8/radiant-include-tag.git”. This tag mimics the include directive in apache2.

Github.com is such a nice site, it’s really easy to use when I posted code first time on the site. Right after I created a new repository, it gave me clear steps to create a git locally and how to push to github.com. A job well done!

Introducing Lun Service (alpha)
Posted by rp8 on Dec 05, 2008 -

We have implemented a new commenting service called Lun. To allow comments on any web page, simply add the following html code:


<div id="lcmts" class="lcmts" permalink=""></div>
<script src="http://lun.competo.com/js/lcmt.js"></script>

Lun is a free service. You can find more at http://lun.competo.com/.

Merb Merged Into Rails 3
Posted by rp8 on Dec 24, 2008 -

Great news!

My hope is that Rails 3 will provide a minimum set of components that serve as back end services and end points to keep the footprint small and efficient. The render of html/haml/etc can be done separately.

Netflix needs to have a Linux player
Posted by rp8 on Dec 06, 2008 -
Netflix player allows us to watch its movies online on Windows OS only. It would be really nice that it offers a Linux player so we don't have switch OS just to watch a movie.
Parsing ISO 8601 DateTime from Rails JSON
Posted by rp8 on Dec 13, 2008 -

Here’s a simple script to parse the JSON date serialized by Rails in ISO 8601 format such as “2008-12-13T16:08:32-06:00”.

ISO 8601 DateTime:

var s = “2008-12-13T16:08:32-06:00”;

var date = Date2.parse(s);

date.toString() => Sat Dec 13 2008 16:08:32 GMT-0600 (CST)

date.toUTCString() => Sat, 13 Dec 2008 22:08:32 GMT

date.toLocaleString() => Sat 13 Dec 2008 04:08:32 PM CST

Date2.toString(date) => December 13, 2008

Profiling with Rawk on Rails
Posted by rp8 on Dec 16, 2008 -

When using Rawk to profile Rails 2.2 application, we need to make a small change on the regular expression for time string.

Setting up a GIT Host on Ubuntu
Posted by rp8 on Dec 18, 2008 -

Gary Dolley has a nice write-up on hosting GIT.

I followed the instructions and got GIT installed in no time. I had to install pyton-setuptools first and run into a problem cloning the gitosis-admin to my laptop. It turned out that the “git” user must be added into server’s /etc/ssh/sshd_config AllowUsers list and restart SSH. Duh.

Testing Web Service With Curl
Posted by rp8 on Dec 08, 2008 -

Here’s a simple way to test a web service that handles HTTP GET or POST:

1. HTTP GET with Query String

curl http://example.com/service --get --data name1=value1 --data name2=value2

2. HTTP POST with name/value pairs

curl http://example.com/service --data name1=value1 --data name2=values2

Threaded Posts or Comments without using Acts_As_Nested_Set
Posted by rp8 on Dec 16, 2008 -

How would you model and render the threaded posts or comments in Rails? If you google the terms “rails threaded posts”, usually acts_as_tree, acts_as_nested_set or acts_as_threaded plugins are often the methods widely discussed and used. If we’re trying to model a real tree structure, they’re probably the way to go.

In the threaded posts or comments scenarios, however, we really just need to have a visual way to render the posts or comments so readers can follow the discussion thread more easily.

Here’s a simple model that we have been using and it performs quite well without complex SQL and calculations. Compared to other methods which are SQL heavy and database bound, this method is light on SQL but heavy on the view. The view needs to build parent/child tree when rendering a thread, but it’s much easier to scale out with more web servers than scale up with bigger DB.

For example, Comments table has the following columns: id (integer), parent_id (integer, nullable), level (integer, default to 0), content(string).

Using Webalizer on Nginx Logs
Posted by rp8 on Dec 20, 2008 -

There is a new version of webalizer. B. Barrett has released two versions this year. There’s no release during 2003-2007, quite a long time.

I have tried to build the latest webalizer 2.20-03 from source, but it kept getting undefined symbol gdImgPng error. The needed libgd2 and libpng are not readily available in Ubuntu distro.

Finally, I gave up building from source and downloaded the binary version. Unzipped it to a folder, modified the sample.conf and run the command “./webalizer -c sample.conf”, which only complained about missing libdb-4.4.so. After installing libdb4.4 using “apt-get”, it finally worked.

In nginx.conf, I have a log format main defined as

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

Webalizer reads this log format without any problem.

Wow you must read this - Evolution of Mona Lisa
Posted by rp8 on Dec 09, 2008 -

monalisa
Roger Alsing described a genetic algorithm to generate a Mona Lisa painting look-alike with only 50 semi-transparent colored polygons. It took about 1,000,000 generations to come up this image on the left. It’s really a remarkable work considering the simplicity of the algorithm!

Here’s the link to his wonderful blog entry Evolution of Mona Lisa.