Friday, November 10, 2006

Viva LaTeX :: Installation

TeX, and associated programs such as LaTeX, form a system for computer typesetting, for placing text on a page. (Pronounce the name "tech".) It is well known for its abilities with the most difficult typesetting jobs: mathematical and scientific text, long and intricate documents, and multilingual works. To know more about LaTeX, visit ctan.

What I care for, is LaTeX is free! It's opensource! Provides way better capabilities than Microsoft Office or open office and it's really easy to use.. Everything is automated, you don't need to care for numbering, bullets, justification, outlining, formatting, figures layout, etc etc...

I don't need to convince you to use LaTeX, if you don't like it, don't use it, but then try to withstand others making jokes about your microsoft office documents.

To start TeXing, you need to:

Install a Tex distribution:
  1. Download latest version of Miktex. For convenience, you better use the "Downlood 'Basic MikTeX' Installer" on the MikTex setup page.
  2. Install Miktex and now it's a good idea to test it. Go on write this simple test in a file test.tex
    \documentclass{article}
    \begin{document}
    My first \TeX~document.
    \end{document}
  3. Open a console window and cd to where test.tex is and type "latex test.tex". You should obtain test.dvi, normally you can open it with YAP on a windows environment.
Obtaining Postscript/PDF:
  1. To obtain Postscript from the dvi file:
    >> dvips test.dvi
  2. To obtain PDF from the dvi file:
    >> dvipdfm test.dvi
  3. To obtain PDF directly from the tex file:
    >> pdflatex test.tex
Installing an editor:
  1. Now it's obvious you can start TeXing right away, but you need an editor, or else working on the notepad you will hate LaTeX before finishing your first paragraph. There are plenty of editors out there, personally I like LEd, because it's simple! Other sophisticated editors are taking LaTeX down! They're trying to build a word-like editor based on the LaTeX engine, it's just stupid..
  2. Download LEd Installer and install it.
  3. Now Launch LEd, and go to options from the configuration menu.
  4. In the DVI viewer, under application menu item. Choose the Tex distribution to be MikTex 2.
  5. Set the directory of the TeX executables to the bin directory of your distribution. It should be something like "D:\Program Files\MiKTeX 2.5\miktex\bin"
  6. The value of Font searching library should be set to MiKTeX-core-2.dll. Font making script should be set to makepk.exe, Fallback font should be set to cmr10, Mode should be set to ljfour, Resolution should be set to 600 dpi.
Resolving DVI Viewer bug in LEd:
  1. Download dvi_miktex25.dll. Copy this file to your MikTeX bin directory, it should be somehting like "D:\Program Files\MiKTeX 2.5\miktex\bin"
  2. Launch LEd and go to Configuration >> Properties and then the DVI Viewer properties.
  3. Change the TeX distribution to "based on MikTex"
  4. Change the font searching library to "dvi_miktex25.dll"... you have to type it not select it from list.
  5. Click ok and Restart LEd. Now the DVI Viewer will show you a preview of your document whenever you do "LateX Compilation" (F9).

Now you have the configurations, go on and play around with your editor and make it useful. I will try to post an introductory tutorial to typing your first latex document, See ya...

Happy TeXing!

--
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln

Sunday, November 05, 2006

Using Eclipse as C++ development platform

Albert Einstein once said, "Two things are infinite: the universe and human stupidity. But I’m not sure about the universe." If only he has been here for a bit more, he would have said "Three things are infinite: the universe, eclipse plugins and human stupidity. But I’m not sure about the universe."

To start developing C and C++ applications on eclipse you need to:
  1. Ofcourse If you're not already an eclipsian (how dare you!) you need to download eclipse SDK.

    Installing Cygwin:
  2. Download cygwin. Cygwin is a UNIX®-like environment for Windows that includes a GCC port, along with all necessary development tools, including automake and the GNU Debugger (GDB). Cygwin is built around the cygwin1.dll library.
  3. When the download is complete, run setup.exe, click next and then 2nd option, download without install.
  4. After choosing a mirror and blabla, make sure you to select the most two important packages, "gcc-g++" and" make".. You will find them under All >> Devel category. Do not skip this step! click next and wait for the download to finish.
  5. Rerun setup.exe, but this time with the 3rd option, install from a local directory.
  6. Now you should have a window with the title "Choose Installation directory"Choose UNIX file type and choose the directory where you want to install cygwin.
  7. Click next, on the window with the title "Select local package directory", select the directory which you have used when downloading in step 4.
  8. Select the packages to install and still make sure to select "gcc-g++" and" make".. You will find them under All >> Devel category. Do not skip this step! click next and wait for the installation to finish.
  9. To check cygwin version open cygwin bash shell cygwin.bat and type "cygcheck -V" you should see
    "cygcheck version 1.43
    System Checker for Cygwin
    Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
    Compiled on May 25 2004"
  10. To make the tools also available in a dos window add the Cygwin bin directory to your path.
    e.g.: PATH=%PATH%;C:\Tools\cygwin\bin
  11. To verify if the utilities are installed, In a dos window type: g++ --version
    You should see:
    g++ (GCC) 3.3.3 (cygwin special)
    Copyright (C) 2003 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  12. type: make --version
    You should see:
    GNU Make 3.80
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.

    Installing CDT
  13. Open eclipse. Go to Help >> Software updates >> find and install. Select Search for new features and click next.
  14. Create a new remote site with a Name, CDT and URL "http://download.eclipse.org/tools/cdt/releases/callisto".
  15. Select this remote site to search and click next. Proceed as the installer suggests until it's done. It should ask to restart eclipse.
  16. Congrats! Now you can start developing C++, but remains a concrete example.

    Creating a project
  17. To create a new project, go to File >> New >> Project and select C++ >> Standard Make C++ Project. Give it a name and click finish.
  18. Now you can right click the new project in the workspace and New >> File. Give it a name .cpp for example "test.cpp"
  19. Open the file and go on write your C++ program. For example
    #include "iostream"
    using namespace std;


    int main() {
    cout << "This is a demonstration! \n";
    return 0;
    }
  20. Now you need a make file. Right click the project and New >> File. Name it "makefile". Here's a sample makefile:
    CC = g++
    LN = link.exe
    EXENAME = test

    all: $(EXENAME).exe
    [tab]@echo ********************************
    [tab]@cmd /c $(EXENAME)
    $(EXENAME).exe: $(EXENAME).o
    [tab]$(CC) -o $(EXENAME).exe $(EXENAME).o
    $(EXENAME).o: $(EXENAME).cpp
    [tab]$(CC) -c $(EXENAME).cpp
    clean:
    [tab]rm $(EXENAME).exe
    [tab]rm *.obj
  21. Please note you need to change the EXENAME to match your .cpp file. And also replace the [tab] with an actual tab not spaces!
  22. Now right click the project and then "Build project". Voilaaa!
Happy Eclipsing !

--
"I pretended to be somebody I wanted to be until finally I became that person. Or he became me." - Cary Grant

Using Eclipse as J2ME development platform

I believe the most powerfull asset of eclipse is the number of plugins available for almost any technology integration, working towards making it programers' heaven.

To start developing J2ME applications on eclipse, you need to:
  1. Download Sun Java Wireless Toolkit
  2. Ofcourse If you're not already an eclipsian (how dare you!) you need to download eclipse SDK.
  3. After Installing eclipse, go to Software Updates >> Find and Install from the Help Menu and then "Search for New Features to install"
  4. Select "New Remote Site" and specify the Name as "J2ME" for example and the URL needs to be specified as "http://eclipseme.org/updates/"
  5. Continue with the procedure as the installer suggests, you need to accept installing the plugin and then eclipse will request to restart.
  6. Before creating a project you should revise your eclipse default build settings. Go to Window >> Preferences. and then from the tree menu Java >> Build path. Make sure that you select the "Folders" radio button from the "Source and output folder" tab and that Source folder name is "src" and output folder name is "bin" confirm your modification by clicking on ok.
  7. When eclipse restarts now you need to create a project. Go to File >> New >> Project.
  8. A wizard will popup, you should find J2ME >> J2ME Midlet Suite and then specify a project name, click Next.
  9. If this is the first time to create a J2ME project, eclipse needs to locate the devices which will be used to run your application. Click on Manage Devices >> Import >> Browse and then locate the root folder for your Wireless toolkit. It should look like "WTK25". Click on Ok and then refresh. After eclipse is done with locating the devices click on "Select All" and then "Finish".
  10. Back to the New J2ME Project, you should have "Sun Java(TM) Wireless Toolkit 2.5 for CLDC Beta" in the Group element and select your preferable device from the list below and then click "Finish".
  11. Now you have the project created. To create your primary Midlet right click on the "src" folder and New >> Other. From the menu select J2ME >> J2ME Midlet.
  12. Click Next, give it a Name and click Finish.
  13. Congrats! Everything is now ready. If you need to add any resources like images or icons, place them in the "res" folder under your project root.
Happy Eclipsing !

--
"I’ve never looked through a keyhole without finding someone was looking back." - Judy Garland

Sunday, September 24, 2006

Viva Opensource!


There's no question here, software is definitely one of the master gates for developing countries to step out from the crowd. India is a live example for what I'm talking about. I regret not having enough information about India's experience in the field, but this is for everyone out of question.

Anyways, Software is too broad to talk about, I will only talk about the influence of open source development on countries that follow the same critera like Egypt.

Whoever minister of information in a country like Egypt, doesn't know exactly what Opensource is about. In case he knows, so what ? What kind of software development phase does Egypt fall in ? The only kind of software we produce is databases and things scholars do in their very first years of study.. things of the "GadoSoft" kind.

Opensource is one of the rare chances for under developed countries to participate. In each other industry, the top contributors keep the secrets explicit for themselves. This is also the case in software, but thanks to the open source activists, this is beggining to end.

If we're still far behind contribution to the open source community, we have to at least use it as end users! How come such a poor country like Egypt, the government pays huge amounts for windows operating systems, microsoft office bundels... for the employees to enjoy their solitaire games! Employees can still enjoy solitaire, but at least the tax payers will not have to pay for it! Come on .. use freeware and opensource! This is really what I find unbelievable, why would you pay for something if you can get the alternative for free ??!!

Software pirating is even worse. I see it coming, one day all the software we've been pirating will just hang and leave us unstable. Imagine your operating system will not load, you're not backedup with an alternative, it will definitely take you down sometime and you will definitely lose A LOT of work ! For now, microsoft can't just do it because they know exactly if they do this, people will not purchase a license.. they will buy a playstation instead or if they're smart enough they will use Linux. Both cases having microsoft lose its market share tragedily.

I have taken the decision to completely migrate to free and opensource, even if they don't offer exactly the same options. I will just do it gradually. For me it's no different than shop lifts and robberies.

--
The man who insists upon seeing with perfect clearness before he decides never decides.

Tuesday, September 19, 2006

Egypt is not yours!

This just can't wait until I have time to write about it... Enjoy!


* Image is a deviation by ~dancewiththesky

** Image published by manalaa.net

--
"Never forget what a man says to you when he is angry" - Henry Ward Beecher.

Monday, September 18, 2006

Lebanon Standing Still


* The image is a deviantion by ~zodc as posted on deviantLEBANON
--
Nobody listens until you say something wrong.

Monday, August 28, 2006

Things I didn't expect about Muenchen


2 days remaining and i'll be back to Cairo .. I'll definitely miss everything here..

The top 9 things I didn't expect about Muenchen are:


  1. Timings: Who said germans are punctual more than any other on the planet ? They're not.. they're normal.. even sometimes the train or the bus can be late for 10 minutes !
  2. People: They ARE generous ! and helpful ! Do you believe it ? I still don't !
  3. "G"irls: Girls are the exception. 'G'irls are the normal.
  4. Language: They're not tightly bound to their language, they don't mind speaking in English (unless they don't know), at all !
  5. Asians: They're almost more than the germans !
  6. Services: Computer Services suck ! You cannot get a trivial problem solved here.
  7. Cleanliness: Rooms can be as dirty as in Egypt, don't believe me ? Check Willi-Graf Str., 17
  8. Pedestrians: I was amazed to see them not always stopping for the red traffic light! It's not very common but I have seen it quite few times, and I thought I would never see it.
  9. Smokers: The ratio is much below what I expected.

Personally I have changed my idea about the german character 120 degrees!

--
"A guest sees more in an hour than the host in a year." - Polish proverb

Friday, August 25, 2006

I'm finally here!

Hello ! It's great you've found your way here to my blog. If you're interested in computer science and software development, definitely this will not be your last visit. I have been thinking for a while of creating my own web page where I can post my blogs in addition to the information I get access to everyday. Unfortunately, as you see, it's a problem of time. This is just another idea that I have been having in mind long ago but I haven't been taking any serious actions. Anyways, here's my first serious action, the blog! Just stick to it and contribute to the discussion.

You might be wondering about the name "Wiki mix". This is one of the things that I try to avoid, giving names! Anyways, the name is inspired by my belief, which has been fastly developing over time, in wiki and open source. I believe this is going to turn the life of nations upside down. Don't believe me ? Just observe...

I guess one of my very first posts will be about this (Wiki and Open Source). Hope to see you back here and would like to hear your feedback.

--
" Oh God, grant us the serenity to accept what cannot be changed; the courage to change what can be changed and wisdom to know one from another " - Reinhold Neibuhr