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
f = open('gps-ops.txt') | |
out = open('gps-ops.tsv','wb') | |
count = 0 | |
output = '' | |
for row in f: | |
if count % 3 != 2: | |
output += row.strip() + '\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
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.HBaseConfiguration; | |
import org.apache.hadoop.hbase.client.HTable; | |
import org.apache.hadoop.hbase.client.Put; | |
import org.apache.hadoop.hbase.util.Bytes; | |
import java.io.IOException; public | |
class PutExample { | |
public static void main(String[] args) throws IOException { | |
Configuration conf = HBaseConfiguration.create(); |
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
{ | |
"name": "Entry", | |
"namespace": "com.shawnhermans.avro.atom", | |
"doc": "A sample Atom entry", | |
"type": "record", | |
"fields": [ | |
{"name": "title", "type": "string"}, | |
{"name": "id", "type": "string"}, | |
{"name": "updated", "type": ["long", "string"]}, | |
{"name": "published", "type": ["long", "null", "string"]}, |
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 avro.schema | |
from avro.datafile import DataFileWriter | |
from avro.io import DatumWriter | |
schema = avro.schema.parse(open('entry.avsc').read()) | |
writer = DataFileWriter(open("entries.avro", "w"), DatumWriter(), schema) | |
entry = {u'authors': [{u'email': u'f8dy@example.com', | |
u'name': u'Mark Pilgrim', | |
u'uri': u'http://example.org/'}], |
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
@outputSchema("output:map[]") | |
def tupleToMap(inputs): | |
field_names = ["field1", "field2", "field3"] | |
result = {} | |
if len(field_names) == len(inputs): | |
for i in range(len(inputs)): | |
result[field_names[i]] = inputs[i] | |
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
ffmpeg -i $1 -codec:v libx264 -profile:v high -preset slower -crf 25 -threads 0 -codec:a libfdk_aac -b:a 128k -f mp4 $2 |
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
#!/bin/bash | |
# Mount the installer image | |
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
# Convert the boot image to a sparse bundle | |
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite | |
# Increase the sparse bundle capacity to accommodate the packages | |
hdiutil resize -size 8g /tmp/Yosemite.sparseimage |
From a sociological standpoint, disciplines are defined less by their intellectual structure and content than by the scientists who identify with them. But more accurately, over time the intellectual content of a discipline gradually defines its boundaries and membership, whereas its membership gradually redefines its content.
OlderNewer