Category Archives: programming

PC^(2++)

.. 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 ASP.net 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]

PC^2

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.

So..

Can you C the trick ? [Problem of the week]

 Untitled How to write “X” so that:

int a= 0;
X(a++);
cout<<"a = "<<a;
//console says a = 5 Positive five!

a= 0;
X(a--);
cout<<"a = "<<a;
//console says a = -5 Negative five!

waiting for the answers in the comments (comments are moderated) .. i will show them after a couple of right answers..

if your answer is wrong “which is fine”, i will pass the comment..

if it is right .. i will reply on the comment or maybe to your mail telling you to stop trying..

—–

now to the Winners (in order of who replied first):

  1. me 😀

Exceptional Software, Explained: Embrace Error [OSCON2008]

i have tried to follow the O’Reilly’s Open Source Convention (OSCON) for a bit .. but since i am not very familiar with most of the names .. i lost my interest later..

until i seen a video by GreggPollack titled Oscon in 37 minutes where every speaker summarizes his talk in 30 seconds..

i will try to cover the most interesting talks -for me- later .. but for now .. i will start with most i liked

it was by Robert ‘r0ml‘ Lefkowitz about Exceptional Software..Explained you can watch the 30 seconds from the previously mentioned video here

[viddler id=ede9eafd&w=437&h=370]

i will quote what he said

one of the things we are trying to do is encourage large enterprises to adopt the open source practices..

difficulty that .. although we have open source practices .. we don’t have open source methodology..

large companies are used to methodologies like Rational Unified Process or the Microsoft Solutions Framework or SCRUM or eXtreme Programming .. that define “how it is that you go about it”

and there is NO open source methodology for HOW YOU DEFINE SOFTWARE ?

and then you think that “MAN .. this is going to get very boring” .. but you must watch the 30 seconds and then you will get why it is not .. especially that he presents a totally new methodology other than what we are used to

i have dug for the complete talk .. and found it here

the talk is extremely fun .. and very insightful

you can download most of the presentations from here

Reblog this post [with Zemanta]

tools i use..

since you might be digging the internet for a notepad replacement or an explorer extension that makes searching files easier..

i thought to save u some bandwidth .. and tell you about some tools i like

most of these are Free Software. برامج حرة

Exploring, Navigation and GUI

    1. Launchy
      no need to Dig through Start>All Programs or fill the desktop with millions if files .. or look for Calc each time you need to add 55 + 78 …find your programs and run them in no time

    1. ClipX
      use Ctrl+Shift+V .. to paste stuff that you copied and overwritten .. like office Clipboard but cooler
    2. PowerMenu
      if you like HackIt .. you will love PM, send any window to System Tray, makes it transparent or On Top
    3. Rocket Dock
      Coolest app from the Mac World
    4. TeraCopy
      Copy, Pause, Cancel and Resume in Windows Explorer and On Lan, hundreds of files.

    1. StExBar
      adds a Toolbar in your Explorer, with some handy stuff (open ComandLine here, copy all pathes, copy names, rename all) .. extremely useful.

  • GrepWin
    if you are a Linux fan .. then u know grep .. and u also know that windows search is useless .. grepWin Lets you search inside files with a RegEx or for normal Text

 

AntiVirus

No matter what you do .. u can never rely on that.. so i will mention NONE

Network and Chat


    1. FireFox
      u can see a cant be bias here

    1. eMule
      P2P file sharing program .. very configurable
      Image via
      Wikipedia

eMule

    1. Orbit / Free Download Manager

    1. CrossLoop
      may be slower than LogMeIn.. lets you share the desktop with your friend.. very helpfull for remote assistance

    1. Pidgin
      aside the fact that current GTK+ release on windows is extremely buggy, Pidgin is All In One Chat Client, very light, very cool .. simply you can have 2 Gtalk accounts + 1 yahoo + 3 MSN in one window, one program

    1. uTorrent
      the smallest of all, compared to its feature richness.

Firefox Addons

    1. Firebug
      helps you to analyze HTML, find problems with your website, debug javascript
    2. FireFTP .. obvious

    1. Foxmarks
      Sync your bookmarks across machines and even access them online
    2. FoxyProxy
      Proxy management, go TOR or any other Proxy in seconds

  1. QuickDrag
    Drag and Drop any link in a new background tab .. instead of Ctrl+Click every time
  2. Shareaholic Found something awesome and cant wait to pass it on ? share over GReader, digg or anyother..

  3. SpeedDial
    bookmarks in a smart way
  4. Sxipper Manages your passwords and fills-web forms .. extremely SMART

  5. TabMixPlus
    want to make your tabs at the bottom of the page , control ordering , force 1 instance of FF ?
  6. Zemanta a blogger ? .. u MUST try this

General Purpose

    1. Foxit Reader
      compared to Adobe reader ? .. this one should be rated (999/5)

  1. WordWeb
    aka Churchill, a compact Dictionary, with shourtcut keys , just select, press ALT+T and u see the meaning. the last version is wierd, but its free any way
  2. Notepad++
    take alook for yourself, it can replace Notpad interly by the way

Audio Vedio

    1. Winamp ..

    1. Audacity
      A Free, Cross-Platform Digital Audio Editor under GPL

    1. MediaCoder
      Convert from any thing to any thing.. another verygood OSS

Burners, ZipFiles

    1. InfraRecorder
      OpenSource Image Burner .. a free/Light Nero alternative and works great!
    2. Daemon Tools
      OpenSource, Simulates a CD from an image, much compact than PowerISO and VirtualCD

    1. 7-Zip
      Tired of the “your evaluation Copy expired” every time you open a zip file in WinRAR ?, 7-zip is the OpenSource alternative

Now to the best part

Development Tools

    1. pInvoke VS addon
      get the pinvok signature of any function from PInvoke.Net

    1. VisualAssistX
      Not Free, but simply addictive

    1. ProcessExplorer
      gives you every detail about any process in your system

    1. DependencyWalker
      Know what DLL’s your program loads.. know what symbols are exported by your DLL, TakeALook

  • TortoiseSVN
    Source Control Management .. if you are still makeing copies of your code and sending them through mail in zip files to your friends .. then you should start using SVN

 

  • CMake
    convert Makefiles into VS Solutions

 

  • WinMerge
    merge two code files or folders, see what changed , bla bla .. the best windows diff tool

 

i think that’s all.. you want to share a tool you like ? .. place it in the comments

Zemanta Pixie

Why are routers annoying ?

Why Cant i host a website on my PC ?

Why do we have to do port forwarding to use Bit-torrent fast enough?
What is port forwarding in the first place ?

the answer for these is because you have a router or they also call it a Layer 3- Switch

but before we can go on and explain why .. i must make sure that every one understands (or at least will understand someday) so i will have to make a fast intro to the networking world .. to reach that goal .. i will split this discussion into a couple of posts .. a series.. like the “My Programming Experience” series which was great because it was never continued 😉

so ..
lets pretend that we are going to build the networking stack from scratch .. and we will face problems and we will face them and solve them “by cheating from the current network stack” .. so i dont claim that what i will explain is very precise .. if u need that .. u can refer to a book or wikipedia after we are done.

  1. Network: an group of inter-connected machines .. that share resources to perform a task. “easy?”
  2. server: a machine in the network that provides a service .. mostly a resource or a piece of info. “okk ?”
    so note: ANY MACHINE can be a SERVER as long it has something to serve “Any one can cook!.. ok Remy ?”
  3. Client: i think its the machine that is served by the server. “its like fire has to burn because its fire!”
  4. Modem .. lets also call it Network Interface .. Adapter .. i will use these names to refer to the hardware and software logic that enables the Client and Server to interact

so lets say we are all connected by some magical wire to some Central .. and the connection between any two machines is like a phone Call .. one machine dials a number .. and starts talking .. so each machine has a number? .. what to call it? .. lets call it IP

ok .. so once you know the a machines IP .. you can communicate with it .. but wait .. lets notice that a machine, a computer is mainly applications, right ? .. so who needs to communicate ? .. these applications .. so likely you will say “i want to talk to MSN on Ali’s machine” in the phone case you use a name after you dial a number .. so lets use another identifier .. again a number .. now we call it PORT .. its where requests dock 🙂

and don’t ask me who choose that name “ports” .. because i have no idea!

now, when an application wants to communicate with another on another machine .. say two MSN messengers, each listens on port 55 on its own machine .. each talk through that port 55 to the other side and receives “listens” to info from that other side on that port too.

from the image, u see firefox tries to connect to some website’s Server, it uses port 1 to communicate, while the server sends its reply to your PC on port 1 again, since Firefox used it to send the request , then logically it is still waiting for the reply from the same address


Ports Explained .. click for a large image..

 

so what is these “addresses” ?
they refer to some application running on a machine
they consist of the IP and the port
IP:Port
123.474.47.1:48
by the way .. the most famous application that runs on a server is a “HTTP server” its an application that simply sends Web-Pages and processes them, by default it runs on port number 80

that’s it for today..
next
en shaa2 Allah: Routers, how they work

if you think i should have mentioned something and i didnt please add it in the comments. thanks..

Zemanta Pixie

Cola.. Shared Editing in Eclipse

i had a post in my draft talking about “Working together” continuing the (My Programming Experience) series

i was going to talk about SVN and Visual Source Safe and other Source Code Management tools (SCM)…
and LogMeIn and CrossLoop and Google Docs as collaboration tools ..

but ALLLLL my plans changed 5 minutes ago when i saw this post about GooglePlex and Ganymede the new Eclipse Release.

Cola: Real-Time Shared Editing from Mustafa K. Isik on Vimeo

because after a couple of clicks i found my self watching this video ..which you MUST see.. it is about Cola a new plugin built for Eclipse Communication framework (ECF)

i am downloading Ganymede now .. 😀

>

5 Rules to break

If you launch lots of programs, calculate alot (2+3 =5) and you hate to run with the mouse through Start>Programs>Accessories>Calc
Start>Programs>Mozilla>Firefox .. every time u need to start a program ..then

YOU must try Launchy (an opensource launcher for windows)

—–

if you are a GNOME user .. then you probably know Gnome Do

Below are shown various shots of Launchy in action, opening a variety of files and programs – in just a few taps of the keyboard.

the author of this app .. (which by the way uses Mono).. has mentioned in his blog the reasons he think made Gnome Do come out so outstandingly in only 8 months to get a 100,000 user.

here are they..

Zemanta Pixie