Tuesday, 23 September 2008

Vista (vs) Ubuntu (vs) Debian

last night I was trying to think why I had only 80GB free on my 140GB disk running Vista? I tried cleaning up stuff I am not using including a 8GB Debian VM image and stuff like that. I even un-installed Office 2007 that I was not using .. still the space did not seem to go ... it grew to a mere 84GB ...

Then as I tried to remove another application, it prompted me for a restart and hello! the laptop wont boot up! After an hour of system recovery it started and behold! I can see 104GB free now ...

What the hell was Vista hogging 20GB for???

Anyways .. I have decided to install Linux as a dual boot on my laptop ... my decision was limited to Debian or Ubuntu ... I like Debain's stability from when I used it on my Linux only laptop ... but in this case I want to preserve the Vista partition .. so I will stick to Ubuntu which I can install with less risk of spoing things ... Last time I did Debain it was another story :)

Wish me all the best

Hello Delphi!

Good projects are hard to come by ...
Projects that mentally stimulate you and gratify you are harder to come by ...
And both of these are less likely to happen in the first 4+ years of your job ...

They do happen .. but rarely ...

My current project is one such experience that I am not going to forget in this lifetime ...

Two weeks ago I had no clue what Delphi was .. except that it is related to Pascal .. which is again something I have no clue about ... I was a direct to C guy ...

Today I wrote my first Delphi console application and it works like a charm ... And I am sure in no other project would I be given such an opportunity to do something like this on my own .. learning on my own ...

Happy!

Sunday, 14 September 2008

Installing MediaWiki - The easy and oversimplified approach

This article is an attempt to provide a bare bones and sure to work approach to install MediaWiki and get it running and ready to use in a very very short time. This was the method that I found to be the best given that I was trying to set this up in under 2 hours.

So, here we go.

1. We will be using a Linux platform to get this job done.
2. If you have a Linux installation that you can use - perfect - I did this on Debian Etch, so I would suggest that.
3. If you do not have a Linux installation or Debian or any Debian derivatives, then you can do what I did.
4. Download VMPlayer from VMWare - this is a free virtual machine player. You can find it here
[1]
5. Once you install this, please go ahead and get the Debian Etch 4.1 Virtual appliance from
[2]
6. This is an 800MB plus download and will be the slowest part of our job - I downloaded this in 30 minutes on my broadband here in London
7. Unzip this to a disk with some 4GB space. Open VMPlayer, browse to this folder and open the virtual machine file. If it gives a lock warning select take lock and if it asks did you move or copy this machine, say you moved it.
8. Debian should boot in a VMPlayer window and you will see a login prompt. Login as "user" with password "user". You are root.
9. Select the desktop menu in the control panel at the top and select Administration->Synaptic Package Manager
10. In click on search on the Synaptic window and search for MediaWiki
11. Select MediaWiki 1.7 in the list shown. Click on the checkbox and say mark for installation. It will prompt you to tell that more dependencies are needed - click OK to install them also.
12. Now search for MySQL and select MySQL client and MySQL server and mark them for installation.
13. Click on apply on the Synaptic window
14. Let it install the stuff.
15. Once done, bring up a browser and go to
http://localhost/mediawiki or the equivalent.
16. You should see a page saying Setup MediaWiki and a hyperlink to the set up.
17. Now fire up a terminal on the Debian box
18. type mysql and hit enter
19. You will be taken to the MySQL prompt.
20. Type this to create a DB called wikidb - "create database wikidb;"
21. Type this to create a user and give him necessary grants - "grant all on wikidb.* to wikiuser identified by wikiuser"
22. Type this to let the grant be effective immediately - "flush privileges;"
23. Commit changes by typing "commit;"
24. Return to the MediaWiki webpage and click on the hyperlink, it will show you a status saying you are ready to install MediaWiki and show you a form. Fill out the details and disable all e-mail related stuff. Enter the DB name as wikidb, user and password as wikiuser and leave the root id etc blank.
25. Hit install MediaWiki and wait for it to complete.

Thats it!

You are done!

I did this just now and am typing this article on the Wiki that I installed.

Saturday, 13 September 2008

My Stories

I have this habit of writing stories ... for a long time I had this habit of thinking up alternative endings and situations for films , but never really tried writing. But in 2007 after I started blogging on our company Intranet I came acros stories by Venu (see this) .. I loved the way he wrote complex stories in a simple and engaging way .. and I ventured into writing my own stories ... I have a collection of them hosted at whitenoise.sulekha.com

Please feel free to leave your comments ... and also watch that space for some more stories coming soon ...

A day at Lords

Finaly I went to Lords .. the home of cricket .. and enjoyed the atmosphere there ... i just loved the way the audience enjoyed the game .. no shouting or slogans or anything ... but they enjoyed it and appreciated every player who made a contribution ...

I mainly concentrated on taking pictures ... I took a coupel of hundred pics ... but most of it was either repettitive or in some way not the best shot ..

I have uploaded some good ones here ... do have a look ...

Thursday, 11 September 2008

Fourteen years with the computer ...

For no good reason today I realized that it has been 14 years since I had my first encounter with a computer. At the first meeting, I was nervous and my computer stubborn. It was a 386 based PC with a 4MB extended RAM to run Windows 3.1 and had 170MB hard disk drive. My dad had installed Windows and wanted to show me few games. Unfortunately the mouse was not working and the "oh-so-obvious-these-days" shortcut of "Alt+F" was not known to me and my dad was still learning the ropes of Windows.
 
Well I did improve from that point. I had the privilage of booting all the 8 PC's in my school lab using the boot disk. That was because my lab incharge saw that I was both interested and comfortable. I used to do BASIC at school and once in a week or when my dad was free I got a chance to run a few commands on the PC at home. There was no Google to get code samples, and the GWBASIC reference we got with DOS was the only way to go. I still remember on the first day with GWBASIC, I wrote a program , saved it as something.BAS and executed it, and then tried to type a second program in the same file under the first program. My reasoning - why waste a file! My cousin who was teaching me was grinning and he thought I needed a lesson.
 
Slowly over the next two years he taught me C and basics of how the file system works, Viruses and anti viruses, how to care for a floppy and how to write a small game. Back then I had no access to anything other than the books in my hand and a pen and paper because most of the time my dad used the PC and I was not supposed to do anything stupid on the PC. I wrote lines and lines of code on paper and ran it in my head. C was tough to run in your head, but I did. Initailly I got everything backwards, but then once I got the hang of it it was cakewalk. By the time I was out of high school and laid my hands on a proper Windows 95 PC, I could get my program right the first time.This was 1998. C was good! but pointers had me for the next 3 years. Meanwhile I got a taste of Visual basic - back in its version 4.5 days and I was amazed by how much I could do easily. Although now after years of Java I dont think I will go to Visual Basic again.
 
Then I was away from computers for two years. In my first year of engineering, we had a C and data structures lab where I cracked pointers. Eureka! and I was the saviour of many souls who had to complete their lab work. I tried C and VB for two years. Then I did 8051 microcontroller programming for a semester on a small custom computer in the lab. That was fun! I wrote so much stuff that I could write machine code and finished my final lab exam in 30 mins flat out! Although this sounds good, it did not get ame any brownie points in my class - I was the geek who spoke an alien tongue. By the time I got to Java in final year, I was having fun. In out last semester we did a project where we coded a microprocessor in C and built a front end in VB.
 
Then came the Job, again I was the geek who spoke an alien tongue - C, Java and programming fundamentals were cakewalk. When they taught me Oracle , i just applied what I already knew about programs to SQL - its just a set of instructions, assignments, branchs and loops. Just dont get in a tangle.
 
I dont know if it is arrogance or ego or whatever, but I am never scared of a programming job adn always take it as something trivial. My first two projects in VB and Java, I did just that - took it as a simple job and did it well. I had the chance to try JUnit, Log4J and Python etc but never found a proper application for them in my projects. Then for two years I did projects that used packaged tools. These projects taught me a lot of other things about the job. So late last year when I got another Java project I was ready to go. Day 1 i realized that I am supposed to work with guys who have 20 yrs average experience in programming. It did hit me hard. I had to make effort to be recognized, I had to write good code and fast and in proper standards compliant manner to get then to even look at it. And each time I had just one shot - just like a sniper who can take just one shot at his kill.I have sobered down and mellowed in the last 10 months, but I have gained scars that will stay with me forever and guide me.
 
I grew up learning C and Java from playing around, not by Google. Today I do search for code on Google and other places, but still I do it my way. I wrote a small console for Jython few months back (http://console4jython.sourceforge.net), I wrote this in one night in a single class. Then I spent another 4 hours breaking it into more structured parts. I was happy, and I searched for any similar project on Google. I did find a few, and I felt I reinvented the wheel, but I was happy. Because I had a wheel that I liked. Maybe a few others will like this wheel, so I put it up on the net for people to use. The key here is the joy of creation. I felt the kind of thrill I felt when I wrote my first program. I also realized something. I was trying to learn Python for a while. I knew what and how to code, but was not getting that comfort feeling. I realized it was because I was not doing anything with my knowledge. I was not trying things. So I wrote a script to generate some XML we needed. I wrote something, cleaned it to standards, wrote some more and cleaned some more. In the end , I had something useful to be proud of.
 
What have I learnt in 14 years? Not much in the first 10 except how to get something right without Google to help you, but in the last four years on the job, yes a lot
  • Write some code - if you have an idea code it and see of it works or blows up. Doesnt matter fo you fry your PC, try first
  • Do this trying thing again and again even if you fail
  • Dont be afraid of code, It cannot come and bite you
  • Think, analyse and work out all possible scenarios
  • Dont believe in reuse - be prepared to rewrite stuff to suit your needs
  • Test
  • Test enough
  • Follow design patterns - dont follow sample code, follow the philosophy of the pattern or approach
  • Try new things
  • Try innovative approaches
  • Error handling
  • Failure and recovery mechanism
  • Performance, scalability, memory etc

Apart from this, it is just a few assignments, instructions, branches and loops.

 

So do I want to spend more time working with the computer?Yes, I dont see anysigns of me giving up as yet. The fun has just begun.