Skip to content

Instantly share code, notes, and snippets.

View maedoc's full-sized avatar

marmaduke woodman maedoc

  • now
  • here
View GitHub Profile
@maedoc
maedoc / gist:8878751
Created February 8, 2014 08:50
Benchmark class generator vs function generator
# coding: utf-8
import time
import operator as op
import numpy as np
# equivalent generators
def foo(n):
@maedoc
maedoc / hrepl.py
Last active August 29, 2015 13:56
control Python REPL over HTTP
import os
import sys
import atexit
import tempfile
import traceback
from urlparse import urlparse, parse_qs
import BaseHTTPServer
try:
from cStringIO import StringIO
@maedoc
maedoc / foo_data.py
Created March 7, 2014 16:34
unruly adapter
import numpy
from tvb.adapters.uploaders.abcuploader import ABCUploader
from tvb.basic.logger.builder import get_logger
from tvb.core.adapters.exceptions import LaunchException
from tvb.datatypes.time_series import TimeSeries
from tvb.adapters.uploaders import foo_data_impl
class FooDataImporter(ABCUploader):
@maedoc
maedoc / pip-requirements.bat
Created March 8, 2014 08:34
Getting started with TVB from sources
pip install --user cherrypy formencode sqlalchemy sqlalchemy-migrate genshi simplejson cfflib nibabel apscheduler mod_pywebsocket psutil minixsv
@maedoc
maedoc / less-useful
Last active August 29, 2015 13:57
constrast stack traces
In [2]: %run new_importer_launcher.py
HDF5-DIAG: Error detected in HDF5 (1.8.9) thread 0:
#000: ..\..\src\H5F.c line 1534 in H5Fopen(): unable to open file
major: File accessability
minor: Unable to open file
#001: ..\..\src\H5F.c line 1223 in H5F_open(): unable to open file: time = Mon Mar 10 10:01:15 2014
, name = 'C:\Users\duke\TVB\PROJECTS\Default_Project_admin\17\TimeSeries_896585d1-a832-11e3-92b8-8851fb5dbed8.h5', tent_flags = 1
major: File accessability
minor: Unable to open file
#002: ..\..\src\H5FD.c line 1101 in H5FD_open(): open failed
@maedoc
maedoc / gist:9461756
Created March 10, 2014 09:10
start up log
C:\Users\duke\Desktop\TVB\svn\trunk>python bin\app.py clean
C:\Users\duke\Desktop\TVB\svn\trunk>python bin\app.py clean
C:\Users\duke\Desktop\TVB\svn\trunk>python bin\app.py start web
Found the first free port: 8080.
['python', '-m', 'tvb.interfaces.web.run', 'tvb.config', '-profile', 'DEPLOYMENT_PROFILE']
C:\Users\duke\Desktop\TVB\svn\trunk>2014-03-10 10:07:27,315 - INFO - tvb.interfaces.web.mplh5.mplh5_server - MPLH5 back-end server s
2014-03-10 10:07:32,203 - ERROR - tvb.datatypes.surfaces_scientific - Failed to import geodesic distance package from externals...
@maedoc
maedoc / err
Created March 10, 2014 12:16
errors
C:\Users\duke\dev\tvb\TVB_Distribution\bin>cmd /c tvb_clean
"Done"
C:\Users\duke\dev\tvb\TVB_Distribution\bin>cmd /c tvb_start
Found the first free port: 8080.
"Done"
C:\Users\duke\dev\tvb\TVB_Distribution\bin>Found the first free port: 8080.
C:\Users\duke\dev\tvb\TVB_Distribution\tvb_data\numpy\lib\utils.py:1132: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x.
import compiler
@maedoc
maedoc / vhdr.py
Created March 13, 2014 10:10
lightweight Brain Vision data reader
import StringIO
import ConfigParser
import numpy as np
class VHDR(object):
"""
Brain Vision file.
@maedoc
maedoc / importer.py
Created April 28, 2014 12:40
Example import adapter for TVB
# auth: Lia Domide
import numpy
from tvb.adapters.uploaders.abcuploader import ABCUploader
from tvb.basic.logger.builder import get_logger
from tvb.datatypes.time_series import TimeSeries
@maedoc
maedoc / circular-cp.ipynb
Created April 29, 2014 11:44
circular-cp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.