Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sztanko
sztanko / luck.md
Last active December 5, 2021 11:10
Role of luck in top selection

This was inspired by the video called "Is Success Luck or Hard Work?" by Veritasium https://www.youtube.com/watch?v=3LopI4YeC4I There he runs simulation of selecting 11 austronauts out of 18,300. If we say there is up to 5% luck contribution in their total score, then how strong the weakest person out of 11 should be?

My simulation shows that the weakest candidate still should be at least in the top 120 candidates, and out of those 11 initially selected 9 got there because of sheer luck.

Here is the code:

from typing import Generator, Tuple
### Keybase proof
I hereby claim:
* I am sztanko on github.
* I am sztanko (https://keybase.io/sztanko) on keybase.
* I have a public key ASDeNs5VvTZ1k6s0-QWbdejOBXP_tNIs9Ao044L7sxnVrgo
To claim this, I am signing this object:
@sztanko
sztanko / getData.js
Last active August 29, 2015 14:05
Script to scrape information Iceland seismic activity website from http://en.vedur.is/earthquakes-and-volcanism/earthquakes/
var http = require('http');
var _ = require('underscore');
var url = "http://en.vedur.is/earthquakes-and-volcanism/earthquakes/";
function process(data)
{
var VI = {};
var l = _.chain(data.split('\n')).filter(function(line) {return line.indexOf('VI.quakeInfo = [')>=0}).first().value();
eval(l);
@sztanko
sztanko / Snakeyaml.java
Last active August 29, 2015 14:03
SnakeYaml problem
import java.util.List;
import java.util.Map;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
public class SnakeTest {
public static class TagMapping {
@sztanko
sztanko / gist:6414090
Last active December 22, 2015 03:59
Compiling CIFReader from Tom Cairns
Chances you will ever need to use https://github.com/swlines/CIFReader are one in million.
If you are working on a transport app and open data, chances are larger.
If you are good with c++ and compiling c++, you probably don't need to read it. Instead, just click here:
http://performance-dynamics.net/wp-content/uploads/2010/10/100-Percent-Genius-Shirt-300x300.jpg
Oh no, don't click, it is not clickable in this gist, so just copy and paste it in your browser address bar. But you probably have figured it out already, since we know you are a genius.
This tutorial potentially can save you one week of work.
# clear out any old ppa's that might conflict
sudo rm /etc/apt/sources.list.d/*mapnik*
sudo rm /etc/apt/sources.list.d/*developmentseed*
sudo rm /etc/apt/sources.list.d/*chris-lea*
# add new ppa's
sudo apt-get install software-properties-common -y
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js-legacy
echo 'yes' | sudo apt-add-repository ppa:mapnik/nightly-trunk
wewewerververververv