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
jshell> ZonedDateTime.of(2017, 1, 13, 4, 21, 15, 100_000_000, ZoneId.systemDefault()).toString() | |
$6 ==> "2017-01-13T04:21:15.100+09:00[Asia/Tokyo]" | |
jshell> ZonedDateTime.of(2017, 1, 13, 4, 21, 15, 000_000_000, ZoneId.systemDefault()).toString() | |
$7 ==> "2017-01-13T04:21:15+09:00[Asia/Tokyo]" | |
jshell> |
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 String toString() { | |
StringBuilder buf = new StringBuilder(18); | |
int hourValue = hour; | |
int minuteValue = minute; | |
int secondValue = second; | |
int nanoValue = nano; | |
buf.append(hourValue < 10 ? "0" : "").append(hourValue) | |
.append(minuteValue < 10 ? ":0" : ":").append(minuteValue); | |
if (secondValue > 0 || nanoValue > 0) { | |
buf.append(secondValue < 10 ? ":0" : ":").append(secondValue); |
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 java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
public class MakingProgramingGroup { | |
public static void main(String... args) { | |
List<String> allMembers = Arrays.asList("1", "2", "3", "4", "5", "6"); | |
pairs(allMembers).forEach(group -> System.out.println("selectedGroup(better):" + group.stream().map(pair -> pair.stream().collect(Collectors.joining("&"))).collect(Collectors.joining(",")))); |
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
static int filter_frame(AVFilterLink *inlink, AVFrame *in) | |
{ | |
AVFilterLink *outlink = inlink->dst->outputs[0]; | |
AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height); | |
if (!out) { | |
av_frame_free(&in); | |
return AVERROR(ENOMEM); | |
} | |
av_frame_copy_props(out, in); |
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
// Convert from YUV to RGB | |
struct SwsContext *sws_ctx = NULL; | |
sws_ctx = | |
sws_getContext | |
( | |
inlink->w, | |
inlink->h, | |
inlink->format, | |
outlink->w, | |
outlink->h, |
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
package main.java.com.linecorp.nakaly; | |
import java.awt.Graphics2D; | |
import java.awt.Transparency; | |
import java.awt.image.BufferedImage; | |
import java.awt.image.BufferedImageOp; | |
import java.awt.image.ConvolveOp; | |
import java.awt.image.Kernel; | |
import java.io.ByteArrayOutputStream; |
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 java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
public class MakingProgramingGroup { | |
public static void main(String... args) { | |
List<String> allMembers = Arrays.asList("@mrt51", "@aidi", "@veronica", "@ukitaka", "@nakaly", "@yoneharamasami", "@chens", "dummy"); |
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 java.io.IOException; | |
import java.io.UncheckedIOException; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.Base64; | |
import org.opencv.core.Core; | |
import org.opencv.core.Mat; | |
import org.opencv.core.Size; | |
import org.opencv.imgcodecs.Imgcodecs; |
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 Sandbox { | |
public static void main (String... args) { | |
System.out.println(getEnums(Hoge.class, "A B")); | |
} | |
public static <T extends Enum<T>> List<T> getEnums(Class<T> enumClass, String line) { | |
return Stream.of(line.split(" ")).map(item -> getEnum(enumClass, item).get()).collect(Collectors.toList()); |
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
レプトセファルスは海流の先で生まれ、海流上流に行くとサイズが小さくなると考えられています。1991年にマリアナ諸島で10mmの約1000匹が発見されました。海山が親うなぎの卵産み場所を決定する役割を持っている可能性があり、新月に卵を産んでいると予想されていますが、誕生日は調べられていますがまだ発見されていません。 しかし2005年の新月の日に海山付近で生後2日のレプトセファルスが発見されました。研究者たちは塩分の濃さの異なる海水の境目「フロント」に注目し、このフロントにいるうなぎが新月時に卵を産むのかを考えましました。5月22日の新月の2日前に2つの卵のようなものが発見され、1.6mmの大きさが確認されました。 |
OlderNewer