Skip to content

Instantly share code, notes, and snippets.

View samwhitehall's full-sized avatar

Sam Whitehall samwhitehall

View GitHub Profile

Keybase proof

I hereby claim:

  • I am samwhitehall on github.
  • I am samwhitehall (https://keybase.io/samwhitehall) on keybase.
  • I have a public key ASDiTJCeykzDWy5K0TAFpn3y0rOsZEhXg-tjPSNkhbNyego

To claim this, I am signing this object:

@samwhitehall
samwhitehall / apple-keyboard-ubuntu.md
Last active September 14, 2019 20:28
Apple Keyboard on Ubuntu 16.04
  1. use English (UK, Macintosh) as the base keyboard layout

  2. https://help.ubuntu.com/community/AppleKeyboard#Ubuntu_11.10_up_to_recent (steps 1,2,3) to fix wrong keys (§± and `~)

  3. dconf-editor org.gnome.desktop.input-sources.xkb-options ~> ['lv3:lalt_switch', 'lv3:ralt_alt']

  4. compizconfig-settings-manager (ccsm)

        desktop > ubuntu unity plugin > general > key to show the menu bar:     
@samwhitehall
samwhitehall / .vimrc
Created December 16, 2014 15:17
.vimrc
" Pathogen (package manager)
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
syntax on
" dark colour scheme
nathan (master *) Enigma $ nosetests
EE
======================================================================
ERROR: tests.Rotor_Test.TestRotor.test_check_letter_substitution_matches_expected_value
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/nathan/Code/Enigma/tests/Rotor_Test.py", line 18, in test_check_letter_substitution_matches_expected_value
assert self.rotor.get_letter_substitution('a') == 'b'
@samwhitehall
samwhitehall / .vimrc
Created October 30, 2014 21:09
vimrc
"" ALL THE REST
set history=100
syntax on
set number
set title
set wildmenu
set wildmode=list:longest
set ignorecase
set smartcase
set encoding=utf-8
@samwhitehall
samwhitehall / pringle.py
Last active October 26, 2016 13:27
Pringle Stack
class PringleStack:
def __init__(self):
self.stack = []
def push(self, obj):
self.stack.append(obj)
def pop(self):
while len(self.stack) > 0:
yield self.stack.pop()
@samwhitehall
samwhitehall / glasso.m
Created September 3, 2013 11:23
graphical lasso (w/shooting algorithm) in Matlab
function [Theta] = glasso(S,rho)
[n,p] = size(S);
max_iterations = 100;
t = 1e-4;
convergence_value = t * meanabs(S - diag(diag(S)));
% initialise
W_old = S + rho*eye(p);
W = W_old;
set ai
set history=100
syntax on
set number
set title
set wildmenu
set wildmode=list:longest
set ignorecase
set smartcase
set encoding=utf-8
@samwhitehall
samwhitehall / unit_test.gunit
Created April 20, 2012 15:27
Niklaus Test Script
This file has been truncated, but you can view the full file.
gunit Niklaus;
prog:
/* test1 (_FAIL_0.txt */
<<
/*Expecting: ( Given: STRLIT*/
MODULE a ; CONST a : COUNT := a "" ) BEGIN END ;
>> FAIL
@samwhitehall
samwhitehall / TestScriptGenerator.java
Created April 19, 2012 14:29
Test Case Convertor
package tests;
import java.io.*;
public class TestScriptGenerator {
public int testCount = 0;
public FileWriter currentTestScript;
public static void main(String[] args) {
TestScriptGenerator tester = new TestScriptGenerator();