I hereby claim:
- I am andreagrandi on github.
- I am andreagrandi (https://keybase.io/andreagrandi) on keybase.
- I have a public key whose fingerprint is 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC
To claim this, I am signing this object:
# Define a lambda function that takes a number and double it | |
d = lambda x: x * 2 | |
# Create a list containing: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
l1 = [x for x in xrange(10)] | |
# Method #1 using map(...) | |
# output: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] | |
print map(d, l1) |
2kpeople.co.uk | |
3aaa.co.uk | |
24-7recruitment.net | |
199rec.co.uk | |
365rec.com | |
aatomrecruitment.com | |
abrs.com | |
agendarecruitment.co.uk | |
andiamo-group.com | |
applauseit.co.uk |
def memoize(function): | |
cache = {} | |
def decorated_function(*args): | |
if args in cache: | |
return cache[args] | |
else: | |
val = function(*args) | |
cache[args] = val | |
return val | |
return decorated_function |
def is_list_circular(l): | |
slower = l | |
faster = l.get_next() | |
while True: | |
# if faster pointer finds a None element | |
# then the list is not circular | |
if (faster is None) or (faster.get_next() is None): | |
return False | |
# if faster element catch up with the slower |
n = 'MCMXCVII' # 1997 | |
def roman_to_decimal(n): | |
roman_map = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1} | |
result = 0 | |
for i,c in enumerate(n): | |
num = roman_map[c] | |
if result == 0: |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
keepalive_host='192.168.0.1' | |
ping -q -c1 $keepalive_host >> /dev/null | |
if [ "$?" -ne "0" ]; then | |
echo "`date` WIFI DOWN" >> wifi_log.txt | |
ifdown wlan0 | |
rmmod 8192cu | |
modprobe 8192cu | |
ifup wlan0 |
keepalive_host='120.0.0.1' | |
ping -q -c1 $keepalive_host >> /dev/null | |
if [ "$?" -ne "0" ]; then | |
echo "Cannot ping!" | |
else | |
echo "PING!" | |
fi |
myhostname = andreagrandi.it | |
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | |
biff = no | |
# appending .domain is the MUA's job. | |
append_dot_mydomain = no | |
# Uncomment the next line to generate "delayed mail" warnings | |
#delay_warning_time = 4h |