Saturday, December 26, 2009

A Look at Motorola Droid

Motorola Droid seems to get a buzz around on its arrival into the mobile market...

What is it that makes us think it’s a great gizmo and will it overtake the I phone.

Let’s see some quick fact sheet on the Droid.

  • Android™ 2.0
  • CDMA CDMA 1X 800/1900, EVDO rev. A
  • SLIDER
  • Wifi
  • GPS
  • 5 MP camera
  • Email sync
  • MSOffice and PDF viewers.
  • Close integration with Google apps.

The overall composition looks very appealing who likes google products with motorola hardware, clearly has a list of much needed features like Wifi and GPS and email sync to office and certainly available unlocked so that I could switch over to any service provider.

I certainly appreciate that Motorola made it available as unlocked though exclusive offers are given by Verizon.

Motorola DROID

I like it hoping the price would come down much further to get my own Driod…

This site has an good comparison have a look http://www.infoworld.com/d/mobilize/mobile-deathmatch-motorola-droid-vs-iphone-side-side-875&current=2&last=1#

Wednesday, June 10, 2009

Advantage PostgreSQL XML power

All of us know the greatness of the opensource database PostgreSQL, which is shortly called as PGSQL. This article outrights the power of XML functions usage available in the postgreSQL database.

Lets take a small sample.

Create a small table

CREATE TABLE "user_add"
(
id serial NOT NULL,
"name" character(100) NOT NULL,
address character varying(100),
phone character varying (12),
city character varying(20),
CONSTRAINT id PRIMARY KEY (id)
)

now let insert some sample records for our further actions


INSERT INTO "user_add"("name", address, phone,city)
VALUES ( 'John', '10, East st,Chennai', '111-111-111','Texas');

INSERT INTO "user_add"("name", address, phone)
VALUES ( 'Peter', '11, West st,Chennai', '222-222-222','Texas');

INSERT INTO "user_add"("name", address, phone)
VALUES ( 'Mike', '12, North st,Chennai', '333-333-333','Newyork');


now if you do a select of the table as select * from user_add;

1 | John | 10, East st,Chennai | 111-111-111 | Texas
2 | Peter | 11, West st,Chennai | 222-222-222 | Texas
3 | Mike | 12, North st,Chennai | 333-333-333 | Newyork

now I plan to give these data for an web service request or an ajax request for a request of user by city.

Generally we will be getting this data and then will be formulating that as xml format, which generally is a very consuming and exhausting process, PostgreSQL provides a simplistic way to achive this using its power full xml functions

here is a query

SELECT xmlelement (name city,
xmlattributes(city as "city" ),
xmlagg(xmlelement(name user,
xmlattributes(name as name),
(xmlelement(name address,address)),
(xmlelement(name phone,phone))
)
)
)
as xml from user_add where city = 'Texas' group by city;

you should get the xml



So just inaf to be passed on directly. Sounds amazing....


Monday, August 4, 2008

Get Reviewboard running using apache.


ServerName yourservername
DocumentRoot /var/www/html/reviewboard
ErrorDocument 500 /errordocs/500.html
# Serve django pages

PythonPath "['/var/www/html/'] + ['/var/www/html/reviewboard'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonAutoReload Off
PythonDebug Off

# Serve static media without running it through mod_python (overrides the above)

SetHandler None

# Alias static media requests to filesystem
Alias /media /usr/lib/python2.4/site-packages/django/contrib/admin/media
Alias /css /var/www/html/reviewboard/htdocs/css
Alias /images /var/www/html/reviewboard/htdocs/images
Alias /scripts /var/www/html/reviewboard/htdocs/scripts
Alias /errordocs/ /var/www/html/reviewboard/htdocs/errordocs




The /var/www/html/reviewboard is the path of the my review board installation and
/usr/lib/python2.4/site-packages/django/contrib/admin/media is the path of the django installation.

Thursday, October 18, 2007

Sethu Canal Project

Hi Readers,

I would like to express my view on the sethu Canal project (so called Ram Sethu), I neither offend or defend the existence of Ram here. But the political parties mainly caste parties are taking it a issue and everyone including the ruling government is trying to make votes in the election of of it.

Does it not affects the progress of our nation , Are we going to hurdle each projects this way.

We have to think forward, lets for an argument lets take Rama has built that bridge. Wasn't he doing it against the nature that time and what the problem now coming up.

Its all in the minds of politicians to grab votes from the people.

Crores of money will go wasted which have been invested in that so far, who bears the burden , not the politician but the tax payers.

Development projects with a true concerned should be appreciated and carried out without hurdles.

That is the only way to get in the vision 2020.

Friday, August 24, 2007

PHP PDO

PDO :
Sounds like a catchy word, but true its is a very good module that has been available with PHP 5.

In quick terms I would say this is like a generic odbc database abstraction method, IE you could write applications that can work seamlessly with different databases with it.

Here is the explanation from PHP site

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. Note that you cannot perform any database functions using the PDO extension by itself; you must use a database-specific PDO driver to access a database server.

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.


How to get it

Its available as PECL and also as a PHP module.

The PHP module is best and performance and speed. For configuring goto PHP site

How do I use it

$db = new PDO('mysql:host=localhost;dbname=$database', $dbuser, $dbpass)
or

class myclass extends pdo{

function __construct(){

parent::construct('mysql:host=localhost;dbname=$database', $dbuser, $dbpass);

}

/***

my code */


}

and now

$db=new myclass();


There are three important things in the PDO we need to understand

PDO object
PDO Statement object
PDO Error handler


PDO object is the object we insantiate

ie $db=new pdo('mysql:host=localhost;dbname=$database', $dbuser, $dbpass);

where $db is the pdo object.

Lets see an example of connecting and updating a record in a table test

$db=new pdo('mysql:host=localhost;dbname=$database', $dbuser, $dbpass);

$db_stmt=$db->prepare("update test set name=:name,address=:address where id=:id");

now $db_stmt is the PDO statement handle.

We had made the sql prepare here this is very effective when you want to update an array of users like

$users=array(
0=>array("name"=>"name1","address"=>"test1","id"=>1),
1=>array("name"=>"name2","address"=>"test2","id"=>2),
2=>array("name"=>"name3","address"=>"test3","id"=>3));

//note you have to

foreach($users as $key=>$user){
foreach($user as $col=>$val){
//bind the value for :name , :address ,:id here

$db_stmt->bindValue(":".$col,$val);
//to my knowledge the bindValue will work for binding all values.
//I see this bindParam is not working for the values in where class
//refer php manual for more options
}
//execute it
$db_stmt->execute();
}

There you go you should have updated 3 records.

you can always execute in the old way of

$db->exec("DELETE FROM test WHERE id=1");

which will return the no of affected rows for this.

Please put comments if you have any doubts.

Friday, July 27, 2007

A Tribute to South INDIA

Friends
I would like to tribute this video in honor of south India , where I do hail from, This video describes about my native town srirangam and also about the Greatest king Raja Raja Cholan.
Its a 52 mins video but worth seeing.

Google News on Tamil