Thursday, October 15, 2009

May be wordpress or other something in future, but now

Monday, July 27, 2009

Automatically attach Windows formatted partitions on booting Ubuntu

As the title say, I consider in this how-to attach windows formatted partitions (FAT32, NTFS ..), it would be a very close procedures to attach other formats.
  1. Step One: Determine Which partition do you want to mount automatically.
    You have to know your target partition's Linux name, which differs from partitions' labels (those names given to partitions in Windows like "Sources", "Entertainment" ..).
    • Installing a suitable Disk-Scanner is a good idea to give you good information about your disk if you don't already know, I suggest gparted
      sudo apt-get gparted
    • Once installed, run it
      sudo gparted
      to see something like:


      now determine which partition you'd like to attach, and know its name (the column at the most left with heading "Partition"), I'll assume it is [my_part]
  2. Step Two: Determine Where to attach the target partition
    Lets assume you want attach the partition in the directory [my_dir], you have to create the directory
    sudo mkdir [my_dir]
  3. Step 3: Tell Ubuntu to attach Partition[Step 1] in Directory[Step 2]
    • Open the file /etc/fstab as root
      gksudo gedit /etc/fstab
    • Add the line
      [my_part] [my_dir] vfat auto,users,uid=1000,gid=100,utf8,dmask=027,fmask=1 37 0 0
      And dont forget to
      • Replace [my_part] with your partition (got from step 1)
      • Replace [my_dir] with your directory (got from step 2)
      • Replace "vfat" (which is for FAT32 partitions) with ntfs for NTFS partitions
    • Save and close /etc/fstab
  4. Step Four: Try attaching new entries in the /etc/fstab
  5. , by typing
    sudo mount -a

Enjoy ..

Thursday, July 23, 2009

Like Google Reader's "like"?


Recently Google reader switched to include more social features.
Like Friendfead and facebook a "like" flag can be associated with each post.

That post of Lifehacker attrackted my attention, have a close look ..


Did you note?
The post is talking about a script to get rid of the like flagging (many people hate it and see that sharing and starring are enough).
That implies that people who like this post hate the "like" feature of google reader.
I am thus confused why 100+ one like it???


Friday, July 10, 2009

Open Command Prompt here

Opening the command prompt/shell interpreter in a specific is handy, and is very common to much many people.
I'll be talking in this post about how to do it in three different platforms.

First Windows Vista

Recently I shared an article that shows how to do it in Vista, which is not more difficult than just holding another button before hitting mouse's right one.

Second Debian based systems

It is also as simple here as installing any other program, here is a How - to which illustrate the operations. 
At the end an additional option is added to the right click:



By clicking it, the terminal should be opened in the specified directory (in my case the desktop):



Third Windows XP

Operations here are a bit more tricky, I'll go in some details:
  1. Open Control Panel => Tools Menu => Folder Options => File Types Tab
  2. Select the "File folder" file type.
  3. Click the "Advanced" button.
  4. Click New (to add new action).
  5. Enter action's name, which will be some thing like "Open Command prompt here".
  6. Enter 
    cmd.exe /k cd "%L"
    against the "Application used to perform action".
    Menu state should end up to something like:

     
  7. Press OK, OK.
Good, but it is not the end.
We need now to assure that folders behave normally, i.e. The default action of the folder file type is to be opened by windows explorer.

  1. Press Start => Run
  2. Write 
    Regedt32.exe 
    and hit enter.
  3. Open HKEY_CLASSES_ROOT/Directory/Shell
  4. From the Edit list choose the name (Default).
  5. Edit Menu => Modify



  6. Enter None and hit OK.


Right click any folder now and note the new action:



Click it:



Thursday, February 19, 2009

Sample Project I

Not only because some colleagues advised me to do, but also because i found it a good idea to publish a sample project of each year and/or semester ..

I'll start by this one "Sorting simulator" was done in the second year with my partner Moustafa.

Why I'm starting with that project especially? Because it had many uniqueness properties not in many other projects.

  • It 's UI is inspired from Microsoft office 2007 ribbon.
  • It's UI is developed in SWT library and the program in Java.
  • We used the Hexapixel project.
  • We used the Nebula project (The pshelf on the left).
  • Time of working in this project was directly before the final exams by 2:3 weeks, we felt that we either won't finish the project or it would affect our exams badly, but thank God all are finished and all are over.
Project size:
  • Src directory contains 9 packages.
  • Model package contains 12 classes.
  • UI main class contains 1322 lines.

Notes about the project
  • Worth mentioning that the program can simulate as long list as the screen resolution permits it to do.
  • All actual sorting algorithms are actually finished normally without being disturbed by UI rendering instructinos. How do we simulate then? After each swap of a pair of elements, a new node is pushed to the simulation queue of this sorting type, which (the queue) is popped purely asynchronously by another thread.
  • Why we did that? To make the running time of the sorting algorithm accurate and not affected by simulation.
The source is available to anyone, just send me an email or comment demanding it.

Finally Here are you some screen-shots due to the bad quality video

  • The options panel:
  • The Results panel:

  • The input panel (ribbon oriented):
  • An overall running instance:

Update The project is now opensource.

The age of embedding Web-servers

The last period witnessed a "web-server-mania". Although I'll talk about running my pc as a server but this is not the reason why I say that.
About running my PC as a server it is not very sophisticated and can be done, just five systematic steps
  • Obtain static IP address.
  • Open port 80 (The port responsible for receiving HTTP requests).
    1. Adjust local firewall settings (to let HTTP requrests pass in).
    2. Do port forwarding (To open the port from the network and direct requests to the proper computer - To do it I downloaded the manual of my Router and searched for "port forwarding").
    3. Check the port is opened.
  • Install the server software on the pc; normally the word "Server" refers to two meanings the first: the Computer running as a server and the second: The software that translates clients' requests and reply by suitable responses (like what the browser does on the client side).
  • Register for a dynamic name service; that maps a certain DNS to your static IP address.
But the process even after its success is full of disadvantages, this article which summarizes the drawbacks of hosting on your own PC.


Back to the main thing that made me write this post ..
A Japanese Company called FreeBit had announced an iphone application that "server-ize" the iphone ...

 Yes once this application is installed on the iphone, all PCs can access it exactly like a web server.
Check this post for more information.

From the ability to "attach" the server on my PC to "embedding" it to a pocket device will change many concepts or at least make them more flexible and different from long age they were.

Tuesday, February 17, 2009

After a semester of being the class representative II

Welcome there ..
34 people had submitted their evaluation for me as their representative.
It has been about 20 hours since number was 34 and it is still 34, It seems that ther will no be any further submission.
Submission is now closed and here are results of the form.

  • Organization, Fairness and being helpful => Satisfying results. 


  • Attendence => nearly 50:50  Good : Acceptable 
  • Behaviour in problems => Satisfying
  • Decision in case of diffrences in opinion => Very satisfying (a bell shaped curve biased to [shifted towards] students :D).


Check this link to view a detailed version of the results.

I have some comments on the results

  • It is not true that these results refer to the person "Mohammad Mahmoud", it refers to the helpful community lead by Mohammad Mahmoud. 
  • I had fallen in mistakes, because I'm a human, the skill (that I'm trying to gain) is decreasing mistakes results, apologize for them and avoid their occurance in the future.
  • I believe strongly in our class, I think we are the most helpful, active and connected class. I do not say that we are in our best state now, but we are better than all other class (at least in our college). That's why I'm enthusiastic and encourage to go on and keep being the representative for the 2nd semester too.
  • The rest of the week is opened for any one who likes to be the class representative, If you wish to be, just send us an email saying why you think that you will be a successful representative. And elections will go on Saturday 21.02.09 (The head of the second week of the semester)

Friday, February 13, 2009

After a semester of being the class representative I

Hi all, back to blogging.
The content of this post is somehow different from others, in spite of having a plethora of ideas and things that I would blog about.
But it is time to evaluate my performance as the class representative for the previous semester.

Note: Submission is now closed

Saturday, January 24, 2009

An aspect of policy


One president of the united states was "swapped" with another from 2 days.
Although I'm not going to talk about the issue from political point of view, but I'll consider what I'll take about an aspect of policy.

In addition to the vast number of ways the inaguration was broadcasted, the Presidential Inaugural Committee (PIC) decided to stream the event live and online on its web site. The surprise that they have chosen to stream the event using Silverlight the Microsoft new technology instead of Adobe Flash.

The other thing that is a point of concern that at 12 am of the cermony day the white house website was "dressed" in a new design and had the new president's face on it. Also check its blog.
Was I fault when I said it is an aspect of policy?

Wednesday, January 21, 2009

New web ideas

Instead of studying algorithms for tomorrow's final exam, I prefered to break the ice of exams days by talking about 2 of these new ideas, I've recently read about
The first is simple; You write a message and determine a distenation email, instead of recieving the message, the distenation will fracly recieve other 2 things: an mp3 attached file and a link to a flash both are audio version of the message. The project launched on Tuesday is called "Blind Speak" is its beta version.



The other thing I would talk about is just a fancy way to preview google search results for a query that is inspired from Linux famous desktop cube.
You can rotate the cube by holding shift + dragging, open a search result by clicking it ..


Sunday, December 7, 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, December 1, 2008

HP Magic Giveaway contest

According to Wikipedia
Thanksgiving, or Thanksgiving Day, celebrated on the fourth Thursday in November, at the end of the harvest season, is an annual American Federal holiday to express thanks for one's material and spiritual possessions.


In accordance with the American Thanksgiving 2009 HP distributes a package of prizes of a 50 of the famous bloggers in what is named by "The HP Magic Giveaway".



In-turn each of the 50 famous bloggers will distribute a "proper" subset of this package on people worldwide (who exactly, simply I and you).

Each blogger will open registration an close it within this month.
Once registration is opened, you have to register, regarding blogger's rules, check your email withing the following 3 days, you may be the winner.

Blogger's rules vary widely from one to another
For example
This was one of the rules of "Thoughts on poetics and techs":
Tell me what you think of what I wrote.

I'm impressed if you are smart, engaged, un-boring, and being real! Make me laugh! Make me think!

It was a very unique rule which I liked, I don't say that as a hypocrisy but the uniqueness of the word "make me laugh and make think" made it more funny and broke the ice of "heavy technical contests".

Another example:
the Gear live blog requires just a twitter account and sending them the link to a tweet containing a certain word (after registering in gear live if not already registered).

Check subscription beginning and deadlines

The most important thing: Prizes:
  1. HP TouchSmart IQ816 PC
  2. HP HDX 18 series Premium Notebook PC
  3. HP MediaSmart Connect
  4. HP Pavilion dv4 series Entertainment Notebook PC with Windows Live
  5. HP Mini 1000 with XP
  6. HP Photosmart C6380 Wireless AIO multifunction printer
  7. HP 564 Photo Value Pak.
In addition to software packages.

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.

      Monday, August 11, 2008

      Discovering Eclipse Ganymede

      Although that
      Note that each program (of those running upon eclipse) runs independently of the other.

      I'm going now to write a bit about my "interaction" with Ganymede which surely are very tiny compared to all of its other features as those interactions' age is about three weeks.
      • JavaScript Development Tools(JSDL): amazing compared to aptana's JavaScript I used to use before, it can check errors, assume quick fixes and has a very complete code completion and documentation. and the comparison of aptana's JavaScript editor and Ganymede JSDT one is nearly the same as comparing RDT (Ruby Development Toolkit) which is ruby old plugin to Ganymede's DLT (Dynamic Language Toolkit) which includes Ruby.
      • Thanks to the p2 provisioning project Ganymede comes with a very easy and much more smarter update center; It automatically resolves dependencies, and if download failed due to some reason and I started downloading later again, it starts from where it have ended.
      • A very powerful UML editor; I can drag and drop and create my own shortcuts. I think I have found finally a replacement for Microsoft Visio.
      • Finally It is something that did not come (for me) as a replacement to any other software but it came to satisfy a real and a bad need to it .. It is the database development which is a project to manipulate database either by developing sql statements or by presenting a reasonable UI of my database in the Database explorer (like Java's package explorer). You just have to download your favouraite database JDBC implementation, give it to eclipse and you are done.
      Last two things:
      • Take care of the eclipse contest. This year it is over but we should know about it that it is very simple inwhich any eclipse user can participate and there exists prizes.
      • Learn more by a very simple and comprehensive presentations about eclipse Ganymede.

      hit tracker