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.testing.Benchmark | |
import scala.annotation.tailrec | |
trait Times { | |
def times(elems: Seq[BigInt]): BigInt | |
} | |
abstract class Bench extends Times with Benchmark { | |
val fixture = BigInt(1) to BigInt(2000) | |
def run() { times(fixture) } |
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
libraryDependencies ++= Seq( | |
"org.springframework" % "spring-orm" % "3.1.1.RELEASE", | |
"cglib" % "cglib-nodep" % "2.2.2" % "runtime", | |
"javax.inject" % "javax.inject" % "1", | |
"org.hibernate" % "hibernate-entitymanager" % "4.1.3.Final", | |
"log4j" % "log4j" % "1.2.16" % "runtime", | |
"com.h2database" % "h2" % "1.3.166" % "runtime" | |
) | |
scalaVersion := "2.9.2" |
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.annotation.tailrec | |
import scala.collection.mutable.StringBuilder | |
def mkStr(elems: Seq[_], sep: String = ""): String = { | |
/* invoke java.lang.StackOverflowError | |
elems match { | |
case Seq() => "" | |
case Seq(head) => head.toString | |
case _ => elems.head + sep + mkStr(elems.tail, sep) | |
} |
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.InputStream; | |
import java.util.Collections; | |
import java.util.Enumeration; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import java.util.Properties; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletException; |
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
jQuery ($) -> | |
nums = [20..0] | |
doms = _.map nums, (e, i, l) -> "<li>[#{i}]=#{e}</li>" | |
$("<ul>#{doms.join("")}</ul>").appendTo("body") | |
hoge = | |
name: "Hoge" | |
age: 10 |
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 foo | |
document.write "<p>#{foo.f(10)}</p>" |
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 md5sum { | |
def main(args: Array[String]) { | |
if (args.isEmpty) { | |
println("Usage: scala md5sum FILE1, FILE2, ...") | |
return | |
} | |
args.foreach{ file => | |
// calculate hash |
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 jsr356.example; | |
import java.io.IOException; | |
import java.util.Set; | |
import java.util.concurrent.CopyOnWriteArraySet; | |
import java.util.logging.Logger; | |
import javax.websocket.OnClose; | |
import javax.websocket.OnMessage; | |
import javax.websocket.OnOpen; |
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
/* jshint node: true, multistr: true */ | |
var express = require('express'); | |
var multer = require('multer'); | |
var serveIndex = require('serve-index'); | |
var serveStatic = require('serve-static'); | |
var app = express(); | |
var pubdir = 'public'; |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Unicode - 結合文字と補助文字</title> | |
</head> | |
<body> | |
<form action="test.jsp" method="POST"> | |
<input type="text" name="p" value="がが丈𠀋" /> | |
<input type="submit" /> |
OlderNewer