Sudarshan Gaikaiwari

There will be some changes made

Sudarshan Gaikaiwari header image 4

A simple rule

June 13th, 2007

Log errors. If you call an API and it returns an error code. Log the error code.

Ideally at the verbose level also log the parameters to the API but in any case log the error. This means for every API that you call you must first check for an error. I wasted half a day of my life troubleshooting code that failed to follow this simple rule.

Tags: No Comments.

The new Updated windows Live Writer

June 12th, 2007

Time to experiment again. This post was created with the latest version of Windows Live Writer.

Here is an attempt at embedding code

#include <stdio.h>

/* the n-th fibonacci number.
 */
unsigned int fib(unsigned int n) {
  unsigned int a = 1, b = 1;
  unsigned int tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

main() {
  printf("%u", fib(10));
}

Since I had some problems entering code with the wysiwg editing capabilities of Wordpress I want to see if Live Writer does this better.

Tags: 1 Comment

C++ function resolution

May 24th, 2007

I earn my living writing C++ code these days. Everyday I learn something new and interesting about this language. Many languages have a simple core, if you understand a few basic principles you can understand how most of the language works. C++ has a lot of esoteric features and no guiding principles that to borrow a term from human computer interaction allow the programmer to develop expectations. I think the reasons for this are historical.
Reading Lippman’s Inside the C++ Object model and Stroustrup’s Design and Evolution of the C++ Programming language I am amazed by how much attention was paid to match C in performance

f()
{
   a.f()      // resolved at compile time (not polymorphic)
   p->f()     // resolved at runtime
}

The static resolution is a feature. The C++ compiler writers were trying to avoid the single instruction cost of vptr dereferencing. For a programmer this means that just marking a function as virtual does not mean that the most overriden version will be invoked. To ensure that every invocation must also be polymorphic. Also there is a principle at work here. You do not have to pay for what you do not use.

Tags:   · No Comments.

Asempra Product Review

May 21st, 2007

I work at Asempra as a software developer. A few days ago I saw that someone came to this blog searching for “asempra product review”. This blogpost is just to point such people to asempra.com.

That being said I am surprised that this blog ranks high enough to be shown in the result sets for such a query.

Tags: 1 Comment

My parents went to Leh Ladakh

February 17th, 2007

and all i got was this article ;-)

Leh_Ladakh Article 1

Leh_ladakh Article 2

Tags: No Comments.

More Self Esteem

February 14th, 2007

From Overconfidence —> Incompetence Humility —> Success

You don’t want to be demoralizing, needlessly tearing at the fabric of your self-esteem, but at every turn, you do want to be saying: “Well, that’s not quite good enough — I can do better.” In fact, it seems to me that you want to attach self-esteem to the process of becoming better, instead of letting it become attached to any static result. That way, you can be critical of a performance and not become demoralized about what it says about you as a person. The self-criticism actually becomes a self-esteem booster because you feel good about doing the hard work to constantly improve.

Tags: No Comments.

The South

January 31st, 2007

It’s a place where some hicks still proudly fly a flag from a war they lost in order to keep their slaves.

Wil Shipley

Tags: 1 Comment

Nationalism

January 27th, 2007

I think nationalism is a disease and it’s a disease that has really hurt the world.

Nicholas Negroponte

Tags: No Comments.

New post at Valleygeek

January 22nd, 2007

go check

Tags: No Comments.

The action is somewhere else

January 17th, 2007

Posting here is going to be even more infrequent. Check valleygeek.org to see what I am upto.

Tags: No Comments.