
You can see the large image here.
http://www.ariesplus.com/wordp/iphone/407.html
Which color do you like?
I'm a Japanese programmer. I write about C#, Ruby and JavaScript.

console.log(Math.cos(1/2)); //=> 0.8775825618903728
console.log(Math.sqrt(2)); //=> 1.4142135623730951
with(Math) {
console.log(cos(1/2)); //=> 0.8775825618903728
console.log(sqrt(2)); //=> 1.4142135623730951
}
puts Math.cos(1/2) #=> 1.0
puts Math.sqrt(2) #=> 1.4142135623731
with(Math) {
puts cos(1/2) #=> 1.0
puts sqrt(2) #=> 1.4142135623731
}
def with(obj, &block)
obj.instance_eval(&block)
end
with(Math) {
puts cos(1/2) #=> 1.0
puts sqrt(2) #=> 1.4142135623731
}
with("I love Ruby.") {
puts reverse #=> .ybuR evol I
puts gsub(/Ruby/, "YUI") #=> I love YUI.
}
with(1) {
puts succ #=> 2
}
var e = document.getElementsByTagName('div');
var n = e.length;
for (var i = 0; i < n; i++) {
e[i].style.fontSize = '14px';
}


import Network.CGI
import Text.XHtml
inputForm :: Html
inputForm = form << [paragraph << "Who are you?",
textfield "name",
submit "" "send"]
greet :: String -> Html
greet n = h1 << ("Hello, " ++ n ++ "!")
page :: String -> Html -> Html
page t b = header << thetitle << t +++ body << b
cgiMain :: CGI CGIResult
cgiMain = do name <- getInput "name"
let x = maybe inputForm greet name
output $ renderHtml $ page "Hello" x
main :: IO ()
main = runCGI $ handleErrors cgiMain


import Network.CGI
inputForm :: String -> String
inputForm script = concat [
"<form action=\"", script, "\" method=\"GET\">",
"<p>Who are you?</p>",
"<input type=\"text\" name=\"name\" />",
"<input type=\"submit\" value=\"send\" />",
"</form>"]
putName :: String -> String
putName name = concat ["<h1>Hello, ", name, "!</h1>"]
body :: Maybe String -> String -> String
body name script =
case name of
Just x -> putName x
Nothing -> inputForm script
html :: Maybe String -> String -> String
html name script = concat [
"<html>",
"<head><title>Hello</title></head>",
"<body>",
body name script,
"</body>",
"</html>"]
cgiMain :: CGI CGIResult
cgiMain = do
setHeader "Content-type" "text/html; charset = UTF-8"
script <- scriptName
name <- getInput "name"
output $ html name script
main :: IO ()
main = runCGI (handleErrors cgiMain)


import System.Environment
inputForm :: String -> String
inputForm script = concat [
"<form action=¥"", script, "¥" method=¥"GET¥">",
"<p>Who are you?</p>",
"<input type=¥"text¥" name=¥"name¥" />",
"<input type=¥"submit¥" value=¥"send¥" />",
"</form>"]
getName :: String -> String
getName q = drop 5 q
main = do
putStrLn "Content-type: text/html; charset = UTF-8¥n"
putStrLn "<html>"
putStrLn "<head><title>Hello</title></head>"
putStrLn "<body>"
script <- getEnv "SCRIPT_NAME"
query <- getEnv "QUERY_STRING"
case query of
"" -> putStrLn $ inputForm script
_ -> putStrLn $ concat ["<h1>Hello, ", getName query, "!</h1>"]
putStrLn "</body>"
putStrLn "</html>"
puts (1..10).inject(:+)
n, s = callcc {|$c| [1, 0] }
n, s = $c.call [n.succ, n + s] if n <= 10
puts s



def fib(n)
if n < 2
1
else
fib(n - 2) + fib(n - 1)
end
end
puts fib(10) #=> 89
class Programmer
def says(message)
puts message
end
end
shunsuk = Programmer.new
shunsuk.says "I came back!"
def foobar a, b
if block_given?
yield a, b
else
puts a * b
end
end
foobar 2, 3 do |a, b|
puts a + b #=> 5
end
def b
yield
end
foobar 2, b { 3 } #=> 6
<html>
<body>
<button onclick="alert('not freese');">check</button>
<button onclick="for (var i = 0; ; i++) { };">freeze</button>
</body>
</html>
<html>
<body>
<button onclick="alert('not freese');">check</button>
<button onclick="for (var i = 0; ; i++) { alert(i); };">freeze</button>
</body>
</html>
<html>
<body>
<pre style="color:blue">
target
</pre>
<script type="text/javascript">
var m = document.body.innerHTML.match(/<pre[\w\s:;="]*>((.|\n)*)<\/pre>/g);
alert(m);
</script>
</body>
</html>