Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
@kehao
高级会员
第 416 位会员 / 2011-12-08

14 篇帖子 / 55 条回帖
1 关注者
1 正在关注
100 收藏
GitHub Public Repos
  • district_cn_selector 32

  • district_cn 3

    地区码查询插件

  • stickers 2

    一个以贴纸为主的活动

  • Blog 2

    日常技术博客

  • workspace 1

    workspace

  • RUI 1

    react 组件库

  • weiwen-test 0

    微文 - 基于EOS和IPFS的类微博DAPP

  • node-x509 0

    Simple X509 certificate parser.

  • Kehao.github.io 0

    基于umi, ts, lerna的react组件库

  • react-ui 0

    react ui 组件库

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • sunspot 要如何設定才能令在隨 ubuntu 11.10 伺服器一併起動,不用再去應用程式輸入命令? at 2012年04月20日

    自动调动在/etc/init.d 里加 欄位是啥么意思,字段?可以加很多欄位还可以加权重。

    
    searchable(:ignore_attribute_changes_of=>ignored_index_attributes,
                 :if => proc { |model|  !model.deleted_at  }) do
        text :name, :stored => true,:more_like_this=>true
        text :token_name do
          Topic.tokens(name)   
        end
        #text :content
        string :user_id
        time :created_at
      end
    
    
    
    hits= Sunspot.search([Question,Topic,User]) do
          keywords params[:query] do
           # fields(:conent, :name => 2.0)
            boost_fields :name => 2.0
            query_phrase_slop 1
          end
          adjust_solr_params do |sunspot_params|
            sunspot_params[:start] = 0
            sunspot_params[:rows] = 9
          end
        end.hits
    
    

    https://github.com/sunspot/sunspot

  • new_cpanel_bg_category_path 这个路由就是不认识 at 2012年04月20日

    #5 楼 @hunter 应该用这个,这样 new 和 edit 只要一个页面

  • 用 Rails 做 Instagram 的后台,要怎样架构?[内附连接] at 2012年04月20日

    #3 楼 @zeeler 数据库通过 redis 减压 你们是怎么做的?

  • 针对大量数据跑任务 at 2012年04月19日

    建议先做数据库优化,索引很重要,可以考虑分表,读写分离。实时性不是很高的需求不建议用队列,这种一个操作就要更改上 1000 万条数据的需求真的并不多,客户又不要求你一下把这上 1000 万的数据给列出来。

  • Ruby China T 恤第二期报名活动开始啦![已结束] at 2012年04月19日

    报名,求,各种求,跪求

  • [杭州][2012年04月17号] Ruby Tuesday 在大浪 at 2012年04月16日

    刚去转了圈,有很不错的沙发。

  • 分享一下我的项目:qisine at 2012年04月16日

    恩,菜式有限制,配送范围也有限制。这是要做成全国范围的还是同城的?

  • 分享一下我的项目:qisine at 2012年04月16日

    这个 idea 不错,看来以后厨师得一边做菜一边看着网站有没有人下订单了,特别中国,独门秘方,传男不传女的菜式,肯定有人订

  • nginx error_page 相关问题 at 2012年04月15日

    #3 楼 @doitian ssl_verify_client 关了没问题

  • nginx error_page 相关问题 at 2012年04月14日

    #1 楼 @minix 感谢 error_page 不起作用,http://leweiup.com/questions/836

  • [杭州 - 滨江] 招聘 Ruby 开发工程师 at 2012年04月13日

    喜欢写文档 这种人才很少哦

  • 缓存引起的 Undefined Class/Module 有什么优雅的解决方法? at 2012年04月13日

    #1 楼 @quakewang 谢谢,原来可以这样解决

  • https uploadify 上传文件时报 IO Error at 2012年04月12日

    求解~

  • https uploadify 上传文件时报 IO Error at 2012年04月11日

    么有人遇到相似的问题么?

  • 不能 Marshal.dump 分页数据?? at 2012年03月21日

    #7 楼 @Rei
    my_array_object=Question.where(id:1).page(1).to_a Kaminari.paginate_array(my_array_object).page(params[:page]).per(10) 取出第一页的数据你再分页有什么用? my_array_object=Question.where(id:1).to_a Kaminari.paginate_array(my_array_object).page(params[:page]).per(10) 分页查询又没用

  • 不能 Marshal.dump 分页数据?? at 2012年03月21日

    #5 楼 @Rei Array 没有 current_page,include....之类的方法

  • 不能 Marshal.dump 分页数据?? at 2012年03月21日

    to_a 和 all ,first,last 都可以立即执行,问题是 view 里的 = paginate @targets 用不了了

  • 不能 Marshal.dump 分页数据?? at 2012年03月21日

    大家有这种问题么?还是我环境出问题了?

  • 请用一句话证明你用过 ruby on rails! at 2012年03月02日

    Question.singleton_class.superclass == Question.superclass.singleton_class => true

  • 一整页招聘。。帖子排序应该按照最后回复时间,而不是 updated_at at 2012年02月23日

    看到满屏招 ruby 程序员的,我感到很 happy

  • 求教,学习 EventMachine 时遇到的问题 at 2012年02月21日

    #9 楼 @calebx 感谢纠正 想起 unicorn 的重启好像用的 run "kill -USR2 `cat #{deploy_to}/current/tmp/pids/unicorn.pid`" 看了下 unicorn 源码:

    
    #lib/unicorn/http_server.rb
    case SIG_QUEUE.shift
          when :QUIT # graceful shutdown
            break
          when :TERM, :INT # immediate shutdown
            stop(false)
            break
          when :USR1 # rotate logs
            logger.info "master reopening logs..."
            Unicorn::Util.reopen_logs
            logger.info "master done reopening logs"
            kill_each_worker(:USR1)
          when :USR2 # exec binary, stay alive in case something went wrong
            reexec
    #.....
    end
    
    def reexec
    #....
     self.reexec_pid = fork do
          listener_fds = Hash[LISTENERS.map do |sock|
            # IO#close_on_exec= will be available on any future version of
            # Ruby that sets FD_CLOEXEC by default on new file descriptors
            # ref: http://redmine.ruby-lang.org/issues/5041
            sock.close_on_exec = false if sock.respond_to?(:close_on_exec=)
            [ sock.fileno, sock ]
          end]
          ENV['UNICORN_FD'] = listener_fds.keys.join(',')
          Dir.chdir(START_CTX[:cwd])
          cmd = [ START_CTX[0] ].concat(START_CTX[:argv])
    
          # avoid leaking FDs we don't know about, but let before_exec
          # unset FD_CLOEXEC, if anything else in the app eventually
          # relies on FD inheritence.
          (3..1024).each do |io|
            next if listener_fds.include?(io)
            io = IO.for_fd(io) rescue next
            IO_PURGATORY << io
            io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
          end
    
          # exec(command, hash) works in at least 1.9.1+, but will only be
          # required in 1.9.4/2.0.0 at earliest.
          cmd << listener_fds if RUBY_VERSION >= "1.9.1"
          logger.info "executing #{cmd.inspect} (in #{Dir.pwd})"
          before_exec.call(self)
          exec(*cmd)
        end
        proc_name 'master (old)'
    #...
    end
    
    before_fork do |server, worker|
      old_pid = "#{Rails.root}/tmp/pids/unicorn.pid.oldbin"
      if File.exists?(old_pid) && server.pid != old_pid
        begin
          Process.kill("QUIT", File.read(old_pid).to_i)
        rescue Errno::ENOENT, Errno::ESRCH
          puts "Send 'QUIT' signal to unicorn error!"
        end
      end
    end
    
  • 求教,学习 EventMachine 时遇到的问题 at 2012年02月21日

    #6 楼 @clc3123 这个是 VMware's Cloud Application Platform 的源代码,我是拉下来学习学习的 https://github.com/derekcollison/vcap

  • 求教,学习 EventMachine 时遇到的问题 at 2012年02月21日

    #1 楼 @lgn21st 第 1 个问题,哈哈,没看懂手册上说什么,只知道 epoll 比 select,poll 好。~……~!!

  • 求教,学习 EventMachine 时遇到的问题 at 2012年02月21日

    #1 楼 @lgn21st 首先感谢

    第 2 个问题 kill -Signal pid signal 是发送给进程的信号,TERM(或数字 9)表示“无条件终止” 信号 INT(或数字 2),就是 ctrl+c

  • 请问有没有 ruby 写的日志分析软件啊? at 2011年12月08日

    very good!

  • 上一页
  • 1
  • 2
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English