This file contains hidden or 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
import timeit | |
import os | |
DB_PATH = 'database.db' | |
# Number of runs to generate | |
NRUNS = int(1e6) | |
insert_setup = """import sqlite3 | |
con = sqlite3.connect('{0}') | |
con.execute('CREATE TABLE runs (run INTEGER PRIMARY KEY)') |
This file contains hidden or 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
import sqlite3 | |
import random | |
# Create the database | |
con = sqlite3.connect('/path/to/database.db') | |
con.execute('CREATE TABLE runs (run INTEGER PRIMARY KEY)') | |
# Insert many runs... | |
runs = range(int(1e3)) | |
random.shuffle(runs) |
This file contains hidden or 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
import numpy as np | |
from matplotlib import pyplot as plt | |
fig = plt.figure(figsize=(5, 4)) | |
# Generate some data | |
mu, sigma = 1e7, 1e6 | |
s = np.random.normal(mu, sigma, 10000) | |
# Plot it | |
plt.hist(s, 30, histtype='step') | |
# Format it |
This file contains hidden or 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
#include "iostream" | |
#include "map" | |
#include "TString.h" | |
int main(int argc, char const *argv[]) | |
{ | |
std::map<int, TString>myMap { | |
{2, "Hello"}, | |
{4, "There"}, | |
{8, "Stranger"}, |
This file contains hidden or 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
#!/bin/bash | |
function bail { | |
echo You did not enter a valid ROOT class $1 | |
exit 1 | |
} | |
if [ -n "$1" ]; then | |
if [ `expr match $1 T` == 1 ]; then | |
status_code=`curl -o /dev/null -sIw "%{http_code}" http://root.cern.ch/root/html/$1.html` |
NewerOlder