Latest Publications

Microsoft Deciphered by Google Voice

So here is an interesting voicemail as transcribed by Google Voice. Can you tell me by reading this what exactly I was a member of, and is this some new membership Microsoft just started?

Hi. This is Microsoft calling on my phone number is 1(xxx) xxx-xxxx. Our records of the chair and lesbians subscriptions currently inactive. I’m calling to assist you in react. Waiting your, and the construction we’re doing with me today, rolling the access your benefits and that’s T. N. Sorry, already access the latest development tools, Operating Systems including, Windows, 7 R C 1 and Microsoft software for evaluation purposes. I can offering pricing for a limited time, so give me a call today to take advantage of this promotion again. The number here is 1(xxx) xxx-xxxx. Thank you for choosing Microsoft. If you developers network resource. I have a great day and a great day.

 

In all fairness – I heard the ‘actual’ message and it was an automated recording, probably that’s why google voice got it so wrong …. nonetheless it was very funny reading this. My experience with google voice has so far been excellent – I route all calls to google voice to have it send me an email when I am to busy to take another call – a few times google gets it very wrong ;)

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon

trg tech | The brand, the people and careers

I wrote sometime back about the job openings at trg tech. Since then, because of the absolutely astounding pace at which this company is growing, a lot more positions have opened up.

As you all know (if you read my about page), I am also currently a part of this company or revolution, as we like to call it. This is probably the only company I know of in Pakistan, which will take the young fresh graduates, and the seasoned veterans of the industry and put them together to work on products side by side, regardless of age, experience and other social factors that other software companies in Pakistan might think are important. The result is absolutely amazing, you find yourself fresh grads working their way up with unmatched zeal, and the seasoned professionals exposing themselves to real time application they might have never encountered before.

Taking into consideration that the new entrepreneur, and the professional is judged by how soon he achieves success, this company is the perfect stepping stone for anyone eager to grow. Just head to the CNN website to find 40 under 40 the richest 40 people who are under the age of 40 and its very apparent that the new tech trend favors the young, and adventurous. This also means I only have 13 years to get my name onto that list.

Enough with the ‘sales pitch’. I think the two adverts below should get you curious enough to apply, but do take into consideration that the selection process is extremely thorough. You will show up for multiple interviews across domains that range from simple technical questions to analytical reasoning.

If you are interested, drop me a line in the comment or email me your CV faisal.mehmood[at]trgworld.com.

          trg tech job advert 1                                             trg tech advert 2

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon

Technical Support Flowchart

Now this is an excellent idea from our friends at xkcd.

As soon as I bought my first computer (I was one of few who had this contraption in my city), I have been the go to guy for anything even remotely associated with computers. I have helped family, friends, family friends, friends of family friends, families or my friends …. I think you get the idea.

Well have a look, and have your elders, friends, families, everyone who has ever approached you to fix their “IT” problem, print this page and glue to their  computers!

500x_tech_support_cheat_sheet

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon

GOTO Statements in Programming Languages

During a conversation recently with one esteemed programmer, I discussed the usage of goto statements. I started programming academically in Fortran where the goto statement was ultimately one of the most important piece. This was carried forward when programming in Basic and early variants of VB.

Somehow when we moved to C and especially C++ this practice was deemed as a fatal error. I think the later variants of C++ don’t even allow the goto statement anymore, but back then C gave you the option to jump your logic using a goto statement when using gcc.

So while researching I came acrosss two exceptionally well written points of view. One of them is by Dijkstra who I introduced to you all here. The other one comes from Frank Rubin.

Here are the opposing points of View:

Dijkstra States:

Click on the link below for the complete paper presented by him in 1968.

The unbridled use of the go to statement has an immediate consequence
that it becomes terribly hard to find a meaningful set of coordinates in
which to describe the process progress. Usually, people take into account
as well the values of some well chosen variables, but this is out of the
question becuase it is relative to the progress that the meaning of these
values is to be understood! With the go to statement one can, of course,
still describe the progress uniquely by a counter counting the number of
actions performed since program start (viz. a kind of normalized clock).
The difficulty is that such a coordinate, although unique, is utterly
unhelpful: in such 8 coordinate system it becomes an extremely complicated
affair to define all those points of progress where, say, "n" equals the
number of persons in the room minus one!

 

Frank Rubin’s take on the Statement:

“Let X be an N x N matrix of integers. Write a program that will print the number of the first all-zero row of X, if any.”

Three of the test group regularly used GOTOs in-their work. They produced seven-line programs nearly identical to this:

 

image

 

The other ten programmers normally avoided GOTOs. Eight of them produced 13 or 14-line programs using a flag to indicate when an all-zero row was found. (The other two programs were either incorrect or far more complex.) The following is typical of the programs produced:

 

image

 

After reviewing the various GOTO-less versions, I was able to eliminate the flag, and reduce the program to nine lines:

 

image

 

By any measure not intentionally biased against GOTOs, the two GOTO-less programs are more complex than the program using GOTOs. Aside from fewer lines of code, the program with GOTOs has only 13 operators, compared to 21 and 19 for the GOTO-less programs, and only 41 total tokens, compared to 74 and 66 for the other programs. More importantly, the programmers who used GOTOs took less time to arrive at their solutions.

 

In recent years I have taken over a number of programs that were written without GOTOs. As I introduce GOTOs to untangle each deeply nested mess of code, I have found that the number of lines of code often drops by 20-25 percent, with a small decrease in the total number of variables. I conclude that the matrix example here is not an odd case, but typical of the improvements that using GOTOs can accomplish. I am aware that some awful programs have been written using GOTOs. This is often the fault of the language (because it lacks other constructs), or the text editor (because it lacks a block move). With a proper language and editor, and adequate instruction in the use of GOTO, this should not be a consideration. All of my experiences compel me to conclude that it is time to part from the dogma of GOTO-less programming. It has failed to prove its merit.

 

So I have given you both the sides and I’ll let you decide. Even though I respect Dijkstra a lot and regard him as an authority in Computer Science, I would have to disagree with him on the use of the GOTO statement. C language has break and continue statements which are sorts of a goto – and everyone uses these somehow, somewhere to get something done.

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon

Free Academic Lectures from MIT, Harvard et. al.

50BestWebsites2009-75x75 I’ve been following this for quite some time now and “enrolling” myself in these courses. Looks like the various different websites all around have now given way to one place where you can find them all. The website was recently voted on Time magazines top 50 websites of 2009.

Academic Earth  – http://www.academicearth.com

This website lists some of the best online videos of complete courses from universities like Harvard, Standford, UCLA, MIT etc. For example if you are just starting and entering the world of programming, I would suggest you enroll yourself for free and attend the course offered by Mehran Sahami at Stanford CS106B –

Or better yet, if you are a student of phlisophy I highly recommend the course by Shelly Kagan at Yale – Also on this website.

You can subscribe to courses as podcasts and you can also visit official websites to pick some extra course material like hand-outs and syllabi!

Best of luck! Your Ivy League education is a click away.

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon

Dijkstra’s Shortest Path Algorithm

Dijksta_Anim When in college, I absolutely hated the core required course named algorithms. This changed when I transferred to UT Dallas for my degree. The course that I had failed twice in my previous institution was still a core for UTD – hence I had the opportunity (necessity) to enroll.

The instructor at UTD focused on Pseudo-Code instead of elaborate C++ programs. Which was one of the major reasons why I started liking this course. She would focus on how algorithms affected real life, and how fun it was to apply these to solve anything, e.g. puzzles, brain teasers, network theory – even mapping out the best way to get to college. The world seemed to make much more sense, and we sat there optimizing code using algorithms to come up with the next “Google”.

Though I’ve lost track of some of the numerous algorithms we studied, one algorithm remains my favorite. This is the Dijkstra’s Shortest Path algorithm. All of you who have studied algorithms would probably know this one, but have you ever considered its real life implications?

Here are some examples of where a well optimized algorithm might help you:

1. Emergency Calls (911):

Modern mapping systems and emergency response systems use highly tweaked versions of the same concept to arrive at the best path to reach someone in crisis. The variables here include traffic, road construction etc. 

But the number of variables needed to determine the time required to travel
between two points in a city can be high, and very computationally intensive (weather,
other accidents, construction, train crossings, etc.). For this reason, computer scientists
have focused hard on tweaking Dijkstra’s Algorithm by experimenting with more
efficient data structures, like heaps and buckets, rather than lists, to keep track of which
nodes should be pulled next from the list of unfinished vertices.

2. GPS and GIS systems:

GPS and GIS systems have reached a point where even cities like Lahore which were previously unmapped, now have extensive detailed maps available. This introduces the problem of determining the best path or route taking into considerations as above, traffic and other factors. The shortest path algorithm has found its way into these software packages.

See if you can find applications of this algo in the following fields and any other (comment)

3. Game Theory:

Hint: (Rubik’s Cube) – Google how this is used in game theory. (One of my favorite subjects)

4. Six Degrees of Separation or also Known as Six Degrees of Kevin Bacon

5. Network Routing (this is pretty self evident)

 

Some of the other algorithms you can explore are:

Social media:
  • RSS
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • StumbleUpon