Sunday, July 19, 2009

Notes on REST Architecture

REST stands for Representation State Transfer

the main characteristics of REST are:

  • Distributed Network of interlinked documents
  • Client-server architecture
  • Stateless Server
  • The concept of Resource and Resource Representation
the action of retrieving a resource must be Idempotent, the fact that you made the request should not change the contents of the resource.

From "Beginning Python 2005"

Wednesday, July 1, 2009

My trip to my hometown

I am traveling to my home city and while i am at the train i see the life of the way to the upper egypt and i wonder how ignorant i was, how much i dont know about my own country and the people who i share with them a religion , home and a future.

the thing that striks me is how different the life here from the crowded city of cairo, how peacefull the people are and how beautiful our upper egypt is.

Today i visited my grandparents grave and i got a feeling my words cannot help me explaining them, but one of the feelings is definitaly sadness, i was sad because the memories that suddenlly became like reality, i got the feeling that my grandfather have past away only yesterday and there is nothing compared to that feeling, those kind of feelings that makes even taking your bearth very defficult process.

and there were the part where i just sat there at this beautifull place outside the mosque, where the wheher cannot be better(the weather was one of the things that made me hisitate going on this trip).

Saturday, March 28, 2009

Google engineers takes python to the next level

Great news for all python fans, Google engineers are working on a project to create a Just In Time (JIT) compiler for python programming language to be used instead of the python virtual machine.
The project called Unladen Swallow and promises a five time faster python.
you can read more details about this great news here

Sunday, March 22, 2009

Linux Tips

How to take the output of a command and pass it as arguments to another command ?
  • using pips
  • using xargs: $ ls /bin/b& | xargs -t dpkg-query -S
How to watch commads:
  • $ watch -n 10 'ls -la'
  • $ watch -d 'ls -la'
Using bash history:
  • $ history
  • $ ! 33
  • $ ! !
  • $ ! ls:s/CF/1
Bash: the shell
there are two types of files holding the bash settings, startup files and initialization files
  • startup files: runs for any shell that is a login shell (/etc/profile/.bash_profile, .profile, and .bash_login)
  • initialization files: runs for interactively running shells (not shell scripts) (/etc/bash.bashrc, ~/.bashrc)

sudo:
  • every use of sudo gets logged in /var/log/secure

Monday, October 20, 2008

Back with some Networking

What is Network secure communication components?
  • Confidentiality: only the sender and the intended receiver should be able to understand the content of the transmitted massege
  • Authentication: both the sender and receiver should be able to confirm the identity of the other party  involved in the communication
  • Message integrity and unrepudation: making sure that the content of the communication estalished between to authenticated entities has not be altered
  • Availability and access control: making sure that legitimate user can access the network services(Denail of service attacks prevention)

Sunday, September 28, 2008

Today's mix: Geography, algorithms,....

Recurrence Equation

What is a Recurrence Equation?
it is a mathematical equation where the value of the function at a given n is given in terms of the value of the function in a smaller value of n

recurrence equation is used in algorthmis analysis to represent recursive functions,like a recursive function, a recurrence equation needs an intial condtion where the call stack will stop evenually at.

Example Fabonanci function:


input: non-negative number n
output: n!
Algorthim:
int fact (int n) {
if (n == 0) return 1;
else return n * fact (n - 1);
}
suppose that t(n) is the number of multiplication done for a given value of n:
t(n) = t(n-1) + 1 where n >= 1
t(0) = 0
The above equation is a Recurrence equation it conforms the tow conditions stated in the definition mentioned earlier:
  1. it have an initial condition --> t(0) = 0
  2. the value of the equation at n is in-terms of the value of the same equation with a smaller n (n-1 in out example)





Wednesday, September 24, 2008

Stuff l learned today

Tail Recursion optimization:

it is the process of converting a recursive function call to an iterative procedure providing that the recursive call is the last call in the function with no other operations after it.

Tuesday, September 23, 2008

Napoleon and Divide-and-Conquer

Today i learned how the French emperor Napoleon is related to the computer programming algorithm technique Divide-and-Conquer.

It was December 2, 1805 on the battle of Austerlitz when Napoleon was faced with an Astro-Russein army which out-numbered his with 15,000 solider, so Napoleon drove right into the middle of the enemy's army to splite it into a tow smaller armies which each of them is weaker than his army.
The Astro-Russein two splitted armies each suffered heavy losses and were compelled to retreat.

From the previous story the technique of Divide-and-Conquer were developed that for some instance of a problem, if the instance can be divided into smaller instance of the same problem, then the solution for the original instance can be obtained from the solution of the smaller one's

Monday, September 22, 2008

Today it is AJax

What is Comet(reverse Ajax)?

it is the illusion that data being pushed from the server.
for example:

a web aggregator that fetch feeds from different sources and view it to the user, the data may viewed as it is being pushed from the server using Comet

How it works ?

a separate process is responsible for fetching data from the server perodically, then it pushes these data to the aggregator

Sunday, September 21, 2008

Today's new stuff

Today I am going to learn something totally new.It is about the ocean and why the ocean colour is blue.


Why the ocean colour is blue?


it is the transmission of energy that makes the ocean colour blue, how?
when the sunlight which contains colours hits the oceans surface, the water molecules scatter the light rays.This scattering causes the water to appear blue because the blue light of the sun rays scatters more than any light of other colours.
source "HowStuffworks.com"