Sunday, November 04, 2007

Shawshank Redemption

After a friend recommended I watched this movie. Well I had this movie with me, for more then 2 years, and had almost forgotten about it, until my friend told me about it. It is very worth watching. It has this nice build-up and sudden punch. After the first 30 minutes, the film, seems to drag a bit, but not much.

This movie made my weekend :-)
If you haven't watched the movie, don't read the wiki description, it gives away the plot !
http://en.wikipedia.org/wiki/The_Shawshank_Redemption

Tuesday, July 24, 2007

using Bit Fields

There was a question, as to write a program in C, which
when supplied 0, would print 1, and on being supplied 1
would 0. You are not to use, bit wise operators, i conditions, ternary operators. Below is my attempt at it.

#include
#include

int main(int argc, char *argv[])
{
struct packed_struct {
unsigned int f:1;
} pack;


pack.f = atoi(argv[1]);
pack.f++;

fprintf(stderr, " %d \n", pack.f);

return 0;
}

This works for me ;-)

Saturday, July 14, 2007

The Empire Strikes Back !

I was talking with a friend of mine, who is a
die hard softie(MS zealot), and I casually
mentioned that MS is going to go down, and cannot
survive the Linux onslaught. On hearing this, he
he disagreed, and said that MS is going strong,
and coming up with new things. He said for e.g.
see www.surface.com, he gave a brief, like they
have came up with a board, and if you keep your
camera on that board, all the pics from that
camera are transferred to the board, and on the
flick of a finger, you can transfer all those
pics from the board to your mobile camera.
I had a look at the site, and it was _amazing_.
I recommend you to have a look at it, it is
a breakthrough thing, and you will have a hard
time describing it. A truly breakthrough
innovation. I think after PC's and the mobile
revolution, this is one major innovation.
This is real sci-fi stuff.

Wednesday, July 11, 2007

Coding in Pre-Internet days

Nowadays, it has become a common practise among programmers,
to search google for any problem they face. Recently one of
my colleague asked me, hey how did people used to work, when
there was no google (read WWW and search engines). Since I
was busy with something I didn't thought much about it.
Later, while pondering over the discussion, I remembered, in
the pre internet days, programmers used to rely much on
manuals, even now, many of the veteran programmers who
started coding prior to launch of www, do rely on man pages
a lot.

Also it came to my mind, that earlier when a naive(basic/
stupid) query was asked, the answer used to be RTFM (Read
the F* manual), which has now changed to STFW(Search the F*
web) Times have changed, and so have the acronyms :-)



Luckily or unluckily when I started learning C, and Unix,
around 97, our lab didn't had access to internet, and hence
I had to rely on man pages, and that was fun. So it feels
good to be part of both worlds (rtfm and stfw :-)

Thursday, May 17, 2007

Switching to FireFox

So alas, I shifted to using FireFox from using Internet Explorer(IE). The reason
for the shifts are manifold. Well I started using Linux desktop, and well
firefox was the default browser in the distro I was using, and it wasn't
so bad I thought :-) So I got used to using firefox, and contrary to what
some so called "experts" claim, you don't have to be a geek to use firefox.

On my windows machine, I upgraded to IE7, and I saw that IE7 had support
for multiple tabs. Wow I thought, now that would make IE better. But
discovered later, that organizing favourites in IE is a nightmare now. I
have a pretty big list of favourites, and when I want to add a link to a
deeply nested directory, IE7 makes that a nightmare. Another good
feature that IE cannot handle well is increasing font size by pressing
"Ctrl +" keys. IE increases the horizontal screen size, when you try to
do so, due to which you get a horizontal scroll bar, which is quite
annoying sometimes. FireFox doesn't increase the size horizontally
and handles that pretty well.

Another feature is while browsing sites which present security
certificates. Firefox allows you to accept certificates permanently, so
that you aren't asked again for accepting certificates everytime
you browse the same site again. IE instead makes it harder, even
if you accept a certificate, and it doesn't understands the
certificate, or rather the certificate is not from some trusted authority,
it would keep on telling you that the site is untrusted and do you
really want to access that page. Also the button for saying "yes" is
red in color, and is pretty non-obvious. Adding to IE's pain points.

I like apps which consume less memory, and if you use the Multi
tab feature in IE, IE starts to hog a lot of memory, which makes
the system slow.
And if you browse through a zillion sites in half an hour, right-click
stops working in IE and sometimes even in Windows, and bizzare
things starts to happen, unless you restart IE.

With all these annoying features in IE7, I thought I better switch to
Firefox, and stop this "feature discovering" exercise on IE :-)

Also Firefox comes with a lot of cool extensions, to make browsing a
lot of fun. So goodbye IE and welcome to FireFox !

Tuesday, May 15, 2007

Software Documentation

While working on any software project, while talking with people the first question that most people ask is where is the documentation, or manual. Most of the people expect good documents of the software to be there, so that they can spoon feed. However while working on UNIX, which follows the philosphy of "code is the documentation", such a question really sounds stupid sometimes. Particularly in this age of google. When my team members asks me this question, it peeves me sometimes. There is a good reason for that. Most people hate to document their work, but at the same time expect documents to be ready for them. They fail to realize that they are part of the problem. However common sense is not so common :-)


The need for documentation => But good documentation is a vital component of software engineering. I make it a habit to document much of the stuff I do, that helps me, when I want to look at those topics again, and even while preparing my status reports. I heard this is a part of personal software engineering :-)

Today's Scenario => Apart from the manual's, in todays world, the online forums/mailing lists are a big boon, and they act as good pieces of documentations. Many queries, which a book simply cannot take care of are easily answered on a mailing list. In fact most of the time, the queries are already asked and answered by some expert on some forum or mailing list.

Enthusiasm the key to achieve success

Maintaining one's enthusiasm is one of the most
difficult thing for a human being. There is a famous
quote by Ralph Waldo Emerson,
Nothing great was ever achieved without enthusiasm.

So true. Enthusiasm is one of the most important
quality that one needs to achieve success in life.
However it is not only enthusiasm, I would like to
prepend it with the word "unlimited". Having
unlimited enthusiasm is important. Many times,
we don't start a venture simply because we don't
have enough enthusiasm. So ensure that you
have enough(well unlimited) enthusiasm in you
so that you can achieve your goal.

Is google cheating ?

Recently saw that he serach results provided by google,
have "sponsored links" at the top. These links are
being marked in a different color. But the color usually
used is very faint, and it is not so obvious at first time,
whether the link is an ad or not.

Earlier google used to put the ads in a column, on the
right side of the page, they still do, but it seems to
generate more ad revenue, google, is now putting
them at the top of the search results. Today they
are putting 2 results, some day later, they will
increase it. Think of it, by default 10 results are
displayed. 2 ads for 10 is about 15%. And you thought
google was ethical ?

Thursday, March 22, 2007

Do we need SEZ's ?

There is a lot of debate going on in
India about SEZ(Special Economic Zone)
SEZ's are being projected as an elixir,
which will give a huge impetus to the
Indian economy.
Big industrialists are pumping in huge
amounts of money in lobbying to create a
favourable atmosphere for SEZ's.

What is an SEZ -> As the name suggests, it
is a piece of land, running into thousands
of acres. This area would have special
labour laws. The industries operating
inside these SEZ's would get huge tax
benefits. There would be housing complexes,
malls, restaurants, movie theatres, etc in
SEZ's. One salient feature of SEZ's is
that govt would be acquiring land, mostly
from farmers for SEZ's at supposedly
throw-away prices and simply evict the
farmers. More on this later.
In short SEZ's would be like leeches on the
economy. They would enjoy benefits from
India, without much obligation to pay
back. SEZ's are promising huge employment
opportunities, for getting these benefits.

Do we need SEZ's ?
To take care of industrial development,
each state in India has got a state
Industrial Development corporation, which
creates industrial areas, and take cares of
the infrastructure needs of industries.
Also to take care of export oriented
industries, most of the states have EPZ aka
Export processing zones. Industries under
these zones, are given import duty benefits
under the condition, that all their
products would be exported.

SEZ's are supposed to enjoy the benefits of
EPZ's but not the responsibility, i.e. the
export obligation won't be there. This
would give the industries in SEZ's an
unfair advantage over companies, which are
operating outside SEZ's. This question is
still largely vaguely answered.

Opposition to SEZ's
Opposition to SEZ's is from several quarters
- farmers
Farmers are asking, why should they be
displaced ? A fair question. If someone
comes at your doorstep and tells you to
leave your house, and get relocated what
would be your re-action ? The situation
gets more complex, when you consider that
the livelihood of these farmers is their
very own land. Their skills are in
farming, and they have a lot of attachment
to their land. Govt and the SEZ lobby
wants the farmer to learn new skills, and
be part of the industries under SEZ. This
is like telling a software professional
to start working on a farmland. So
outlandish, and absurd ofcourse.

- Economists
Some economist, are questioning, whether
SEZ's will really help India. A report of
a recent SEZ has shown that the company
proposing that SEZ had earmarked 45% of
the land for housing and related things
like malls, etc. And 55% for industrial
activity. So the real motive is to create
hosuing enclaves under the facade of
industrial development ?

- Credibility
There is a huge question on the
credibility of private players. In the
past private sector has been largely
socially irresponsible. So it remains
to be see, if the private sector, can
really achieve the stated goals of SEZ's,
rather then becoming real estate
companies.

- Area of Land
The size of land that these SEZ's are
demanding are raising serious doubts,
about their real motives. Thousands of
acres of land is being ear marked, without
a real need for it. In fact the actual
need is only a fraction of the land
that is being demanded.


There have been violent opposition to SEZ's
from farmers, and they have a very good
reason for it. The govt is behaving like a
dictator, and caring less for the
farmers. The recent spate of demonstrations
by farmers in the state of West Bengal and
Maharashtra, have put the state governments
temporarily on a backfoot, and they have
softened a bit. Lets see what happens next.