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 ( | |
"context" | |
"errors" | |
"fmt" | |
"time" | |
"golang.org/x/sync/errgroup" | |
) |
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
require "pry" | |
# http://nabetani.sakura.ne.jp/yokohamarb/103mask/ | |
def solve(mask) | |
# 0. 入力を、1a(16) => 26(10) => 11010(2) にする | |
# 1. 11010(2) => [2, 8, 16] にする | |
# 2. arrの要素数で分岐する、4つ以下 or それ以上 | |
# 2a. 全部のconbinationを取って、数字変換して、終わり | |
# 2b. 下4つの組み合わせの前13つと、最後2つを取って、終わり |
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
require "pry" | |
# どう書く 2019-04-06 | |
# http://nabetani.sakura.ne.jp/hena/orde32rects/ | |
# | |
# 方針 | |
# 1. 各入力矩形で塗ったかどうかを点ごとに記録する | |
# 2. 全体を舐めてその点がどの図形に属しているかを判定しつつ、面積と縦横別の面積を記録する | |
# 3. 各図形のうち長方形になっているものを選択して面積を返してソートする | |
# |
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
require "pry" | |
# どう書く 2019-04-06 | |
# http://nabetani.sakura.ne.jp/hena/orde32rects/ | |
# | |
# 方針 | |
# 1. 各入力矩形で塗ったかどうかを点ごとに記録する | |
# 2. 全体を舐めてその点がどの図形に属しているかを判定しつつ、面積と縦横別の面積を記録する | |
# 3. 各図形のうち長方形になっているものを選択して面積を返してソートする | |
# |
https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
gRPC Code | HTTP Status Code |
---|---|
OK = 0 | 200 OK |
CANCELLED = 1 | 499 Client Closed Request |
UNKNOWN = 2 | 500 Internal Server Error |
INVALID_ARGUMENT = 3 | 400 Bad Request |
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 ( | |
"fmt" | |
"time" | |
"github.com/golang/protobuf/ptypes" | |
"github.com/golang/protobuf/ptypes/duration" | |
"github.com/golang/protobuf/ptypes/timestamp" | |
) |
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
=== RUN TestPropertyLoadSaverLoadAndSave | |
== original goon == | |
&{5629499534213120 foo Zm9v} | |
&{5629499534213120 foo Zm9v} | |
&{5629499534213120 foo Zm9v} | |
&{5629499534213120 Zm9v} // => bad | |
== pullrequest 69 goon == | |
&{5066549580791808 foo Zm9v} | |
&{5066549580791808 foo Zm9v} | |
&{5066549580791808 foo Zm9v} |
- dockerでやるのが、環境構築コストが下がってよい
- https://qiita.com/kshigeru/items/ea174d6bcacc474f2a51 JupyterのDockerイメージまとめ
- によると、...そもそもpysparkが何なのかわからないが、とりあえず datascience-notebook を使えば良い...と思う
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 test ./... -bench . -benchmem | |
goos: darwin | |
goarch: amd64 | |
BenchmarkLoadByUnmarshal-4 2 507854026 ns/op 33357464 B/op 650037 allocs/op | |
BenchmarkLoadByNewDecoder-4 2 502302509 ns/op 51238448 B/op 650051 allocs/op | |
PASS |