Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Sevk
@sevk
高级会员
第 681 位会员 / 2012-01-05

嘉兴
47 篇帖子 / 934 条回帖
10 关注者
1 正在关注
37 收藏
Sevk
打赏作者
GitHub Public Repos
  • kk-irc-bot 55

    irc-bot , like a human

  • rustdesk 0

    An open-source remote desktop, and alternative to TeamViewer.

  • rustdesk-server 0

    RustDesk Server Program

  • notepad4 0

    Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with ...

  • VB6toRuby-tk 0

    vb6 code to ruby code auto convert

  • qqwry 0

    纯真IP数据库,每天从官方授权方式自动抓取最新文件

  • linux-wifi-hotspot 0

    Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. I...

  • VB6-Compression 0

    VB6 wrappers for modern compression libraries

  • Dism-Multi-language 0

    Dism++

  • HumanSystemOptimization 0

    健康学习到150岁 - 人体系统调优不完全指南

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • BitCoin 有冲向 $1000 的趋势啊 at 2013年11月19日

    虽然是泡,但是促进了相关技术的发展。泡沫也是有好处的。对于大部分人来说:利大于弊。

    #1 楼 @shatle

  • 如何用代码描述问题而不是过程式思考? at 2013年11月15日

    好的代码,他本身的可读性就像是注释一样。像英文那样。人机交流更简便。

  • Ruby China 是采用了什么架构和技术让网站这么快的? at 2013年11月15日

    语言不是重点,设计很重要. ruby 让你关注设计,减少语言层面的折腾,很人性化。

  • 并行赋值的使用场景 at 2013年11月14日

    #18 楼 @bhuztez x,y,z 没赋值?

  • 这段三行的 Ruby 的 Socket 代码求解释? at 2013年11月14日

    就解个域名啊?

  • 松本行弘的新书《关于 mRuby 的一切》 at 2013年11月13日

    喜欢电子书,淘宝电子书

  • 访问 Github 一直跳转到帮助界面,不知道如何解决 at 2013年11月13日

    可能这个木马针对你的网卡 MAC 吧,不过可能性不大。

  • 访问 Github 一直跳转到帮助界面,不知道如何解决 at 2013年11月12日

    或者路由器中木马了,篡改了 dns 的数据

  • 访问 Github 一直跳转到帮助界面,不知道如何解决 at 2013年11月12日

    如果不是 hosts 的关系,可能 DNS 被污染?

  • 关于 Ruby 中全局变量 $SAFE 的一点疑惑,求解答 at 2013年11月12日

    因为 $SAFE 关系到安全

  • 怎么将 gbk 的中文字符转换成 unicode 编码? at 2013年11月11日
    
    #!/usr/bin/env ruby
    # -*- coding: UTF-8 -*-
    #
    # ruby utf8 gb2312 gbk gb18030 转换
    require 'rubygems'
    
    if RUBY_VERSION > '1.9'
       if RUBY_VERSION > '1.9.2'
          $ec1 = Encoding::Converter.new("UTF-16lE", "UTF-8", :universal_newline => true)
          $ec2 = Encoding::Converter.new("UTF-8","GB2312", :universal_newline => true)
       else
          require 'iconv'
       end
    else
       require 'iconv'
    end
    
    class String
       #s.encode!("gbk")
       def code_a2b(a,b)
          if RUBY_VERSION > '1.9.2' and defined? Encoding::Converter
            tmp = Encoding::Converter.new(a,b, :universal_newline => true)
            tmp.convert self rescue self
          else
            Iconv.conv("#{b}//IGNORE","#{a}//IGNORE",self)
          end
       end
       def gbtoX(code)
         code_a2b('GB18030',code)
         #code_a2b('CP20936',code)
         #code_a2b('GB2312',code)
       end
    
       def togb2312
          return $ec2.convert self if RUBY_VERSION > '1.9.2'
          Iconv.conv("CP20936#{Ig}","UTF-8#{Ig}",self)
       end
    
       def togbk
          if RUBY_VERSION > '1.9.2'
             $ec2.convert self rescue self
          else
             Iconv.conv("GBK#{Ig}","UTF-8#{Ig}",self)
          end
       end
    
       def togb
          if RUBY_VERSION > '1.9.2'
             $ec2.convert self rescue self
          else
             Iconv.conv("GB2312#{Ig}","UTF-8#{Ig}",self)
          end
       end
       alias to_gb togb
    
       def utf8_to_gb
          return $ec2.convert self if RUBY_VERSION > '1.9.2'
          Iconv.conv("GB18030#{Ig}","UTF-8#{Ig}",self)
       end
       def gb_to_utf8
          return $ec1.convert self if RUBY_VERSION > '1.9.2'
          Iconv.conv("UTF-8#{Ig}","GB18030#{Ig}",self)
       end
       def to_utf8
          return $ec1.convert self if RUBY_VERSION > '1.9.2'
          Iconv.conv("UTF-8#{Ig}","GB18030#{Ig}",self)
       end
       alias toutf8 to_utf8
    
       def to_hex(s=' ')
          self.each_byte.map{|b| "%02X" % b}.join(s)
       end
    end
    
    begin
      require 'rchardet' if RUBY_VERSION < '1.9'
      require 'rchardet19' if RUBY_VERSION > '1.9'
    rescue LoadError
      s="载入库错误,命令:
      apt-get install rubygems; #安装ruby库管理器 
    gem install rchardet; #安装字符猜测库\n否则字符编码检测功能可能失效. \n"
      s = s.utf8_to_gb if win_platform?
      puts s
      puts $!.message + $@[0]
    end
    def guess(s)
      CharDet.detect(s)['encoding'].upcase
    end
    
    if $0 == __FILE__
       puts '中文'.togbk
    end
    
    
    
  • 比特币安全指南 at 2013年11月11日

    杀个人也可以匿名,放个病毒也可以。 利益交换可以匿名,这是什么节奏?

    匿名不是他的优点之一,而是他的缺点之一吧?

  • 对于 md5 字符串,有没有 hash 函数可以映射成整数 at 2013年11月11日

    嗯,那就 Digest::MD5.digest("aa")

  • 对于 md5 字符串,有没有 hash 函数可以映射成整数 at 2013年11月11日

    'aa'.to_sym.object_id 'aa'.to_sym 就已经唯一了

  • [已解决] RVM 安装好了,安装 readline 失败。 at 2013年11月10日

    嗯,以前是要自己手工 apt-get install libreadline-dev 的

  • ruby 报错: You're running a version of ruby with no Readline support at 2013年11月10日

    先 apt-get install libreadline-dev , 再 rbenv install 试试

  • 1111 了,你的购物车里放了哪本书? at 2013年11月07日

    淘宝电子书不错

  • 发现 Puma 用 JRuby 来跑确实快了好多 at 2013年11月06日

    Rubinius 成熟了吗?不敢用

  • 还是关于开发工具! at 2013年11月05日

    买台笔记本吧,i3 才 2300 元

  • 码农自己家里看电影用什么投影仪比较好? at 2013年11月05日

    我安装了个 pptv , 然后看里面的蓝光电影,应该用什么投影仪?估计 1080p 的 呵呵

  • 那就让大家看看给 @lichooo 的邮件内容吧 at 2013年11月05日

    情商 是一门学问,大家都要学。

  • 对于客户只有一台 windows 服务器且限定 sql server 的时候,怎么处理 at 2013年11月01日

    使用 ActiveRecord 还行,我用过的。

  • RVM + Rubinius + Rails + Puma + Nginx + Capistrano + Ubuntu 12.04 配置方案 at 2013年11月01日

    学习了,多谢

  • 又有人退出江湖了? at 2013年11月01日

    维护者就一个人啊?

  • RubyMine 4 正式版发布 at 2013年10月31日

    用了一下,确实不错。功能强大,不卡。

    不过选择字体时,字体数量太少了,只有 6 个。

  • [已解决] 编译器干嘛用的? at 2013年10月31日

    1 和 2 有时候可以省略,省去自己编译的时间。 网上有别人编译好的 ruby install for windows 或 apt-get install ruby

    而且 ruby 代码可以直接像 C 语言那样编译成本地代码: http://rubini.us/

  • ruby 中的 Thread at 2013年10月30日

    ruby.exe 在 任务管理器里面的线程数是 100 多个,好多啊。

  • Webrick 源码阅读笔记 at 2013年10月30日

    学习了

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