Sunday, December 16, 2007

What's AJAX?

Everybody's talking about Ajax, and practically nobody actually has a clue as to what it actually is!

AJAX, n. acronym: Method of making HTTP server requests using Javascript code, and fetching the server response without reloading the web browser. Short for Asynchronous Javascript And XML. Uses the XMLHTTPRequest Javascript object.

Ajax in a Nutshell:
A way to hit your server and get some data from it without making your poor user reload the whole stinkin' page. (You can send data to the server, too, such as form submissions.) The HTTP request is normal, just done from Javascript! And no reloads!

Wha? XML?
Despite the name, XML doesn't have to be involved. Some Ajax packages let you offload data formatting work to your back end so you can return HTML and even Javascript instead of serializing stuff. Prototype.js is one of them.

The road from here:
Code it by hand, use a Javascript toolkit, or use a Javascript/server-side scripting language framework. Ruby on Rails and its clones have Ajax support baked in. For other languages, your best bet is one of the pure Javascript codepackages to the right.

Saturday, November 17, 2007

Sorting techniques and algorithms (2)

Before reading this article please refer to part 1.

Selection Sort:
Selection sort is the most conceptually simple of all the sorting algorithms. It's inefficient on large lists, and generally performs worse than the similar insertion sort. It works by selecting the smallest (or largest, if you want to sort from big to small) element of the array and placing it at the head of the array. Then the process is repeated for the remainder of the array; the next largest element is selected and put into the next slot, and so on down the line.

Because a selection sort looks at progressively smaller parts of the array each time (as it knows to ignore the front of the array because it is already in order), a selection sort is slightly faster than bubble sort, and can be better than a modified bubble sort.

Here is an example of this sort algorithm sorting five elements:

31 25 12 22 11
11 25 12 22 31
11 12 25 22 31
11 12 22 25 31
And here is the code for a simple selection sort:

Insertion Sort:

Insertion sort is a simple sorting algorithm. It inserts each element of the array into its proper position, leaving progressively larger stretches of the array sorted. What this means in practice is that the sort iterates down an array, and the part of the array already covered is in order; then, the current element of the array is inserted into the proper position at the head of the array, and the rest of the elements are moved down, using the space just vacated by the element inserted as the final space.

It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort, but it has various advantages:
  • Simple to implement
  • Efficient on (quite) small data sets
  • Efficient on data sets which are already substantially sorted
  • More efficient in practice than most other simple algorithms such as selection sort or bubble sort.
  • Stable (does not change the relative order of elements with equal keys)
  • In-place (only requires a constant amount of extra memory space)
  • It is an online algorithm, in that it can sort a list as it receives it
Here is an example: for sorting the array 52314 First, 2 is inserted before 5, resulting in 25314 Then, 3 is inserted between 2 and 5, resulting in 23514 Next, one is inserted at the start, 12354 Finally, 4 is inserted between 3 and 5, 12345

Here's a simple implementation of insertion sort in C/C++:

For a complete list of popular sorting algorithms please refer to this Wikipedia article

Friday, November 16, 2007

Tech Talks

Until Recently, home networks were primarily the realm of technophiles - most families either didn't need or couldn't afford more than one computer. But now, in addition to using computers for e-mail, people use them for schoolwork, shopping, instant messaging, downloading music and videos and playing games. For may families, just one computer is no longer enough to go around.

Join us in this session of Tech Talks as we discuss the fundamentals of networking and give a quick overview on how it works in the real world

Date: Tuesday, November 20, 2007
Time: 4:00pm - 6:30pm
Location: AAST- Ground Floor CS Building

For more info please call 010.171.2417

Facebook RSVP Status:

Note: You may invite your colleagues to this event

Wednesday, November 7, 2007

AAST's new website launched

AAST has finally launched there new website which has been in the beta phase for a loooong period of time. The new website is much (and I mean MUUUUCH!) better than the old crappy one and it's not just a redesign, but a complete makeover with some new features as the AAST Calender (which is still empty though). Although it's still incomplete and has many broken links/pages, but it's an excellent start and hope they complete it someday and keep it up to date.

Check it out yourself:

Tuesday, November 6, 2007

Tuesday, October 23, 2007

Business slides, finally!

Fundamentals of Business slides, all 18 chapters (50 MB, RAR compressed file): download now!

Monday, October 22, 2007

Sorting techniques and algorithms (1)

Have an array you need to put in order? Keeping business records and want to sort them by ID number or last name of client? Then you'll need a sorting algorithm. To understand the more complex and efficient sorting algorithms, it's important to first understand the simpler, but slower algorithms. In this article, I'll talk about the 3 algorithms we studied at college which are bubble sort, including a modified bubble sort that's slightly more efficient; insertion sort; and selection sort. Any of these sorting algorithms are good enough for most small tasks, though if you were going to process a large amount of data, you would want to choose one of the sorting algorithms that I'll talk about in the next posts isA.

Bubble Sort:
The bubble sort is the oldest, simplest and generally considered to be the most inefficient sorting algorithm in common usage. Unfortunately, it's also the slowest. It works by comparing each item in the list with the item next to it, and swapping them if required. The algorithm repeats this process until it makes a pass all the way through the list without swapping any items (in other words, all items are in the correct order). This causes larger values to "bubble" to the end of the list while smaller values "sink" towards the beginning of the list.

Since the worst case scenario is that the array is in reverse order, and that the first element in sorted array is the last element in the starting array, the most exchanges that will be necessary is equal to the length of the array. Here is a simple example:

Given an array 23154 a bubble sort would lead to the following sequence of partially sorted arrays: 21354, 21345, 12345. First the 1 and 3 would be compared and switched, then the 4 and 5. On the next pass, the 1 and 2 would switch, and the array would be in order.

The basic code for bubble sort for sorting an integer array using C looks like this:

A better version of bubble sort, known as modified bubble sort, includes a flag that is set if an exchange is made after an entire pass over the array. If no exchange is made, then it should be clear that the array is already in order because no two elements need to be switched. In that case, the sort should end. The new best case order for this algorithm is O(n), as if the array is already sorted, then no exchanges are made. After modifying the code it will be like this:

In part two I will talk about insertion sort and selection sort. Please post a comment if you have any questions :)

Tuesday, October 16, 2007

Developers developers developers developers...!!

A couple of years at Microsoft and you should start acting like this!!

In this video: Steve Ballmer, Microsoft CEO.

Monday, October 15, 2007

You are a Programmer IF...

1- You have more than a document file on your desktop called "To Do".
2- You start counting from zero.
3- You can find some code in a folder on ur PC & you wonder when & how you made this code.
4- You may stay awake a whole night trying to fix a bug, then when u go asleep, you dream of the solution.
5- You don't like most of the softwares in the market.
6- You forget to eat or sleep cause you were too busy writing some piece of code.
7- You stress the words IF, THEN & ELSE while speaking.
8- You always search for the undo button (ctrl+z) when u mistake in doing any handwritten stuff.
9- Most of your speech is not understood except by your colleagues in college or work.
10-You find yourself writing a semi-colon at the end of any sentence instead of a full stop;
11-You estimate lengths better in pixels than in meters & centimeters.
12-You use the eye-drops as frequent as you use the toothpaste.
13-The First words you write when trying sth new are "Hello World".
14-You never used that device that looks like a computer screen & called "TV".
15-You - every now & then - wake up with the keyboard imprinted on your face.
16- You have a volatile Memory like RAM.
17- You write C++,C# or Java better than u write your own language.
18- You don't think wearing sports shoes with a suit is strange.
19- You remember all your passwords, but fail to remember you own birth date.
20- The word 'Engine' reminds you of games more than of cars.
21- Anytime you see a penguin, you think of Linux.
22- You have a LAN in your room.
23- You're the highest-paid yet the worst-dressed person in the office.
24- You follow the instructions only if everything else fails.
25- You use F1 instead of SOS.

Source: JetBrain blog (a blog by Roaa Mohammed, an MSP at Ain Shams university)

Wednesday, September 19, 2007

Imagine Cup

Mohab and Marwan (MSPs at the AAST). CCIT's Imagine Cup booth

What is the Imagine Cup?

The world’s premier student technology competition, Imagine Cup is one way Microsoft is encouraging young people to apply their imagination, their passion, and their creativity to technology innovations that can make a difference in the world – today. Now in its fifth year, the Imagine Cup has grown to be a truly global competition focused on finding solutions to real world issues. In 2007, more than 100,000 students from 100 countries entered the Imagine Cup competition.

The 2008 Theme: The Environment
This year, Microsoft is calling on young programmers, artists and technologists around the world to "imagine a world where technology enables a sustainable environment." We’re challenging students to bring their ideas to life in a multifaceted competition that comprises nine categories, each catering to a different technological or artistic affinity. Students’ work will reflect valuable, real world solutions, while giving them the opportunity to compete for cash prizes. When coupled with the power of technology the potential of young people is unlimited and the ideas they develop for the Imagine Cup could significantly improve the lives of millions of people around the world. In this competition, everyone wins. The 2008 World Finals will be held in Paris France from July 1-8, 2008.

Who can enter the Imagine Cup?
You are eligible to enter any invitational that is a part of this Contest if you meet the following requirements at the time of registration:

  • You are 16 years of age or older.
  • You are actively enrolled as a student at an accredited educational institution that grants high-school or college/university (or equivalent) degrees any time between January 1, 2007 and May 31, 2008.
  • You are not an employee or intern of Microsoft Corporation, or an employee of a Microsoft subsidiary.
  • You are not involved in any part of the execution or administration of this Contest between.
  • You are not an immediate family member of (parent, sibling, spouse, child) or household member of a Microsoft employee, an employee of a Microsoft subsidiary, or a person involved in any part of the administration and execution of this Contest.
  • You are not a resident of any of the following countries: Cuba, Iran, Iraq, North Korea, Sudan, and Syria.
  • If you are a Microsoft campus representative (such as Microsoft Student Partners and you meet the eligibility criteria set forth above, you may enter, but you are prohibited from using Microsoft property or resources, including without limitation, Microsoft networks, hardware tools and technology resources and/or the counsel of Microsoft employees, in connection with the creation or execution of your entry.

Competition Categories
Below is a list of the 2008 Competition invitationals.

  • Software Design
  • Embedded Development
  • Game Development
  • Project Hoshimi
  • IT Challenge
  • Algorithm
  • Photography
  • Short Film
  • Interface Design
Visit for more information about the Imagine Cup and to register for the 2008 competition. Good luck! ;)