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
create table users( | |
userid integer not null, | |
username char(8), | |
firstname varchar(30), | |
lastname varchar(30), | |
city varchar(30), | |
state char(2), | |
email varchar(100), | |
phone char(14), | |
likesports boolean, |
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
copy users from '/tmp/s3/allusers_pipe.txt' with null as '' delimiter '|'; | |
copy venue from '/tmp/s3/venue_pipe.txt' delimiter '|'; | |
copy category from '/tmp/s3/category_pipe.txt' with null as '' delimiter '|'; | |
copy date from '/tmp/s3/date2008_pipe.txt' with null as '' delimiter '|'; | |
copy event from '/tmp/s3/allevents_pipe.txt' with null as '' delimiter '|'; | |
copy listing from '/tmp/s3/listings_pipe.txt' with null as '' delimiter '|'; | |
copy sales from '/tmp/s3/sales_tab.txt' with null as '' delimiter '\t'; |
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
copy users from '/tmp/s3/allusers_pipe.txt' with null as '' delimiter '|'; | |
copy venue from '/tmp/s3/venue_pipe.txt' delimiter '|'; | |
copy category from '/tmp/s3/category_pipe.txt' with null as '' delimiter '|'; | |
copy date from '/tmp/s3/date2008_pipe.txt' with null as '' delimiter '|'; | |
copy event from '/tmp/s3/allevents_pipe.txt' with null as '' delimiter '|'; | |
copy listing from '/tmp/s3/listings_pipe.txt' with null as '' delimiter '|'; | |
copy sales from '/tmp/s3/sales_tab.txt' with null as '' delimiter '\t'; |
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
escape ^Z^\ | |
vbell off | |
# don't show startup messages | |
startup_message off | |
# detach on hangup - if my dial-up session fails, screen will simply | |
# detach and let me re re-attach later. | |
autodetach on |
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
{ | |
"version": 2, | |
"waiters": { | |
"DataSourceAvailable": { | |
"delay": 30, | |
"operation": "GetDataSource", | |
"maxAttempts": 60, | |
"acceptors": [ | |
{ | |
"expected": "COMPLETED", |
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
/* | |
* http://www.graphviz.org/ | |
* $ dot -Tpng test.dot -o test.png | |
* rollback can be disabled | |
*/ | |
digraph create_stack { | |
CreateStack_API [shape=box]; | |
DeleteStack_API[shape=box]; | |
CREATE_COMPLETE [style=filled,color=blue]; // OK | |
CREATE_FAILED [style=filled,color=red]; // NG |
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
diff --git a/stackexchange/__init__.py b/stackexchange/__init__.py | |
index c257838..32e3fb7 100644 | |
--- a/stackexchange/__init__.py | |
+++ b/stackexchange/__init__.py | |
@@ -542,7 +542,7 @@ through here.""" | |
try: | |
if isinstance(ob, datetime.datetime): | |
return str(time.mktime(ob.timetuple())) | |
- elif isinstance(ob, str): | |
+ elif isinstance(ob, basestring): |
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
# Python port of half duplex FIFO program : http://developers.sun.com/solaris/articles/named_pipes.html | |
import sys | |
import config | |
def main(): | |
if len(sys.argv) < 2: | |
print 'Usage : %s <string to be sent to the server>' % sys.argv[0] | |
sys.exit(0) | |
wr = open(config.HALF_DUPLEX, 'wb') |
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
# Michael Kerrisk : "The Linux Programming Interface" CH.44 : sequence number server(Python Implementation) | |
# fifo_seqnum_client | |
import atexit | |
import os | |
import struct | |
import sys | |
import config |
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
# http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters | |
# http://www.michaelnielsen.org/ddi/why-bloom-filters-work-the-way-they-do/ | |
import hashlib | |
class BloomFilter(object): | |
def __init__(self, m, k): | |
self.m = m | |
self.k = k | |
self.array = [0 for i in range(m)] |
OlderNewer