Tuesday, March 31, 2009

SLow down on programming, gaining on Forex Learning

I never invest in Forex, but have been reading about it extensively since months ago. BabyPips.com provides the best guides ever. So I'll slow down a bit on programming reserach and put some efforst on learning Forex.

Pisces born clads are not greedy type, so the trait quite useful while trading on FX......

Sunday, March 29, 2009

Tiara Beach Resort

The aerial view of Tiara Beach Rsort

Travelling path from Putrajaya

Friday, March 27, 2009

Field Test 2 : Satria NEO from Putrajaya To PD

I'm not a 100% computer geek, apart from coding, I enjoy motorsports, esp Sepang Sunday Track Day Session. Yesterday I burnt almost RM900 changing new front tires, adjusting camber degree, changed the APM rear coilspring to Eibach.

Now the car handles beatifully. The new camber setup improved the cornering performance.

Wednesday, March 25, 2009

RoR : batch geocoding using shell command


runner in action

Imagine you have thousands of data of subscribers with address and postcode, and suddenly your boss asking for Latitude and Longitude value for each entry using the given address. The answer is, using geokit and RoR runner

ruby script/runner batch_geocoding.rb

Tuesday, March 24, 2009

GPS: View by route

Updated the prototype engine with display by route. Additional info is total distance in kilometer and time taken for the tracking.

Monday, March 23, 2009

GMAP Ez in CakePHP

This is the result

This is how i use Foreach in CakePHP to plot the map

This is the JS init in app/views/layouts.ctp
I use GMAP Ez Google MAP Framework ( http://n01se.net/gmapez/ )

Speed & Distance

The view sample

The controller sample.

The Location Model. Add process_afterfind() function

The result on view

The result on info balloon

So I add some new functions today, to display covered distance between 2 nodes and average speed too.

Saturday, March 21, 2009

Field Test 1 : Logging GPS from Putrajaya to Batu Pahat

Sample python logger used in this field testing.

Sample GPS Log with info window tracking from Plus Pagoh Toll to Batu Pahat, Johore town

The path taken from Putrajaya to Batu Pahat,

Sample logging output from Nokia E71 GPS Tracker

The aim for this field test is to do stress testing on the Python GPS logger running on my Nokia E71. The logger will write GPS and Time data into text file every 60 secs. Average cruising speed on my wife's Toyota Altis is 120kmh - 140kmh on the highway.

From the log file,
1. Must be able to upload to the server and automatic plot on Google MAP
2. Have to write a Python script to automate the upload using HTTP transport.

From the report
1. Calculate covered distance in meters.
2. Calculate each node covered distance
3. Calculate average speed
4. Calculate speed from node to node

Field Testing Reports
1. The logging was successful
2. Log file size is 86kb in size
3. Abto to upload and automatic plot without problem

Sunday, March 15, 2009

Python GPS logger

Simple Python script

My Prepaid credit is null, and I want to do live tracking today. So I fired up my vi text editor and begin experimenting.

The script should log the gps data every 5 secs into flat file
The format will be "gps|||

Live Tracking Site

Ok, it's live. Now you can track me live on the net ( unless I have enough credits on Nokia E71 Celcom's prepaid )


Saturday, March 14, 2009

Satria NEO Tracking Project

My wifey's Corolla Altis is not suitable for this project since, it's a family car. So I'll use my Satria NEO as test car in this Google MAP Live tracking project. Some facts about the car

1600cc normally aspirated Campro Engine
APM lowering spring ( till I got enough money for TEIN )
TSW Hockenheim R 16" Competition Wheels
205x50 Hankook rubber on rear and 205x45 Silverstone on the front
Built in Video Camera holder ( bought from US for RM400 0

For tracking device, I'll use Nokia E71 installed with Python script that will send SMS for current location for every 30 secs ( suck my money yeah )

For receiver at home, I'll use my Wife's SONY Laptop connected to receiver GSM Modem, Sony K770i.

For programming I'll use CakeSMS ( http://cakesms.blogspot.com ) for SMS Framework and write simple listening daemon for SMS processing

For the output, I'll use GMap EZ framework for Google MAP.

This tracking device is suitable to track the car movement live on your web browser, maybe for Rally fan, can watch the car movement live on the mobile phone connected to GPS

Google MAP Tracking using Polylines

Info windows on event start

Infor windows on event stop

Friday, March 13, 2009

Formula to calculate distance of 2 corrdinats

$lat1 = 3.033555;
$lon1 = 101.87347;

$lat2 = $location['lat'];
$lon2 = $location['lon'];

$location['distance'] = (3958*3.1415926*sqrt(($lat2-$lat1)*($lat2-$lat1) + cos($lat2/57.29578)*cos($lat1/57.29578)*($lon2-$lon1)*($lon2-$lon1))/180);

Wednesday, March 11, 2009

Google Map Nokia E71 Tracking

On the left is my listening SMS daemon, on the right is the debug mode for Gnokii

Here's the tracking Sample. The balloon pointed where was me on the specified time

It works !

GPS2SMS: Using Mobile Python on Nokia E71 to send GPS using SMS

This is continuous 60secs version.

Get the GPS, then send to predefined mobile phone ( listening server )

This code will run on Signed Python shell in E71
Credit : http://code.activestate.com/recipes/576601/

References :
I use
1. Python 1.4.5 3rd edition self signed
2. Python 1.4.5 Shell Unsigned ( then go to Nokia Symbian Signed website to get it signed )
URL : http://sourceforge.net/project/showfiles.php?group_id=154155&package_id=171153

Imagine this application combined with CakeSMS ( http://cakesms.blogspot.com )

If you met the gridlock or application can't run, try read this forum

Tuesday, March 10, 2009

Aspicore.com GPS 2 SMS

I managed to install the trial software ( runs on for 10 minutes ) and sending periodic GPS using SMS every 1 minute.

So I have my own Fleet and Vehicle Tracking System, and only cost me USD40

Imagine Google Map + RoR + Apricot + Nokia E71

Wednesday, March 4, 2009

Search engine with pagination

The search result with pagination

The will_paginate object, Note the extra params.

The search method. Note the 2nd @pages object. It's lazy man way

The search from using built in Ajax.

Geocoding in Ruby On Rails

My boss quite impressed by the JARING BizOnNet portal. So he decided to give me a new task. To plot all the WiFi nodes in Malaysia installed by JARING.

The requirements will be :
1. Auto geocoding street address. For example, you put Jalan K/4 P11, Presint 11, 62300 Putrajaya, the system should be able to get the longitude and latitude for the address.

2. Display the Google MAP for geocoded address
This is simple, just get the lon/lat value and use YM4R plugins to display the MAP in RoR style.

3. Each node will have many users. So the DB relationship will be Nodes hasMany Users and User belongsTo Node

4. Category, will have 2 category, 512kbps and 1024 kbps. So the map ballon will be using customised icon. YM4R have this nifty function.

5. Tagging for each node for easy search

Tuesday, March 3, 2009

SEOd URL using to_param method in RoR

The SEOd URL. Looks nice and clean " http://bizonnet.jaring.my/pages/9-adelia-power-services"

This the view. Note I use button_to helper instead of link_to.

The magic is in the mode, the to_param method.

Insetad of http://bizonnet.jaring.my/pages/9 , I would like a more nicer and meaningful URL like http://bizonnet.jaring.my/pages/9-adelia-power-services. So when the URL is being stored in Search Engine, people will know what's the page is all about. So How do I do that ?

First, add the to_param new defination to your model, and it's will be donw automatically.

Sunday, March 1, 2009

10 Skills a Web Developer should know

1. User Authentication system
- signup engine
- login engine
- forget password engine
- confirmation thru email engine

2. User Roles System
- User has many Roles
- function for each role

3. CRUD System
- Create new item
- Read created item
- Update created item
- delete created item

4. Search engine
- simple search
- full text
- with pagination

5. Pagination engine
- digg like pagination engine

6. Relationships
- A User has many Posts
- A Post belongs To User

7. Tagging System
- Tag search
- tag cloud
- tag an item

8. Upload system
- image
- file
- video

9. Image Processing
- photo resizing
- image thumbnails

10. AJAX
- ajax pagination
- ajax drop down select
- ajax search
- ajax updates
- ajax validation
- ajax suggest