Skip to content

Instantly share code, notes, and snippets.

@ddk50
ddk50 / BayseRuby.patch
Created February 18, 2012 13:45
Bayse統計をつかった統計的デバッグ支援ツール
diff --git a/Makefile.in b/Makefile.in
index 6b12187..9a6e1b8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -59,7 +59,7 @@ CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
EXTLDFLAGS =
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
+EXTLIBS = -lgsl -lgslcblas
@ddk50
ddk50 / NoobCode.rb
Created February 23, 2012 22:50
Noob Code
require 'bayesdebug.rb'
class Eratosthenes20
def self.isMultiple2(i)
## if i == 3
if i == 3
return false
end
@ddk50
ddk50 / test
Created March 4, 2012 04:44
test
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index 259382e..ae96943 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -446,7 +446,8 @@ class GetoptLong
terminate
return nil
elsif @ordering == PERMUTE
- while 0 < ARGV.length && ARGV[0] !~ /^-./
+## while 0 < ARGV.length && ARGV[0] !~ /^-./ correct
@ddk50
ddk50 / test.rb
Created March 4, 2012 05:27
test
require 'getoptlong'
require 'bayesdebug'
class AAA
def self.test
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--repeat', '-n', GetoptLong::REQUIRED_ARGUMENT ],
[ '--name', GetoptLong::OPTIONAL_ARGUMENT ]
)
@ddk50
ddk50 / rm_dd_benchmark.rb
Created October 28, 2016 09:03
rmとddのベンチマーク
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# 以下2つのプロセスを用意して、同時に実行
# 1つ目のプロセスで1MBのファイルを40000個削除する
# 2つ目のプロセスでddで/dev/zeroから1GBファイルをディスクにwrite
# * 40000ファイルrmとddを同時に行う(チョークなし)実験結果
# 1. 1073741824 bytes (1.1 GB) copied, 13.3225 s, 80.6 MB/s
# 2. 1073741824 bytes (1.1 GB) copied, 14.1681 s, 75.8 MB/s
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
int main (int argc, char *argv[])
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
int main (int argc, char *argv[])
@ddk50
ddk50 / odirect_write_sample.c
Created March 28, 2022 20:18
a sample for O_DIRECT open
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
int main (int argc, char *argv[])
version: '3.8'
services:
https-portal:
image: steveltn/https-portal:1
ports:
- '80:80'
- '443:443'
networks:
- web_network
environment:
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>