Skip to content

Instantly share code, notes, and snippets.

View alexshires's full-sized avatar

Alex Shires alexshires

View GitHub Profile
@alexshires
alexshires / .bashrc
Created June 12, 2012 15:49
as1905 .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export PYTHONPATH=$HOME/local/lib64/python2.4/site-packages
export LHCBDISK2=/vols/lhcbdisk02/ashires
class value {
public:
value::value() { central = 1.0 ; error = 0.0 ; }
value::value(double a, double b) { central = a ; error = b ; }
double val() { return central ; }
double err() { return error ; }
#include <iostream>
#include <gsl/gsl_integration.h>
#include <functional>
class A
{
public :
A(const double & _z = 1.0) : z(_z) {;}
double f( double x ) { return z*x*x ; }
double test( double x, void * y ) { return f(x) ; }
git init
git add XXX
git commit -m "XXX"
CREATE REPO ON WEBSEVER BEFORE THIS STEP!!!!
git remote add origin git@git.xxxx.yy:USERNAME/PROJECT.git
...
git push origin master
from math import sqrt
def prod_tuple( a, b):
va, ea = a
vb, eb = b
e = sqrt( ea*ea*vb*vb + eb*eb*va*va )
return (va*vb, e )
def div_tuple( a, b):
va, ea = a
@alexshires
alexshires / root-numpy install error
Last active August 29, 2015 14:12
root-numpy install error
Requirement already satisfied (use --upgrade to upgrade): rootpy in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking root-numpy
Running setup.py (path:/tmp/pip_build_root/root-numpy/setup.py) egg_info for package root-numpy
Installing collected packages: root-numpy
Running setup.py install for root-numpy
_
_ __ ___ ___ | |_ _ __ _ _ _ __ ___ _ __ _ _
| '__/ _ \ / _ \| __| | '_ \| | | | '_ ` _ \| '_ \| | | |
echo $PATH
/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/alexshires/bin
[alexshires@alex-desktop Desktop]$ echo $LD_LIBRARY_PATH
[alexshires@alex-desktop Desktop]$ lhcbSetup
ALWAYS : Configuring LbScripts v8r3 from /cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/LBSCRIPTS_v8r3
Configuring LbScripts v8r3 from /cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/LBSCRIPTS_v8r3
********************************************************************************
* ---- LHCb Login v8r3 ---- *
* Building with gcc48 on slc6 x86_64 system (x86_64-slc6-gcc48-opt) *
********************************************************************************
@alexshires
alexshires / gist:0cbef200036778d8efe7
Created February 6, 2015 12:58
virtual functions
#include <iostream>
class A {
public:
virtual double f () = 0 ;
double g() { return f() ; }
} ;
class B : public A {
public:
class testClass:
def foo(self, x):
print "foo", x
def bar(self, y):
print "bar", y
""" TEST Luigi processes """
import os
def python_function(filename1):
# from filename1 create filename2
if "." not in filename1:
print "can't split"
return None