Saturday, December 6, 2008

Make use of technology, but takecare of your culture

Launched nearly "Google ta3reeb" which converts efficiently the "franco-arab" (a fancy name of Arabic pronounced language written in Latin alphanumeric letters) to real Arabic.


Worth mentioning that the idea is not new, it was previously applied by the Yamli editor, The process is know as "Transliteration".

I'm not saying it is an evil or bad technology, in the contrary the idea appeals to me and helps "franco-arabians" a lot, that's why I wrote about it, but in the occation, I'm advicing those "franco-arabians" -including me :D- to be careful about their culture represented in such a simple thing as catching up with their laguage's keyboard layout.

Monday, November 24, 2008

Get your own supercomputer

It is something like having a Dinosaur as a pet, or spending my vacation on the moon, Regardless that you have to be rich to do .. the point here is that it is possible to do.
I was excited when I heard of it, it worth mentioning.
Nvidia has launched a "personal supercomputer".
The company already produces supercomputers, but for researches and technology research centers, the new point is that it is available for personal use.
About the Tesla personal supercomputer:
  • Processing power is 250 times normal PCs and workstations.
  • Speed is 4 tera-flops (executes 4 trillion floating point operation per one second).
  • Processors: 3 or 4 "Tesla C1060 GPU" each 1.29 GHz in clock speed.
  • Memory of each processor: 4GHz, speed: 800 MHz.
  • Supported operating systems include Windows XP, Red Hat and SUSE



The Tesla personal supercomputer seems to be designed for PC gaming, and highly computational research and professional work.
According to Nvidia: several institutes already uses a GPU based personal computer (ex the Max Planck Institute, the University of Illinois at Urbana-Champaign and Cambridge University).
Last thing: its price, it is expected to reach $10,000 very cheap :D
For more information, http://www.nvidia.com/object/personal_supercomputing.html

Friday, November 21, 2008

Prepare to run a "p-threaded" c project

here is a good quick reference to learning pthreads, but normal building and running won't work as the gcc must be explicitly directed to load the runtime library pthread upon running, for the line "#include " to work. How will we do it?

  1. From command line:
    Instead of normal compiling way:
    gcc sourc_file.c

    , you are supposed to use:
    gcc -lpthread sourc_file.c

    directing the linker to link the runtime library "pthread".


  2. Using eclipse IDE:
    It is fairly easy too, we will do the same something but from configuration of this project, steps:

    • Create a new project copy-paste any pthread-using code, (for example: use the above link)
    • Right click your project and select properties (alternatively hit alt+enter)
    • Expand C/C++, and click Settings, you should see something like:
    • Expand the GCC linker and click libraries, you should see something like:
    • At the text are "libraries (-l)", click add, as figured in the above snapshot.
    • Type the name of the run time library you want to add (in out case: "pthread") without the preceding "-l"
    • Now build and run your project .. enjoy pthreads

Tuesday, October 7, 2008

Change famous sites templates with foxReplace





It seems that I've signed my contract with Google
and have started designing their pages .. or I'm a VIP that popular sites are writing about me, actually the story is quite different.
The trick is in the fire fox add-on: foxReplace.
After installing it:
  • Press file "Edit", then "Replace" (instead press Alt + F2).
  • Write in the left box the phrase you'd like to replace, and in the right one the replacement.
cool trick isn't it?

Saturday, September 13, 2008

Javaize your Ubuntu

  • Installing Java

    1. Type
      sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
      .

    2. Read and accept lisece of Sun.

    3. Now we should tell Ubuntu to regard the installed JVM as the default one:

      1. You need to edit a file called /etc/jvm. This file defines the default system JVM search order.

      2. The default system JVM is the first one available from top to bottom.

      3. Type
        $ gksudo gedit /etc/jvm
        so as to open it as root.

      4. The file contains:
        /usr/lib/jvm/java-gcj
        /usr/lib/jvm/ia32-java-1.5.0-sun
        /usr/lib/jvm/java-1.5.0-sun
        /usr

      5. Add
        /usr/lib/jvm/java-6-sun
        such that the file's contents become:
        /usr/lib/jvm/java-6-sun
        /usr/lib/jvm/java-gcj
        /usr/lib/jvm/ia32-java-1.5.0-sun
        /usr/lib/jvm/java-1.5.0-sun
        /usr

      6. Save and close the file.

  • Testing Java

  1. Type
    java -version
    output should be something like:
    java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

  2. Create a HelloWorld.java and save it in [certain_directory]

  3. Type
    javac [certain_directory/HelloWorld.java]

    • Nothing should be output.
    • In the the file "HelloWorld.class" must be generated.
    • Move the HelloWorld.class to [another_or_same_dir]

  4. Type
    java -classpath [another_or_same_dir] HelloWorld
  5. Note that that we have set the environmental variable: classpath to avoid the ClassNotFoudException
  6. The HelloWorld.class must be executed (run) and
    Hello World
    is to be printed.

  • Next step .. Eclipse

  • We have two options:

    VersionOption 1Option 2
    Eclipse versionInstalling Eclipse Callisto (3.2)Installing Eclipse Ganymede (3.4)
    AdvantageEnjoying the benefits of eclipse as a universe Ubuntu software package Making use of eclipse latest version and its new features.
    Procedures
    1. System -> Adminstration -> Synaptic Package Manager and enter Password
    2. Highlight the list-item "All" in the left list.
    3. Search for "eclipse".
    4. After it is found -> right click -> mark -> agree -> apply.
    5. Wait till finishing download and installation.
      1. Download eclipse for linux
      2. Copy paste the downloaded .gz file to your home folder
      3. Right click it -> Extract here
      4. Open the extracted folder (eclipse) and here is present the executable eclipse ganymede
      5. Note that the link I provided was to classic eclipse if you want to use the enterprise one or any other version check this

    6. Next step .. The standard widget toolkit (SWT)

    7. Remember that -after migration to Ubuntu- you need to find a replacement to any platform dependent component like JDk, JRE, Eclipse and SWT (which is not the case of either any of nebula widgets as they are based upon SWT, nor Swing GUI library as it is based on JDK and JRE nor Java ribbon which based upon SWT).
      I mean that all of those components will work fine on Ubuntu as well as any OS as long as the proper version of Java (JRE, JDK, JVM, SWT) is installed on the entire OS.
      1. From SWT home download SWT for linux
      2. Keep the downloaded zipped file in a known safe directory.
      3. Unzip it and copy the SWT.jar from it and paste in the directory of ur java project
      4. Refresh the project from eclipse and enjoy..

      Thursday, September 4, 2008

      Compiz, what, why and how

      Understanding Linux, Ubuntu, Compiz
      We all know that Linux is an OSS (Open Source Software) OS (Operating System) but a user friendly OS is a huge product to be free ..
      OS = Kernel + System software

      The first component of Linux (Kernel) was finished in 1991 by Linus Trovalds the student of Helsinki University in Finland. While the second one (System software) were developed, maintained and re-distributed by GNU which is a glorious and a pioneer foundation in the field of the OSS.

      After this "histo-technical" introduction lets mention some -system software programs- definitions.


      Desktop environment


      a style of graphical user interface (GUI) that is used to be the interactive and friendly interface to the user, instead of the old command line interface (CLI).


      Window manager


      The program that is responsible for drawing (rendering) windows, control their appearance and determine how they are displayed and interact with each other.



      Now back to our Ubuntu Hardy ..
      The default Desktop environment is "Gnome", wheres the default window manager is "Metacity".
      I'm ready now to say what Compiz is:
      It is an alternate for Metacity which uses 3D H/W (VGA) to create fast, efficient and advanced visual desktop effects. Here are some photos:








      Now lets move to the "How" section of the post;

      How to obtain Compiz Fusion (which is Compiz with some plug-ins):

      1. First of all ensure that your VGA is not blacklisted from here .
      2. Follow this tutorial
      3. If it is still not working type
        mkdir -p ~/.config/compiz/ && echo SKIP_CHECKS=yes >> ~/.config/compiz/compiz-manager
        to skip checks that compiz performs.
      4. If it is still not working enable the compsite extension in /etc/X11/xorg.conf



      Reboot and enjoy..

      Even after installing compiz you can alternate your Window manager between compiz and metacity by the commands
      compiz --replace &
      and
      metacity --replace &

      I prefer creating a couple of launchers in my panel instead of writing commands each time.

      But why alternating between them?

      Because applications which rely on VGA and performs heavy rendering conflicts with compiz and cause the monitor to continually blink, like Google Earth and any "medium/big" game.