I hereby claim:
- I am peter-jung on github.
- I am pjung (https://keybase.io/pjung) on keybase.
- I have a public key whose fingerprint is B7C0 77CB 9C5A B947 4371 E77A 2EFB F090 9E22 0423
To claim this, I am signing this object:
| /* | |
| * 1:1 Lichttunnel | |
| * Kuzmin 2017 | |
| * code für Arduino Mega 2560 | |
| * Anschlüsse wie in https://youtu.be/xOhIc03cWW4 | |
| * Peter Jung (2017) | |
| * 2017-10-18 | |
| */ |
| bpm = 200 # Beats Per Minute (BPM) = Schläge pro Minute | |
| bptakt = 4 # | |
| base = :a4 | |
| sc = scale(base, :aeolian) | |
| takt_duration = 60.0/bpm*bptakt | |
| haenschenklein = [ | |
| [ [5,1], [3,1], [3,2] ], | |
| [ [4,1], [2,1], [2,2] ], | |
| [ [1,1], [2,1], [3,1], [4,1] ], |
| sstr = ''' | |
| 71 4 | |
| 6 8 | |
| 3 4 16 | |
| 6 1 | |
| 3 8 | |
| 1 7 2 | |
| 8 9 | |
| 53 4 2 | |
| 4 1 9 ''' |
| ''' | |
| check your intuition: when x is evenly distributed around 0, and x^2 are totally uncorrelated | |
| ''' | |
| import pandas as pd | |
| import numpy as np | |
| x = np.random.normal(0,1,1000) | |
| y = x**2 |
| # leveldb json store | |
| import leveldb | |
| import struct | |
| def i2s(i): | |
| res = '' | |
| while i > 255: | |
| res += chr(i % 256) | |
| i = i >> 8 |
| ''' | |
| https://en.wikipedia.org/wiki/Knapsack_problem | |
| ''' | |
| v = [1,2,3,2,10] | |
| w = [2,5,7,8,15] | |
| W = 22 | |
| n = len(v) | |
| m = [[0 for _ in range(W+1)] for _ in range(n)] | |
| for i in range(n): |
| # DawkinsWeasel.py | |
| import random | |
| chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .,-' | |
| target = 'The aim is to demonstrate that the process that drives evolutionary systems, random variation combined with non-random cumulative selection, is different from pure chance.' | |
| print len(chars), len(target) | |
| #b | |
| def randchar(): |
| import subprocess, sys | |
| applescript=''' | |
| tell application "System Events" | |
| set processName to name of processes whose frontmost is true | |
| do shell script "echo " & processName | |
| end tell | |
| ''' | |
| args = [item for x in [("-e",l.strip()) for l in applescript.split('\n') if l.strip() != ''] for item in x] | |
| proc = subprocess.Popen(["osascript"] + args ,stdout=subprocess.PIPE ) | |
| progname = proc.stdout.read().strip() |
| ''' | |
| calculate annuities | |
| ''' | |
| ''' | |
| annuities kernel | |
| s: total amount | |
| r: nominal annual rate | |
| t: duration/years |
I hereby claim:
To claim this, I am signing this object: