Skip to content

Instantly share code, notes, and snippets.

View saeedghsh's full-sized avatar

Saeed Gholami Shahbandi saeedghsh

View GitHub Profile
#!/usr/bin/python3
'''
Copyright (C) Saeed Gholami Shahbandi. All rights reserved.
Author: Saeed Gholami Shahbandi
This file is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@saeedghsh
saeedghsh / opencv3_on_Sierra.md
Last active March 11, 2019 00:32
install opencv3 on sierra with support for virtual environement

The following is a set of instruction, [half] borrowed from here. But it didn't work for me and I had to modify it. Finally I installed it the linux way, with modified addresses of directories for OSX. Then created a symbolic object and linked to the installed opencv The opencv installation instruction is from here, with following options modified:

PYTHON_LIBRARY=/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib \
PYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Headers/ \
PYTHON_EXECUTABLE=/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python \
PYTHON2_NUMPY_INCLUDE_DIRS=/usr/local/Cellar/numpy/1.13.1/lib/python2.7/site-packages/numpy/core/include/ \
@saeedghsh
saeedghsh / matplotlib_bottons_x_axis_zoom.py
Last active April 13, 2025 14:48
A Matplotlib plot with bottons and mouse scroll for y-axis zooming
#!/usr/bin/python3
'''
Copyright (C) Saeed Gholami Shahbandi. All rights reserved.
Author: Saeed Gholami Shahbandi
This file is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without
@saeedghsh
saeedghsh / latency.md
Last active March 13, 2020 08:40 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
  • Latency Comparison Numbers (~2012)
L1 cache reference                           0.5 ns
Branch mispredict                            5   ns
L2 cache reference                           7   ns                      14x L1 cache
Mutex lock/unlock                           25   ns
Main memory reference                      100   ns                      20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy             3,000   ns        3 us
Send 1K bytes over 1 Gbps network       10,000   ns       10 us