Aftab Sultan

Talkin' Geek

A few weeks ago, I received my free BlackBerry PlayBook from RIM. After playing around with it, I realized there wasn’t a built-in file browsing app nor was there an app on the AppWorld that allowed the user to browse the full QNX file system.  I then spent a couple of days coding one of my own. It wasn’t a full blown file management app – it allowed file/folder browsing and deleting files (pretty much all that I needed for personal use).

I named it File Browser and put it up on BlackBerry AppWorld so others can benefit from this. To my surprise,  in a matter of hours after it published, it became #1 in the top purchased app for PlayBook and #3 in the top purchased app in the whole of AppWorld (PlayBook and BlackBerry smartphones combined).

File Browser top paid

The feedback I got for this app was very supportive and so constructive that I decided to continue the development on it and so far it has evolved into a full blown file management app with support for packaging and unzipping ZIP archive files. I am currently working on integrating FTP support for it. I will keep updating it as I get time to work on it.

Since its initial launch, there have been many other apps following the footsteps of File Browser that give the user unique ways of interacting with the QNX file system and I believe overall experience people have with the PlayBook device has been greatly enhanced because of this.

I recently started playing around with the BlackBerry PlayBook SDK and the free PlayBook offer was too good to pass up. So far I’ve had two applications approved for sale on the BlackBerry AppWorld for the Tablet OS Platform. Without further ado here is a list of my published apps:

Offline Viewer

Description: Offline Viewer allows the user to view webpages saved locally. Simply click the open button and pick the webpage you wish to view. It’s that simple.

Price: FREE

Get Offline Viewer on AppWorld


Description: Use your BlackBerry® PlayBook™ as a flashlight in dark environments.

Price: FREE

Get FlashLight on AppWorld

You can access my BlackBerry AppWorld vendor page here.

I have a ton of ideas for more apps and will start working on new apps as I get time. I am currently polishing up my Android app and will be posting it on the Android and Amazon app store soon – so stay tuned for that.


The Problem:

While trying to install Windows XP after having installed Windows 7 or Windows Vista first, a blue screen of death (BSOD) appears.

The error message basically says

A problem has been detected and Windows has been shut down to prevent damage to your computer.

STOP: 0x0000007B

The Solution:

There could be numerous issues that could cause this problem including memory, hard drive issues, etc. The problem for me was the SATA setting for my Lenovo T400 was not configured properly.

The following steps may vary depending on your hardware:

  1. Restart the machine
  2. As the machine boots up, enter BIOS setup
  3. Using your cursor navigate to Config
  4. Navigate to Serial ATA (SATA)
  5. Change the SATA Controller Mode Option to ‘Compatibility’ [or IDE]
  6. Save the setting and exit
  7. Reinstall Windows XP

That should do it!

April 25th, 2010

A whole word trim function

No Comments, code, PHP, Web development, by sultanaf.

Recently while upgrading the templates for this site to make it more mobile friendly, I decided to trim the post content on the front page to limit it to only show the first 10 or so words of the post. Obviously the substr function in PHP won’t work since it will simply cut off the string at x characters and possibly cut off words.

To my knowledge no such function exists in PHP so I wrote a function of my own with regex goodness. Heres the code:

This function will trim a string to x characters and truncate to the last whole word.

str is the string to be trimmed
x is the number of characters
postfix is the string to append to the end of the trimmed function

function trim_to_word($str, $x,  $postfix='...') {
$str_len = strlen($str);
if ($str_len > $x) {

# Modify this line to customize the matching criteria
$r = '/(.{' . $x . '}.*?)\b/'
preg_match($r, $str, $matches);

# Trim the right side of the matched string and append the postfix
return rtrim($matches[1]) . $postfix;
else {
return $str;

April 22nd, 2010

[FIX] Another StarCraft 2 lag fix

3 Comments, starcraft 2, by sultanaf.

Aside from the previous fix I posted, I have another fix for the in-game lag in StarCraft 2. The lag could be caused by the GPU rendering the frames at max speed which might cause the video card to overheat and slow down the game.

The following will help by telling StarCraft 2 to limit the behavior:

  1. Open My Documents\StarCraft II Beta\variables.txt using Notepad (or any other text editor)
  2. Add the following two lines to the file:
  3. Save the txt file and you’re done.

The frameratecapglue variable controls menu screens framerates. The frameratecap controls the in-game framerate. I have chosen 60 as I am running this game on a laptop (60 is the max refresh rate for my monitor) but you can choose any number that fits your configuration.

April 17th, 2010

iPad in-dash project

No Comments, Audio, Cars, iPad, by sultanaf.

Regardless of what you think of Apple’s new iPad, I think this is a very cool project. A lot of the new cars already have a touch screen interface but for those who don’t I think this is a pretty good idea.

With wireless syncing. the process of adding new songs can be simplified. With a decent GPS app combined with its big screen, this has a lot of potential. Of course if one wants to go hardcore, an OBDII scanner can be integrated to show useful information about the car like intake air temp, error codes, timing readings, etc.

Keeping the cost aside, one potential problem I see with this is sun glare. Also the screen placement might be awkward and of course having a visible $500 iPad in a parked car is asking for trouble (it’s removable, so you can take it with you, I guess).

Part 1:

Part 2:

The Problem:

I’ve been playing the long-awaited StarCraft 2 (Beta) recently and it doesn’t disappoint. I am running Windows 7 (64 bit) with an ATI Radeon HD 3400 video card. I ran into some complications while playing the game. Specifically, it would freeze in-game for a while and sometimes long enough for me to be dropped from the game.

The Internet?

At first I though it was my internet connection which was causing the lag. After some investigation, it turns out it wasn’t the internet connection (the game was also freezing during replays as well).

The Video Card?

Next I suspected the video card was over heating. I ran a temperature monitor with a CPU monitor while playing the game. It seems that under normal game play, the temperature was around 70 C. Once the game froze, the GPU temperature dropped and the CPU usage spiked to 100%.

The CPU?

After digging around a little bit, I came across a few threads on people having the same problem. They seemed to have fixed this problem by running the game on a single CPU core instead of the default multi-core setup. Specifically CPU 1 seems to be the magic core. I tried that but with no success. It was time to dig a little deeper.

The Solution:

The problem lies with Physx. StarCraft 2 comes with a version of Physx but with certain drivers, the latest version is required to run the game smoothly. Physx basically allows the game physics to be CPU powered rather than being powered by the graphics card. it is also referred by some as Software Physics. Make sure you have the latest version of Physx installed. it is required regardless of whether the you have an ATI or nVidia card. This should do it!

If you are still having this problem, add -skipopenal -nocpubinding to the Target field of the StarCraft 2 shortcut and try again.

Enjoy 🙂

UPDATE: I have posted another possible fix here.

April 16th, 2010

Mobile version now available

No Comments, Mobile, by sultanaf.

I just upgraded the template to allow comfortable navigation of the site with smart phones. The theme is pretty simple right now but I’ll be updating it regularly with new features. You can check out the mobile version with a normal browser here.

I recently had a chance to work with JQuery for a web development course. JQuery totally changed the way I think about JavaScript. The best part is the ease by which you can make AJAX calls. For those starting out with JQuery, this cheatsheet is a must have!

For those who missed the xkcd fun on April Fool’s, you can still access the page here. After spending some time messing around with it trying to find the easter eggs, I ended up looking at the source code (kind of cheating, I know lol).

With the beginning of summer, this means one and one thing only: StarCraft II.