Skip to content

Instantly share code, notes, and snippets.

View kratsg's full-sized avatar

Giordon Stark kratsg

View GitHub Profile
{
"00": 52,
"01": 288,
"02": 182,
"03": 125,
"04": 187,
"05": 217,
"06": 320,
"07": 277,
"08": 11,
{
"01": 207,
"010": 311,
"011": 139,
"012": 34,
"013": 263,
"014": 282,
"02": 52,
"03": 447,
"04": 389,
def get_primes(n):
numbers = set(range(n, 1, -1))
primes = []
while numbers:
p = numbers.pop()
primes.append(p)
numbers.difference_update(set(range(p*2, n+1, p)))
return primes
primes = get_primes(500)
@kratsg
kratsg / gist:d311a9f6b8d6a4af1201
Created December 11, 2014 05:35
Decode lights over all possible combinations for hex?
lights = [['g','r'],
['y','d'],
['r','r'],
['b','d'],
['g','r'],
['b','r'],
['y','d'],
['p','d'],
['b','d'],
['r','d'],
This file has been truncated, but you can view the full file.
('0', '1', '2', '3', '4', '3', '4')
43D43
--------------------
0A2C03ADCB3
..............................
('0', '1', '2', '3', '4', '3', '5')
53E53
--------------------
0Q2S03QTSR3
..............................
lights = [['g','r'],
['y','d'],
['r','r'],
['b','d'],
['g','r'],
['b','r'],
['y','d'],
['p','d'],
['b','d'],
['r','d'],
This file has been truncated, but you can view the full file.
('0', '1', '2', '3', '4', '3', '4')
43DD3
--------------------
0A2C03ADDB3
..............................
('0', '1', '2', '3', '4', '3', '5')
53EE3
--------------------
0Q2S03QTTR3
..............................
@kratsg
kratsg / GiordonStark.py
Created January 27, 2015 16:47
test python example
import numpy as np
import matplotlib.pyplot as pl
x = np.random.randn(10000)
y = np.random.randn(10000)+5
pl.figure()
pl.hist2d(x, y, bins=40, cmap=pl.cm.hot_r)
pl.show()
#include <vector>
#include <iostream>
#include <fstream>
#include "TFile.h"
#include "TLine.h"
#include "TEllipse.h"
#include "TGraphErrors.h"
#include "TGaxis.h"
#include "TGraphAsymmErrors.h"
#include "TCanvas.h"
#include <EventLoop/Job.h>
#include <EventLoop/StatusCode.h>
#include <EventLoop/Worker.h>
#include "xAODJet/JetContainer.h"
#include "AthContainers/ConstDataVector.h"
#include <xAODAnaHelpers/ContainerRecording.h>
// this is needed to distribute the algorithm to the workers