12
2007
A friend complained on Orkut that I have stopped blogging. Maybe not, but then the frequency is definitely down.
What do people talk about when they have nothing to talk about? They talk about “weather”! So the weather in Hyderabad has been playing games; in the morning the sun is shining with all its ferocity and during late afternoons we have rains. Not the torrential kind though but the infamous cyclonic ones of the East Coast. In fact they are quite dangerous as I read in the papers today. A huge billboard crashed on top of an ice cream parlour and killed a man. Ouch!
Had a long weekend last week. Went to Abids along with a friend and his parents and roamed the market, finished an ebook on Old Greek Stories on my Palm handheld, watched a play at Hi-Tec City Convention Center and generally fooled around. Also read a little more about XAML and WPF from Windows Presentation Foundation - Unleashed. Pretty interesting stuff, one should really read it to gain a perspective about a completely new paradigm of programming.
21
2007
I like Firefox because of innumerable extensions and settings that are available to the user. Not only that, it is the (only?) browser that was available across all the operating systems which provided me with an OS independent experience that the Internet is truly meant to be.
One of the gripes I had about this was that I had to install Firefox for every Operating System (OS) that was there on my computer. So on my home computer which had Windows ME, Windows XP and Ubuntu, I had to install Firefox separatelyfor each of them. I could understand this as they were separate OSes and required different binaries for themselves. But installing all the Extensions and Themes for each and every OS was just plain irritating.
Browsing through www.mozilla.org I saw an article on Profile management in Firefox. Profiles allow different users to have individual settings for a software on the same computer. But this is not what I wanted to do. I wanted to use the same profile across different installations of Firefox, on different OSes, in my machine.
So how I did this was -
-
This step can vary but I will outline the simplest solution. Linux can access your mounted FAT or NTFS drives easily. So we would create the profile folder on a Windows partition and instruct Linux to read data from there.
For this, locate the profile in Windows and note down the name like
xxxxxxxx.default. It will reside- On Windows Vista/XP/2000, the path is usually
%AppData%\Mozilla\Firefox\Profiles\xxxxxxxx.default\, where xxxxxxxx is a random string of 8 characters. Just browse toC:\Documents and Settings\[User Name]\Application Data\Mozilla\Firefox\Profiles\on Windows XP/2000 orC:\users\[User Name]\AppData\Roaming\Mozilla\Firefox\Profiles\on Windows Vista, and the rest should be obvious. - On Windows 95/98/Me, the path is usually
C:\WINDOWS\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default\
- On Windows Vista/XP/2000, the path is usually
-
Now for each of the other OSes, open up
profiles.iniin a text editor. The file is located in the application data folder for Firefox:- On Windows Vista/XP/2000, the path is
%AppData%\Mozilla\Firefox\ - On Windows 95/98/Me, the path is usually
C:\WINDOWS\Application Data\Mozilla\Firefox\ - On Linux, the path is
~/.mozilla/firefox/
- On Windows Vista/XP/2000, the path is
- Change
IsRelative=1toIsRelative=0. - Change
Path=<something>toPath=(assuming that the profile that you selected in step 1 was in this location).C:\WINDOWS\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default\ - For Linux, set the
Pathaccording to the location of the folder in the mounted drive (Assuming the local mount folder is/media/cdriveyour path will be/media/cdrive/WINDOWS/Application Data/Mozilla/Firefox/Profiles/xxxxxxxx.default) - That’s it! Your Firefox Extensions, Themes, Settings, Cache and History will be shared across all the operating Systems.
8
2007
Just couldn’t resist posting this!
OK, many might ask, what’s new; almost no one manages to fill up the >2GB email space given by GMail. I agree. It is more of a gimmick but what was hilarious was this message posted on the Welcome page.

Seems like Rediff is encouraging people to store files on their server. What next, RediffDrive after GMail drive?
Technorati tags: Rediff, Rediffmail, unlimited, storage
26
2007
So the Day arrived; with all the excitement and hype that had built up for me for the convocation, I was all hyped and excited. Since we (medal recipients) were called at 9.30 am; myself and my parents started much earlier and reached the venue at around 9. The idea was that we would get good (if any) seats at the venue and probably both my parents could get in on a single card ![]()
Once there, I quickly changed into the ceremonial attire. My father came with me inside the hall and we tried to get mom inside too, but the bureaucratic officials refused, citing lack of space. This after seeing people enter with 4 invitations each! Entering the hall, there was a flurry of red and black gowns (with yellow hoods) all over the place. When we arrived, the hall was only half full; with people roaming around and taking photographs. You could really feel the excitement and the anticipation in the air. Everyone had huge smiles on their faces, probably because this was the last time they would be listening to any authority in the university. Eventually my mom also got in, with a little help from kind policewomen (what is that, does something like that exist in Delhi?)
The convocation was supposed to begin at 11 am, so there was plenty of time for me to roam around, help my father set the digital camera (the 3x zoom didn’t help much though) and in general chat with fellow medallists. Sitting behind me was a guy Nitin, who was getting a medal for DM and to the left of me was a lady who worked in Bharti Telecom, I think. Feeling bored, I decided to talk to them and introduce myself. And there I faced the problem faced by all NSITians while talking to people… what is NSIT? Telling the guy that it was earlier called DIT helped as he had given one of his exams there, he must have been pretty old. The lady/girl knew that because her boss was from NSIT (hooray!). So I educated 2 persons about the existence of my college
One more thing that I noticed (and also communicated to the guy behind me) was that 80-90% of the medallists were girls. We guys were seriously outnumbered! I have seen this for so long now, girls outnumbering guys while getting prizes. Why this happens, I still cannot figure out. Does that mean that females are the smarter sex? Guess you cannot generalize everything based on a convocation so I will leave it here.
At 11, the procession (it’s a formal term) of the Deans, VC and the Chief Guest came. There were around 30 of them. This made me realize how big and diverse DU actually is. The deans wore red, the VC (and some others) wore purple and the Chief Guest wore blue. After a brief introduction to the Chief Guest, Sh. Montek Singh Ahluwalia (he’s the Deputy Chairman of the Planning Commission), the convocation ceremony began. Now the excruciating part began; my position was 92 after the PhD guys (around 300). But the university people were pretty fast and quickly wound up with the awardees. So in all it wasn’t that bad.
I liked the part at the end when the Chief Guest addressed the gathering. He gave an overview of what kind of world we will encounter when we enter our working life. The thing that I liked about him was that he supported all his statements with facts and figures and didn’t give any vague statements. He was also careful enough to say that we shouldn’t take the progress for granted and it is us who would have to work to create and take advantages of the opportunities he was talking about. The speech was truly great and insightful.
After the ceremony, there were refreshments for the guests (and also the police, staff of the college and anyone who managed to enter the premises). OK stuff, and the convocation was finally over.
I will leave you with a masterpiece that my father shot with the digicam at DU ![]()
23
2007
I am back in Delhi for the most awaited event in a college graduate’s life, the Convocation. To me, it appears to be a reward for all the hard work that we have put in through the time we spent in the college. Even though I was not getting my degree at this Convocation; I was getting the L Jogeshwar Nath Gold Medal (for being the Best Candidate in Technical Education). What made it even more interesting was the fact that this was the only way a BE student from NSIT who was not in ECE could be invited to the DU convocation. Great! ![]()
The day before the Convocation, all students were asked to report for a roll-call/rehearsal at the Old Vice Regal Lodge at the University Campus at 11 am. Now, I had arrived at Delhi at night at around 1 am and was really sleepy. But then, I somehow managed to get up and reach the University along with my mom. We were both clueless abut how the whole thing worked; my mom had also not gone to her convocation and had the degree delivered home. We reached the place before 11 am, which I had seriously doubted. But Delhi Metro is amazing and took us from Central Secretariat to DU in around 20 minutes flat; neat! Once there, we beckoned a sight with lots of people standing outside the hall gate and trying to make sense of the proceedings. Remembering the old adage “When in Rome, do as the Romans”, we decided to go with the crowd. I saw people rushing to the nearby Anthropology department and getting the Convocation gowns and so decided to follow them and get one for myself too. I was vaguely aware that the red gown was for the PhD guys and so got myself a black gown with a yellow hood. It was the stuff out of movies and I wondered if people would toss their hats after the ceremony was over.
There was also a shady looking character who came to us as soon as we got the rented gown and asked for 200 bucks for a convocation photo and 300 bucks for a VCD. I know that the inflation is at an all time high, but this was preposterous! Also one of my profs had said something about these characters and I decided not to deal with him. Lucky me! During the rehearsal I came to know that this guy was indeed someone shady. Dunno if people caught up with him in the end.
The rehearsal was merely for telling us who the Chief Guest was, at what time we were supposed to arrive and stuff. Also the downer for the day was that passes for the ceremony were in a short supply and limited to 1 per person (though we came to know later that people were taking around 4 passes each).
Now regarding the ceremonial gown that I had rented from the University, I didn’t have the faintest idea regarding how to wear the hood, which side would be in front; so I spent the night googling around for people wearing their convocation attire, hoping that I would get a clue somewhere. So after going through various sites with pictures of students (or models) in the attire, I finally got some idea about how to dress for the occasion. The scarf-like hood was to be put hanging behind and was to be pinned to the gown in the front. So finally I got that stuff right.
For the convocation, I am supposed to reach at 9.30 am in the morning, but will have to reach much earlier if my parents are going to get any seats. Will post the day’s events in the next post. Till later.
4
2007
During the flight that I have mentioned in the previous post, I read a story by Anton Chekov, so intriguing that it really set me thinking about the perception of Justice that prevails in our society; it is called “The Head-Gardener’s Story” The story starts with a gardener talking to people and saying that he feels good when someone is acquitted of a charge because this reinforces belief in humanity. He goes on to narrate a story. It is set in a small town and is about a doctor who lives there. He is utterly sincere and selfless in his work and so is admired and respected by the people of the town. Even when he was waylaid by vagrants, he suffered no harm because of his good deeds.
However, the doctor was murdered. I really love the way that the author describes the expression on the doctor’s face when he was found.
… and his pale face wore an expression of amazement. Yes, not horror but amazement was the emotion that had been fixed upon his face when he saw the murderer before him.
Not only this, the whole town is not angry but amazed at this dastardly deed. The judges quickly rule out murder as the cause of death and say that his death was, in all likelihood, an accident. They think that there could be no one who would want to kill such a good person. Incredibly,when they find a person, against him there is enough evidence to convict him of murder, the judges say that in probability there has been some mistake and that person could not have killed the doctor. Finally, they let the accused go free.
It completely flabbergasted me! Even when there was so much evidence against the accused, how could the judges let him go scot-free? Didn’t it go against the common perception that a criminal must be punished for his deeds, no matter what? The characters had such faith in humanity that they disagreed that anyone could be so vile, as to kill the doctor. Though this story was written before 1900s, the concept is even more relevant today. Many a times, when approach people, we do so cautiously. In essence, our faith in humanity has begun to waver. The above story reminded me that decisions need not always be mathematical but must be based on compassion too. More important than punishment for the sinner is for us to continue our belief in humanity and its existence.
29
2007
Its time I updated my Blog, its just lying there on a server and gathering dust. So updating it now… This post might include a lot of ramblings so bear with me ![]()
Last Saturday, I made a trip back home Delhi (yippee… brrr… cold). It was a normal warm Saturday morning when I left from Hyderabad. Got a lift from my friend/flatmate Rajat till Kothaguda Junction to take the bus. Speaking of buses, Hyderabad buses remind me of the Red line buses that we used to have back in Delhi, fast and oh so dangerous. But considering the general traffic (and the traffic sense…) that prevails in the city, the buses are not so bad. So, got the 10H bus from Kothaguda which would take me directly to airport for a measly Rs. 10 (and this was the Express bus!). On the other hand, the unscrupulous auto-wallahs take anywhere from Rs. 150 to 200 for the same journey depending on how naive/smart you are. A word of caution here, be it Delhi or Hyderabad or Bangalore, the auto-wallahs are the same everywhere; never trust their meters and always haggle (the euphemism is bargain) with them over the asking fare. Try to come up with a fare that is at least Rs. 30-50 than what they demand and especially in Hyderabad, do not go by the meter (remember the time when Delhi auto-wallahs had tampered mechanical meters and the government forced them to switch to harder-to-tamper-but-still-tampered digital meters, the same is here too).
Since the bus was fast (remember Delhi Red Line buses), I reached the airport in around half an hour. So had lots of time to spend there. Even more… when I checked my cellphone and saw an SMS sent 15 minutes back that my Go Air flight was delayed by an hour or so. T’ was a good thing that Rajat had suggested that I take a book along. And so Anton Chekov came to my rescue. Now I really admire his short stories… so spent most of the time at the airport reading the book in the lounge (what else can one do at the Hyderabad airport) After the security check we were shuttled into the ground floor lounge to… wait. Then after half an hour we were asked to go to the first floor (so why could they not tell us that before?) and made to wait. Finally after a long time (and after having harrowing thoughts about the flight being cancelled as we were made to wait without explanation), we finally boarded and left for Delhi.
Now I won’t bore you with what I did at Delhi (and IMHO that’s not so important anyway, is it?), the real ordeal was getting back at Hyderabad. Blinded by low fares and my judgement clouded with the thoughts of saving some money $-), I had booked an Air Deccan flight back to Hyderabad. I should have guessed that things would not go so smoothly, when the night before the departure, I got an SMS that the flight that was supposed to depart at 0820 hours would leave at 1145 hours.<sarcasm> These Air Deccan people are quite smart IMHO, they actually forecasted the fog that would be there in the morning and so to be safe delayed their morning flight! But they must have miscalculated a little bit because their aircraft failed to turn up at that time.<end sarcasm> So at 1141 hours I get an SMS that the flight is delayed and would come at 1225 hours. OK, I think remembering that last year at Bangalore the flight was delayed for 3 hours. In the end I do get to board the flight at 1235 hours and then the pilot informs us that we are 20th on the runway. Not only that, his tone seems to blame the ATC for the problems.Agreed that the flights are delayed due to fog, but if your aircraft arrived late, is it really the ATC or nature’s fault? Its not that it was hovering over the airport awaiting clearance. Sitting in classic cramped Air Deccan seats for over an hour and listening to “इस विमान में फ़à¥à¤°à¥€ सीटींग का आयोजन किया गया है” is not a pleasant experience by any means. Finally the flight did take off at 1345 hours after an excruciating delay.
The worst part is that I am due to go back to Delhi and come back by Air Deccan flight in March too. Damn these low fares. #-o
8
2007
One of the great things about the Internet is anonymity; one can surf the net without disclosing who he/she is and where he comes from (OK, your IP address can be used to track you, but then unless you go through the long process of getting your ISP to yield details about the IP address, such means can be safely ruled out). Also people using a shared IP address can be more anonymous. In Qatar, there is just one ISP with only one IP address. How can one trace an individual net-surfer from only that information?
No wonder, people expect to have the same kind of anonymity while surfing the web through their mobile devices too. The mobile operator does give you a shared IP address. Though surfing through mobile phones is still very painful in India (3KBps download speeds aren’t that great), mobile Internet access through GPRS is becoming cheaper every passing month; Airtel offers a HTTP only package for just Rs. 99 per month which would encourage more people to at least try mobile web surfing. But cheap access doesn’t translate into secure access.
I always used to wonder how various websites like Yahoo, Rediff et al could get access to mobile subscriber data and charge them for their products and services. So I created a small servlet at http://www.myjavaserver.com/servlet/proteus.SmallFiles.WmlHead. And the results turned out to be shocking. I accessed the page from my friend’s phone and this is what I saw (the number was not masked, it has been done so to protect his privacy.
Host : www.myjavaserver.com X-Wap-Profile : "http://wap.sonyericsson.com/UAprof/W700iR101.xml" Accept-Language : en Accept : application/vnd.wap.xhtml+xml, application/vnd.wap.wmlc, application/xhtml+xml, image/gif, */*, text/vnd.wap.wml User-Agent : SonyEricssonW700i/R1CA Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 Accept-Charset : * Accept-Encoding : deflate, gzip TE : deflate, gzip MSISDN : 9198xxxxxxxx WAP-Connection : Stack-Type=HTTP Cookie : $Version=0;User-Identity-Forward-msisdn=9198xxxxxxxx;User-Identity-Forward-ppp-username=void;Bearer-Type=w-TCP;wtls-security-level=none;network-access-type=CSD;nas-ip-address=10.151.1.18;apn=airtelfun.com;imsi=404490016894720;Called-station-id=airtelfun.com;accounting-session-id=3D5FF84246578127;accounting-authentication-method=2;sgsn-ip-address=125.19.6.40 SCRIPT_URL : /servlet/proteus.SmallFiles.WmlHead SCRIPT_URI : http://www.myjavaserver.com/servlet/proteus.SmallFiles.WmlHead Remote Address : 203.145.131.158 Remote Host : 203.145.131.158 Server Name : www.myjavaserver.com Protocol : HTTP/1.1>
This is from Airtel network in Andhra Pradesh, India. As one can see it is transmitting your mobile number in plain text as well as your mobile operator information to each and every website you visit. It also has your IMSI number which, about which Wikipedia says "In order to avoid the subscriber being identified and tracked by eavesdroppers on the radio interface, the IMSI is sent as rarely as possible and a randomly generated TMSI is sent instead.". This is potentially a great way for spammers to send you spam SMSs or track your surfing habits. They can put in a 0 X 0 pixel image on web pages and track you without you having to visit their site. Though much of this is what they can do through normal browsers on computers, here they can personally identify you through your phone number. You can visit the link given above to verify what headers you ISP is attaching to your outbound requests over GPRS. It is a WML page so even the oldest browsers should be able to open it.
It would be futile to even talk to your Customer Care guys about this, write to your ISP about this and ask them WHY they are exposing you to dangers which involve endangering your privacy. As a defence against this, you can use an anonymizing proxy like Opera Mini which will hide your information, but prevention is better than cure!
Source for the Java Servlet is available here .
Remember you need to access the URL with your Mobile phones , accessing through your normal browser will display the header information of your PC Browser. Also you need a GPRS connection that allows you to surf external sites and not just those of your service provider’s.
For the curious, I have also added a Java Servlet that displays the headers sent by your PC browsers here. The source for this one is available here.
26
2006
![]() |
I always thought that one couldn’t get more for less. But Hyderabad is a city of contrasts! A visit to the Hyderabad Central mall proved this. Not only does one get products at a cheap price but one gets more than what he paid for… So in the receipt above, I pay for products worth Rs 280 and get those worth Rs 320 free… Weird… :-? |
16
2006
XAML has this great concept of look-less controls. When we see a normal Win32 control like say a checkbox, we always assume that it will be a square box along with some text written to the left of it. Taking an example from our old friend WordPad, we would always expect a checkbox to look like

Pretty boring, if you would ask a kid (or even a teenager!). Even though it makes the control much more usable (which is a very important thing BTW), it doesn’t look cool. So how does WPF help us here?
For starters, when you define a control, WPF doesn’t force to you to define the look of the control along with the functionality. Here comes the concept of a look-less control; a control whose behaviour is defined but whose look is not defined. For instance, we might define the behavior of the check box (it has a bool or a bool? property called IsChecked, it has a check mark to the left of the content, etc…
but leave it to the author to define the look for it. So we might have something like
|
|
Checked Checkbox |
|
|
Unchecked Checkbox |
How to go about doing this? This is all done by redefining the ControlTemplate for the checkbox. ControlTemplate is basically what it says, it is a Template for the Control and decides how the control will look like. To achieve such a look we define the Style of the Checkbox as
<Style x:Key="{x:Type CheckBox}" TargetType="{x:Type CheckBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type CheckBox}"> <WrapPanel Orientation="Horizontal"> <Border x:Name="Border" CornerRadius="0” > <Image Name="CheckMark" Height="{Binding ElementName=MyContent, Path=ActualHeight}" Source="happy.gif"> <Image.BitmapEffect> <OuterGlowBitmapEffect GlowColor="Blue" GlowSize="2” Noise=".1” Opacity="0.8"/> </Image.BitmapEffect> </Image> </Border> <ContentPresenter Margin="4,0,0,0" Name="MyContent" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True"/> </WrapPanel> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="{x:Null}"> <Setter TargetName="CheckMark" Property="Source" Value="unsure.gif" /> <Setter Property="BitmapEffect" TargetName="CheckMark"> <Setter.Value> <OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" Noise=".1" Opacity="0.8" /> </Setter.Value> </Setter> </Trigger> <Trigger Property="IsChecked" Value="false"> <Setter TargetName="CheckMark" Property="Source" Value="sad.gif" /> <Setter Property="BitmapEffect" TargetName="CheckMark" Value="{x:Null}"/> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="BitmapEffect" TargetName="CheckMark"> <Setter.Value> <OuterGlowBitmapEffect GlowColor="Red" GlowSize="2" Noise=".1" Opacity="0.8" /> </Setter.Value> </Setter> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter Property="BitmapEffect" TargetName="CheckMark"> <Setter.Value> <OuterGlowBitmapEffect GlowColor="Yellow" GlowSize="2" Noise=".1" Opacity="0.8" /> </Setter.Value> </Setter> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" /> <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" /> <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
Let’s dissect this monster to see how it works ![]()
The first line
<Style x:Key="{x:Type CheckBox}" TargetType="{x:Type CheckBox}">
means that this is a Style being defined for Type CheckBox in the namespace referred to by x which is http://schemas.microsoft.com/winfx/2006/xaml in my case.
Moving on, the core part of the Style is in defining the ControlTemplarte.
<ControlTemplate TargetType="{x:Type CheckBox}">
Note that I could have defined the ControlTemplate for the CheckBox using CheckBox.ControlTemplate but have chosen to implement it using a Style as it is quite common to do so.
It is in this ControlTemplate that I define the look of the CheckBox. Here I say that it should be a WrapPanel which should contain a Border which has an Image and a ContentPresenter in it. You can read more about the ContentPresenter in MSDN, it is just a UIElement which can contain and display any other object. The Image has a binding to the Height of the ContentPresenter so that it resizes automatically to the Height of the content, else you might have a case when you have text with FontSize 36 points but you checkmark is just 10 pixels high. That’s it! That’s the definition of our customized CheckBox; could it be any easier?
I added some Triggers to change the Image in the CheckBox depending on its state. I have added an image when IsChecked is null to account for a Tri State CheckBox. I also added some BitmapEffects for a Glow (just to make it more pretty!)
Go through the code, it isn’t very hard to understand or comprehend. Now whenever you wish your CheckBox to use this style, simply use it as
<CheckBox Margin="8” Style="myCheckBoxStyle"> <TextBlock FontSize="20">Happy or Sad?</TextBlock> </CheckBox>
If you find this article useful, do comment and let me know




