Skip to content

Instantly share code, notes, and snippets.

研修スケジュール

10:00 ~ 12:30

  • 諸連絡
  • 自己紹介  
  • CSS,Bootstrapの講義

12:30 ~ 13:30

  •  お昼休み
@kodaitakahashi
kodaitakahashi / BadRequestException.kt
Last active July 29, 2017 16:31
Kotlinで例外クラスの作り方
class BadRequestExcetpion(val httpStatusCode: String, msg: String? = null): RuntimeException(msg)
// インスタンス生成時にRuntimeExceptionにmsgを渡しています
// Javaで書き直した場合
/*
class BadRequestException extends RuntimeException{
String httpStatusCode;
BadRequestException(String httpStatusCode, String msg){
super(msg)
@kodaitakahashi
kodaitakahashi / GebConfig.groovy
Last active June 30, 2017 10:25
Spock+Gebでダイアログ操作
import geb.report.ScreenshotReporter
import org.openqa.selenium.ie.InternetExplorerDriver;
environments {
ie {
driver = { new InternetExplorerDriver() }
}
}
reporter = new ScreenshotReporter(){
@Override
public BasicSyntax{
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.Test;
Main sut = null; // テスト対象となるクラスのインスタンス
import java.util.List;
import java.util.function.IntPredicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
public class StreamEx1 {
// 終端処理
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.Stream;
public class StreamEx {
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Stream1 {
public static void main(String[] args) {
List<String> strings = Arrays.asList("b", "a", "d");
for (int i = 0; i < strings.size(); i++) {
@kodaitakahashi
kodaitakahashi / ME.java
Created April 10, 2017 10:04
hashMap mergeについて
import java.util.HashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ME {
public static void main(String[] args) {
HashMap<Integer, Integer> hashMap = new HashMap<Integer, Integer>();
hashMap.put(1, 100);
hashMap.put(2, 200);
@kodaitakahashi
kodaitakahashi / GenQ1.java
Last active April 8, 2017 03:15
ジェネリックスを用いたインターフェースの継承の問題
interface GenInterface<T> {
void showState(T t);
}
interface GenInterface2<T> extends GenInterface<String> {
void dispState(T t);
}
----------------------------------------------------------------
import java.util.ArrayList;
@kodaitakahashi
kodaitakahashi / FunctionClass.java
Created April 7, 2017 08:14
関数型インターフェースの理解を深めるため
import java.util.Random;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.IntToDoubleFunction;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;