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 -O | |
import argparse | |
import sys | |
import numpy | |
import h5py | |
import csv | |
class ColType: | |
UNKNOWN = 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
How to configure httpd to forward requests (tested on SuSE): | |
============================================================ | |
* create /etc/apache2/proxies.conf | |
* change APACHE_CONF_INCLUDE_FILES="" to | |
APACHE_CONF_INCLUDE_FILES="/etc/apache2/proxies.conf" in | |
/etc/sysconfig/apache2 | |
* add "proxy proxy_http" to the APACHE_MODULES list in | |
/etc/sysconfig/apache2 | |
And the proxies.conf file might look like: |
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
# grep through git history | |
for i in {1..20} | |
do | |
echo "### check master~$((i - 1)) vs master~${i} diff ###" | |
git diff "master~$((i - 1))" "master~${i}" | grep -i 'sample-index' | |
done | |
# merge logs across several projects | |
(echo "commit time,author,project,message"; \ | |
(for i in `"ls" -d */`; do (cd $i; git log "--pretty=tformat:%ai,%an,$i,%s") 2>/dev/null; done \ |
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 | |
# exit on error and don't allow the use of unset variables | |
set -o errexit | |
set -o nounset | |
#NOTE: you can find a list of special variables at http://tldp.org/LDP/abs/html/internalvariables.html | |
# quietly execute GUI applications | |
function quietly() { |
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
To get rid of shadows in screen captures: | |
defaults write com.apple.screencapture disable-shadow -bool true | |
To manipulate file attributes use xattr: | |
usage: xattr [-l] file [file ...] | |
xattr -p [-l] attr_name file [file ...] | |
xattr -w attr_name attr_value file [file ...] | |
xattr -d attr_name file [file ...] | |
The first form lists the names of all xattrs on the given file(s). |
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
library("RHmm") | |
sunProb <- c(0.6, 0.2, 0.15, 0.05) | |
cloudProb <- c(0.25, 0.25, 0.25, 0.25) | |
rainProb <- c(0.05, 0.10, 0.35, 0.50) | |
weatherDist <- distributionSet(dis="DISCRETE", proba=list(sunProb, cloudProb, rainProb), labels =c("DRY", "DRYISH", "DAMP", "SOGGY")) | |
weatherTransitions <- rbind(c(0.5, 0.375, 0.125), c(0.25, 0.125, 0.625), c(0.25, 0.375, 0.375)) | |
weatherHmm <- HMMSet(initProb=c(0.63, 0.17, 0.20), transMat=weatherTransitions, distribution=weatherDist) | |
weatherPath <- viterbi(HMM=weatherHmm, obs=c("DRY", "DAMP", "SOGGY", "SOGGY", "DRYISH")) |
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
# attach and detach a package: | |
library("MouseDivGeno") | |
detach(package:MouseDivGeno) | |
# start in 64 bit mode: | |
R --arch x86_64 | |
# Stack-trace in R: | |
traceback() |
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
The liftover web app and command line download: | |
http://genome.ucsc.edu/cgi-bin/hgLiftOver | |
mapping from build # to dates and version numbers: | |
http://genome.ucsc.edu/FAQ/FAQreleases | |
chain files for converting from one build to another: | |
http://hgdownload.cse.ucsc.edu/downloads.html#mouse |
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 "input directory: $1" | |
echo "output directory: $2" | |
for i in `ls $1` ; do echo "striping N and H calls from: $i" && egrep -v '(,N,)|(,N$)|(,H,)|(,H$)|(,n,)|(,n$)|(,h,)|(,h$)' $1/$i > $2/$i; done | |
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/perl | |
use strict; | |
use warnings; | |
my $status_output = `svn status @ARGV`; | |
my @split_status_lines = split(/\n/, $status_output); | |
foreach(@split_status_lines) | |
{ | |
if($_ =~ /^M.{5}\s+(.*)$/) |