This file contains hidden or 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
| " vim-plugでPluginがインストールされているかどうかを判定する | |
| function s:has_plugged(name) | |
| if exists('g:plugs') && has_key(g:plugs, a:name) && isdirectory(g:plugs[a:name].dir) | |
| return 1 | |
| else | |
| return 0 | |
| endif | |
| endfunction |
This file contains hidden or 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
| /** | |
| * continuous dump from binary stream | |
| * $ tail -f xxx | xstream | |
| */ | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| void xstreamer(FILE *fdin, FILE *fdout) { | |
| int col = 0; |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| static int ng_count = 0; | |
| #define TEST_EQUAL(expect, v) do { if ((v) != (expect)) { \ | |
| printf("Failed @__%d__: v=%02x expect=%02x", __LINE__, (v), (expect)); \ | |
| printf("\n v:"); \ | |
| DEC2BIN((v)); \ | |
| printf("\n e:"); \ |
This file contains hidden or 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
| // 標準入力を受け取って標準出力に吐き出す | |
| use std::io::{self, Read, Write}; | |
| fn main() { | |
| const N: usize = 8; | |
| let mut buf = [0u8; N]; | |
| loop { | |
| match io::stdin().read(&mut buf) { | |
| Ok(s) => { | |
| if s == 0 { |
This file contains hidden or 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
| /** | |
| * Calculate Base64 encoded size | |
| **/ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| uint32_t calc_base64_size(uint32_t size) | |
| { | |
| uint32_t bit_size = size * 8; |
This file contains hidden or 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
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <stdlib.h> | |
| /** |
This file contains hidden or 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 ( | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| buf := make([]byte, 0x10) | |
| offset := 0x00000000 |
This file contains hidden or 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
| .DS_Store | |
| *~ | |
| *.hex | |
| *.bak | |
| GPATH | |
| GRTAGS | |
| GTAGS | |
| tags | |
| doxygen/ | |
| *.zip |
This file contains hidden or 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 | |
| type container struct { | |
| v [64]byte | |
| } | |
| func MakeContainer() *container { | |
| c := container{} | |
| return &c | |
| } |