Sunday, November 29, 2009

Karma in Computer Science and the Story of Abbas

For those who don't know what Karma is, here it is in my own words.

In religion if you did something bad, something bad will happen to you. If you did something good something good will happen to you based on your actions. In Islam we call this العدالة الإلهية or the Ultimate justice, In Buddhism its called Karama.

Scientifically, If you do something good or you did something bad there is an amount of energy that you release whether positive or negative, this amount of energy someday will come back to you (the source) .

The Unfortunate Driver
Let me tell you a story about how Karma does its magic.

One day an employee was late for work in the morning, so he drove fast and start overtaking a car in front of him. The other driver was angry, and he also started to overtake the next car, the next driver seeing this overtake the next car.. and so on.

In the end of the day our employee leaves his work. On his way to the parking he was hit by an overtaking car, a car from the same series he created earlier this day.

Karma will find you.

Abbas and the Process.Kill()
OK. Now can this apply this to computer science. Let me tell you a story that will explain the whole thing.

Once upon a time there was a developer lets call him Abbas. Abbas was a brilliant developer, he does his tasks quickly and he rarely says I don't know. One day Abbas encountered a weird error upon closing one of the application. He didn't know the source of the error and after half an hour of searching he gave up and decided to apply a quick fix by simply kill the process on the exit this way .NET garbege collector won't have the time to show this error. It WORKED.

The clients were SO happy the damned error upon closing the application disappeared. The application has been submitted, and the maintenance period finished.

One day one of the clients reported that no matter what edits and changes he apply to the application, they are not saved. So the client IT team started to do their research and stumbled upon a piece of code that kills the application process clearly marked with a comment -Abbas and dated. It appears that killing the process prevented the application from running the On_Close event on which the saving of the data is being done.

Karma found Abbas.





Sunday, November 22, 2009

In your next project hire an Actor

Most Projects overrun both in time and funding due to many reasons. Among these reasons is the not my job mindset. The concept of an employee not welling to break the chain of his knowledge that is tying him down from seeing the big picture. This phenomena leaves developers apart from engineers and engineers apart from managers.

If an Engineer gives a developer a set of requirements to develop a simple tool, the developer will simply slam down the requirements one after the other as code. Lets take an example.

Example
* Create a tool that will allow the user to select a Transformer and display the customers being fed from this transformer in a pop-up form.

The developer will simply do the simplest logic possible and show the customers he will show all the customer information (SELECT * FROM CUSTOMERS). He doesn't care if the engineer need all or one of those fields.

If in this case the developer tries to put his shoes in the engineer (i.e. acting like an engineer) the results will be different.

The developer will say, if I am an engineer, what I want to see in the customers form? I need to see each customer address but most important I need to see how much each customer is consuming from that transformer in terms of percentage. Perhaps I should show that information on the map and make it more sexy by adding some color coding, red are high usage customers, green light usage customers.

Now some of you will say, developers hardly have the time to code what they have, they won't find the time to think like this and waste time. I say exactly the opposite, impersonating the client actually speeds up the development process. The reason is there will be less fixing and iterations and ping ponging between the client and the developer. Moreover, it will increase the quality of the application and promote your developers in seeing the pig picture instead of their own narrow space of sight.

This process is called Empathy. Try going to an acting class, I took Dan Pink's Advice and did go, I am really am improving in seeing

Sunday, November 15, 2009

L-Directed Vs R-Directed Thinking





Perhaps you got tired of hearing all the fuss about the Left Brain and Right Brain Thinking. But If you know that those very two hemispheres are the origins of almost everything in this world you will appreciate study them more.

L-Directed Thinking is the process that is done by the left hemisphere of the brain. Here goes the analysis, sequenced logic, 1+1=2 like of logic, computation of complex formulas etc. Basically computers are great at stuff like this.

For example playing chess is an L-Directed thinking approach, You can NEVER beat a computer at Chess, because basically your Left Brain is not as fast as a computer, in performing sequenced steps. The computer will basically calculate ALL your possible moves and encounter it easily.

Garry Kasparov the Chess Champion beat the first computer at Chess, and the second one, but he couldn't beat the third.



Now, If you bring a violent picture and you feed it to a Cloud of computers in order to detect the type of this picture; A 6 years old kid can instantly know that this picture is violent in less than a second where the Cloud can report it after days and most of the time the result is wrong.

This is the power of the R-Directed Thinking which cannot be replicated by a computer yet. So the Right Brain is responsible for emotions, parallel, pattern detection. Whereas you can replace a human left Brain with a Machine.

When you look at someones face, you don't see her nose first, then her eyes, then her lips. You see her face as a whole, in parrallel. Thats the power of the R-Directed thinking.

Imagine your wife is cooking dinner. She asked you to bring some stuff from the store. You forget an important stuff. The wife looks at you and say, "I'm going to the store". Now your left brain will know that this woman in front of you aka your wife, is going to the store. But your right brain will detect that she is angry because you didn't bring the missing ingredient. No Computer can do that.



In another post I will explain the power of the R-Directed thinking and why the R-Directed thinkers will lead the world as Dan Pink explains in his book a Whole new Mind. This post is an inspiration by his book.


Thursday, November 5, 2009

ArcGIS: Export Selection as a New Layer Different Source

From time to time, I like to do some handy tools that I just feel that someone will use it one day. Take the Twitter Extension for ArcGIS for instance that allows you to login to ArcMap with your twitter account and tweet from Arcmap. I got some emails from people who actually said they made use of the code. Some said that they created an account that will automatically tweet tasks done by users. Some used it to tweet when a warning when certain location on the map is viewed at a certain scale.


This time I developed a tool for ArcMap, that allows you to select some features in the map. Click a button and it will create a new layer, export your selection into a personal geodatabase in temporary location and set the new layer to that new source.

The new layer will contain the new selection ONLY, you can do many things with it, change symbology, use definition query etc..

And It works on any Data source doesn't matter if its SDE/PGDB/File GDB/Shape file.




Here is a Video



Here are some snaps.












Download Script
Download Script






Monday, November 2, 2009

Quantum Consciousness - Fear








I've been digging into Quantum Mechanics the last couple of months and really dove into the conscious part of this science.

Imagine yourself at a deserted cemetery 200 miles from the nearest city. No lights, midnight, no sound, just the sound of your foot stepping on the sand and dry leaves as you walk between the graves.

Now the last thing you think of at this moment is picking the Laundry or preparing for work tomorrow, or the virus at your machine or the chapter you skipped from the last book you read. You will keep thinking that some ghost will come and squeeze your soul out of the tip of your toe while screaming very load. Or perhaps an ugly old grandy coming out of one of the graves and running very fast with her back bend towards you to eat your pretty head.

Those thoughts become so sharp, so clear, so thin that increases what physicists called the Energy Density and make those thoughts move to a part of your brain called the Frontal Lobe. At this time, those thoughts, those ideas, those concepts become real.

So you might really see something really weird coming to you because you believed that it will come to you.

Should you achieve this in a fear mode, you can do the same in the normal mode. Say like, you can create a 20 BD in your hand if you believed in it enough. That's how prayers work too to a certain extent. Its about what you believe in.

EDIT: That is turned into a movie. The Apparition [2012]