Skip to content

Instantly share code, notes, and snippets.

@veprbl
veprbl / condormon.py
Last active March 21, 2016 23:05
Online status pages for monitoring htcondor jobs
#!/usr/bin/python2
import time
import math
import threading
import htcondor
coll = htcondor.Collector("condor02.rcf.bnl.gov:9664")
schedd_list = coll.locateAll(htcondor.DaemonTypes.Schedd)
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#define VME_A32 0x4
#define VME_D32 0x4
#define VME_USER 0x2000
VME_A16 = 0x1
VME_A24 = 0x2
VME_A32 = 0x4
VME_A64 = 0x8
VME_CRCSR = 0x10
VME_SUPER = 0x1000
VME_USER = 0x2000
VME_PROG = 0x4000
VME_DATA = 0x8000
VME_SCT = 0x1
diff -rupN nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h
--- nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h 2010-05-11 11:06:00.000000000 -0400
+++ nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h 2014-08-23 03:22:51.000000000 -0400
@@ -26,8 +26,11 @@
namespace nlo {
// Spacializations
+ template<>
class lorentzvector<std::complex<float> >;
+ template<>
@veprbl
veprbl / topdrawer_OSX_fix.patch
Last active August 29, 2015 14:14
Topdrawer OSX compilation fix
diff --git a/Imakefile b/Imakefile
index 8c61951..6e0f945 100644
--- a/Imakefile
+++ b/Imakefile
@@ -18,7 +18,7 @@ AllTarget($(PROGRAM))
$(PROGRAM)::
$(FC) $(LDOPT) -o $(PROGRAM) src/td.o td.a misc.a \
- $(UGS) $(LDPRELIB) $(XTOOLLIB) $(XLIB)
+ $(UGS) $(LDPRELIB) $(XTOOLLIB) $(XLIB) -L/opt/X11/lib
diff --git a/Makefile.in b/Makefile.in
index 7f18f5c..6d9b237 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -876,10 +876,6 @@ slow:
install-data-local:
mkdir -p $(pkgdatadir)
-@HAS_SVNVERSION_TRUE@ if ! test `svnversion $(srcdir)` = "exported" ; then\
-@HAS_SVNVERSION_TRUE@ svnversion $(srcdir) > $(pkgdatadir)/svnversion ;\
@veprbl
veprbl / rel_asym_err.py
Created December 18, 2014 02:10
Divide two variables with asymmetric uncertainties
import scipy.optimize
def mlnL_Barlow(x, x_mean, sigma_p, sigma_n):
# from arXiv:physics/0406120
return 0.5 * ((x - x_mean)**2) / (sigma_p * sigma_n + (sigma_p - sigma_n) * (x - x_mean))
assert mlnL_Barlow(7+5, 7, 5, 3) == 0.5
assert mlnL_Barlow(7-3, 7, 5, 3) == 0.5
#!/bin/sh
wget http://fastnlo.hepforge.org/code/other/nlojet++-4.1.3-patched.tar.gz
wget http://fastnlo.hepforge.org/code/other/fastjet-3.0.6.tar.gz
wget http://fastnlo.hepforge.org/code/other/qcdnum-17.00.06-patched.tar.gz
wget http://fastnlo.hepforge.org/code/other/lhapdf-5.9.1.tar.gz
wget http://fastnlo.hepforge.org/code/v23/fastnlo_toolkit-2.3.1pre-1871.tar.gz
wget http://fastnlo.hepforge.org/code/v23/fastnlo_interface_nlojet-2.3.1pre-1855.tar.gz
for i in *.tar.gz; do
@veprbl
veprbl / foils-install.sh
Created November 4, 2014 07:21
Foils is a nice alternative to the beamer latex package
#!/bin/sh
cd /tmp
wget http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx
wget http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins
latex foiltex.ins
PREFIX=~/Library/texmf
mkdir $PREFIX
mkdir -p $PREFIX/tex/latex/foils
cp foils.sty $PREFIX/tex/latex/foils/
mkdir -p $PREFIX/tex/latex/base
#!/usr/bin/env python2
from reportlab.pdfgen import canvas
mm = 2.83464567
fms = [(0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 15), (0, 16), (0, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (0, 16), (0, 16), (0, 15), (0, 14), (0, 13), (0, 12), (0, 11), (0, 10), (0, 9)]
ch = 1
row = 0