Saturday, September 30, 2006

A Very “Proud” Fellow

A couple of days ago I was working on some mathematical formulae related to the file-wave conversion, the thing that I was burbling about in the previous post. It was 2 o’clock after midnight and everything was totally quiet. I could hear my younger brother slam the house door and move up the stairs to our room. I was digging into the Fourier Series coefficients formula when he entered the room holding this …



Ghaith: esh hada bil zab6?
Loai: Saqer!
Ghaith (sarcastically): billllaaah 3alek?

Apparently, my brother “borrowed” it from one of his friends. It is a very young eagle who’s being kept by his friend as a pet! :S

I was a bit surprised to hear that there are people in Amman keeping eagles as “pets”! I know that eagles can be raised in farms or in the deserts as luxury birds, or as hunting assistants, but I least expected to see one raised in an apartment :D

My brother said that as long as it’s being fed good amounts of meat, which is the only thing it eats, it won’t cause any problems; it won’t fly away and it won’t think of hunting down the street cats :P

The little eagle sounded very quiet, a bit arrogant maybe, more like it thinks nothing in the world can harm it! It didn't pay any attention to our gestures and acted very calm. It is a very fearful and proud bird indeed :)

We tried to push it to fly around so we can see how it looks like with its wings spread wide open, but it wasn’t really into it; it flew one meter and landed on one of my guitars.



My brother told me it may not be in the mood because it just had a fight with a cat right outside the house. My brother and his friend put one of the neighborhood cats in front of the eagle to see how it would react. The eagle, being apparently well-fed, didn’t bother at all. The cat, however, had a different opinion: it thought the little eagle was a pigeon and so it attacked it!

My brother told me they had to pull the eagle away instantly because it was being hurt by the cat and it didn’t fight back, nor did it try to escape. He said it looked like it's being “annoyed” more than it looked scared. I think it is fascinating, though a bit dumb, that these birds do not know what fear is. Even the fatal dangers won’t scare the little ones of them.


I admired the bird a lot. My brother soon took it back to his friend who’s been waiting outside. I didn’t have a lot of time to experiment with it like I usually do to animals I get my hands on ;)

The next day, I showed my father the eagle’s pictures and he really liked them. My father turned to know a lot about eagles as he used to capture the young ones in the old days. He said that in 5~6 months, this little fellow will grow to become a dreadful hunter, and will become far too big to be kept in an apartment!

His owners must be thinking of this, it must be hard to let go of a proud bird like this. No wonder why eagles are symbols for power, pride and freedom :)

Tuesday, September 26, 2006

Computer Files as Waves

Few days ago, I was out for lunch with some friends, among which was Zeid. After having our meals, we settled down somewhere and started talking about various stuff, like we always do.

Zeid told me he’s been thinking about a new file compression mechanism but he’s still uncertain of its effectiveness. He said he thought of turning a computer file into a “wave”, literally transforming the bits and bytes into a waveform, then use Fourier Series to represent the wave with much less data. This small quantity of data can be used later to re-construct the wave and produce the original file again!

The idea sounded crazy at first; how can a computer file be represented by a wave? I was wondering while Zeid continued to discuss his idea and I soon began to figure what’s in his mind …

Waves or Signals, whether analogue or digital, are a primary concern of engineering students. Many engineering courses focus on waves, their applications and how to process them. One wave processing technique that all engineers know about is the “Fourier Transform”. The idea of this transform is quiet simple; you take a huge wave with a large number of points, make some calculations, and then extract a number of certain “coefficients” that is less than the number of points. Those coefficients (which are actually just numbers) can be used to reconstruct the wave again!

So if you have a wave of say 1000 numbers, you can compute special 50 numbers (coefficients), and use these anytime to get the original 1000 numbers back.

It sounds like magic, but there’s a catch that all engineers know about: The re-constructed wave is not an exact replica of the original wave; it is only a very similar wave!

During the transformation, the more coefficients you grab, the more close your generated wave will be to the actual wave. So it’s like a tradeoff between a high compression ratio and an accurate representation of the wave.

Considering our digital concerns, any series of “continuous” numbers can be called a wave. By the term “continuous” I mean “progressive”, or “gradually changing”. For example, consider the following two series of numbers:

Series A : 1 , 2 , 3 , 4 , 5 , 4 , 3 , 2 , 1
Series B : 1 , 2 , 3 , 7 , 8 , 7 , 3 , 2 , 1

Both series can be called waves! This is because there is some kind of “continuity” between the numbers. Series A, however, shows more continuity than Series B and is, therefore, a more appropriate “waveform”.

Now if you want to treat a bunch of numbers as a wave, those numbers must be acting like a wave; they must show some continuity, or else they don’t deserve to be treated like a gentle wave ;)

Therefore, the biggest debate over Zeid’s theory must be: why would bytes be continuous? i.e. who said that bytes in any computer file are continuous? For example, a simple text file with the phrase “Hello World” is represented in memory by:

72 , 101 , 108 , 108 , 111 , 32 , 87 , 111 , 114 , 108 , 100

As you can see, these bytes are not continuous, and representing them by a waveform is useless. This is the case in most computer files; bytes are not linked together!

Still, Zeid thought that there must be some continuity if we looked in the right place. Say for example a picture file! Pictures are actually series of numbers representing colours of pixels, and in most pictures those numbers change “gradually” making them a very good candidate for wave representation!

During the subsequent days of our conversation, I was investigating the proclaimed “continuity” of picture files and its effectiveness. I took a sample picture and split it into three arrays, each holding the values for one of the three basic colours (Red, Green, and Blue) for all the pixels. I found that the three arrays show a good deal of continuity and are therefore very suitable for wave representation.

So next I made a program that computes the Fourier Sine Series coefficients for a picture, and then uses them to re-construct the picture again. The results were amazing! Take a look at these:

The number N indicates the number of Fourier coefficients per line of pixels (actually, I split the picture into 96 waves per each primary colour). The last transform (N = 48) rendered very close to the original image although it dismissed an exact 50% of the data of the original file :D

There is a lot more to talk about concerning this subject but I’ll have to look deeper into it and have a discussion with Zeid. This compression mechanism may work for other computer file types as well; sounds, videos and maybe others. I’ll have to research more!

Gosh I still can’t believe I did this ...

I have successfully represented a computer file as a wave!! :D

Saturday, September 23, 2006

Classically Conditioned

This post is about one of the hotwirings of my brain. I thought of writing about this when I read Lubna’s post “Songs in the Memory”. Lubna was talking about how some songs relate her to places or events in her memory. Linking a song to an occurring event or a situation is an example of the use of our “Involuntary Memory”; a conception used to describe a condition where our brains store data and link them to a “sensual stimulus”, which can be an image, a smell, or simply a song!

This is a cool memory feature we have, but what happened to me and what I’ll be talking about here is a bit different …

A couple of years ago I was developing a Network Gaming System for a Network Games Place called Splash. It’s basically a login system that allows users to play games on the network for an amount of time they pay for. Guys who play network games should know very well what am talking about. The network system carries many other tasks as well, and is a very complex piece of software.



I started programming my network system like 5 years ago on my home PC. Being a network system, it had to be developed on a couple of computers at least, so as to test and experiment the features as they are programmed. Unluckily I had no other than my single computer and I had to program the whole product under virtual network configurations.

I sold the first copy of my system shortly before doing my IGCSE AS exams. After deployment, I began to realize that the system needed much more work than I ever thought it did. All the things that worked perfectly on my machine ran differently in the real network implementation. Serious problems started to arise; core features stopped working for unknown reasons and mysterious bugs appeared every now and then. The worst part of the problem was that the business already started to rely completely on my network system, there was no go back …

I got hundreds of calls from Splash staff at different times of the day and for months. Some calls came at nights before my IGCSE exams and were really freaky; “Mar7aba Ghaith, all our user accounts are gone”, “Ghaith; the system isn’t logging anybody off, everybody is playing for free”, “Ghaith, the server is down and it’s refusing to start again”.

When any of that used to happen, I’d hurry to take a taxi to the place and see what the problem is about, and then go back home, fix the problem, and come back to the place with a newer version of the software. I had no laptop and I couldn’t risk bringing the source code to the place, so this was my only possible course of action.

So anyway, during some of the most terrifying moments of my life, moments when the system came down and I was sweating at the server machine reviewing the logs to find a clue, the guys at Splash were playing songs from Fadel Shaker’s newest album “Seedi Roo7e”, which has been just released back then. They were enjoying the songs while I was freaking to death trying to fix the problems with the business owner over my head. My heart was beating soo fast while the songs played. I could hear every single musical note played alone because for me … time was freezing …

Today, it’s been a couple of years since I last rushed to Splash. I’ve sold two more copies of my network system to other network games places, and all of them are stable and rocking good! In fact, my network system is now the finest work in the local market with absolutely no competitor.

One peculiar phenomenon that I got out of this whole experience is that, till the day, my heartbeat rate increases instantly and uncontrollably every time I hear one the songs of “Seedi Roo7e” being played somewhere!

It sounds funny but it’s true. It’s a case of an unconscious learning behavior known as “Classical Conditioning” where an animal (me in this case :S) is taught to make a certain response to a stimulus by pairing this stimulus with another stimulus that is known to cause the response.

The physiologist Ivan Pavlov made a very famous experiment in this regard. He kept ringing a bell pre to presenting food to one of his dogs. Dogs usually salivate when they see or smell food, but Pavlov’s dog started to salivate at the sound of the bell itself!

You can see how Classical Conditioning is different from Involuntary Memory. The last links a stimulus to some collected memories, while the former links a stimulus to a behavior. Classical conditioning applies to us (humans) as much as it applies to animals even though we’re not aware of it; remember that the whole process takes place in the unconscious areas of our brains!

Still, if you think a bit about your daily activities, you can find many automatic reactions your body was classically conditioned to make in response to stimuli around. So next time you freak out when you hear your phone tone being played somewhere, you should know what that is about ;)

Saturday, September 16, 2006

Behind the Mall

This Thursday, half the population of mo5ayyamat 3amman was in Sport City to checkout Al-Mokhtar Mall opening festival at 6:00 PM. The big mall, which has been in construction ever since dinosaurs walked the earth, was announced open for visitors.


It was a cool scene at the front doors, an enormous number of cars were trying to squeeze everywhere along the main street, and even a bigger number were flooding into the back streets of the mall to find a place to park. Fireworks covered the sky while herds of sheep and families were approaching on foot to the main entrance.

Of course I wasn’t there at the front door, or else I wouldn’t be alive to blog about the event. My cousins and I were busy having a big problem at the back street of the mall!

The mall lies in front of our main “headquarters”, or better say, our headquarters now lie behind the mall. “Our”, this time, refers to me and my cousins. We all grew up together in this area before everyone of us moved away. The sport city district, and specifically that street right behind the mall, became central meeting grounds for me and my cousins. We usually group there before deciding where else to go. It has always been such a lovely, calm, and soothing area where we could escape the lights and enjoy a good time (no pun intended) with a number of friends and relatives.

The construction of the mall wasn’t of so much annoyance to anyone of us as we were no more residents of the area. We enjoyed watching the progress of building and made many jokes about the mall. We never actually thought they’re going to finish any soon and we weren’t much interested in the effects of the mall on the area.

Last week, my cousin told me they’re opening the mall this Thursday which made me a bit uncomfortable. I was planning to go somewhere in the Sport City that day and spend some time later in our “headquarters” because it’s been a while I didn’t pay the guys there a visit. I guessed the sport city circle and all nearby streets will be jammed and it won’t be a good idea to be there when it happens, but I had to go.

On Thursday, I went an hour before the opening festival, finished my business and came back to our headquarters right when the festival started. The number of cars parking in the back streets of the mall was shocking! Cars were everywhere and more people were coming. Some people parked their cars in the garages of buildings in the area, which are our friends’ and neighbors’ houses!

Of course my cousins and I weren’t so happy about the situation. One of my cousins (codename: M7ammad el 7ara7sheh) spent the time staring at those who were parking their cars in front of others' houses. I, in turn, blocked the street several times by parking my car (bil 3ard) preventing any more cars from passing! Unfortunately, our efforts went in vein as people eventually kept flooding and we were unable to do anything about it!

After some thinking we decided that the best thing to do at that moment was to leave, or more precisely escape the area. We fled away with our cars and left the residents of the area to mourn the peaceful times, which now became history!

I would have loved to share with you a picture of the scene, but that would pose a threat to the secrecy of the location of our headquarters, as well as to the identities of our uncovered personnel in the area.

It was a bit surprising how such an event as the opening of a small mall in Amman had “that much” of people’s attention. It was also weird how people were so ignorant and unaware of the discomfort they’re causing to residents of the area, especially when they crowded such a calm and small area with their cars!

Ya3ni howweh awwal mall bil 3alam? Ma kollo 7abbet mall wage3! Our studies team in the area predicted that the mall will stand for 2~3 weeks at maximum before it collapses down to the ground, just like all other buildings which are higher than two stories in Amman. Actually, the mall already started to fall apart during the first day as one of the fireworks caused a complete electricity shutdown for about a minute :D

Tuesday, September 12, 2006

Blog Script Upgrade

Ever since I enabled comments on my blog and implemented this commenting system (which now happens to be a far deviation of the original Metempsychosis Comments Hack 1.03 by Ebenezer Orthodoxy), I’ve been constantly tweaking and adding features to the core Java script that submits comments to Blogger and formats them the way you can see on all posts on this blog.

I was able to fix almost all errors and make the commenting system look and work best, despite my very basic knowledge with Java!

There was a single bug that I couldn’t get rid of since the beginning! Am not sure if any of you have noted, but post pages took so long to load after you submit a comment, and used to scroll twice to the top, which was a bit annoying. This happened because the commenting system used to hold a “hidden object” to exchange data with Blogger’s commenting system behind the scenes all the time. When pages were refreshed, that object was also invisibly refreshing its contents, which made the blog took additional time to complete loading!

Good news is; that bug is finally history! I made a major upgrade and coded the hidden object to be created only for the time it’s being used, after which it will be unloaded from the browser window. You will also be scrolled down to your just-submitted comment when the page completes loading :)

The change may not be that obvious, but all post pages will actually load much faster from now on, especially long posts with many comments. Please let me know if you find any problem with the commenting system; send me an email, or just drop me a comment here.

I’ve also designed a little animated roller which appears when someone submits a comment; everybody is welcome to try ;)

Saturday, September 09, 2006

On Tagging & Stuff

Now that the last tagging wave is over (through Jordan Planet to say the least), I can share some thoughts I had in mind about tagging while I was reading some responses to tags that have been floating around recently.

For those who do not follow blogs much; tagging is a game where a blogger publishes his answers to a number of pre-written questions, usually personal, and then asks (tags) other bloggers to answer the same questions on their blogs and pass it on to others, pretty much like a chain letter. In tagging, however, the recipients are asked “in name” to respond!

Most people can’t find anything wrong about tags, chain letters, or even spam! To them, nothing can go wrong only because they forwarded an email to 100 of their friends and relatives, or just because they answered some questions on theirs blogs! Computer Geeks, on contrary, are very serious about such issues and feel greatly threatened and annoyed by the passing of such waves of letters or tags!

So who’s right of the two? Is tagging that much dangerous? and what are the risks of answering a tag and passing it on to others?

First of all, let me start by saying that no one knows the Internet better than computer geeks! Therefore it is natural to assume that the decisions they make regarding web activities are based on more thorough understanding of the Internet, its effects, and its relevancy to the real life. Hence the answer to the first question is: Yes, tagging is definitely dangerous!

But why? What’s really wrong about answering a couple of questions?

The reason that makes tagging such a threat is that in most cases it violates Geeky Internet Law #1:

Never share you personal info on the Internet!

If you've read so far and are now wondering “why shouldn’t I share my personal data on the Internet?” then I suggest you disconnect and stop using the Internet from now on :D

Sharing personal info on the Internet is the worst thing you can ever do! Unfortunately, the “Why” isn’t always clear as it should be! I usually compare this Internet law to driving laws; you can’t always see what could go wrong if you violate a simple driving law, but with some thinking you can come up with many possible scenarios where your violation leads to an accident!

One tag that had my complete attention, or better say “drove me nuts”, is the “What’s In My Bag” tag, which has been circulating between female (and even some male!?) bloggers around. I was shocked because bloggers who answered this tag were letting people know what’s inside their handbags and they were doing it gladly! Jano, Khalidah, Wedad, Roba, Rambling Hal, Salam, 7ala and Moey (!?) answered the tag! Most of them even provided pictures for their bags’ contents!!

Was it safe to answer that tag? I don’t think so! What can go wrong because of it can’t be determined that easily, just like I said, but I can imagine more than one scenario where somebody could make use of knowing what’s inside somebody's else's handbag! Keep in mind that many of those bloggers have posted their pictures on their blogs and recognizing them outdoors won’t be a hard task.

I may sound a bit silly but believe me; whoever you are, there are many people out there waiting for a good chance to screw you! We all have rivals, foes, or people who just don’t like us much; don’t give them any chance :)

I hope I made clear (in my own geeky view at least) how can such tags be hazardous to your safety people. I was glad to note that other bloggers like Qwaider recognized the problem too, check his comment on 7ala’s post :)

To end with, I’d like to introduce a new tag that I myself came up with today. I am tagging you Qwaider :P

1 - How much money do you usually carry around in your wallet?

2 - How much time (on average) do you stay away from your car?

3 - If you’re leaving your place and wanted to hide the house key somewhere for your brother/sister to take it later, where would you hide it?

4 - In your own opinion; what items in your place are worth breaking in for?

5 - If somebody wants to blackmail you, what would be the best approach?

(P.S : It’s just a joke people, mesh tro7o mjawbeno :P)

Monday, September 04, 2006

Nighty Confrontations 2

This is the second post in a series of posts about some funny incidents that took place on the streets when my friends and I were stopped by the police/Intelligence agents late at night. Make sure you have read the previous post Nighty Confrontations 1 to know what this is about :P


(9orah archiveyyeh tanyeh bardo ma elha 5a9 bil mawdoo3)

P.S For Ma'en: zalameh oo e3ref hada el share3 ween ;)

Story 2. Sho Hee Saybeh?

Okay, I wasn’t with the guys when this happened so it’s being told “3ala themmet-hom”. It was Sami, Zeid and Mr. X in Sami’s car. They were parking at late night in a dark street somewhere and chatting together when suddenly …

Two accelerating cars came out of nowhere and skid blocking the street, then men in civilian customs went down and ran towards Sami’s car …

Sami: Quick!! Close the doors!!

Sami closed a door … Mr. X closed two … while my good friend Zeid wasn’t quick enough to close the door next to him. The men opened that door and got all three out of the car.

Unknown Man: shabab haweyyatkom …

(Sami and Mr. X reaching to their wallets, when surprisingly …)

Zeid (in a sharp and confident tone):
esh haweyyatna? Meen ento? SHO HEE SAYBEH?

Unknown Man:. :|

(The Unknown Man, shocked by Zeid’s kind of “counter-attack”, reaches to his pocket and presents his gadget: MO7'ABARAT 3AMMEH)

Unknown Man: haweytak?

Zeid (still confident): ma ma3e

Unknown Man (5aff 3aglo oo eltamas): ma ma3ak? Bte3ref enno bagdar a5thak 3al markez tnam el leleh 3enna?

Zeid: ...

(The other men search carefully through Sami’s car)

Unknown Man 2: ntheefeh seedi

(They all move back into their cars and disappear)

Seconds later …

Sami: enta jad ma ma3ak el haweyyeh?

Zeid: aah

Mr. X: o mkayyef 3ala 7alak o btes2al el zalameh 3an haweyto?

Zeid: aah wella? SHO HEE SAYBEH?

(Sami and Mr. X look at each other and burst laughing)