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
#!/usr/bin/python | |
# | |
# Copyright (c) 2015 Benjamin Geiger <[email protected]> | |
""" | |
Module-specific doc string. | |
""" | |
from __future__ import absolute_import | |
from __future__ import division |
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
#!/usr/bin/python | |
# | |
# Copyright (c) 2015 Benjamin Geiger <email.redacted> | |
""" | |
Module-specific doc string. | |
""" | |
from __future__ import absolute_import | |
from __future__ import division |
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
#!/usr/bin/python | |
# | |
# Copyright (c) 2015 Benjamin Geiger <[email protected]> | |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from collections import defaultdict |
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 max(seq, key=lambda x: x): | |
return reduce(lambda x, y: y if key(y) > key(x) else x, seq[1:], seq[0]) |
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
infile = open(inputfilename, "r") | |
outfile = open(outputfilename, "w") | |
filter1 = subprocess.Popen(commandline1, stdin=infile, stdout=subprocess.PIPE, stderr=None) | |
filter2 = subprocess.Popen(commandline2, stdin=filter1.stdout, stdout=outfile, stderr=None) | |
filter1.stdout.close() # required so filter2 can get SIGPIPE, apparently | |
filter1.wait() | |
filter2.wait() |
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
#include <LiquidCrystal.h> | |
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); | |
#include <EEPROM.h> | |
/* | |
** Hardware configuration. | |
*/ |
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
foo = [[0] * 10] * 10 | |
print(foo) | |
foo[3][5] = 1 | |
print(foo) |
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
In [1]: foo = [1, 2, 3, 4, 5] | |
In [2]: def bar(lst): | |
...: lst.append(6) | |
...: | |
In [3]: bar(foo) | |
In [4]: foo | |
Out[4]: [1, 2, 3, 4, 5, 6] |
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 re | |
# Get a list of all stories. (This will have to be written at some point.) | |
stories = get_stories() | |
for story in stories: | |
summary = story.get_summary() | |
body = story.get_body() | |
if (not summary) or len(summary.trim()) == 0: |
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
[bgeiger@Maximus][~]$ ls -l /Library/Internet\ Plug-Ins/ | |
total 12 | |
drwxrwxr-x 3 root wheel 102 Oct 31 09:08 AdobeExManDetect.plugin | |
lrwxr-xr-x 1 root wheel 91 Oct 17 09:56 AmazonMP3DownloaderPlugin1017287.plugin -> /Applications/Amazon MP3 Downloader.app/Contents/Resources/AmazonMP3DownloaderPlugin.plugin | |
drwxrwxr-x 3 root wheel 102 Jan 9 15:10 Flash Player.plugin | |
drwxr-xr-x 3 root wheel 102 Aug 24 17:33 Flip4Mac WMV Plugin.plugin | |
lrwxr-xr-x 1 root wheel 86 Jan 9 17:03 JavaAppletPlugin.plugin -> /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin | |
drwxr-xr-x 3 root wheel 102 Jun 20 2012 Quartz Composer.webplugin | |
drwxr-xr-x 3 root wheel 102 Jun 20 2012 QuickTime Plugin.plugin | |
drwxrwxr-x 3 root wheel 102 Apr 2 2012 SharePointBrowserPlugin.plugin |
NewerOlder