View markdown on Mac OS X

Use the Quicklook plugin from here. Simpy drop the QLMarkdown.qlgenerator to ~/Library/QuickLook or /Library/QuickLook Now whenever you select a markdown file (.md) it will format the file and show the formatted version to you through quicklook.

Quick state machine in Python

SM = { ‘INTERTRIAL’: {‘TRIALSTART’: ‘TSTART0’}, ‘TSTART0’: {‘TRIALSTART’: ‘TSTART1’}, ‘TSTART1’: {‘TRIALSTART’: ‘INTRIAL’}, ‘INTRIAL’: {‘TRIALEND’: ‘TEND0’}, ‘TEND0’: {‘TRIALEND’: ‘TEND1’}, ‘TEND1’: {‘TRIALEND’: ‘INTERTRIAL’}}nextstate = SM[currentstate].get(input,currentstate)

Mac OS X install pytables and h5py

Install tables – need NumPy version 1.6 Get NumPy from sourceforge and install – need Python 2.7 Install python 2.7 on Lion, open new terminal (or refresh path) curl | python curl | python sudo pip install ipython sudo pip install tables need numexpr > 1.4.1,  Download anc ompile numexpr -> wants to… Read More Mac OS X install pytables and h5py

Dealing with strict key checking for SSH

Problem: While using sftp (or some other ssh related service) the following warning shows up and we can’t use the service: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!Someone could be eavesdropping on you right now (man-in-the-middle attack)!It is also possible that the RSA host key has… Read More Dealing with strict key checking for SSH

Mac OS Lion

Things I like New tab in terminal opens in same folder Preview can make pdfs by stringing msic documents together I don’t like Preview is sooo sluggish Preview messes up some transparency in pdfs No save as (gotta duplicate etc etc)

Reading Plexon files into Python

Sample C code is at plx2csv, rather striaghtofrward reading of the plexon binary file Needed to load the data into Python, so looked at Boost.Python and pybindgen, but then decided that pickling the data from the c code and loading it into python scripts would be fine and so used The PicklingTools library.

++i OR i++ ?

From discussions on stack overflow we have: ++i does not expect to return a value while i++ might need to return a value. A modern compiler, for simple data types (i.e. integer) will treat the two the same if the context is right e.g. in a for loop For an object (e.g. an interator), however,… Read More ++i OR i++ ?