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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import codecs | |
from collections import Counter | |
class Card: | |
def __init__(self, data): | |
self.idnr= data[0].strip("\n") | |
self.category = data[1].strip("\n") | |
self.star = data[2].strip("\n") | |
self.name = data[3].strip("\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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import codecs | |
from collections import Counter | |
class Card: | |
def __init__(self, data): | |
self.idnr= data[0].strip("\n") | |
self.category = data[1].strip("\n") | |
self.star = data[2].strip("\n") | |
self.name = data[3].strip("\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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import sys, urllib2, urllib | |
from bs4 import BeautifulSoup | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print "Called with './explainregex therege(x)?'" | |
else: | |
page = urllib2.urlopen('http://rick.measham.id.au/paste/explain.pl?regex='+ urllib.quote(sys.argv[1])) |
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 codecs | |
class Card: | |
def __init__(self, data): | |
self.idnr= data[0].strip("\n") | |
self.category = data[1].strip("\n") | |
self.star = data[2].strip("\n") | |
self.name = data[3].strip("\n") | |
self.questions = list() | |
self.addQuestion(data[4].strip("\n"), data[5].strip("\n"), data[6].strip("\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 <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
LSSharedFileListRef recentDocsList = LSSharedFileListCreate(NULL, kLSSharedFileListRecentDocumentItems, NULL); | |
LSSharedFileListRemoveAllItems(recentDocsList); | |
NSLog(@"Cleared files!"); |
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
package probability | |
import scala.math | |
/*** | |
* Calculates the probability of a distribution of multidimensional stocastic variables (binominal distrubution). | |
* | |
* param n: number of events | |
* param probabilityList: Array of the probabilites of the different event | |
* param occurance: Array of number of occurances we want to know the probability of | |
* | |
* called with i.e. multidimensionalBinProb(12, Array(0.5, 0.5), Array(6,6)) |
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 scala.util.Random | |
import scala.Math.min | |
import scala.runtime.ScalaRunTime._ | |
class MergeSort(list: Array[Int]) { | |
def sort(): Array[Int] = { | |
reqSort(list) | |
} | |
def merge(v1: Array[Int], v2: Array[Int]): Array[Int] = { |
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
% | |
% | |
% Created by christopher on 2012-05-11. | |
% Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
% | |
\documentclass[]{article} | |
% Use utf-8 encoding for foreign characters | |
\usepackage[utf8]{inputenc} |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Kallas med: | |
cat bRPM_data/Yes/brpm_yes_11_1.in | python Main.py | |
""" | |
import sys |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
from random import random | |
from heapq import heappush, nsmallest, nlargest | |
import time, sys | |
from sets import Set | |
def rotl32(a, b): | |
return (((a << (b & 0x1f)) & 0xffffffff) | | |
((a >> (32 - (b & 0x1f))) & 0xffffffff)) |