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
# -*- coding:utf8 -*- | |
import time | |
import threading | |
import logging | |
from Queue import Queue, Full as FullQueue | |
from random import randrange | |
logging.basicConfig(level=logging.DEBUG, | |
format='%s(asctime)s (%(threadName)-2s) %(message)s') |
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
"Multiple dispatch in Python with configurable dispatch resolution" | |
_AUTHOR=["David Mertz (mertz@gnosis.cx)",] | |
_THANKS_TO=[ | |
"Tim Hochberg (tim.hochberg@ieee.org)", | |
"Samuele Pedroni (pedronis@bluewin.ch)", | |
] | |
_COPYRIGHT=""" | |
This file is released to the public domain. I (dqm) would | |
appreciate it if you choose to keep derived works under terms |
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
# -*- coding: utf-8 -*- | |
""" | |
LICENSE: BSD (same as pandas) | |
example use of pandas with oracle mysql postgresql sqlite | |
- updated 9/18/2012 with better column name handling; couple of bug fixes. | |
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle. | |
to do: | |
save/restore index (how to check table existence? just do select count(*)?), | |
finish odbc, |
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
Dockerfile + Node.js Examples |
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
language: python | |
python: | |
- 2.7 | |
services: | |
- docker | |
hosts: | |
- feed.bencane.com | |
- bencane.com |
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
# -*- coding: utf-8 -*- | |
"""A simple tool to document how to control AWS resources. | |
AWS AUTHENTICATION | |
------------------- | |
In order to run any of the code below, you need a profile with AWS credentials | |
set up on your computer. It's very easy to do this. Google how to configure | |
your profile with boto3, or visit the docs: |
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/env bash | |
# more bash-friendly output for jq | |
JQ="jq --raw-output" | |
configure_aws_cli(){ | |
aws --version | |
aws configure set default.region us-east-1 |
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
""" | |
Implemention of the hash table with the open adressing | |
""" | |
NIL = 'NIL' | |
DELETED = 'deleted' | |
C1 = 2 | |
C2 = 3 | |
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
INF = float('inf') | |
def merge(A, p, q, r): | |
L = A[p:q + 1] | |
R = A[q + 1:r + 1] | |
L.append(INF) | |
R.append(INF) | |
i = j = 0 | |
for k in range(p, r + 1): |
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 merge(A, p, q, r): | |
L = A[p:q + 1] | |
R = A[q + 1: r + 1] | |
i = j = 0 | |
for k in range(p, r + 1): | |
if i == len(L): | |
A[k] = R[j] | |
j += 1 | |
elif j == len(R): | |
A[k] = L[i] |
OlderNewer