This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you'll need to: | |
# sudo pip install python-dateutil | |
# sudo pip install pytz | |
# | |
# to run this | |
import petl as etl | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Color32 = UnityEngine.Color32; | |
namespace KSPPP | |
{ | |
public class Palette | |
{ | |
public string name; | |
public int minSize; | |
public int maxSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text.RegularExpressions; | |
using Color32 = UnityEngine.Color32; | |
using System.Collections.Generic; | |
using System.Linq; | |
using KSPPP; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Func<int,int,Array> OffsetArray = (size,start) => Array.CreateInstance(typeof(string), new[] { size }, new[] { start }); | |
static Func<int,int,string[]> OffsetArrayString = (size,start) => (string[]) Array.CreateInstance(typeof(string), new[] { size }, new[] { start }); | |
public static void Main () | |
{ | |
Array a = OffsetArray(24,1990); | |
a.SetValue("I was born", 1990); | |
a.SetValue("I dislocated my shoulder", 1996); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
import Control.Monad.Fix (fix) | |
class ArithA eX (f :: * -> *) where | |
lit :: Int -> eX f Int | |
(-+-) :: eX f Int -> eX f Int -> eX f Int | |
class BindA eX (f :: * -> *) where | |
var :: f t -> eX f t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g = undefined -- group Ru | |
|| g = [ 2^14 , [3^3 , 5^3] , [ 7 , 13 , 29 ] ] | |
exp g = [ 2^4 , [] , [3 , 5 , 7 , 13 , 29 ] ] | |
01 -> () | |
02 -> a, b | |
03 -> a | |
04 -> a, b, c, d | |
05 -> a, b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infixl 8 ^. | |
infixr 4 %= | |
infixr 4 ^= | |
x ^. l = got (l Getting x) | |
l %= f = unsetting . l (Setting . f) | |
l ^= x = l %= const x | |
type Lens a b = forall f. Functor f => (b -> f b) -> a -> f a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The situation Dirac faced was (and we are still) faced with is this: | |
psi = c_lower ((> 0) energy) + c_lower ((< 0) energy) | |
psiT = c_raise ((> 0) energy) + c_raise ((< 0) energy) | |
c_lower = undefined -- a fermion annihilation operator | |
c_raise = undefined -- a fermion creation operator | |
-- | |
-- and I have deliberately avoided using pluses and minuses | |
-- except where we we are actually summing over all possible states |