Skip to content

Instantly share code, notes, and snippets.

View hannorein's full-sized avatar

Hanno Rein hannorein

View GitHub Profile
@ctmakro
ctmakro / ipython_display.py
Last active April 15, 2024 03:22
Display numpy ndarray as Image in Jupyter/IPython notebook
# if input image is in range 0..1, please first multiply img by 255
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4
def imshow(img):
import cv2
import IPython
_,ret = cv2.imencode('.jpg', img)
i = IPython.display.Image(data=ret)
IPython.display.display(i)
@Microno95
Microno95 / Fast_Variational_Equations_Implementation.ipynb
Last active May 23, 2017 20:25
Poincaré Sections - Chaos - With Variations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chris-taylor
chris-taylor / interpreter.hs
Last active August 29, 2015 14:04
Interpreter for Hanno's made-up assembly language
import Data.Map (Map, (!), insert, empty)
import Control.Monad.State (StateT, put, get, liftIO, evalStateT)
type Val = Int
type Var = String
data Instruction =
Set Val Var
| Print Var
| Add Var Var Var
@cotdp
cotdp / gmetric-cpu-temp.sh
Created November 22, 2011 22:09
this script read the core(s) temperature using lm sensors then calculate the average and send it to the ganglia using gmetric
#!/bin/sh
# this script read the core(s) temperature using lm sensors then calculate the average
# and send it to the ganglia using gmetric
# Based on the original from: http://computational.engineering.or.id/LM_Sensors#Integrasi_Dengan_Ganglia
# assumes that the lines reported by lm sensors are formated like this
# Core 0: +48.0°C (high = +90.0°C, crit = +100.0°C)
SENSORS=/usr/bin/sensors
GMETRIC=/usr/bin/gmetric