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
from subprocess import Popen, PIPE | |
outproc = None | |
linecount = 0 | |
p = Popen('cat input.txt', shell=True, stdout=PIPE) | |
for line in p.stdout.xreadlines(): | |
if linecount % 1000000 == 0: | |
outfile = "output%03d" %(linecount // 1000000, ) | |
if outproc: | |
#outproc.stdin.flush() |
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 os.path | |
import sys | |
def main(pid): | |
f = open(os.path.join('/proc', pid, 'maps')) | |
for l in f.readlines(): | |
col = l.split() | |
if len(col) == 5: | |
address, perms, offset, device, inode = col | |
pathname = '' |
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
Unhandled Exception in Bug Search (Hide) | |
System.ApplicationException: Buffer cannot be null. | |
Parameter name: array | |
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count) | |
at FogCreek.Search.Store.Buffer.ProcessValid(FileStream stream, FileStream valid, Int64 pos, Int32 length, Boolean fetch) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Buffer.cs:line 297 | |
at FogCreek.Search.Store.Buffer.Read(Int64 pos, Byte[] b, Int32 offset, Int32 length) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Buffer.cs:line 451 | |
at FogCreek.Search.Store.Input.ReadInternal(Byte[] b, Int32 offset, Int32 length) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Input.cs:line 38 | |
at Lucene.Net.Store.BufferedIndexInput.Refill() in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Lucene.Net\Store\BufferedIndexInput.cs:line 77 | |
at FogCreek.Searc |
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
pip install gunicorn | |
gunicorn testapp:app |
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
sudo apt-get install ruby1.9.1 ruby1.9.1-dev | |
gem1.9.1 install --user rake | |
gem1.9.1 install --user bundler | |
# nokogiri requirements | |
# see http://nokogiri.org/tutorials/installing_nokogiri.html | |
sudo apt-get install libxslt-dev libxml2-dev | |
~/.gem/ruby/1.9.1/bin/bundle install --path ~/.gem/ruby/1.9.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
#! /usr/bin/env ruby | |
require 'yaml' | |
environment = YAML.load_file('../environment.yml') | |
database = YAML.load_file('config/database.yml') | |
prod_db = database['production'] | |
prod_db['username'] = environment['DOTCLOUD_DB_SQL_LOGIN'] | |
prod_db['password'] = environment['DOTCLOUD_DB_SQL_PASSWORD'] | |
prod_db['host'] = environment['DOTCLOUD_DB_SQL_HOST'] | |
prod_db['port'] = Integer(environment['DOTCLOUD_DB_SQL_PORT']) |
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
var fs = require('fs'); | |
var path = require('path'); | |
var vm = require('vm'); | |
var argv = require('optimist').argv; | |
function compileHandlebarsTemplate(file, onComplete) { | |
//dummy jQuery | |
var jQuery = function () { return jQuery } | |
jQuery.ready = function () { return jQuery } | |
jQuery.inArray = function () { return jQuery } |
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
hidden_bin_string = '01011001001100110101011001110111011000100011' \ | |
'001000110100011001110101100100110010001110010110101101011010' \ | |
'010101000110111101100111010100110101010100110001010101000101' \ | |
'010000110000011110000100011001010010010101100101000101100111' \ | |
'01001111011110010110101100111101' | |
from itertools import groupby | |
from base64 import b64decode | |
bit_counts = [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
// Version: v0.14 | |
// Last commit: d9cd270 (2013-08-31 17:12:14 -0700) | |
(function() { | |
var define, requireModule; | |
(function() { | |
var registry = {}, seen = {}; |
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
{ | |
"url": "http://localhost:8000/api/v1/choices/1/", | |
"poll": "http://localhost:8000/api/v1/polls/1/", | |
"choice_text": "Pretty confusing", | |
"votes": 0 | |
} |
OlderNewer