September 26, 2009

Facebook Friends Graph — Plotting your social network together

Filed under: Blog — krkhan @ 3:58 pm

Update: New version

While visiting profile of a friend, I noticed that he and I had about 70 mutual friends. Immediately it gave me the idea to plot the common friend connections and see what interesting patterns emerge in the larger picture. Something like this:

Facebook Friends' Graph Sample

In the sample above, the names in circles (“nodes”) happen to be in my friend list. The connecting lines represent their own friendship status. For example, Saad Jasra and Hassan Ahmad are friends among themselves apart from being my friends on their own. Similarly, Ali Zeeshan Ijaz is a friend of both Saad Jasra and Abdullah Afaq Ali.

Luckily, Facebook API had Python bindings available which considerably simplified my task. Those, coupled with pydot, resulted in a dot file with all the required connections. Graphviz did the remaining work:

Facebook Friends' Graph
(Click on the thumbnail for larger version.)
(Warning: The larger version is a 7329x5953 PNG image with a humongous file size of 13 MB. If your hardware specs are squeamish, don’t blame me if it brings your machine on its knees — this is not a DoS attack.)

Now came the intriguing part. The resulting graph was visibly split in two large portions. This resulted from the fact that I had spent a major portion of my life (15 years to be exact) in Saudi Arabia before moving to Pakistan. More interestingly, an old friend of mine from Saudi Arabia — Atif Sheikh — was also enrolled at my university in Pakistan. When I zoomed into the graph, I spotted him at the nexus of two networks. Similarly, the names in the middle of a network were the most connected people in that network. That is, the names congested in the middle of Pakistan network were friends from university and the names at the edges of that network were friends outside the university who didn’t share my academic connections.

I haven’t polished the code for a stable release yet as I doubt that other people would be interested in having gigantic plots of their social lives. Nevertheless, I’ll try to package it in form of a proper Facebook application in near future. After all, as I quoted in a previous post of mine:

“Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.”

Tags: , , , , , , , , , , , ,

August 20, 2009

Web 2.5

Filed under: Blog — krkhan @ 11:58 pm

Ladies and gentlemen, let’s bring our hands together for a clamorous round of applause. The greatest browser plugin since the invention of, well… browsers, has been unveiled. Welcome to Quake Live.

An year ago, anyone proposing the idea of running Quake III in a browser would have been sent to the local psych ward. Heck, even a week ago I would’ve been skeptical about practicality of any such development. But sometimes, it just feels wonderful to be proven wrong. This is one of those times and while I shoot railguns aimlessly in the other Firefox tab, I just can’t help staring at the screen in awe. In fact, I can even — for the time being — totally overlook any security concerns related to the plugin. If you own a decent browser, QL’s worth at least a try. I’m not a FPS fan either but this was just too good to be overlooked because of gaming preferences.

Tags: , , , , , , , ,

May 6, 2009

Breaking the ISP shackles on Huawei SmartAX MT 882

Filed under: Blog — krkhan @ 10:56 am

What does an ISP do when it needs to sell a customized router? Well, if they’re smart, they go for a Chinese product; re-brand it as their own, slap stupid restrictions on it and then shove the whole thing down the customers’ throats.

Last year, when I came to Saudi Arabia on vacation, I got ADSL installed on my phone-line. As mentioned above, a Huawei SmartAX MT 882 was provided by the ISP. Interestingly, it came not only with a re-branded appearance, but also with a customized firmware which purged all Huawei logos and references from the administration interface. As a side note, switching from a Linksys WAG200G (which I had back in Pakistan) to the Huawei thing was more or less like transitioning from GIMP/Photoshop to MS Paint. For example, even though I had UPnP enabled on the goddamned Chinese weapon, it never worked. Leaving me no alternative but to forward the ports manually.

Back to the topic, the device worked halfway decently. That is, until I came back during these vacations and bought the ADSL service from a different ISP. As soon as I popped up the configuration interface to type in the ADSL credentials, I was hit with this:

Huawei SmartAX MT882 Configuration Interface

See any issues? The username is already tied to the older ISP. My new username is something like “[a-number-I-can't-remember]“. The configuration interface only allows me to type in the [number-I-can't-remember] part, effectively allowing usernames only of the format: “[a-number-I-can't-remember]“. Because of the old ISP’s stupid attempt at monopolizing sales, I apparently needed to buy another router to work with the new username.

Hell, no. If I had actually went ahead and bought another router for this reason alone, I might’ve as well stopped calling myself a geek. Looking for a fix, the first thought that naturally occurred to me was to try and flash the firmware. Again, firmware flashing for such crippled devices isn’t any less of a b**** either. Curiously, I opened up the source of the interface webpage. Apart from a total mess of tag-soup the likes of which I had only ever seen in FrontPage websites, I spotted this:

<input type="hidden" size="30" maxlength="63" name="pppuser" value="">
<input type="text" name="pppuser_prefix" size="20" maxlength="35" value="51252403762">
@<input type="text" name="rate" size="5" maxlength="15" value="1024">

Er.. a hidden input field that basically contains the whole username. What for? I had and still have no idea. Nevertheless, it gave me a clue that the "" part is not hard-coded in the customized firmware. That is, if I could only manage to somehow input the new username unmodified in the router, it should still work.


  • Backup the router configuration.
  • Open it in a text editor.
  • Search for the username.
  • Change it.
  • Save the file and “restore” it through the administrative interface.
  • Restart the device, and stick a middle finger to the monopolizing ISP’s.
  • Pat yourself on the back for being the William Wallace of home internet gateways.
Tags: , , , , , , , , , , , , ,

September 11, 2008

Thanks, but I don’t want to try out Google Chrome (yet)

Filed under: Blog — krkhan @ 4:36 am

Alright, Google finally releases the Chrome browser, along with a certain comic detailing features of their product. I check out the comic and the feature-list, I decide that there isn’t any compelling reason for me to switch to Windows and run the beta. I also decide never to blog about it unless I deem it important enough for a try out. So far, so good.

But hey, I have violated the unimpeachable moral obligation of going along with the current buzzword by declining to be a part of the Chromosphere. In the past week, at least seven different people have tried to persuade me to believe Chrome is going to take over the world. In fact, that is the inherent problem with Google and Apple fanboys. They equate anything remotely new from their favorite corporation with the second coming of Christ, and then try to convince other people over it. I do happen to be a fan of both as well, but I still don’t see why products like 3G iPhone or Google Chrome deserve the applauds lauded by these people. Here’s a list of arguments Chrome fans presented to me:

  • Chrome is Google’s attempt to blur the line between desktop and web, and it is the future Operating System
    Bullocks. The line between desktop and web shall never be blurred. Are you trying to tell me that you’ll be installing your printer or screen drivers to web one day? Will a browser ever be capable of doing even half of the stuff that operating systems do, e.g., implement the POSIX specification or host other processes?
    No? I didn’t think so either. Yes? You do not have any idea what an operating system is.
  • Chrome isn’t a memory hog like Firefox
    Firefox’s memory-usage has steadily improved over the released and I have yet to encounter someone who had any serious memory troubles with the former that were solved by the latter.
  • Chrome’s Javascript runs faster
    The only worthwhile feature of Chrome is its Javascript engine. Nevertheless, milliseconds of speed improvement won’t even be noticeable by me. The AJAXed Facebook or Gmail run on my Firefox extremely well and I don’t think my productivity with either would increase by switching to Chrome.
  • Chrome’s rendering engine (WebKit) is new whereas Firefox’s rendering engine (Gecko) is outdated
    Wrong. Totally wrong. Gecko might be bloated, but Mozilla does a more than reasonable job of making it perform well. Gecko is huge — WebKit comparatively isn’t — but it is still frequently updated and properly maintained. The huge codebase is an issue for the developers rather than the users and as long as developers are delivering stable final products using that codebase, it’s certainly not an issue for me. WebKit is great for new applications like Chrome, but Mozilla has already settled with Gecko so it isn’t a bother for them.
  • Chrome uses separate processes for each tab
    And this was the only “visible” feature Google was able to highlight in their comics. This is nifty behavior, but with frequency of my browser crashes reduced to almost once a month, this isn’t enough to convert me over.

On the other hand, consider the mammoth developer base Mozilla already has for its Firefox extensions. Google isn’t going to replicate that as well as bundle Chrome with killer feature(s) anytime soon, if ever. What Google perhaps aimed to do was to get other browsers to adopt Javascript enhancements that they’re going to introduce with Chrome. More than that, I don’t think Chrome shall ever compete in user share against Safari, let alone against the big guns.

Tags: , , , , , , , ,

October 11, 2007

Watching the froots

Filed under: Blog — krkhan @ 6:55 pm

“The rat, the mouse, the fox, the rabbet; watch the roots, the lion, the tyger, the horse, the elephant, watch the fruits.” — William Blake

(As far as history tells us, Blake was a n00b in the field of computers and internet. Which adequately explains why he knew as much about browser wars as anyone’s grandma. Certain fiery foxes do watch the (open-source) roots, but I never heard anything about a Radiating Rat, Mercurial Mouse or Rigorous Rabbit.)

Anyone not living under a rock for the past decade knows this pretty well: Firefox is the best web-browser on the face of earth, period — as far as embedded browsing isn’t concerned. For me, and everyone else who actually browses full-blown websites on cell phones, Opera still holds that honor on mobile platforms. Here’s a list of few good reasons why:

  • Page refitting “modes”. You can view the page in its original design or opt for having Opera “fit” it on the mobile screen for you.
  • Inline frames. You can’t log-in in some of the Google services without them (e.g. orkut).
  • Better Javascript support.
  • One reason to rule them all: absence of Firefox on the platform.

And the one reason looks like it’s finally going to be rectified by Mozilla. Gentlemen, everyone’s favorite fox is aiming for mobile platforms.

The bad news? You’re gonna have to wait for about another year before you could actually get your hands on it (the project is as mature right now as Steve Ballmer; and that’s virtually indicative of infancy). Other than that, the details are aplenty and if you do use internet on a hand-held, you should definitely give the announcement link a visit.

Tags: , , , , ,
« Previous Page