Category Archives: All

Open Source in Egypt

A couple of days ago .. i came by this Map. its about the Open Source Active territories in the world ..

So i thought, โ€œNo way i can see Egypt in thereโ€, but to my amazement .. She ranks the 58th of 75.


Which is weird, cause i do live in Egypt, i am in the Computer Science Community, moreover i am quite a fan of open-source .. image

But still .. if you ask me to name an Egyptian company that has invested in OSS, i can only come up with OpenCraft with their contributions to Drupal and eSpace with their imagecontributions to Rails and may be there is some one out there who contributes to Joomla

That makes 3 or 4 say 10 companies .. where the heck did this 63 of 75 rank number came from ??!!

and do we have 25+ open-source community projects ? ๐Ÿ˜€

well we do have EGLUG .. ุญูŠุซ ุชุฃูƒู„ ุงู„ุจุทุงุฑูŠู‚ ุงู„ุทุนู…ูŠุฉ .. but thatโ€™s mainly a โ€œLinux-is-coolโ€ thing, well, its an activity, but i doubt that these numbers only came by having fans !

When you click on a country, you can see its overall rank among the 75 countries in the index, as well as its rank for Government, Industry, and Community factors. Government factors include open source procurement policies and support for open source. Industry factors include the number of registered OSS users per capita and internet growth. Community factors include the number of applications to the Google summer of code, native language support for GNU/Linux, and number of Internet users per capita.


That is the Google Summer of Code Students Map for 2008. you can see it heavily connected, every where away form egypt.


But we do have 3 contributors .. โ€œsalute to them!โ€ .. 
i think that all of them are from Cairo University (Mostafa studies medicine !)..  โ€œWay to go Ain-Shams!โ€ ..


But none of them i knew personally .. โ€œlucky them!โ€ .. though its quite an annoying thought.

So lets do something about it..

We encourage you to explore, learn, then improve or build off the Open Source Index. This work is a resource and just the beginning. Analyze the results here or gather the data and change the construction. Whatever you do, share it with the rest of us.

So, throw links in the comments .. all the links you know about open source in Egypt. Projects, Blogs, People.

I will gather them all isA .. make an index .. and may be next year .. if they knew each other we will find 50 students contributing to GSoC.

Reblog this post [with Zemanta]


.. So, in this post, i will try to figure out how PC^2 can get better .. by giving it some lousy competition ๐Ÿ˜€

.. Just add one to the power..

PC^3 is an open source, web-based Programming Contest Control System. [now you get why i was so biased in my previous post (6) ๐Ÿ˜€ ]

You can take a look at the Prototype here ..

The Bad stuff about PC^3:

  1. Still in alpha .. so if PC^2 started in 1988, may be we will use PC^3 to run the ACM-ICPC, in the year 2525.
  2. Web App.. relies on HTTP, still no matter what, Desktop apps and two-way communication have their charm.
  3. currently supports only (not cross-platform), but you are welcome to port it to Mono.
  4. Not Feature rich yet. (i think thatโ€™s why its open source ๐Ÿ˜€ .. we need your help ๐Ÿ˜€ .. etbara3 walaw be logo)
  5. .. you get to add ..

The Not-So-Bad stuff about PC^3:

  1. ZERO install is required on the contestantsโ€™ machines, just a browser.
  2. You can always fire up a backup machine to host the server .. copy the configuration folder .. give the contestants the new URL .. every one is happy.
  3. HTTP can get through your annoying universityโ€™s firewall.
  4. NOW .. you can actually have the scoreboard integrated with the client it self.. and not have to give every one the link in the clarifications.
  5. Its open-source .. so if you were a judge in some contest and no one submits .. and you got bored .. you can always fire VS and add some features and get to test it in a real contest .. you can, right ?.. no ?!
  6. Imagine all the features we can add .. I am posting a list to the blog soon isA.

so .. suggestions, contributions ?

Reblog this post [with Zemanta]


Those of you who ever have been to an acm contest, certainly do know great PC^2 (pronounced P-C-Squared).

PC^2 is simply the most reliable out there, not because its awesome, but because people everywhere rely on it to run their contests, especially that its the only one out there.

I am quite sad that I am writing this post, not only because no body is gonna read it, but also because PC^2 is related to some of the best memories on my days in the university, and now i have to criticize it a little bit. But i hope its for the best.

Since, to me, PC^2 does not seem to be jumping to the next curve, not to mention that it started out in 1988 and it is at its version 9 today!

Awesome things about PC^2:

  1. Tested heavily, man, every contest ever runs in the world runs on it.
  2. Cross-Platform, written in JAVA

Not-So-Awesome things about PC^2:

  1. Its in JAVA, the most speeding, Lightweight platform in the world.. oh wait! .. its not. (note: do take this point personally .. i hate java .. but who cares)
  2. Requires an always-on connection, That is just a dream in my universityโ€™s labs.
  3. Requires a separate installation on every single client and server, you need to install Java, MinGW, define environment variables, copy PC^2, Run it, Test it.
  4. Closed-Source, seems like Berkeley is more open than Sacramento.. guys .. open it up a bit .. California is dreaming of such a Wednesday.


CIS Game

Ok .. so none of us knows how to make a game.. lets try to make a one together

may be we can call it “Game[d] el Tenneen” ๐Ÿ˜›


Prerequisites :

  1. C++ and OOP “games are all about lots and lots of classes” ๐Ÿ˜€
  2. Good Command on your Tool “Visual Studio”
  3. A decent Graphics Card
  4. “some” love for Math (especially vectors) ๐Ÿ˜›
    yes .. lel asaf

I Promise this will be a piece of cake, only if you bear with me the first two posts

i will use VS 2005, you can use VS2008 or Code:Blocks .. it will not make any difference isA

Steps for who will use VS2008:

  1. download this.

Steps for who will use VS2005:

  1. You MUST download this. [VS2005 SP1 432MB] ๐Ÿ˜€
  2. Download this. [it helps you to say File>New>Project>Game] ๐Ÿ˜€ .. it works only with 2005 that is why i use it
  3. download this.

2oktob 3arabi.. Yamli

ู„ูˆ ุนู†ุฏูƒ ู„ุงุจุชูˆุจ ูˆ ู…ุด ู„ุงู‚ู‰ ุงู„ูƒูŠุจูˆุฑุฏ ุจุงู„ุนุฑุจู‰ .. ุงูˆ ุงู„ุนุฑุจู‰ ุงุชู…ุณุญ .. ุงูˆ ุงู†ุช ุงุตู„ุง ู…ุจุชุนุฑูุด ุชูƒุชุจ ุนุฑุจู‰ ุจุณุฑุนุฉ .. ุชุจู‚ู‰ ุงู†ุช ูู‰ ู†ูุณ ุงู„ู…ูˆู‚ู ุงู„ู„ู‰ ูˆุงุฌู‡ ุญุจูŠุจ ุญุฏุงุฏ ู„ู…ุง ูƒุงู† ูู‰ ุจูˆุณุทู† ูˆ ุญุงูˆู„ ูŠุฏูˆุฑ ุนู„ู‰ ุงุฎุจุงุฑ ุจู„ุฏู‡ ุจุงู„ุนุฑุจู‰ ุนู„ู‰ ุฌูˆุฌู„ ูˆ ู…ุนุฑูุด ู…ุน ุงู†ู‡ ูƒุงู† ู‚ุงุฏุฑ ูŠูƒู„ู… ุตุญุงุจู‡ ุนู„ู‰ ุงู„ู€MSN ูˆ ูŠูู‡ู…ู‡ู… ูˆ ูŠูู‡ู…ูˆู‡ ุนุงุฏู‰ ุจุงู„ุนุฑุจู‰ ูุฑุงู†ูƒุง

ุงู„ูุฑู‚ ุงู„ูˆุญูŠุฏ ุจูŠู†ูƒ ูˆ ุจูŠู†ู‡ ุงู†ู‡ ู‚ุฑุฑ ูŠุนู…ู„ ู…ูˆู‚ุน ุชูƒุชุจ ููŠู‡ bel 3araby ูˆ ุชุชุญูˆู„ ู‡ูŠุง ุจุงู„ุนุฑุจู‰ ๐Ÿ˜€

ูˆ ุชุทูˆุฑ ุงู„ุงู…ุฑ ู…ู† ูˆุงุฌู‡ู‡ ู…ุญุฑูƒ ุจุญุซ ุงู„ู‰ ู…ุญุฑุฑ ูƒุงู…ู„ ุงู„ู‰ ุฎุฏู…ุฉ ูƒุงู…ู„ุฉ ุญูŠุซ ูŠู…ูƒู†ูƒ ุงุถุงูุฉ ู…ุญุฑุฑyamlified ุนู„ู‰ ู…ูˆู‚ุนูƒ ุงูˆ ู…ุฏูˆู†ุชูƒ ุฎู„ุงู„ yamli API

ุนูˆุงุฏ ูˆ ูŠู…ู„ู‰

ุชูุงุตูŠู„ ุงูƒุชุฑ ุนู† ูŠู…ู„ู‰ ูˆ ุนู† ุดุฑูƒุฉ Language Analytics LLC ู…ูˆุฌูˆุฏู‡ ูู‰ ู…ู‚ุงุจู„ุฉ ู…ุนู‡ ุนู„ู‰ StartUpArabia

To my lonely 1 reader.. I am back


ุงู„ู„ู‰ ู‚ุงุฑุฆู‰ ุงู„ูˆุญูŠุฏ .. ู„ุณุช ูˆุญุฏูƒ ..ุงู†ุธุฑ ุญูˆู„ูƒ .. ุนู„ู‰ ุงู„ุฃู‚ู„ ูู‰ ุฎู…ุณุฉ ุงุดุฎุงุต ุจูŠู‚ุฑูˆุง ุงู„ุงุนู„ุงู† ุฏู‡ .. ุญุงูˆู„ ุชุฌุฏู‡ู… .. ุฎู„ูŠูƒ ูุถูˆู„ู‰

ู…ูˆุจูŠู€ .. ู…ุญู…ุฏ ูุคุงุฏ

ุญุณู†ุง .. ู„ู‚ุฏ ุนุฏุช ูˆ ุณุฃุญุงูˆู„ ุงู„ูƒุชุงุจู‡ ุจุงู†ุชุธุงู….. ุฏุนูˆุงุชูƒู… ุนู„ุดุงู† ู…ุญุชุงุฌู‡ุง

The Shortest.. Solved Again [Problem of the Week]

it’s time to show you the solutions submitted to this problem..

I have heard about this problem once from Abdalla Gamal, The acm Guru that taught us every thing we know about acming.. then i found it later mentioned in a book

i recommend that you copy all the code in a cpp, comment it, then un-comment and test each one alone.

so .. first there were solutions by Mohamed Samy, Mohamed Adbelghani, Hatem Adbelghani and Tasniem they used Printf

//m samy
#include <stdio.h>
int main(){char q='"',nl='n',bs='\',p='%';char *s="#include<stdio.h>%cint main(){char q='%c',nl='%cn',bs='%c%c',p='%c';char *s=%c%s%c;printf(s,nl,q,bs,bs,bs,p,q,s,q);}";printf(s,nl,q,bs,bs,bs,p,q,s,q);}

//m adbelghani
char* printedCode="#include<stdio.h>%cchar* printedCode= %c%s%c;%cvoid main()%c{%cprintf(printedCode,10,34,printedCode,34,10,10,10,10);%c}";
void main()

char prog[]="void main(){printf(_char prog[]=%c%s%c;_,34,prog,34);for(char*s=prog;*s;s++)*s=(*s==95?34:*s);printf(_%s_,prog);}";void main(){printf("char prog[]=%c%s%c;",34,prog,34);for(char*s=prog;*s;s++)*s=(*s==95?34:*s);printf("%s",prog);}

#include <stdio.h>
char *myProg = "#include<stdio.h>%cchar *myProg=%c%s%c;%cvoid main(){printf(myProg,10,34,myProg,34,10,10);}%c";
void main(){printf(myProg,10,34,myProg,34,10,10);}

Then there was Jaqoup and Tecno who both used Macros

#include <iostream>
using namespace std;
#define ENIUQ(TEMPLATE) cout << TEMPLATE << "(" << #TEMPLATE << ");n}";

void main()
    ENIUQ("#include <iostream>nusing namespace std; n#define ENIUQ(TEMPLATE) cout << TEMPLATE <<  "("  << #TEMPLATE << ");\n}; n nvoid main() n{n   ENIUQ");

#include <iostream>
using namespace std;

#define STR(str)
    cout <<"int main(){nSTR(" << #str<<")n}";
int main()
        cout << "this is test program";
    return 0; )

Tecno’s Solution although not 100% accurate.. is very elegant.

Then a solution by Mohamed Abd El-Mon’em (Harry Potter), he used cout with no Macros which is why i like his solution alot.

//harry potter
char *str="#include <iostream> using namespace std; int main(){cout<<char(99)<<char(104)<<char(97)<<char(114)<<char(32)<<char(42)<<char(115)<<char(116)<<char(114)<<char(61)<<char(34)<<str<<char(34)<<char(59)<<str;}";
#include <iostream>
using namespace std;

int main()

Then i want you to take a look at another two solutions by Alaa Shaker and Tasniem..

#include <iostream>
using namespace std;

int main()
    // Write ANYTHING .. ANYWHERE!
    FILE *file = fopen(__FILE__, "r");

    if (!file) return 1;

    for(int ch = fgetc(file); ch != EOF; ch = fgetc(file))
        printf ("%c", ch);


    // Thanks to Abdallah Gamal .. LOL
    return 0;

using namespace std;

void main ()
    ifstream fin(__FILE__);
    char a;
    while( !fin.eof())
        fin.get( a );

.. shocking .. hah ?! ๐Ÿ˜€

.. both though totally outside the box.. simple, straight forward .. and even prints comments as they said ๐Ÿ˜€

Thanks to every one.. ๐Ÿ˜€ .. i hope you liked that problem

The Shortest (again!) [Problem of the Week]

Once that a blogger says “i am too busy to post and i will start posting regularly once i am free” he never actually becomes free and never it happens that you see a post in his blog again..

so i wont say that .. but since i am busy a bit .. i will leave you with a strange problem this time.. famous among hackers.. its about..

The Shortest Program That Can Print It Self

..ignoring header files..

so lets say you write this program

#include <stdio.h>void main(){}

your program must print to the console this

void main(){} press any key to exit..
and off course .. any other letter you add to the code (e.g. the printing code inside the main) must be printed also along with the code
Rules and Hints:
  1. the code may be in C or C++
  2. you may consider using either printf or cout to print the program any thing is fine, printf is recommended.
  3. if you can also print the #include lines.. (honestly I couldn’t).. then you are the man.
  4. “almost right” answers might be accepted as long as it RUNS and at least prints 95% of the program!
  5. Anonymous answers wont be approved, at least provide a nick name and don’t use m8 cause its mine!
  6. if you still don’t get the problem, try writing a program that prints “int main(){}” and then look at your code .. and then try to add what you added to the printed “int main(){}” and you will get the problem.
    in other words .. i need to copy the console output and place it in a cpp and run it and then take its output place it in a cpp and .. bla bla

The Shortest – Solved [Problem of the Week ]

OK, enough winners for this problem ๐Ÿ˜‰

By far the most viewed topic in this blog!
and the most solved problem
I really have enjoyed noticing how every one tried to reduce it to 1 line .. to the extend that we don’t have a Second Place !

First Place 1 line (in order of who sent first)

  1. Alaa Shaker
  2. Mohammad Diab
  3. Mahmoud Osama

  4. Anonymous ! .. he didn’t leave a second name so i can’t really tell which Anonymous is he ๐Ÿ˜€ .. please send a name man .. a nickname is also fine ๐Ÿ˜€
  5. Tecnoyotta
  6. Amr Saqr
  7. Hatem
  8. Metal
  9. Mohamed Samy
  10. Mohamed Hesham – Filipino
  11. Mohamed Abdelghani
  12. Mohamed Abd-Elmone’m
  13. Roaa
  14. Tasniem Seliem

now to the solution ๐Ÿ˜€

while( *dest++ = *src++ );

we use a very unique feature .. a very dangerous feature .. its .. well i don’t know what do they call it ๐Ÿ˜€

its when an arithmetic expression can be converted implicitly to a boolean expression .. so its “implicit conversion”  i think (A)

i am sure that every one of us has spent hours and hours in debugging some code that doesn’t work as it should .. only to find out at the end that he left out some “=”..

if( x = 5 )
//instead of 
if( x == 5 )

right ? ๐Ÿ˜›

of course for old programmers its usually not an issue .. but for new comers .. well i think they still feel the sour of it ๐Ÿ˜€

but i think now that you have seen that feature being helpful sometimes .. you will never fall in that trap again.