This file contains hidden or 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
| ; Press LeftWindows + a to toggle autopressing left mouse button | |
| toggle=0 | |
| LWIN & a:: | |
| if (toggle := !toggle) | |
| SetTimer, timer, -1 | |
| return | |
| timer: | |
| while toggle |
This file contains hidden or 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
| #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)) |
This file contains hidden or 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 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)) | |
This file contains hidden or 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
| #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 |
This file contains hidden or 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
| <!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) { |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| html, | |
| body { | |
| margin: 0; | |
| overflow: hidden; | |
| height: 100%; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| html, | |
| body { | |
| margin: 0; | |
| overflow: hidden; | |
| height: 100%; |
This file contains hidden or 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 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)] |
This file contains hidden or 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
| set smartindent " TODO | |
| set tabstop=4 | |
| set shiftwidth=4 | |
| set expandtab " TODO | |
| set encoding=utf-8 | |
| set completeopt=menuone,longest " TODO | |
| set number " Displays line number | |
| set autochdir | |
| set clipboard=unnamedplus |
This file contains hidden or 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 pynput import keyboard | |
| import pyperclip | |
| current = {"tags":[]} | |
| def on_press(key): | |
| global current | |
| try: k = key.char # single-char keys | |
| except: k = key.name # other keys |
OlderNewer