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" /> |
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
module.exports = { | |
add: function(a, b) { | |
if (typeof a === 'undefined' || a === null) a = 0; | |
if (typeof b === 'undefined' || b === null) b = 0; | |
return Number(a) + Number(b); | |
} | |
}; |
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.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import org.springframework.jdbc.core.ResultSetExtractor; | |
import org.springframework.jdbc.core.RowMapper; | |
public final class PaginatedResultSetExtractor<T> implements ResultSetExtractor<List<T>> { |
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
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="javax.naming.*"%> | |
<!DOCTYPE html> | |
<html> | |
<head><title>JNDI list</title></head> | |
<body> | |
<h1>JNDI list</h1> | |
<% | |
String root = request.getParameter("root"); | |
if (root == null) { | |
root = ""; |
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 |
OlderNewer