Skip to content

Instantly share code, notes, and snippets.

View SpringMT's full-sized avatar

Spring_MT SpringMT

View GitHub Profile
@SpringMT
SpringMT / gist:1b5bed2f027bd39b26b285b2364c9535
Created August 13, 2017 07:25
stackprof print_method(/pow|newobj|math/)
A#pow (/home/ec2-user/stackprof/sample.rb:11)
samples: 1574 self (41.2%) / 1574 total (41.2%)
callers:
1574 ( 100.0%) A#initialize
code:
| 11 | def pow
1574 (41.2%) / 1574 (41.2%) | 12 | 2 ** 100
| 13 | end
A.newobj (/home/ec2-user/stackprof/sample.rb:15)
samples: 873 self (22.9%) / 873 total (22.9%)
@SpringMT
SpringMT / gist:3a9bcde944d4c3f390b4c29be6747c11
Created August 13, 2017 07:25
stackprof result.print_text
==================================
Mode: wall(1000)
Samples: 3817 (0.00% miss rate)
GC: 282 (7.39%)
==================================
TOTAL (pct) SAMPLES (pct) FRAME
1574 (41.2%) 1574 (41.2%) A#pow
873 (22.9%) 873 (22.9%) A.newobj
1629 (42.7%) 869 (22.8%) A#math
3535 (92.6%) 178 (4.7%) block (2 levels) in <main>
{:version=>1.1,
:mode=>:wall,
:interval=>1000,
:samples=>3817,
:gc_samples=>282,
:missed_samples=>0,
:frames=>
{47247995082020=>
{:name=>"A#pow",
:file=>"/home/ec2-user/stackprof/sample.rb",
@SpringMT
SpringMT / stopwatch.hpp
Created August 3, 2017 08:03 — forked from Giemsa/stopwatch.hpp
怠惰な人のための時間計測クラス for C++11
#include <chrono>
#include <iostream>
namespace detail
{
namespace chrono
{
template<typename P>
struct UnitName;
require 'optparse'
require 'yaml'
require 'erb'
require 'pp'
verbose = false
opt = OptionParser.new
opt.on('--verbose') {|v| verbose = v }
opt.parse!(ARGV)
@SpringMT
SpringMT / gist:dc1494e70479875ea983e70d1ca3864b
Last active December 25, 2016 14:47
Ruby 2.4.0 for gdbinit
set print pretty on
set pagination off
define ruby_thread
set $ruby_thread = ruby_current_vm->running_thread
printf "running_thread set $ruby_thread \n"
end
define vm_cfp_cnt
printf "cfp_cnt %d \n", ((rb_control_frame_t *)(($arg0)->stack + ($arg0)->stack_size) - (rb_control_frame_t *)($arg1))
set print pretty on
set pagination off
define ruby_thread
set $ruby_thread = ruby_current_vm->running_thread
printf "running_thread set $ruby_thread \n"
end
define vm_cfp_cnt
printf "cfp_cnt %d \n", ((rb_control_frame_t *)(($arg0)->stack + ($arg0)->stack_size) - (rb_control_frame_t *)($arg1))
## rails
* cronの設定
* ローカルからでプロい
* scafoldは使いやすく
* DBは一つ
* 権限管理周りはどうするかな
* IPアドレス制限くらいはかけられる
* キュー処理はかけるようにしてあげてもよいか
* JSON APIとかくらいはたたけるようにする
*

遺伝子の売買に関して

遺伝子または、そこから生成されるタンパク質(主に酵素)は金になります。 もちろん売買がされています。 こういうことを生業にしているところも多くあります。 (特に細菌ですね。)

一例ですが、PCR(RPCではないです)を考えてみましょう。 人類が遺伝子解析を行うことができるのは、PCRの恩恵であることは間違いありません。 DNAの特性を活かして、DNA増幅酵素を用いて、DNAを増幅させるのですが、ここで1つ問題がありました。 このPCRは加熱と冷却を繰り返すのですが、普通のDNA増幅酵素は熱に弱いのです。

puts RubyVM::InstructionSequence.compile("exit(0) []").disasm
== disasm: #<ISeq:<compiled>@<compiled>>================================
0000 trace 1 ( 1)
0002 putself
0003 putobject_OP_INT2FIX_O_0_C_
0004 opt_send_without_block <callinfo!mid:exit, argc:1, FCALL|ARGS_SIMPLE>, <callcache>
0007 opt_send_without_block <callinfo!mid:[], argc:0, ARGS_SIMPLE>, <callcache>
0010 leave
=> nil