About Me

My photo
PhD Candidate at Purdue University, Computer Science.
Showing posts with label technical. Show all posts
Showing posts with label technical. Show all posts

Wednesday, February 22, 2012

Starting with Android Ubuntu 11.10

I started exploring Android.
I will show the steps I did to build the development environment on Ubuntu 11.10.
At the beginning I wanted to have the environment ready on my MacBook. Actually that did not go so well. It seems that android development is supported mainly on Linux 64 bits. Otherwise, one will face many problems.
  1. Get your 64 bits linux machine ready. VM should be ok. I am working on Parallels.
  2. Visit the Android Source website (Not the SDK). Don't overlook the steps mentioned there.
  3. If you are using Ubuntu 11.10 then use that for installing JDK-6 :
    $ sudo add-apt-repository ppa:ferramroberto/java 
    $ sudo apt-get update
    $ sudo apt-get install sun-java6-jdk sun-java6-plugin

    Instead of lib32readline5-dev use the following libraries
    $ sudo apt-get install lib32readline6-dev libreadline-gplv2-dev

  4. While building I got an error "fatal error: GL/glx.h: No such file or directory". The fix was to install libgl1-mesa-dev.
    $ sudo apt-get install libgl1-mesa-dev

  5. The build may take up to 2 hours.
  6. When you use eclipse as an IDE. the project will have 3 errors. to fix them remove the missing jar files. Then add some lines to your .classpath file. Later I found a patch doing the same modifications https://groups.google.com/forum/?fromgroups#!topic/android-contrib/wEpciQkEUlA
  7. You should be ready to go and use the emulator.

Friday, April 16, 2010

X10 Day

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.

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.

Friday, March 26, 2010

Operating Systems humors

Copied from Prof. Douglas Comer:

Note: This is a revision of the classic essay the low level
of "customer" service and peculiarities of some operating systems
that was written in late 1994. The author is still or wishes to be
unknown.

Unix Airlines
-------------
Everyone brings one piece of the plane with them when they come to
the airport. They all go out on the runway and put the plane together
piece by piece, arguing constantly about what kind of plane they're
building. When another plane lands nearby the passengers begin
breaking up into meetings and trading pieces of the plane.

Fly NT
------
Everyone marches out on the runway, says the password in unison, and
forms the outline of an airplane. Then they all sit down and make a
whooshing sound like they're flying. The flight attendant then
announces that they are privileged to be on such an advanced airline,
and if they close their eyes they can imagine they are flying on a
powerful plane that can take them anywhere.

DOS Airlines
------------
Everybody pushes the airplane until it glides, then they jump on and
let the plane coast until it hits the ground again, then push again,
jump on again, and so on. For relaxation Bill's autobiographies are
tucked in the back of every seat.

MAC Airways
-----------
All the flight attendants, captains, baggage handlers, and ticket
agents look the same, act the same. Every time you ask questions
about details, you are told you don't need to know, don't want to
know, and everything will be done for you without you having to know,
so just shut up. Cute little signs are everywhere and outside every
window there are flying toasters.

Windows Airlines
----------------
The airport terminal is nice and colorful with friendly flight
attendants, easy access to the plane, an uneventful takeoff...then
the plane blows up without any warning whatsoever. All the
decorations fall off, revealing that each part of the plane is
painted the same color blue. In mid-air you are informed that the
rest of your flight will be continued on DOS airlines. (See DOS
Airlines)

Cell Phone Air
--------------
Everyone has difficulties getting into the plane and once they are in
it takes a long time to start the engine and take off is very slow.
The plane only has one window that is so small a passenger cannot
view much at a time. To help, the window is easily moved, allowing
passengers to position it to view one small piece of the scenery at
a time. Each time the plane takes off, an annoying sound is played;
passengers can change the sound to a pleasing tone or song, but must
pay more.

------------------------------
----------------------------------------------

Xinu Airline
------------

You arrive at the terminal and are shocked to find that only one
passenger can fit into the plane at any time. Then you are told that
you will have to help finish building the plane and pilot it during the
flight. Unfortunately, because travelers have little prior experience
with either activity, almost all flights crash on take off. To help
out, the airline pads the runway with soft material and supplies a ground
crew that retrieves the plane and lets you start over. One of positive
aspects is that the plane is free, so travelers who do have a successful
flight often take the plane with them, and use it for private flights
at the company in which they are employed.

Friday, March 19, 2010

MAC expose bug


I have a macbook-pro, and whenever I use show all applications using the expose feature.
I got a shadow of un-existing application within the displayed windows...
u can see it in the picture, i am marking it in gray.

Wednesday, September 23, 2009

Back to MAC

Hurray..Hurray.

I am on MAC again :)
This post is from MacBook-Pro 


  Model Name: MacBook Pro 15"

  Model Identifier: MacBookPro2,2

  Processor Name: Intel Core 2 Duo

  Processor Speed: 2.16 GHz

  Number Of Processors: 1

  Total Number Of Cores: 2

  L2 Cache: 4 MB

  Memory: 2 GB

  Bus Speed: 667 MHz

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:
$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=5
runnable[1]: counter=498
runnable[2]: counter=488
runnable[3]: counter=0
runnable[4]: counter=0
Again:
$runnable[0]: counter=1
runnable[1]: counter=990
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
Ok, I promise this is the last one:
$runnable[0]: counter=117
runnable[1]: counter=875
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
I run the experiment on my Ia32_linux system and used exactly the same code in the same entry I refer to.
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:

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.

Tuesday, April 14, 2009

Call for research Group

For some time, I have faced difficulties implementing my ideas. I think the problem with my university that research is formed of isolated individuals. each one try to defend his master thesis. There is no knowledge-transfer, no cooperation to build a solid background in a given framework.
Recently, I tried to start a research group. a group with common research interest. the idea was to throw some ideas and try to propagate the ideas between colleagues who are still lost, or stuck in their thesis.
Actually, many people were enthusiastic toward the idea, and we are trying to make it work.
I hate to be Mr pushy, but if it is a way to make that thing successful and build a research group to my university..then I don't mind to be the pushy guy.

You can join us if you are interested in system programming, virtual machines and concurrent programming.

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...

Thursday, February 19, 2009

Above the Clouds

Don't go too far..this is not my romantic post for the Valentine 's Month.

Enjoy this paper..
Above the Clouds..is a Berkeley's view of Cloud Computing...If you are interested in knowing some brief issues about the cloud computing, then this is a very recommended reading..link

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.


Friday, December 12, 2008

Working with Fonts on Linux

I am in a project where I need to collect documents created on various environments to the Linux system.
An important aspect is to preserve the fonts as much as we can. So, for example I need to import fonts from Windows to Linux.

first to know the fonts you have already on your ubuntu/debian distributions run the following command.
$ find /usr -iname \*.ttf
The fonts should be in the /usr/share/fonts directory.

To install the Webcorefonts run the following command
$ sudo apt-get install msttcorefonts


In case you need more fonts, you can get them directly from the windows folder:
$ cd /usr/share/fonts
fonts$ mkdir newfonts
newfonts$ cp imported_fonts_path .
newfonts$ chown root.root *.ttf
newfonts$ chmod 644 *.ttf
newfonts$ mkfontdir
newfonts$ cd ..
fonts$ gedit fonts.cache-1
fonts$ ##append the following to the end of the file ["newfonts" 0 ".dir"]
fonts$ fc-cache


If you like to learn more about fonts on linux..visit this page

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
$ 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++-multilib
You will also need Bison
$ sudo apt-get install bison
get ant
$ sudo apt-get install ant
get 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-sun
Set your $JAVA_HOME variable
$ sudo gedit /etc/environment
and add JAVA_HOME = "/usr/lib/jvm/java-sun-6"

Re-login
Download eclipse from its official site.
$ sudo apt-get install subversion
$ svn co https://jikesrvm.svn.sf.net/svnroot/jikesrvm/rvmroot/trunk jikesrvm
$ cd jikesrvm
jikesrvm$ bin/buildit --eclipse localhost -j $JAVA_HOME
Import the project into workspace.

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 components
jikesrvm$ ant very-clean
and then rebuild..it worked fine this time

Saturday, November 22, 2008

Archiving Scalability in NARA

Today I read this interesting article. It's a typical problem I was thinking about for a long time ago.
Archiving projects are the core of the Bibliotheca Alexandrina Strength, but so far we didn't face this huge amount of data described in the article.
Although we made archive for famous Egyptian figures like Boutros0Boutros Ghali, Gamal AbdElNasser, Anwar el-Sadat, and a collection of "History of Modern Egypt" noone of these collections exceeds some of hundreds of thousands of documents.
I have many thought about how can I deal with these amounts of data. the key is to design a scalable system based on clusters of data and not to wait for a president to conduct his heritage after termination. You should invest your time building a "generic" system capable of drinking whatever you throw to it given the key performance points you consider..
Is it surprising that you know that the president of USA will get billions of messages!
I would propose hadoop as a starting phase, a good step to start the cluster you want to create. But of course you may to ass some enhancements based on your system requirements.
This would be a great challenge if we come across such huge collection in some projects.

Monday, October 27, 2008

Memory of Modern Egypt..Here we come

Today, Memory of Modern Egypt will be finally launched.

"Memory of Modern Egypt is an endeavor to produce the definitive repository for culturally and historically significant material pertaining to the modern history of Egypt, from the French Expedition in 1798 to the end of Al-Sadat’s presidency in 1981".

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.

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.