'##::: ##:'####::::'###:::::'######::::::'###::::'########:::::'###::::
###:: ##:. ##::::'## ##:::'##... ##::::'## ##::: ##.... ##:::'## ##:::
####: ##:: ##:::'##:. ##:: ##:::..::::'##:. ##:: ##:::: ##::'##:. ##::
## ## ##:: ##::'##:::. ##: ##::'####:'##:::. ##: ########::'##:::. ##:
##. ####:: ##:: #########: ##::: ##:: #########: ##.. ##::: #########:
##:. ###:: ##:: ##.... ##: ##::: ##:: ##.... ##: ##::. ##:: ##.... ##:
##::. ##:'####: ##:::: ##:. ######::: ##:::: ##: ##:::. ##: ##:::: ##:
..::::..::....::..:::::..:::......::::..:::::..::..:::::..::..:::::..::
This file contains hidden or 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
class Animal | |
def initialize(species) | |
@species = species | |
end | |
def bark() | |
"bowbow" | |
end | |
def mew() | |
"mewwww" | |
end |
This file contains hidden or 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
function run-ec2 { | |
source ~/.virtualenv/CP-2710/bin/activate | |
aws ec2 run-instances --image-id $1 --instance-type t1.micro --key-name oregon > /tmp/run-i | |
aws_id=$(cat /tmp/run-i | jq -r '.Instances | .[] | .InstanceId') | |
echo "aws_id: $aws_id" | |
sleep 10 | |
aws ec2 describe-instances --instance-ids $aws_id > /tmp/run-i | |
aws_ip=$(cat /tmp/run-i | jq -r '.Reservations | .[] | .Instances | .[] | .PublicDnsName') | |
echo "aws_ip: $aws_ip" | |
echo 'ssh -i ~/.ssh/id_rsa.aws.oregon -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ec2-user@$aws_ip' |
This file contains hidden or 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
/* | |
* MAVE | |
* + RIcK | |
* ------- | |
* Scala | |
*/ | |
import scala.annotation.tailrec | |
@tailrec |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import Cocoa | |
// string | |
var str = "Hello, playgroundaaa" | |
var ihoho = 34343 | |
print(str) | |
str = "ニーハオ" + str |
This file contains hidden or 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
class Food | |
attr_reader :price, :name | |
def initialize(price, name) | |
@price = price | |
@name = name | |
end | |
end |
This file contains hidden or 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
from bs4 import BeautifulSoup | |
import urllib2 | |
import urllib | |
import codecs | |
def candidate(url): | |
req = urllib2.Request(url) | |
USERAGENT = 'Mozilla/5.0' | |
req.add_header("User-agent", USERAGENT) |
This file contains hidden or 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
from typing import List | |
import sys | |
def merge(src1: List, src2: List) -> List: | |
a = src1[0] | |
b = src2[0] | |
res = list() | |
while len(src1) != 0 or len(src2) != 0: | |
if a <= b: |
ポルトガル王マヌエル1世は、アルハンブラ宮殿のタイルの美しさに心を打たれ、自分の宮殿を同様のタイルで装飾するよう命じました。プレイヤーはタイル・アーティストとなります。
プレイヤーボードの上方は得点ボードです。中央のタイル工房からタイルを持って来てプレイヤーボード左の図案ラインに並べ、タイルが揃ったらボード右の壁にタイルを貼ります。貼るたびに得点があり、ゲーム終了時にも出来上がった壁のデザインによって得点が入ります。
プレイヤーボードはカラフルな面を使います。プレイヤーボードの得点0のところに黒いキューブを置きます。 丸い皿を、2人プレイでは5枚、3人プレイでは7枚、4人プレイでは9枚用意します。2n+1です。これがタイル工房の展示ボードです。それらを円周状に並べます。円周の中央はあとでタイルを置けるように空けておきます。
スタートプレイヤーはスタートプレイヤータイル(1と書いてあります)を持ちます。スタートプレイヤーは袋の中にタイルを全部入れ、そこからランダムに引いて丸い皿に4枚ずつ載せていきます。