Monday, April 28, 2008

Whats wrong with the Toktok?

Many people have been talking about the toktok and how its not a civilized approach to transportation. I hate it when people use the corresponding Arabic words for "not civilized". To be honest this country lacks many aspects of civilization. All we care about is looking civilized when in actual fact we are years behind.



I believe recently the authorities have decided to banish the toktok from Egyptian sands. I see this as a foolish decision. When you decide on something, you must think of the consequences to yourself and the others who will be affected by this decision. The toktok is an excellent means of transportation over short distances in remote areas of Cairo. If you take this away many people will suffer. Find another cheap solution before you take this away. Think about the people. That is being civilized.

Another problem we face in West Cairo is the "highway" called the Mehwar. There was no maintenance done to the highway throughout its lifetime. Now they are in the process of redoing it and still they yet to learn that there is something called a hard shoulder which is an empty lane reserved for broken down cars...etc. They also want to stop the micro-buses from stopping on the highway. This again is the black and white decision making of the authorities. What will people who live around the highway do? They will have no easy means of transportation. They will surely suffer. Wouldn't it be better if we offered them another solution, if we thought about them for a second, if we thought about their rights as citizens in Greater Cairo.

Te2ool lee meen? ("Who do you tell?" - an Arabic expression of hopelessness)

Masr Om El Donia!!! ("Egypt - the mother of the world")

:D

Telescope? Did I order a telescope? Oh yes...

Ah yes...now I remember! I ordered a telescope in December of last year.
Have I received it?
Nope. The customs put me through hell. So I was forced to forfeit it.
Why?
Because they believe a telescope is associated with explosives, weapons and ammunition.
What the hell?
Yes, its true. They offered me a choice though. Which was very good of them :).
I could either go ahead with the transaction and pay taxes equal in amount to the price of the telescope and then pay a further pricey fee for a metaphysical test on the telescope which would then dictate whether or not this type of telescope was banned.
The other option was to disown it and donate it to the government. The last option which I initially decided to go with, was to reship it out. I though of shipping it to my family in the UK...but NOOO!!! It has to be shipped to the same country from which it came from or otherwise they will think I was trading telescopes. Then I discovered that to reship it out to the US alone would cost a considerable sum, let alone shipping it later to the UK.

It seems there is a lack of understanding. Everybody told us something different. A guy in customs told us to ship it to the US and on the way instruct the courier service to change destination at Heathrow airport and then ship it to a location in UK. This was complete bullocks. The courier service said to just leave the telescope at customs and forget about it. It would go to the government in the end. The official responsible for weapons and ammunition told us that the government will not leave it alone. They will charge us money for the space the telescope is taking up in the warehouse.

Its a complex world it seems. I'm still trying to ask to give up the telescope and disown it altogether. I'm glad the ordeal is coming to an end...isA

It was an unwise decision to order that telescope. Let this be a warning to anyone who wants to order something from abroad to Egypt.

Thursday, April 24, 2008

Reflection()

I've been doing some programming using reflection recently and when I thought about the term I was unable to put together a formal definition, so here it is...

Reflection in computer science is: "Reflection allows code to discover information about the fields, methods and constructors of loaded classes and to dynamically invoke them. It basically entails reaching into the JVM (if in JAVA) and grabbing out information about loaded classes at runtime"

The Revolution of the Google App Engine

As they have done before, Google are revolutionizing the way we deal with the Web. For developers like myself, they have created a whole new scheme of things to come. Google has announced Google App Engine which provides developers with a means of instantaneous web publishing. You can create a website through Python (the first supported language) and using the SDKs provided test it and debug it and then publish it within minutes.
This will revolutionize web dev. I think this is damn innovative stuff...



"Google App Engine lets you run your web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.

You can serve your app using a free domain name on the appspot.com domain, or use Google Apps to serve it from your own domain. You can share your application with the world, or limit access to members of your organization."


App Engine is free!!! You get 500MB of storage and enough CPU power and bandwidth for about 5,000,000 page views a month

Simply beautiful...

I tried to get the preview release but it was only being given to the first 10,000 developers to register. I was obviously too late.

The SDK is available for download...so anyone interested go ahead! There is also documentation. But there is still no space to register for publishing on the production environment...

Soon...my friends...soon :D

Backronyms

Never knew there was a word to describe this. An acronym is a abbreviation. A backronym on the other hand is a phrase constructed from a previously existing word or abbreviation.

An example: A Spool in computers is a buffer area used for data transmission between a computer and a peripheral of lower speed. People constructed the phrase Simultaneous Peripheral Operations On-Line based on the believed-to-be acronym Spool. Its the inverse (the reverse direction) of developing an acronym.

I thought this was quite interesting...

Wednesday, April 23, 2008

Google Alerts

Just came across Google Alerts. This is darn kool. It'll allow me to keep up to date with issues. Check it out...

Radio on The Run

As usual I started driving to work this morning and tuned into our local English radio station. As many time in the past, I SMSed the station telling them I would love to play one of their games where they ask a guy 5 Qs and then ask a girl 5 Qs. Call it sexist, call it competition....whatever :D. I was the first one to be asked the questions. I got 4/5. I got the easiest of all questions wrong. I always get confused about the capital of Canada. I said Ontario. Ontario is the county which contains the capital city, Ottawa. Well I got 4/5 and the girl got 2/5 so I won myself a mobile line and some goodies from the mobile service provider. Hope the number is good. I don't know if I'll be able to go pick them up...we'll see.

In actual fact, they made my drive to work fun. I enjoyed the ride and partially was unaware of the time it took in the crowded streets of Cairo. I then took a wrong turn as I smiled at the girl who got most of the questions wrong....evil me! That wrong turn cost me a lot. I had to take a long detour to get back to work.

Yalla...I had a nice morning so far. Hopefully the day will meet the high expectations ..isA

Sunday, April 20, 2008

Vector Graphics Vs. Raster Graphics

Curiosity killed the Cat! Not in my case - I'm looking into something called Vector Graphics.

Vector graphics...AKA geometric modeling or object-oriented graphics. OOG...hehe.
Vector graphics is the use of geometric primitives like points, lines, curves and polygons which are modeled by mathematical equations to represent images.

Vector graphics is the opposite of Raster Graphics. Raster Graphics is representing an image by an array of pixels (also the technique used for rendering photographic images). This mechanism makes images pixelate as you zoom in, as you can see in the picture below.



This pixelation does not happen with vector graphics. Vector graphics files store the lines, shapes and colors that make up an image as mathematical formulas. A vector graphics program uses the mathematical formulas to construct the screen image by building the best quality image possible, given the screen resolution, from the mathematical data. This is why you see the difference between both techniques in the picture above. Vector graphics render themselves using math equations according to the resolution of the image.

So this is an exceedingly brief look at the two techniques. For a complete and detailed description of the PROs and CONs of each see Wikipedia - Vector Graphics

Stay tuned for more posts...

Friday, April 18, 2008

Thursday, April 17, 2008

Monty Hallin'

Two days ago I saw the movie 21. Its based on a true story. Its a story about five MIT students and how they are recruited by a university professor to count cards in Black Jack. The plot is absolutely predictable but I definitely enjoyed it.

They referred to the Monty Hall Problem in the beginning of the movie. This sent nostalgia spinning up my spine. I never did pay attention in that class on probability, maybe cause the room was always so jam-packed and the professor was sooo irritatingly annoying. Thus, I never did get the hang of it and I think that was my lowest grade in all my years at uni. So I obviously couldn't remember much about the problem except its name.

The Monty Hall Problem is a problem of probability based on a tv show. The host asks you to pick one door out of three knowing that behind two of them is a goat and behind just one of them there is a bran new car. The objective obviously is to pick the door with the car behind it.



Once you pick one of the doors which has a probability of 1/3 to have the car behind it, the host then goes and opens one of the other two doors. It reveals a goat. The host then asks you whether or not you want to change your choice. So you offered to keep to your first choice or to switch to the other closed door.

The simple scenario is that you pick one door and stay with it. The probability in this case is 1/3 that the car is behind it. But actually it would be wiser or mathematically wiser to switch. Why?

The probability of your chosen door is 1/3 which makes the probability that the car is behind one of the other two doors 2/3 (shared across both doors). When the host reveals one of the two other doors, he has made the 2/3 probability rest solely on the closed door of the pair. Therefore your chosen door has a probability of 1/3 (same as before) and the other remaining door has a probability of 2/3. This is why it is wiser to switch.



You can look at it from various angles. You can analyze it using Bayesian analysis or map out all scenarios and see what happens. Another way to look at it is that the probability of choosing a goat in the first place is 2/3. In all cases if you choose a goat in the first place, and switch, you will win the car. This is because the host will reveal the other goat and thus the remaining door has the car behind it. But if you stick to the choice you only have a 1/3 chance of winning the car.

An easier way to look at this is to increase the number of doors to say; a 100. You choose one and the host reveals 98 of the other doors. Will you switch? The probability of choosing a goat first is 99/100 which is 99%. It is almost certain that you choose a goat door. Then the passes along the other 99 doors and opens them all except for one somewhere along the line. A rational decision would be to switch to that door knowing that there is a 99% chance you choose a goat to start with and a 1% chance you choose the car from your first choice. Pretty cool huh?

Its a really cool problem that sparked confusion and debate in the world. The problem and solution were published in the Parade magazine. About 10,000 readers (including several hundred mathematics professors) wrote to the magazine claiming the solution was wrong. People saw the problem of switching as a bran new problem independent of the first choice. In actual fact it is because depending on which door you choose at the beginning the host will reveal one of the other doors which has a goat. So the host's choice is based on your choice. So therefore there is a relationship between which door the host reveals and the door you choose.

Tuesday, April 15, 2008

My Lumix

Got my new camera two days ago and took it for a Macro Morning Spin!!! Took some pix in my back garden this morning using macro. Here they are...

An Egyptian fly unaware of my presence...



Eaten by a rose...



Mushroom Kings



Love...



Honey suckle....or close



The Brain...



Crown




A fallen rose

Asciimation!!!

This is sooo kool!

You've got to check it out!!!!



Open up the windows command prompt (you'll find it under All Programs > accessories.
Once the black window opens up type in the following line:

telnet towel.blinkenlights.nl

and enjoy :D!!!

Wednesday, April 09, 2008

Stylish Firefox

This is definitely the best UI enhancement add-on for Firefox I've seen. It's called Stylish. It actually applies styles to the websites of your choice. It replaces the existing styles of websites and puts your own.

The effects of this add-on are amazing! and as usual in the open source world there has been a swarm of commotion and hence you can find ready made styles to install onto the add-on. Here are some snapshots of what can be done.

Gmail in black!



Wikipedia painted dark!



Rainforest Yahoo!!!



There is a site called http://www.blackle.com/
which claims that because of it's black theme it saves energy and is easier on the eyes. Easier on the eyes maybe but Google denies the greenness of black. It says displaying black on flat-panel monitors actually uses more energy.

:D

Wednesday, April 02, 2008

Tuesday, April 01, 2008

Aliens in Egypt!!!


View Larger Map

This funny looking sign was found on Google maps. It shows a weird pattern in the middle of nowhere. Could it be aliens?

hehe...don't think so...Could be some very innovative dumpster truck drivers with a lot of free time :). Its quite interesting. Some of them are holes in the sand and some are tiny hills. There are no traces of vehicles to show how it was made. It could actually be a Google April fools prank. It could have been deliberately inserted into Google maps by Google!!!

Can you think of any other explanations?

Monday, March 24, 2008

Calories Affect Brain Power!!!

"I fast for greater mental and physical efficiency", Plato said.

A study has been published that says:

When the stomach is empty the body produces a hormone called ghrelin. This hormone travels to the hippocampus in the brain and causes new brain cell connections to form. The hippocampus is the memory engine of your brain. when lab animals are injected with extra ghrelin, their learning ability and memory improved.

"Could intentionally keeping your stomach empty (by cutting down your food intake) accelerate learning ability and improve memory? The recent discovery involving ghrelin, taken in conjunction with recent research involving calorie restriction - suggests this may very well be the case"



Wow. Very interesting stuff...

I started looking into the relationship between food and mental power when I finally got fed up of the situation I fall into whenever I eat large meals at work. My efficiency falls to the floor. Not only do I feel slow, tired and exhausted after the large meal, I am unable to concentrate. I become a zombie!

The relationship between our diet and our life is extremely strong. Unfortunately I abuse my diet. I'm working on that...

PS: Definitely more posts on this subject...

Tuesday, March 18, 2008

The Indian Fibonacci and Rabbit Reproduction

Most of you know of the Fibonacci sequence. Its the magical sequence of numbers that was mentioned in the Da Vinci Code novel. I took it in school and university and never actually knew what it represented.

The original sequence was studied by an Indian mathematician called Virahanka in the 6th century AD. Virahanka was analyzing the length of sequences of long and short syllables in an ancient Indian language. The long syllable was twice as long as the short syllable. The Ith number in the Fibonacci sequence is the number of total combinations that can be composed of those two syllables with length equal to I.

For example:
If the short syllable is S (represents 1 unit of length) and long is L (represents 2 units of length) then for the 3rd number in the sequence the number of combinations of the two syllables that make a total unit length of 3 are:

{ SSS, SL, LS }

If you do this for lengths of 1,2,3,4,5,... you will find that the original Fibonacci sequence is created which is 1,2,3,5,8,13,21,...

Later on Leonardo of Pisa (AKA Fibonacci) studied the sequence of numbers and linked it to reproducing in rabbit populations to produce the sequence we know today which is summarized in the formula: F(n) = F(n−1) + F(n−2). Which is:

0,1,1,2,3,5,8,13,21...

Has anyone seen rabbits reproduce before? I had rabbits in my back yard when I was a kid. We bought two French rabbits (male and female) and two Egyptian rabbits (male and female). In about a year they had become an extended family of 18 and the number went up and up exponentially just like the Fibonacci sequence. Very often we would catch sight of a new born exploring its way outside of the burrow and race back in as we approached.

Yaaaaa...those were the days...

I came across the Fibonacci sequence the other day when I came across a question; It said, "Given that you can take one step or two steps forward from a given step, find the total number of ways of reaching the Nth step?"

Monday, March 17, 2008

Space Tourismo!!!

How amazing would it be to go up into space, experience zero-g and to look back at our home planet and see how small we really are in the context of the universe.

The Russian space program offers trips to the International Space Station. There have been five space tourists who have undertaken this trip before. The next person to go up to the ISS in October of this year is Richard Garriot - a Game desginer. The last one to go up was Charles Simonyi - a software company executive. Richard Garriot is paying 30 million dollars for this. Quite an astonishing amount of money to be paid by one man for one trip.

Is this a waste of money? I personally think there are much more productive ways to spend that kind of money. For starters he could help millions of unfortunate people on Earth instead of riding off on his dream voyage. He could help starving people. He could donate it to disease research. There are many benefits 30 MILLION DOLLARS can bring!!!!

In the end it isn't my decision, I'm just wondering how the last two to go up are people in the software business!!! I want to be next!!!...hehe.

Thursday, March 13, 2008

A Sneak Peek

My poor telescope is still being held in customs...:'(. I just hope it gets here in one piece. I guess I'm going to have to introduce it before it actually arrives. Maybe I'll get it piece by piece (Rabena Yostor).

There are of course many different types of telescopes. There are three main types of telescopes; reflectors, refractors and catadioptric. Reflectors use mirrors to reflect the light captured by the aperture. Refractors use lenses to convey the image caught at the aperture to the opening for the eyepiece. Catadioptric telescopes are telescopes that combine together mirrors and lenses. There are many pros and cons of each type of telescopes. I'll talk about these in later posts.

The telescope I ordered is a 90mm Maksutov-Cassegrain. This is a catadioptric type of telescope. The 90mm corresponds to the diameter of the aperture of the telescope. This is the most important aspect of a telescope. The larger the aperture, the more light the telescope absorbs and hence the more fainter and further objects it can reveal.

Another important factor is the focal length of the telescope. The longer this is the more power of magnification it provides. The magnification is the first thing people think of when they think of telescopes and they believe this is the metric on which to evaluate a telescope. This is not true.



The magnification of a telescope equals the focal length of the telescope divided by the focal length of the eyepiece. Eyepieces are changeable. Astronomers typically have sets of different eyepieces to attach to the telescope depending on what they want to see. Eyepieces each have a focal length and a field of view. There is no point in trying to get the highest possible magnification, which means getting the eyepiece with the smallest focal length. This is because there is a limit to the amount of magnification a telescope can handle. The limiting factor is our old friend, the aperture. There is only so much detail (i.e. light) that exists in the image caught by the telescope's main mirror or lens (according to the aperture size). There is no point in trying to magnify beyond the detail that the telescope reveals. This will give you a blurred image. Another thing to consider is the field of view of the eyepiece being used. I'll talk more about eyepieces in future posts.

My telescope-to-be (isA) is a catadioptric type. It is a very compact model. You can see it here...



I didn't order the tripod you see in the pic.

This telescope should be able to see, believe it or not, the red spot on Jupiter and the dust ring around Saturn. Of course I'm going to go out to the desert or somewhere with no light or air pollution.




Just hope I get the scope intact soon isA...
When I do I won't stop showing it off :p

The formidable wall we know so well

Very frequently in my line of work do I find myself in front of an obstacle. I find myself confronting a dead-end wall. There is no way around this wall. No solution to allow you to pass. You are stuck. You struggle to get around it, but in vain. You hack away at the wall but everything seems impossible. Then you really break down in spirit. You feel helpless and useless.



Then I always remember standing on the other side of the wall and looking back at the wall and thinking, "It wasn't that hard? It all worked out in the end". I take a deep breath and walk on. Only to confront another wall may be even bigger than the last.

Time and time again you look back upon the wall you just conquered and think, "there is no such thing as impossible".

How many times have I slumped down at the sight of a formidable problem with "no" solutions at all. I've tried and tried different approaches and nothing helps. I get tangled up in the threads of my own thoughts and little by little strangle myself. Then I can not take anymore so I get up and go take a break and suddenly as I'm watching the TV, walking away from my room or doing whatever it is I'm doing to get my mind off the problem at hand, I trip over the solution to the problem. I see something that I hadn't seen prior. I find a fundamental answer to the puzzling problem and later on, yet again, I look back at the wall I just climbed.