Learn to think like a computer, to code like a guru [Part 1]

15 May

So, you are thinking about becoming a programmer, if so then this post is for you. Many people that I know who have started to learn programming just walked away after a few days from starting to learn. By talking to them they said that programming was very hard to understand and it was very hard for them to build a working application. The problem was that almost all of them have started to learn programming using a high level programming language like C# or Java. They just got overwhelmed from day one with lots of details and jargons that they couldn’t handle.

As I have also noticed that those who were able to survive and continue learning are not able to solve relatively simple programming assignments. From my point of view that was expected. The question is why did that happened to them, and how it can be avoid. For the first question the answer is that they don’t understand the mechanism of how computers think and work, they don’t understand the logic that computers use to think. For the second question the answer is that they first need to learn (in plain English) the computers thinking logic, before they can start to learn any programming language at all.

In this post and the several coming posts (GOD only knows how many of them there will be) I will teach you how computers think. In order to learn the computer thinking logic I have asked a friend of mine to lend me his Robot, as robots think the same way computers think. So please welcome “Jazari” the robot.

Please welcome Jazari

Please welcome Jazari

Now as we have a robot, we need to make use of him, it doesn’t now make any sense to own a robot and not ask him to do our tasks; at the beginning I’m suggesting to ask him to get me some deserts from the fridge. Okay, let me ask him to do.  “Jazari, would you please get me some Baklava from the fridge”, as you can see below “Jazari” is not moving at all. Let me check its manuals.

Ahaaa the manual says that our orders to “Jazari” need to follow three simple rules otherwise it will not work at all, those rule are listed below.

  1. Sequence
  2. branching
  3. Repetition

So what does that mean? For now I will explain what sequence is. A Sequence is an ordered finite list of commands that the robot or a computer will execute one by one from top to bottom. Now let’s see how to ask “Jazari” the same question but in a way he can understand.

  1. Move 10 meters forward
  2. Grasp the fridge door handle with right hand
  3. Pull the fridge door handle
  4. Un grasp the fridge door handle
  5.  Grasp the baklava plate with right hand
  6. Grasp the fridge door handle with left hand
  7. Push the fridge door
  8. Un grasp the fridge door handle
  9. Move 10 meters backwards

Although that might sound very stupid for a human, but for computers and robots it always had to be like that, a sequence of a very primitive commands that explain every single step to complete needed to a task. Let’s assume that I have forgot the command number 8, in this case the robot would have moved backwards while still grasping the fridge door handle, dragging the fridge to my living room.

So for today we have learned that computers and robots are not as smart as we think, we have also learned the correct way to give orders to a computer or a robot. Now as I feel thirsty after eating the baklava, would you please ask “Jazari” to get me a cup of tap water, just write the sequence and send it to me. While writing it don’t focus on the words as much as you focus on simplifying the commands for “Jazari” to be able execute them one by one, and remember that it is a must that each line should contain a single command for “jazari”.

Video game development essential terminologies

13 May

Back to time when I started studying game development, I used to write down each terminology that I didn’t understand in an excel sheet, and at the end of the day I navigated the internet looking for a definition. Sample terminologies are min maps, procedural textures and texels. So I decided to collect them in a presentation to make it easier for anyone learning game development. I have added more than 40 terminologies in this presentation and I know that there are more terminologies out there to be covered. So If you have any terminology that is not in the list, please post it to me and I will include it. to view the presentation please click here or click the below picture and as usual any questions are more than welcomed.


game development terminologies

game development terminologies

How monsters can always find players in video games?

11 May

Most of us have played video games long time ago, personally one of my favorite old titles was resident evil 2. In this game you were chased by raccoon city zombies and you either need to kill them or run away from them. When I played that game I was wondering how those zombies can always find me, no matter where I hide. They have even kept following me around if I tried to escape.

In this post I will try to answer this question for you, and I will show you by an example application I have created, how those bad zombies can always find you, no matter where you are hiding.

To simplify this let’s rephrase what we need to do. “we need to make the computer draw the shortest path (route) around obstacles between two points” for this purpose a computer scientist called Dijkstra invented a technique called “path finding”. This technique does exactly what we want. Latter on, other computer scientists improved this technique and called it “A star”.

For the A star technique to work the game level is divided into a grid of small squares,  All the squares overlapping the game map walls should be marked as none passable squares. All of the non marked squares are considered passable which simply means that the zombies can walk in this area (As far as I know zombies can’t penetrate walls, correct me if I were wrong)

The square overlapping the game player should be marked as well (in this figure it is marked in green), also the square overlapping with the zombie should be marked too (in the figure it is marked in red). Now the problem has been simplified enough for the A star to operate.

The A Star will inspect the eight squares around the zombie (diagonal squares are also counted) and choose the closest passable square to the player based on a heuristic function (simply a guess based on a mathematical formula).  as a result a path between the zombie and the player can be determied by repeating this process on each chosen square.

I don’t want to make things complicated so I will not talk about heuristic functions but you can try things yourself using this application. you can find the program in the following path after  you extract the archive [..\PathFinder\PathFinder\bin\Release\] you just need to run PathFinder.exe. If you are having any trouble using it, you can watch that video to know how to use it.

I have also included the source code for the computer science guys who are reading the post, as they might be interested in it. The application will only fail when there is no route between the starting node (zombie) and the target node (player), if this happened you will need the task manager to kill the application.

Cairo ICT 2012 Kherna interview

7 May

While hanging around in CICT 2012, I have made an interview with Amera Salah from Kherna.com. Kherna is an online social hub that will not only connect donors and volunteers to charity organizations, but it will also connect you to your friends that have similar charity activities. All you need to do is to watch this two minutes video and you will get the whole idea.

Cairo ICT 2012

30 Apr

if you have missed Cairo ICT 2012, you can still catch up with some of what you have missed in this post and the following posts. This time it is simply a group of pictures taken in ICT 2012.

Culturama theater

AS you can see in the picture it’s a curved silver screen showing cultural interactive content, personally I have attended a show about Jan 25. The experience was awesome.

Culturama theater

Xerox Booth
Xerox booth

SAP booth

If you don’t know what SAP is, it is a German software corporation that makes enterprise software to manage business operations and customer relations.

SAP booth in Cairo ICT

Mobinil Booth

Personally I didn’t like that booth a lot, it was very crowded, and noisy as it was playing Arabic songs almost all the time. But despite the previous cons, the did has some new services to offer like video IVR, and traffic detection systems. They also have a stack of video games dedicated computers for it’s visitors entertainment.

Mobinil Booth at Cairo ICT 2012

Blackberry booth

I didn’t spend a lot of time here in this booth as I couldn’t find anything new than already presented in the market.

Blackberry both in Cairo ICT 2012

EMC2 booth

If you don’t know what EMC2 does I recommend to read their history from here http://en.wikipedia.org/wiki/EMC_Corporation#History . One of their companies called Iomega produced a personal hard disk that when connected to your home router is automatically turned into a storage cloud that you and your family can use from anywhere in the world.
EMC2 booth at Cairo ICT 2012

Vodafone learning keyboard

This is not just a keyboard, it contains memory, a processor and a data sim card. All you need to do is to connect it to you T.V. and start browsing the Internet without a full blown computer. Vodafone also is planning to put educational material on their cloud such that school students can study online. This device already exists in their stores for just 500 L.E.
Vodafone learning keyboard at Cairo ICT 2012
Vodafone Booth Decorations
Vodafone Booth Decorations at Cairo ICT 2012

Vodafone learning keyboard plugged to a T.V.

Vodafone learning keyboard plugged to a T.V.

Huawei booth

Huawei booth at cairo ICT

Microsoft booth

Microsoft Booth at cairo ICT 2012

Vodafone learning keyboard flipped

Vodafone learning keyboard flipped

Tagipedia  tags

Just Point your mobile’s camera to the barcode of an item you are interested in, and enjoy the multiple of services especially tailored for you. You might need to check www.tagipedia.com

Tagipedia rock at Cairo ICT 2012

A collection of small sized booths

Kherna booth was in that area, you can check their website here http://kherna.com/welcome

A collection of small booths at cairo ICT 2012

Cairo ICT 2012 hall entrance

Cairo ICT 2012 hall entrance

Samsung Booth

Samsung Booth at Cairo ICT 2012

Vodafone fleet Management system

A device is put in the car, and by the end of the day the fleet manager will unplug this device and see the streets that the car has passed through along with it’s speed. Real time tracking is not supported due to Egyptian regulations.

Vodafone fleet Management system 2012

Vodafone traffic jam detection system

Vodafone can measure the traffic jam in a street using the average speed of Vodafone customers on the road, the updates this information on a map using color codes,

Vodafone traffic jam detection system

Vodafone booth decorations

Vodafone booth was really big, that it held a decoration area as big as a medium sized booth.

Vodafone booth decorations Cairo ICT 2012

Cairo ICT 2012 Registration

Here we bought the tickets and got our name tags.

Cairo ICT 2012 Registration

VivoTek booth

They provide surveillance cameras solutions both hardware and software.

VivoTek booth in cairo ICT 2012

Asphalt 5 played on a Galaxy Note

Mobinil build playing section in their booth in Cairo ICT 2012, games included asphalat 5, and angry birds.

Asphalt 5 played on a Galaxy Note in cairo ICT| 2012

Vodafone’s car ani theft advertisment

Vodafone’s car ani theft advertisment in cairo ICT

Vodafone's car ani theft advertisment in cairo ICT

Start with google crash course

17 Dec

During the past three days I have experienced something I have never passed through since ages. It was “start with google” crash course event. For a life time I heard about success stories in the IT business, but never really came across direct communication with any of them. In this event; Google, SAS, and Innoventures, have mixed together entrepreneurs, venture capitalists, and business owners.

The result was magical; there was this spirit of motivation and success.  I have met many successful people out there; all of them were hard workers, and determinant to success.  But if I wanted to mention what I have really learned from this event I can say that “Startup success is not about ideas, it’s about the team implementing them”.  I know that there are other factors that can make the startup successful, but if you look deeply you will find that they are just by-products of a successful collaborative team. Also I have learned that Ideas are only worth the papers that they were written on them, the big deal is about making them a reality.  It would take several articles to summarize all the lessons I have learned, so I have decided that for now I will just list the five questions a start-up needs to answer to be successful. These tips were mentioned right before the event’s closing session.

TIP 1: Where is the problem you are trying to solve for your customer?

TIP 2: What is the market? How big it is? Is it scalable or not?

TIP 3: What are you going to do to solve the customer problem?

TIP 4: How competent your team is? Can the team complete the project on time with the required quality?

TIP 5: How much money do you want to start? How much money your business is going to return?