Skip to content

Instantly share code, notes, and snippets.

@jhw
jhw / .KALMAN_DOG.md
Last active October 16, 2019 10:22
Kalman Filter dog example

https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/04-One-Dimensional-Kalman-Filters.ipynb

justin@justin-XPS-13-9360:~/work$ python3 kalman_dog.py 
(1.00000, 401.00000) 1.3535959735108178 (1.35184, 1.99007)
(2.35184, 2.99007) 1.8820653967131618 (2.07035, 1.19841)
(3.07035, 2.19841) 4.341047429453569 (3.73572, 1.04726)
(4.73572, 2.04726) 7.156332673205118 (5.96016, 1.01168)
(6.96016, 2.01168) 6.938695089418526 (6.94940, 1.00291)
(7.94940, 2.00291) 6.843912342028484 (7.39625, 1.00073)
@jhw
jhw / .TEAM_MATCHER.md
Last active October 20, 2019 16:14
Team matcher
justin@justin-XPS-13-9360:~/work$ python team_matcher.py 
matched:
  AFC Bournemouth: Bournemouth
  Arsenal: Arsenal
  Aston Villa: Aston Villa
  Bournemouth: Bournemouth
  Brighton: Brighton
  Brighton & Hove Albion: Brighton
 Burnley: Burnley
@jhw
jhw / .GOALS_GRID.md
Last active October 21, 2019 08:06
Simple goals grid model
justin@justin-XPS-13-9360:~/work$ python3 goals_grid.py 
home_win	0.45395
away_win	0.24608
draw    	0.29997
over_05 	0.86466
under_05	0.13534
over_15 	0.59399
under_15	0.40601
over_25 0.32332
@jhw
jhw / .MAPREDUCE.md
Last active October 21, 2019 09:50
Python mapreduce pattern
justin@justin-XPS-13-9360:~/work$ python3 mapreduce.py 
spawning batch 1
result -> {'x': 2, 'y': 6, 'z': 8}
result -> {'x': 6, 'y': 8, 'z': 14}
spawning batch 2
result -> {'x': 1, 'y': 2, 'z': 3}
result -> {'x': 1, 'y': 2, 'z': 3}

- x: 2
@jhw
jhw / .OPTIONS.md
Last active October 24, 2019 13:30
Options valuation
justin@justin-XPS-13-9360:~/work$ python3 black_scholes.py 
call: 4.75942
put : 0.80860
justin@justin-XPS-13-9360:~/work$ python3 binomial.py 
call: 4.75982
put : 0.80899
justin@justin-XPS-13-9360:~/work$ python3 monte_carlo.py 
call: 4.75913
put : 0.80862
@jhw
jhw / .RUSSKI_NEWS.md
Last active October 24, 2019 14:01
Russian news
justin@justin-XPS-13-9360:~/work/gists/f2765d0e7e8637e020cf90798aa87158$ python3 bbc_links.py 
- img: https://ichef.bbci.co.uk/news/200/cpsprodpb/15473/production/_109355178_hi057516604.jpg
  tags:
  - news
  text: 39 погибших в фуре в английском графстве Эссекс - граждане Китая
  url: https://www.bbc.com/russian/news-50154070
- img: https://ichef.bbci.co.uk/news/200/cpsprodpb/15CB1/production/_109356298_6ef9b12a-d608-49ab-b285-ee8925ead420.jpg
  tags:
  - features
@jhw
jhw / .GSHEETS_DEMO.md
Last active November 26, 2019 15:34
Google Sheets Demo
@jhw
jhw / .BBC_RUSSIAN_API.md
Last active April 6, 2020 07:00
BBC Russian Lambda API

setup

virtualenv
virtualenv -p /usr/bin/python3.6 .
. bin/activate
pip install -U -r requirements.txt
{...}
deactivate
@jhw
jhw / .500_RUSSIAN_NOUNS.md
Last active April 12, 2020 07:55
Parse Master Russian 500 nouns for Quizlet
python nouns_500.py