Expected:
let x = 1
+ 1
or
public class EscapeTest { | |
protected static String escape(String word) { | |
return word.replaceAll("'", "\\u0027"); // '等のエスケープは省略 | |
} | |
public static void main(String [] args) { | |
String word = "\" onmouseover=\"alert(document.cookie)\" onmousedown=\""; | |
System.out.println("<a name=\"#\" onclick=\"alert('" + escape(word) + "')\">"); | |
System.out.println("previous search word"); |
import Data.List | |
data FizzBuzz a = Num a | Word String deriving (Eq, Show) | |
instance Functor FizzBuzz where | |
fmap f (Num a) = Num $ f a | |
fmap f (Word s) = Word s | |
irrationalFizzBuzz = | |
map f [0..] |
object Main extends App { | |
class irof[+A](val condition: Boolean)(block: => A) { | |
lazy val value = block | |
def elof[B >: A](elsePart: => B): B = { | |
if (condition) value else elsePart | |
} | |
} | |
object irof { |
function buildArray(initial, getNext, getElement) { | |
var current = initial; | |
var next = getNext(current); | |
var array = []; | |
while (current !== next) { | |
array.push(getElement(current, next)); | |
current = next; | |
next = getNext(current); | |
} |
{ stdenv, fetchurl | |
, gconf | |
, alsaLib | |
, at_spi2_atk | |
, atk | |
, cairo | |
, cups | |
, curl | |
, dbus_glib | |
, dbus_libs |
def part(n, k) | |
if k == 1 | |
[[n]] | |
else | |
0.upto(n).flat_map do |i| | |
part(n - i, k - 1).map do |partition| | |
partition.unshift(i) | |
end | |
end | |
end |
import Control.Applicative | |
part n 1 = [[n]] | |
part n k = [0..n] >>= \i -> (i:) <$> part (n - i) (k -1) | |
main :: IO () | |
main = mapM_ print (part 7 4) |
1 + | |
2 + 5 * | |
3 | |
1 + | |
2 + 5 | |
+ 3 | |
let foo: Foo<A> = |
Expected:
let x = 1
+ 1
or
import scala.collection.mutable | |
object Main extends App { | |
0.until(100).foreach { _ => | |
val start = System.nanoTime() | |
val map = compute5() | |
val time = (System.nanoTime() - start) / 1000.0 / 1000.0 | |
println(s"${map.size} $time ms") | |
} |