Wednesday, January 30, 2013

It's 1500!!!

Page view count on this blog is 1500 at this very minute! Yipeeeee

ORA-01882: timezone region not found

If you get the following error when you try to connect to your Oracle db from SQL developer (or from any other entity)

ORA-01882: timezone region not found

The reason is that time zone is not set in java opts (Obviously!)  You need to set it.

In SQL developer go to

opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf 

And add,

AddVMOption -Duser.timezone="+05:30" (Your time zone)

Monday, January 28, 2013

Two types of girls..


There are two types of girls, One type who are toughened by circumstances and hardships, who have been out there in the world alone, who have fought battles and worked their way up in the hard way.
They are independent and strong. They may not care much about uncombed hair or unironed clothes, because they know better than to think that a girl's value is in her looks or in the gold she adorns. They may not be graceful in their ways or poised in their speech since they simply never had time to polish themselves up.
And then there is the type who get everything served to them in a silver platter. Those who are spoiled by been waited upon and their every whim been catered to, who never had to move a hair to get what they want.
They are escorted to wherever they go by doting parents. They get annoyed when their wishes are not fulfilled at the rate they want. They are groomed up to be “feminine” in all their ways.
I've always found that it's the first category that can be true friends. But it's a pity to see that the second is the type that is mostly admired in this country.

Why should being feminine should be synonymous to being fragile?

Friday, January 18, 2013

Dealing with a Legacy Codebase

As software engineers we don't always get to work on clean slates.

At one time or another, we all get to deal with legacy code bases. Eventhough they may look like scary daemons at the first sight, they can be fun and they can teach us a lot of things. 

We all love to see clearly written, easy to read, properly formatted, well maintained code that are well aligned with all design standards imaginable and backed with clear and up-to-date design diagrams, architectural documents, requirement specs etc. But such legacy code exists only in the day dreams of developers. In reality, no matter whether you're in silicon valley or in a outsourcing company in far east, what you get is a soup of technologies, very very lengthy classes with bug fixes creeping in and messing up the original design whatever it was. You'd be lucky to find any documentation. And even the domain knowledge is tuned into software folklore that are passed from developer to developer and lost when people leave.
How do you get to know a legacy code base in practice? 

Bug fixes & Debugging 

One of the best hands-on-approaches to learn a foreign code, is to fix something in it. A bug will give you a purpose and a direction. The more you go wrong, the more you learn. Following the code along with the variables through debugging gives a good idea about the code.

Reverse engineering the design

There are tools that allow you to create design diagrams based on existing code. These diagrams help you to visualize the overall picture.
You can draw class, sequence diagrams by simply dragging and dropping the classes. ObjectAid is a free Eclipse plugin that allows you to do that.
More advanced tools would generate the diagrams when you run the functionality.  MaintainJ is one such tool that gives some of the functionality free. It's a Ecplise plugin again.

Use of profiling tools

Profilers generate the call tree along with the times spent at each step. You get the class/method stack that gets called when you run the program. It's a great way to find out which classes and which methods gets called in a given scenario.

History and folklore

There is a wealth of knowledge floating around that is not included in the code or in any of the documentations. These exists in the memory of the people who had been dealing with the system for some time.
There are pretty interesting stories about why a certain functionality had to be implemented that way and not in a different way etc. "Long time ago when dinosaurs roamed the earth there was this requirement and we did this to cater for that, hmm nobody needs that any more, but we never had the time to remove it", Dead Code?, yeah don't be surprised if you find skeletons and cemeteries in your code base!
Talking to people and getting to know all this background details is critical, and the juicy bits in the stories actually make all the technical nitty gritties stick in your memory.

Thursday, January 17, 2013

Eclipse Plugins : JVM Monitor

JVM Monitor (http://www.jvmmonitor.org/)  is an excellent tool for generating a call tree for a functionality. It's an Eclipse plugin and is actually a java profiler.

Install the plugin from the update site
http://www.jvmmonitor.org/updates/3.8

Once you install the plugin you get a new perspective called "Java Monitor". In that, there is a Explorer which lists down all the JVMs. Right click on the JVM you want to monitor and click start monitoring.



In the properties window there are several tabs, select the CPU tab as shown above and click on “select profiles Java packages” which opens up a window that allows you to select the packages that you need to instrument.

Once selected, you can see the “run” button in green which says “Resume CPU Profiling”


Click on that and it will start generating call tree for all the threads in that JVM using the instrumented classes.

You can click on the “pause” button to stop.

What I usually do is have debug points before and after the functionality I want to learn, run a test, start monitoring when it stops at the first break point and stops monitoring when the second break point is reached.


You can save this and it will generate a .cpu file that can be used for later reference. You can easily search through the call tree and see what classes are called.

Wednesday, January 16, 2013

Help me choose my Linux

Number of Linux/BSD distributions available out there can be overwhelming. These can vary in number of aspects, and selecting the perfect distribution can be a hectic task.

This is a website that compares features of Linux, BSD distributions and provides a wealth of information on the subject.

http://distrowatch.com/

Top 10 distributions as per this site are detailed here.

It also contains a long list of open source software here.

Tuesday, January 15, 2013

Mystery Solved

I was wondering how the hell I was getting so many page views for this one small blog post within a very short period of time.

Stats showed following URL as the traffic source of so many page views, URL was leading to my blog post. And the referring site "t.co" is actually twitter :)

http://t.co/Qf74yIRQ

Now I have never tweeted or have visited twitter. Then I googled the URL and was given two search results. And that led me to this,

Someone has tweeted my post :) :)

 And the someone is,




And the discussion has continued..































Now isn't that cool!!!

Monday, January 14, 2013

Surprise Surprise... :)

I started actively writing this blog in April 2012, so it's like 9 months old by now. I had kept it anonymous so far and hadn't linked to it from facebook etc (Might do it after some time) I've received one comment :) and 400+ page views by yesterday. It was actually the page view count that kept me motivated writing it. I was thinking of a little celebration once it reaches 500.

Today first thing in the morning I dutifully log into my blogger account and I was in for a surprise. Page count has gone up to "933" :-O and it was due to 410 views received yesterday for a one very short post (which was actually an extract of a book as I have mentioned there) Now I wonder if this is a mistake or is it because this was mentioned some where with a large group of people and everyone clicked on it to see it. hmm anyway it's nice to see a high page count no matter what. Ahh and also comment count has increased to 2 :) (It has doubled now, hasn't it)

The post is How many open source developers does it take to change a lightbulb?

Being a girl...

I came across an interesting blog post while I was casually and aimlessly browsing the net to kill some time.

The author is a lady as obvious from the article name (My Experiences as a Female Software Engineer) and being a female in the same field, I can strongly relate to what she had written.

The site in which the blog was posted gave almost no information about this lady, Jean Hsu, and I did a bit of Googling out of curiosity. It was a bit tricky since the name seems to be a common Asian name with 25 professionals in that name been listed on LinkedIn alone.

Anyway managed to find that she is someone all lady software engineers can be proud of :)
Jean Hsu co-leads Android development at Pulse and has helped to grow the Android userbase from a quarter million users to over 2.5 million. Before she entered the startup world, she worked at Google on P2P payment experiments. Jean holds a Bachelor’s of Engineering in Computer Science from Princeton University.

Her blog post an eye opener, so it wasn't only me who was feeling this way.
"Something that frustrates me about the field of computer science is that there are a lot of jerks who think that just because they’ve “mastered” some programming language or know some obscure unix commands, they are gods and you are nothing."
"One of the challenges for me while I was at Google was to speak up when I didn’t understand something, as I often assumed it was common technical knowledge and that people would pass judgment."

Read it here..
http://www.jeanhsu.com/2011/01/17/my-experiences-as-a-female-software-engineer/


Thursday, January 10, 2013

A little inspiration, anyone?

The Reasonable man adapts to nature. The unreasonable man seeks to adapt nature to himself. Therefore it is only through the actions of unreasonable men that civilization advances.
-George Bernard Shaw
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
I've learned, the hard way, that some poems don't rhyme, and some stories don't have a clear beginning, middle, and end.  Life is about not knowing, having to change, taking the moment and making the best of it, without knowing what's going to happen next.
-Gilda Radner
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Any fool can make things bigger, more complex, and more violent. It takes a touch of genius—and a lot of courage—to move in the opposite direction.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
It is never too late to be what you might have been.
–George Eliot
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
That which doesn’t kill us makes us stronger.
-Friedrich Nietzsche
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Believe you can and you're halfway there
-Theodore Roosevelt
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary
-Steve Jobs

Wednesday, January 9, 2013

How many open source developers does it take to change a lightbulb?

The answer is: 17. Seventeen to argue about the license; 17 to argue about the brain-deadedness of the lightbulb architecture; 17 to argue about a new model that encompasses all models of illumination and makes it simple to replace candles, campfires, pilot lights,and skylights with the same easy-to-extend mechanism; 17 to speculate about the secretive industrial conspiracy that ensures that lightbulbs will burn out frequently; 1 to finally change the bulb; and 16 who decide that this solution is good enough for the time being.

:)

-Free for All by Peter Wayner

Free For All

I was born in 1983.
Little did I know that I was born in a such a significant period in the software history.

In a different world to where I was born, programmers in universities shared the software they wrote. Sharing the software meant sharing the code. But things took a turn when it was found how to lock up the source code to a program by only distributing a machine-readable version.

In the early 1980s, an operating system known as UNIX had grown to be very popular in universities and laboratories. AT&T designed and built it at Bell Labs throughout the 1970s. In the beginning, the company shared the source code with researchers and computer scientists in universities, in part because the company was a monopoly that was only allowed to sell telephone service. UNIX was just an experiment that the company started to help run the next generation of telephone switches, which were already turning into specialized computers.

When the phone company started splitting up in 1984, the folks at AT&T wondered how they could turn a profit from what was a substantial investment in time and money. They started by asking people who used UNIX at the universities to sign non-disclosure agreements.

University of California at Berkeley had developed a version of UNIX known as BSD (Berkeley Software Distribution) and they wanted to keep it free and share the source code. They had contributed lot to unix and it was difficult to decide who had copyright to what.

AT&T and University of Bekerly went for a historical legal battle over the usage of UNIX

When I was one, Richard Stallmean left the Artificial Intelligence Lab of MIT where he worked and he founded the Free Software Foundation. He didn't like the idea of locking up source code at all. He wrote the GNU ("GNU's Not UNIX") Manifesto and created very advanced tools like the GNU Emacs text editor to be distributed with the source.

While I was going to primary school in this part of the world, a poor student was writting a little toy program in Finland. His name was Linus Torvalds and he named the OS he created as Linux. He created a working system with a compiler in less than half a year.

Professor Andy Tanenbaum, a fairly well-respected and famous computer scientist, got in a long debate with Torvalds over the structure of Linux. He looked down at Linux and claimed that Linux would have been worth two F's in his class because of its design. :)

In 1998, a group of people in the free software community created a new term, "open source." To make sure everyone knew they were serious, they started an unincorporated organization, registered a trademark, and set up a website (www.opensource.org).

After 3 decades, in my part of the world I'm typing this blogpost in my office laptop with linux in it. Open source surely has come a long way!