This file contains hidden or 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 euler.zerosum | |
| import scala.io.Source | |
| object Euler0079 { | |
| def main(args: Array[String]) { | |
| val f = Source.fromFile("resources/keylog.txt") | |
| val keylogs = f.getLines.toList | |
| f.close() |
This file contains hidden or 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 euler.zerosum | |
| import euler.zerosum.Number._ | |
| object Euler0038 { | |
| private val nums = from(1).take(9999) | |
| private val digits = (1 to 9).toList | |
| private val nineDigitNums: Set[String] = digits.permutations.map(_.mkString).toSet |
This file contains hidden or 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
| [ | |
| {"keys": ["alt+`"], "command": "toggle_mozc"} | |
| ] |
This file contains hidden or 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.time.LocalDateTime; | |
| import java.time.ZoneId; | |
| import java.time.ZoneOffset; | |
| import java.util.Date; | |
| import java.util.function.Function; | |
| import java.util.function.UnaryOperator; | |
| public class DateWrapper { | |
| private LocalDateTime localDateTime; |
This file contains hidden or 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
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.bmuschko:gradle-tomcat-plugin:2.1' | |
| } | |
| } | |
| apply plugin: 'scala' |
This file contains hidden or 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
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.sahlbach.gradle:gradle-jetty-eclipse-plugin:1.9.+' | |
| } | |
| } | |
| apply plugin: 'scala' |
This file contains hidden or 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
| Array.prototype.filterNot = function (callback) { | |
| var result = []; | |
| for (e of this) { | |
| if (!callback(e)) { | |
| result.push(e); | |
| } | |
| }; | |
| return result; | |
| } |
This file contains hidden or 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 loop(numer: Int, denom: Int, digits: Seq[(Int, Int)]): Int = { | |
| val quot = numer / denom | |
| val rem = numer % denom | |
| val digit = (quot, rem) | |
| if (rem == 0) { | |
| 0 | |
| } else if (digits.contains(digit)) { | |
| digits.indexWhere(_ == digit) + 1 | |
| } else { |
This file contains hidden or 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
| function peco-docker-container-stop () { | |
| local selected=$(docker container ls | tail -n +2 | peco) | |
| if [ -n "$selected" ]; then | |
| BUFFER=`echo ${selected} | awk '{print $1}' | xargs -I {} docker container stop {}` | |
| fi | |
| } |
This file contains hidden or 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 dev.zerosum.sandbox.base | |
| import java.time._ | |
| import wvlet.airframe._ | |
| trait DateTimeSupport { | |
| private lazy val clock = bind[Clock] |