Feb 262010

Heylo people!  Its been quite sometime since I’ve posted here…  This time, I’ll blatantly accept the reason! I’m outright lazy… and things at work have been shit-busy!!!  Scary deadlines, lots of shitty re-work, delivery pressure, <<feel free to add other shitty IT terms here>>

But yeah, I’m more active on twitter and Posterous

Twitter rocks!!! So does Posterous!

And I’m desperately waiting for the native S60 based Wordpress client…  That would help me put up thoughts here more often! Read Ewan’s account about the client here



As they say, the most important feature in your product is Shipping it!  I love “The Cult of Done Manifesto“.  A truckload of thanks to Swaroop C H for blogging about it!  Its soooo much simpler to understand and adapt to.  It makes a truckload of sense, and more importantly, it fits me and my attitude towards things – It works if YOU work it. Shit happens, Forget / fuck it / move on!

I love the Nokia N900!!! I cant wait for the next generation Maemo / MeeGo / <whatever Mooo-thingy its called> class devices to hit the road! I absolutely absolutely DID NOT like the Samsung Galaxy.  Nice to see the traction android is pulling on, but sorry, it still doesnt cut it for me!  And no, Snapdragon isnt close to a statement in terms of validating performance! ARM is GOD!

And in other stuff, the iPad is in more instances than none, being mistaken for a sanitary product… I’m having trouble convincing people at home that its a computing technological device!!!  And in a very very long time, I admit, I love the look and feel of the 17″ Macbook Pro.  Saw it at fossiloflife’s place.  I just love the curves on it :-)

And just so to mention, I’m listening to Laila O Laila as I type in this line :-)

Ciao folks… Have a good one :-)

Laila O Lailaaaaa

Posted by Cruisemaniac Tagged with: , , , , ,
Nov 062009

As developers, we tend to keep writing a particular piece of code time and again… Not because, we want to, but because we have to… Called boilerplate code, this chunk is unavoidable, repetitive and kinda grows on you over time!

I was recently coding up a web app using PHP and MySql and, I set out to find a wrapper class that provides good and fast CRUD functionality for MySql.



What I found, I ought to share! This post is tribute to an amazing PHP, MySql wrapper class that I have come to use and love over sometime now. The code is by a developer on a website called ricocheting.  The php mysql wrapper code can be downloaded from here.

I really appreciate that the code is fully documented in terms of functionality provided and also has strict type checking (strip slashes, escaping data, et. al.) and error reporting on sql queries. A nice addon to the script is that it allows to force open multiple database connections to the same database from the same source.

I am not going to take time into rewriting all that wonderful help documentation the developer has produced on his website. So, go ahead and check it out there.

The code has been released under the GPL license so, all you code-monks are free to tweak and boost it! Do let me know if someone comes up with a similar / updated / more functional code-chunk for this purpose.

Chao…

Posted by Cruisemaniac
Oct 062009

A lot of us have blogs, websites and web applications. A good number of us use private hosting providers like bluehost / dreamhost / mediatemple as opposed to hosted services such as wordpress / blogger / gmail, etc.

When you’re with a private hosting provider migrating between providers is a common scenario that occurs on reasons of cost, reliability, performance, demand and so on…  Moving files across these providers is a breeze… FTP from one place to another…

The question that arises is, how do you move that huge mysql database??? I’ll walk you through two regular techniques that are generally used to move databases… And then the third technique that uses the BigDump tool…

All the three techniques require you to take a dump of the mysql database of your application(s) using phpmydmin / mysql CLI. Download the resultant .sql or .sql.gz (Compressed zip file) and keep it ready to move…

1. phpMyAdmin: Everyone knows this… and everyone that uses a private host has used it atleast one time…  Once you’ve created your new database at the new host, open up phpMyAdmin and navigate to the newly created database.  Click on the SQL link and click browse in the window that pops up.  Select the .sql or .sql.gz file and select Import.  The job is done!  The problem with this technique however is that it is limited by the memory limit imposed on PHP by the server.  Most cases, this is around 7-8MB.

2. mySQL CLI: This is the next advanced method of sql import.  This is from the commandline (SSH) on the server.  It is extremely simple and ready to go if you have shell access to your space on your server. The technique goes like this.  Upload the .gz file via ftp onto your new site and login to your server via SSH using putty or equivalent tools and navigate to the location.

  1. Unzip the .gz file if you’ve used compression.
    you@host~ tar -xvf database.sql.gz
  2. Dump the sql into your preselected database like so:
    you@host~ mysql -h mysqlhosturl.com -u yourmysqlusername -p yourmysqlpasswd -p yourdbname < databasedump.sql

3. The BigDump technique: The first technique works, as mentioned, works for very small database backups and restores. The second technique works when you’ve got shell access to your hosting space. The third technique works when your sql file is too large for phpMyAdmin and you do not have Shell access to your hosting space.

BigDump works by what is called staggered import of SQL. It breaks down and batches SQL imports into the database, thus maintaining the memory limits of PHP and also getting the job done via a simple web interface.

Getting it to work is very simple.  The script has only 4 parameters you need to configure: the mysql host, username, password and database name.  Once the info is keyed in, upload the BigDump.php (download) to the folder where your big sql file is. Chances are that its already in a .gz file.

Using your browser, open up www.yourserverpath.com/bigdump.php.  It automatically detects sql and .gz files placed in the current directory.  Just hit start import and you’re good to go…
A screenshot is attached below:
Bigdump

There. That does the post… I felt the need to post about the tool as it helped me out of a very cheeky solution yesterday.  And for the beta the developer calls it to be (Version 0.30 beta), the tool is amzingly stable. And it works like an absolute charm.

The developer website is here.

Till the next post…

Chao…

Posted by Cruisemaniac Tagged with: , , , , ,
Sep 302009

I was out yesterday to meet a couple of friends and as is customary, we were clicking photos with our cameras AND not to forget mention, our mobiles.  At this point, my friend Hrish (@dhempe, for all those who would not identify with the name ;-) ) raised an interesting point!

Thus spake Dhempe and here I quote:

Many of us have cameras on our phones, and we click photos! But, its a very messy job to put them in a place where others can see it and also to share with friends. The mobile phone is a blackhole for its own content!

And that statement is filled with such profound truth!

Many of us, or if I may, a whole LOT of us have phones that are quite capable of generating content (Images, videos, voice recordings, etc) and we definitely do generate enough content to fill storehouses with our happy / romantic / funny / cheesey/ whatever memories for lifetimes together. Heck, this is what the mobile phone revolution is coming around to do…

For us geeks, connectivity, socializing and sharing is as basic and habitual an act as is having food.  We feel the necessity to share and connect and as a result, find and utilize services to enable this! Photos go on twitpic / flickr, Videos go on Qik / youtube, Shouts / screams go on blogs / facebook / twitter… we have no end to destinations!

But, a lot of content does not make it online / publicly (atleast within friends) available.  Infact, most of this content doesnt even make it outside of the mobile devices!  And, mind you, the memory on the mobile is limited.  And the main use of this memory, again mind you, is Ringtones and MP3 music!  The photos and videos captured thus take a backseat and much of this content is to true sadness, deleted to make way for more MP3 and ringtones! And hence the reference to a black hole in the title of my post!

  • In reasoning as to why people don’t share their photos or videos, the first answer that pops up is: “They dont have a computer!” And this is a very valid point across the lengtrh and breadth of this nation.  Access to a computer is not everyone’s daily possibility.  But with cost of mobiles going down, they do have access to multimedia devices!
  • Another reason, a lot of people do not have GPRS active on their devices. Reason, it doesnt make sense…  No, GPRS doesnt yet make sense for a guy working as a driver.  A mobile phone with a camera does. Why? 1. He can afford it. 2. He can flaunt it! Simple!
  • The third reason I can think of is the software problems that is associated with sharing content.  Getting your Nokia phone (Cited Nokia because its the most common / prevalent brand in INDIA) connected to the PC with PC suite isnt really an easy job.  Sometimes, you need to make use of imaginary numbers like eleventeen and the likes!!!  For the blindfolded usability and seamlessness nokia gives its phones, the software it bundles with it is not quite the works!!!
  • The fourth and final reason I can think of: There is only so much of sharing you can do via bluetooth with your friends and there’s only so much of showing it to friends that you can do…. Believe me, give it a try, you’ll know!

So, four reasons why content doesnt get out of the mobile!

What if a user could as and when he / she could and wanted, move and materialize the media he / she created to make place for more memories to be stored? This, my friends, is a very interesting challenge and hence an interesting prospect for a service!

We are over 400 million mobile users in India alone.  I am really in a fix in figuring out a solution to get this content out of their mobiles and shared across with their friends and with the world!

The way out:

  • One solution I can think of is the Kiosk model.  A shop / vending machine where people could go and get their photos printed / and mailed for cheap using Bluetooth to transfer their content. Or better, transfer the photo, punch in the address where it needs to be delivered and presto, the photo + address travels via IP to the centre closest to the destination and gets printed and posted from there! :-)
  • Another amazing service I can think of with the kiosk model is one where the videos captured using the mobile can be transferred to CD’s. Come to talk of it, a CD costs you 8 Rs.

These are two solutions off the top of my mind…

The whole idea that I’m trying to propagate here is to take the complexity of the software / sharing service bit of the scenario away from the hands of the user.  This effectively reduces complexity for the layman with the multimedia mobile :-) and effectively encourages him to share the content he / she creates on the mobile with friends and hence further encourage him to generate more content and so on and so forth!

I’d really love to hear more from you all on how the black hole scenario can be averted! Sharing services are many and aplenty!

The success of a service is, in our Indian scenario, not just in holding existing users to itself, but in getting those new users from outside the regular spectrum to come in, take a look, get enthusiastic and get enabled!

Would love to have comments and discussions on this topic!

Chao!

Posted by Cruisemaniac Tagged with: , , , , ,
Aug 142009

Developers working on Symbian code have always had problems when it came to testing their apps.  The process is quite a bit cumbersome:

  1. Build your code – Cross compile it for ARMV5 / ARM-GCCE Release
  2. Make your sis installer (unsigned)
  3. Upload the SIS to symbiansigned.com using the Symbian Online Signed program
  4. Click on the confirmation link in your email
  5. Wait for your app to be signed by symbian and recieve the email
  6. Download the app
  7. Install and test (mostly only to realise that you have made the mistake of not installing theCActiveScheduler::Add(this) in your ConstructL. ;-)

The process works… nevertheless, its very very very cumbersome and timeconsuming.  And the debug that you are left with is plain text-statements that you write to a log file and dump it onto the filesystem.  While this method may be good enough for some small apps using the in-built emulator, testing GSM activity and live testing of the application is not quite possible or comfortable there.

There is however, another really good way to debug your app and step thru code and read symbian variable values right from the comfort zone of your PC. Say hello to ODD or On-Device-Debug.

On-Device Debugging has been a prominent feature of Symbian IDE’s right since the Metrowerks CodeWarrior days! Yes, its been there… but back then, prior to Symbian OS 9.0 / S60 3.0, it was used more for JTAG based debugging.

Now, with Carbide, virtually any app can be set to debug mode and tested with ODD. And in this post, I will show you how:

Requirements: ;-)

  1. Carbide 2.0 – The eclipse based IDE is at v2.0. Its free and is absolutely amazing to use. Next best thing since notepad for writing symbian code!!!
  2. S60v3/S60v5 device – For the purpose of this article and impending demo, I am using a Nokia 6210 navigator but any S60v3/S60v5 device should work. (Ideally this is the case but I do not have non-Nokia S60V3/S60v5 devices to test and confirm it…
  3. USB cable / Bluetooth – The code you want to test runs on the device… and you need something to transfer data between the PC and the device… So BT / USB data cable it will be.

SETUP:

And the Steps for getting your ODD setup in place:

First, install Nokia PC suite on your PC.  This dude is important as PC suite contains the basic connectivity drivers for your device.  Without that, your phone wouldnt be able to connect to the PC.

Next up, Fire up carbide. The On-Device debug mode is needed to be setup from the help menu. So… head over to Help -> On-Device Connections.On-Device Connections...You will be presented with a menu like so:New ConnectionSelect between Bluetooth and USB for connecting to your device. The other 2 connectivity methods Serial and TRK2.x are, well, not covered in this tutorial. But just a heads up, Serial connection is when you have a serial cable connecting your device to a physical COM port (so 1990’s) and the TRK2.x is for the TRK debugger which uses the elusive and exhorbitantly costly impossible-to-buy-for-a-indi-dev JTAG cable. So, there… We use either Bluetooth or USB 2.0 cable options to connect with our device. In my case here, its USB.

TRK:

Click on next and head over directly to the install remote agents tab.  This will let us install the TRK client onto the devices. This is a sis file that is tailored for every single S60 version since 3.0.  Lets talk a little bit about the TRK client here.  This app is basically what helps you pause your code and step through when the code is executing on the device.Install Remote AgentsSelect the Application TRK 3.x.x Installer. and click on the install button and fire up the PC Suite installer, proceed to install it.  I would prefer you install the TRK app on the phone memory rather than the mass memory or memory card.

We do not need the Carbide Profiler 2.0 installers. But, Just for FYI sakes, they are apps used to profile processor performance and load.  I seriously do not know what purpose it exactly serves. If you do know, do help me by dropping in a comment :)

Connection:

Once you are done with the installation, fire up the TRK application on the device. Select Options -> Settings and select USB / Bluetooth as your connection method is.  In my case here, its USB.

dodd-1 dodd-2

Once you are connected, the TRK app will show the Status as connected like so…

dodd-3

Here, connected means that the cable is connected to the device.  It DOES NOT mean that you are connected to carbide in any way.  Why it is so… I have no idea!

Now, on carbide, switch to the Set Connection Settings tab in the connection properties window.  In the Connection Settings dialog box, click on the drop-down and you should currently see your device assigned to one of the com ports.COM Connection SettingsSelect the com port your device is detected in, the TRK version installed on your device and click on initiate testing.Connection Successful A connection successful message would mean that your TRK on the device is detected and you are good to go.  If it fails, its mostly the COM port being selected wrong.  I really have no idea how to fix this, but yeah, a trial and error run with some com ports should work always! :-)

Hit Finish, And we’re good to go do some code-debugging on carbide!!! :-D

To take a look at the remote connections, Hit Window –> Show View –> Other. Expand the Carbide.C++ list, select Remote Connections and click on OK. You will be presented with a list of remote connections you currently have.Remote ConnectionsRemote ConnectionsDebugging:

To start with debugging, open your Symbian C++ project and in build options, select Phone debug (GCCE). Hit the build.Phone Debug (GCCE)Once the build is fine, hit debug. Since we do not have a debug configuration for GCCE Phone debug, carbide will ask us to create a new configuration like so:New Debug ConfigurationSelect the Application TRK Launch Configuration, and click on next. The remote connection we created earlier is listed and selected automatically. Proceed to the next step where it asks for the SIS file to be installed. Carbide has already filled up the necessary information. We just need to add a few things.

Now, click on the Modify Sis builder settings for build configuration link just below the Sis File dialog box.  This will open a new dialog box where the only things we need to modify are as below:

  • Enable the partial Upgrade checkbox. This will help quickstart the debug as the whole sis file is not re-created and signed. Only the delta is sent across to be debugged again…
  • Select the configuration and click on Edit. You will notice that the Self Sign sis file option is selected already.

Good, now wind up and head out… Once you hit finish, carbide starts up the debugger and switches to the debug perspective. The application will be packaged, signed, transferred to the device, installed on the C/ E drive that you choose, and started up.  Provided you have already set a breakpoint, the code will execute till that point and you have control to step through then on.Debug ModeSo, there you go… On Device Debugging for S60 apps on Carbide.  Have fun coding…

Chao!

Posted by Cruisemaniac Tagged with: , , , , , , , , , , , ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes