- 各APIのレスポンス性能やCPU、メモリ、GCなどが分かる
- GlassFishやWildflyを切り替えれる
- レポートはテスト単位で切り取れる
- gitやdockerと連携してカスタマイズが可能
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
/** | |
* Java 8 New Style. | |
*/ | |
public static void useStreamAPI() { | |
IntStream.rangeClosed(1, 100) | |
.mapToObj(n | |
-> ((n % 15 == 0)) ? "FizzBuzz" | |
: (n % 3 == 0) ? "Fizz" | |
: (n % 5 == 0) ? "Buzz" | |
: String.valueOf(n)) |
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
long count = IntStream.rangeClosed(1, 100) | |
.mapToObj(n | |
-> ((n % 15 == 0)) ? "FizzBuzz" | |
: (n % 3 == 0) ? "Fizz" | |
: (n % 5 == 0) ? "Buzz" | |
: String.valueOf(n)) | |
.peek(x -> System.out.println("debug: " + x)) // print debug | |
.filter(x -> "FizzBuzz".equals(x)) | |
.count(); |
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
interface ToStringModule<T> { | |
default String toString() { | |
StringBuilder sb = new StringBuilder(); | |
sb.append(this.getClass().getSimpleName()); | |
sb.append("["); | |
Field[] fields = this.getClass().getDeclaredFields(); | |
for (Field field : fields) { |
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
Stream.of("1", "2", null, "3", "4", "5") | |
.map( x -> Optional.ofNullable(x)) | |
.map(x -> Integer.parseInt(x.orElse("0"))) | |
.map(x -> x * 2) | |
.forEach( x -> System.out.println(x)); |
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 javax.swing.*; | |
import wiiremotej.*; | |
import wiiremotej.event.*; | |
import javax.sound.sampled.*; | |
import java.io.*; | |
public class WiiSample1 { |
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
<html> | |
<head> | |
<title>DataSheet</title> | |
<style> | |
table, td, th { | |
border-collapse: collapse; | |
border: 1px solid #ddd; | |
text-align: left; | |
} |
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
<html> | |
<head> | |
<!-- Load c3.css --> | |
<link href="http://cdnjs.cloudflare.com/ajax/libs/c3/0.4.7/c3.min.css" rel="stylesheet" type="text/css"> | |
<!-- Load d3.js and c3.js --> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/c3/0.4.7/c3.min.js"></script> | |
<script type="text/javascript"> |
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
<html> | |
<head> | |
<title>DataSheet</title> | |
<script type="text/javascript"> | |
main_data = { | |
"Description":"GlassFish Application Server", | |
"Environment":["production"], | |
"Network":{ | |
"Host":["localhost.localdomain"], | |
"IP":["enp0s3", "10.0.2.15"] |