Tuesday, March 10, 2009

Pakistan's Software Industry Celebrates Achievements

By Anthony Mitchell
E-Commerce Times 

Pakistan's software industry recently feted some of its own success stories, handing out awards for various products. The achievements highlight Pakistan's growth as a destination for outsourcing thanks to its skilled and relatively inexpensive labor pool.

To read more please follow: http://www.ecommercetimes.com/story/65046.html

Thursday, February 19, 2009

Shikwa-e-Programmer - With due respect to Allama Iqbal

Hum say pehlay tha teri product ka ajab manzar
Kahin code tha phatta kahin functionality thee sifer
Mehv-e-Khuwab-e-Khurgoosh thee PM ke Nazar
Manta phir koi mujh jaisay coder koo kyounker
Tujh koo maloom hay bikta tha kiya Software tera?
Aakhir meeri he product nay kiya kaam tera?

Bus rahay thay yahin PM bhee, consultants bhee
Ahle QA, SQA main cabins main architects bhee
Issi floor per aabad thay marketers bhee
Issi duniya main Analyst bhee thay designers bhee
Per teray clients kee mushaq'qatain uthain kis nay?
Baat jo bigri hovi thee woo banai kis nay?

Thay hamein aik teray mourka aaraon main
Kabhi office main kee coding kabhi Khala'aon main
Dein client koo kabhi topiyan hawaon main
Kabhi patch main, kabhi exe main kabhi sadaon main
Shaan aankhon main na jachti thee Jahandaron ke
Jeetay martay thay hum chao'on main talwaroon ke

Hum joo jeetay thay too coding ke musebat kay liyay
Or martay thay company ke Azmat kay liyay
Us pay shikwa kay kee coding apraisal kay liyay!
Raat bhar kaam keya kartay thay kiya phokat kay liyay?
Coders itna he agar khush hoota too wafa karta!
Four thousand kay liyay kabhi job swith na karta

Kuch na khatay thay agar office main ruk jaatay thay
Paaon TL kay bhee maidan say ukhar jaatay thay
Bug jo sirkush hova koi too bigar jaatay thay
Interface kiya cheez hay hum code main ghus jaatay thay
Code phat chuka thaa joo aakhir woo chalaya kis nay?
Bhund joo Mgmt ka thaa uskoo nibhaya kis nay?

Aagaya ain coding main agar waqt-e-namaz
Qibl-ru-ho kay zameen boas hoi apni zaat
Aik he suf main kharay hoo ga'ay TL kay sath
Na koi TL raha or na koi PM yaad
Banda-e-Sahib-O- Muhtaj-o-Ghani aik hovay
Uspay shikwa hay kay hum panch minute late hovay

Wednesday, February 4, 2009

Implicitly Typed Local Variable in C#

Confused…. Yes, now a local variable (method level variable) can be declared without declaring its type In Csharp 3.0, something new to Csharp. The type is then infered by the value assigned to it. Once you assign a value to such variable then it’s type is infered by the compiler and thus making it type safe. Following are the impliaction towards it uses.

1) Can only be defined in local scope (Mehtod level).

2) Declaration must follow var keyword i.e. var myVariable = (value | Expression). Please note that if you are declaring and assigning a var type with a literal then it is much wiser to use explicitly typed variable :) . Following are few valid declarations.

var myVar;

var myVar = row["SomeColumn"]; // Where row is of type DataRow and contains.

var myVar = 0; //Valid but since you know the type in advance it's not a good style use int myVar = 0;

var myVar = [Some expression];

3) Implicity type identification is not to be mixed up with Variant type in VB and Boxing and Generics in Dotnet. Variant is such a type whose type is variable or can be changed. Boxing and UnBoxing at the otherhand are performed at runtime and so does some part of Generic implementation is. At the other hand implicit type inference is completely compile time and doesn’t effect performance of your code. It is just that the compiler infer the type and then replace it in the declaration at the place of var keyword (just thinking abruptly). 

4) Initialization with null is not supported by these variable. i.e. you can’t use the following.

var myStringOrObject = null; //Invalid statement. No way for the compiler to infer.

if (someThingIsTrue)

    myStringOrObject = MyClass.MyMethodWhichReturnsObjects();

else if (someThingElseIsTrue)

    myStringOrObject = MyClass.MyMethodWhichReturnsStrings();

if(myStringOrObject == null) //Sequence of actions goes here.

else if (myStringOrObject is String) //Sequence of actions goes here.

else if (myStringOrObject is Object) //Sequence of actions goes here.

Wednesday, December 3, 2008

A Threading Query

Consider the following block of code…
//Csharp code snippet..
Line 1: Thread t = new Thread (Go);    // Assume Go is some static method
Line 2: t.Start();
Line 3: t.Join();                      // Wait (block) calling thread until thread t ends 
- In calling thread at line 1 we created a thread object.
- On Line 2 we started the thread t.
- Then on line 3 we are calling Join() method of Thread t which serves the other way around. 
   I mean if you think logically t.Join() causes the calling thread to wait untill thread T  completes.
   The join() method is a busy waiting technique… i.e. The main thread is engaged in a continuous
   loop checking for thread t.IsAlive property to be false. t.Join() syntax is also an invalidation of an
   important OOP concept, “Encapsulation”… i.e. in t.Join() we are actually blocking Main thread
   instead of working on Thread t.
I don’t know how many of you agree that logically it should be the other way around (i.e. One
should be calling Thread.CurrentThread.Join(t) instead of t.Join()).
Any one thinks of a reason why the Thread.Join() method was implemented like this??

Friday, November 28, 2008

Surface Computing

Many of us might have heard the term Surface Computing and for those who didn’t, “Its the term for the use of a specialized computer GUI in which traditional user Interface elements are replaced by everyday objects. Instead of a keyboard and mouse, the user interacts directly with a touch-sensitive screen.” Hence a surface computer is a computer that interacts with the user through the surface of an ordinary object, rather than through a monitor and keyboard.

 Suface Computer GUI  

Earlier work in this area was done at the University of Toronto, Alias Research, and MIT. However Recent minor innovations in the surface computing field are attributed to Apple, Inc and to Microsoft Corporation. Apple had demonstrated surface computing interfaces intended for professional use since 2006, with no expected product release date. Microsoft unveiled plans for the Microsoft Surface in May 2007. The Microsoft Surface (code name Milan) seems to be closer to production. Finally, there is Linux surface computing software aswell, called Linux MPX.

The Surface is a horizontal display on a table-like form. Somewhat similar to the iPhone, the Surface has a screen that can incorporate multiple touches and thus uses them to navigate multimedia content. Unlike the iPhone, which uses fingers’ electrical properties to detect touch, the Surface utilizes a system of infrared cameras to detect input. Uploading digital files only requires each object (e.g. a Bluetooth-enabled digital camera) to be placed on the Surface. People can physically move around the picture across the screen with their hands, or even shrink or enlarge them. This could be the next generation of KIOSK. Below is the diagram from Microsoft Surface (Codename Milan).

 Microsoft Surface IllustrationMicrosoft Surface

1. MultiTouch Screen: This is the multitouch screen display. The Surface is so far advanced than we could imagine that it can recognize objects by their shapes or by reading coded “domino” tags when placed on the table.

2. Infrared: Used for collection input/s. When objects touch the tabletop, the light reflects back and is picked up by multiple infrared cameras. 

3. CPU: Surface uses many of the same components found in everyday desktop computers.

4. Projector: These are set of projectors inside to display images. 

references: http://www.microsoft.com/surface/index.html  

Tuesday, November 25, 2008

Brain Teaser # 1

Three people check into a hotel. They pay Rs 3000 to the manager and go to their room. The manager suddenly remembers that the room rate is Rs 2500 and gives Rs 500 to the bellboy to return to the people. On the way to the room the bellboy reasons that Rs 500 would be difficult to share among three people so he pockets Rs 200 and gives Rs 100 to each person. Now each person paid Rs 1000 and got back Rs 100. So they paid Rs 900 each, totalling Rs 2700. The bellboy has Rs 200, totalling Rs 2900. Where is the missing Rs 100?

Monday, November 24, 2008

Behind every CLOUD is another CLOUD

As we all know we are entering into cloud era where to build an application like Youtube, mySpaces, etc an individual does not have to worry about massive infrastructure to serve millions of user requests, data centers, database space, memory, scalability and moreover administration and maintenance of such a big infrastructure. Amazon, Google and Microsoft have provided us these infrastructure for minimal cost and with application platform to build such big applications.

Amazon is in cloud business for quite long time with its Amazon Web Services, S3 (Simple Storage Service), EC2 (Elastic Compute Cloud) and SQS (Simple Queue Service) services, Google have provided this platform few moths back with its GAE (Google App Engine) and BigTable for Data Storage and now Microsoft came up with its Windows Azure, Live Services, .Net Services, SQL Services, Dynamics CRM Services, etc. Now an individual or small firms can easily access world level ground to compete with old big giants. Good thing is that Google and Microsoft have provided these services initially free to a certain limit so any one can start building such application right now without any constraint

Below is an article explaining the advantage of cloud war to Asian software firms and individuals.