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/python | |
from pwn import * | |
if __name__ == '__main__': | |
# context.binary = "precision" # name of binary | |
host = "54.210.15.77" # host ip | |
port = 1259 | |
connection = remote(host, port) # expose connection to service | |
context.bits = 32 # since we're working with a 32-bit binary | |
response = connection.recvline() |
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
(defclass Noeud [object] | |
;; Node class for representing outcomes | |
[[--init-- (fn [self] | |
(setv self.acheter None) ; edge to buy node | |
(setv self.rester None) ; edge to stay node | |
(setv self.solde 0) ; balance at current node | |
(setv self.machine None) ; each node has a machine associated, except first node | |
(setv self.jour None) ; init node object attrs | |
None)] | |
[--str-- (fn [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
import sys | |
sys.path.append('../../' ) | |
from core.vector import Vector | |
from util.matrixutil import rowdict2matrix | |
def read_training_data(fname, D=None): | |
"""Given a file in appropriate format, and given a set D of features, | |
returns the pair (A, b) consisting of | |
a P-by-D matrix A and a P-Vector b, | |
where P is a set of patient identification integers (IDs). |
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
""" | |
Analyzing voting data using SLAL | |
""" | |
# from Vector import Vector | |
from Vector import list2vector | |
US_file = open('US_Senate_voting_data_109.txt') | |
UN_file = open('UN_voting_data.txt') | |
US_voting_data = [] | |
UN_voting_data = [] |
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/python3 | |
from core.vector import Vector | |
from core.GF2 import one, zero | |
from util.factoring_util import dumb_factor, intsqrt, primes, prod | |
def int2GF2(integer): | |
""" Convert integer to a binary one or zero. | |
0 if int is even else 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
#!/usr/bin/python | |
import numpy as np | |
from sklearn.dataset import load_files | |
def split_neg_pos_docs(data): | |
""" | |
Splits the dataset into negative and negative sets. | |
""" | |
negative_documents = b' '.join([ data.data[i] for i in range(len(data.data)) if data.target[i] == 0 ]) | |
positive_documents = b' '.join([ data.data[i] for i in range(len(data.data)) if data.target[i] == 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
#!/usr/bin/python | |
""" | |
Simple Sentiment Analyzer over the Cornell Moview Review Dataset | |
""" | |
import string | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from random import randint | |
# nltk has some tools that might be useful... | |
from nltk.corpus import stopwords |
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 time import time | |
from sklearn.datasets import load_files | |
from sklearn.cross_validation import train_test_split | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.cluster import KMeans | |
from sklearn import metrics | |
def bench_k_means(estimator, name, data, labels): | |
t0 = time() | |
sample_size = len(data) |
NewerOlder