Desi Founder @ Work

08 Feb, 2009

Carputer Kit for Sale

Posted by: sharjeel In: forsale

Few months back I wrote about my Carputer which I built over the past two years. I've had loads of fun with it, especially when I installed few months ago.

Here's a good news for all those who were feeling jealous :P I'm selling my Carputer.

Mini KeyboardDell Optiplex

Garmin external GPS

The stuff includes:

1) Lilliput Touchscreen 8" LCD
2) Garmin GPS Module
3) Dell Optiplex SX 270, 512 MB RAM, 40 GB HDD
4) A4Tech mini camera for reverse assists
5) Havit Mini Keyboard
6) Wires for car as well as for porting it in home
7) Car Audio Kit

Also includes some good piece of Software installed and configured including RoadRunner, GPS Spanner, Google Earth configured with RoadRunner and many more.

Only serious Geeks should contact. Price is Rs. 41,340 (or $516.75). Lahoris will be preferred.

Tags:

24 Jan, 2009

Why Nerds are Unfit

Posted by: sharjeel In: nerds

A healthy body contains a healthier mind. Keeping this in mind, I floated an idea in front of my colleagues. Here was the conversation:

Me: I think we should have our Cricket team. We should play regularly
PersonA: It won't be useful. No one would play eventually. ... (pause) ... On second thought we will. Now Cricket games have networked multiplayer support as well.
PersonB: Do they run on Linux?
PersonA: You can try WINE. You'll have to recompile a few things to support 3D acceleration and ... bla bla bla

19 Dec, 2008

Subjective well being in Gmail

Posted by: sharjeel In: Subjective Well Being

Every morning I log into my machine, a nice Yahoo Widget shows me the weather of my city in a very nice manner. Today, It was drizzling and when I logged in, it showed me a nice photo of clouds and a five day forecast.

Yahoo Weather Widget

When I logged into GMail today, I noticed that the theme was slightly different  than everyday. Was there any rain element previously in the theme? No. Gmail changed the themes slightly according to my weather. And made me smile :)

GMail - Weather localization in Theme

Although this small feature is not a core functionality of an email system,  small tweaks like these make your day; they also differentiate mediocre products from refined ones. Features like these differentiated Apple's iPod with all other MP3 players in the market

Tags:

16 Dec, 2008

Some good products by Microsoft

Posted by: sharjeel In: Uncategorized

Microsoft is the company everyone loves to hate and I am not an exception. But I think we have gone a bit too far in our prejudice. Surely there are looser products by Microsoft such as Internet Explorer which do not care anything about users and prevent the market from taking a good direction. But on the other hand Microsoft also has built products which have changed our lives and most of us really like to use but somehow we don't admit.

I gave some thoughts to it and came up with a list of Microsoft products I really like:

Windows Mobile

I love this mobile operating system! I've owned two Windows Mobile based devices (HTC TyTN II & P3300) and never had a slightest of regret. The version of 6.1 just works great! It is smooth, handles multitasking very well, mobile Office is great and there are so many useful third party applications available. The only thing I don't like about Windows Mobile is the bundled Pocket IE. But you can always install Opera Mini or Opera Mobile.

I find Windows Mobile way better than iPhone, Blackberry, Android and Symbian platforms.

Microsoft Office

I've used a lot of Office suites out there (OpenOffice etc) but nothing comes closer to Microsoft Word, Excel and Outlook. They've worked hard on improving Office to keep their users happy and if you analyze the complexity of these products, you'd realize that they've done a good job. Also, they've been relatively quite fair in this competition :)

Windows XP

Yes! Thats true. Though Windows XP is not something that I am a die hard fan but I find it certainly better than having any other OS on my desktop, especially Linux. I want something that is OK out-of-the box, not something which I have to tweak hard to make really cool. Windows XP serves this purpose really well. However I must congratulate Microsoft for taking a step backwards and coming up with Vista.

For the Mac fans out there: I like my computer running without the cover and hard-disk outside the casing. I would love to make MacOS X my primary OS on my cheap hardware but not until it becomes legal to do so.

Tags:

There are documentaries and movies like Triumph of the Nerds and Pirates of Silicon Valley which give an insight into how Steve Jobs and Steve Wozniak started apple and revolutionized the PC industry. There is a lot of other material out there too accurately based on what was initially recorded in the history. But did history accurately record what really happened?

According to Steve Wozniak's autobiography "iWoz: Computer Geek to Cult Icon" a few of the facts went inaccurately in the history and they stayed like that. Even to this day people are of their belief. Woz has tried to get some facts straight.

Here is a comprehensive list of widely believed facts that, according to Steve Wozniak, were inaccurately recorded initially and got spread:

  • Steve Jobs and Steve Wozniak were not classmates. They were several years apart. Though Jobs attended the same school Woz did.
  • Unlike Steve Jobs, Wozniak did not drop out. He took off from Berkley and after doing Apple-II he returned to school and completed his degree.
  • The two Steves did not design the first Apple computer together. Steve Wozniak did it alone.
  • Steve Wozniak did not quit Apple in protest. Although he was not satisfied the way Apple II team was treated, his main reason was that he wanted to start a new company to develop universal, programmable remote controls.
  • Steve Jobs was never fired from Apple. Steve resigned from Apple in 1985 after he was stripped of his responsiblities by the board.
  • When Steve Jobs returned to Apple, iPod and iMac were already designed by Jonathan Ive. Steve just put certain things in order and marketed them really well.
  • Technically, Steve Wozniak never left Apple. He's still on Payroll of Apple and holds an employee cards even to this date!

We've submitted See'n'Report at Knight News Challenge 2009.

Here is the link to the grant application. The application not only describes our current status but also envisions our long term objectives.

I'd like to request everyone following my blog, especially the django community, to rate and comment it.

25 Oct, 2008

Recursion, Misunderstood

Posted by: sharjeel In: Programming

My experience with the Electrical Engineers in academics is that they usually view Computer Science in terms of circuits and details of how things work at the most tangible level. One hazard of using this approach in teaching is that many times you end up with some wrong core concepts of Computer Science. They enable your abstract level thinking at large. The worst part is, you don't even know that your concepts are incorrect yet you are very confident about them.

My undergrad CS program at FAST-NUCES was heavily dominated by dedicated and competent Electrical Engineers. That is why my classmates and I have really good C/C++ programming skills, great concepts about pointers, indepth understanding of microprocessors work, how implementations of Operating Systems take advantage of them at the very nitty gritty level and have strong knowledge of other implementation specific things. On the downside, I feel such students have some gaps left in their personalities towards the mathematical face of Computer Science.

Perhaps the most commonly misunderstood such topic is Recursion. For me, it was a shock to know, after about two years of my graduation, that what I knew about recursion was quite wrong. I, along with many others were taught (and are still being taught) that recursion is about a function calling itself.  When a function calls itself, a separate call is made, the parameters and some other info is placed on stack and a new 'instance' of function takes over until it returns. If this process goes on infinitely, the program would end with an overflowed stack so there must be a base or terminating condition. The instructors would give us assignments in which recursion had to be "removed" by explicitly storing some state information on a stack so that a new call to the same function was not made. The emphasis of these assignments was that although "recursive" code is simple, recursion has a huge overhead which should be removed in most of the cases.

This is not recursion! This way of looking at recursion might be OK for a low-level C/C++ programmer who wants to build his career coding micro-controllers for the rest of his life. But these concepts of recursion are certainly disastrous for a Computer Science Major who wants to truly appreciate the beauty of algorithms.

I was lucky to learn Lisp after my graduation which gave enough abstraction from low level nitty gritty controls such as memory management and pointers as well as complex syntax, to let me focus on the problem itself rather than going into syntax.

What I learnt then is that recursion is solving a problem by deferring until it's subproblem and reconciling the solution of the problem with a simpler computation. The subproblem itself is solved in the same manner until the subproblem becomes so simple that it's solution is trivial. In mathematics, this is called inductive step.

This seems much like the former view but it's implication is quite different. The second definition of recursion implies that a function calling itself may not necessarily be forming a recursive solution. For example the following two implementations of factorial call themselves but the first one is recursive while the second one is iterative:

; Recursive
(define fact
   (lambda (n)
      (if (= n 0) 1
         (* n (factorial (- n 1))))))
 
; Iterative
(define facti
   (lambda (n, c)
      (if (= n 0) c
         (facti (- n 1) (* c n))

The reason facti is not recursive is that it is not deferring any computation.

The equal implementation of these in Python would be:

 
# Recursive
def fact(n):
   if n == 0: return 1
   return n * fact(n - 1)
 
# Iterative
def facti(n, c=1):
   if n == 0: return c
   else: return facti(n - 1, c * n)

Also, a function not calling itself may still be a recursive function. For example, an explicit stack storing different states to avoid function calling itself is still recursive!

PS: If you still don't get what recursion is, see "Recursion, Misunderstood" by Sharjeel Ahmed Qureshi.

20 Oct, 2008

Installing OS with Bootable USB

Posted by: sharjeel In: sysadmin

Laziness is a quality of  great programmers. I tried to be amongst them by not taking the headache of putting a DVD-ROM Drive in my new test server machine for installation of an Operating System. And who really wants to get bothered by unscrewing the case, connecting the drive's data and power cables, burning the CD, putting in and booting up from the mechanical stuff anyway.

Maybe it took me more time to figure out the way of booting an ISO image from my USB Flash Drive than the above procedure but it was certainly more fun. The next time, installation will be just plug n play for me; without the need of disconnect n connecting cables (No, I don't like to keep a DVD-Drive fitted in any of my machine).

The process is very simple. Just download and run UNetbootin. Choose the ISO image you'd like to boot from (In my case, it was Ubunt 8.04) and the USB drive on which you'd like to write on. Click next, and in a few minutes you are done!

It works great under Linux as well as Windows.

Tags: , , ,

08 Oct, 2008

Car parking @ LUMS

Posted by: sharjeel In: Eye-Witness

Bob Sutton, author of "The No Asshole Rule" writes:

"One of the examples of rude behavior that comes up in The Civility Solution is people who park in obviously selfish ways.  I was talking to a friend of mine the other day and she complained about someone we know who prides himself in taking two spaces (just like the above picture) to protect his car from door dings. I think that is a nearly perfect example of someone who is so self-absorbed that they don't even consider the negative effects of their behavior on others. It is also pretty similar to how CEO Paul Purcell defines an asshole at Baird -- someone who consistently puts his or her self-interest ahead of others.  I would love to see the correlation between parking behavior and scores on the ARSE (the asshole rating self-exam)."

What I experienced today at Lahore University of Management Science's parking beats any ARSE score, if there exists a direct correlation. Due to construction in University, the parking is limited and sometimes it takes up to 10 minutes to roam around the campus and find a good parking space.  I spotted an apparent space in a corner but when I got there I found this:

LUMS Car Parking

I don't know about Bob Sutton's correlation but surely there should be a relation between being educated and being civilized.

02 Oct, 2008

django standalone scripts

Posted by: sharjeel In: Programming

Standalone scripts and cron jobs are integral part of any significantly complex web based application. We use them in our applications for health monitoring, mails sending, computing scores and ratings, deferred tasks and job queues such as video processing etc.

To make a python script work which uses django's functionality, you need to have the required environment variables set: your application's path in your PYTHON path and name of the settings module in DJANGO_SETTINGS_MODULE. If you are using Unix, you can set these in your bash_profile so that each time you log in, the environment variables are already set.

For instance, if your project's name is myproject, then add these lines (with appropriate changes) in ~/.bash_profile file:


export PYTHONPATH="/home/path/to/myproj/"
export DJANGO_SETTINGS_MODULE="myproj.settings"

Now you can write and execute a python script which imports models and views of myproj.

CronJobs using the django models or views also need these environment variables which can be set at the top of the crontab file. Open the crontab file using this command on shell:


$crontab -e # Edit the crontab file

Put these lines at the top to pass required environment variables to any subsequent cronjobs


PYTHONPATH=/home/path/to/myproj/
DJANGO_SETTINGS_MODULE=myproj.settings

If you use webmin for scheduling cronjobs, you can create environment variables from from the menu.