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.

Monday, March 10, 2008

Dexter in Space!

We are minutes away from witnessing the launch of the Endeavour space shuttle from the Kennedy Space Center, Florida, USA. It's quite amazing that some people are unaware of something orbiting the Earth called the international space station...hmmm...interesting...

The shuttle will be taking up an interesting two-armed robot called Dextre. Its a Canadian made robotic arm which will help substitute astronauts going out for space-walks. The shuttle is also taking up a Japanese made science laboratory or a piece of it at least.

This is Dextre below...



Quite fascinating I must say.

Sunday, March 09, 2008

The World is Shrinking!

How I wish some times that I was an undergrad student again these days. The world is shrinking!!! There are more and more oppurtunities popping up everyday. All this has become possible by the Internet which youngsters take for granted these days. They never saw what was before the Internet! Since I'm from a slightly older generation; it's like the stone age humans who came across fire!!!! hehe...So the east and west have come closer and with the advancement in technology we see "exciting new opportunities that people are talking about" {The way Bill Gates puts it}.

The reason I was set on this nostalgic path of thought was because I was nominated to be a Google Student Ambassador. Where were these opportunities when I was an undergrad??? Fein???? :D. Google was still on the rise back then and well, more and more multinational companies are interested in draining the innovative brains of our talented youth :). Well that is another line of thought - Countries are loosing their little powerhouse brains to the west. The industry is reaching across the globe and hacking into oilfields of ideas from innovative young youth. :'(

Of course I don't have the time anymore to do something like this. In order for it to be done properly it needs time and commitment. Those are two things I have allocated to other aspects of life...

I'm not sad, just thought I'd share a spur of thought with ya as always...

Why do we stick out our tongue to focus?

The real reason to this, psychologists say, is because there is a significant amount of background processing that goes on in the brain that controls the movement of our tongue. We are of course unaware of this but when a person is trying to concentrate on a mind-intensive task at hand they tend to involuntarily stick out their tongue or fixate their tongue between their teeth or up against the top of the ceiling. This is to relieve the brain of any background processing and to fully focus on the task.



Quite interesting...

Blogging Mind-Bogglers

If you haven't watched this video on youtube then you've missed quite a lot...thats if your interested in virtual reality and gaming. I was sent a link to this video a long time ago but never actually watched it. Yesterday I came across the same video again and it blew my mind away! It is one of the most watched videos on the Internet. Its utterly awesome!

Its by a guy called Johnny Lee from Carnegie Mellon University. He created virtual reality using the Wii controller and sensors. You have to watch this. Towards the end when he views the stadium, its like looking out a real window! Watch now...

Head Tracking for Desktop VR Displays using the WiiRemote!!!!!!!!!!!!!!!!!!!!

Saturday, March 01, 2008

A Clap for WikiSky and Google Sky

WOW! Technology is definitely moving faster than we can grasp. The discovery of Microsoft WWT has brought to my attention two other technologies that have beaten Microsoft to the stargazing software arena. The first being Google Sky who has already launched itself with the newer versions of Google Earth. Now not only can you look at Earth and zoom down to street level, but you can turn the gaze up and look at the night's sky. Unbelievable!



Seriously mind-blowing!



Download it now and take a look for yourselves. Another technology I was aware of but caught my eye as I was looking at Google Sky is KML (Keyhole Markup Language). This is an XML-based language which was originally built by Keyhole Inc. - the creators of Google Earth. The KML file specifies a set of features - placemarks, images, polygons, 3D models, textual descriptions - for display in Google Earth, Maps and Mobile or actually any other 3D earth browser (geo-browser) implementing the KML encoding. Pretty neat huh?

This has led to some amazing applications like for example watching the animation of international flights on Google Earth and a scary simulation of water level rising. You can see this @ here!
and watch it in the Google Earth application.

Another stargazing technology I came across is WikiSky @ Wikisky.org. This freaking blew my mind! I've recently gotten into astronomy again after long years of absence. This comes at a wonderful time.



We have come a long way with technology. There are even virtual moon trips coming up! Imagine this...going to the moon in virtual reality. You can read all about this here. This should be coming up in a year. This will allow people to hitch rides on probes to the moon and watch as the lunar robots explore the surface of planets. This will all be in real-time and will allow everyone to participate in space exploration. WOW!

I'm glad though that I ordered my telescope. So far I can see that these two portals into the night sky are just knowledge providers and will in no way replace real astronomy. They will definitely greatly help the astronomy communities around the globe and are welcomed as an amazing innovation. They are truly grand! I can't wait to explore some more!

Friday, February 29, 2008

A Definite BRAVO for Microsoft

I was just notified by a friend of something called "The Microsoft Research WorldWide Telescope"

"The WorldWide Telescope (WWT) is a rich visualization environment that functions as a virtual telescope, bringing together imagery from the best ground and space telescopes in the world for a seamless, guided exploration of the universe.





WorldWide Telescope, created with Microsoft's high-performance Visual Experience Engine™, enables seamless panning and zooming across the night sky blending terabytes of images, data, and stories from multiple sources over the Internet into a media-rich, immersive experience"

source: you can find this @ WWT!

A screenshot of the whole experience...



Check it out on Youtube

It is still not operational. It should be out as an alpha version in several weeks. Can't wait! This comes at a weird time...as I'm actually waiting for my new telescope. WWT revolutionizes astronomy. Should I have thought twice before ordering a telescope...

Thursday, February 21, 2008

The Lunar Eclipse From Egypt

Last night was a very interesting night. It seems not many people here in Egypt were aware that the Earth would cast its shadow on its nearest neighbor, the moon. Or may be no one was interested. It started at about 3:30am here in Cairo. It started like this:



This was the first thing I saw as I switched off the movie and looked up. I had been watching a movie as I waited for the eclipse to begin. The shadow appeared on the rim of the silver sphere. It slowly made its way further and further across the bright silver moon.



I struggled to capture decent photos of the eclipse with my primitive automated cybershot. I tried my best and to be honest I was happy with the outcome. My other visual aid was my telescope. I set it up on a tripod on my roof ready to watch the event. I've had this telescope since I was ten years old or something. It was a birthday gift from my father and the night I got it was one hell of a night. I could finally see the moon up close and see the dinosaur-looking or dragon-like craters of the glaring moon. Now, many years later I look up again at the glowing ball in the night's sky.



It's quite ironic that a few days earlier, unaware of the lunar eclipse coming up, I ordered a 90mm Mak-Cass telescope. Interesting that my interest in astronomy re-emerges just before this event. Another ironic thing is on the 21st of February 41 years ago the Apollo 1 was planned to launch but there were unfortunate events in one of the test runs leading to the death of some of the astronauts due to fatal errors in the designs of the Apollo command module.

So there I was freezing in the cold pre-dawn air. My hands were frozen blocks of ice and every time I looked into the eyepiece of my telescope the chilly metal would scorch my skin cold.





The star you see in the above image is Saturn. There is another bright star above the eclipsed moon that you cant see in the picture. This is Regulus (a bright star of the Leo constellation). Hopefully with the telescope I ordered, I'll be able to meet Saturn and Jupiter up close and personal :D.



The picture above is the last picture I took. It isn't clear at all but you can see that the moon has disappeared behind the shadow cloak of the earth all together.

The picture just below is the telescope I used to view the amazing experience.



It's a 20x50 refractor telescope which isn't too bad. You can see the moon fairly clearly. I still plan on buying a deep space Imager which is something you put on the eyepiece of the telescope and connect to a USB port in a computer. It allows you to take images using your telescope. I just hope my telescope gets here and the 6.3mm eyepiece I ordered along with it.

As you can see the moon turned dark orange as the full eclipse came into play. I was forced inside by the cold and so had to look up from my window. The full lunar eclipse was approximately at 5am. I had work early that day so I was forced to shut down my operations and get some rest.

It was definitely an interesting experience. It was so grand. So much bigger than us. I kept imaging the whole event up close, seeing the massive earth moving across the rays of the sun and cutting off light from the lunar disc. The disc darkened with the umbra of the shadow and the people on earth, so small and insignificant in the context of such a large-scale show, looked up in absolute awe.