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
label: dos | |
label-id: 0x000e4547 | |
device: /dev/sdb | |
unit: sectors | |
/dev/sdb1 : start= 2048, size= 204800, type=17 | |
/dev/sdb2 : start= 206785, size= 1324167231, type=f | |
/dev/sdb5 : start= 206848, size= 1324167168, type=7 |
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
def gen_primes() -> Iterator[int]: | |
yield 2 | |
n = 3 | |
def is_prime(x: int) -> bool: | |
return all(x % i for i in range(2, int(x ** 0.5) + 1)) |
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
#!/usr/bin/env bash | |
get_local_packages(){ | |
comm -23 <(apt-mark showmanual | sort -u) \ | |
<(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) | |
return 0; | |
} | |
get_latest_diff() { |
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
#!/usr/bin/python3.6 | |
import sh | |
import re | |
from sys import exit | |
from collections import namedtuple | |
from tempfile import mkstemp | |
from os import fdopen, remove | |
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
RET=$(pwd) && cd /opt/geant4/bin && . ./geant4.sh && cd $RET | |
PATH="$HOME/.local/bin:$PATH" | |
export PYTHONPATH="$HOME/GIT/geant4/environments/g4py/lib" | |
# Fix for local users connecting to display | |
xhost +local: | |
# Add texlive | |
PATH=/usr/local/texlive/2017/bin/x86_64-linux:$PATH; export PATH |
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
export JLAB_ROOT=~/jlab | |
export JLAB_VERSION=devel | |
. $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh | |
export PYTHONPATH=$JLAB_ROOT/$JLAB_VERSION/scons_bm/$JLAB_VERSION:$PYTHONPATH | |
# Should we use debug symbols? | |
DEBUG=0 | |
while getopts d option |
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
from collections import deque, namedtuple | |
from time import time | |
from enum import auto, Enum | |
from operator import itemgetter | |
class Trap(Enum): | |
SLEEP = auto() | |
SPAWN = auto() | |
WHOAMI = auto() |
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
from collections import deque, namedtuple, defaultdict | |
from time import time | |
from types import coroutine | |
from enum import auto, Enum | |
from operator import itemgetter | |
def async_contextmanager(func): | |
class ctx: | |
def __init__(self, *args, **kwargs): |
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
<gcard> | |
<!-- Define the materials, and detectors --> | |
<definitions> | |
<material path="scintillator" factory="TEXT"/> | |
<material path="other_materials/" factory="TEXT"/> | |
<material table="scintillator_materials"/> | |
<detector path="basic_detector" factory="TEXT"/> | |
<detector path="basic_cad_detector" factory="CAD"/> | |
<detector path="basic_cad_detectors/" factory="CAD"/> | |
</definitions> |
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
G4MaterialPropertyVector* f_AddProperty(G4MaterialPropertiesTable* table, const char *key, | |
np::ndarray& PhotonEnergies, np::ndarray& PropertyValues) | |
{ | |
if (PhotonEnergies.get_nd() != 1 || PropertyValues.get_nd() != 1) | |
throw std::invalid_argument("Expected single dimension for PhotonEnergies and PropertyValues arrays"); | |
const Py_intptr_t *shape = PhotonEnergies.get_shape(); | |
int n_values = shape[0]; | |
if (PropertyValues.get_shape()[0] != n_values) |