Friday, August 26, 2011

NodeJS + CouchDB Concept in Action

Here is the concept in action:
http://siddiq.no.de/dubai-gold-rates.html


This app is pure Javascript:
A complete Javascript stack is not only a reality, its fun.


1. Backend Server Language
Javascript running in NodeJS (http://nodejs.org) hosting on Joyent for free. See http://no.de

2. Database stored procedures Language
Javascript running in CouchDB (http://couchdb.apache.org/) hosting on IrisCouch for free. See http://www.iriscouch.com/service

3. Front-end GUI + Charts (No flash used i.e. HTML5 + CSS3)
HighCharts uses HTML5 + CSS3, so you don't have to use Flash. http://www.highcharts.com/


Tuesday, August 9, 2011

SOLVED /etc /sysconfig /modules /VirtualBox-OSE.modules

I updated kernel and my VirtualBox-OSE stopped working. Asking me to run this command: /etc/sysconfig/modules/VirtualBox-OSE.modules

But this command would fail with following error.
$ sudo /etc/sysconfig/modules/VirtualBox-OSE.modules
ERROR: modinfo: could not find module vboxdrv
ERROR: modinfo: could not find module vboxnetflt
ERROR: modinfo: could not find module vboxnetadp

SOLUTION:
The easiet solution is to download stable package from the site, instead of resorting on yum repos:
http://www.virtualbox.org/wiki/Linux_Downloads 

NOTE :
This happens becuase yum repos are not updated soon after the kernel is released. It usually takes hours and days depending on the packages.

Friday, May 6, 2011

Awesome NodeJS performance on a VM in Joyent cloud

VM running on Joyent cloud has a very fast processor.


Having some fun, crunching a number on my machine vs a smart machine on joyent cloud.

Here is the code:

sys = require('sys');

var counter, d, d2;

// sync with clock
d = new Date();
do {
    d2 = new Date();
} while (d.getSeconds() === d2.getSeconds());

// run for a second
counter = 0;
d = new Date();
do {
    d2 = new Date();
    counter ++;
} while (d.getSeconds() === d2.getSeconds());

// the number that was crunched
sys.puts('counter = ' + counter);

My machine specs:
Intel core2 duo 1.6GHz * 2
2GB RAM

Joyent SmartMachine:
Vistual machine with some SPARC server machine as host
128MB RAM

Tuesday, January 18, 2011

gitk looks ugly: qgit vs gitg vs gitk

A quick comparison between gitk vs gitg vs qgit and why gitk looks ugly?


gitk gitg qgit
Version 1.5.6.5-30.0.62.3
GUI Tcl/Tk GTK Qt
Looks ugly awesome less awesome
Speed fast as expected very slow very slow
Features: search only basic search only more features then gitk and gitg



Acquiring packages:
  • sudo apt-get install gitk
  • sudo apt-get install gitg
  • sudo apt-get install qgit

gitk:
  • Nice visualization but a scary gui. Look at the buttons you cant tell they are pressed or unpressed. The gui problem is also because its based on tk/tcl which doesn't honor the GTK theme.
  • After showing the initial view, it keeps running a background process to scan local uncommitted changes which are finished in 45 seconds for my project. Which is a cool feature.




gitg:
  • Provide the awesomeness of gui that is expected in gnome. i.e. proper GTK theme settings.  
  • The problem is that its slow. It says "Loaded 1893 revisions in 32 seconds.". Even if I turn off the options to show stash/staged/unstaged changes I still wait for 32 seconds to load the history on my project.




qgit:
  • Loads 1893 revisions and directory changes in 61 seconds. But if you turn off 'check working directory changes' then it becomes very fast and loads in less then 5 seconds.
  • Provides more features then gitk and gitg.
  • A little less awesome then gitg bot a lot more awesome then gitk.


Sunday, August 22, 2010

Recursively delete .svn directories in Linux

See the .svn folders:

$ find . -type d -name .svn
./.svn
./js/.svn
./tests/.svn
./tests/js/.svn
./assets/.svn

Delete the .svn folders (pass the output to rm -rf):

$ rm -rf `find . -type d -name .svn`

You may want to create a shell script to automate...

Sunday, February 7, 2010

Facebook Credits Integration for Developers

Just like many other developers I was interested in Facebook Credits testing program. Still waiting for their beta launch.

For signup for beta testing program you may want to sign in here:
http://facebookcredits.questionpro.com/

Other options for virtual currencies
  • Direct credit card transactions
  • PayPal
  • Google CheckOut
  • Amazon Payments
  • Mobile payments (Zong, PayMo, Mobill Cash, etc)
  • Affiliate providers (SuperRewards, OfferPal)
  • Third party virtual currencies (e.g., SpareChange, Social Gold)
Facebook Credits Pros and Cons
As not much specifications annouced from facebook so we can only speculate with limited details and what industry specialists say about it.
Pros
- Simple interface for customers. Less clicks.
- More trust
Cons
- Platform not much tested
- Can't completely replace other Virtual Currency providers. So developers have to maintain parallel systems.

Some Apps that are currently using Facebook credits:
  • Zoo World — Zoo World
  • Crowdstar — Happy Aquarium (7.3 million DAU), Happy Pets (2.9 million DAU), Happy Island (just launched)
  • Playfish — Restaurant City (4.2 million DAU)
  • HitGrab — MouseHunt (173,000 DAU)
  • Zynga — Pirates: Rule the Caribbean! (159,200 DAU)
  • Playdom – (Lil) Green Patch (79,228 DAU) and TikiFarm (just launched)
  • GPI – Robin Hood (11,104 DAU)
  • Alamofire – PackRat (8,442 DAU) – although I couldn’t identify the integration point
I was surprised to see FarmVille not in the list.

Sunday, January 31, 2010

Code Jam 2009 and the glory of China continues

The winner is Lou TianCheng from China followed by Qi ZiChao (China) and Iwata Yoichi (Japan) respectively.

See the difference, such a big leap the winner had.


Here is the list of finalists with ranking.

Position Country Participant Score Penalty
1 China ACRush 168 03:10:13
2 China qizichao 87 03:59:29
3 Japan wata 81 03:42:15
4 Russia ZhukovDmitry 70 04:07:59
5 Ukraine dzhulgakov 69 03:23:57
6 Georgia nika 62 02:36:34
7 Russia Vitaliy 62 04:06:31
8 Croatia kalinov 55 03:57:38
9 Russia halyavin 54 03:55:29
10 South Africa bmerry 50 03:30:12
11 Ukraine Slyusarenko 50 03:32:13
12 Poland marek.cygan 45 03:29:21
13 Vietnam Khuc.Anh.Tuan 45 03:59:27
14 Taiwan Jiunru 35 01:44:16
15 Russia winger 32 02:51:28
16 Japan hos.lyric 30 03:50:08
17 Russia pashka 30 03:57:18
18 Slovakia
misof 30 04:11:40
19 China Jeru 23 03:28:29
20 Lithuania FloppyCat 18 04:02:16
21 Germany AdrianKuegel 15 02:55:00
22 Russia emaxx 13 02:31:57
23 United States ploh 3 03:57:28


One of the interesting fact is that the most popular language was C++ followed by Java, C and Python.

For more on Statistics by Language and by Country:
http://go-hero.net/jam/

Official Page
http://code.google.com/codejam/