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
JFLAGS = -g | |
JC = javac | |
.SUFFIXES: .java .class | |
.java.class: | |
$(JC) $(JFLAGS) $*.java | |
CLASSES = Service.java |
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.mashape.unirest.http.HttpResponse; | |
import com.mashape.unirest.http.JsonNode; | |
import com.mashape.unirest.http.Unirest; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.HashMap; |
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 io.reactivex.*; | |
import org.apache.geode.cache.*; | |
import org.apache.geode.cache.client.ClientCache; | |
import org.apache.geode.cache.client.ClientCacheFactory; | |
import org.apache.geode.cache.client.ClientRegionFactory; | |
import org.apache.geode.cache.client.ClientRegionShortcut; | |
import org.apache.geode.cache.query.*; | |
import org.apache.geode.cache.query.internal.cq.CqAttributesImpl; | |
import java.util.Random; |
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
apply plugin: 'groovy' | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
compile 'org.codehaus.groovy:groovy:2.4.8' | |
compile 'org.apache.geode:geode-core:1.1.0' | |
} |
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 java.util.AbstractMap.SimpleEntry; | |
import java.util.HashMap; | |
import java.util.Map; | |
// A pretty, but expensive way to create maps | |
public class MapLiteral { | |
public static <K,V> Map.Entry<K, V> e(K key, V value) { | |
return new SimpleEntry<K,V>(key, value); | |
} |
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 java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Compressor { | |
private Compressor() {}; | |
public static <V extends ICompressible<K, V>, K> Collection<V> compress(Collection<V> original) { |
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
<?php | |
class DBUtil { | |
/** | |
* Concatenate fields using the driver's valid SQL operator. | |
* | |
* @param array | |
* | |
* @example |
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
<?php namespace DAO; | |
class StorageException extends \Exception {} | |
class DuplicateRecordException extends \Exception {} | |
interface DAO { | |
/** | |
* Checks if an Entity exists in the datastore. | |
* |
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
#!/usr/bin/python | |
from time import time | |
mark = 0 | |
def tic(): | |
global mark | |
mark = time() |
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
#include <string> | |
#include <vector> | |
/* Trims a string of any characters provided in the char list */ | |
string trim(string str, string charlist = " \t\f\v\n\r") | |
{ | |
int first, last; | |
last = str.find_last_not_of(charlist); | |
// only contains chars that are being trimmed, return "" | |
if (last == string::npos) |