About Me

My photo
PhD Candidate at Purdue University, Computer Science.

Monday, December 24, 2007

Keep my MAC Screen Clean

Thx to ZDNet. They posted some tips to keep your restore your glossy screen.

Of course this is applicable for all screens, not just for MAC.

Building Ruby and Rails on MAC 10.4

You can check the following link for a step-by-step guide to build your rails environment on the MAC OS 10.4.

you can just change the versions you need to install. (I get the latest ones)
After finishing don't use the $ruby -version
In this case, you will get an error. the error is due that ruby tries to evaluate ruby -v then "ersion".

to check ur version just run $ruby -v

Saturday, December 22, 2007

I will "Facebook" you

The word Facebook has been added to the 2008 edition of the Collins English Dictionary, as both a noun and a verb.

Grat Goal for Facebook.....

Thursday, December 20, 2007

Privacy Tips provided from Google

Top 10 ways to un-bake your brain

I passed through a very interesting blog entry, among the co-workers I had through my working life, I think more than 95% need to try some of these techniques.
baking brains has a negative impact on the surrounding, not just you. so, Plz be helpful and try to De-Stress.

In the following I am listing the entry with some comments:

1. Mindfulness-based stress reduction: I don't have access for this , so maybe later I can experience it.
2. Get lost in music : I do that a lot. I try to be ready with my hits player armed. I use to listen to Quraan, soft music, french melodies..etc
3. Get Active for 30 minutes: I don't do that :( , but I really need to do it. I am thinking of getting a part of it during my half hour break. I think it will help me a lot.
4. Get a breath-break: My favorite practice :), I just knew by nature that this helps me a lot to de-stress.
5. BioFeedback: I liked the idea. I hope I can do it sometime.
6. Game-out: Actually I don't feel good with gamed requiring an intense concentration. so, maybe i should reconsider this habit.

the part of writing things down is very nice. I thought it was only me the stupid person who totally forgets the details of his finished tasks.

Wednesday, December 19, 2007

بسبب نوم السائق مصرع وإصابة 24 حاجا مصريا في السعودية

الرياض حازم الشرقاوي:
لقي 5 حجاج مصريين مصرعهم وأصيب 19آخرون أثناء توجههم من مدينة الرياض إلي مكة المكرمة لأداء مناسك الحج والحجاج المتوفون هم: محمد جمعة مقصود ومحمد سيد أحمد محمد ومحمد عبدالله أحمد وابراهيم أحمد متولي وأحمد عبدالعال والمصابون في مستشفي الملك عبدالعزيز في الطائف هم: سعيد عبدالغني أحمد ومحمد عبدالفتاح وسلوي أمين عز ووائل صالح ورنيم وائل صالح وفاتن عبدالباقي وهويدا حسن ناصر وعز الدين عبد الرؤوف ونادية عبدالرحمن وحسن محمد عبدالغفار ومعتز سيد محمود وإسلام محمود إسلام وطه محمد أبو الفتوح وسوسن المصري. أما المصابون في مستشفي الملك فيصل بالطائف وهم: أحمد سعيد محمد وأحمد عبدالبديع وأسماء محمود وأشرف سعيد وكريم محمد. وقال فتحي خميس الملحق الإداري في القنصلية العامة المصرية في جدة: إن السفير عفيفي عبدالوهاب القنصل العام قام بتشكيل فريق من ممثلي الجالية المصرية في الطائف للتوجه إلي مكان الحادث وزيارة المصابين في المستشفيات، وأشار فتحي خميس إلي ان الفريق توجه إلي المصابين وأطمأن عليهم وكانت حالتهم متفاوتة ما بين متوسطة وكبيرة لأن الحادث كان صعبا بسبب انقلاب الاتوبيس عدة مرات، وأضاف أن القنصلية تتابع الحالات أولا بأول كما ستقوم بالتنسيق مع الجهات السعودية لإنهاء إجراءات دفن المتوفين في الأراضي السعودية أو نقلهم إلي مصر حسب رغبة ذويهم. وكان الحادث قد وقع أول أمس في منطقة 'ظلم' بالقرب من الطائف غرب السعودية حيث تسببت غفوة قائد الحافلة في انحراف الاتوبيس عن الطريق علي بعد 25 كيلو مترا من مركز 'ظلم' علي طريق الطائف الرياض مما أدي لانقلابها عدة مرات وتناثرت الجثث وأجساد المصابين علي جنبات الطريق فيما احتجز أكثر من 8 أشخاص بين ركام الحافلة، وهرعت إلي مكان الحادث 28 فرقة إسعافية من الهلال الأحمر والمراكز الصحية.

GoodBye My Friend



Ahmed Mahmoud Abd-ElAal...
To a kind heart..to kind friend..
It's bad u don't feel how much you like someone until you loose him. :'(

اللهم تقبل منه صالح عمله و تجاوز عن سيئاته.
اللهم ثبته عند السؤال، وعند العرض عليك.
اللهم اغفر له و ارحمه
اللهم غسله بالماء و الثلج و البرد
اللهم نقه من الذنوب و الخطايا كما ينقى الثوب الأبيض من الدنس
اللهم اجعل عن يمينه نورا وعن شماله نورا ومن فوقه نورا ومن تحته نورا ومن خلفه نورا و من امامه نورا.

بِسْمِ اللّهِ الرَّحْمـَنِ الرَّحِيمِ
الْحَمْدُ للّهِ رَبِّ الْعَالَمِينَ
الرَّحْمـنِ الرَّحِيمِ
مَـالِكِ يَوْمِ الدِّينِ
إِيَّاكَ نَعْبُدُ وإِيَّاكَ نَسْتَعِينُ
اهدِنَــــا الصِّرَاطَ المُستَقِيمَ
صِرَاطَ الَّذِينَ أَنعَمتَ عَلَيهِمْ غَيرِ المَغضُوبِ عَلَيهِمْ وَلاَ الضَّالِّينَ
صدق الله العظيم

انا لله وانا اليه راجعون

Android Demo

Sunday, December 16, 2007

JAI handling files

I am using JAI to display images. First I run my development environment was MAC. Everything was going smooth with me.
The problems started when I moved to Windows. Somehow, when I try to delete the image file from the hard disk, it didn't work.
Seems that JAI keeps a reference over the file indefinitely.
Example:
PlanarImage image = JAI.create("fileload",path)

The file load operation doesn't release the handler.
I tried to nullify the source handling the image, then call the System.gc(). (which is a really bad solution)

another solution is as following:
//replace fileLoad operation
File image = new File(path);
FileInputStream fis = new FileInputStream(file);
byte[] buffer = new byte[(int)file.length()];
fis.read(buffer);
fis.close();
PlanarImage image = JAI.create("stream",new ByteArraySeekableStream(buffer));

//replace file store operation
JAI.create("filestore",image,file.getAbsolutePath(),"jpg",null);

If this doesn't work, it maybe because file descriptor is not released. you may need to call the garbage collector.