Skip to content

Instantly share code, notes, and snippets.

View drhirsch's full-sized avatar

Michael Hirsch drhirsch

View GitHub Profile
@drhirsch
drhirsch / opencv3.1 cmake
Last active July 18, 2016 18:33
OpenCV3 cmake output on Ubuntu 16.04
On Ubuntu 16.04
https://scivision.co/anaconda-python-opencv3/
$ cmake -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DENABLE_AVX=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_IPP=ON -DWITH_TBB=ON -DWITH_EIGEN=ON -DWITH_V4L=ON -DWITH_VTK=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -DPYTHON3_EXECUTABLE=$(which python3) -DPYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ..
-- The CXX compiler identification is GNU 5.3.1
-- The C compiler identification is GNU 5.3.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
@drhirsch
drhirsch / python mayavi virtualbox opengl error
Created June 17, 2015 02:49
Errors using python / Mayavi in a VirtualBox 5.0 virtual machine with 3D aceeleration enabled
https://www.virtualbox.org/ticket/12746
```
pci id for fd 4: 80ee:beef, driver (null)
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
@drhirsch
drhirsch / gist:62543e43769f73d11dfb
Created June 18, 2015 19:35
Loading ISR and video data at same time using GeoDataMatlab
Loading ISR data and AVI video at the same times from disk
Michael Hirsch
My first thought on finding the nearest neighbor in time between instruments
is to use interp1().
Let's say I have a radar that samples once every three seconds, and a camera that samples
once per second. The code below is done in Matlab/Octave.
```
@drhirsch
drhirsch / rst-cheatsheet
Last active August 29, 2015 14:25
RST ReStructured Text Cheatsheet of frequently used syntax
hyperlink: Here is `my website <https://scivision.co>`_
code: two ways to do this:
easy way: just indent each line of code with a tab, leaving one blank line above and below each line of code
better way with syntax highlighting:
here is my python code
.. code:: python
@drhirsch
drhirsch / octave 4.0 configure output
Created July 17, 2015 18:18
octave 4.0 on Ubuntu 14.04 ./configure output
Octave is now configured for x86_64-unknown-linux-gnu
Source directory: .
Installation prefix: /opt/octave4.0
C compiler: gcc -pthread -fopenmp -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
C++ compiler: g++ -pthread -fopenmp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
Fortran compiler: gfortran -O
Fortran libraries: -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../.. -lgfortran -lm -lquadmath
Lex libraries:
LIBS: -lutil -lm

Keybase proof

I hereby claim:

  • I am scienceopen on github.
  • I am michaelhirsch (https://keybase.io/michaelhirsch) on keybase.
  • I have a public key whose fingerprint is 8761 AE12 C085 981A 367D F3DC 05F2 BD2A 5250 07DF

To claim this, I am signing this object:

@drhirsch
drhirsch / splitstring.f90
Last active October 4, 2015 07:06 — forked from ponderomotion/splitstring.f90
Split a string into 2 either side a delimiter in FORTRAN
! split a string into 2 either side of a delimiter token
function split(instr, delm)
implicit none
CHARACTER(len=80),intent(in) :: instr,delm
INTEGER :: idx
idx = scan(instr,delm)
split = instr(1:idx-1)
END function split
@drhirsch
drhirsch / find_available_port.py
Last active December 30, 2015 18:04 — forked from dbrgn/gist:3979133
Find an available port from Python script
#!/usr/bin/env python3
""" for use from shell, returns on STDOUT a free port number.
Yes, there is a slight race condition where between end of this program and start of your shell program,
another program could grab this port.
Useful for scripts with SSH port forwarding for example, where you have one or more hops before the final host.
reference: http://stackoverflow.com/questions/1365265/on-localhost-how-to-pick-a-free-port-number
Michael Hirsch
@drhirsch
drhirsch / gist:b16a0a1d91a3973c1658
Created October 30, 2015 03:37
Edison dmesg ready for flashing with dfu-util
new high-speed USB device number 42 using xhci_hcd
New USB device found, idVendor=8086, idProduct=e005
New USB device strings: Mfr=2, Product=1, SerialNumber=3
Product: MERRIFIELD
Manufacturer: INTEL
SerialNumber: XXX
USB disconnect, device number 42
new high-speed USB device number 43 using xhci_hcd
New USB device found, idVendor=8086, idProduct=e005
New USB device strings: Mfr=2, Product=1, SerialNumber=3
@drhirsch
drhirsch / testlowtran.txt
Created April 14, 2016 05:18
lowtran testlowtran output
./testlowtran
for wavelengths [nm]: 1200.48022 1132.50281 1071.81128 1017.29407 968.054260 923.361084 882.612549 845.308533 811.030029 779.423218 750.187561 723.065796 697.836670 674.308838 652.315735 631.711975 612.369873 594.177063 577.034058 560.852478 545.553772 531.067444 517.330566 504.286407 491.883911 480.076813 468.823242 458.085205 447.828033 438.020142 428.632690 419.639099 411.015198 402.738617 394.788788 387.146729 379.794922 372.717102 365.898285 359.324463 352.982697 346.860901 340.947845 335.232971 329.706543 324.359375 319.182892 314.169006 309.310242 304.599457 300.029999
transmission: 0.934353650 0.653181911 0.980576396 0.988120317 0.922352910 0.928113937 0