This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connect the distance sensor | |
#define trigPin 13 | |
#define echoPin 12 | |
// connect motor controller pins to Arduino digital pins | |
// motor one | |
int enA = 3; | |
int in1 = 4; | |
int in2 = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function join { local IFS="$1"; shift; echo "$*"; } | |
IFS=$'\n' | |
LIMIT=20 | |
STATS=$(netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | grep -v Address | grep -v servers) | |
BLACKLISTED="" | |
BLACKLISTED_IPS=() | |
EMAIL="[email protected]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
class API : | |
ERROR = -1 | |
OK = 0 | |
class APIResponse(API) : | |
def __init__(self, code, data) : | |
self.code = code | |
self.data = data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Django==1.4 | |
South==0.7.6 | |
django-dbsettings==0.2 | |
django-grappelli==2.3.8 | |
pyechonest==4.2.21 | |
simplejson==2.6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
def latex_decode( s ) : | |
''' | |
A simple function which taks a latex escaping command | |
and returns the appropriate unicode character according | |
to this table (via wikipedia): | |
LaTeX command Sample Description | |
\`{o} ò grave accent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
convert a number (given in string format) from a base f to base t | |
''' | |
import string | |
def convertbase( n, f, t ) : | |
digits = list(string.digits+string.uppercase) | |
rev_digits = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def intersection( *A ) : | |
res = [] | |
while True : | |
# check if the heads are the same | |
all_same = True | |
for i in range(1, len(A)) : | |
if len(A[i]) > 0 and len(A[i-1]) > 0 and A[i-1][0] == A[i][0] : | |
pass | |
else : | |
all_same = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node : | |
def __init__( self, data ) : | |
self.data = data | |
self.next = None | |
self.prev = None | |
class LinkedList : | |
def __init__( self ) : | |
self.head = None |