Skip to content

Instantly share code, notes, and snippets.

View 3265's full-sized avatar

74k35h1 k4n3k0 3265

  • Yoyodyne
  • TARDIS
View GitHub Profile
@3265
3265 / vott.md
Last active June 14, 2020 09:10

create token

  • my_token: xxx

Initialize folder

$ mkdir {dataset_raw,dataset_vott,dataset_voc,dataset_coco}

Add Connections

[enforce fail at CPUAllocator.cpp:64] . DefaultCPUAllocator: can't allocate memory: you tried to allocate 191102976000 bytes. Error code 12 (Cannot allocate memory)

code

        super(Autoencoder, self).__init__()
 self.encoder = nn.Sequential(
import glob
import shutil
def main():
"""mkdir {1, 2, 3}"""
cam1_0= glob.glob("200603_1350_luc/Cam1*.jpg")
cam1_1 = glob.glob("200603_1446_luc/Cam1*.jpg")
cam2_0 = glob.glob("200603_1350_luc/Cam2*.jpg")
cam2_1 = glob.glob("200603_1446_luc/Cam2*.jpg")
// expects txt is like "/@admin" and extract admin
const extractNameFromPathname = (txt: string) => {
// ref https://stackoverflow.com/questions/22454258/js-regex-string-validation-for-slug
const r = /\/@([A-Za-z0-9_-]{3,15})$/;
const res = txt.match(r);
if (!res) return "";
return res[1];
};
import copy
class Hoge():
def __init__(self):
self.aaa = {"abc":12}
def test(self):
abc = copy.deepcopy(self.aaa)
print(id(abc))
print(id(self.aaa))
abc["abc"] = 212
method meaning
nil? Rubyの標準メソッド。nilの場合のみtrueを返し、それ以外はfalseを返す。nilとfalseを判別したい場合などに、==演算子を使わずに書ける。
empty? String や Array に実装されているメソッド。空の文字列や空の配列の場合にtrueを返す。nilに対して呼び出すとNoMethodErrorが発生する。
blank? nil? or empty? のようなメソッド。nilまたは空のオブジェクトを判定できる。
present? !blank? を実行するメソッド。unless hoge.blank? とするくらいなら、if hoge.present? としたほうがelsifも書けるしすっきり。
// <Route
// path={"/"}
// component={() => (
// <>
// {state.session_id ? (
// <LoginHeader
// pageTitle={state.pageTitle}
// username={state.username}
// imageURL={state.imageURL}

docker run -it -p 1236:6666 -e PORT=6666 laser/helloworld-http:latest