FFMPEG Cheat Sheet

  Create animated GIF (with nice colors) from a sequence of images named "img (0...N).jpg". Use "%0Nd.jpg" for 0-padded numbered files. set pattern="%04d.jp2" ffmpeg -i %pattern% -vf palettegen palette.png ffmpeg -i %pattern% -i palette.png -lavfi "fps=15, paletteuse" out.gif

NEURON Cheat Sheet

Compile all .mod files in directory nrnivmodl #NRN IV MOD L Use variable step integration h.cvode_active(1) # or 0 for fixed, note the _ h.cvode.atol(0.01) # for tolerance 0.001 is default Run sim till a specific time h.continuerun(tstop) Record value e.g. memb pot vVector = h.Vector() vVector.record(section(0.5)._ref_v) #Use h._ref_t for time #Then, after h.run() vVector.to_pyton() … Continue reading NEURON Cheat Sheet

Ruby Cheat Sheet

Upper/lower case version of a string "test".downcase "test".upcase Check if a string contains another string my_string.include? "target" Replace in string stringVar.gsub("replacewhat","withthis") # add ! to replace in-place Length of array arrVar.length Try/Catch exception handling begin error_code_here() rescue handle_error() end Ternary/conditional operator: result = condition ? if_true : if_false

Python Cheat Sheet

Create Anaconda environment conda create -n envName python=2.7 Change Anaconda Python environment *NIX: source activate p2/p3 WIN: activate p2/3/pb35 Cython re-build files python setup.py build_ext --inplace Get cmd parameter:  sys.argv[1+] Get absolute path:  os.path.abspath(relativePath)   Get file parent folder:  os.path.dirname(filePath)   Get list of directory files (just file names): os.listdir(dirPath) # note no os.path Delete … Continue reading Python Cheat Sheet

Important NEURON Gotchas and Tips

Below are some common problems/puzzling behavior I have encountered when working with NEURON.  Understand the difference between Sections, Segments, and 3D Points You will mostly be working with Sections which are subdivided into iso-potential compartments called Segments. NEURON takes care of the details of managing the compartments, but you can set the number of compartments … Continue reading Important NEURON Gotchas and Tips