Skip to content

Instantly share code, notes, and snippets.

View torincb's full-sized avatar

Torin Cooper-Bennun torincb

View GitHub Profile
@torincb
torincb / RunEve.C
Created January 29, 2020 16:56
RunEve.C
{
TGeoManager::Import("geometry.gdml");
TFile *_file0 = TFile::Open("geometry.root", "RECREATE");
gGeoManager->Write();
_file0->Close();
TEveManager::Create();
gGeoManager = gEve->GetGeometry("geometry.root");
TGeoNode* world = gGeoManager->GetTopNode();
@torincb
torincb / getBoundProcStatStr.c
Created January 21, 2020 16:40
getBoundProcStatStr()
G4String getBoundProcStatStr(G4OpBoundaryProcessStatus stat) {
static G4String statStrs[] = {
"Undefined", "Transmission", "FresnelRefraction", "FresnelReflection",
"TotalInternalReflection", "LambertianReflection", "LobeReflection",
"SpikeReflection", "BackScattering", "Absorption", "Detection",
"NotAtBoundary", "SameMaterial", "StepTooSmall", "NoRINDEX",
"PolishedLumirrorAirReflection", "PolishedLumirrorGlueReflection",
"PolishedAirReflection", "PolishedTeflonAirReflection",
"PolishedTiOAirReflection", "PolishedTyvekAirReflection",
"PolishedVM2000AirReflection", "PolishedVM2000GlueReflection",
" graphics
set guifont=Monospace\ 9
set background=dark
colo solarized
set lines=36 columns=83
" graphics
syntax enable
" indentation
filetype plugin indent on
set expandtab
set shiftwidth=4
set softtabstop=4
" misc
#!/usr/bin/python3
# Copyright (C) 2017 Torin Cooper-Bennun
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-10, 10, 10000)
ys = []
for S in np.arange(0.5, 1000):
ys.append((np.log(np.sinh(x * (S + 0.5)) / np.sinh(x / 2)), S))
fig = plt.figure()
/*
DWTFYWWI LICENSE
Version 1, January 2006
Copyright (C) 2006 Ævar Arnfjörð Bjarmason
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the DWTFYWWI or Do
# A horrible and hastily-written solution to Problem 54 on Project Euler.
import time
HIGH_CARD = 0
ONE_PAIR = 1
TWO_PAIRS = 2
THREE_OF_A_KIND = 3
STRAIGHT = 4
FLUSH = 5
// This code is licensed under the
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, version 2:
// http://www.wtfpl.net/txt/copying/
// Everybody thinks that the Program Manager died with Windows 3.1.
// They may not be entirely correct.
// The program below searches the titles of all open windows for the string
// "program manager". You may well discover that something is found...
//
// This code is fully C++03 compliant and may be compiled with MinGW GCC