I hereby claim:
- I am salotz on github.
- I am salotz (https://keybase.io/salotz) on keybase.
- I have a public key ASB24_I5jo3wKU9_DxOuUnSpzWrQT5jpRAg5JbxVeI8I8wo
To claim this, I am signing this object:
#............................................................................... | |
""" new colormaps from old: stack, truncate builtin cmaps / files / numpy arrays | |
What's a colormap or cmap in matplotlib ? | |
Mainly a bar or array of 256 colors, rgb or rgba values 0 .. 1, | |
used in | |
pl.imshow( a 2d numpy array, cmap=cmap, ... ) | |
pl.colorbar() | |
Cmaps can be indexed with () like | |
cmap( .25 ), cmap( [0, .25, .5] ), cmap( np.linspace( ... )) |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
# Supporting Python 3 | |
import sys, os, re | |
try: bibtexdb = open(sys.argv[1]).read() | |
except: print("Error: specify the file to be processed!") | |
if not os.path.isfile('journalList.txt'): |
#!/bin/bash | |
# | |
# ----------------------- | |
# | |
# This is a script that installs docker-ce (Docker Community Edition) on Debian 9 | |
# Inspired by https://gist.github.com/frgomes/a6f889583860f5b330c06c8b46fa0f42 | |
# | |
# ----------------------- | |
# Pre-requesite |
Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.
"Don't Use Manual Procedures".
This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.
The trouble was that I hadn't much of an idea how to actually go
import matplotlib.pyplot as plt | |
def move_axes(ax, fig, subplot_spec=111): | |
"""Move an Axes object from a figure to a new pyplot managed Figure in | |
the specified subplot.""" | |
# get a reference to the old figure context so we can release it | |
old_fig = ax.figure | |
# remove the Axes from it's original Figure context |
First start an ipython session first printing out the PID.
bash -c "echo $$; exec ipython"
I also tried changing the name of the process so you can name them but it didn’t seem to work, although there is probably something you can do to be able to do this:
def shimazaki_shinimoto_binning(x, min_bins, max_bins): | |
"""The Shimazaki-Shinimoto histogram binning algorithm for choosing an | |
optimal constant number of bins. | |
Parameters | |
---------- | |
x : array of int or float | |
The data you want to bin |
#!/usr/bin/env python | |
import apscheduler.scheduler | |
import daemon.runner | |
import os.path | |
import sys | |
import time | |
class Core(): | |
def __init__(self): |
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 | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |