Monday, October 24, 2011

Do: Migrate E63 to Galaxy 3; Done!

It has been a while since I bought my Galaxy 3. Its an amazing economy Android phone :) I have an E63, which has been with me since a while now. I was trying to find ways to transfer contacts from E63 to Galaxy. Laziness! and Procrastination!!
I was not really using the Droid for a lousy reason that the contacts are not transferred.

Today I decided I will end my procrastination :D there you go; decision done -> action taken :)

A really simple 2 step procedure to copy contacts:
1. Copy all contacts from E63 to the mem card. Mount mem card & copy contacts to the PC (saved as *.vcf).
2. Copy contacts from PC to the Droid mem card & import vCard to phone!

I now feel really dumb that I waited for so long :(

Saturday, October 22, 2011

Keep your workstation ready -- Always...

Hola!!

What better can I think of doing than blogging when a bunch of software gets installed on my comp??

Setting up a new system is the most painful ordeal. PERIOD :-| I am sure a lot of us agree. This is particularly true when we have multiple systems distributed across locations AND like to keep the workstations in sync. Well few of you may say, when we can carry a laptop why bother? I can only say, I thought so too, but was proved wrong time and again.

Most of us fancy having a "High End" system. Let's face it, we don't necessarily make use of all its juice. So? There you go, settle down for a slightly lower configuration workstation that can be carried around :)

Desktop virtualization is a boon to guys like us. I used to fancy running a Linux box on my Windows PC @ work place. I am more comfortable using the 'ls' than the 'dir'. Unfortunately, my work called for using Windows for every single thing I did. Nevertheless, I had a Linux VM ready for any script-testing. I thought a VM is good for that and only that!

How incorrect I was :-O Now when I am pursuing Masters I realized the awesomeness of virtualization. Be it messing around with new software... kernel compiling... or simply try coding to check the effect of infinite recursion on the OS :-P

My latest "woah!" time was when I had to run a bunch of software on a friend's machine. I had very less time, and also could not ask my friend to load his box with all the assorted libraries which meant nothing more than non-sense to him. I quickly configured my Ubuntu VM decked it up and took the vdi file on a portable hard disk. Just one installation of Virtual Box on his machine, I had my workstation up and running in less than 5 minutes. :)

So what is the learning? For me it was simple. Configure a sufficiently powerful virtual machine on the native box you have, keep the VDI safe. Use it where ever you want.

I have now decided to work full time on this virtual machine. I have configured my virtual machine based on virtual box. Its fairly simple to use, open sourced and easy to carry around ( NOT the virtual machine, the S/w itself ). My VM is an Ubuntu 10.10 box (32 bit - safer as it runs on both a 32 bit / 64 bit base machine). How ever less I use, I have the following environment ready:
Java development, including J2EE.
A fairly decent C/C++ environment with Qt/OpenGL & Boost libraries.
Perl -- My favorite language! How can I leave it :)
Python -- a new muse.
SVN & GIT -- version control on the move.
An Eclipse IDE (Galileo -- well I know its a bit old, but WTH! it serves my purpose).
Mozilla firefox browser -- I need to "Google things out" when I'm working!

I installed this VM from a bare minimal Ubuntu server alternate disk (with no servers installed), so I handpicked the necessary software. I don't intend to play tetris on this development box. A big NO to any (un)productivity suites. However I do have a decently heavy LaTeX2e environment to type out reports :)

This VM is a 2 vCPU, 2GB vRAM machine with virtual disk size is 15gigs, which is OK! I carry this around on a USB portable harddisk, along with a Virtualbox installer(both Linux & Windows :D). I can do most of my work on this virtual machine.

If you are wondering, "You have your environment ready, then why the **** are you setting up a new machine? Couldn't you have worked on this??" Well.. lets just say, a failed upgrade! :D

Now that my base machine is ready, time to get back to the VM and crank code!

Cheers,
Akshay

Saturday, October 15, 2011

Code Indenting Made Easy

In continuation to my once-upon-a-time post about code indentation here is a quick post.

This is particularly helpful to those of us who get this kick of writing code in a single column indentation, ( some fancy name for hopelessly written code :-| ). I discovered these tools called GNU Indent and Artistic Style, when pulling out my hair reading someone's code.

Perl has a beautifier called Perltidy. I searched for "Is there a ctidy" and that is when I came across the two tools mentioned earlier. GNU Indent seems to be a C only beautifier*.
( * Correct me if I am wrong. I just read the description )

Artistic Style on the other hand works for Java, C, C++ and C#. It is a simple light weight yet powerful code formatter. You can download the source from here. Extract it to a convenient folder. Change directory to build and run make. If you prefer installing in some local location like me, provide the prefix information in install: make prefix=$HOME install. If you don't bother much, just run make install. There you have AS installed.

Running is even simple, (assuming AS is installed in the user's local bin directory)
~/<username>/bin/astyle <source files>

THAT'S IT!

AS does give plenty of options to format code, I wont go over all of it. Waste of time (:P) feel free to figure it out.

Now that the code is indented, let me figure out what it does!

Adios :)

Wednesday, October 12, 2011

Text under word in LaTeX

Howdy!!!

If there is an activity graph that is generated on my posting habits, I'm pretty sure it would look like the ECG of a dying man. 
Sigh!! how I hate myself for not being able to post frequently. All I do here is rant. Most unfortunately, I cant rant as frequently as I want :(

The title gives away the suspense (if ever it would excite anyone!). In my last post, well a long time ago, I indicated that I have been working with LaTeX for a while, there is no change in the status :) Every time I discover something new I am like "Woah!" ( Expression flicked from a good friend Tejaswini ).

Now its about placing text under a word / sentence / symbol. What's so great? Well, the way your content is typeset becomes awesome!

For starters, this has to be executed in math mode in between text. So it may not work in the equation mode.
A simple example, you need to say summation over some i. Classically, the code for the same would look like this : $\sum_{i}$
And the typeset looks as under:

Now how nice would it be if we could place the i below the sigma? Well, I had to pull my hair out to figure out the same. Thankfully, some dude had posted the solution on a forum, I adopted that, and voila! my problem was solved.
So the code to make i appear below sigma is simple: $\underset{i}\sum$.
The typeset looks like this:
Ain't that what we wanted! :)

Enjoy TeX-ing :)

Signing off for now.