Monday, August 4, 2008

Ubuntu vs Mac OS

So I recently bought an iMac, and I love it! I still have my dell laptop which has Ubuntu on it. Funny thing is that I recently switched over from OpenSuse to Ubuntu. IMO Ubuntu was easier to install from OpenSuse. Of course taking into account that I had installed OpenSuse on a purely Windoze box, all the fun stuff involving partitioning was already done for me. Anyway I did spend a few weeks with Ubuntu installing software and configuring my desktop so I do have some sort of an experience with it.

So If I have a laptop, why do I need another personal machine??
I have always wanted a machine with Mac OS on it. I used the Apples sparingly at Emory, but never truly got the hang of it. Ever since my husband got a mini, we sort of started replacing all our machines at home to either Apple TVs or Mac minis. I never really had the need for another machine since my Dell was good enough for all my side-project development machine. Or let me rephrase - I was happy with my laptop for the last 4 years. I do have a few issues with my Dell right now - I can't test out my web apps on Safari/IE/FF, Its not very fast (tops out at 2G RAM), I don't have a fancy text editor(tried to pimp up gedit to emulate textmate), and well I really wanted a change in my OS.

This last weekend was the tax free weekend. We stood in line at the apple store and were taken care of pretty quickly. After 20 minutes, I was the proud owner of an iMac **and** a free iPod touch! The iMac, designed by Apple in California, is a simply amazing design - the monitor has the entire computer inside it and its still not that thick. The speakers are not bad and I have enough USB ports on the back of the monitor - very sleek.

Once you get the hang of using an Apple machine with the funky Mighty Mouse, and learning your way around the Expose and the million keyboard shortcuts, its a pretty straight-forward OS to interract with. The only thing I might want to complain about is the lack of focus-follows-mouse support in the windows manager. Ever since my school days of playing around with Enlightment, I have been addicted to this very customized preference.

Anyway, other than that, here is a list of differences I see between Mac and Linux -
  1. Ease of installation of software - On Linux, installing a software or application is not the most complicated process, but it takes time - the basic steps are downloading the binary or the tar ball, unzip it, make it, and then copy the files over to /the/proper/location. On an Apple, all you do is download the mac-os-version and copy it to Applications. Thats it - how easy is that.
  2. The Dashboard - On Linux, you would probably need to start up all these applications in a different desktop - there is no dock like functionality. On an Apple, its always there at your beck and call . I like using it without the need to crank up the date app or the calendar app or the weather app.
  3. Fluid - There is no way that I can explain how convenient SSBs are!! I have facebook, hahlo, jango, zimbra mail all opened up as its own little application. There are neat scripts that make the GUI look better and I don't have to bother about whether one app might cause a crash in another. So sure, I could open up different sessions of FF but it is not the same experience. Also, fluid is based on the Safari technology, its a lot faster.
  4. TextMate - Eclipse is way too bloated to code. If I am not writing java code, Eclipse is more of a hassle to use than anything. Textmate is so easy to use, so many different templates and such a simple interface.
  5. iTunes - I have tried to use amarok to sync my ipods. It hasn't been a complete disaster but its not intuitive. iTunes does it the best!
  6. Prettier fonts/design/layout/shadows/GUI - Need I say more - its just prettier!

Hopefully I can code up the next-earth-shattering application on my new beautiful desktop, and then this purchase would be justified!

Wednesday, July 16, 2008

Grit Documentation

Grit is a Ruby library for extracting information from a git repository in an object oriented manner.

I am trying to use grit for a simple project - basically provide a GUI for git. Eclipse does a good job for CVS and SVN and gitk doesn't do a good job with git. It sounds like a good idea, and I really am all for git. Other than a few irritating things about merge, git is a pretty kewl tool.

So for this simple project, I am using mojombo-grit (and Ruby on Rails) to look at the tree/branch structure of git commits. Its pretty straight-forward but the API documentation is not that great. Its just not laid out intuitively and IMHO not easy to understand to follow. I like their example on the home page, which starts you off easily. But then after that, if you have to get more information on (say) a branch, then the doc doesn't do much for you.

Looking around for a better take on the documentation ....

Thursday, May 29, 2008

GIT

A couple of reasons have led me to play around with GIT. I have had experience with CVS and Subversion. I use CVS at work, and use Subversion for my personal projects. Both have their pros and cons, and I heard a tons of good things about GIT. Linus wrote it and uses it for the kernel development - that's good enough!

After a ton of reading up on it, and watching
Randal Schwartz's presentation on git, I was inspired to get git and use it. It hit the spot - I have always had a few issues with the source code management systems out there and git supposedly has thought of everything -
  • So here's a typical scenario - I checkout the source code from the HEAD at my work repository. I want to refactor it but don't want to break anything. I just want to change a few things, make them more efficient ( yea right! ) and basically try out a coupla things I couldn't try out earlier due to deadlines. So I edit code, play around with some kewl new technology, refactor it. By the end of the day, my editing has been finished. But its not perfect and frankly I rather not commit these changes since I really don't wanna break the code and/or I don't want the rest of the world to know I made these changes! So the only option left for me is to delete these changes ( or make a local backup copy ). I will have to start working on the main branch again, I guess I'll have to forget about this entire day's of work. The problem with that is that I have lost my work; however trivial it was. Hence the concept of a distributed version control system appeals to me. I clone the repo and play around all that I want. Ooo the concept of private branches...

  • Another interesting feature of distributed development is that since you "clone" the repo to your hard disk, you always end up having the entire repo, the history of each and every file - all readily available. You can work on it offline, and commit it only when you are absolutely ready. This also helps when more than 1 person is working on the same piece of code, and needs to be able to make changes all the time.


  • Every time I have to work on >1 different branches of the same project, it is always a hassle. I don't know of all the .cvs ignore files that are lingering around, and I always make mistakes committing my changes. I tried out git and tried out checking out 2 different branches. I tried out editing them, and then checking those changes in. Wow, that was simple! It really is very intuitive and the non-polluting of any sub-directories makes it so easy to learn and use git.
Git also delivers on a few other things - these weren't amongst my initial requirements, but are very useful now.
  • For legacy humans ( ;) ), git has a "backwards-compatibility" feature to work with cvs clients. The end user does not need to learn 5 extra git commands, and can use cvs-style commits/checkout/branch to basically use git. I guess in my company, if I was trying to push Git, this would be an awesome plus-point!

  • Git has funky merge and rebase features for tons of different users working on the same code. Merging is always a nightmare, and its not too bad with git. Of course you are going to break something somewhere, but thats what a developer in a team has to go through!

  • It has to be real fast - the linux kernel has 25000 files
After using git for a few days now, I feel like I need to use it in one of my personal projects. I have been looking forward to working on something exciting.

Think Globally, Work Locally.....

Wednesday, January 2, 2008

OutOfMemoryError: Java heap space

Ugh memory leak! This is what I encountered a couple days ago at work. My java application is not too complicated - parsing data, normalizing it, and then inserting into the database. Its a kinda "critical" application and should always be chugging away. Its a a very random occurrence and I haven't been able to re-produce it yet. Sometimes I get this error after 1 day, sometimes 10 days, and sometimes none at all ( or like maybe at infinity ).

So one of the 2 causes of OOM is inadequate heap space - so I allocated more and ran the app, this time with the Xms and Xmx arguments. It ran for a longer time but again crashed with the OOM error. OK so time to look into the second reason - Memory Leak.

I looked around for a decent profiling tool, and downloaded JProfiler. It's free for 10 days and I hope I can figure out what the issue is before that. Installing it on my RedHat box was a piece of cake, but setting up the environment wasn't! Anyway, after setting it up, I started it. Way too cool!! ( Not the debugging/diagnostic part of the analysis ) I haven't really had experience with JProfiler so this is very new to me. The amount of data that is available is very impressive (and in pretty colors too ;) ). Tons of different views and graphs to help make the software more efficient and memory-leak free. Looks like I am going to be using the Heap stack view in my search for the memory leak.

Right now, I am familiarizing myself with this tool, reading up on what should be my best approach. It's more of an art to find the runway non-GC'ed variables than science! A couple of things I am going to take a look at - objects like String, HashMapEntry, Char, Long maybe a problem due to their growing numbers (but maybe thats valid ?), database connection pooling and result sets not getting closed properly....

I am looking forward to playing around with JProfiler, but not as much to finding this "random" memory leak.

Friday, October 12, 2007

Video Games

A sort of pre-requisite for being in the technology world is that one should be addicted to video games. I just don't get it though. Why would one want to spend tons of time (urm and money) jumping over hurdles, killing alien bosses just to save the Princess...I think its fun playing Wario Moves on the Wii, but playing Final Fantasy for 75 hours sounds crazy!

Let me try and list my issues with playing video games.
1. Time : I tried playing Zelda. I did put in a few hours. After that, I just got irritated. Sure I am not the most patient person in the world, but why "waste" all this time to learn a few jumps, how to swing your sword and how to correctly press A and B together to shoot.
  • I do understand that at least the gamer is using his brain and is not ideally sitting around and watching TV. But, if I want to use my brain, I will go work either on my own projects or on my day-job project. Either of them will be beneficial and no one can argue the useful-ness of using your time to "work".
  • Of course the gamer could just be playing a game because he's taking a break and wants to get away from work. Fair enough: so why would you want to get deeply involved in something that will take 50 hours to finish! How is that a 30-minute break? Like I have seen, its really never 20-30 minutes, its about reaching the Save Point and then getting addicted to finishing the damn boss!
2. Money: I am sure people are aware that even if its not a ton ( and yeah right coz the XBox is sooo cheap) of money, you do spend $$ on various different gaming consoles and the games itself.
After Halo1, I want to see how they did Halo2, and oooo Halo3 is out....I played Zelda5 years ago and now they are releasing it for the Wii, I have got to buy it!

Common, you guys have heard this before. I rather spend money on cool sci-fi books or music( maybe ) or something cool!

3. Addiction: People spend hours upon hours just playing and playing and playing! They want to get to the next level, and specially for MMPOG, people get crazily addicted to it. Being this addicted to anything can't be healthy!

Ahh maybe its just me and my short attention span, but hey, we are talking about developers and software engineers too who are probably really impatient, and yet spend hours on their gaming console. Sometimes, I do like playing with my friends and having fun with the graphics and the remotes and the controllers. But, I wish I could get really excited about standing in line for hours for the next big game. I would love to use the Wii remote as a LightSabre just for the ooo factor, and that would last for exactly 20 minutes!