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
==> ./configure prefix=/Users/adamv/homebrew/Cellar/cmus/2.7.1_1 mandir=/Users/adamv/homebrew/Cellar/cmus/2.7.1_1/share/man | |
checking for program clang... /Users/adamv/homebrew/Library/ENV/4.3/clang | |
checking for program gcc... /Users/adamv/homebrew/Library/ENV/4.3/gcc | |
checking for CFLAGS -std=gnu99 -pipe -Wall -Wshadow -Wcast-align -Wpointer-arith -Wwrite-strings -Wundef -Wmissing-prototypes -Wredundant-decls -Wextra -Wno-sign-compare -Wformat-security... yes | |
checking for CFLAGS -Wold-style-definition... yes | |
checking for CFLAGS -Wno-pointer-sign... yes | |
checking for CFLAGS -Werror-implicit-function-declaration... yes | |
checking for CFLAGS -Wno-unused-parameter... yes | |
checking if CC can generate dependency information... yes | |
checking byte order... little-endian |
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
package test.util; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.hamcrest.Description; | |
import org.hamcrest.TypeSafeMatcher; | |
import java.io.IOException; | |
import java.net.URL; |
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
class Table(object): | |
def __init__(self): | |
self.rows = [] | |
def add(self, row): | |
self.rows.append(row) | |
def render(self): | |
if not self.rows: | |
return |
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 com.google.common.base.Strings; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* S3Location represents an S3 bucket and a key. | |
*/ | |
public class S3Location { | |
/** |
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 com.google.common.base.Joiner; | |
import com.google.common.collect.Lists; | |
import java.util.Comparator; | |
import java.util.List; | |
import java.util.ListIterator; | |
public class Incr2 { | |
static class Datum { | |
final int id; |
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
check_if_master() { | |
python - <<'__SCRIPT__' | |
import sys | |
import json | |
instance_file = "/mnt/var/lib/info/instance.json" | |
with open(instance_file) as f: | |
props = json.load(f) | |
is_master = props.get('isMaster', False) |
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
class WorkaroundInputStream extends FilterInputStream { | |
static final int CONTROL_Z = 26; | |
protected WorkaroundInputStream(InputStream in) { | |
super(in); | |
} | |
@Override | |
public int read() throws IOException { |
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
// Subclass TextOutputFormat so we can use a base ".json" extension. | |
// adamv: I feel as if this shouldn't be this complicated. | |
static class JsonTextOutputFormat extends TextOutputFormat<LongWritable, Text> { | |
@Override | |
public RecordWriter<LongWritable, Text> | |
getRecordWriter(TaskAttemptContext job | |
) throws IOException, InterruptedException { | |
Configuration conf = job.getConfiguration(); | |
boolean isCompressed = getCompressOutput(job); | |
String keyValueSeparator = conf.get(SEPERATOR, "\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
#!/usr/bin/env python3.4 | |
import tempfile | |
from subprocess import call | |
with tempfile.NamedTemporaryFile() as f: | |
for i in range(500): | |
f.write(bytes("abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij\n", 'UTF-8')) | |
f.flush() | |
call(["cat", f.name]) |
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 com.fasterxml.jackson.core.JsonFactory | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import com.fasterxml.jackson.databind.util.TokenBuffer | |
import com.fasterxml.jackson.dataformat.smile.SmileFactory | |
object SmileDemo { | |
val JSON_FACTORY: JsonFactory = new JsonFactory() | |
val SMILE_FACTORY: SmileFactory = new SmileFactory() | |
val JSON = new ObjectMapper(JSON_FACTORY) |