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
#define Swap(X,Y) do{ __typeof__ (X) _T = X; X = Y; Y = _T; }while(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
/** | |
* A recursive factorial method | |
*/ | |
int factorial(int n) | |
{ | |
if (n == 0) | |
{ | |
return 1; | |
} | |
else |
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
# A recursive factorial method | |
import math | |
def my_factorial1(n): | |
return math.factorial(n) | |
def my_factorial2(n): | |
z = 1 | |
if n > 1: |
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
#include <stdio.h> | |
/* This function assumes the passed pointer points to a valid, zero-terminated string */ | |
void reverse(char *s) | |
{ | |
char *t = s; | |
while (*t != '\0') t++; | |
while (s < t) |
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 reverse(n): | |
return n[::-1] |
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
#include <stdio.h> | |
int bit_count(int n); | |
int main() | |
{ | |
int i, limit = 255; | |
for (i = 0; i <= limit; i++) | |
{ |
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/sh | |
# This is a custom script to check our DNS servers. | |
# This is just a test across a few publicly available DNS points for | |
# latency etc. | |
isp=$(dig +noall +stats 2>&1 | awk '$2~/^SERVER:$/{split($3,dnsip,"#");print dnsip[1]}'); | |
m="-------------------------------------------------------------------------------"; | |
s=" "; |
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
SELECT SUBSTRING(MD5(RAND()) FROM 1 FOR 6) AS `password` |
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
# replace HEAD with your revision number | |
# replace 80 with your char limit | |
git rev-list HEAD |\ | |
xargs -iX sh -c\ | |
"if test \"\$(git show --quiet --pretty=format:%s%n%n%b X | wc -c)\" -lt 80; then echo X; fi" |
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
/* | |
HTTP Host: static.ak.fbcdn.net | |
Generated: April 28th 2010 3:07:47 PM PDT | |
Machine: 10.16.140.106 | |
Locale: nu_ll | |
Path: js/iphone/fb.js | |
*/ | |
if (window.CavalryLogger) { | |
CavalryLogger.start_js(["js\/iphone\/fb.js"]); |