使いかた
- manifest.json と script.js を適当な、同じディレクトリ内に保存します。
- Chromeの設定画面を開き、拡張機能の画面を出します。
- 「デベロッパーモード」のチェックボックスにチェックを入れます。
- 「パッケージされていない拡張機能を読み込む」ボタンを押し、先程のディレクトリを選択します。
- http://daishonin.hatelabo.jp/ を開きます。
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
import json | |
import os | |
import tempfile | |
import codecs | |
from optparse import OptionParser |
//Zコンビネータ | |
//再帰する関数を定義するのに使う | |
ZCONB = { f -> ({ x -> f({ y -> x(x)(y) }) })({ x -> f({ y -> x(x)(y) }) }) } | |
//数の定義 | |
ZERO = { f -> { x -> x }} | |
ONE = { f -> { x -> f(x) }} | |
THREE = { f -> { x -> f(f(f(x))) }} | |
FIVE = { f -> { x -> f(f(f(f(f(x))))) }} |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
config.vm.box = "centos64_64" | |
config.vm.define :web do |india| | |
india.vm.host_name = "india" | |
india.vm.network :hostonly, "192.168.50.12" |
object Main extends App { | |
class irof[A](val condition: Boolean)(block: => A) { | |
lazy val value = block | |
def elof[B, C](elsePart: => B)(implicit e1: A <:< C, e2: B <:< C): C = { | |
if (condition) value else elsePart | |
} | |
} | |
object irof { |
/* | |
* http://projecteuler.net/problem=2 | |
* http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%202 | |
*/ | |
val fib: List[Int] => List[Int] = { | |
case Nil | _ :: Nil => throw new IllegalArgumentException | |
case xs @ (a :: b :: tail) => { | |
val nextNum = a + b | |
if (nextNum >= 4000000) { | |
xs |
scala -Xcheckinit
だと TransietnVariablesトレイトで定義したフィールドへのアクセス時に以下のような例外が発生する。
scala.UninitializedFieldError: Uninitialized field: <console>: 20
at Container._boolean(<console>:20)
at TransientVariables$class.boolean(<console>:31)
at Container.boolean(<console>:20)
at .<init>(<console>:39)
at .<clinit>(<console>)
at .(:11)
organization := "net.seratch" | |
name := "sandbox" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
libraryDependencies ++= Seq( | |
"junit" % "junit" % "4.9" withSources(), |
Option Explicit | |
Sub AddNewMenu() | |
On Error GoTo ErrHand | |
Dim cbrCmd As CommandBar | |
Dim cbcMenu As CommandBarControl | |
Set cbrCmd = Application.CommandBars("Worksheet Menu Bar") | |
cbrCmd.Controls("方眼紙").Delete |