Skip to content

Instantly share code, notes, and snippets.

View chrisvoncsefalvay's full-sized avatar
🥼
doing science & still alive ;)

Chris von Csefalvay chrisvoncsefalvay

🥼
doing science & still alive ;)
View GitHub Profile
@chrisvoncsefalvay
chrisvoncsefalvay / CartesianProduct.vba
Created July 23, 2015 12:03
Cartesian Product for Kath
Sub cartesianproduct()
Dim startrange As Range
range1 = Application.InputBox(Prompt:="Please Select First Range", Type:=8)
range2 = Application.InputBox(Prompt:="Please Select Second Range", Type:=8)
Set startrange = Application.InputBox(Prompt:="Please select where you want to put it", Type:=8)
array1 = [range1]
array2 = [range2]
  • Update HISTORY.rst
  • Update version number in my_project/__init__.py
  • Update version number in setup.py
  • Install the package again for local development, but with the new version number:
python setup.py develop
  • Run the tests:
python setup.py test
@chrisvoncsefalvay
chrisvoncsefalvay / diffiehellman.py
Created April 27, 2016 19:08
Diffie-Hellman key exchange demo code
import hashlib
import ssl
PRIME_18 = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC
@chrisvoncsefalvay
chrisvoncsefalvay / README.md
Last active June 23, 2016 01:42
OpenCV LiveTemplate goodies

@chrisvoncsefalvay
chrisvoncsefalvay / process.py
Created June 25, 2016 05:01
Processing injector for live image analysis
import numpy as np
import imutils
import argparse
import cv2
def analyse_image(frame):
@chrisvoncsefalvay
chrisvoncsefalvay / install.sh
Last active November 7, 2016 00:54
OpenCV installation script (OS X + Python 3.5 + OpenCV 3.1.0)
pip install --upgrade pip
pip install numpy scipy matplotlib scikit-learn
pip install -U scikit-image
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D PYTHON3_PACKAGES_PATH==~/.virtualenvs/cv3/lib/python3.5/site-packages \
-D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib \
-D PYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/include/python3.5m \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON \
@chrisvoncsefalvay
chrisvoncsefalvay / README.md
Last active November 16, 2016 22:05
LiveCapture

LiveCapture 📸

LiveCapture is a tool to experiment with computer vision, in particular with image processing. The workflow is quite simple.

  1. You write a processing function, which takes a logger and an image.
  2. You run the script including the processing function.
  3. From a live view of the camera, you capture a frame using the Esc key.
  4. The capture is then run through your processing functions. The results are logged in log.html using visual-logging.
@chrisvoncsefalvay
chrisvoncsefalvay / install.sh
Created December 4, 2016 21:18
Install GQRX and all its dependencies for OS X
brew tap godber/godber
brew update
brew install gnuradio
brew install rtl-sdr
brew install hackrf
brew install gnuradio-osmosdr
brew install gqrx
brew linkapps gqrx
@chrisvoncsefalvay
chrisvoncsefalvay / humanized_join_list.py
Created February 8, 2017 22:19
All sorts of useful Python hacks...
def humanized_join_list(item_list: Union[List, Tuple], ordinary_separator: str = ", ", final_separator=" and "):
return final_separator.join([ordinary_separator.join(item_list[:-1]), item_list[-1]] if len(item_list) > 2 else
item_list)
@chrisvoncsefalvay
chrisvoncsefalvay / CONTEXT_IMPORTING.md
Last active April 12, 2017 20:00
Context importing in Python

Shamelessly stolen from Kenneth Reitz.