- 噛みたいという欲求を解消する必要がある
- ケージから出して、引っ張り合いをして遊んであげる
- おもちゃの種類をふやす 10種類くらい用意して飽きさせないように
- 紐や人形などで引っ張り合いをする
- 引っ張りで噛む力を発散させる
- 大きく振り回すと歯を炒めるので、小刻みに引っ張る
- あそぶときに手をかんだらやめる
This file contains 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
import java.io.File | |
import scala.io.Source | |
import scala.util.matching.Regex | |
import scala.util.parsing.combinator._ | |
import scala.util.parsing.input.{Position, NoPosition} | |
sealed abstract class Insn extends ( CED => CED ){ | |
val pos:Position | |
} | |
case class App( m:Int, n:Int, pos:Position ) extends Insn{ |
This file contains 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
require "grpc" | |
module GRPC::VCR | |
GRPC_VCR_FiXTURE_PATH = SPEC_PATH.join("fixtures/grpc_vcr") | |
def grpc_interceptor(example) | |
cassette = example.metadata[:grpc_vcr] | |
return unless cassette&.is_a? GRPC::VCR::Cassette | |
cassette.exist? ? |
This file contains 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
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'base64' | |
require './worker.rb' | |
$urls = %w( | |
http://www.aozora.gr.jp/cards/001779/files/56647_ruby_58166.zip | |
http://www.aozora.gr.jp/cards/000148/files/752_ruby_2438.zip | |
http://www.aozora.gr.jp/cards/001383/files/56866_ruby_58168.zip |
This file contains 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
// Note: You must restart bin/webpack-watcher for changes to take effect | |
var path = require('path') | |
var webpack = require('webpack') | |
var merge = require('webpack-merge') | |
var config = require('./shared.js') | |
var devconfig = { | |
devtool: 'sourcemap', |
This file contains 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
// Optional container like maybe monad | |
class Option { | |
constructor(value){ | |
this.value = value | |
} | |
async promise() { | |
return new Promise((resolve, reject) => { | |
if (this.value) { | |
resolve(this.value); |
This file contains 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
trait Memorized[T,R] { | |
import scala.collection.mutable._ | |
val cache = new HashMap[T,R] | |
def cacheOrApply( t:T )( f: => R ):R = cache get(t) getOrElse{ | |
val rv = f | |
cache += t -> rv | |
println("do %s:%s" format(t, rv)) | |
rv | |
} |
This file contains 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
#!/usr/bin/env ruby | |
arr = { | |
resource: [6657, 5699, 3371, 8909, 7719, 6229, 5449, 8561, 2987, 5501, 3127, 9319, 4365, 9811, 9927, 2423, 3439, 1865, 5925, 4409, 5509, 1517, 9695, 9255, 5325, 3691, 5519, 6949, 5607, 9539, 4133, 7795, 5465, 2659, 6381, 6875, 4019, 9195, 5645, 2887, 1213, 1815, 8671, 3015, 3147, 2991, 7977, 7045, 1619, 7909, 4451, 6573, 4545, 8251, 5983, 2849, 7249, 7449, 9477, 5963, 2711, 9019, 7375, 2201, 5631, 4893, 7653, 3719, 8819, 5839, 1853, 9843, 9119, 7023, 5681, 2345, 9873, 6349, 9315, 3795, 9737, 4633, 4173, 7549, 7171, 6147, 4723, 5039, 2723, 7815, 6201, 5999, 5339, 4431, 2911, 4435, 3611, 4423, 9517, 3243], | |
voice: [2475, 6547, 1471, 8691, 7847, 3595, 1767, 3311, 2507, 9651, 5321, 4473, 7117, 5947, 9489, 2669, 8741, 6149, 1301, 7297, 2975, 6413, 8391, 9705, 2243, 2091, 4231, 3107, 9499, 4205, 6013, 3393, 6401, 6985, 3683, 9447, 3287, 5181, 7587, 9353, 2135, 4947, 5405, 5223, 9457, 5767, 9265, 8191, 3927, 3061, 2805, 3273, 7331] | |
} | |
def createKey(s) | |
s.codepoints. |
This file contains 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
def tryo[T]( f: => T ) | |
( implicit onError: Throwable => Option[T] = | |
{ t:Throwable => None }): Option[T] = | |
{ | |
try { | |
Some( f ) | |
} catch { | |
case c => onError( c ) | |
} | |
} |
- CONNECTメソッドのリクエストから、http.Hijackerを使って生のTCPコネクションを取り出す
- クライアントには200 okを返す
- 接続先ホストの証明書を、予め用意してあるroot証明書でサインして生成する
- 生成した証明書でクライアントとtls接続を確立する (root証明書が登録されていないとブラウザで警告が出る)
- goroutine起こして、クライアントとのtls接続からhttp requestを読み込む
- 受けたhttp requestをそのまま接続先hostに送信する
- 接続先hostからのhttp responseを、クライアントtls接続に書き込む
- EOFが来るまで 5-7繰り返し
NewerOlder