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
for { | |
i <- 1 to 9 | |
j <- 1 to 9 | |
if i != j | |
result = s"($i, $j)" | |
} { | |
println(result) | |
} |
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
type Key = Long | |
implicit def strToKey(str: String): Long = str.toLong |
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 com.ponkotuy.proxy | |
import com.twitter.finagle.builder.ClientBuilder | |
import com.twitter.finagle.{Http, Service, http} | |
import org.jboss.netty.handler.codec.http.{HttpMethod, HttpResponse, HttpRequest} | |
import com.twitter.util.{Await, Future} | |
import com.github.theon.uri.Uri | |
class FinagleProxySample(hosts: String, port: Int, inter: Intercepter) { | |
val client = ClientBuilder().codec(http.Http()).hosts(hosts).build() |
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
object Main extends App { | |
val hoge = new Hoge() | |
println((hoge.hoge, hoge.fuga)) | |
} | |
class Hoge(val hoge: Int, val fuga: Int) { | |
import Hoge._ | |
def this() = this(init, init) // Compile Erorr! not found init | |
} |
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.collection.GenSeq | |
import org.jasypt.util.digest.Digester | |
object Main { | |
val digester = new Digester("MD5") | |
def main(args: Array[String]): Unit = { | |
val salt = "hoge".getBytes("UTF8") | |
val digest = digester.digest(salt ++ toBytes(567890)) | |
val single = timer { println(bruteForceSingle(salt, digest)) } |
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.security.MessageDigest | |
val md5 = MessageDigest.getInstance("MD5") | |
def equals[T](xs: Array[T], ys: Array[T]): Boolean = { | |
if(xs.size != ys.size) return false | |
var i = 0 | |
while(i != xs.size) { | |
if(xs(i) != ys(i)) return false |
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 akka.actor._ | |
import scala.collection.mutable.ArrayBuffer | |
object Reaper { | |
case class WatchMe(ref: ActorRef) | |
} | |
abstract class Reaper extends Actor { | |
import Reaper._ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace AtCoder { | |
class Cont014_4 { | |
static void Main(string[] args) { | |
string fst = Console.ReadLine(); |