GCP_PROJECT_ID
の部分を GCP のプロジェクトIDにすると動く
go-cloud-workspace
はコレクション名
DB_NAME
の部分を MongoDB の DB 名にする
foo
はコレクション名
接続設定は環境変数 MONGO_SERVER_URL
にセットする
const canvas = document.getElementById('game'); | |
const ctx = canvas.getContext('2d'); | |
const tileSize = 10; | |
const numRows = canvas.height / tileSize; | |
const numCols = canvas.width / tileSize; | |
const numEnemies = 5; // お好みの敵の数に設定 | |
const rows = 10; | |
const cols = 10; | |
const cellSize = 32; |
" Returns the byte offset for the cursor | |
function! OffsetCursor() abort | |
let line = line('.') | |
let col = col('.') | |
if &encoding != 'utf-8' | |
let sep = "\r" | |
let buf = l:line == 1 ? '' : (join(getline(1, l:line-1), sep) . sep) | |
let buf .= l:col == 1 ? '' : getline('.')[:l:col-2] | |
return len(iconv(buf, &encoding, 'utf-8')) | |
endif |
drop table datasets; | |
create table datasets ( uuid varchar(40), name varchar(100), data jsonb ); | |
INSERT INTO datasets ( uuid, name, data ) VALUES ( '212ea202-36d9-4f7b-b2ff-58a702e7fa5e', 'books', | |
json_build_object( | |
'id_integer', 2602, 'id_string', '2602', 'id_float', 2602.0, | |
'title_integer', 0, 'title_string', 'ぅえりはわへうせぴぽしぷ', 'title_float', 0.0, | |
'price_integer', 660, 'price_string', '660', 'price_float', 660.0 | |
) | |
); | |
INSERT INTO datasets ( uuid, name, data ) VALUES ( 'd18fc8a7-cef1-4dc9-b64d-04fa23c2d516', 'books', |
このサンプルで CORS 対応した server.go ファイルです https://github.com/99designs/gqlgen/tree/master/example/todo
↓の公式ドキュメントが古いので(2020-03-17時点)動きませんでした https://gqlgen.com/recipes/cors/
実装は至ってシンプルで、chi
の Router
に cors
のミドルウェアを Use
させてるだけです。
main.cpp:6:10: error: no viable conversion from 'A<Bar>' to 'A<Foo>' | |
A<Foo> a = A<Bar>(); | |
^ ~~~~~~~~ | |
main.cpp:3:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'A<Bar>' to 'const A<Foo> &' for 1st argument | |
template <typename T> class A {}; | |
^ | |
main.cpp:3:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'A<Bar>' to 'A<Foo> &&' for 1st argument | |
template <typename T> class A {}; | |
^ | |
1 error generated. |
remote/host: python3 host registered plugins [] | |
function remote#host#UpdateRemotePlugins[6]..<SNR>39_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll, line 4 | |
Vim(if):ch 15 was closed by the client | |
Fatal Python error: PyThreadState_Get: no current thread | |
function remote#host#UpdateRemotePlugins[6]..<SNR>39_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll, line 14 | |
Failed to load python host. You can try to see what happened by starting nvim with $NVIM_PYTHON_LOG_FILE set and opening the generated log file. Also, the host stderr is available in messages. | |
remote/host: generated rplugin manifest: /Users/ocha/.local/share/nvim/rplugin.vim |
function! RunTest() | |
let filter = substitute(expand('%:t'), "_test.cpp", "", "g") | |
let filter = substitute(l:filter, ".cpp", "", "g") | |
let filter = system("ruby -e \"print '" . l:filter . "'.split('_').collect(&:capitalize).join\"") | |
let lower_filter = tolower(l:filter[0]) . l:filter[1 : -1] | |
let output = system("make build-test && GTEST_FILTER=*" . l:filter . "*:*" . l:lower_filter . "* build/test") | |
echo "test finished" | |
cexpr l:output | |
endfunction |