Skip to content

Instantly share code, notes, and snippets.

View charlienewey's full-sized avatar

Charles Newey charlienewey

View GitHub Profile
@charlienewey
charlienewey / monty.py
Last active November 14, 2018 11:37
Monty Hall simulation in Python
import random
class Door(object):
def __init__(self, has_car):
self.has_car = has_car
self.selected = False
class Game(object):
def __init__(self):
@charlienewey
charlienewey / standard_response_to_mac_bashing.md
Created February 18, 2015 11:26
Standard Response to People Bashing OS X

I'm not an Apple evangelist - I use a lot of different operating systems (FreeBSD, Arch Linux, Ubuntu, OS X, etc) at home and at work - I just happen to use OS X sometimes (and like it).

OS X is actually a pretty good operating system (the only major caveat to this being the filesystem, which is pants):

  • The underlying OS is essentially a fork of BSD/NeXTStep - BSD is (very) well known for being stable, fast, and memory-efficient. OS X has absorbed many of these traits
  • The last few versions of OS X are Unix certified - and because Darwin is based on BSD, it's also POSIX compliant... which means it's pretty much the same to use as on the command-line many other Unix systems
  • The OS will run most software you throw at it - certainly most things that on a Linux machine with the help of brew or port. I've never had any significant problems, and I've been using my laptop for software development for several years. OS X is also very
@charlienewey
charlienewey / posterior_surface.m
Created November 5, 2016 17:39
Plotting a multivariate Bayesian prior probability
% Q11: Compute and plot a 3-d graph of the posterior probability of one cls
figure;
xs = -5:0.2:5;
[X1, X2] = meshgrid(xs, xs);
% My method
%numerator = ((1/2) * mvnpdf([X1(:), X2(:)], m2', C));
%denominator = ((1/2) * mvnpdf([X1(:), X2(:)], m1', C)) + ((1/2) * mvnpdf([X1(:), X2(:)], m2', C));
%p_wj = numerator ./ denominator;
%p_wj = reshape(p_wj, length(xs), length(xs));
@charlienewey
charlienewey / Exploratory+Analysis.ipynb
Created February 12, 2017 19:56
Exploratory analysis on a dataset of job adverts
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charlienewey
charlienewey / keybase.md
Last active August 1, 2017 16:51
Keybase verification

Keybase proof

I hereby claim:

  • I am charlienewey on github.
  • I am cn_ (https://keybase.io/cn_) on keybase.
  • I have a public key ASAxWKkg_qSGU5Y90rHM8Mb8agyt2d8yVE6bW-3FWpFDnQo

To claim this, I am signing this object:

type stop|Southampton|0 stop|Neweys|58 stop|Rousharps|95 stop|Rougets|110
C 2017-12-22 16:00 2017-12-22 17:30 - -
S 2017-12-23 18:45 - 2017-12-23 20:45 -
C - 2017-12-23 19:20 2017-12-23 20:00 -
C - - 2017-12-24 14:15 2017-12-24 14:25
S - - 2017-12-24 15:00 2017-12-24 15:10
C - - 2017-12-24 22:00 2017-12-24 21:50
S - 2017-12-24 22:45 2017-12-24 22:35
C - 2017-12-25 10:00 2017-12-25 08:45 -
S - 2017-12-25 16:00 2017-12-25 15:00 -
@charlienewey
charlienewey / GradientBoosting.ipynb
Created December 14, 2018 17:56
Rudimentary gradient boosting implementation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charlienewey
charlienewey / logid.cfg
Created January 29, 2024 09:45
/etc/logid.cfg
timeout = 10000;
devices: ({
name: "MX Master 3S";
smartshift: {
on: true;
threshold: 15;
torque: 50;
};