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; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
List<Integer> before = Arrays.asList(1,2,3,4,5); | |
List<Integer> after = Arrays.asList(1,4,5,6); | |
System.out.print("removed:"); |
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.Scanner; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Main { | |
private static final Pattern pattern = Pattern.compile("([a-z])\\1*"); | |
public static void main(String[] args) { | |
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
def sample(strOpt:Option[String]) = strOpt match { | |
case Some(str) if str == "hoge" => Some(str) | |
case _ => None | |
} |
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 scala.util.Random | |
object Main { | |
val random = new scala.util.Random | |
def main(args:Array[String]):Unit = { | |
Iterator.continually(findSTAP).takeWhile(_ != "STAP").toList | |
println("見つかったよ!") |
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 scala.util.Random | |
object Main { | |
def main(args:Array[String]) = { | |
findSTAP() | |
} | |
def findSTAP():Unit = | |
randomString(4) match { |
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
require "optparse" | |
require "date" | |
OptionParser.accept(Date) do |s,| | |
begin | |
Date.parse(s) if s | |
rescue | |
raise OptionParser::InvalidArgument, s | |
end | |
end |
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 models | |
import play.api.db._ | |
import play.api.Play.current | |
import anorm._ | |
import anorm.SqlParser._ | |
case class User(email: String, name: String, password: String) |
NewerOlder