We have just finished the x10 day..We really had very odd trip. Everythg was not as planned.
Getting lost in NY, having not enough clothes in a cold windy weather, getting food from a Mexican Inn that mad me sick all the following day.
The x10 workshop was nice, I met many people from the community, and it was fun.
About Me
- Ahmed Abd-ElHaffiez Hussein
- PhD Candidate at Purdue University, Computer Science.
Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts
Friday, April 16, 2010
Wednesday, March 31, 2010
Taysseer Zilmenna Launch
Today, We released Taysseer Zilmenna alpha release.
The current release is not still stable, We hope that we will add some enhancements later. I am not able to dedicate time for it now, as I have many projects and assignments to do. But I have some ideas to add.
The current release is not still stable, We hope that we will add some enhancements later. I am not able to dedicate time for it now, as I have many projects and assignments to do. But I have some ideas to add.
Tuesday, September 22, 2009
Unbiasing the biased thing
I think the title is quite interesting. For VMs guys the biased locking is a well known topic.
I read a post few months ago an entry about the impact of the biased implementation in Java 6, and to get full idea go quickly through the comments as well.
I liked to make the same experiment against the JikesRVM biased implementation which I am working on currently.
It was really interesting that I got a slightly different behavior than the same experiment running on Java6.
Java6:
It is always the same output, the first thread does all the work, and the other threads display zeros.
JikesRVM:
Every run, I get a different output: The following are examples of what I got as an output from the little experiment:
Another one:
Although the JikesRVM is somehow far from being "fair", I think we are on business. The real question will be how we can increase this fairness without beating the performance of the biased mechanism, or how can we decrease the threads starvations and get the same performance we are aiming for from the biased implementation.
It worth mention that the current implementation beats Java6 in many benchmarks. Stay tuned with more entries about this.
I read a post few months ago an entry about the impact of the biased implementation in Java 6, and to get full idea go quickly through the comments as well.
I liked to make the same experiment against the JikesRVM biased implementation which I am working on currently.
It was really interesting that I got a slightly different behavior than the same experiment running on Java6.
Java6:
It is always the same output, the first thread does all the work, and the other threads display zeros.
JikesRVM:
Every run, I get a different output: The following are examples of what I got as an output from the little experiment:
$runnable[0]: counter=4
runnable[1]: counter=0
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=987
Another one:
$runnable[0]: counter=5Again:
runnable[1]: counter=498
runnable[2]: counter=488
runnable[3]: counter=0
runnable[4]: counter=0
$runnable[0]: counter=1Ok, I promise this is the last one:
runnable[1]: counter=990
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
$runnable[0]: counter=117I run the experiment on my Ia32_linux system and used exactly the same code in the same entry I refer to.
runnable[1]: counter=875
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
Although the JikesRVM is somehow far from being "fair", I think we are on business. The real question will be how we can increase this fairness without beating the performance of the biased mechanism, or how can we decrease the threads starvations and get the same performance we are aiming for from the biased implementation.
It worth mention that the current implementation beats Java6 in many benchmarks. Stay tuned with more entries about this.
Sunday, April 26, 2009
embedding ftpServer
I was trying to embed the ftpserver in my Java code. I had a problem exception:
I looked to the source files of the slf4j and found that in the latest release slf4j-1.5.6 there is a private modifier in Class org.slf4j.impl.StaticLoggerBinder
ftpserver puts slf4j-api-1.5.2.jar, that's why it deals with this member as public.
All you need to do is
1- change the modifier of this member.
2- or get the latest sl4fj-api-1.5.6.jar
Exception in thread "main" java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
I looked to the source files of the slf4j and found that in the latest release slf4j-1.5.6 there is a private modifier in Class org.slf4j.impl.StaticLoggerBinder
private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
ftpserver puts slf4j-api-1.5.2.jar, that's why it deals with this member as public.
All you need to do is
1- change the modifier of this member.
2- or get the latest sl4fj-api-1.5.6.jar
Monday, April 20, 2009
MapReduce .. Another Chance
I have been calling for MapReduce and to replace the Relational Database.... I was just one guy of its thousands attracted by this.
I will be waiting for the release of this paper. at the end it depends on your system. sometimes you may need flexible designs more than performance. I think MapReduce is better in this.
I will be waiting for the release of this paper. at the end it depends on your system. sometimes you may need flexible designs more than performance. I think MapReduce is better in this.
Tuesday, April 14, 2009
Scala threading
Scala augments Java's native support for concurrency by adding actors. The Scala's actors library does address the fundamental problem of shared data and locks model by providing an alternative, share-nothing, message passing model that programmers tend to find much easier to reason about. They are implemented on top of normal Java threads, so that every actor must be given its own thread, so that all the act methods get their turn.
It is clear, that this model is not efficient as the creation and switching of threads are not cheap in Java. The normal implementation of receive returns after it finds and processes a message. To overcome this problem Scala adds an alternative to the usual receive method which is called react. react takes a partial function, but it doesn't return, its result type is Nothing.
Scala users, you should be ware that you are still on top of Java threading model...
It is clear, that this model is not efficient as the creation and switching of threads are not cheap in Java. The normal implementation of receive returns after it finds and processes a message. To overcome this problem Scala adds an alternative to the usual receive method which is called react. react takes a partial function, but it doesn't return, its result type is Nothing.
Scala users, you should be ware that you are still on top of Java threading model...
Friday, March 20, 2009
Erlang propaganda
It's weird when I first noticed the propaganda around Erlang specially in 2007..Everyone was going crazy talking about Erlang.
You can see it is not the case the last year.
I was thinking that maybe this was due to the launching of other languages built on Java. the new languages like Scala, Clojure made many enhancements to the concurrency problems in the Java model while preserving the knowledge and the libraries of this famous language.
You can see it is not the case the last year.
I was thinking that maybe this was due to the launching of other languages built on Java. the new languages like Scala, Clojure made many enhancements to the concurrency problems in the Java model while preserving the knowledge and the libraries of this famous language.
Sunday, December 14, 2008
Aiming at SVG..Experience Rich Web

I think that the future will be for the SVG replacing the normal image formats..
First time for me to hear about SVG was when I was discovering the Batik. I liked at that time the easy way the batik provide access to SVG.
But I didn't go deep with this as SVG couldn't be used with web products at that time.
Currently, the latest versions of Mozilla is supporting SVG, and work is still going to fully integrate it to the firefox. check the Mozilla SVG project for further information.
Opera also announced that it has support to some extent for the SVG
Adobe released Adobe viewer which is a plugin to support SVG in browsers, though I prefer a native support without relying on plugins.
So why someone should use SVG instead of normal image formats in web:
- SVG is a vector format, SVG images can be printed with high quality at any resolution.
- SVG is plain text, it's W3C standard. So, you can deduce that it is much more easy to compress these text formats.
- As it is text .. then SVG support search in text! Suppose you implement google maps on SVG then you can search the text in the maps. (interesting)
- Did you worry every time by the level of zooming you provide vs the resolution you have for your image? With SVG there is no worries about pixelization with increasing zooming level. You can get very good zooming quality.
- You can get the same effect you want with Flash as the SVG supports animation.
- It's open source if you seek openess.


Thursday, December 11, 2008
Back to Shell
Finally, I am back to the open source world.
After getting my new used Toshiba Satellite A100, I downloaded Ubuntu 8.10.
Something I liked when installing the new ubuntu is its ability to be installed within Windows. So, u don't have to bother about restarting, disk formats..bla..bla..bla.
I checked the new OS installation on my laptop. Well, I am impressed, everything seemed to be working smoothly.
My next step was to run the JikesRVM on eclipse to start some development.
in order to achieve this:
if you run
u will get a list of the libraries you have on your system.
While for the jikes compilation u will need gcc multilib and g++ multilib
so, you should get the g++-multilib by running
In case you have other java installations ..Run this command to fix configurations.
Re-login
Download eclipse from its official site.
I found some errors in the source code after getting the project into eclipse.
My friend Morshedy advised that it may be a common problem with the eclipse, so I run the
So, I guess I will wait for an update on the SVN.
Update: it was not my lucky day when I was building jikes..I tried to build it many times on that day. but I got errors when openening in eclipse...
So, I retired again a day later by :
After getting my new used Toshiba Satellite A100, I downloaded Ubuntu 8.10.
Something I liked when installing the new ubuntu is its ability to be installed within Windows. So, u don't have to bother about restarting, disk formats..bla..bla..bla.
I checked the new OS installation on my laptop. Well, I am impressed, everything seemed to be working smoothly.
My next step was to run the JikesRVM on eclipse to start some development.
in order to achieve this:
if you run
$ dpkg --get-selections | egrep '32|gcc'
u will get a list of the libraries you have on your system.
While for the jikes compilation u will need gcc multilib and g++ multilib
so, you should get the g++-multilib by running
$ sudo apt-get install g++-multilibYou will also need Bison
$ sudo apt-get install bisonget ant
$ sudo apt-get install antget your Java packages by running..
$ sudo apt-get update
$ sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin
In case you have other java installations ..Run this command to fix configurations.
$ sudo update-java-alternatives -s java-6-sunSet your $JAVA_HOME variable
$ sudo gedit /etc/environmentand add JAVA_HOME = "/usr/lib/jvm/java-sun-6"
Re-login
Download eclipse from its official site.
$ sudo apt-get install subversionImport the project into workspace.
$ svn co https://jikesrvm.svn.sf.net/svnroot/jikesrvm/rvmroot/trunk jikesrvm
$ cd jikesrvm
jikesrvm$ bin/buildit --eclipse localhost -j $JAVA_HOME
I found some errors in the source code after getting the project into eclipse.
My friend Morshedy advised that it may be a common problem with the eclipse, so I run the
jikesrvm$ find -wholename *.java -exec touch {} \; but didn't solve it.So, I guess I will wait for an update on the SVN.
Update: it was not my lucky day when I was building jikes..I tried to build it many times on that day. but I got errors when openening in eclipse...
So, I retired again a day later by :
jikesrvm$ rm rf componentsand then rebuild..it worked fine this time
jikesrvm$ ant very-clean
Wednesday, October 08, 2008
Will we say Goodbye to RDBMS?
Through my work in the last 2 web projects I made a different architecture different that the usual ones.
The projects depend basically on a powerful multilingual search engine.
Using the Lucene technology for both projects created a big bunch of index files.
All I did, that I made all the navigation in the site be done through the search engine. So, I don't need to retrieve data from DB anymore.
Of course the site is dynamic, I think that I can just rebuild the index file from time to time(from scratch)..and if the site you work on has huge index files that will take months to be rebuild then you can rely on the (add/delete) command in the Lucene.
But in all cases, I expect this will future of Data storage. later, I figured out that Google App Engine provides way to connect directly to the BigTable.
Also, many Document based storage were released such as CouchDB build in Erlang (my beloved language) and thrudb.
I expect to release technical details about the architecture and the tradeoffs.
The projects depend basically on a powerful multilingual search engine.
Using the Lucene technology for both projects created a big bunch of index files.
All I did, that I made all the navigation in the site be done through the search engine. So, I don't need to retrieve data from DB anymore.
Of course the site is dynamic, I think that I can just rebuild the index file from time to time(from scratch)..and if the site you work on has huge index files that will take months to be rebuild then you can rely on the (add/delete) command in the Lucene.
But in all cases, I expect this will future of Data storage. later, I figured out that Google App Engine provides way to connect directly to the BigTable.
Also, many Document based storage were released such as CouchDB build in Erlang (my beloved language) and thrudb.
I expect to release technical details about the architecture and the tradeoffs.
Wednesday, October 01, 2008
Taysseer Zi El Menna ( the History)
"Taysseer Zi El Menna" started as an ambitious project to assemble islamic contents and provide them to the user hands in a very easy way.
We noticed that majority of implemented islamic web-sites/applications were poorly implemnted.
For example, the search was limited to exact search, or %like%.another aspect was the repository used to implement this search. if it was Database it was very slow, or limited to a specific book.
At that time we decided to implement a desktop application that assembles some islamic books abt "tafsseer" (Quraan explanation) and make a more advanced search techniques. we used Lucene to provide morphological search.
The end product was something good (Java desktop application) . But we didn't pay much effort to distribute this desktop application.






We noticed that majority of implemented islamic web-sites/applications were poorly implemnted.
For example, the search was limited to exact search, or %like%.another aspect was the repository used to implement this search. if it was Database it was very slow, or limited to a specific book.
At that time we decided to implement a desktop application that assembles some islamic books abt "tafsseer" (Quraan explanation) and make a more advanced search techniques. we used Lucene to provide morphological search.
The end product was something good (Java desktop application) . But we didn't pay much effort to distribute this desktop application.
Tuesday, September 23, 2008
Taysseer Zi El Menna
Taysseer zi el menna, is my next web site.
Stay tuned for my coming posts about it........
Stay tuned for my coming posts about it........
Monday, September 01, 2008
Error at Home.Microsoft
Friday, August 01, 2008
Saturday, July 26, 2008
Sunday, July 20, 2008
Arabic Morphological search dilemma
It seems an endless problem, and continuous dilemma.
the Arabic always rejects to be searched easily like all other language...
I have developed a powerful arabic search engine. My motivation was to extend the normal "Aramorph" code to be able to solve the following examples:
now, the trade off yet to come, I got the following as same stems:
the Arabic always rejects to be searched easily like all other language...
I have developed a powerful arabic search engine. My motivation was to extend the normal "Aramorph" code to be able to solve the following examples:
- مصر - مصرى - مصرية
- رجل -- رجال
now, the trade off yet to come, I got the following as same stems:
- مؤتمر - أمير - أمر
- سيد - سادات - سودان
Friday, May 23, 2008
An introduction to Ruby language
My second technical session at Bibliotheca Alexandrina emphasized on the Ruby language..
I posted the presentation on my scribd here. I hope you find it useful.
Feel free to post your comments.
I posted the presentation on my scribd here. I hope you find it useful.
Feel free to post your comments.
Read this doc on Scribd: ruby intro
Thursday, May 08, 2008
Accessing multi-solr through acts_as_solr
You may need for multicore to manage multi languages search at least. An approach to solve the multilanguages problems is to use replication of each field (i.e field_arabic, field_english, field_french..etc) which I think is not feasible for large systems..
As a quick fix, using the acts_as_solr plugin, I just added a parameter to the Post method. I send the url to the method and post my request on this specific solr url. So, I make the search by iterating on all the solrs I define in my rails application and then combine the results.
The advantage of this approach that you don't enforce the user to specify the language he uses in the query, which I think it worth.
Check the multi-solr cores shaped. I didn't have the time to try it yet. This is really a powerful feature to add to the solr core. It is similar to having many solr running on one tomcat.
As a quick fix, using the acts_as_solr plugin, I just added a parameter to the Post method. I send the url to the method and post my request on this specific solr url. So, I make the search by iterating on all the solrs I define in my rails application and then combine the results.
The advantage of this approach that you don't enforce the user to specify the language he uses in the query, which I think it worth.
Check the multi-solr cores shaped. I didn't have the time to try it yet. This is really a powerful feature to add to the solr core. It is similar to having many solr running on one tomcat.
Wednesday, April 23, 2008
Pairing, something I missed for so long
"The code should always be written by two programmers on one machine". Is it a rule? ...yes, in the XP world.
don't think it's waste of resources..Today, I found many issues in the code making me beg my environment to introduce a code review in the development process.
But before you go deep into this, you have to know that pairing is not a competition to show who is the best programmer. In order to maintain this , a good common practice is to ask questions.
Also, remember that the questions should eliminate the "why" thing. A lot of ppl don't like it.
The most important thing that I forgot to do when I was reviewing is the acknowledgment for the successful piece of code. Instead I kept focusing on hunting pitfalls, which I believe is a bad behavior that I should avoid the next time :(
don't think it's waste of resources..Today, I found many issues in the code making me beg my environment to introduce a code review in the development process.
But before you go deep into this, you have to know that pairing is not a competition to show who is the best programmer. In order to maintain this , a good common practice is to ask questions.
Also, remember that the questions should eliminate the "why" thing. A lot of ppl don't like it.
The most important thing that I forgot to do when I was reviewing is the acknowledgment for the successful piece of code. Instead I kept focusing on hunting pitfalls, which I believe is a bad behavior that I should avoid the next time :(
Monday, December 24, 2007
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
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
Subscribe to:
Posts (Atom)