Finally I have moved out of my old host canaca.com beacuse of all the difficulties I was facing with them. Even the IP address of my hosting server was blacklisted and they were not ready to do anything about it. I got pissed off with thier service and finally bailed out.
All the services are now moved to my new (virtual) server from VPSlink. Eventhough I bought this almost a month back, I had to setup and try various things before moving all my web services here.
I am running Apache 2, Exim 4.60, Spamassassin, ClamAV, Courier IMAP, Courier POP, Squirrelmail and other supporting services like SSH, FTP, finger, etc on Ubuntu 6.06. The reason for taking more time to configure these things is that I have only 512 MB of available memory and I have to make use of it efficiently. So, I had to tweak various applications to use minimal footprint of memory.
Also setting up Exim with SSL authentication and making it to use Spamassassin and ClamAV for mail filtering took a while. Thanks to the following links.
Finally I am happy that all my web services are running on a server to which I have full access and control (root) and all the services are hand picked by me! But I have 1 year and 3 months of hosting period left with canaca.com!
There is an official confirmation about the release date of Debian GNU/Linux 4.0 a.k.a. “etch” in the Debian announcement list. It is going to be released in December 2006. That is going to be pretty quick compared with the previous release cycles. Take a look at the announcement to get more information on the features planned.
I was debugging a malfunctioning code in my project. The part of the code that I debugged involved some endian based computations. I just guessed that there might be some endian based issues in the code. But when I looked into the details of the code, they have handled the endianness properly as follows.
#if __BYTE_ORDER == __BIG_ENDIAN
// Do some big endian stuff
#elif __BYTE_ORDER == __LITTLE_ENDIAN
// Do some little endian stuff
#elif __BYTE_ORDER == __PDP_ENDIAN
// Do some PDP endian stuff
#else
// Do something else
#endif
But when I did more investigation, I found that the big endian part of code is generated inspite of the fact that I am running it on AMD64. Can you guess the reason for this?
I too was puzzled initially. But the reason was so silly. The source file was not including endian.h header file! Because of this both __BYTE_ORDER and __BIG_ENDIAN evaluated to null and the condition #if null == null evaluates to true always. Funny!!!
I have applied for a Tata Indicom broadband connection and waiting for the connection almost one month. Everyday I call them on status they would say either the status is unknown or they will call me back. Nobody has called me even a single time. Finally when I called them today, they are saying that they don’t have port to connect me. WTF? Why on the hell then did they take my application? Here is the mail that I have shot them
For those who want to go for Tata Indicom broadband in Bangalore, I would say a big “NO!”. You would waste most of your time trying to reach the customer care.
Hello -
I have applied for Tata Indicom Broadband on 29/06/2006 (Application #
XYZ). I have not got the connection so far and it has been a real
pain the a** talking to your customer care everyday and asking for the
status. I really got fed up with the process. I don’t want to get a
connection from you and struggle with your customer care in the future.
*REFUND MY MONEY* I would never consider Tata Indicom again as an option
for an ISP and would never recommend to any of my friends.
Thanks but no thanks -
Praveen.
Your EQ is 133
|

50 or less: Thanks for answering honestly. Now get yourself a shrink, quick!
51-70: When it comes to understanding human emotions, you’d have better luck understanding Chinese.
71-90: You’ve got more emotional intelligence than the average frat boy. Barely.
91-110: You’re average. It’s easy to predict how you’ll react to things. But anyone could have guessed that.
111-130: You usually have it going on emotionally, but roadblocks tend to land you on your butt.
131-150: You are remarkable when it comes to relating with others. Only the biggest losers get under your skin.
150+: Two possibilities - you’ve either out “Dr. Phil-ed” Dr. Phil… or you’re a dirty liar.
|
One of the most common interview questions for software professionals is “How do you find a loop in a singly linked list?”. Most of the people tend to think in the recursive way to solve this problem. The truth is that the most optimal solution for this problem lies out of the scope of the linked list.
A linked list with a loop can be visualized as a pseudo-random number sequence where the pseudo-random numbers are the addresses (pointers) of each node. After some time, the cycle repeats itself. There are two factors in the sequence now. One is the length of the cycle and other one is the length of the tail (the non-repeating part). Robert W. Floyd invented the Floyd’s cycle-finding algorithm in 1967 based on the properties of the pseudo-random sequences. By applying this algorithm, we simultaneously go through the list by ones (slow iterator) and by twos (fast iterator). If there is a loop the fast iterator will go around that loop twice as fast as the slow iterator. The fast iterator will lap the slow iterator within a single pass through the cycle. Detecting a loop is then just detecting that the slow iterator has been lapped by the fast iterator. It is sometimes called the “tortoise and the hare”-algorithm.
Here is a sample implemetation of this algorithm in C.
typedef struct node_s {
void *data;
struct node_s *next;
} NODE;
int list_has_cycle(NODE *list)
{
NODE *fast=list;
while(1) {
if(!(fast=fast->next)) return 0;
if(fast==list) return 1;
if(!(fast=fast->next)) return 0;
if(fast==list) return 1;
list=list->next;
}
return 0;
}
If one wants a much more readable implemenation of this algorithm, here we go!
int list_has_cycle(NODE *list)
{
NODE *s = list, *f1 = list, *f2 = list;
while( s && f1 = f2->next && f2 = f1->next ) {
if ( s == f1 || s == f2 ) {
return 1;
}
s = s->next;
}
return 0;
}
This is the best solution known so far for the given problem as it is of O(n) time and O(1) space. There are some other algorithms known of O(nlogn), O(n^2) time and a hash table based algorithm of O(n) time and O(n) space.
Finally, the long time pending task of getting a more visually pleasing theme for the journal is over. I have taken up one of an existing Wordpress theme and modified it to suit my needs. This theme looks neat for me in my Mozilla Firefox 1.5 on Linux. I have to test how it looks with Internet Explorer/Firefox on Microsoft Windows.
I like this theme because, it is mainly text oriented and not much of graphics stuff expect those tiny icons that you see on the right pane. For it’s given simplicity, the theme looks awesome (atleast for me). Maybe I would stick with this theme for a long period of time. Also the next task in the pipeline would be try to port this theme somehow for Gallery 2.
I might move this site to another host soon. You may see some flakieness.
A few months back we were introduced to the a subset of eXtreme Programming practices like Pair Programming and Test Driven Development. At the beginning I was in the impression that Pair Programming will not work out well for my style of programming. But slowly, I am leaning more towards Pair Programming and I have already started reaping some gains out of it.
Last week I got a chance to pair up with one of my collegue on tracing down some issues in my project. He was one of the new joinees of the project but, he is more experienced in the industry than me. We were able to effectively mix my familiarity in the code base and his familiarity in the domain to trace down the issue pretty quickly than expected. It also serves as a faster ramp-up for him. It is a Win-Win situation for us.
In the coming days I am going to concentrate more on Agile methods for Iterative delveopment and more practices from eXtreme Programming.
One of the recent jokes that I have come across on abscent mindedness is quite interesting.
An elderly couple had dinner at another couple’’s house and after eating, the wives left the table and went into the kitchen.
The two elderly gentlemen were talking, and one said, “Last night we went out to a new restaurant, and it was really great. I really recommend it.”
The other man said, “What’’s the name of the restaurant?”
The first man knits his brow in obvious concentration and finally says to his companion, “Ah, what is the name of that red flower you give to someone you love?”
His friend replies, “A Carnation?”
“No. No. The other one,” the man says.
His friend offers another suggestion, “The Poppy?”
“No,” growls the man, “You know the one that is red and has thorns.”
His friend says, “Do you mean a rose?”
“Yes, yes that’’s it,” the first man says.
He then turns toward the kitchen and yells, “Rose, what’’s the name of that restaurant we went to last night?
Hope that I am not into this stage yet! But soon I might be there!