Skip to content

Instantly share code, notes, and snippets.

@gidden
gidden / gist:a2bd769781f16cfc43da
Created August 6, 2014 19:58
writing only a chunksize
def write(self):
if len(self.data) >= self.chunksize:
self.tbl.append(self.data[:self.chunksize])
self.data = self.data[self.chunksize:]
a, b, c
1, 2, 3
1.5, 2.5, 3.5
@gidden
gidden / class.cc
Created September 12, 2014 01:13
xdress vector bool failure
// class.cc
#include "class.h"
Foo::Foo() { i=1; }
@gidden
gidden / hs_err_pid..
Created September 18, 2014 21:34
cyclist crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd6610533ab, pid=10349, tid=140558724683520
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [sqlite-3.7.2-libsqlitejdbc.so+0x353ab]
#
@gidden
gidden / gist:738ab954f00b8d52c55c
Created October 28, 2014 15:00
epub latex compile fail
kpathsea: Running mktextfm texnansi-qplr+20
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input texnansi-qplr+20
This is METAFONT, Version 2.718281 (TeX Live 2013/Debian)
kpathsea: Running mktexmf texnansi-qplr+20
! I can't find file `texnansi-qplr+20'.
<*> ...mag:=1; nonstopmode; input texnansi-qplr+20
Please type another input file name
def masked_collection(c, mask):
"""Return a subset of a collection with a mask applied"""
return [c[i] for i in range(len(c)) if mask[i]]
@gidden
gidden / gist:99b2dea4701477569f49
Created December 1, 2014 20:32
only ids from both bax and cytc
bax_ids = set(data_ch1.values())
cytc_ids = set(data_ch2.values())
both_ids = bax_ids | cytc_ids
@gidden
gidden / gist:24bf04cefd7ae7065872
Created December 12, 2014 14:57
Pyne's Flake8 output
pyne/__init__.py:10:5: F403 'from pyne_config import *' used; unable to detect undefined names
pyne/__init__.py:13:80: E501 line too long (82 > 79 characters)
pyne/api.py:2:1: F401 'nuc_data' imported but unused
pyne/api.py:2:1: F401 'pyne_conf' imported but unused
pyne/api.py:2:1: F401 'pyne_start' imported but unused
pyne/api.py:5:1: F401 'id' imported but unused
pyne/api.py:5:1: F401 'name' imported but unused
pyne/api.py:6:1: W391 blank line at end of file
pyne/binaryreader.py:14:1: E302 expected 2 blank lines, found 1
pyne/alara.py:4:1: F401 'os' imported but unused
@gidden
gidden / README.rst
Last active August 29, 2015 14:13
SWC Collaboration

This gist provides a minimal setup and example of the git collaborate exercise for SWC (e.g., here). Use setup.sh to get a minimal working repository example. A repos represent the master upstream version, B and C repos represent forks. *-remote directories represent Github repos (and forks), while ~*-local` directories correspond to local copies. exercise.sh goes through what students will see for both the PR execise and "experiencing a conflict".

======================================================================
FAIL: test_abi.test_abi_stability
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/gidden/work/cyclus/cyclus/tests/test_abi.py", line 32, in test_abi_stability
assert_true(obs)
AssertionError: False is not true
-------------------- >> begin captured stdout << ---------------------