I hereby claim:
- I am keating on github.
- I am keating (https://keybase.io/keating) on keybase.
- I have a public key ASDhCcfHWZIv38FpG4HGYJDNutvbeerZAf9X5aAkuQgIEgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
require "active_record" | |
ActiveRecord::Base.establish_connection( | |
:adapter => "postgresql", | |
:host => "localhost", | |
:username => "map", | |
:password => "map", | |
:database => "lspf" | |
) |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* bidirectional hashMap | |
* 双向的HashMap对应关系 | |
* | |
* @author keating_andy_given | |
*/ |
pid = fork { `nohup ruby GpsReader.rb 1 &` } | |
# 这种写法能得到一个子进程的PID,但不是shell命令所运行进程的PID,若shell命令启动一个服务(一直运行),那么此子进程也不会死掉(与block是个while true,子进程便不会死掉一样) | |
pid = fork { exec "`nohup ruby GpsReader.rb 1 &`" } | |
# 这种写法能得到一个子进程的PID,同样不是shell命令进程的PID,子进程马上就结束了(ps S -C ruby或ps S -p your_PID),是exec方法在起作用(Replaces the current process by running the given external _command_),所以,在ruby代码运行一个shell命令时,使用exec要比直接`少一个进程 | |
Process.detach(pid) | |
puts pid | |
while true | |
puts "i am father..." | |
sleep 2 |
require 'rss/2.0' | |
require 'open-uri' | |
require 'timeout' | |
module PagesHelper | |
def blog_feed | |
html = "" | |
begin |
Coping the following codes: | |
``` | |
LoadModule proxy_module modules/mod_proxy.so | |
LoadModule proxy_http_module modules/mod_proxy_http.so | |
<VirtualHost *:80> | |
ServerName www.jobmre.fr | |
DocumentRoot /usr/local/pro/future_cadre | |
ProxyRequests Off |
starling错误信息 | |
Exception in MqBase::get()---incompatible marshal file format (can't be read) | |
format version 4.8 required; 83.84 given;time:2 q_carstate | |
mq_base.get::q_carstate | |
Exception in MqBase::get()---marshal data too short;time:3 q_carstate | |
mq_base.get::q_carstate | |
Exception in MqBase::get()---marshal data too short;time:4 q_carstate | |
mq_base.get::q_dispatcher | |
mq_base.get::q_obsever | |
Exception in MqBase::get()---Timeout::Error;time:1 q_dispatcher |
#1 | |
# 测试登录,omniauth-identity | |
it "will show save search button in home" do | |
OmniAuth.config.test_mode = false | |
user ||= FactoryGirl.create(:identity_first) | |
visit login_path | |
within("form") do | |
fill_in 'auth_key', with: user.email |
2.times.map { | |
Thread.new { while true do end } | |
}.each(&:join) |
===development/webrick================================================================ | |
内存: | |
启动(点击首页) 查询提单 打开两个浏览器轮流查询 2分钟不操作 | |
CRuby 1.8% 2.5% 3.5% 3.5% | |
JRuby 10.9% 11.0% 11.9% 11.9% | |
CPU在查询提单时最大占用率(大约) | |
CRuby 30% | |
JRuby 40% |