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
from random import randint | |
class Game: | |
def __init__(self): | |
self.correct = randint(0,2) | |
def make_guess(self, door): | |
self.guess = door | |
def verify(self): |
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
#!/bin/sh | |
# Before use: | |
# * Put line seperated wordlist in file 'wordlist' | |
# * Change device /dev/sdX to the drive/file you want to brute force | |
# Call with 'sudo tc-brute.sh < wordlist'. | |
while read line | |
do | |
if truecrypt -t -k "" --protect-hidden=no --non-interactive /dev/sdX -p $line |
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
class LinkedList(startNode:Node) { | |
var lastNode = startNode | |
def printList() = { | |
startNode.print() | |
} | |
def addNode(node:Node) = { | |
this.lastNode.next = Some(node) | |
node.last = Some(lastNode) | |
this.lastNode = node |
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
""" To run first | |
touch old_url.txt | |
touch data.txt | |
requires requests and feedparser (available through pip) | |
""" | |
import requests | |
import feedparser | |
rss = 'http://www.dn.se/nyheter/m/rss/senaste-nytt' | |
old_urls_file = 'old_url.txt' | |
data_file = 'data.txt' |
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 networkx as nx | |
from time import time | |
import random | |
""" | |
Lab 1 EDAN55 | |
Max cut: State-flipping algorithm | |
https://github.com/thorehusfeldt/Maxcut-Lab | |
""" |
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 networkx as nx | |
import sys, random | |
def parse(file): | |
f = open(file, 'r') | |
G = nx.DiGraph() | |
first = True | |
for row in f: |
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 numpy as np | |
import sys | |
def parse(path): | |
f = open(path, 'r') | |
lines = f.readlines() | |
#init empty |
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)) |
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
% | |
% | |
% 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} |