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
$ go version | |
go version go1.10.2 darwin/amd64 | |
$ go get -u golang.org/x/vgo | |
$ vgo version | |
go version go1.10.2 darwin/amd64 vgo:2018-02-20.1 | |
$ mkdir test_vgo | |
$ cd test_vgo | |
$ echo >go.mod | |
$ wget https://gist.githubusercontent.com/deltam/14e44c5adff91e723d2036f5f8e7ac25/raw/8048a89bb73c3bf719f5d830917ee3673b52170e/main.go | |
$ vgo build |
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
(ns sandbox.tree | |
"『集合知プログラミング』の7章を読んで決定木をプログラミングする") | |
;; https://resources.oreilly.com/examples/9780596529321/blob/master/PCI_Code%20Folder/chapter7/treepredict.py | |
(def my-data [["slashdot","USA","yes",18,"None"], | |
["google","France","yes",23,"Premium"], | |
["digg","USA","yes",24,"Basic"], | |
["kiwitobes","France","yes",23,"Basic"], | |
["google","UK","no",21,"Premium"], | |
["(direct)","New Zealand","no",12,"None"], |
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
#!/bin/sh | |
# 参考 Commit Hash から、該当 Pull Request を見つける方法 - Qiita https://qiita.com/awakia/items/f14dc6310e469964a8f7 | |
GITHUB_URL=`git config --get remote.origin.url | sed -E 's#^.+(github.com):(.+)\.git$#https://\1/\2#'` | |
git log --merges --oneline --reverse --ancestry-path $1...master | grep -m 1 "Merge pull request" | cut -f5 -d ' ' | sed "s@#@${GITHUB_URL}/pull/@" |xargs open |
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
package main | |
import ( | |
"code.google.com/p/goauth2/oauth" | |
"fmt" | |
"google.golang.org/api/drive/v2" | |
"log" | |
"net/http" | |
"os" | |
) |
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
$ convert A.png -distort Affine '10,10 3,5' B.png |
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
(defn read-as-byte-array [filename] | |
(with-open [fis (java.io.FileInputStream. filename)] | |
(let [channel (.getChannel fis) | |
byte-buf (java.nio.ByteBuffer/allocate 100000)] | |
(.read channel byte-buf) | |
byte-buf))) |
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
package mypackage | |
import ( | |
"fmt" | |
"time" | |
someLibrary "github.com/deltam/some-library-go" // パッケージ名と同じ別名をつける | |
) | |
func Hoge() { |
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
package main | |
import ( | |
"code.google.com/p/goauth2/oauth" | |
"fmt" | |
// "code.google.com/p/google-api-go-client/drive/v2" | |
"google.golang.org/api/drive/v2" // こっちに書き換え | |
"log" | |
"net/http" | |
"os" |
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
// This file is part of www.nand2tetris.org | |
// and the book "The Elements of Computing Systems" | |
// by Nisan and Schocken, MIT Press. | |
// File name: projects/05/CPU.hdl | |
/** | |
* The Central Processing unit (CPU). | |
* Consists of an ALU and a set of registers, designed to fetch and | |
* execute instructions written in the Hack machine language. | |
* In particular, functions as follows: |
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
// nand2tetris 「コンピュータシステムの理論と実装」 | |
// 01のNandだけで論理素子を作る | |
CHIP And { | |
IN a, b; | |
OUT out; | |
PARTS: | |
// Put your code here: | |
Nand (a=a, b=b, out=c0); |