See https://github.com/facebook/presto/wiki/HTTP-Protocol
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
public class A { | |
private final int dataSize = (int) (Runtime.getRuntime().maxMemory() * 0.6); | |
public void f() | |
{ | |
{ | |
byte[] data = new byte[dataSize]; | |
} | |
byte[] data2 = new byte[dataSize]; |
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
bash_prompt() { | |
local status=$(git status 2> /dev/null | grep 'working directory clean') | |
local dirty='' | |
if [ -z "$status" ]; then | |
local dirty='*' | |
fi | |
local branch=$(git branch 2> /dev/null | grep -e "\* " | sed "s/^..\(.*\)/\1/") | |
if [ -z "$branch" ]; then | |
export PS1="[$(date +%H:%M) \u@\[\033[33m\]\h\[\033[39m\]:\w] " |
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
test |
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
public class X | |
{ | |
public static void main(String[] args) | |
throws InterruptedException | |
{ | |
final Thread t = new Thread(new Runnable() { | |
@Override | |
public void run() | |
{ |
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 ruby | |
limit = ARGV[0].to_i | |
result = Array.new(limit) | |
count = 0 | |
STDIN.each_line do |line| | |
if count < limit | |
result[count] = line |
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
VirtualMachineDescriptor virtualMachineDescriptor = VirtualMachine.list().get(0); | |
MonitoredHost host = MonitoredHost.getMonitoredHost("localhost"); | |
MonitoredVm monitoredVm = host.getMonitoredVm(new VmIdentifier(virtualMachineDescriptor.id())); | |
System.out.println(MonitoredVmUtil.commandLine(monitoredVm)); |
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 | |
function setjdk { | |
local ver=${1?Usage: setjdk <version>} | |
export JAVA_HOME=$(/usr/libexec/java_home -v $ver) | |
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':') | |
export PATH=$JAVA_HOME/bin:$PATH | |
} | |
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 | |
function setjdk { | |
local ver=${1?Usage: setjdk <version>} | |
export JAVA_HOME=$(/usr/libexec/java_home -v $ver) | |
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':') | |
export PATH=$JAVA_HOME/bin:$PATH | |
} | |
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.annotation.JsonProperty; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
import com.fasterxml.jackson.databind.JavaType; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver; | |
import com.fasterxml.jackson.databind.jsontype.TypeIdResolver; | |
import com.fasterxml.jackson.databind.type.SimpleType; | |
import java.io.IOException; |
OlderNewer