Skip to content

Instantly share code, notes, and snippets.

@namoopsoo
namoopsoo / matplotlib quickly display small images.md
Last active October 22, 2020 17:08
matplotlib quickly display small images

Running this in a jupyter notebook

  • (NOTE: this data is from one of the Keras Hello World datasets) , per below
import matplotlib.pyplot as plt

image = [[0, 0, 0, 0, 0, 0, 0, 0, 33, 96, 175, 156, 64, 14, 54, 137, 204, 194, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 73, 186, 177, 183, 175, 188, 232, 255, 223, 219, 194, 179, 186, 213, 146, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 35, 163, 140, 150, 152, 150, 146, 175, 175, 173, 171, 156, 152, 148, 129, 156, 140, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 150, 142, 140, 152, 160, 156, 146, 142, 127, 135, 133, 140, 140, 137, 133, 125, 169, 75, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 54, 167, 146, 129, 142, 137, 137, 131, 148, 148, 133, 131, 131, 131, 125, 140, 140, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 110, 188, 133, 146, 152, 133, 125, 127, 119, 129, 133, 119, 140, 131, 150, 14, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 221, 158, 137, 135, 123, 110, 110, 114, 108, 112, 117, 127, 142, 77, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0
@namoopsoo
namoopsoo / argparse_boilerplate.py
Created January 12, 2019 22:49
python argparse boilerplate
import argparse
def bake_options():
return [
[['--verbose', '-v'],
{'action': 'store_true',
'help': 'pass to to be verbose with commands'},
],
[['--dry-run', '-D'],
{'action': 'store_true',
@namoopsoo
namoopsoo / fano.notes.md
Created December 23, 2018 21:12
Trying to understand fano
import numpy as np

from bokeh.plotting import figure, show, output_file
def doplot(x, y, **figure_kwargs):
    N = x.shape[0]
    radii = np.array([0.1,]*N)
    # print 'DEBUG, ', radii[:4], ', ', N
@namoopsoo
namoopsoo / docker build,push quick reference.md
Last active July 15, 2018 19:45
docker build/push quick reference

Do a build

  • login from shell,
$(aws --profile my-local-aws-profile ecr get-login --no-include-email --region us-east-1)
  • build,
docker build -t name-of-image -f path/to/Dockerfile path/to/docker/context
@namoopsoo
namoopsoo / transition notes.md
Last active July 8, 2018 18:13
New Laptop Transition
@namoopsoo
namoopsoo / temporary link farm.md
Created January 22, 2018 17:36
temporary link farm
@namoopsoo
namoopsoo / conda notes.md
Last active December 28, 2017 18:36
conda notes

miniconda notes cheat sheet

  • list environments
conda env list
  • new env
conda create --name myenv

@namoopsoo
namoopsoo / mongodb.md
Last active December 16, 2017 00:56
more cloj notes

...

@namoopsoo
namoopsoo / clojure hmms.md
Created July 12, 2017 15:08
clojure hmms..

this is weird...

app.core=> (make-auth-options)
{"client_id" "xxxxxblah", "secret" "xxxxblah"}
app.core=> (type (make-auth-options) )

CompilerException java.lang.RuntimeException: Unable to resolve symbol:  in this context, compiling:(/private/var/folders/mj/7bwn1wld4pscycn91fpjn1h40000gn/T/form-init1933255439273248076.clj:1:1) 
app.core=> (def a (make-auth-options))
#'app.core/a
app.core=> (type a)
@namoopsoo
namoopsoo / pandas manip.md
Created June 18, 2017 21:43
pandas manip