This file contains 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
import psycopg2 as dbapi | |
import csv | |
from itertools import izip, count | |
if __name__ == "__main__": | |
con = dbapi.connect(database='play') | |
cur = con.cursor() | |
data = ([str(212), str(i)] + row + (15 - len(row)) * [','] for row, i in izip(csv.reader(open('test.csv')), count())) | |
sql = open('test.sql').read() |
This file contains 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
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.image as mpimg | |
import matplotlib.pyplot as plt | |
import numpy as np | |
img=mpimg.imread('image.jpg') | |
lum_img = img[:,:,0] | |
p = plt.hist(lum_img.flatten(), 256, range=(0.0,255), fc='k', ec='k') | |
plt.savefig('out.png') |
This file contains 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
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.image as mpimg | |
import matplotlib.pyplot as plt | |
import numpy as np | |
img=mpimg.imread('image.jpg') | |
lum_img = img[:,:,0] | |
p = plt.hist(lum_img.flatten(), 256, range=(0.0,255), fc='k', ec='k') | |
plt.savefig('/output/out.png') |
This file contains 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
NAME := $(shell uuidgen -r) | |
out.png: histogram.py image.jpg | |
docker run --name $(NAME) -w /work -v $$PWD:/work -v /output \ | |
ipython/scipystack python histogram.py | |
docker cp $(NAME):/output/out.png . | |
docker rm $(NAME) |
This file contains 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
NAME := $(shell uuidgen -r) | |
out.png: run/* | |
docker run --name $(NAME) -w /work -v $$PWD:/work -v /output \ | |
ipython/scipystack python make $(MFLAGS) | |
docker cp $(NAME):/output/out.png . | |
docker rm $(NAME) |
This file contains 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
NAME := $(shell uuidgen -r) | |
.PHONY: all | |
all: run/* | |
docker run --name $(NAME) -w /work -v $$PWD:/work -v /output \ | |
ipython/scipystack python make $(MFLAGS) | |
docker cp $(NAME):/output/out.png . | |
docker rm $(NAME) |
This file contains 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
all: run/* .datavol | |
docker run --rm --volumes-from=$$(cat .datavol) -w /work -v $$PWD/run:/work \ | |
-v /output ipython/scipystack make $(MFLAGS) | |
docker cp $$(cat .datavol):/output/out.png . | |
.datavol: | |
docker run --cidfile=$@ -v /output debian | |
clean: | |
docker rm -f $$(cat .datavol) |
This file contains 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
DATAVOL := docker-tutorial-data-container | |
all: out.png | |
out.png: run/* .datavol | |
docker run --rm --volumes-from=$(DATAVOL) -w /work -v $$PWD/run:/work \ | |
-v /output ipython/scipystack make $(MFLAGS) | |
docker cp $(DATAVOL):/output/out.png . | |
.datavol: | |
docker run --name $(DATAVOL) -v /output debian |
This file contains 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
CID := .container | |
CONTAINER = $(shell cat $(CID) 2>/dev/null) | |
all: out.png | |
out.png: run/* | |
ifneq "$(CONTAINER)" "" | |
docker restart $(CONTAINER) | |
docker attach $(CONTAINER) || docker logs $(CONTAINER) | |
else |
This file contains 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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
OlderNewer