Skip to content

Instantly share code, notes, and snippets.

View jdangerx's full-sized avatar
🐢
writing slow code slowly

Dazhong Xia jdangerx

🐢
writing slow code slowly
  • Catalyst Cooperative
  • Cambridge, MA
View GitHub Profile
@jdangerx
jdangerx / filesize-vs-compression-level.py
Created October 24, 2012 22:24
filesize vs compression level for materials.write_hdf5
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.rc('font', family='serif', size=16)
compressionlevel = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
filesize = np.array([504.3, 211.3, 210.4, 210.6, 209.1, 208.8, 208.5, 208.5, 208.2, 207.8])
fig = figure(figsize=(7,7))
plt.plot(compressionlevel, filesize, 'r-', figure=fig)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdangerx
jdangerx / oh_no
Last active December 15, 2015 09:59
PyNE build error
john@entropy:~/pyne$ rm -r build
john@entropy:~/pyne$ python setup.py install --user
-- HDF5_LIBRARY_DIRS = /usr/lib
-- PYTHON_EXECUTABLE: /usr/bin/python
-- Pyne platform defined as: __LINUX__
/ \
) (( )) (
(@) /|\ ))_(( /|\
|-| / | \ (/\|/\) / | \ (@)
(defun msm-list (sum ls)
(let* ((acc '())
(fakehash (make-array (+ 1 sum) :initial-element 0)))
(dolist (elt ls)
(incf (svref fakehash elt)))
(dolist (elt ls)
(let* ((comp (- sum elt))
(num-pairs (* (svref fakehash comp)
(svref fakehash elt))))
(if (= comp elt)
@jdangerx
jdangerx / Ghost_Council_1.md
Last active December 25, 2015 11:39
Ghost Council of Max Palevsky, Sat Oct 12 2013

Team Structure

  • Over-organization and under-organization both lead to more stress
  • Roles should be relatively clearly defined
    • pictures of people in leadership roles should be available
    • armbands of authority?
  • with regards to recruitment: we should get to know first-years pre-hunt
    • This lets us filter for good page captains and special forces people etc

Roles we need filled

@jdangerx
jdangerx / gist:7568815
Created November 20, 2013 18:53
scav parser. no item parsing yet
def split_into_sections(fh):
with open(fh, 'r') as f:
scavlist = f.read().split("\n")
scavlympics = get_section(scavlist, "Scav Olympics")
items = get_section(scavlist, "Items")
return scavlympics, items
def get_section(lst, section):
begin = lst.index("\\section*{{{}}}".format(section))
end = lst[begin:].index("\\end{list}")
FFEFFFEFFFEFFFEFFFEFFEFFEFFEFFEFFEFFEFFEFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFEFFEFFEFFFFE.FEE........FFEFFEFFEFFEFFEFFEFFEFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFFEFFEFFEFFEFFEFFEFFEFFEEFEEFEEFEFFEFFEFFFEFFEFFEFFEFFEFFE
======================================================================
ERROR: test_basic.test_results
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/john/.virtualenvs/pyne/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/john/openmc/tests/test_basic/test_basic.py", line 33, in test_results
call(['python', 'results.py', statepoint[0]])
IndexError: list index out of range
.d88888b. 888b d888 .d8888b.
d88P" "Y88b 8888b d8888 d88P Y88b
888 888 88888b.d88888 888 888
888 888 88888b. .d88b. 88888b. 888Y88888P888 888
888 888 888 "88b d8P Y8b 888 "88b 888 Y888P 888 888
888 888 888 888 88888888 888 888 888 Y8P 888 888 888
Y88b. .d88P 888 d88P Y8b. 888 888 888 " 888 Y88b d88P
"Y88888P" 88888P" "Y8888 888 888 888 888 "Y8888P"
__________________888______________________________________________________
@jdangerx
jdangerx / gist:df8cb80e2b8ee0b0e492
Created August 12, 2014 16:54
Pocketsphinx.js test failures
With living recognizer: Recognizing audio (18, 16, 34)Rerun97 ms
Recognizer instantiated successfully
Recognizer should process successfully
Recognizer should stop successfully
Recognizer should recognize the correct utterance
Segmentation should be initialized empty
okay
Segmentation should not be empty after filled in
Value stored in Segmentation should be the correct one
@jdangerx
jdangerx / gist:98797f22ba045009b6d2
Created October 8, 2014 01:17
pyne test failure
EEEEEEE................................SEEEEEE.............................ESSEESEE..................E..............S
======================================================================
ERROR: Failure: ImportError (/home/john/.virtualenvs/cnerg/lib/python3.4/site-packages/pyne/nucname.cpython-34m.so: undefined symbol: _ZN4pyne7nucname7zz_nameE)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/john/.virtualenvs/cnerg/lib/python3.4/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/home/john/.virtualenvs/cnerg/lib/python3.4/site-packages/nose/loader.py", line 414, in loadTestsFromName
addr.filename, addr.module)
File "/home/john/.virtualenvs/cnerg/lib/python3.4/site-packages/nose/importer.py", line 47, in importFromPath