Skip to content

Instantly share code, notes, and snippets.

View yarikoptic's full-sized avatar
😠
Pseudo-"Tsar"-made WAR in Europe!

Yaroslav Halchenko yarikoptic

😠
Pseudo-"Tsar"-made WAR in Europe!
View GitHub Profile
#!/usr/bin/python
#emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 noet:
#------------------------- =+- Python script -+= -------------------------
"""
@file travis-logs.py
@date Wed Mar 27 15:20:16 2013
@brief
Created: Wed Mar 27 15:20:16 2013
@yarikoptic
yarikoptic / python-all
Created February 17, 2013 03:23
tiny script to invoke any available python version with given cmdline arguments
#!/bin/bash
# Simple helper script to run something with all available versions of Python
# (under /usr/bin and /usr/local/bin python2.*)
set -eu
failed=
for python in /usr/{,local/}bin/python[23].[0-9]{,.*}{,-dbg}
do
[ -e "$python" ] || continue
Program received signal SIGBUS, Bus error.
blosc_d (blocksize=32768, leftoverblock=<optimized out>, src=0x132f543 "S", dest=0x1421808 "", tmp=0x1429810 "", tmp2=
0x1431830 "") at blosc/blosc.c:330
330 cbytes = sw32(((uint32_t *)(src))[0]); /* amount of compressed bytes */
(gdb) print src
$1 = (uint8_t *) 0x132f543 "S"
(gdb) print ((uint32_t *)(src))[0]
$2 = 1392508928
(gdb) print sw32(((uint32_t *)(src))[0])
$3 = 83
@yarikoptic
yarikoptic / gist:1524518
Created December 27, 2011 17:41
s390 hercules configuration
CPUSERIAL 000069 # CPU serial number
#CPUMODEL 9672 # CPU model number
CPUMODEL 2097 # CPU model number
MAINSIZE 256 # Main storage size in megabytes
XPNDSIZE 0 # Expanded storage size in megabytes
CNSLPORT 3270 # TCP port number to which consoles connect
NUMCPU 2 # Number of CPUs
LOADPARM 0120.... # IPL parameter
OSTAILOR LINUX # OS tailoring
PANRATE SLOW # Panel refresh rate (SLOW, FAST)
@yarikoptic
yarikoptic / rdist_test.py
Created July 27, 2011 13:35
Compare Fisher transformation to rdist
#!/usr/bin/python
#emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 noet:
"""The target is to compare Fisher transformation to simply taking std values from rdist
"""
import numpy as np
from scipy.stats import rdist, norm, t
@yarikoptic
yarikoptic / dmtcp-tasty-python.rst
Created July 22, 2011 18:09
Ideas for DMTCP slide for EuroSciPy talks

Features

  • compatible with all recent Linux kernels
  • no need for kernel rebuilding/patching
  • verified (to what degree?) compatibility with Python (what versions?)
  • ...

Scientific Python

while running
CCACHE_CPP2=1 CCACHE_LOGFILE=/tmp/1.log PATH=/usr/lib/ccache:$PATH make
got
[2011-05-06T14:12:24.132205 2214 ] === CCACHE STARTED =========================================
[2011-05-06T14:12:24.132538 2214 ] Hostname: novo
[2011-05-06T14:12:24.132554 2214 ] Working directory: /home/yoh/deb/gits/pkg-exppsy/freesurfer/freeview
[2011-05-06T14:12:24.132771 2214 ] Source file: moc_LayerPropertyPointSet.cpp
$> PATH=/usr/lib/ccache:$PATH make
make all-am
make[1]: Entering directory `/home/yoh/deb/gits/pkg-exppsy/freesurfer/freeview'
g++ -DHAVE_CONFIG_H -I. -I.. -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -g -O3 -msse2 -mfpmath=sse -Wall -DUSE_SSE_MATHFUN -m64 -DLinux -DANSI -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -fno-strict-aliasing -Wno-deprecated -Wno-unused -Wno-uninitialized -Wno-return-type -Wno-reorder -Wno-sign-compare -I../include -I/usr/X11R6/include -pthread -I/usr/include/GL -I/usr/include/vtk-5.6 -I../vtkfsio -I../vtkutils -I/usr/include/InsightToolkit -I/usr/include/InsightToolkit/Algorithms -I/usr/include/InsightToolkit/BasicFilters -I/usr/include/InsightToolkit/Common -I/usr/include/InsightToolkit/IO -I/usr/include/InsightToolkit/Numerics -I/us
$> quilt diff
--- a/src/pebl/taskcontroller/ec2ipy1.py
+++ b/src/pebl/taskcontroller/ec2ipy1.py
@@ -2,7 +2,11 @@ import sys, os, time
import ConfigParser
from itertools import groupby
-import ipython1.kernel.api as kernel
+try:
+ import ipython1.kernel.api as kernel
$> PYTHONPATH=build/lib.linux-x86_64-2.6 sphinx-build docs/src/ build/html/
Running Sphinx v1.0.7
loading pickled environment... done
No builder selected, using default: html
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 18 changed, 0 removed
Traceback (most recent call last):roller/ec2
File "/usr/lib/pymodules/python2.6/sphinx/ext/autodoc.py", line 329, in import_object
__import__(self.modname)
File "/tmp/pebl-1.0.2/build/lib.linux-x86_64-2.6/pebl/taskcontroller/ec2.py", line 11, in <module>