This file contains hidden or 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 sys,json,fileinput | |
| # if obj["pageId"] == "AmericanIdol": | |
| for line in fileinput.input(): | |
| obj = json.loads(line) | |
| if obj["utc"] > 1359878460000 and obj["utc"] < 1359964740000 and obj["pageId"] == "ironman": | |
| print "%s %s" % (obj["pageId"], obj["utc"]) | |
This file contains hidden or 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 sys,json,fileinput | |
| for line in fileinput.input(): | |
| try: | |
| obj = json.loads(line) | |
| postId = obj["postId"] | |
| if len(postId) < 3: | |
| print "%s" % (obj["id"]) | |
| except: | |
| print "error line: " + line |
This file contains hidden or 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 sys,json,fileinput | |
| import rethinkdb as r | |
| #python rdbFill.py /data/exports3/rawProd/fbComment/* | |
| r.connect('dcd3', 28015).repl() | |
| t = r.db('test').table('oink') | |
| i = 0 | |
| lines = [] |
This file contains hidden or 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 com.datastax.driver.core.*; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| import java.util.UUID; | |
| /** | |
| * CREATE TABLE tag (id uuid, foreignId uuid ,name text, lowerName text,PRIMARY KEY (id) ); | |
| * | |
| * create index TagNameIdx on tag(name); |
This file contains hidden or 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
| <assembly> | |
| <id>deps</id> | |
| <formats> | |
| <format>jar</format> | |
| </formats> | |
| <includeBaseDirectory>false</includeBaseDirectory> | |
| <dependencySets> | |
| <dependencySet> | |
| <outputDirectory>/</outputDirectory> | |
| <unpack>true</unpack> |
This file contains hidden or 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 boto.sqs import regioninfo | |
| import logging | |
| from boto.sqs.jsonmessage import JSONMessage | |
| # useful for debugging boto connect | |
| #logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG) | |
| logger = logging.getLogger(__name__) | |
This file contains hidden or 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 boto | |
| import cmb | |
| # erich on velum.io CMB | |
| #export AWS_ACCESS_KEY=UZXEHK0D44TQRY4SI52E | |
| #export AWS_SECRET_ACCESS_KEY=1JfVhGZhvPB2Hw18cHsmaQtZbMXCQOzMWXy1H2q2 | |
| conn = cmb.cmb_cxn('UZXEHK0D44TQRY4SI52E', '1JfVhGZhvPB2Hw18cHsmaQtZbMXCQOzMWXy1H2q2', 'cmb' ,'velum.io') |
This file contains hidden or 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
| //login with client ID & secret but does | |
| val client = new Client(Config.OrgName, Config.AppName) | |
| client.setApiUrl(Config.UserGridUrl) | |
| client.setApplicationId(Config.AppId) | |
| val resp = client.authorizeAppClient(Config.UserGridClientId, Config.UserGridClientSecret) | |
| if(resp.getError != null){ | |
| error("Login status: " + resp) | |
| throw new LoginException(resp.getError) |
This file contains hidden or 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
| // Compute factor for amps calculation | |
| const float factor = 5.0 / 1023.0 / 5.0 * 600.0 | |
| void setup() | |
| { | |
| // initialize serial communication at 9600 bits per second: | |
| Serial.begin(9600); | |
| } | |
| void loop() |
This file contains hidden or 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
| #!/bin/bash | |
| OUT_DIR=/mnt/scans | |
| TMP_DIR=`mktemp -d` | |
| FILE_NAME=scan_`date +%Y-%m-%d-%H%M%S` | |
| LANGUAGE="eng" # the tesseract language - ensure you installed it | |
| echo 'scanning...' | |
| scanimage --resolution 300 \ | |
| --batch="$TMP_DIR/scan_%03d.pnm" \ |