<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>goodboyRyan (ryan)</title>
    <link>https://ruby-china.org/goodboyRyan</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>rails 直到网站挂掉才知道缓存多重要</title>
      <description>&lt;p&gt;昨天遇到一个很棘手的问题，业余做的 www.zhongduwang.com 网站;每秒 10 次访问压力就网站就挂掉；桑心的不得了，然后去群里面问问 NB 的，有的告诉我去做分布式处理，有的说数据库要优化？？这都不擅长，做分布式好像需要买新的服务器，这个成本问题很突出！pass 掉，我看到了 李华顺的博客，才知道优化可以做缓存来实现，而且非常非常高效。而且还找到了这个，第一步做了一个页面缓存，就网站不挂了，速度也好了很多，每秒承受压力达到 50 次。还有很多要做，此贴表表我的兴奋心情吧
&lt;a href="https://ruby-china.org/topics/19389" rel="nofollow" target="_blank"&gt;https://ruby-china.org/topics/19389&lt;/a&gt;&lt;/p&gt;</description>
      <author>goodboyRyan</author>
      <pubDate>Thu, 07 Aug 2014 10:13:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/20884</link>
      <guid>https://ruby-china.org/topics/20884</guid>
    </item>
    <item>
      <title>纠结的中文乱码问题</title>
      <description>&lt;p&gt;同志们，每次我（mac os）上传歌词都是正常的，但是换成 window 上传就是乱码；刚开始我一个一个的转换，现在受不鸟了，请求帮助？&lt;/p&gt;

&lt;p&gt;尝试的解决方案：
rails 版本：3.2.13
ruby 版本：1.9.3-p392
1，使用'iconv',不起效；
  Iconv.iconv("GBK", "UTF-8", xxx)
 Iconv.iconv("GB2312", "UTF-8", xxx)
 [04??14.06]??????ʱ????ת?ˣ?
2, 使用 force_encoding("utf-8") 不起效；
  [04??14.06]??????ʱ????ת?ˣ?
3，直接使用 encoding('utf-8'),不起效；&lt;/p&gt;

&lt;p&gt;寻求帮助，先拜谢&lt;/p&gt;</description>
      <author>goodboyRyan</author>
      <pubDate>Wed, 17 Jul 2013 11:21:41 +0800</pubDate>
      <link>https://ruby-china.org/topics/12562</link>
      <guid>https://ruby-china.org/topics/12562</guid>
    </item>
    <item>
      <title>ruby 模拟 http 请求  服务器端不能取得 header 的内容</title>
      <description>&lt;p&gt;先看 ruby 代码
require "net/http"
require "open-uri"&lt;br&gt;
require "uri" &lt;/p&gt;

&lt;p&gt;&lt;a href="/agent" class="user-mention" title="@agent"&gt;&lt;i&gt;@&lt;/i&gt;agent&lt;/a&gt; = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31'
data = {"m"=&amp;gt;"user", "a"=    &amp;gt;"login", "release"=&amp;gt;"20110501", "appid"=&amp;gt;"3"};&lt;/p&gt;

&lt;p&gt;uri = URI.parse("&lt;a href="http://localhost:8080/server/uc.php" rel="nofollow" target="_blank"&gt;http://localhost:8080/server/uc.php&lt;/a&gt;")
 request = Net::HTTP.post_form(uri, data)&lt;/p&gt;

&lt;p&gt;request.initialize_http_header({"USER-AGENT" =&amp;gt; "asdsdsd"})
 puts request.class
 puts request.body&lt;/p&gt;

&lt;p&gt;服务器端：
&amp;lt;?php
 header("Content-Type: text/html; charset=utf-8");
  echo $_SERVER['HTTP_USER_AGENT']."\n";
?&amp;gt;&lt;/p&gt;

&lt;p&gt;返回的结果是：
“Ruby”而不是  &lt;a href="/agent" class="user-mention" title="@agent"&gt;&lt;i&gt;@&lt;/i&gt;agent&lt;/a&gt;的内容
难道是 initialize_http_header 方法的问题
求帮助？&lt;/p&gt;</description>
      <author>goodboyRyan</author>
      <pubDate>Fri, 26 Apr 2013 17:47:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/10557</link>
      <guid>https://ruby-china.org/topics/10557</guid>
    </item>
    <item>
      <title>Devise 在 controller 里面创建一个用户 怎么使用户创建之后就登陆</title>
      <description>&lt;p&gt;寻求帮助？&lt;/p&gt;</description>
      <author>goodboyRyan</author>
      <pubDate>Wed, 20 Mar 2013 14:01:13 +0800</pubDate>
      <link>https://ruby-china.org/topics/9597</link>
      <guid>https://ruby-china.org/topics/9597</guid>
    </item>
    <item>
      <title>[devise] To select a encryption which isn't bcrypt, you should use devise-encryptable gem.</title>
      <description>&lt;p&gt;=&amp;gt; Booting WEBrick
=&amp;gt; Rails 3.2.8 application starting in development on &lt;a href="http://0.0.0.0:3000" rel="nofollow" target="_blank"&gt;http://0.0.0.0:3000&lt;/a&gt;
=&amp;gt; Call with -d to detach
=&amp;gt; Ctrl-C to shutdown server&lt;/p&gt;

&lt;p&gt;[DEVISE] To select a encryption which isn't bcrypt, you should use devise-encryptable gem.&lt;/p&gt;

&lt;p&gt;[2012-12-17 10:50:56] INFO  WEBrick 1.3.1
[2012-12-17 10:50:56] INFO  ruby 1.9.3 (2012-02-16) [x86_64-darwin11.4.0]
[2012-12-17 10:50:56] INFO  WEBrick::HTTPServer#start: pid=46243 port=3000&lt;/p&gt;

&lt;p&gt;这个 devise 警告是什么原因？&lt;/p&gt;</description>
      <author>goodboyRyan</author>
      <pubDate>Mon, 17 Dec 2012 11:00:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/7624</link>
      <guid>https://ruby-china.org/topics/7624</guid>
    </item>
  </channel>
</rss>
