<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>twm (cshome)</title>
    <link>https://ruby-china.org/twm</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>我做了一个面向开发者的 newsletter</title>
      <description>&lt;p&gt;感觉每天都很忙，忙着写各种 bug… 同时又很焦虑，感觉忙碌会让人错过各种“信息”。&lt;/p&gt;

&lt;p&gt;现在其实不缺信息，只是缺乏对信息的有效筛选机制，于是我干起了人工筛选信息的事。&lt;/p&gt;

&lt;p&gt;互联网 Newsletter 这种形式，多年前就有了，信息送达不够及时，后来邮件也成了一种“营销”形式，让许多人提起 Email 就想到垃圾邮件。&lt;/p&gt;

&lt;p&gt;以及现在很多人很难静下心来写一封“邮件”。&lt;/p&gt;

&lt;p&gt;于是，我做了一个“技术简报”，每周一封，让邮件变为你的信息收件箱。&lt;/p&gt;

&lt;p&gt;每周为开发者轻简读：技术创业、酷产品、新技术、编程语言、开发工具、DevOps…等内容。&lt;/p&gt;

&lt;p&gt;欢迎订阅： &lt;a href="https://dev.com.cn" rel="nofollow" target="_blank"&gt;https://dev.com.cn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;也欢迎投稿。&lt;/p&gt;

&lt;p&gt;发布周期为每周一，如果订阅当天是周一，则需要等到下个周期。&lt;/p&gt;

&lt;p&gt;永远不会发广告，可随时退订&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Fri, 11 Nov 2022 22:02:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/42742</link>
      <guid>https://ruby-china.org/topics/42742</guid>
    </item>
    <item>
      <title>创建了一个 “元宇宙” 介绍网站</title>
      <description>&lt;p&gt;网址：&lt;a href="https://itnext.cn" rel="nofollow" target="_blank"&gt;https://itnext.cn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;介绍元宇宙及最新动态、投融资、周边产品等。&lt;/p&gt;

&lt;p&gt;有感兴趣的可以一起交流。&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Sat, 25 Dec 2021 20:47:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/42026</link>
      <guid>https://ruby-china.org/topics/42026</guid>
    </item>
    <item>
      <title>多了一个空格</title>
      <description>&lt;p&gt;rt&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Tue, 06 Mar 2018 15:24:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/35157</link>
      <guid>https://ruby-china.org/topics/35157</guid>
    </item>
    <item>
      <title>讨薪说明</title>
      <description>&lt;p&gt;....&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Thu, 15 Jun 2017 16:49:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/33239</link>
      <guid>https://ruby-china.org/topics/33239</guid>
    </item>
    <item>
      <title>ruby-china 速度真快啊</title>
      <description>&lt;p&gt;真心赞&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Tue, 09 Aug 2016 13:53:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/30776</link>
      <guid>https://ruby-china.org/topics/30776</guid>
    </item>
    <item>
      <title>撸了一个宝宝起名字的 APP，至今为止最好的起名 APP，让你起了又起。</title>
      <description>&lt;p&gt;因为之前没写过 objc，所以从零看 swift，所以一共花了 2 周时间这么长才搞定。&lt;/p&gt;

&lt;p&gt;送给还在给宝宝起名的程序员爸爸妈妈们。&lt;/p&gt;

&lt;p&gt;名字：宝宝起名助手
下载：&lt;a href="https://appsto.re/cn/Ny9F4.i" rel="nofollow" target="_blank"&gt;https://appsto.re/cn/Ny9F4.i&lt;/a&gt;
兼容 iOS7/8，5X/iPhone6/6+&lt;/p&gt;

&lt;p&gt;&lt;img src="http://ww1.sinaimg.cn/large/005yyi5Jjw1enkoqukud0j30ku112jth.jpg" title="" alt=""&gt;
&lt;img src="http://ww4.sinaimg.cn/large/005yyi5Jjw1enkoqt6lq1j30ku112jsu.jpg" title="" alt=""&gt;
&lt;img src="http://ww1.sinaimg.cn/large/005yyi5Jjw1enkoqu2skbj30ku112jvo.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Sun, 11 Jan 2015 08:38:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/23666</link>
      <guid>https://ruby-china.org/topics/23666</guid>
    </item>
    <item>
      <title>也许是目前最好用的宝宝起名 APP，让你起了又起。</title>
      <description>&lt;p&gt;不过苹果的审核人员休圣诞节了。。。要元旦后才能上线了。
下面是截图。&lt;/p&gt;

&lt;p&gt;越狱用户 &lt;a href="http://fir.im/babyname" rel="nofollow" target="_blank"&gt;http://fir.im/babyname&lt;/a&gt;
兼容 iOS7/8，5X/iPhone6/6+&lt;/p&gt;

&lt;p&gt;&lt;img src="http://ww1.sinaimg.cn/large/005yyi5Jjw1enkoqukud0j30ku112jth.jpg" title="" alt=""&gt;
&lt;img src="http://ww4.sinaimg.cn/large/005yyi5Jjw1enkoqt6lq1j30ku112jsu.jpg" title="" alt=""&gt;
&lt;img src="http://ww1.sinaimg.cn/large/005yyi5Jjw1enkoqu2skbj30ku112jvo.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Wed, 24 Dec 2014 13:07:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/23378</link>
      <guid>https://ruby-china.org/topics/23378</guid>
    </item>
    <item>
      <title>Firefox for iOS with Swift</title>
      <description>&lt;p&gt;&lt;a href="https://github.com/mozilla/firefox-ios" rel="nofollow" target="_blank"&gt;https://github.com/mozilla/firefox-ios&lt;/a&gt;&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Wed, 10 Dec 2014 09:27:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/23113</link>
      <guid>https://ruby-china.org/topics/23113</guid>
    </item>
    <item>
      <title>xcode6 的 bug？</title>
      <description>&lt;p&gt;以下常量，加入一个 ViewController 后，无法 run，一直无限 indexing，cpu 高到 90% 以上&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let popularTableData = [
        [
            "id": 1,
            "title": "xxx"
        ],
        [
            "id": 2,
            "title": "xxx"
        ],
        [
            "id": 3,
            "title": "xxx"
        ],
        [
            "id": 4,
            "title": "xxx"
        ],
        [
            "id": 5,
            "title": "xxx"
        ],
        [
            "id": 6,
            "title": "xxx"
        ],
        [
            "id": 7,
            "title": "xxx"
        ],
        [
            "id": 8,
            "title": "xxx"
        ],
        [
            "id": 9,
            "title": "xxx"
        ],
        [
            "id": 10,
            "title": "xxx"
        ]
    ]
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>twm</author>
      <pubDate>Tue, 09 Dec 2014 09:29:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/23095</link>
      <guid>https://ruby-china.org/topics/23095</guid>
    </item>
    <item>
      <title>代码实现类似设置界面，是这样做吗？</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2014/0641cb87280ab886bc08164b8cab682e.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;代码如下：
感觉好繁琐哦。&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class SearchViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

var searchTableView: UITableView?
var genderSegment: UISegmentedControl?

override func viewDidLoad() {
    super.viewDidLoad()

    self.title = "Search"

    self.searchTableView = UITableView(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height), style: UITableViewStyle.Grouped)
    self.searchTableView?.delegate = self
    self.searchTableView?.dataSource = self

    self.view.addSubview(self.searchTableView!)
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&amp;gt; Int {
    return 5
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&amp;gt; UITableViewCell {
    let cell = UITableViewCell()
    cell.selectionStyle = UITableViewCellSelectionStyle.None

    switch indexPath.row {
    case 0:
        cell.textLabel?.text = "Gender"

        self.genderSegment = UISegmentedControl(items: ["Boy", "Girl", "All"])
        self.genderSegment?.frame.origin.x = self.view.frame.width - self.genderSegment!.frame.width - 10
        self.genderSegment?.frame.origin.y = cell.frame.height / 2 - self.genderSegment!.frame.height / 2

        cell.contentView.addSubview(self.genderSegment!)

    default:
        cell.textLabel?.text = nil
    }

    return cell
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}
}```
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>twm</author>
      <pubDate>Fri, 05 Dec 2014 17:13:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/23049</link>
      <guid>https://ruby-china.org/topics/23049</guid>
    </item>
    <item>
      <title>App 初始数据怎么提供？</title>
      <description>&lt;p&gt;比如一个 app，用户打开就内置了很多数据，日志、文章等。
这些怎么存到 app 中？什么时候存？&lt;/p&gt;

&lt;p&gt;我想的是把数据保存为文本文件，用户安装 app 后，第一次打开，读取文本文件，写入数据库，以后每次读取数据库。&lt;/p&gt;

&lt;p&gt;一般通用做法是怎样的呢？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Fri, 05 Dec 2014 14:16:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/23044</link>
      <guid>https://ruby-china.org/topics/23044</guid>
    </item>
    <item>
      <title>可以直接继承 UINavigationController 吗</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;lass&lt;/span&gt; &lt;span class="no"&gt;ViewController&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;UINavigationController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="n"&gt;override&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="n"&gt;viewDidLoad&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;viewDidLoad&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backgroundColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;UIColor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;whiteColor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"xxx"&lt;/span&gt;

        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationItem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"xxx"&lt;/span&gt;
&lt;span class="sr"&gt;//&lt;/span&gt;        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backgroundColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;UIColor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;orangeColor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="n"&gt;let&lt;/span&gt; &lt;span class="n"&gt;navBarItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;UINavigationItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;title: &lt;/span&gt;&lt;span class="s2"&gt;"xxx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="sr"&gt;//&lt;/span&gt;        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationItem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;leftBarButtonItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;UIBarButtonItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;barButtonSystemItem: &lt;/span&gt;&lt;span class="no"&gt;UIBarButtonSystemItem&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;target: &lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;action: &lt;/span&gt;&lt;span class="s2"&gt;"xx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="sr"&gt;//&lt;/span&gt;        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pushNavigationItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;navBarItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;animated: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="sr"&gt;//&lt;/span&gt;        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItems&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;navBarItem&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;animated: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;override&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="n"&gt;didReceiveMemoryWarning&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;didReceiveMemoryWarning&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="sr"&gt;//&lt;/span&gt; &lt;span class="no"&gt;Dispose&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;any&lt;/span&gt; &lt;span class="n"&gt;resources&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt; &lt;span class="n"&gt;be&lt;/span&gt; &lt;span class="n"&gt;recreated&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;无论是通过 self.title 还是 navigationItem.title 设置标题都无效，包括下面注释掉的部分，设置都无效。&lt;/p&gt;

&lt;p&gt;但 navigationBar.backgroundColor 有颜色效果。
我想问的是，既然无法通过继承来设置这些元素，那么为什么要将这个类开放让开发者可继承？&lt;/p&gt;

&lt;p&gt;我的目的是一个 UINavBar 的 first item 是上述 ViewController，因为其本身是一个 NavigationViewController 了，所以就不用包装了，比如 let navigation = UINavigationController(rootViewController: ViewController)&lt;/p&gt;

&lt;p&gt;还有就是继承自  UITabBarController 的 ViewController 却可以直接设置其 TabBarItem。为什么继承上述 ViewController 缺不行？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Thu, 20 Nov 2014 23:12:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/22785</link>
      <guid>https://ruby-china.org/topics/22785</guid>
    </item>
    <item>
      <title>Swift 看完了，下一步呢？</title>
      <description>&lt;p&gt;Swift 仅仅是一个语言，下一步进行 iOS 开发需要看什么文档？
官方的基本都还是 objc 的，如何是好？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Mon, 17 Nov 2014 17:46:04 +0800</pubDate>
      <link>https://ruby-china.org/topics/22722</link>
      <guid>https://ruby-china.org/topics/22722</guid>
    </item>
    <item>
      <title>这个结构怎么设计？</title>
      <description>&lt;pre class="highlight plaintext"&gt;&lt;code&gt;language:
+----------+------------------+
| Field    | Type             |
+----------+------------------+
| id       | int(10) unsigned |
| language | varchar(45)      |
+----------+------------------+

country:

+-------+------------------+
| Field | Type             |
+-------+------------------+
| id    | int(10) unsigned |
| name  | varchar(45)      |
+-------+------------------+

goods:
+--------------+------------------------+
| Field        | Type                   |
+--------------+------------------------+
| id           | int(10) unsigned       |
| name         | varchar(200)           |
| model        | varchar(45)            |
| description  | varchar(200)           |
| price        | decimal(10,2) unsigned |
+--------------+------------------------+
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;需求：
1、有 1 人做商品信息录入［基本信息］
2、A、B、C 国家进行信息本地化，包括 name,description,price 等。model 是 unique 的，不用本地化。
3、D 国家发现语言和基本信息一致，不用进行本地化，此时读取［基本信息］。
4、E 国家可只本地化价格，其他信息按照［基础信息］来显示。&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Fri, 10 Oct 2014 22:00:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/21974</link>
      <guid>https://ruby-china.org/topics/21974</guid>
    </item>
    <item>
      <title>请教一个 SQL</title>
      <description>&lt;p&gt;A
id | name
1  | abc&lt;/p&gt;

&lt;p&gt;B
name | country |  aid |
xyz   | NULL     | 1
xyz   | cn         | 1&lt;/p&gt;

&lt;p&gt;想得到的结果是，当 Where country = 'cn' 有结果时，用 B 的第 2 行，没有 结果时，用 NULL 的记录。&lt;/p&gt;

&lt;p&gt;select * from A
join B on (B.aid = A.id)
where B.country = 'cn' or country is NULL&lt;/p&gt;

&lt;p&gt;这样会得到 2 行结果啊，能否不用 group 来分组去重？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Sat, 20 Sep 2014 16:37:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/21630</link>
      <guid>https://ruby-china.org/topics/21630</guid>
    </item>
    <item>
      <title>北京这个鬼地方，天天重度雾霾。想滚回老家了。</title>
      <description>&lt;p&gt;rt&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Thu, 31 Jul 2014 08:05:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/20764</link>
      <guid>https://ruby-china.org/topics/20764</guid>
    </item>
    <item>
      <title>微博用 MySQL 存储靠谱吗？怎么解决扩容问题，如果用类似 MongoDB 呢？</title>
      <description>&lt;p&gt;微博用 MySQL 存储靠谱吗？怎么解决扩容问题，如果用类似 MongoDB 呢？MongoDB 的扩容需要考虑分表吗？还是分片即可？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Thu, 24 Jul 2014 12:31:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/20652</link>
      <guid>https://ruby-china.org/topics/20652</guid>
    </item>
    <item>
      <title>你愿意为知识付费吗？关于 Symfony2 学习计划</title>
      <description>&lt;p&gt;你愿意为知识付费吗？关于 Symfony2 学习计划
各位好，我本人准备抽出业余时间给那些热爱学习，正在学习 Symfony2 框架的同学提供一对一、面对面学习辅导计划，详细介绍见 &lt;a href="http://notes.cshome.com/archives/5" rel="nofollow" target="_blank"&gt;http://notes.cshome.com/archives/5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;如果你需要的化，你愿意付费吗？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Mon, 26 May 2014 20:24:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/19550</link>
      <guid>https://ruby-china.org/topics/19550</guid>
    </item>
    <item>
      <title>mysql left join 使用索引的问题请教</title>
      <description>&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql&amp;gt; desc user;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| username   | varchar(255) | NO   | UNI | NULL    |                |
+------------+--------------+------+-----+---------+----------------+

mysql&amp;gt; desc topic;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| group_id   | int(11)      | YES  | MUL | NULL    |                |
| user_id    | int(11)      | YES  | MUL | NULL    |                |
| touched_at | datetime     | NO   |     | NULL    |                |
| deleted_at | datetime     | YES  | MUL | NULL    |                |
+------------+--------------+------+-----+---------+----------------+
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;索引：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KEY `IDX_9D40DE1BFE54D947` (`group_id`),
KEY `IDX_9D40DE1BA76ED395` (`user_id`),
KEY `IDX_9D40DE1BFE54D9474AF38FD18C43597D` (`group_id`,`deleted_at`,`touched_at`),
KEY `IDX_9D40DE1B4AF38FD18C43597D` (`deleted_at`,`touched_at`),
KEY `IDX_9D40DE1BA76ED3954AF38FD18C43597D` (`user_id`,`deleted_at`,`touched_at`),
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查询：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;explain select title from topic join user on (user.id = topic.user_id) where deleted_at is null order by touched_at desc;

explain select title from topic join user on (user.id = topic.user_id) where group_id = 1 and deleted_at is null order by touched_at desc;

explain select title from topic join user on (user.id = topic.user_id) where user_id = 1 and deleted_at is null order by touched_at desc;

explain select title from topic join user on (user.id = topic.user_id) where topic.id = 1 and deleted_at is null order by touched_at desc;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这些查询都用到了索引，没有使用 filesort&lt;/p&gt;

&lt;p&gt;但是如果没有第 3 个和第 5 个索引，则第 2 条和第 3 条语句都使用 filesort&lt;/p&gt;

&lt;p&gt;我的问题是，真的需要第 3 个和第 5 个索引吗？不能通过第 4 个索引不能满足？有没有其他办法？&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Thu, 22 May 2014 21:26:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/19479</link>
      <guid>https://ruby-china.org/topics/19479</guid>
    </item>
    <item>
      <title>亚马逊的 ec2 redhat 能安装图形界面吗？</title>
      <description>&lt;p&gt;有尝试过吗？因公司客户使用 HP 的商业软件，不支持命令模式安装，但只支持 redhat 和 windows，但不想用 windows。&lt;/p&gt;</description>
      <author>twm</author>
      <pubDate>Tue, 20 May 2014 11:37:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/19408</link>
      <guid>https://ruby-china.org/topics/19408</guid>
    </item>
  </channel>
</rss>
