Skip to content

Instantly share code, notes, and snippets.

{
"notebook:close-and-shutdown": {
"command": "notebook:close-and-shutdown",
"keys": [
"Alt W"
],
"selector": ".jp-Notebook"
},
"notebook:change-cell-to-raw": {
"command": "notebook:change-cell-to-raw",
@ashigeru
ashigeru / MRC.java
Created July 26, 2017 04:29
method reference w/ capturing left terms
public class MRC {
public static void main(String[] args) {
Supplier<Integer> s = new AtomicInteger()::incrementAndGet;
System.out.println(s.get());
System.out.println(s.get());
System.out.println(s.get());
}
}
@ashigeru
ashigeru / SubSubCommands.java
Created July 21, 2017 07:19
sub-sub-commands on JCommander
public class SubSubCommands {
public static void main(String[] args) {
exec("a");
exec("b");
exec("a", "c");
/*
args: [a]
program: "root a"
command: [A]
@ashigeru
ashigeru / BreakExample.java
Created January 17, 2017 01:33
break w/ target label in Java
public class BreakExample {
public static void main(String... args) {
boolean always = true;
String message;
body:
{
if (always) {
message = "OK";
// http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.15
break body;
public class InferExc {
public static void main(String[] args) /*never throw*/ {
caller(() -> { return; });
}
private static <T extends Throwable> void caller(Capture<T> c) throws T {
c.f();
}
@FunctionalInterface
public interface Capture<T extends Throwable> {
void f() throws T;
@ashigeru
ashigeru / memo.md
Last active December 30, 2020 14:33
Prestoソースコードリーディング#2 メモ

Presto メモ

  • presto 0.60
  • [ QueryResource , TaskResource )

環境

なんかそのまま mvn clean install eclipse:eclipse -DskipTests コマンド叩いても checkstyle で落ちたので:

mvn clean install -DskipTests
mvn eclipse:eclipse -Dcheckstyle.skip
@ashigeru
ashigeru / MEMO.md
Created March 1, 2014 05:09
Headless Eclipse Plug-in Installation memo
eclipse \
  -nosplash \
  -application org.eclipse.equinox.p2.director \
  -repository <update-site-urls> \
  -installIU <install-unit-id>
  • <update-site-urls> はカンマ区切りでURLを複数指定可能
  • `` は Eclipseの Help &gt; About &gt; Installation Details の `Id` カラムの値
import java.net.URI;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
/*
@ashigeru
ashigeru / 1 - error stack trace
Created May 12, 2012 07:34
0 - EMRに関するメモ
Status Code: 400, AWS Request ID: 26FA211630014E86, AWS Error Code: InvalidRequest, AWS Error Message: The specified copy source is larger than the maximum allowable size for a copy source: 5368709120, S3 Extended Request ID: j2yq6lBCU8gL5/bmrTLH4pZ9gtoGUPzySVLN+OiUJ4anMBqlohG3QVQBhoMWBLBL
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:544)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:284)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:169)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2619)
at com.amazonaws.services.s3.AmazonS3Client.copyObject(AmazonS3Client.java:1129)
at com.amazonaws.services.s3.AmazonS3Client.copyObject(AmazonS3Client.java:1092)
at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.copy(Jets3tNativeFileSystemStore.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
@ashigeru
ashigeru / 1GB
Created January 25, 2012 02:35
NativeS3FileSystem input test
# condition
S3
- Bucket region: Tokyo
- Size: 1GB
EMR
- AZ: ap-northeast-1a
- Type:m1.lage
- hadoop-version: 0.20.205
- ami-version: 2.0.2 (latest)