Monday, February 27, 2012
Funny Quote of the Day
Thursday, February 16, 2012
Sunday, May 9, 2010
How to know what version of ubuntu you are running
sudo cat /etc/lsb-release
your output should be somethinglike that:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=$version
DISTRIB_CODENAME=$codename
DISTRIB_DESCRIPTION=$description
thats it, peace of cake ha...
Wednesday, March 31, 2010
How to disable the your linux firewall(iptables)
I tried the hg serve command and it worked but only locally on my machine and it didnt work with any of my local network machines, so i found out that my firewall(iptables) is on and a colleague helped me to turn if off, here is the How ?
sudo service iptables stop
sudo iptables -F
sudo service iptables save
thats it, hope it helps
Friday, February 5, 2010
The difference between staticmethod and classmethod in python
So today i will explain the difference between staticmethod and classmethod in python, lets start..
You may have read a couple of python books/tutorials and i think that none of them mentions the difference between the staticemethod and classmethod decorator, even some tutorials says that there is no difference at all !!!
Why would i need to use static/class methods?
Example of static method:
class FactoryClass(object):
@staticmethod
def createObject(objectType):
do some stuff
Wednesday, January 13, 2010
[CES 2010] RCA Airnergy Charger Harvests Electricity From WiFi Signals
well this is very cool stuff...
the idea here is that the device is kind of circuitry that harvests the WiFi energy out of the air and convert it to electricity.
The device(Airnergy) has a small battery in it, so you can just carry it around and as long as there is a WiFi near you, it charges itself.
The great news is the device will be out in the market soon for 40$ !!!
for more info check that blog
Wednesday, January 6, 2010
Google wants to administer the first white spaces database
pretty cool..
Saturday, August 15, 2009
How to decode a URL using python
since i used urllib.urlencode before i was sure that i will find urllib.decode method as well, but i didn't.
Here is the result of my search, to decode a url into dictionary of parameter and its values user the cgi module as the follwoing:
import cgi
import urllib
url = 'http://www.test.com/test?%s'
params = {'param1': 'value1', 'param2': 'value2'}
urlParams = urllib.urlencode(params)
url = url%urlParams
resultParams = dict(cgi.parse_qsl(url))
print result_params
Enjoy
Sunday, July 19, 2009
Notes on REST Architecture
the main characteristics of REST are:
- Distributed Network of interlinked documents
- Client-server architecture
- Stateless Server
- The concept of Resource and Resource Representation
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).