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.

Tuesday, November 06, 2007

Configure libtiff for Visual C

I had to move my working environment to windows to realize integration with my organization. So, one of the steps was to configure libtiff to work on Visual C.

To use LIBTIFF in your existing VC++ 6.0 Project/WorkSpace, you need to do the following setting modifications:

  1. Open your existing Project/WorkSpace file in VC++ 6.0
  2. Choose Project-Settings... menu item.
  3. Click "C/C++" tab.
  4. Choose "Preprocessor" item in the "Category:" menu.
  5. Choose "All Configurations" item in the "Settings for" menu.
  6. Add to the "Additional Include Directories:" field the path to the include directory of the libtiff folder.
  7. Choose "Code Generation" item from the "Category" menu
  8. Choose "Win32 Release" item in the "Settings for:" menu
  9. Select "Multithreaded" option in the "Use run-time library:" menu.
  10. Select "Win32 Debug" item in the "Settings for:" menu
  11. Set "Use run-time library" menu to the option "Debug Multithreaded".
  12. Click "Link" tab in the dialog.
  13. Select "Input" item in the "Category:" menu.
  14. Choose "All Configurations" item in the "Settings for:" menu
  15. Add to the "Additional library path:" the path to the lib folder in the libtiff folder.
  16. Choose "Win32 Release" item in the "Settings for:" menu
  17. Add to the "Object/library modules:" field: libtiff.lib
  18. Choose "Win32 Debug" item in the "Settings for:" menu
  19. Add following text to the "Object/library modules:" field: dlibtiff.lib.
  20. Click "Ok".

Saturday, November 03, 2007

Installing Windows, Ubuntu7.10, Mac OS 10.4.10 on MacBook (Triple Boot)


I am happy with my MacBook with its running Mac OS X 10.4.10. I can't stand working on windows any more, I feel more comfortable with Mac OS.

My master Thesis is running on linux environment(basically Fedora, but I successfully turned it to be Ubuntu)
My current project delivery should be done on windows. An easy solution costing 60$ would be to purchase Fusion.
Although Fusion looks very interesting, I didn't submit to this solution, for the following reasons:
  1. Running virtual machines consumes more memory, in this case I will loose some performance which is something I will certainly need during development.
  2. More memory usage, means more power consumptions, hence less battery life time. in normal cases I enjoy having ~4hrs battery life time with my lovely Mac. this is sthg i don't stand to loose.
  3. to overcome the first problem, I can extend my RAM. this will make the virtual software costs me almost (60+90)$....I really can't afford this for now. (I didn't get paid for salary 3 months ago)
So, I decided to to create a triple boot on my MacBook. It was a very risky step for me..But here we go, I have nothing to loose anyway (keeping in mind 150$ :S, 900 LE when converted to our local currency!!!!!! )

My MAC specs are:
Processor: 2.16GHz Intel Core 2 Duo
Memory: 1 GB 667 MHz DDR2 SDRAM
MAC OS X: 10.4.10

The target is to install Ubuntu 7.10 and WinXP SP2 on MacBook.
steps:
  1. Get BootCamp: I think it may force you to update to Mac 10.5. (luckily I installed it 1 month ago before leopard is released)
  2. Update your Mac OS.
  3. Install rEFIT.
  4. run BootCamp assistant and follow instructions to burn driver CD for windows. (don't proceed with installing steps)
  5. Backup your data. (you may not loose your data if things go smoothly)
  6. Check your disk partitions and identify the Mac Partion. I most cases it is /dev/disk0s2. but if you are not sure, you can verify this by running a shell command using the diskutil:
    $ diskutil list
    resize your HDD using Diskutil by running the following command. first you specify the volume to be resized, and its new size, then the type, and the name of the new volumes followed by their size.
    $ diskutil resizeVolume /dev/disk0s2 70G "Linux" "Linux" 20G "MS-DOS FAT32" "Windows" 20G
  7. insert your XP SP2 CD and hold down the "ALT" key.
  8. install XP on the valid partition, just give it a quick FAT32 format.
  9. you should now have a dual boot(windows with Mac).
  10. insert your Ubuntu 7.10 Live CD.
  11. run the installation normally. You should set up the partition manually. Don't mount the EFI system partition. you need only to mount / to the drive you allocated to your linux installation. I didn't make a SWAP file, I just don't need this for now, I relied on my 1GB RAM.
  12. Continue through the following steps.
  13. When you reboot, you should have triple boot.

Extracting metadata from PDFs

I have assigned to create a DB starting from PDF files. Typical fields are (title, Location, Date, Actors mentioned in each PDF..etc)
plan A:
The first idea i got in my mind is to create a Lexical Analyser.
I should parse the PDF file word by word then check if it is "Held" then i should expect a location description after that...If I find "Present" then i should expect a bunch of actors' names.

TO parse Text of PDF file I used PDFBox. Surprisingly, it didn't work as i expected.
  1. the PDFParse can split a single word into multiple words. So my code would receive "hel" then "d", and not "held". In this case to make it works I should generate a state machine that keeps track of the history which I found non feasible solution.
  2. I have French documents among these files. Applying a text analyser for french document is a kind of stupidity, in french..instead of saying "hold on", they type "le". Le is a very frequent string (if u r not familiar with french, it is equivalent to the".
plan B:
which implies that putting positions of text in consideration, hence I can build a set of blocks, and based on this structure I can isolate different logical blocks and then separate their contents.
this didn't work :( the problem this time was with the OCR generating these PDFs. the OCR is not accurate with text positioning 100%. hence the input to my code is buggy. in consequence, the OCR merges two different columns, or split 1 column to different columns.

plan C:
Implies to work on the TIFF files directly(ignores the Buggy PDF)
I read the original TIFF file, then parse pixel by pixel to split the original tiff into sub tiff. in this way I have control on the blocks without need to let the OCR do this for me.
after identifying basic blocks in the tiff file, I call an OCR SDK to transform my Tiffs into text, which finally will be my fields in the DB.

Friday, November 02, 2007

Joke of the year

While I was working on my MAC...I was very concentrating and stressed...
I was trying to Burn A CD....Well, it was my first time to burn a CD on my MacBook...

I tried inserting the CDs for 20 minutes(i tried 10 blank CDs)..but Nothing happened, so i decided that i may have corrupted CD blanks and I should buy some new ones.
Luckily, I noticed that all that time I was inserting the blank CD in my DESKTOP DVD , not my MacBook... :D
I should lost my mind somewhere...
grrrrrrrrrrrrr.

Saturday, October 27, 2007

Free Access To All Human Knowledge

As we are still organizing our local Egyptian team to host the Wikimania at Alex at August 2008, I am didn't define the committee I will be responsible of till the moment. But, I think I have some ideas in many committees held by my team mates, and I hope that I can be a member in these committees as well as a core member of one committee.

Saturday, October 20, 2007

No ldd on MAC OS X

ldd is not available on MAC OS X. Instead, I used the otool -L command to have the same functionality that ldd does.

Monday, October 15, 2007

Le Naufrage

"On part quand on le veut; mais on arrive quand Dieu le veut."

L'avantage des tempêtes, c'est qu'elles nous libères de tout soucis. Contre les élèments déchainés, il n'y a rien à faire. Alors, on s'en remet au destin.
Ce qu'on doit bien comprendre que le départ est dûe par Dieu.

Parfois; ton navire ne bouge plus. Il devait étre blooqué sur un banc de sable ou sur des récifs. ne penses plus que ton navire peut fuir sous la tempête pendant des centaines de kilomètres sans rien rencontrer.

Wednesday, October 10, 2007

Wikimania 2008 at ALEXANDRIA

"The Jury for Wikimania 2008 bids have met and are pleased to announce that Wikimania 2008 will be held in Alexandria, Egypt".

Yes, we did it and we won the bid :)
Statements about the Jury choice can be grabbed here.

We have to meet now to plan for the next steps. Hopefully it will be good experience...

Wednesday, October 03, 2007

Friday, September 28, 2007

Wikimania 2008

For the second time I am in the bidding team for the wikimania, I think we are close to win it this year. The bidding team (except me) did a great job during the last few days. Africa should get its turn to host this event. South Africa has its own problems, and don't forget what is going with the World Cup as they didn't start yet to prepare for the event..

Tuesday, September 18, 2007

New Task - الباز أفندى


I have a new Project as assignment...
A huge data for Dr Boutros Boutros-Ghali, which I should manipulate and categorize, create metadata, then finally create launch a site to browse the documents..

Whenever I look at the boxes at my disk I remember the Arabic old movies, where we used to see an employee handling tons of papers in front of him in a caricature profile for Egyptian employee. There is also a well known character who appeared in the movie "Ebn Hameedo" played by Tawfik El-De'n known as "El Baz Afandy". :)) he was a skilled employee, pretending the knowledge of everything while he has not gotten any certificates...

Actually I like the task...I find it has some kind of challenge... It tests how much you can handle these docs, how much you can be organized, knowing where a specific document can fit, and how you can make good procedures to organize the structure of such data.
Well, I guess It is a new kind of experience.

Friday, September 14, 2007

VISTA.....

As a new developer in the Bibliotheca Alexandrina, I should get a tour to VISTA(Virtual Immersive Science and Technology Applications). Bibliotheca Alexandrina is the first to provide researchers with such advanced visualization tools (in the middle east of course I mean). The VISTA is also known as CAVE (Computer Aided Virtual Environment).

It displays 3D stereoscopic images generated from a PC cluster, on four 10-ft × 10-ft vertical walls and the floor. The cluster is Five workstations linked together. The four projectors used in the VISTA render 1400 × 1050 pixels each and have a very bright light output rated at 7200 ANSI lumens. this can be very good for simulating real phenomenon. There are a lot of applications applied to Vista concerning Aero Dynamics, Chemistry, Medicine..etc.

One of the applications, which I see it quite impressive, is a 3d chart visualizer. It gives you a nice feeling that you are running on the axis, or between the points of the plot.

Actually, I have no pics for the VISTA.... but i can give you an approximation...
imagine the Gapminder in 3D effect.. That's wt u get when you use the VISTA_3dCharts.

Friday, August 31, 2007

Gapple: A google phone!!!

A HTC insider sent us a tip this weekend about an upcoming gphone coming out of Taiwan that should launch Q1 2008.

Google can make use of web service integration(gmail,google docs, ..etc). Google maps/GPS will play a big role to add to the Gapple features. In this way google can be really tight to anybody's life. online synchronization will be a feasible feature, you won't need any m/c to access ur life as u already have ur blog/gmail/docs/../../../etc on ur phone. this is really awesome.

Actually i don't know how google is going to compete with iphone? It's clear that they will provide a variety of features unavailable for iphone users.
but how about Hardware? is HTC able to compete the Apple slickness? the same issue for OS!!
iphone reached already 700,000 users and still counting. So, Google should be very wise to compete this mountain and to convince all these users to migrate their mobile device to Gapple. They can focus on services, cost (given that iphone remains expensive). so 100$ down cost can be good factor for migration.
Anyway, let's see how this will go.

By the way, iphone is on top of my wish list (it's not available yet here in Egypt) you can buy it for me on my birthday !!

google is not the only company moving to the phone worlds, there are rumors that Microsoft is trying to buy BlackBerry!!!!

Zmail

I didn't read about zimbra long time ago, since i was busy with Ruby.
I found that Zimbra created a gmail like skin called zmail. I got used of gmail skin and I would like time ago to have all my mail boxes with same interface at least.
A lot of people may get bored that gmail skin is not customizable. You can customize it using Firefox plugin.
check more details about zmail from here.

Wednesday, August 29, 2007

What Keeps me Happy at Work?

I like to be more related to my tasks and feel more productive. This should be done by improving my life style to feel some kind of achievements and renewing my habits continuously.
  1. Pause your computer: it is not necessary to turn it off, but at least i take few seconds to make a small walk to refresh my mind and give my eyes some rest.
  2. Don't check my email at the start: A lot of people check their email at the start of the day, once they arrive at their disks. I think this is not good attitude. I check the email related to my tasks first, then start on my tasks. I check emails after i finish, or when i go home. I finish my top priorities first.
  3. Drop tasks: frequently I drop tasks I find that they are less important. hence, I have always an inner satisfaction that I should not always finish my tasks list.
  4. Learn from my faults: I find it a great habit to be ready to hear people's criticism about myself and discuss it with them open-mindly.
  5. Be Creative: I like to achieve my tasks in a creative way. I should try always to add value to my work.
  6. Learning: look for ways to add to my knowledge by following new trends and new technologies.
  7. Evaluate myself before anybody evaluates me: I try to reconsider my habits and my behaviors periodically. Try to break any negative habits I have in dealing with my team, or with customers.
  8. Take Vacations: :)
  9. Be Positive: Add positive effect on people around you, and avoid their negative impact.
  10. Add to conflicts: when I have conflicts with others, I should try to think about a way of how to accelerate the disappearance of that conflict.
  11. Focus: when I am in a task, I focus just on this individual task. I avoid tasks mazes.
  12. share my achievements with others: I should communicate my achievements to my team to feel the value of our work all together. We should Speak up and find ways to let the right people know how we are contributing to the success of the company.

Firefox Add-ons for developers and designers

Firefox has cool add-ons which make the job of website designers and developers much easier. Here is our list of 30+ excellent Firefox add-ons that every web developer and designer should know about.
this link lists all these add-ons.

Wednesday, August 22, 2007

MAC character set reference


Ever wanted to type the copyright icon, or do an accent over an A without having to resort to some character palette? We have, and it takes time and is an effort. So we put together a series of help sheets that reference all of the characters that aren’t listed on your keyboard, along with their shortcut keys to make your life easier.
Get the List from Liquidicity

Desert Rose


I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

I dream of fire
Those dreams are tied to a horse that will never tire
And in the flames
Her shadows play in the shape of a man's desire

This desert rose
Each of her veils, a secret promise
This desert flower
No sweet perfume ever tortured me more than this

And as she turns
This way she moves in the logic of all my dreams
This fire burns
I realize that nothing's as it seems

I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

I dream of rain
I lift my gaze to empty skies above
I close my eyes
This rare perfume is the sweet intoxication of her love

I dream of rain
I dream of gardens in the desert sand
I wake in vain
I dream of love as time runs through my hand

Sweet desert rose
Each of her veils, a secret promise
This desert flower
No sweet perfume ever tortured me more than this

Sweet desert rose
This memory of Eden haunts us all
This desert flower
This rare perfume, is the sweet intoxication of the fall

Thursday, August 16, 2007

PDF Library on MAC

It happened by luck...
I was dragging a PDF file, then I dropped it mistakenly on itunes. I expected an error message or something popping into my face. Surprisingly, the PDF file was added ti the library.
At first glance, I thought it would be a bug or sthg :), so I clicked the file, and it opened the MAC viewer to display the PDF file.
WAAW, the itunes support PDF Files :), I am new to MAC world and it is clear that I miss a lot. I decided to give it a chance and check how much itunes can go far with me as a PDF organizer for files on my MAC.
I created a new library and called it "ebook" and I dragged some pdf to that library.
the itunes copy any files dragged to its library. In this case, I will have at least two copies of each files.
from preferences->advanced uncheck the "keep itunes music folder organized" and "copy files to itunes music folder when adding to library".
This doesn't look enough so far, i need some kind of tagging. thx to the "smart playlist" I can automatically assign a keyword and it will be added automatically to this playlist.
Hence, all I have to do is to add a prefix to my PDF files depending on the folder structure i need it to be.
I browse media and documents through only one application now :)
the advantage of itunes was to make a virtual structure. So, it wasn't a big deal where i place physically the file as long as i organize it well by tagging through the playlist, and the file can exist in many playlist (many-to-many relation) and this is sthg u don't get by folders.
Don't forget that this also will work under Windows as well ;)
I was happy with my itunes so far, although it doesn't support search in PDF contents.
searching in PDF contents is supported in Spotlight, so it was not a big deal. Another problem is that files are not opened inside itunes, instead, they were opened by the MAC Viewer.

What else can I have here?
I found a great tool called yep, It is really a great tool. It has the same decent look as any MAC tool.
It does everythg: searching, printing, tagging, browsing..etc it is really a great document store. It is freeware; I hope it remains so.

Wednesday, August 15, 2007

Flock's Distraction

Every nation had passed by hard times through its history. Hard times are mainly harsh realities of war and economy.
The way to overcome such moments discriminates the nations and determines which nation will dominate the others.
I don't get why we always obfuscate our problems, the government is not honest in the press releases about any event. Actually, it is not surprising to see that the country's obsession with celebrity is increasing during the last 60 years.
People look for escape during hard times. It is an acceptable way to reduce your pain. I admit that there are a lot of evidences of how this can be used positively. But my concern is that when it becomes to a daily routine running over and over by everybody.
Someone uses people's need to a constant in their lives and a hero who can boost morales by devoting more interest in Celebrities such as famous actors or athletes.
We should try to make the mentality more mature , not to destroy it by making it a shallow mentality seeking gossip columns and films posters.
The best way to face your problem is to know it, not to escape it.
It becomes annoying when a citizen feels that his country is forgetting his pain. Instead, all what his country is doing is to love its celebrities.
Japan didn't submit to these silly procedures after its defeat. they focussed to restructure their country, and they did it as a charm.

Tuesday, August 14, 2007

RSS Reader For MAC OS

I was trying to figure out the RSS readers i can use on my macbook.
I find an application called Shrook
At first glance, i didn't like it. I can't drag a link from Firefox. It works only with Safari.
Actually I am not a Safari fan as it has some problems with many sites. Rendering Arabic sites is always corrupted on Safari.

I decided to move to Google Reader
I didn't use it b4. I relied on Google Desktop reader, and it was enough for me at that time.
But I realized sthg very weird that may push me to refer to Shrook again.
I didn't find "SEARCH" in Google Reader!!!!
I didn't try to bother to look for it at first, I never expect that it is not there. IT's GOOGLE!!!

The Thai won the Imagine CUP

Thai students win the Imagine CUP. Their project was text-to-speech.

Details for the judge moments can be found here

Monday, August 13, 2007

The C++ Future

Dr. Bjarne Stroustrup, (English attempt at pronunciation of his name would be "B-yar-ne Strov-stroop") creator of C++, discusses new features that will be present in the next version of C++ (tentatively C++09). He addresses many important questions form the audience, and gives his views on C++ compilers, including GCC and Visual C++.
check the video here

you can get a list of applications built on C++ here

Saturday, August 11, 2007

Install Beast the open source forum

to install Beast open source forum:
  1. I prefer to get the code from Trunk, but last time I tried to do so, i found the version unstable. So, i used the tags link.
    $ svn co http://svn.techno-weenie.net/projects/beast/tags/rel-1.0pre/  beast
  2. Install RedCloth
    $ gem install RedCloth
  3. Install open-id
    $ gem install ruby-openid
  4. Install gettext
    $ gem install gettext
  5. Edit the environment.rb by changing the Salt Password by any different value.
  6. You Are Done

Monday, August 06, 2007

Windows Vs Linux

Today i saw a map on http://www.sanasecurity.com/ for system calls on both windows and linux.
I was shocked seeing how many calls are needed when u run IIS on windows. dude, this is really complex, hence very hard to be secured.


System running IIS on windows.
system running Apache on Linux

Sunday, July 22, 2007

Zimbra Violating the Open Source Term

Not all pretenders are Open source... this is true with zimbra at least which claims it is open source but actually I see everythg they r doing is against open source. check this for detailed discussion abt zimbra as open source.
I am still in my battle field working on Zimbra.
We upgraded to the new zimbra version now....
In this new version I found sthg in the code that made my nerves; all variables are written in this format "_158", "_140".
I found this hilarious...

Saturday, June 30, 2007

The fall of MS fan

For most of life, I have been a Microsoft user. I wasn't a MS' fan. But I didn't find it was not so bad working on Window, and it was fair enough for me, although it is not perfect.

I had great passion to try the Vista out, the long delayed version, 6 years or sthg. We all read abt it for many years, and how much it will be sthg fascinating and a new..bla..bla..bla
When I tried it on my PC, i was expecting sthg that could dazzle me.

finally, I got Vista business. I was totally wrong, I regret the day i installed Vista.

well, it is beautiful, the 3-D desktop switcher looks nice.
I faced many many problems with Drivers. the problem is not that they r not verified by Vista. the problem that from time to time, I had to redefine the drivers.
my network card kept me to be disconnected. I couldn't stay online for couple of hours. the stupid thing that when it disconnects, i have to press by myself "diagnose and repair" then should also "get IP" to ask the Vista to get another IP. What is this stupidity!!! didn't I define that already in the connection properties!! the answer to that question is the "ALLOW" :))
If u run sthg on vista, and precipitate away from ur PC, don't expect it is working.

u should wait because u will have to answer "Continue with getting a new IP?", "continue with opening this executable file"..etc I really hate this stupid thg in vista. i don't think i have to press 3 clickes just to run exe file..

The gadgets are terrible, I have never turned them on. they are not innovative and poor.

fighting to have a network connection really annoyed me.
this Vista eats the processor and the Memory. it slows down ur PC. without any tasks running ur RAM usage can be 512 MB. to use a PC now. u have to add $X o buy extra RAM for the Vista beast and $Y extra to more powerful processor, don't forget that u will pay for the Vista too :)
it seems to me that Vista price is too high. despite the license price is the almost the same since many old versions of windows, it is too high comparing with HW costs these days. Windows license can exceed 20% of ur costs!!!!

the only thg that may keep windows alive is that majority of mobile tools need windows to sync, and some softwares are not still available for MACs.

anyways, I didn't like the Vista thg.

Wednesday, June 27, 2007

My Writely Document

I used frequently these days my writely dcocument to share docs with friends. It is nice, I was just installing my windows and I didn't have my openOffice running. Writely helped me to start writing without bothering on installing any office.

but I noticed some problem with it.
If u copy from openOffice and paste in ur writely document, the numbering will be abused in some cases.
Also, if u face a problem with connection, and while disconnection another buddy is updating the Doc, u may have a trouble when ur connection is back.
u will try to refresh to check if anybody has updated the doc while u r offline. the problem is u won't get anythg by refreshing. so, u will think nobody updated anythg.
What is happenning is that when u come back online, the writely will consider ur old version is the most recent update and replace any changes happened while offline. if u didn't put this in consideration u will work on ur old version and didn't get ur buddy's updates.
to get ur buddy's work u have check the revision by urself, and if u find that some work has done while u r offline , click revert to the version preceding the last one.

Thursday, June 07, 2007

Erlang Vs Object Oriented

I think that in the future the functional programming community will be at peak. currently I think that the functional communities are too small to beat the Java community.

the functional is easier to any person. any one can write a functional code. Erlang for example has a light VM that can make profit of multiprocessors availability. this doesn't depend on certain compiler that enables parallelism in Java or C.
if you don't care about performance, think about parallelism as simpler way to structure software in a domain where there is a lot of natural concurrency.

I read a paper "Structured Programming Using Processes" in which the author tried to prove that the Erlang was capable to support a personal accounting software application. Maybe you can take a look to it later.

also, I like to point to Yaws, Yaws is a HTTP high performance 1.1 webserver particularly well suited for dynamic-content webapplications. I ma really amazed by its performance.

well, but why Erlang is not widely used till now?
Well the world likes Java. the type safe language. Security in distributed Erlang is “all or nothing,” so when a node is authenticated to another, it can perform any operation.
process isolation is not complete, a process can flood another process with messages, or it can steal all the CPU cycles by entering into an infinite loop.

Thursday, May 24, 2007

Agile Process

My first reading about Agile was the Agile Manifesto. I think this was enough to get the whole picture of the agile philosophy.
I really don't recommend that you get a book to read about the agility; it will be a contradiction to read a book as long as the Agile methods emphasize working software as the primary measure of progress. It is better you spend the time understanding your working environment and maturity to apply the best process that can fit with it.
I lived a similar experience with eSpace when they were aiming to get a CMM certificate, CMMI or whatever they will call it after couple of years.
I think that finally the people here got the good decision by putting this plan away, and put their own standards, the standards best fitting with their teams and their environment. I doubt their was a need to some white collar guy to supervise our documents and our working styles to decide whether we fit to Mr XYZ standards or not. I also got the chance to meet some guys from another company having this certificate. What I found is that they modified their hierarchical structure just to accommodate the standard although their team wasn't capable at all to support this hierarchy.

Anyway, let's move to another point...
When we talk about the agile process we should identify very well any possible limitations before adopting it. It is very clear for me that it needs mature people, and this can be considered as one of the limitations.
Another factor that may limit the agile adoption is the "distributed software". Lately all our projects are distributed. Customers are from Europe, USA, Gulf. Developers are working remotely from different areas.
What are the challenges behind such distributed agile work???

The answer of this question can be summarized in knowing that agile methods mainly rely on informal processes to facilitate coordination while distributed software development typically relies on formal mechanisms.

Challenges in Agile Distributed Development
  1. Communication need vs. communication impedance: How can we achieve a balance in formality of communication in agile distributed environments?
  2. Fixed vs. evolving quality requirements: the Agile relies on ongoing negotiations between the developer and the customer while Distributed Development often relies on fixed, upfront commitments on quality requirements.
  3. People- vs. process-oriented control: We appreciate the people-orientation the most.
  4. Lack of cohesion: Generally speaking about the distributed environment, people may feel In distributed development, participants are less likely to perceive themselves as part of the same team when compared to co-located participants. the agile adds some more excitement to it :)
Practices
  1. Process Refactor: Continuous process adjustments instead of following strictly the agile practices. It is also recommended to document the requirements at different levels of formality.
  2. Knowledge Spreading: the team should share their knowledge regarding different domains(business, code, test cases..etc). Alot of tools were developed to reduce the overhead of knowledge-sharing activities. Code/process Repository is a must. the Wiki also is a very important way to share the How-Tos between members. I can't neglect the Bugzilla with its role in creating database to help teams report issues and assign priorities.
  3. Short Iterations: any iteration should not exceed 2 weeks. short iterations help to detect any misunderstandings for the project business and prevent any time waste.
  4. Start with well-understood functionalities: In order to create the best atmosphere for developers there should be a solid sand to start to be familiar with the processes, tools, and the application. this can be some kind different that the agile which advocates the development of features prioritized as critical by the customer.
  5. Improve Communication: Synchronized work hours are very important for the team. Also try to make the informal communication be done through formal channels. for example, let it through the emails so that it can be archived. In the distributed Projects it is recommended that the project leader/manager should be involved in the communication and the synchronization process than the Agile practice. finally, some daily mechanisms should be done to maintain minimal communication like morning online meeting.
  6. Building Trust: trust involves both the team and the customers.
References:
1. Ebert, C. and Neve, P.D. Surviving global software development. IEEE Software 18, 2 (Mar./Apr. 2001), 62–69.
2. Highsmith, J. and Cockburn, A. Agile software development: The business of innovation. IEEE Computer 34, 9 (Sept. 2001), 120–122.
3. Matloff, N. Offshoring: What can go wrong? IT Professional (July/Aug.2005), 39–45.

Saturday, May 12, 2007

Web Antivirus

Web Services are increasingly becoming an essential part of your everyday life. How much time you spend surfing the internet pages?
To be more specific how much you feel now that Google is too much involved in your daily routine? Can you imagine your life without Google? your search, your Calendar, your email, your blog, ...etc

Well, it seems that you will look for Google to be your web antivirus. Before you access a page, type the url in google search and pray that you won't get "this site may harm your computer".
you have just to obey, otherwise your PC will be affected.

the story begins with researchers from the firm surveyed billions of sites, subjecting 4.5 million pages to "in-depth analysis". Actually they found 450,000 pages guilty.

It is sufficient only one visit from you to make the attacker able to detect and exploit a browser
vulnerability. Therefore, the goal of the attacker becomes identifying web applications with vulnerabilities that enable him to insert small pieces of HTML in web pages.
An example for this is iframes, which can successfully install a malware binary "drive-by-download".
Are the web masters, or the site creators are responsible for this?
The answer is, it is not always the case.

User Contribution

Many web sites feature web applications that allow visitors to contribute their own content. This is often in the form of blogs, profiles, comments, or reviews. they usually support only a limited subset of the hypertext markup language, but in some cases poor sanitization or checking allows users to post or insert arbitrary HTML into web pages.

Advertising
Although web masters have no direct control over the ads themselves, they trust advertisers to show non-malicious content. Sometimes, advertisers rent out part of their advertising space; in this case the web master needs to trust the ads provided from a company that might be trusted by the first advertiser. And so on, you may find nested relations which considered as pitfall in the trust relation by making it a transitive one.

Third-Party Widgets
A third-party widget is an embedded link to an external JavaScript or iframe that a web master uses to provide additional functionality to users. Example for this, Google Analytics :)

Webserver Security
The contents of a web site are only as secure as the set of applications used to deliver the content, including the actual HTTP server, scripting applications (e.g. PHP, ASP etc.) and database backends. If an attacker gains control of a server, he can modify its content to his benefit. For example, he can simply insert the exploit code into the web server’s templating system. As a result, all web pages on that server may start exhibiting malicious behavior. Although we have observed a variety of web server compromises, the most common infection vector is via vulnerable scripting applications. We observed vulnerabilities in phpBB2 or InvisionBoard that enabled an adversary to gain direct access to the underlying operating system. That access can often be escalated to super-user privileges which inturn can be used to compromise any web server running on the compromised host. This type of exploitation is particularly damaging to large virtual hosting farms, turning them into malware distribution centers.

Exploitation Mechanisms
A popular exploit we encountered takes advantage of a vulnerability in Microsoft’s Data Access Components that allows arbitrary code execution on a user’s computer.
Typical steps taken to leverage vulnerability into remote code execution:
  • The exploit is delivered to a user’s browser via an iframe on a compromised web page.
  • The iframe contains Javascript to instantiate an ActiveX object that is not normally safe for scripting.
  • The Javascript makes an XMLHTTP request to retrieve an executable.
  • Adodb.stream is used to write the executable to disk.
  • A Shell.Application is used to launch the newly written executable.
Another popular exploit is due to a vulnerability in Microsoft’s WebViewFolderIcon. The exploit Javascript uses a technique called "heap spraying" which creates a large number of Javascript string objects on the heap. Each Javascript string contains x86 machine code (shellcode) necessary to download and execute a binary on the exploited system. By spraying the heap, an adversary attempts to create a copy of the shellcode at a known location in memory and then redirects program execution to it.

Detecting Dangerous Pages
Simply, by monitoring the CPU and the processes executed on accessing the page. When some unknown processes are added to the list, this will be a strong sign that a drive-by download has happened.

Google will be more and more involved in our life, it will report to you malicious sites for free....
anyway, it is not a big deal, you can do it yourself for some levels. but there a little bit sophisticated cases when you need multilevel reverse engineering...

source: Google Research Paper



Update: Google online security blog, the latest news and insights from Google on security and safety on the internet.

Wednesday, May 09, 2007

Upgrade your Experience with Google Analytics

Few days ago Google Analytics has released a new version. The new user UI enables easier use of the reports and metrics within the data sets,

New Google Analytics Visitor Overview

NEW:
  • Email reports and improved clarity of graphs allow users to explore and discover new insights
  • Customizable dashboards ensure the right data gets to the right people at the right time
  • Plain language descriptions of the data allow users to take action to improve their web site
This is awesome :)

Attitudes for Creativity

I just remember the Bernards Shaw's quote:" You see things, and you say, "Why?" But I dream things that never were, and I say "Why not?"
I am sure if the creativity can be learned anyway, a lot of people just born to be creative...
maybe someone can see this link listing 9 attitudes for creative people, and tell me if creativity can be learned or not.
the attitudes as listed by the link are as follows:

1. Curiosity

"What if?", "Why?", "Why Not?"...

2. Seeing Problems as Interesting and Acceptable

ChallengeCreative people see problems as a natural and normal part of life - in fact they often have a fascination with problems and are drawn to them.

3. Confronting Challenge

Asking ‘how can I overcome this’?

4. Constructive Discontent

Awareness of what’s wrong with the world around, then let it be a motivation to doing something constructive.

Friday, May 04, 2007

The 100 most Influential Personalities


Time magazine.....Created a list of the 100 most influential people in the world.
The Saudi monarch Abdullah bin Abdul Aziz was ranked 36 among the 100 most influential personalities on the political level in the world for 2007. The list included personalities from diverse backgrounds, including Sudanese President Omar Al-Bashir, along with Egyptian Islamic preacher Amr Khaled. It was striking absence from the list the name of the American President George Bush, leaving the place for Osama bin Laden and the Pope Benedictos XVI and Al Gore, Leonardo de Caprio and others. For the politicians, the list included the name of the American Secretary of State Condoleezza Rice, and the Supreme Leader of the Revolution, the Iranian Ali Khomini, and Raul Castro, brother of Cuban President, along with the Democrats, the main candidates to the American presidential elections of 2008, Hillary Clinton and Barak Obama, in addition to the Chairperson of the American House of Representatives Nancy Pelosi. The 34/39 former U.S. Vice President Al Gore in the category of "scholars and thinkers," along with the co-founder of Microsoft Paul Allen.
In the category of "heroes and pioneers," the name of the multi-millionaire Warren Bouvet, and French soccer star Thierry Henry and an activist in the issue of Darfur Representative George Cluny. It also named for the founder of the site "youTube" electronic videos on the list and the name of the founder of Apple, Steve Jobs.

The journal does not rank such personalities, not necessarily to justify why chosen figures, only saying that it wants to honor the "men and women who change the world using their talents, their authorities or their moralities"

This is a strike to the Egyptian system, choosing Abdullah is an indication of the absence of the Egyptian effect on the middle East, where Egypt has been always the most effective player. Currently, it is really obvious that Saudi Arabia stole this role from Egypt.
We don't forget picking Amr Khaled is also a big strike, there were rumors that Amr Khaled was forbidden from Egypt because of the worry of his effect on the Egyptian people, and he faced a lot of Media battles to deny his effect and his role in the islamic world.

Thursday, May 03, 2007

The BlackWater's Danger

I think the phenomenon of BlackWater is too dangerous concept...
The USA uses these kinds of gangs to fight for them instead of get involved in IRAQ, Afghanistan.
These gangs cannot be punished for war crimes, because they are not nothing actually. they are not a military, nothing except...........
They achieved numerous massacres in IRAQ and Afghanistan, wearing Navy Uniform.

Privatization in Egypt is totally different than privatization all over the world :)...This is about the privatization of war and how that subverts even basic notions of democracy. The blackWater is used as a mirror for "Radical Christian Right".

If we are still not aware of wt does this really mean...then here we are..
Blackwater is also the name of private company, formed by an ex-Navy Seal, which owns the training facility and sells "security" to countries or organization doing business in high-risk areas of the globe.

Blackwater's security services included making available - for a price - a small army of heavily armed, experienced mercenaries with access to their own helicopter gun ships, armored vehicles and war planes.
Some says that in 2006, Blackwater had 2300 soldiers deployed in nine countries with a database of 21,000 additional on-call mercenaries.
Where these soldiers come from?????
There are EX-Special Forces from US and UK. they simply can't find inner peace in thir civilian life, so they looked for wars in other countries (Islamic ones). We don't need to say that they r very cruel, experienced, commandos, seal...etc everythg we may think about.
the BlackWater can defeat a significant number of countries.

Some others confirmed that Blackwater has won - on a sole-source basis - more than $500 million of US government contracts, not including unlisted "black" contracts. In addition to Iraq, Blackwater has contracts for work in the Louisiana flood area and on the Mexican boarder. The total global value of private military security contracts is estimated to be $100 billion and rising.

Aren't these terrorist gangs?
they make me sick, that's enough for now :S

Saturday, April 28, 2007

Communication Barriers


I think that we are the most skillful people to achieve a team work. I thought that the majority of us have been working in teams since their first academic year, and for me, this was good reason to justify my theory.
Ironically, I am totally convinced with my theory, while all other careers look to developers as freaks. Well, I show up hands to agree with this. My theory isn't precise...I should add "teams of developers". At least the freaks can understand each other :)

Team chit chat
It should be curious that our teams may still have problems in communication. I got some remarks from my partners, through the projects, concerning my communication success with them.
The big majority confirmed that:
  1. I have a problem in transferring my knowledge to them.
  2. I am "expression-less", so that someone asked me to put a sign indicating my mood whether "I am sad" or "I am happy".
The 2nd point is little bit tough. The 1st point can be analyzed and managed.
It was normal that I spend time thinking about how much people think that I have deficiencies in transferring my knowledge and my talk skills. At the beginning I was trying to evaluate myself and think how can I overcome my problems.
hence, whenever someone asks me about anything, I make a flash back to the days when I was still learning that thing, memorize all the questions I got at that time, and then start my brief session.
I worked on this thinking that I am overcoming my problems with partners. But I was totally wrong.
one day, I was making a brief introduction to my partner, he shouted "Fizo, I really don't get you, your explanation is really vague....Why don't you make a flash back to the days when you started to learn this thing and explain to me based on the question you got in your head?"
"huh...?" That what I am doing all the time.

Again, there should be something wrong...This time I thought about it in more abstract way.

Evaluation Barrier
My partner's comment made me notice a small problem...
It's the "Tendency to Evaluate", this is a human nature, the first reaction of a statement is to evaluate it from "your" point of view. It's a tendency to judge, approve/disapprove person's statement. What was really happening is that my explanation was evaluated by my partner more than listening with understanding.

Listening with Understanding
You should achieve real communication by avoiding evaluative tendency. This means seeing the attitude from the other person's point of view, touch his/her frame of reference about the subject.
I see that I should answer question, in the contest I can do it. Some efforts should be done by the questioner to get and understand the whole picture. In practical life we are not open books, my head is not indexed like the book, I have no appendices pointing to keywords which the questioner look for.
What will happen when you listen to my answer and analyze it to get your satisfactory answer? Does this sound absurdly simple??
Actually "listening" is not widely used. There are a lot of reasons in my opinion to avoid the "listening" thing.
  1. Most of us have a defensive attitude when it comes to opinions' discussions. We are afraid to get affected and changed by what we hear. Weird, isn't it?
  2. Emotions, in some discussions emotions become strongest, so they forbid us from achieving the frame of reference of the others. (let's not focus on this right now, as we are more involved with technical discussions)
I don't think I am saying something new. What the entry includes is very obvious for all of us, "the importance of listening"...But the fact, is, the problem has endured because it is a basic truth about human interaction.

Thursday, March 29, 2007

Practical RESTful rails Example

Using PUT and DELETE with GET and POST is the main idea behind REST to simulate the CRUD mappings.
Note: Web-Browsers neither support PUT nor DELETE

Create a Rails project and the Resource Scaffolding
$ rails warehouse
warehouse> ruby script/generate scaffold_resource product name:string desc:text
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/products
exists test/functional/
exists test/unit/
create app/views/products/index.rhtml
create app/views/products/show.rhtml
create app/views/products/new.rhtml
create app/views/products/edit.rhtml
create app/views/layouts/products.rhtml
create public/stylesheets/scaffold.css
create app/models/product.rb
create app/controllers/products_controller.rb
create test/functional/products_controller_test.rb
create app/helpers/products_helper.rb
create test/unit/product_test.rb
create test/fixtures/products.yml
create db/migrate
create db/migrate/001_create_products.rb
route map.resources :products
warehouse> rake db:migrate
== CreateProducts: migrating ==================================================
-- create_table(:products, {:options=>"default charset=UTF8"})
-> 0.0160s
== CreateProducts: migrated (0.0160s) =========================================
We can now have a look to the generated controller.

URLs.
An example of URL in REST is (/product/1) instead of (/products/show/1). We notice that the action is dropped from the URL, we can't know what is the action that should happen to the addressed resource.
The REST actions are activated through a combination of resource-url and HTTP verb. Another feature in the REST action, is that it can react with different response-formats . REST uses the respond_to. We can see this in the generated controller we got from the above steps.
The format specification can be simply done by appending it to the request.(http://localhost:3000/products/1.xml)

Views
Remember the old days when we used to find the following line in the generated views:
link_to :controller => "products",:action=>"show", :id => product
>>>< href="/products/show/1">Show
Looking to our generated views, we see the following code instead:
<%= link_to 'Show', product_path(product) %>
>>>< href="/products/1">Show
The 'link_to' call is the same, but the hash is replaced by the path_methods.

Same thing for the following methods:
<%= link_to 'New product', new_product_path %>
>>>< href="/products/new">New product

<%= link_to 'Edit', edit_product_path(product) %>
>>>< href="/products/1;edit">Edit
It is not surprising to expect that the REST will affect our forms too. Now, we have to use Path-Methods in our Create/Edit forms.
The :url-hash is replaced with the calling of a Path-Method
  • product-path for the new-form.
  • product_path(:id) for the edit form.
<%= form_for(:product, :url => products_path) do |f| %>
>>>< action="/products" method="post">

<%= form_for(:product, :url => product_path(@product),
:html => { :method => :put }) do |f| %>
>>>< action="/products/1" method="post">
< style="margin: 0pt; padding: 0pt;">
< name="_method" value="put" type="hidden">
< / div>

Finally, the Destroy. The method used for both showing and deleting is 'project-path'. The only difference is that the destroy link additionally uses the parameter :method to name the HTTP method to use (:delete) because the browser doesn't support DELETE.
<%= link_to 'Show', product_path(product) %>
%= link_to 'Destroy', product_path(product),:method => :delete %>
In the same manner controllers have to take special care in using the new technique during redirect operation. Rails uses the URL methods generating a method for each path methos:
project_url for project_path
projects_url for projects_path
redirect_to :controller =>"products", :action=>"show", :id=>@project.id
>>>>
redirect_to project_url(@project)

Monday, March 26, 2007

RJS

Ruby on Rails has excellent support for Ajax baked right into the framework. Remote JavaScript (RJS) templates build upon the Ajax support offered by Rails, allow to easily update multiple page elements.
This is a quick start to work with RJS.
$ rails RJS_Example


Create your controller:

RJS_Example> ruby script/generate controller Examples
exists app/controllers/
exists app/helpers/
create app/views/examples
create test/functional/
create app/controllers/examples_controller.rb
create test/functional/examples_controller_test.rb
create app/helpers/examples_helper.rb


Let's modify the default controllers now:
class ExamplesController < ApplicationController  
def index
end
def display
@statement = params[:statement]
end
end


Now, we should go to create our views.
Create in the $RJS_Example/app/views/examples create your index.rhtml
In the header include this tag
    <%= javascript_include_tag :defaults %>

The :defaults helps to add all the Scriptaculous visual effects and controls.

In the body, add this code.
    <%= form_remote_tag :url => { :action => 'display' },
:html => { :id => 'display-form' } %>
<%= text_field_tag 'statement', nil, :size => 40 %>
<%= submit_tag 'submit statement' %>
<%= end_form_tag %>


We use the form_remote_tag() helper instead of the form_tag().
:html option helps to reset the form after completion.
:url option specifies the controller action that receives the form data.
Finally the empty "div id=statement",The id provides a way to reference the element from the RJS template.

Create partial template app/views/examples/_example.rhtml
  [<%= Time.now.to_s(:db) %>]

<%=h example %>


Create the RJS template: app/views/examples/display.rjs
page.insert_html :bottom, 'statements', :partial => 'example'
page.visual_effect :highlight, 'statements'
page.form.reset 'display-form'

The page object is an instance of the Rails JavaScriptGenerator.
the partial template app/views/examples/_example.rhtml is rendered, and the resulting content is inserted into the bottom of the statements div.

Sunday, March 25, 2007

Globalize on Ruby-On-Rails

The Globalize is an internationalization and localization plugin.
  • Translates both db content and view text.
  • Supports automatic selection of an alternate, localized template for each view.
  • Built-in localization and translation of strftime, numbers, and currency formats.
  • Supports pluralization.
  • All based on three automatically migrated database tables.
I is the best solution to support multi languages for your rails application.
The globalization wiki is not yet complete. But I think the "Get Started" part is fair enough to help you out making your globalized application, it provides very helpful external links.
  1. Sven’s Globalize Writeup – has many times been refered to as “the best documentation available for Globalize” .
  2. Example Application – takes you step by step through the process of creating a Globalized example application.
  3. Unit-tested Example – a walkthrough using a test-driven approach by Josh Harvey.

Saturday, March 24, 2007

My Visual DNA

Leadership User Guide

Leadership has becoming more and more important due to the globalization and its effect on the effective workforce in market.

Who is a leader?

A leader is someone who makes things happen by:

* Knowing the objectives and having a plan to achieve them.
* Building a team committed to achieving the objectives.
* Helping each member to give his best effort.

A leader must demonstrate two active traits: expertise and empathy. Also he takes active roles in remaking the environment in productive ways.

What is Leadership?

Leadership involves cooperation and collaboration activities that can occur only in a conductive context. It is the art of influencing a body of people to follow a certain course of action; the art of controlling them, directing them and getting the best out of them. A major part of leadership is man-management.
Leadership is the capacity to translate vision into reality.

There is a different between Management and Leadership.

Leadership Vs Management

Leadership

Management

People

Things

Empower

Control

Effectiveness

Efficiency

Principles

Techniques

Purpose

Method

Doing the right things

Do things right

Is the ladder against the right wall??

Climbing the ladder fast.

Leadership styles.

Creation of resonance can be done in six ways, leading to Six Leadership Styles. Typically, the most effective leaders can act according to and they can even skillfully switch between the various styles, depending on the situation.(According to Daniel Goleman).


Visionary Leadership

(Transformational Leadership)

Coaching Style

Affiliative Leadership

(People-Oriented)

Democratic Leadership

Pacesetting Leadership

(task oriented)

Commanding Leadership

How style builds resonance

He moves people towards shared dreams.

Connects what a person wants; with the organization's goals.

Creates harmony by connecting people to each other.

Appreciates people's input and gets commitment through participation.

Realizes challenging and exciting goals.

He decreases fear by giving clear direction in an emergency.

The impact of the style on the (business) climate

+ + +

+ +

+

+

Often ― ― when used too exclusively or poorly

Often ― ―

When style is appropriate

When changes require a new vision. Or when a clear direction is needed. Radical change.

To help competent, motivated employees to improve performance by building long-term capabilities.

To heal rifts in a team. To motivate during stressful times. Or to strengthen connections.

To build support or consensus. Or to get valuable input from employees.

To get high-quality results from a motivated and competent team. Sales.

In a grave crisis. Or with problem employees. To start an urgent organizational turnaround. Traditional military.

Saturday, March 17, 2007

Erlang Review

After I got a quick look to Erlang, I started to feel a little more curios to this language, and I decided to give it a portion of my readings.
The resources of this language are limited, it is very clear that it is still in the "Early Adopter" phase. I already believe that this language can realize a very good hype very soon. Furthermore, I see it has as many advantages as the Ruby.
I won't talk about the ordinary features which anybody can figure out by himself. What I see the most important point is "Concurrent Programming" in Erlang.
Now, I think of this blog entry as a checkpoint of my digging results in the Erlang World, and not an Erlang Quick Start. this is just an entry to point to the "Erlang Status".

Erlang is a programming language designed for building highly parallel, distributed, fault-tolerant systems. It has been used commercially for many years to build massive fault-tolerant systems which run for years with minimal failures. Erlang combines ideas from the world of functional programming with techniques for building fault-tolerant systems to make a powerful language for building the massively parallel networked applications of the future.
This means that your Erlang program should run X times faster on a X core processor than on a single core processor, without changing a single line in your code. I really appreciate this flexibility. You can use this feature in a very effective way in your application.
I didn't test the Erlang by myself and test its performance, but actually I am very optimistic towards the results, given that the Erlang is heavily used on embedded systems. so, I expect that it has a good performance comparing with other technologies such as Java, Ruby..etc
frankly speaking, I didn't test the Ruby on my PDA. But I expected that the performance won't be pleasant at all. so I decided to save my time for something else. About Java, yes well, I tested it and I am not ready to do it again.
I wondered if anybody used Erlang in web applications!!! The good news I found is that there is a plan to produce a web platform for Erlang. well, there is already a web platform for Erlang but it is not open source and information about it is very limited because it was developed outside of Ericsson
I think the Erlang consulting and Training Ltd has used an Erlang web platform. which I think a quite impressive start for the Erlang. When I think about Erlang Platform, I think of powerful concurrency handling of heavy loads (It is the Erlang nature, nothing to do with it), and I certainly remember the fault-tolerance embedded with Erlang (built-in ability to upgrade software during runtime without restarting or failure time) which is something missed in most of frameworks dominating the marketplace nowadays. This paper talks in some more details about the status of the Erlang Platform.

I hope you enjoy your Erlang programming.