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
XBuild Engine Version 12.0 | |
Mono, Version 4.2.0.0 | |
Copyright (C) 2005-2013 Various Mono authors | |
Loading default tasks for ToolsVersion: 4.0 from /usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.Common.tasks | |
Build started 1/27/2016 9:48:30 AM. | |
__________________________________________________ | |
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. | |
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. | |
Project "MYPROJECT.fsproj" (default target(s)): |
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 -e | |
""" USAGE: ./remove_empty_part_files.sh <qualified hdfs dir path> """ | |
HDFS=$1 | |
echo "checking for empty files in $HDFS..." | |
IFS=$'\n' | |
for i in `hadoop fs -ls $HDFS/* | grep -e "$HDFS/.*" | awk '{print $0}'` ; do | |
file=$(echo $i | awk '{print $8}') | |
size=$(echo $i | awk '{print $5}') | |
if [ $size -eq 0 ]; then |
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
open Newtonsoft.Json | |
let rec private _flattenJson (delim:string) (pkey:string) (json:JsonValue): (string * JsonValue) seq = | |
json.Properties | |
|> Seq.collect (fun (k, v) -> | |
match v with | |
| JsonValue.Record r -> _flattenJson delim k (JsonValue.Record r) | |
| _ -> [(pkey + delim + k, v)] |> Seq.ofList | |
) | |
/// flatten a Json nested children and stop at primitive or Array. specify delimiter for nested key names. |
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.google.gson.Gson | |
import java.util.{Map => JMap, LinkedHashMap} | |
type GenericDecoder = String => JMap[String, Object] | |
val decoder: GenericDecoder = { | |
// Gson instances are apparently thread-safe, so curry... | |
val gson: Gson = new Gson() | |
// LinkedHashMap preserves ordering. use HashMap if not required. | |
x => gson.fromJson(x, (new LinkedHashMap[String, Object]()).getClass) |
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
package main | |
import ( | |
"bytes" | |
"log" | |
"sort" | |
) | |
// implement `Interface` in sort package. | |
type sortByteArrays [][]byte |
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
// v2 of the great example of SSE in go by @ismasan. | |
// includes fixes: | |
// * infinite loop ending in panic | |
// * closing a client twice | |
// * potentially blocked listen() from closing a connection during multiplex step. | |
package main | |
import ( | |
"fmt" | |
"log" |
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
package io.schmohl; | |
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class FriendCircles { | |
/* |
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
package io.schmohl; | |
import java.util.*; | |
public class StringChain { | |
// we can use depth first search for each word to calculate the length of the chain. | |
static int longestChain(String[] words) { |
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
public class BlockingQueue implements Queue { | |
private java.util.Queue queue = new java.util.LinkedList(); | |
/** | |
* Make a blocking Dequeue call so that we'll only return when the queue has | |
* something on it, otherwise we'll wait until something is put on it. | |
* | |
* @returns This will return null if the thread wait() call is interrupted. | |
*/ |
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 | |
yum install -y aws-cli | |
cd /home/ec2-user/ | |
aws s3 cp 's3://aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm' . --region us-east-1 | |
yum -y install codedeploy-agent.noarch.rpm |