Skip to content

Instantly share code, notes, and snippets.

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("control mmsys.cpl");
wait("サウンド")
WshShell.SendKeys("{DOWN " +
WScript.Arguments.item(0) +
"}%{s}{TAB 3}{ENTER}");
WshShell.Run('restart.bat TrayVolume.exe "C:\\Program Files (x86)\\TrayVolume\\TrayVolume.exe"');
REM @echo off
tasklist | findstr %1
if errorlevel 1 goto START
if errorlevel 0 taskkill /f /im %1
:START
start "" %2
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="./flashobject.js">
</script>
<style type="text/css">
/* hide from ie on mac \*/
html {
var blockNo = '47662';
var now = new Date();
location.href = 'http://www.data.jma.go.jp/obd/stats/etrn/view/hourly_s1.php?block_no='
+ blockNo
+ '&year='
+ now.getFullYear()
+ '&month='
+ (now.getMonth() + 1)
+ '&day='
+ (now.getDate() - 1).toString()
class Person
include Comparable
attr_reader :name , :age
def initialize(name,age)
@name = name
@age = age
end
def <=>(other)
cmp = @age <=> other.age
if cmp != 0
data List a = Nil
| Cons a (List a)
deriving Show
xs = Cons 1 (Cons 2 (Cons 3 Nil))
reduceList f z Nil = z
reduceList f z (Cons x xs) = f x (reduceList f z xs)
idList = reduceList Cons Nil
fact'cps n k | n == 0 = k 1
| otherwise = fact'cps (n-1) (\x -> k (n * x))
fib n | n == 0 = 0
| n == 1 = 1
| otherwise = fib (n-1) + fib (n-2)
fib'cps n k | n <= 1 = k n
| otherwise = fib'cps (n-1) $ \x ->
fib'cps (n-2) $ \y ->
k $ x + y
-- 普通の足し算、かけ算、引き算
add x y = x + y
mul x y = x * y
sub x y = x - y
-- x y の値を元に計算を行い、その結果に対して関数 k を適用する。
add'cps x y k = k $ x + y
mul'cps x y k = k $ x * y
sub'cps x y k = k $ x - y
foldr3' _ z [] p k _ = k z
foldr3' f'cps z (x:xs) p k k'
| p x = k' x
| otherwise = f'cps x (foldr3' f'cps z xs p k k') $ \y -> k y
main = do print $ foldr3' (\x y k -> k $ x ++ y) []
[[1,2],[3,4],[5,6]] (== []) id id
print $ foldr3' (\x y k -> k $ x ++ y) []
[[1,2],[3,4],[],[5,6]] (== []) id id