About Me

- Ahmed Abd-ElHaffiez Hussein
- PhD Candidate at Purdue University, Computer Science.
Friday, March 09, 2007
Quick look to Erlang
There is a short movie giving a quick introduction about ERLANG features.
Erlang has reached a high level of maturity in the telecoms market!!!!
Tuesday, February 27, 2007
ليــس الغريب
ليــس الغريب غريب الشام واليـمــن .. إن الغريب غريب اللحــد والكفــن
إن الغــريب لـــه حـــق لغـــربـتــــه .. على المقيمين في الأوطان والسكن
لا تنهـــرن غــريبـــا حــال غربتـــه .. فـالدهـر ينهــره بــالـذل والمـحـــن
سفـــري بعيــد وزادي لـن يبـلـغـنـي .. وقـوتي ضعفـت والمــوت يطلبنـي
ولـي بقـايــا ذنوب لسـت أعـلـمـهـــا .. الله يعلمهــا فــي الســـر والعـلـــــن
مــا أحلــم الله عنــي حيـث أمهـلـنـي .. وقـد تمــاديـت فـي ذنبـي ويسترني
تمــر ساعـات أيـامـي بـلا نـــــــــدم .. ولا بكــاء ولا خـــوف ولا حــــزن
أنـا الـذي أغـلـق الأبـواب مجتـهـــدا .. علـى المعاصي وعين الله تنظرنـي
يـا زلـة كتـبـت فـي غـفـلــة ذهـبــت .. يـا حسرة بقـيت في القلـب تحرقنـي
دعنــي أنـوح علــى نفسـي وأندبـهـا .. وأقطـع الـدهـر بالتـذكيــر والحـزن
دع عنـك عزلي يا من كان يعزلنـي .. لـو كنت تعلـم ما بـي كنـت تعذرنـي
دعنــي أسـح دمـوعا لا انقطــاع لها .. فهـل عسـى عبـرة منهــا تخلصنـي
كأنـنـي بيـن تـلك الأهــل منـطــرحا .. عـلـى الفــراش وأيـديهـم تقـلـبـنــي
وقـد تجمــع حولـي من ينــوح ومـن .. يبكــي عـلـي وينعـانـي ويندبـنــــي
وقـد أتــوا بطبـيـب كــي يعــالجـنـي .. ولم أر الطب هذا اليوم يـنـفـعــنــي
واشتد نزعي وصار الموت يجذبهـا .. مـن كل عـرق بلا رفـق ولا هــون
واستخرج الروح مني في تغرغرها .. وصار ريقي مريرا حين غرغرني
وغمـضونـي وراح الكل وانصرفوا .. بعـد الإيـاس وجــدوا في شرا الكفن
وقـام مـن كان حـب الناس في عجل .. نـحـــو المغســل يأتينـي يـغـسـلـنـي
وقــال يــا قــوم نـبـغ غـاسـلا حــذقا .. حـــرا أديبـــا أريبـــا عــارفـا فطن
فجـــاءنـي رجــل منهــم فجــردنــي .. مــن الثيــاب وأعــرانــي وأفـردني
وأودعـــوني عـلى الألواح منطرحا .. وصـار فوقـي خريــر الماء ينظفني
وأسكـــب المــاء فوقــي وغسلنـــي .. غســـلا ثـــلاثا ونــادى القوم بالكفن
وألبسـونـــي ثيابـــا لا كمــــام لهـــا .. وصــار زادي حنوطـا حين حنطني
وأخرجونـي من الدنيــا فــوا أسفــاه .. علــى رحيـــــل بــــلا زاد يبلغـنــي
وحملــــونــي علــى الأكتاف أربعة .. مــن الــرجــال وخلفـي من يشيعني
وقدمـوني إلى المحراب وانصرفـوا .. خلــف الإمــــام فصلـــى ثم ودعني
صلـــوا علـي صــلاة لا ركـوع لها .. ولا سجــــود لعــــل الله يـــرحمنـي
وأنـــزلونــي إلى قبري علـى مهــل .. وقدمــوا واحــــدا منهــم يلحدنــــي
وكشـف الثوب عن وجهي لينظرني .. وأسكـب الدمــع من عينيـه أغرقني
فقـــام محتـــرما بالحــزم مشتمـــلا .. وصفـف اللبــن من فــوقي وفارقني
وقـــال هلـوا عليه الترب واغتنمـوا .. حسن الثواب من الرحمن ذي المنن
فــي ظلمــة القبــر لا أم هنــاك ولا .. أب شـفـيـــق ولا أخ يـؤنـســنــــــي
وهالنـي صورة في العين إذ نظرت .. مــن هـول مطلع ما قد كان أفزعني
مـن منكـر ونكيــر مــاذا أقــول لهم .. قــد هالنــي أمــرهم جـدا فأدهشنـي
وأقعدونــي وجــدوا في مساءلتــــي .. مالـــي ســواك إلهــي من يخلصني
تقــاسم الأهل مالي بعد ما انصرفوا .. وصـار وزري على ظهري فأثقلني
واستبـدلـت زوجتي بعلا لها بدلــي .. وحكمتــه علـــى الأمـــوال والسكـن
وصيــرت ولدي عبـــدا ليخدمهـــا .. وصـــار مالــــي لهــم حلا بلا ثمــن
فـلا تغــرنــك الدنيـــا وزيـنـتـهــــا .. وانظـر إلى فعلها في الأهـل والوطن
وانظر إلى من حوى الدنيا بأجمعها .. هـل راح منهــا بغيـر الحنط والكفن
خــذ القنـاعة من دنياك وارض بها .. لــو لــم يكن منهـا إلا راحـــة البــدن
يــا زارع الخيــر تحصد بعده ثمرا .. يـا زارع الشـر موقـوف على الوهن
يا نفسي كفي عن العصيان واكتسبي .. فعـــلا جميـــلا لعــل الله يــرحمني
يـا نفس ويحك توبي واعملي حسنا .. عسـى تجــازين بعد الموت بالحسـن
ثــم الصـلاة علـى المختـار سيدنــا .. مــا وقـــع البــرق في شـام وفي يمن
والحمــد لله ممسينــا ومصبحنـــــا .. بـالعفـــو والخيــر والإحسـان والمنن
الإمام زين العابدين (علي بن الحسين بن علي بن أبي طالب رضى الله عنهم)
اللهم لا تجعل الدنيا أكبر همنـــا
Sunday, February 25, 2007
Acts_as_Statable
We were working on a small forum, when it comes to define a forum/thread to be closed, blocked, forbidden..bla, bla...whatever anybody calls these restricted access issues.
I made a quick lookup for the available plugins, it was difficult at the beginning as I was looking for something without knowing what it can be called. Finally, I found the acts_as_enumerated plugin, it should be the one. I succesfully installed it, at the end it didn't work with me ( I may be missing something) but i decided not to give aq second try for now. I thought it doesn't satisfy my design. Instead i started to think of something which should like this:

Steps to create a plugin:
Note: the following steps are provided as guidance to create plugins.
1. In your project directory run the following command.
$ruby script/generate plugin acts_as_statable
create vendor/plugins/acts_as_statable/lib
create vendor/plugins/acts_as_statable/tasks
create vendor/plugins/acts_as_statable/test
create vendor/plugins/acts_as_statable/README
create vendor/plugins/acts_as_statable/Rakefile
create vendor/plugins/acts_as_statable/init.rb
create vendor/plugins/acts_as_statable/install.rb
create vendor/plugins/acts_as_statable/uninstall.rb
create vendor/plugins/acts_as_statable/lib/acts_as_statable.rb
create vendor/plugins/acts_as_statable/tasks/acts_as_statable_tasks.rake
create vendor/plugins/acts_as_statable/test/acts_as_statable_test.rb
2. Edit "vendor/plugins/acts_as_statable/init.rb"
require 'acts_as_statable'
ActiveRecord::Base.send(:include, ActiveRecord::Acts::Statable)
require File.dirname(__FILE__) + '/lib/stating'
require File.dirname(__FILE__) + '/lib/state'
3. your real work will be in this file "vendor/plugins/acts_as_statable/lib/acts_as_statable.rb"
you will need to define your methods just right here
module ActiveRecord
module Acts
module statable
..........
end
end
end
4. create the new classes stating and state
"vendor/plugins/acts_as_statable/lib/stating.rb"
"vendor/plugins/acts_as_statable/lib/state.rb"
class Stating < ActiveRecord::Base
belongs_to :state
belongs_to :statable, polymorphic =>true
............
............
end
class State < ActiveRecord::Base
has_many : statings
.......
end
Wednesday, February 21, 2007
Two Hours with Oracle
The title seems very interesting; and the most interesting is that it was in Hilton green plaza, Alex. I decided to go and attend, it is a good chance, I thought so.
The seminar didn't introduce something new, it was based on the Oracle10g. Oh yes, "g" stands for "Grid". It didn't meet my expectations at all.
I couldn't stand for more than two sessions. the seminar was behind schedule by more than 45 minutes at the moment I left!!
The first session included an example with Amazon, it was the best part of the seminar probably. The problem facing Amazon is that they have machines:
- Order entries: it easy to expect that these machines got the peak load in December.
- Financial: dedicated for reporting and statistics. these machines will face the peak load in January to extract the reports needed to put the plan for the next year...etc
Number of steps and time in oracle10g is almost 2x or more than DB2, and SqlServer.
There are a lot of improvement comparing to 8i, for example Enterprise Manager can be accessed through Browser and PDA clients.
I will appreciate if they enhance the usability before releasing the next release. I can't think of getting Oracle and wasting more than double my time, and hiring a DBA with a big salary .
For now, Oracle is forbidden for me.
Monday, February 19, 2007
Acts_as_Taggable Tag Cloud
The forum includes a set of forums which in turn include a set of threads.
When a user displays the forum/show.. he should see a tag cloud involving all the tags attached to the threads in this forum.
I found this link describing the code for the tag cloud; but it doesn't satisfy my need as it can be used only on the threads level.
I should confess that the performance was not my concern this time.
in the vendor/plugins/acts_as_taggable/lib/tag.rb file I added this code:
def self.tags(options = {})
query = " select tags.id, tags.name, t1.count"
query << " from tags INNER JOIN"
query << " (select tag_id , count(*) as count FROM taggings, posts "
query << " where"
query << " posts.forum_id=#{options[:forum]} and "if options[:forum] != nil
query << " taggings.taggable_type='Post' and taggings.taggable_id=posts.id"
query << " group by tag_id)AS t1 ON t1.tag_id=tags.id"
query << " order by #{options[:order]}" if options[:order] != nil
query << " limit #{options[:limit]}" if options[:limit] != nil
tags = Tag.find_by_sql(query)
end
Following the link, everything should be working well now.
OOPS...Don't forget to restart the server!!!
Tuesday, February 13, 2007
Web Roots
I found this article very good. It seems that there are some characteristics which did not get the deserved attention. What is really great, is that Web2.0 represents a return to the essential principles that guided the Web.
- Open Source: Yahoo was built on the foundation of open-source operating system(BSD Unix) and open-source language(Perl). The core of the Web was (NCSA Mosaic browser, NCSA and CERN HTTP Servers)
- Collaboration: Tim Berners Lee inventor of the World Wide Web and the leader of DIG put an original design for the Web to enable researchers to collaborate.
- Simplicity: we can find a lot of web2.0 products very elegant, simple, and focusing on only one single point; "make a single focus and do it well". This isn't an innovation. the RocketMail was one of the first major free webmail services, and it was focusing just on "e-mail".
- Architecture of participation: Epinion.com is a review site that was established in 1999. we can see now the success story of Amazon and eBay
- Lightweight programming model: many of the Web1.0 generation were built using scripting languages (example: Perl used in yahoo). Large companies used widely the complex web services stack and forgot the REST which was originated in 2000. (Amazon provides the web services in both forms SOAP and REST)
- Social Software: in 1994 Match.com was started. The "social software" was called "viral market".
Friday, February 09, 2007
Catching the "A"-Team
"I am a geek, I am friendly, I am a designer, I am strict, I am a business guy..Woow, I should be in the company's "A"-team!!"
If you really think that a company can have different classes of teams, then you are totally wrong. We can prove this by contradiction :)
Let's assume that a client calls for your service; a team will be assigned to provide the client for his needs. If he is lucky, he will get the "A"-team and get what he really expected; otherwise, of course he will be unlucky. When you claim that your company possesses a "A"-team, the later unlucky client will smash your head "Where the hell was that team when my project was under construction?".
On average, your company has not an "A"-team, customers will certainly turnover.
So, we agree that the dilemma is not individual; it's a team work by the end.
Now, you can start to ask yourself about your chances to catch the world's "A"-team.
1-Possessing Positive Attraction:
We are all influenced by the "Law of Attraction". Everyone has his own impact on his environment. You should increase your positive impact. Are you trying to deal positively with events which you observe around you? Or you just complain your bad luck and the lack of resources?
You should also have the ability to reject negative thoughts from people surrounding you and substitute it by your own positive ones. Know that what anyone or any source offers you; it is only one view, one description or interpretation of an event or truth. It is only one perspective of an interpretation gained from other third parties who in turn focuses on the topic and did not experience the subject first hand.
2-Building Trusts
Why trust is important?
" If you don't have trust, people won’t cooperate, won’t be
In The 7 Habits of Highly Effective People, Stephen Covey talks about
Gaining trust:
Before searching for trust you must trust yourself.
- Be reliable and available. Try always to be available when the client wants to talk directly to the people working on his project whenever he wants. Don't let him feel that he has to send 100 emails and 100 phone calls to make you appear online.
- Keep your promises and follow through with commitments
- Forgive and move on
- Don't be threatened by people who are different from you
- Tell the truth
- Communicate openly and honestly
Be aware that Trust is bidirectional relation. You should evaluate how much trusting you are in order to make a successful trust construction.
3-Self Motivated.
Why anybody needs self-motivation?
Because if you want to improve your self esteem or improve yourself in any way at all you first need the inner desire and will to do it.
But you cannot always rely on others to encourage you. To take up a new activity, hobby or challenge. The self-motivation is the way to "Initiative", without motivation you can't take any initiative on any level.
Increase your self-motivation
- Focus on what you really enjoy doing. Think about giving it priority to start doing what you love doing.
- Always keep a list of things you'd like to improve on and how you're going to do it.
- from time to time, try to totally forget all the negatives you have faced and review all the success in your life.
- Contact positive people.
- Give your soul a break to read some good books.(NLP, How To increase your energy, Getting things done, Motivated Mind, How to Raise your Self Esteem, Self Help Stuff that Works..etc)
4-Knowing About Business.
Client-side:
Keep in mind the budgetary and time constraints that the client faces. This will help you define the customer goals and priorities in concrete terms. Further, it will help you to deliver a robust business solution through usable deliveries.
Tools-prespective:
Constitute a cross-industry perspective of the technologies you can consider in developing. You should keep some kind of aim at the different technology trends. Your attention should be varying significantly across industries. This can be done based on continuous data entries for the "benefit Vs mainstream-adoption" (can be called "Priority Matrix") for each technology such as Web 2.0, Ajax, Grid Computing, RFID, DNA Logic, Social Network Analysis, wikis..etc
The end result should be awareness (or at least prediction) of the following regarding each technology:
- Prevalence: How prevalent is it in the current crop ventures.
- Essential: does this characteristic stem from expediency or is it a core part of competitive advantage, Newness, Longevity.
- Newness: Is this characteristic really new, or just rediscovered or relabeled.
- Longevity: Will this last during the next five years.
- User: content, metadata, usability,
- Open: open SRC product, public API, open process, open source platform,
- Lightweight: Ajax, REST, Scripting Languages,
- decentralized: RSS/Content, Code, Development,
- Still Missing: Security, Transactions, Durability, Global Audience, Mobile.
5-Listening
You start a project by learning and listening. The result will be a clear plan that ensures results for you and a great experience for your customers.
Listen is another aspect to the "trust", it is an important key on the building trust journey.
You should know how much you like to involve others and seek their opinions when working on a project.
- When you are talking with someone face to face, don’t answer the phone, check e-mail, or sort the papers on your desk.
- Make time to talk one on one with your spouse or partner.
- Be a patient listener. Not everyone thinks or speaks as fast as you do.
- Avoid putting words in people's mouths.
6-Flexibility
"There is nothing permanent except change"; said Heraclitus. That has been true throughout the history, but it is especially true in our exciting and ever-changing field. You should value the "Responding to change" and may be "search for it".
After evaluating yourself, do the NLP H.W to change behaviours.
First step is to stand outside the 'creative state' and think of a time when you were acting creatively according to your own standards. You should refresh everything you saw, heard and felt while reliving that experience.

After you have created 'creative' states follow these steps:
- Stand in the state that represents 'behavior' and think of a behavior that you would like to change. Make sure that you already have a representation of the behavior in one of the three senses.
- Move to the 'intent' state, and then ask the question, 'What is the intent, of the behavior?'. Once you get a sense of the intent for the behavior move into the 'creative state'.
- Ask yourself 'how else can I fulfill the intent for the behavior?'. When you get plenty of alternatives behaviors you can go back to the state for 'intent'.
- Review the alternatives and select the best three options. Step back into the state for 'behavior'.
- Test out each of the three options one at a time by imagining using each new behaviour in the original situation. Check if there are any objections to any of the selected options. If so, step back into the state for 'intent' and repeat the entire process, until all objections are satisfied.
Wednesday, February 07, 2007
Saturday, February 03, 2007
دع الأيـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــام
فَأَنْـتَ وَمَالِكُ الدُّنْيَا سَـوَاءُ
Friday, February 02, 2007
Donormyl

Still fighting to sleep :(
2day i took "Donormyl"which contains Doxylamine succinate which is an antihistamine of the ethanolamine class which has a high incidence of sedation.
My sister recommended it for me. it is supposed that it reduces the time taken to fall asleep & improve the duration & quality of sleep.
i hope it makes a good effect to make me sleep.