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
class IVisitor | |
{ | |
public: | |
virtual ~IVisitor() {} | |
virtual void visit(Circle& node) = 0; | |
virtual void visit(Triangle& node) = 0; | |
}; | |
class Shape | |
{ |
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
# Dockerホストマシンを作成する | |
${DOCKER_MACHINE} create -d virtualbox "${VM}" | |
# Docker machineを起動する。2回目以降はここから | |
${DOCKER_MACHINE} start "${VM}" | |
# 環境変数no-proxyの設定 | |
${DOCKER_MACHINE} env --shell=bash --no-proxy ${VM} | |
bash --login -i |
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 caffe | |
from caffe.proto import caffe_pb2 | |
from caffe.io import blobproto_to_array | |
import numpy as np # for array | |
import glob | |
import os.path | |
# directory = "C:/dev/caffe/caffe-windows" | |
net_path = "./examples/mytest/lenet/deploy.prototxt" |
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
GemfileにいれたいGemパッケージをかきかき | |
==> Gemfileを`bundle install` | |
==> 依存ファイルもろとも、バージョンがGemfile.lockに書き込まれる。 | |
<== Gemfile.lockがない状態で、他の環境で後日`bundle install` | |
==> 依存ファイルのバージョンが違ってしまい、同一環境で開発ができない! |
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
git init |
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
dec // 10 進表記 | |
endl // 改行文字の出力 | |
ends // 空白文字の出力 | |
flush // ストリームのフラッシュ | |
hex // 16 進表記 | |
oct // 8 進表記 | |
resetioflags(long f) // f で指定されたフラッグを off | |
setbase(int base) // 基数を base にする | |
setfill(int ch) // 文字 h で埋める | |
setioflags(long f) // f で指定されたフラッグを on |
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
function LazyChain(iter) | |
{ | |
//push each function | |
this._calls = []; | |
this._target = iter; | |
} | |
// アロー演算子は使えない(thisがグローバルオブジェクトをさしてしまうから) | |
LazyChain.prototype.invoke = function(methodName, ...args) | |
{ |
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
static void Main(string[] args) | |
{ | |
int i = 1; | |
int j = i; //iの値が複製されて、jに格納される(intは値型) | |
j = j + 1; | |
List<int> arr = new List<int>{ 1, 2, 3 }; | |
Console.WriteLine("{0} {1}", i, j); //1 2 | |
var newArr = arr; // List<int>は参照型なので、値自体ではなく、値のアドレスが複製される。 | |
newArr[0] = 10; //arrの参照情報とnewArrの参照情報は同じなので、arr[0]も変更される | |
arr.ForEach(c => Console.WriteLine(c)); //10 2 3 |
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
console.log(this);//{} : module.exports Object | |
this.obj = "a" | |
console.log(this); // { obj: 'a' } | |
//cf) 2 : 関数呼び出しも参考にしてください | |
var func = function() | |
{ | |
console.log(this); | |
}; |
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
function foo() { | |
console.log(typeof this); | |
} | |
function bar() { | |
"use strict"; | |
console.log(typeof this); | |
} |
OlderNewer