Skip to content

Instantly share code, notes, and snippets.

View samposm's full-sized avatar

Sampo Smolander samposm

View GitHub Profile
@samposm
samposm / gist:82f3825023e3dbbc1542
Last active March 30, 2016 08:35
screen-ongelmat melkillä
Nyt kun tunnuksilla tunnus ja tunnus@cs pääsee eri kotihakemistoihin, screen
ilmeisesti saa käyttöjärjestelmältä vähän satunnaisesti jomman kumman
vastaukseksi kun se kysyy käyttäjätunnusta.
Yksi mahdollisuus on takoa
screen -rd
There is no screen to be detached.
kunnes ehkä tärppää. Ilmeisesti satunnaisuus ei kuitenkaan ole kolikonheiton
#!/usr/bin/python
# ref. discussion in: https://news.ycombinator.com/item?id=4285531
import random
import math
max1, max2, iterations = 999, 255, 1000
pi_approx = 355/113. - math.pi
fracs1 = sum([[i/float(n) for i in range(n+1)] for n in range(1,max1+1)], [])
fracs2 = sum([[i/float(n) for i in range(n+1)] for n in range(1,max2+1)], [])