float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from bokeh.io import push_notebook, output_notebook, show | |
from bokeh.plotting import figure | |
output_notebook() | |
def dynamic_image_figure(w,h): | |
"""create an RGB image figure in current cell and return an update function for it""" | |
def im2bokeh(img): | |
img = (img*255).astype(np.uint8) | |
img = np.dstack([img, np.ones(img.shape[:2], np.uint8) * 255]) | |
img = np.squeeze(img.view(np.uint32)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is a simple and pretty generic example of an AutoHotkey script to run a | |
; program when you press a keyboard shortcut. Add as many of these as you want | |
; to a .ahk file, and set that to be run at startup. | |
; See the Hotkeys reference [1] for details of the modifiers and keys available. | |
; [1]: http://www.autohotkey.com/docs/Hotkeys.htm | |
; Win+Alt+G - Open Gmail in Chrome |