This file contains 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 urllib2, json, re | |
raw = open("data.txt").read() #[\w\d]{2}:[\w\d]{2}:[\w\d]{2}:[\w\d]{2}:[\w\d]{2} | |
parse = re.compile("\t(.*?)\s((?:[\w\d]{2}:?){6}).*?(-\d+\s*dBm)\s*(-\d+\s*dBm)") | |
kml = open("data.kml", "w") | |
#"signal_strength": 8, "request_address": true, | |
request = '{"version": "1.1.0","host": "maps.google.com","address_language": "en_US", "wifi_towers": [{"mac_address": "%s","age": 0}]}' | |
kmlHead = '<?xml version="1.0" encoding="UTF-8"?>\n<kml xmlns="http://www.opengis.net/kml/2.2">\n<Folder>\n' |
This file contains 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 glob | |
presets = {} | |
preset_list = ["default","fastfirstpass","hq","lossless_fast","lossless_max","lossless_medium","lossless_slow","lossless_slower","lossless_ultrafast","max","normal","slowfirstpass"] | |
for preset_file in preset_list: | |
current = map(lambda x: x.split("="), open(preset_file + ".ffpreset").read().splitlines()) | |
preset_name = preset_file.replace(".ffpreset", "") | |
presets[preset_name] = {} |
This file contains 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 sqlite3, re, math, os | |
con = sqlite3.connect(':memory:') | |
db = con.cursor() | |
contigs = [425,424,3472,7154,6911,7165,6940,4912,421,422,423,7155] | |
# Set filename and open input | |
in_file = open("trimmed.ace", "r") |
This file contains 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 <iostream> | |
#include <math.h> | |
using namespace std; | |
// declare functions | |
int prime(int n); | |
int main() { | |
int n1; | |
int i; | |
bool isprime; |
This file contains 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 quarter((x0, y0, x1, y1)): | |
quadrants = [] | |
# Define the width and height as half the width and height of the given box | |
width = (max(x0,x1) - min(x0,x1)) / 2.0 | |
height = (max(y0,y1) - min(y0,y1)) / 2.0 | |
# Starting with the bottom left corner | |
x = min(x0,x1) | |
# Go through all 4 combinations of adding width and height to x and y |
This file contains 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
/* LOGISTIC EQUATION */ | |
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
FILE *fp; | |
int i; | |
int k; |
This file contains 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 <iostream> | |
#include <math.h> | |
using namespace std; | |
int main(void) { | |
FILE * fp5; | |
int Max(11); | |
double V[20000]; | |
double diff(1.0); |
This file contains 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 glob, os, urllib2, re | |
from xml.etree import ElementTree | |
# Input: Takes in "S##E##.avi" or "S##E##.mkv" | |
# Output: Renames to "S##E## - [Episode title].avi" (or mkv) | |
# Search: http://services.tvrage.com/feeds/search.php?show=Mythbusters for sid | |
show_id = 4605 | |
# Get episode list from tvrage.com for the selected show |
This file contains 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 gobject | |
import matplotlib | |
matplotlib.use('GTKAgg') | |
import matplotlib.pyplot as plt | |
current_pos = 0 | |
temps = [] | |
pad = 5.0 |
This file contains 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 random | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.mlab as mlab | |
from math import sqrt | |
def magnitude(x, y, z): | |
return sqrt(x**2 + y**2 + z**2) | |
for k in xrange(1,3): |