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. |
random = `ruby non-totalistic-rules-random-picker.rb` | |
puts <<EOS | |
#CXRLE Pos=0,0 | |
x = 328, y = 264, rule = #{random} | |
b4ob2ob2obo3bobobob5obobobo3bo2b3o2bo2bo3b2obo2b4ob2o4bob2ob4ob3o4b3o | |
2b3o6bo3b2o2bo3b2o3bo6b2obob3o2bo2bobobo7bob4o3bo7b2o5bob4o2bob2o3bob | |
2o4b2o2b2o3bobo4b2o3bobo3bob4o2bobobob4ob6ob2o2b3obo8bo4b2o2bob5ob3o3b | |
o3b2o2b3o3b2obo3bo3bo4b4ob2o2bo$2o3bobo2b5obob2obobobo2b2o2b2o3bo4b2o | |
2bo2bob2o4b2ob3o2b3o3b2o3b4ob4o3bob2ob3obob4o2bo3b2obobo2b2ob3obob2obo |
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 |