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
def filestream(file, interval=1.0): | |
with open(file) as f: | |
while True: | |
where = f.tell() | |
line = f.readline() | |
if not line: | |
time.sleep(interval) | |
f.seek(where) | |
else: | |
yield line |
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
perl -ne '$H{$_}++ or print' |
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
''' | |
Code snippet to plot multiple triangle's in Matplotlib using different methods. | |
''' | |
import time | |
import sys | |
import matplotlib.pyplot as pp | |
import numpy as np | |
from matplotlib.collections import PolyCollection | |
import random | |
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
CXXFLAGS=-Wall -Wextra -Werror -DLINUX | |
CXX_DEBUG_FLAGS=-g3 -DDEBUG_ALL | |
CXX_RELEASE_FLAGS=-O3 | |
.PHONY: debug | |
debug: CXXFLAGS+=$(CXX_DEBUG_FLAGS) | |
debug: HelloWorldD | |
.PHONY: release | |
release: CXXFLAGS+=$(CXX_RELEASE_FLAGS) |
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
#!/bin/bash | |
######################################################################## | |
## This script is used to start/stop the dsmcad under ubuntu | |
## The original script was: start/stop mldonkey p2p client | |
## 2007 by Christoph Langner, published under the GPL v3 | |
## published on http://wiki.ubuntuusers.de/MLDonkey | |
## Changed the script to start/stop the dsmcad for ubuntu | |
## 2008 by Timo Scheller, published under the GPL v3 | |
## Modified, Feb. 2009 for Ubuntu Server 8.04.2 | |
## Modified, Feb. 2010, Fixed to change this ANS4042E: http://www-01.ibm.com/support/docview.wss?uid=swg21290640 |
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
TEX = pdflatex -interaction nonstopmode | |
BIB = bibtex | |
GS = gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite | |
COVER = cover | |
PAPER = paper_main | |
SUPP = paper_supp | |
BIBFILE = temp.bib | |
BUNDLE = paper_bundle.pdf |
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
def isiterable(obj): | |
return hasattr(obj, '__contains__') |
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 numpy as np | |
def peakdetect(y_axis, x_axis = None, lookahead = 500, delta = 0): | |
""" | |
Converted from/based on a MATLAB script at http://billauer.co.il/peakdet.html | |
Algorithm for detecting local maximas and minmias in a signal. | |
Discovers peaks by searching for values which are surrounded by lower | |
or larger values for maximas and minimas respectively | |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: dsmc | |
# Required-Start: $local_fs $network $syslog | |
# Required-Stop: $local_fs $network $syslog | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: Start and stop the Tivoli Storage Client | |
# Description: Control the IBM Tivoli Storage Manager Client Schedule instance | |
### END INIT INFO |
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
#!/bin/sh | |
sudo update-texmf | |
sudo texhash | |
sudo mktexlsr |
NewerOlder