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 | |
import sys | |
import urllib | |
from BeautifulSoup import BeautifulSoup, SoupStrainer | |
import re | |
filename = sys.argv[1] | |
with open(filename) as f: |
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 codecs | |
def unicode_safe_127(ss): | |
"""safely handle strings with hard ordinal values greater than 127 | |
by escaping each value as appropriate""" | |
mys = ss | |
tos=[] | |
for i,s in enumerate(mys): | |
if ord(s)>127: | |
print codecs.unicode_escape_encode(mys)[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
[sandboxuser@box42-107 blueprint]$ git diff | |
diff --git a/blueprint/git.py b/blueprint/git.py | |
index 39f7743..c6ea528 100644 | |
--- a/blueprint/git.py | |
+++ b/blueprint/git.py | |
@@ -27,6 +27,7 @@ def init(): | |
""" | |
dirname = repo() | |
try: | |
+ unroot() |
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
require 'rubygems' | |
require 'fog' | |
require 'ap' | |
require 'time' | |
def print_usage() | |
puts "Assumes all devices from sdc to sdz are available" | |
puts "Usage: volume attach [aws instance id] ['raid-name' tag value] ['snap-time' tag value]" | |
puts "Usage: volume detach ['raid-name' tag value] ['snap-time' tag value]" | |
puts "Usage: volume create ['raid-name' tag value] ['snap-time' tag value]" |
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
<?php | |
/** | |
* Sends statistics to the stats daemon over UDP | |
* | |
**/ | |
class StatsD { | |
/** |
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
[~/src/logstash]> git diff | |
diff --git a/lib/logstash/agent.rb b/lib/logstash/agent.rb | |
index 750aba6..23fff2a 100644 | |
--- a/lib/logstash/agent.rb | |
+++ b/lib/logstash/agent.rb | |
@@ -15,6 +15,8 @@ require "optparse" | |
require "thread" | |
require "uri" | |
+include_class Java::java.lang.Error |
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
<?php | |
class BitArray { | |
//Sacrifice 2x the amount of memory, so we can use pack/unpack easily | |
const INT_SIZE = 4; | |
private $bitArray; | |
public function __construct($numberOfBits, $bitArray = null) { | |
$numberOfInts = $numberOfBits / self::INT_SIZE / 8; // PHP_INT_SIZE is in bytes |
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
require_once("BitArray.php"); | |
$test = new BitArray(128); | |
$test->setBit(12); | |
$test2 = new BitArray(128); | |
$test2->setBit(126); | |
$test3 = BitArray::orFn($test, $test2); | |
var_dump($test3); | |
var_dump($test); | |
var_dump($test2); | |
$test2 = new BitArray(60); |
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
<?php | |
class BitArray { | |
//Sacrifice 2x the amount of memory, so we can use pack/unpack easily | |
const INT_SIZE = 4; | |
private $bitmapString; | |
public function __construct($numberOfBits = 64, $bitmapString = null) { | |
if($bitmapString!= null) |
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
<?php | |
require_once("BitArray.php"); | |
$test = new BitArray(128); | |
$test->setBit(12); | |
var_dump($test->toIntArray()); | |
$test2 = new BitArray(128); | |
$test2->setBit(126); | |
var_dump($test2->toIntArray()); | |
$test3 = BitArray::orFn($test, $test2); | |
var_dump($test3->toIntArray()); |
OlderNewer