https://github.com/xuwei-k/grpc-scala-sample
$ sbt
> project grpcScalaSample
> compile
> run # runMain is OK
**コンストラクター** | |
1. フェラーリ | |
2. マクラーレン | |
3. メルセデス | |
4. レッドブル | |
5. ウィリアムズ | |
6. HaaS | |
7. レーシングブルズ | |
8. アストンマーティン |
def dynamic_generated_fn(): | |
created_fns = {} | |
fn_code = """def {name}(x): | |
return x + '_called_by_{name}'""" | |
fn_name1 = 'foo' | |
fn_name2 = 'bar' |
# This is the custom theme template for gitprompt.sh | |
override_git_prompt_colors() { | |
GIT_PROMPT_THEME_NAME="Custom" | |
GIT_PROMPT_START_USER="${BoldCyan}${USER}@${HOSTNAME%%.*} ${ResetColor}_LAST_COMMAND_INDICATOR_ ${ResetColor}${Yellow}${PathShort}${ResetColor}" | |
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" | |
} | |
def test_bn_onnxruntime(): | |
import numpy as np | |
import onnx | |
# this code is from ONNX BatchNomalization example | |
# https://github.com/onnx/onnx/blob/master/onnx/backend/test/case/node/batchnorm.py | |
def _batchnorm_test_mode(x, s, bias, mean, var, epsilon=1e-5): # type: ignore | |
dims_x = len(x.shape) | |
dim_ones = (1,) * (dims_x - 2) | |
s = s.reshape(-1, *dim_ones) | |
bias = bias.reshape(-1, *dim_ones) |
class Database(object): | |
def dump(self, url): | |
import sqlite3 | |
db = sqlite3.connect(url) | |
script = '\n'.join(db.iterdump()) | |
with open('test.sql', 'w') as f: | |
f.write(script) | |
db.close() |
set -g prefix 'C-\' | |
unbind C-b | |
# enable mouse operation | |
set-option -g mouse on | |
# enable copy mode when scroll-up | |
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" | |
# unable coy mode on end of scroll | |
bind-key -n WheelDownPane select-pane -t= \; send-keys -M |
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Remap cursor keys</name> | |
<identifier>private.remap.cursor_keys</identifier> | |
<autogen>__KeyToKey__ KeyCode::HOME, KeyCode::CURSOR_LEFT</autogen> | |
<autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, KeyCode::CURSOR_DOWN</autogen> | |
<autogen>__KeyToKey__ KeyCode::CURSOR_DOWN, KeyCode::CURSOR_UP</autogen> | |
<autogen>__KeyToKey__ KeyCode::CURSOR_UP, KeyCode::HOME</autogen> | |
</item> |
# meta info | |
NAME := myproj | |
VERSION := $(shell git describe --tags --abbrev=0) | |
REVISION := $(shell git rev-parse --short HEAD) | |
LDFLAGS := -X 'main.version=$(VERSION)' \ | |
-X 'main.revision=$(REVISION)' | |
# setup required tools | |
## Setup | |
setup: |
https://github.com/xuwei-k/grpc-scala-sample
$ sbt
> project grpcScalaSample
> compile
> run # runMain is OK