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
#include<iostream> | |
#include<vector> | |
#include<stdlib.h> | |
/** People sometimes get the false impression that because STL and iterators | |
* are fairly new additions to C++, they do sensible, commonplace things like | |
* bounds checking. | |
* | |
* This is sadly not the case, since preserving backwards-compatibility with C | |
* means preserving the loaded-gun-pointed-at-your-foot aspects, too. |
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
'''Example of a custom ReST directive in Python docutils''' | |
import docutils.core | |
from docutils.nodes import TextElement, Inline | |
from docutils.parsers.rst import Directive, directives | |
from docutils.writers.html4css1 import Writer, HTMLTranslator | |
class foo(Inline, TextElement): | |
'''This node class is a no-op -- just a fun way to define some parameters. | |
There are lots of base classes to choose from in `docutils.nodes`. |
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
'''Make the "lobster plot." | |
That is, the possible values of the Majorana mass given the mixing parameters | |
and assuming standard three-neutrino mixing, for the normal and inverted | |
mass hierarchy. | |
By the way, the current global best fit parameters from NuFit are: | |
sin(t12)^2 = 0.304 +/- 0.012 | |
sin(t23)^2 = 0.451 +/- 0.002 (first quadrant) |
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
#include<iostream> | |
#include<signal.h> | |
#include<limits.h> | |
/** g++'s -ftrapv flag provides some protection against integer overflows. It | |
* is a little awkward to use, though. All it will do is "trap" -- you must | |
* provide a signal handler to deal with it. | |
* | |
* (You must compile with -ftrapv for this to work) | |
*/ |
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
# Example /etc/slurm-llnl/slurm.conf | |
ControlMachine=master | |
ControlAddr=192.168.57.100 | |
Proctracktype=proctrack/linuxproc | |
SlurmctldPort=6819 | |
SlurmdPort=6818 | |
SlurmdSpoolDir=/tmp/slurmd | |
SlurmUser=slurm | |
StateSaveLocation=/tmp/slurmd | |
SwitchType=switch/none |
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
#!/bin/bash | |
echo "`date` Resume invoked $0 $*" >> /var/log/slurm-llnl/power_save.log | |
hosts=`scontrol show hostnames $1` | |
for host in $hosts | |
do | |
docker run --rm \ | |
--name $host \ | |
-h $host \ | |
-v /home:/home \ |
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
// This lives in user/ | |
/////////////////////////////////////////////////////////////////////////////// | |
/// \file TestUser.cc | |
/// \brief An example User Processor | |
/// | |
/// This example demonstrates how to write a User Processor. MyUserProc | |
/// (declared and defined below) just creates a 1-D histogram of the number of | |
/// photoelectrons in each event, filled it as events are generated and writes | |
/// it to a file called "numpe.root". |
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 python | |
'''Check to make sure that all the replications on the local CouchDB server | |
are actually running.''' | |
import argparse | |
from datetime import datetime, timedelta | |
from operator import itemgetter | |
import requests | |
import sys | |
import tempfile |
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 python | |
'''Report the SMART status of hard disks using a log file.''' | |
import argparse | |
import subprocess | |
import sys | |
# Nagios status codes | |
OK, WARNING, CRITICAL, UNKNOWN = range(4) |
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
#!/bin/bash | |
git clone git://github.com/jhs/build-couchdb.git | |
cd build-couchdb | |
git submodule init | |
git submodule update | |
rake erl_checkout="OTP_R15B03-1" git="git://git.apache.org/couchdb.git 1.6.1" install=/opt/build-couchdb-dependencies couchdb_build=/opt/couchdb/1.6.1 |
NewerOlder