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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"math" | |
"os" | |
"sort" | |
"strings" |
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
// Save: | |
outTensor, err := tf.NewTensor(filename) | |
if err != nil { | |
return err | |
} | |
_, err = session.Run( | |
map[tf.Output]*tf.Tensor{ | |
graph.Operation("save/Const").Output(0): outTensor, | |
}, | |
nil, |
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
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"net/http" | |
"net/rpc" | |
"os" | |
"os/signal" |
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
(menu-bar-mode -1) | |
(global-set-key "\M-g" 'goto-line) | |
(global-set-key "\M-." 'rtags-find-symbol-at-point) | |
(global-set-key "\M-," 'rtags-location-stack-back) | |
(global-set-key (kbd "M-]") 'next-error) ; Go to next error (or msg) | |
(global-set-key (kbd "M-[") 'previous-error) ; Go to previous error or msg | |
(global-set-key (kbd "M-m") 'rtags-find-references-at-point) | |
(require 'package) |
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
ls /dev/nvidia* | xargs -I{} echo '--device {}:{}' | |
docker run -v /var/lib/nvidia-docker/volumes/nvidia_driver/384.98:/driver --device /dev/nvidia0:/dev/nvidia0 --device /dev/nvidiactl:/dev/nvidiactl --device /dev/nvidia-uvm:/dev/nvidia-uvm --device /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools -it -v `pwd`:/data nvidia/cuda:8.0-runtime-ubuntu16.04 bash | |
export PATH=$PATH:/driver/bin | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/driver/lib64/ |
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 program_summary(program): | |
print("--------------------") | |
for block in program.blocks: | |
for op in block.ops: | |
outputs = [[x + ":"] + op.output(x) for x in op.output_names] | |
inputs = [[x + ":"] + op.input(x) for x in op.input_names] | |
print(block.idx, op.type, inputs, "|", outputs) |
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
package main | |
import ( | |
"net/http" | |
"fmt" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Println("Inside handler") | |
fmt.Fprintf(w, "Hello world from my Go program!") |
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
- repo: https://github.com/dnephin/pre-commit-golang | |
sha: e4693a4c282b4fc878eda172a929f7a6508e7d16 | |
hooks: | |
- id: go-fmt | |
files: \.go$ | |
- id: go-lint | |
files: \.go$ | |
exclude: (.*\/client\/.*\.go|.*\generated\.deepcopy\.go)$ | |
- repo: local |
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
matrix: | |
include: | |
- language: go | |
go: 1.8.x | |
sudo: required | |
install: | |
- go get -u github.com/golang/lint/golint | |
- curl https://glide.sh/get | bash | |
- sudo pip install pre-commit | |
script: |
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
diff --git a/format.go b/format.go | |
index bce4914..fb40b9d 100644 | |
--- a/format.go | |
+++ b/format.go | |
@@ -12,8 +12,8 @@ import ( | |
) | |
const ( | |
- timeFormat = "2006-01-02T15:04:05-0700" | |
- termTimeFormat = "01-02|15:04:05" |
OlderNewer