Whiz Kid Woes

Faisal's Personal Blog

Sunday, June 25, 2006

Blog Moved!

PTA has blocked the entire blogspot.com domain and blogging has never been the same for me ever since. I can still hack my way to blogspot.com but it just doesn't feel the same. I've moved my blog to my own site:

http://www.nasim.org/blog/.

Thursday, March 30, 2006

Softec 2006 - FAST episode

Softec this year was much more than a programming competition. It was a great learning experience for me! I've divided the entire visit into several segments.

The FAST Lahore Episode:

On day 1, we were only able to solve 1/5 questions which was pretty bogus as most of the other teams got 1 too! Some even got 2 and 3 so the test day didn't work very well for us. Actually the test day was very helpful for a warm up and we made full use of that. On second day, we heard that there were some internal problems due to which the 5-hours competition which was supposed to start at 9:30AM actually started at about 1:00PM. The competition was intense with about 50 teams from all over Pakistan and India. We clinched first position by solving 5/9 questions. LUMS came second with 4 solutions and PUCIT came third with 4 solutions as well.

We had fourth position in the first-ever competition we entered in Procom 2005 (FAST Karachi), third in Softec 2005 (FAST Lahore), second in ProQuest 2005 (ACM-KU) and finally first in Softec 2006!

Tuesday, February 21, 2006

Travelling Salesperson

I'm taking an AI course this year and we have started to study some algorithms which will involve graph and tree traversals. For starters, we were given a very stripped down version of the travelling salesperson algorithm to work out in C/C++/C#/etc. The graph is undirected and each city can be visited only once, the salesperson must start from A, visit all cities and come back to city A. The values along the paths are the cost associated to the travel to each city. The task was to devise an algorithm which would compute all the possible paths and would give the total cost of each route. I devised a generic solution (it still can't do city repetitions and it assumes that all cities are to visited). The first algorithm was aimed at solving the problem at hand and was a quick and dirty solution to get the job done. It wasn't thread-safe and it used fixed-size data structures. The output was as follows:

ABCDEA - Cost: 940
ABCEDA - Cost: 920
ABDCEA - Cost: 920
ABDECA - Cost: 995
ABECDA - Cost: 875
ABEDCA - Cost: 970
ACBDEA - Cost: 975
ACBEDA - Cost: 930
ACDBEA - Cost: 930
ACDEBA - Cost: 970
ACEBDA - Cost: 910
ACEDBA - Cost: 995
ADBCEA - Cost: 880
ADBECA - Cost: 910
ADCBEA - Cost: 855
ADCEBA - Cost: 875
ADEBCA - Cost: 930
ADECBA - Cost: 920
AEBCDA - Cost: 855
AEBDCA - Cost: 930
AECBDA - Cost: 880
AECDBA - Cost: 920
AEDBCA - Cost: 975
AEDCBA - Cost: 940
Smallest Cost: 855

After that I redesigned the solution to be thread-safe and more organized with lesser hacks. I still have to incorporate a bunch of features. Here is what the header of tsp3.cpp reads:

// TODO:
// MUST VISIT: allow user to Nodes.mustvisit (char) for nodes that MUST be in the solution
// ALLOW REPEAT: a flag which tells us if cities can be revisited to find the most optimal solution
// TRAVEL: Nodes.Travel(src,dest) and take into account MUST VISIT and ALLOW REPEAT and give possible solutions

The solution I designed inherently supported directed and undirected graphs so that is one less thing on the TODO list.

Tuesday, January 24, 2006

Playing with Lego Mindstorm

We're doing a AI and Robotics Workshop under IEE NED Chapter. Uvais bhai was generous enough to leave his Lego Mindstorm kit with me so I could mess around with it. He has an extra RCX 2.0 module which he has borrowed from Basil (another cousin, 10 years old).

Here are the first two vehicles I have designed. The bigger one will be the star of tomorrow's workshop! It is fitted with two light sensors which help the vehicle steer through a black line. The second one is fitted with two touch sensors and is programmed to simply reverse the direction of motors to forward and backwards upon touching a physical object.

Lego Mindstorm is very simple and it is extremely intuitive. There are a number of cool plugins available for Lego, such as a Video camera and a bunch of other sensors. The only drawback is that it has very few input and output ports. Although they can be stacked but I couldn't see any way to multiplex them using available parts in the kit. I don't have a user manual handy.

Playing with Lego Mindstorm reminded me of the good old school days when I used to play with the DC motors, make my own portable fan and small gadgets and of the good old Meccano which I received on a birthday. I designed so many things using it... once I tried to use my toy car's motor to drive the pulley in a lifting truck I designed using meccano but the motor couldn't take the load. I wish I had my digital camera then or maybe there will be a device in the future which will let me capture an image of whatever I have in the mind! Well, it does exist in Star Trek! I guess I'll have to order one from Starfleet.

Sunday, January 01, 2006

Busy?

"The busiest people I have known in my life always have time enough to do everything. Those who do nothing are always tired and pay no attention to the little amount of work they are required to do. They complain constantly that the day is too short. The truth is, they are afraid to fight a good fight."
Page 51 of Pilgrimage, by Paulo Coelho

Friday, December 09, 2005

TechNet and MSDN at Pearl Continental







Sharah-e-Faisal at 8:50a

Mr. Aseel is presenting TechNet

Seat shortage! People (uncle-type!) are standing in TechNet

Chad is literally throwing away T-Shirts!

We had some fun on the stage!

Munir's first seminar! LOL!

Thursday, December 08, 2005

Wireless Internet

CIS is now offering wireless network in all the labs and I'm enjoying 100KBps downloads!






The wireless network added a special touch to our Software Engineering project presentation today. We presented our software 'Video Teleconferencing' for final review today which is developed using C# and SQL Server 2005. I demonstrated how a teacher could deliver a lecture to remote audience while enjoying a walk in the corridor! There is a wireless router in all the labs and moving from one lab to another does not break the connection however it deteriorates significantly, we can always switch to the wireless connection of that particular lab in such a case. I'm thinking of all I can do with wireless connectivity and blazing fast internet...