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]


Tuesday, October 20, 2009

Change your dull ArcMap interface to a cool XP Style

OK, this is not rocket science. Its just that you might develop great design for your applications for ArcMap, but it doesn't look so great when you compile your DLL and run ArcMap. It basically converts your application to an ugly Windows98ish classic boring style.

So today I will help you convert ArcMap style from this boring dull interface





To This cool interface







Steps:

1. Download this file
2. Copy it to ArcGIS bin directory, that is C:\Program Files\ArcGIS\Bin most of the time

Your done.



You can do the same with any application, if your application name is say, MyProg.exe, rename the manifest file to MyProg.exe.manifest and copy it in the same directory of your program. It will automatically render your application style.

It works with XP, I don't know about Vista though *unsure*


Enjoy GISing.

Wednesday, October 7, 2009

Google Earth API now Supports Google SKY Data


I was checking my EarthTwit today, and was amazed that Google has embedded the full data of Google Sky in Google Earth API too.

Thankfully without any change in the Code you can tweet your favorite Sky Locations from EarthTwit now easily along with data tags.

Take a look this is Capricornus.

More pictures ...

Thursday, September 17, 2009

Batelco: When able to attack you must seem unable



By Sun Tzu from the Art of War

When able to attack you must seem unable


When you are in the battlefield it is wise to make the enemy feel you are not able to attack to let him gain confidence and go arrogant while you hide your winning cards for a counter attack. That's what the giant telecommunication in Bahrain (Batelco) did.

When menatelecom launched their 8Mbs speed Internet service in Nov 2008, at that time Batelco had only a 4Mbs.

Some of Batelco's customers churn defected to mena. Batelco enabled mena to enjoy this quick small victory and go arrogant.

Batelco waited few more months before it launched a 10 Mbs package even cheaper than mena's 8 Mbs and much more reliable.

Later we learned that this 10 Mbs package was already implemented by Batelco and was under testing when mena came to the market.

Now mena is struggling with the growing numbers of their customers and their service is getting worse everyday. Flip-Flop Customers are going back to Batelco.

Great strategy and a direct hit

P.S. I am not a fan of either side, I just admired Batelco's approach.

Monday, September 7, 2009

Twikemon Launch (Pokemon on Twitter)

Back in June, I decided to write a small pokemon game on top of Twitter. I didn't know that it will require a lot of development work and time and testing.

So I decided to release the first draft version of the game today 7-9-2009. Click Here for the Game

1. Login to Twitter and Pick your Pokemon
When you login with your Twitter account, you will be prompted to select 1 one out of 3 bird pokemons by default yours is Level 5 and you fight your way with the Computer on top of Google Maps.



2. Pick a Pokemon to fight
You click on any pokemon ball it will popup open showing the pokemon in it. Clicking fight will start the fight.



3. Defeat them and increase your level
When you click Fight it! A new window will be opened for the fight to start. You have a text area where you can write and tweet any message you want.





As you fight more Pokemons and defeat them, you're level increases, and as your level increases you will have more attacks. The Default attack for Spearow is "Pick"; With time it will evolve to Fearow so does the rest of the pokemons.

This is more like an alpha version just to test the game, only 7 Pokemons are there. All pokemon pictures are taken from pokemonelite2000


You will also see the top 5 Pokemons Twitters



Enjoy, and let me see if there are any bugs or enhancements

I had fun programming it but it is so difficult!! That's why this maybe the last time I design a web game, I need more tools and time.