Search

Tuesday, August 10, 2004

I figured out that though my web-site is that of a programmer it has very little stuff to do with programming. So I decided that I'm going to change this!!!!

So my site http://www.geocities.com/basuabhinaba/ is updated with a Code link on the top. I plan to update this regularly with interesting code snippets and other programming stuff. I have already put up some stuff. Lets see how it goes.

Every time I update my site I feel I need to go and get a domain name registered. I am too lethargic to actually do this. Lets see how this goes through!!!

Saturday, July 24, 2004

I have heard of the famous urban legend that NASA spent millions of dollars to invent a pen that could be used to write in Space. In space there is no gravity and so the common ink filled pen will not work because gravity will not pull down the ink towards the nib. When NASA was spending this money on the pen research, Russia went ahead and used pencil instead. It served the same purpose at no extra cost!!!

I got it from a book that the site
Fisher Space Pen Co. - Engineered for Better Writing
is of the company that invented the pen for NASA.

The prices on this site says $130 for a pen. That is approximately Rs.5850 in Indian currency. This will be more than the average monthly family income for most Indian household. Even by metropolitan standards that is almost equal to half the salary for a lot of people.

Friday, July 16, 2004

I friend asked me this question.

Write a C++ program that prints "Hello" hundred times without using any loop or recursion statements and obviously without writing the printing statement hundred times.

And the solution is



#include
using namespace std;

class Show
{
public:
show(){cout <<"Hello" << endl;};
};

int main()
{
Show s[100];
}



I just do not know why someone will ever need this but found it very amuzing. He even went as far as to optimize it by adding the same cout << "Hello" to the destructor and only creating 50 objects instead of 100!!!!!!!

Wednesday, July 14, 2004

C++ - Stop people deriving from your class

One of my friends was facing a problem while trying to write a class B so that no one would be able to inherit from it. He used code as below.



class B; // forward declaration

class Prot // this class is used to stop the inheritance
{
public:
friend class B; // allow only B access to ctors
private:
Prot(){}; // make all ctors private
Prot(const Prot &p){};
};

// class that cannot be inherited from
class B: public Prot // inherit from prot. Since B is friend of Prot it'll work
{
public:
B();
int a;
};

class D : public B
{
public:
int d;
};

D d; // this should fail




However D was still able to inherit from B. What he missed was using virtual inheritance for inheriting from Prot as follows


class B: public virtual Prot // inherit from prot
{
// ...
}

this lead to the bug. Without virtual inheritance the call does not go via the vtable and D is able to access Prot's ctor as it is merged with that of B.

Tuesday, July 13, 2004

We knew MS primarily as a secretive organization who is always fighting off Open Source and GNU. But these days they have really gone open thoughts if not open source. Most of them including architects like Herb Sutter have blogs on the net where they speak there hearts out (or is it??)

Check out the following blogs

Brandon Bray Blog
Herb Sutter

Brandon has a nice little piece on the justification of introducing the ^ into C++.
Amazing blog. I don't know from where she(??) gets these links. http://www.stormwerks.com/linked/

Monday, July 12, 2004

I use the CodeProject a lot. One of the maintainers of the site happens to be an Indian who has a interesting blog at http://blog.voidnish.com/

His site http://www.voidnish.com/ is also kinda interesting. May be I'll go and get a domain name for myself one day. Lets see.....

Thursday, July 08, 2004

Give it back

Programers face a slew of problems each day. We either solve it ourself or search the net for resources that better equip us to solve them. The resources could be reference material, books, articles, code snippets or even full fledged application whose source have been given out by a developer.

Some of us take time to thank the kind soul behind the resource via email, but most of use just take it for granted that they are just available. Some even look down upon them considering them as show-offs but still use there material anyway!!!!

But is it not our duty to also give back, from where we are getting so much for so less (actually free). I think it is the moral duty for all developer to give back something to the online developer community. You can always try sites like CodeProject.com or CodeGuru.com.

Wednesday, June 23, 2004

I am not too sure on what Microsoft is doing to C++. They add scary stuff like __gc, __property to VC.NET and now in the VC++ 2005 they are calling these cumbersome and doing away with them. Lippman has also joined them and startted adding operator like ^ !!!!

With new operators, limitations on their usage and so many intricacies, I'm really concerned on how far these tools can be used on large multi-million lines of code projects!!!!

Wednesday, March 03, 2004

Windows Vs UNIX

To prove that you are a Techie the first thing you must do is abuse Windows and prove how instable and insecure it is.

I have worked on Windows and Linux and tiny little bit on Solaris. I was amazed at the strategy of Windows. When the UNIX developers were just concerned about coming up with an OS as secure as Fort-Nox, as stable as the Great Wall of China. MS came out with this lame OS which just allowed users to do anything they wanted and crashed when a person sneezed in the next room.

Yes UNIX is a great OS; it’s so secure that the common users cannot get in!! So they just turned and went for Windows where they could do just what they wanted without knowing how to mount file systems and what permission levels are and what an inode has to do with it.

So MS got all the dollars whereas UNIX vendors fought to make their stuff as secure as possible. Then one day everyone suddenly realized that MS has all the money in the world to now start securing and stabilizing their OS and still everyone will stick to them, cause they cannot go anywhere else, as they are so used to it and have billion of dollars in investment binding them to it. This realization has made the UNIX vendors who used to say that command prompt rules and to run for developing a GUI. But I guess its already too late.

Even from an application developers point of view developing and debugging on Windows is so easy. I have worked on cross-platform products and have seen people try to do the same thing on UNIX as I was doing on Windows!!!!

Anyway, may be I'm proving my self to be a non-techie cause I do not prefer gdb over VC++ debugging environment or consider vim as gods gift to mankind.

Saturday, February 07, 2004

BPO and Indian youth

The advent of IT age was a great boon on the students of India. Now they could stop cribbing that there is no money for the highly educated youth and that business is what takes you places.

Even then IT jobs, specially the ones in the MNCs and in the Indian giants like TCS and Wipro were accessible only to the engineering graduates. So the rule was simple, either get an engineering degree (preferably Computer science) or ...

With the advent of BPO things changed. India has an army of English speaking graduates. So the mere fact that they can converse fluently in English got them a job with a 5-7000 rupees salary. Though this is not much, but good enough for most fresh graduates to buy financial freedom.

I met a guy from Jalpaiguri. If you do not know where that is then don't be surprised most Indians do not. Its a town in West Bengal at the foot hills on Himalayas. He did graduation in Commerce. Then a recruiter went to their town(!!!!) and took interviews and he landed himself a job in Delhi. He is now in the collection department in Dell, calling people all over US asking them to pay up their dues.

This is amazing; couple of year back he would have to be content with finishing his Masters and then running around offices looking for jobs in Kolkata. After a lot of perseverance he would have got one as a sales representative. Which gives me another thought, how many sales representatives in US or the developed countries have crossed high school !!!

Friday, February 06, 2004

Bangalore vs Noida


Having come to Noida from Bangalore, there are a lot of difference that I see.

For one Bangalore's weather was great. Its called the air conditioned city. In the same lines Noida or Delhi should be called the Freezer that comes with a free griller.

The aura in Bangalore is also great. You can smell computer and software in the air. You step into a road side dhaba or resturant, irrespective of the shabby interiors, you are always sure to get a guy from GE, DELL, Oracle, Intel or Texas Instruments in it. If you step into a pub it is generally filled with people from BPO and service sector companies like Wipro or Infosys. Generally people with very good background in academics make it into the high profile companies and they are on the timid side and venture less into the pubs. The are the docile type. Not that there are no exceptions.

The local Karanaticas are also very nice people. Unlike most other south indian states they do not have opposition to use Hindi and are fluent in it. They are educated and you may be surprised with the quality their English speaking.

Bangalore expanded too fast. It was a city for the retired army and governemnt officers. Its roads and design were far suited for a quaint old Portuguese town than an IT hub. Its now stretched to its limits. People do not buy car because they do not want to take the botheration of parking it 1 mile away from the destination and walking the rest.

Noida being more planned and a young city does not have these issues. But the issues it has other than weather are many. For one lack of education, civic sense, make it dificult to live here. Administration is also poor. It is cheaper than Bangalore in many respects and you get decent appartments at affordable rents. But the restaurants are really expensive.

All in all I'd prefer Bangalore to Noida any day. You just need to have a car in Bangalore and stay a little outside the city.

Thursday, February 05, 2004

I was hearing about this blog thing every where. One of my colleagues told me that I have lot of strong opinions and views. He suggested that I blog. And so I started.

What I will be blogging? My views and opinions about Indian, Bengal, computer engineering and life in general.