Ramadhan comes again

Minaratul-Masih
Ramadhan is here once again, just like last year and the year before. Its back and its here to stay, for a month at least. As we all know the holy month is a time of great holiness and blessings. During this month, Muslims all over the world abstain from food and drink and begin praying like crazy. At prayer time they’re seen running towards the Jama`t, dripping water all over, their Jinnah caps and their beards flowing. An awesome sight watching the creation hurrying to worship their creator. Even the most irreligious of us can be seen praying in this blessed month, begging forgiveness for their sins. The imprisoned Satan is powerless while Momins carry out their fasting activities with complete devotion.
Not feeling the Ramadhani fever yet? No problem! Get your blood flowing by visiting your nearest Jama Masjid and offering taraweehs all night with all the cool
kids. Listen to a sipara or too and you’ll be back in business. You have, after all survived another summer of heat and perspiration and lived through the tandoori nights. That’s something to be proud of, to enjoy. Its time to rejoice and be grateful to the Lord.
Weird $.getJSON caching behaviour in IE6 and IE7
So I’ve been doing some more Ajax stuff using JQuery during my ASP.Net maintenance work. One of the joys of maintenance is introducing new features into an existing application from time to time. It allows one an opportunity to try out some new stuff occasionally. I decided to use the hip new JSON as the data-interchange format for my client-server communications using JQuery’s $.getJSON function for sending back requests to the ASP.Net server. It’s pretty easy to use, all the house-keeping is done by JQuery.
$.getJSON("MyPage.aspx",
{ Param1: "Param1Value" }
function(result) {
//manipulate result data here
alert(result.value);
});
Just send the parameters and get the results. Of course you’ll need to serialize the results into the JSON format using the ASP.Net Ajax JavaScript Serializer. That’s what I do anyway, just serialize the object I want to send back and write all of it on the Response using Response.Write(). And then do all the processing at the client. JSON is used purely as the means of sending back and forth between the browser and the server. It was working fine until I discovered some weird random behaviour in IE6 and IE7 . The browser seemed to be caching the Ajax requests if all the parameters were the same as the last request. Instead of contacting the server for the latest data the browser returned cached results. It was happening randomly in IE6 and 7. I had to whip up Fiddler to get to the ‘root’ of the problem. Anyway turns out there’s a simple fix. Adding $.ajaxSetup({ cache: false }); before the request solved the problem. Basically JQuery now forces the browser not to use the cached results by adding a new randomly generated number as a parameter to every request. No more caching means new results every time…
Tandoori nights

Finally the heat is upon us in the land of the pure. With great heat comes great responsibility. A responsibility to survive, to die another day. 22nd of June, the day it happened, the longest day of the year brought with a heat to remember. The day my friend Chaukas Khan coined the phrase tandoori nights to accurately sum up the situation. This period of 3 months is the best time of the year for the people of the desert plains. The desert heat coupled with unremitting heat make a great combination. Its a period of trial, when their powers of endurance and survival skills are tested beyond limits. In these months of fire its not about living the life, its about survival. Its about going back to your basic instincts, about life and death.
When the sun shines all day, the nights that follow are tandoori nights bringing no respite for those who want to rest. Heat is your only companion dripping from the walls, taking you for a spin. Its all about remembering your loved ones, picturing them in your mind when trying to survive the next hour. The trick is in hour by hour survival. Don’t look beyond the hour. Stock up on lot of water bottles to help ease the pain. At times you may lose all will to survive. You might hear yourself saying what the heck, its all futile. The torture is too much for me to handle. Why don’t I just die and end the misery. For times like these you must stock up on some good memories that will help you through the journey of pain that are the tandoori nights. There will be times when you might think these nights are eternal but you must have faith. Tandoori nights are long but they do end eventually. And when the sun rises, pat yourself on the back. You survived against all odds. You should be proud of your achievement. Take a shower (if you have water i.e.
), wash that stench of the tandoori nights off your body, and go to work. After all, what doesn’t kill you makes you ’stronger’…
WorldCall EVDO not available in Lahore Cantt yet
So WorldCall launched their USB EVDO thing on 25th May in Lahore. Read all about the packages etc. here. Its supposed to be a pretty nifty service offering ‘broadband Internet’ through a USB. Just the kind of mobility I was looking for. They’re charging 3k as ‘activation fee’ and 1.8k/month for a 512K connection. Not sure if it’ll run on my Linux installation though. Anyway after visiting their shop I found out that its not yet available in Lahore Cantt because the army won’t let them plant any towers here. Maybe asking for a little too much money. So I guess I’ll have to wait until they pay off the khakhis, or maybe I could get this PTCL EVDO. This one also have a USB version…
What happened to ‘the others’?
So the 5th seson of Lost came to a wierd end with the The Incident. An hour and half of craziness ending with Ben finishing off the immortal saviour and protector of the Island, Jacob. Apparently Jacob is some kind of human God or something like that. Anyway what ever happened to ‘the others’. In the 3 years without Ben they’ve become so meek and submissive. They looked like the lost sheep of Moses. Where did the real others go. Ones that had passion and fire. Those who were raring to break bones and kill without a second thought. Just look at those of 1970s. People like Charles Widmore and Penelope Widmore, shooting people up for no reason, even killing her own son in the process. That guy on the horse that banged up Jack and Kate, he had some passion for his job.
And then Ben’s guys and girls, the way they moved through the jungle, the way they infiltrated and kidnapped the survivors of Flight 815. That was some scary, cold blooded stuff. This is why Ben was such a great leader. Under his leadership they had a purpose. They were the protectors of the Island, serving Jacob. Ready to do any crazy thing he wanted done. But the three years without Ben has made them so weak and feeble, following ‘John Locke’ like a bunch of puppies. That’s what happens when you lose a leader of Ben’s calibre. That’s why he’s my favourite Lost character. Way to go Ben! If Jacob deserved to die, he deserved to die at your hands.
Connecting to the Internet on Ubuntu using Nokia E51 as modem
So lets say you have a brand new (or you know, slightly used) Nokia E51 phone. You looked it up, saw it had some cool features, all that smartphone stuff etc. So you buy it and now you want to connect your laptop to the Internets using it as the modem. Well its not very hard to do on Windows because Nokia provides Windows users with the Nokia PC Suite which makes connecting to the Internet a piece of cake.
But in Linux or Ubuntu specifically, because that’s what I use, we can use the wvdial utility to connect to the world wide web. For that we need to install wvdial (if its not already in the system). Since you aren’t connected to the Internet on Linux yet, find a Windows box or if you’re dual booting fire up that trusted Windows XP (or Vista if you’re one of those people) and download it from http://packages.ubuntu.com. Be sure to download all the dependencies as well. Once you have wvdial just create a new wvdial.conf file at /etc. And fill it up with the following:
[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","ufone.pfinternet","",0,0
ISDN = 0
Modem Type = USB Modem
Phone = *99#
Username = "blank"
Password = "blank"
Stupid Mode = 1
|
Since I’m a Ufone subscriber (unfortunately) I’ve used its APN i.e. ufone.pfinternet. If you have a different provider use theirs. If you’re already using GPRS on your phone then you can find it in your phone’s connection settings. And if the username and password are blank use “blank”, otherwise type in the correct credentials. Now fire up a terminal and type:
sudo wvdial
|
Give your password and if successful should show some output like this:
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","ufone.pfinternet","",0,0
AT+CGDCONT=1,"IP","ufone.pfinternet","",0,0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sun May 17 13:07:08 2009
--> Pid of pppd: 8662
--> Using interface ppp0
--> pppd: ��� �� ��
--> pppd: ��� �� ��
--> pppd: ��� �� ��
--> pppd: ��� �� ��
--> local IP address 10.2.85.37
--> pppd: ��� �� ��
--> remote IP address 10.6.6.6
--> pppd: ��� �� ��
--> primary DNS address 172.16.13.219
--> pppd: ��� �� ��
--> secondary DNS address 58.65.175.74
--> pppd: ��� �� ��
|
If the connection process breaks then check your credentials and APN. Most likely one of them is wrong. Fix it and try again. I’ve tried this procedure successfully on both Ubuntu 8.04 and 9.04. Although in 9.04 when you connect your phone to the PC using a USB cable, a dialog will pop up asking you if you want to connect to the Internet using your phone. It provides a very convenient GUI interface to do the same thing wvdial does. But for some reason it gives me slower speeds so I had to go out and install wvdial and now mostly I use that. A word about the Ufone GPRS/EDGE services in case you didn’t know it already, it kind of sucks. Also using your phone as a modem for long periods can result in decreased battery and phone life and a general disturbance in the force. So be careful…
Modifying dropdown tooltips using JQuery
Finally got to try out some more JQuery goodness in an Asp.Net project at work. The width of the drop down was little too short for the user to see the whole text. So we decided to show it all in the tooltip instead. That meant modifying the title property of the HTML drop down. So I added the following the $(document).ready event handler. The function retrieves the drop down by its ID and iterates over it using the nice .each() provided by JQuery and sets the text to the title. Nice and easy. JQuery is cooool. Write less, do more.
$(document).ready( function() {
$("#dropdown").each(function(index) {
$(this).attr({
title: $(this).text()
})
});
});
a
IE8 gets a new View Source
So IE8 finally got released the other day and I decided to install it. After grabbing the 16MB installer from the Microsoft web site I had to restart the computer of course and there it was in all its glory…the most sophisticated explorer of the internets known to mankind…version 8. I don’t really need it to explore the internet. It’s just a requirement for my software supporting needs since I mostly do Asp.Net stuff which is of course only Internet Explorer 6 compatible. These apps don’t usually work on newer versions of explorer due to a variety of unknown reasons. Something to do with standard HTML.
Anyway, the thing that I really hated about previous versions of explorer was the View Source. That’s about the only thing I actually ended up using for my meagre programming needs. The source opened up in Notepad which is a seriously out dated piece of software with absolutely no sytax highlighting. All I wanted was syntax highlighting. That’s the the mosic basic and probably the only thing one needs from a source viewer. How hard is that? But thankfully IE8 gets a syntax highlited source viewer. So now that HTML looks like this.

Instead of this:

Which is quite an improvement. Plus IE8 also has some development tools like javascript debugging and stuff. Haven’t used them yet though…maybe some day…
Firefox and Chrome
Now that the browser wars are set to begin again, I finally decided to try out the new Google browser. It’s not exactly new anymore but me being a faithful Firefoxian, I never really tried it before. Until now, and man, is it fast or what? I’m completely blown away with its speed. In front of this young cheetah of a browser, Firefox looks like an old man grasping his last breaths. While Firefox is trying to get up on its feet chrome is running around loading up sites like nobody’s business, executing scripts and rendering funky HTML. I don’t even have that many extensions installed on Firefox anymore. Only the bare minimum that I can’t live without like AdBlock, fireguestures and a couple more. But despite this the fox needs at least 10 minutes to load itself up. And then continues to hog memory. And having too many tabs open adversely affect its performance, it starts getting stuck every five minutes.
So does this mean I’m going to switch to Chrome completely. Probably not. I now do all my regular browsing on Chrome, and when I need to quickly fire up a site. But for reading the blogs I subscribe to I need Firefox since guess what? Chrome doesn’t support RSS feeds. Why? because they want you to go use that Google Reader thing. While Google Reader is great for some heavy duty feed reading I just need a simple solution. I can even live with the Ads or without the mouse guestures but I need those feeds. Lack of a built in RSS reader for me is the deal breaker here. In the meantime, I did however get this Firefox theme that makes my Firefox look a lot like a Chrome, maybe not in function but certainly in looks…
Taking on Sufi Muhammad…or not…
Ejaz Haider asks in his column at daily times whether the newly restored CJ can or will take on Sufi Muhammad in the near future. Sufi Muhammad as we all know is the founder of the Tehreek-e-Nafaz-e-Shariat-e-Mohammadi who has now renounced voilence and vowed to bring peace to the Swat region through talks with Maulvi Fazlullah and his followers. He recently signed a peace deal with the NWFP government allowing for the implementation of shariah law in the Swat region. Of course nobody really knows what kind of shariah will be implemented. The details of the deal are a bit sketchy. At first we heard that there would be some kind of parallel legal system where one could go to either the shariah courts (which would follow the Islamic shariah of course) or the civil courts following the Pakistan penal code. But apparently Sufi sahab has ‘asked’ the civil judges not to attend courts anymore.
He said, “I will personally monitor the hearings of Shariah courts.”
Addressing a press conference here he said, “According to the deal signed with government, civil judges will have no role in future whatsoever and all cases will be followed under Shariah courts so the civil judges must refrain from courts from Tuesday.”
“Shariah has already been imposed in Malakand Division therefore there is no need of Presidents’ signature”, he remarked vowing, “We will soon setup Dar-ul-Qaza courts for filing appeals against the verdicts of Shariah courts.”
So as tazeen has asked rightly why isnt’ anyone protesting against this edict. Apart from Altaf Hussein i.e. That’s because the majority of Pakistanis at some level want shariah to be imposed in Pakistan. Most of the people I’ve talked to think that’s the only way to solve the country’s ailing problems. In fact some of them are waiting for Sufi Muhammad to finish his job in Swat and do the same in Punjab and other provinces. It’s the people’s will. The same people who helped CJ get back on his seat. So, no! CJ cannot stand up against Sufi Sahab even if he wanted to…
Link: Sufi Muhammad’s interview with daily times What has happened in the past should not be discussed. (President Zardari and Mian Sahab would certainly agree with that.)