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
#!/usr/bin/env python | |
import sys | |
import pstats | |
input_path = sys.argv[1] | |
output_path = sys.argv[2] | |
fp = open(output_path, "w") | |
s = pstats.Stats(input_path, stream=fp) |
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
# add the following to bin/active script in virtualenv sandbox | |
echo "ARCHFLAGS=${ARCHFLAGS}" | |
export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future |
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
package main | |
import "fmt" | |
func main() { | |
fmt.Printf("Hello World.\n") | |
} | |
/* |
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
void setup() | |
{ | |
pinMode(13, OUTPUT); | |
} | |
void loop() | |
{ | |
digitalWrite(13, HIGH); | |
delay(2000); | |
digitalWrite(13, LOW); |
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
#!/usr/bin/python | |
import os | |
for root, dirs, files in os.walk("."): | |
print "---" | |
print "root=%r" % (root,) | |
print "dirs=%r" % (dirs,) | |
print "files=%r" % (files,) |
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
try: | |
import unittest2 as unittest | |
except ImportError: | |
import unittest # noqa | |
import logging | |
_log = logging.getLogger(__name__) | |
import uuid |
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
/* ** | |
Got this error on OS X 10.6 with "/": {{{ | |
$ ./a.out / | |
Query on: (0x7fff5fbff980) [/] | |
Get realpath: (0x7fff5fbfd620) [/] | |
a.out(348) malloc: *** error for object 0x7fff5fbfd620: pointer being freed was not allocated | |
*** set a breakpoint in malloc_error_break to debug | |
Abort trap | |
}}} |
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> | |
#include <getopt.h> | |
int main(int argc, char *argv[]) | |
{ | |
int enable_dog; | |
int enable_egg; | |
int enable_farm; | |
struct option cmd_long_options[] = { |
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 main(int argc, char *argv[]) | |
{ | |
int i; | |
printf("%d arguments.\n", argc); | |
for(i = 0; i < argc; 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
#!/usr/bin/python | |
""" Parsing timing information of sunrise and sunset from CWB """ | |
import sys | |
import csv | |
import re | |
import pprint | |