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 time | |
from nose2.tools import such | |
def slow_blocking_init(): | |
time.sleep(1) | |
print("a second elapsed") | |
time.sleep(1) | |
print("a second elapsed") | |
return 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
# std | |
import io | |
import time | |
# vendor | |
import serial | |
ser = serial.Serial('/dev/tty.usbserial-A6008sxN', 115200, timeout=1) | |
time.sleep(2) |
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
#!/usr/bin/env python | |
""" | |
This script reads in lines of UTF-8 text from stdin, | |
applies the NLTK English sentence tokenizer to the text, and | |
prints out the split lines to stdout (in UTF-8), preserving runs of two or more | |
newline characters. | |
N.B. An assumption being made is that the NLTK English Punkt model is already | |
installed in an appropriate location in the environment. | |
""" |
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
$ python manage.py shell | |
/Users/orluke/src/neo4django-tutorial/venv/src/neo4django/neo4django/db/models/relationships.py:170: UserWarning: `lazycat_set` and `lazycat_set` share a relationship type and direction. Is this what you meant to do? | |
% (r.name, name)) | |
Python 2.7.3 (default, Feb 6 2013, 23:59:57) | |
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from polls.models import Poll, Choice | |
/Users/orluke/src/neo4django-tutorial/venv/src/neo4django/neo4django/db/models/relationships.py:170: UserWarning: `choices` and `choices` share a relationship type and direction. Is this what you meant to do? | |
% (r.name, name)) |
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
function split_novowel { | |
echo $1 | cut -d_ -f$2 | sed 's/[aeiou]//g' | |
} | |
function abbr { | |
echo $(split_novowel $1 1 | cut -c 1-3)$(split_novowel $1 2 | cut -c 1-1) | |
} | |
abbr Computer_Hardware |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Luke Orland | |
# [email protected] | |
# Fri Apr 27 14:51:01 EDT 2012 | |
# EXAMPLE USAGE: | |
# $ zcat gigaword/data/*/*gz | python gigaword-separate-sentences.py > text |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import argparse | |
import os | |
def file_size(file_name): | |
"""Returns size of the file named file_name in bytes.""" | |
if not os.path.exists(file_name): | |
msg = "The file {} does not exist.".format(file_name) |
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
#!/usr/bin/env python | |
# Convert Mediasite content for a lecture into two DV-formatted videos: | |
# one from the lecture | |
# one of the slideshow with timings extracted from the Mediasite content. | |
# | |
# Usage: run this Python script from the root directory of the Mediasite | |
# content. | |
# It's the directory that contains the directories and files as follows: | |
# App_Themes/ Content/ Player.html PlayerOptions/ Players/ |
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
#!/usr/bin/env bash | |
set -x | |
HANDBRAKECLI_DMG="/Volumes/CLSP-500GB/handbrakeCLI/HandBrake-0.9.5-MacOSX.5_CLI_x86_64.dmg" | |
HANDBRAKECLI="/Volumes/HandBrake-0.9.5-MacOSX.5_CLI_x86_64/HandBrakeCLI" | |
open $HANDBRAKECLI_DMG | |
sleep 4s | |
DVD="$1" | |
DEST="$2" |
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
$ git commit | |
Error detected while processing /Users/orluke/src/newnew_dotvim/.vim/bundle/vim-pandoc/plugin/pandoc.vim: | |
line 1: | |
E319: Sorry, the command is not available in this version: python<<EOF | |
line 2: | |
E488: Trailing characters: # We register openers with PandocRegisterExecutor. | |
line 3: | |
E488: Trailing characters: # We take its first argument as the name of a vim ex command, the second | |
line 4: | |
E488: Trailing characters: # argument as a mapping, and the rest as the description of a command, |