Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
@holyshared
holyshared / .editorconfig
Last active February 15, 2016 03:57
Benchmark of Hacklang
[*.hh]
indent_style = space
indent_size = 4
[*.md]
indent_style = tab
indent_size = 2
[*.json]
indent_style = space
all:
gcc -g --coverage fixture.c func1.c func2.c -o fixture
test:
./fixture
gcov -fbc fixture.c
lcov -t example -c -d . -o fixture.info --checksum --rc=lcov_branch_coverage=1
clean:
rm fixture *.gcda *.gcno *.info

Map

Command Chain

curl -X POST https://content.dropboxapi.com/2/files/upload \
--header 'Authorization: Bearer [ACCESS_TOKEN] \
--header 'Content-Type: application/octet-stream' \
--header 'Dropbox-API-Arg: {"path":"/[FILE_NAME]","mode":{".tag":"add"},"autorename":false,"mute":false}' \
--data-binary @'[LOCAL_FILE_NAME]'
require 'erb_parser'
class Collector
def initialize
@line = 1
@crlf = nil
end
def collect(t)
result = ErbParser.parse(t)

OCamlでのbit演算

10進数38を2進数に変換すると100110になる。
これを16bitにするには、0埋めするので0000000000100110

指定のbit位置が1かどうか調べるにはlsl関数とland関数を使う。

lsl

lsl関数は左にビットシフトさせることができる。

@holyshared
holyshared / .gitignore
Last active August 8, 2017 05:02
Nim Tutorial Part1
nimcache
@holyshared
holyshared / .gitignore
Last active August 17, 2017 02:32
Check digit of numbers
nimcache