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
'''Create a print job string for page range by supplying | |
a total range of pages and an exclude list (such as graphical | |
pages or ones simply not needed). | |
Example: | |
In [1]: from printer_jobs_strings import make_print_string | |
In [2]: pages = range(0, 25) | |
In [3]: exclude = [3, 6, 7, 8, 15, 24] | |
In [4]: make_print_string(pages, exclude) | |
Out[5]: '0-2,4-5,9-14,16-23' |
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
import multiprocessing | |
import os | |
import sys | |
import time | |
import Queue | |
import threading | |
from tkwindow import Report | |
from watchdog import WatchDog | |
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
import matplotlib.pyplot as plt | |
import numpy | |
import random | |
plt.ion() | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
ax.grid(True) |
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
def h_index(pubs): | |
"""n-publicaions with at least n-citations""" | |
# sort the list of citations | |
pubs = sorted(pubs) | |
# iterate over the sorted list | |
for i, x in enumerate(pubs): | |
# number of citations including this one and greater | |
n = len(pubs[i:]) | |
# if this citaiton index is greater than or equal to | |
# n, we have an h_index |
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
wget -q -O- http://feeds.serialpodcast.org/serialpodcast | grep -o "<enclosure[ -~][^>]*" | grep -o "http://[ -~][^\"]*" | xargs wget -c |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
OlderNewer