Skip to content

Instantly share code, notes, and snippets.

class Paths(object):
def __init__(self, E, N):
self.N = N
self.E = E
self.start = 0
self.end = N-1
self.count = 0
self.colors = [0 for x in xrange(N)]
self.cycles = [0 for x in xrange(N)]
self.values = [0 for x in xrange(N)]
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html,
body {
margin: 0;
overflow: hidden;
height: 100%;
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html,
body {
margin: 0;
overflow: hidden;
height: 100%;
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/paper.js"></script>
<script type="text/javascript">
//plane flying behind the mouse pointer
paper.install(window);
function lerp(v0, v1, t) {
#wczytuje plik i dzieli go na liste stringów, gdzie każdy element to jeden wiersz
file_lines = open("ścieżka do pliku").read().split('\n')
#dzieli każdy wiersz na 3 kolumny po tabulatorze. [1:] - to oznacza że ma ominiąć pierwszą linię, bo w niej jest nagłówek
score_lines = map(lambda x:tuple(x.split('\t')), file_lines)
#słownik (struktura danych) w której będziemy trzymać punkty graczy
players_scores = {}
for player_id, player_avg, player_score in score_lines: #dla każdej lini
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from scipy.special import binom
def bernoulli(p, n, k):
return binom(n, k) * (p ** k) * ((1.0 - p) ** (n - k))
#Not mine code, but a very good example that helped me understand Logistic Regression
#Found it here: http://stackoverflow.com/questions/25880634/logistic-regression-objects-are-not-aligned
import numpy as np
from scipy.optimize import fmin_bfgs
import io
data = np.loadtxt('ex2data1.txt',delimiter=",")
m,n = data.shape
X = np.array(np.column_stack((np.ones(m),data[:,:-1])))
y = np.array(data[:,2].reshape(m,1))
@heolin
heolin / AutoClicker
Created November 7, 2015 22:24
Press LeftWindows + a to toggle autopressing left mouse button
; Press LeftWindows + a to toggle autopressing left mouse button
toggle=0
LWIN & a::
if (toggle := !toggle)
SetTimer, timer, -1
return
timer:
while toggle