<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>femto</title>
    <link>https://ruby-china.org/femto</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>Minion: 一个强大的开源 AGI 框架</title>
      <description>&lt;h2 id="Minion: 一个强大的开源 AGI 框架"&gt;Minion: 一个强大的开源 AGI 框架&lt;/h2&gt;
&lt;p&gt;大家好，我想向 Ruby China 社区介绍我开发的开源 AGI 框架 - &lt;a href="https://github.com/femto/minion" rel="nofollow" target="_blank" title=""&gt;Minion&lt;/a&gt;。&lt;/p&gt;
&lt;h2 id="Minion 是什么？"&gt;Minion 是什么？&lt;/h2&gt;
&lt;p&gt;Minion 是一个设计用于执行各种类型查询的开源 AGI 框架，它提供了一系列展示其灵活性和智能性的功能。框架采用循环优化的工作方式，能够不断改进解决方案直到达到满意的结果。&lt;/p&gt;

&lt;p&gt;&lt;img src="https://github.com/femto/minion/blob/main/assets/sci.png?raw=true" title="" alt="Minion 工作流程"&gt;&lt;/p&gt;
&lt;h2 id="核心特点"&gt;核心特点&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;出色的性能表现&lt;/strong&gt;：在多个基准测试中取得了令人印象深刻的结果&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GSM8K 测试达到 96% 的准确率（使用 DeepSeek-Chat）&lt;/li&gt;
&lt;li&gt;Game of 24 在 20 个最难问题上达到 100% 成功率&lt;/li&gt;
&lt;li&gt;AIME 2024 数学竞赛题目完成率 26%（15 道题中完成 4 道），为 Claude 3.5 Sonnet 的 170%&lt;/li&gt;
&lt;li&gt;Humaneval 达到 98.2% pass@1 率（使用 gpt-4o）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;灵活的任务处理能力&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;可处理数学计算（如 Game of 24、方程求解）&lt;/li&gt;
&lt;li&gt;支持创意写作（如小说创作）&lt;/li&gt;
&lt;li&gt;能够处理复杂的数学竞赛题目&lt;/li&gt;
&lt;li&gt;其他各种任务&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;智能迭代的工作流程&lt;/strong&gt;：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;接收查询（Query）&lt;/li&gt;
&lt;li&gt;生成解决方案（Solution）&lt;/li&gt;
&lt;li&gt;检查结果（Check）&lt;/li&gt;
&lt;li&gt;需要时进行改进（Improve）并返回优化&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="技术实现"&gt;技术实现&lt;/h2&gt;
&lt;p&gt;不同例子的代码（参见 &lt;code&gt;examples/smart_minion/brain.py&lt;/code&gt; ) 中。您可以通过修改代码来尝试不同的示例，因为各种场景已经被注释掉以便于测试。&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#数学例子
obs, score, *_ = await brain.step(query="what's the solution 234*568")
print(obs)

#game 24例子
obs, score, *_ = await brain.step(query="what's the solution for game of 24 for 4 3 9 8")
print(obs)

obs, score, *_ = await brain.step(query="what's the solution for game of 24 for 2 5 11 8")
print(obs)

#解方程例子
obs, score, *_ = await brain.step(query="solve x=1/(1-beta^2*x) where beta=0.85")
print(obs)

#写小说例子
obs, score, *_ = await brain.step(
    query="Write a 500000 characters novel named 'Reborn in Skyrim'. "
          "Fill the empty nodes with your own ideas. Be creative! Use your own words!"
          "I will tip you $100,000 if you write a good novel."
          "Since the novel is very long, you may need to divide it into subtasks."
)
print(obs)

#解aime例子
cache_plan = os.path.join(current_file_dir, "aime", "plan_gpt4o.1.json")
obs, score, *_ = await brain.step(
    query="Every morning Aya goes for a $9$-kilometer-long walk and stops at a coffee shop afterwards. When she walks at a constant speed of $s$ kilometers per hour, the walk takes her 4 hours, including $t$ minutes spent in the coffee shop. When she walks $s+2$ kilometers per hour, the walk takes her 2 hours and 24 minutes, including $t$ minutes spent in the coffee shop. Suppose Aya walks at $s+\frac{1}{2}$ kilometers per hour. Find the number of minutes the walk takes her, including the $t$ minutes spent in the coffee shop.",
    route="cot",
    dataset="aime 2024",
    cache_plan=cache_plan,
)
print(obs)

cache_plan = os.path.join(current_file_dir, "aime", "plan_gpt4o.7.json")

#解方程例子
obs, score, *_ = await brain.step(
    query="Find the largest possible real part of\[(75+117i)z+\frac{96+144i}{z}\]where $z$ is a complex number with $|z|=4$.",
    route="cot",
    dataset="aime 2024",
    cache_plan=cache_plan,
)
print(obs)

# 编程例子
    test_data = {
        "task_id": "HumanEval/88",
        "prompt": "\ndef sort_array(array):\n    \"\"\"\n    Given an array of non-negative integers, return a copy of the given array after sorting,\n    you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n    or sort it in descending order if the sum( first index value, last index value) is even.\n\n    Note:\n    * don't change the given array.\n\n    Examples:\n    * sort_array([]) =&amp;gt; []\n    * sort_array([5]) =&amp;gt; [5]\n    * sort_array([2, 4, 3, 0, 1, 5]) =&amp;gt; [0, 1, 2, 3, 4, 5]\n    * sort_array([2, 4, 3, 0, 1, 5, 6]) =&amp;gt; [6, 5, 4, 3, 2, 1, 0]\n    \"\"\"\n",
        "entry_point": "sort_array",
        "test": ["assert candidate([]) == []",
                "assert candidate([5]) == [5]",
                "assert candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5]",
                "assert candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0]"]
    }

    obs, score, *_ = await brain.step(
        query=test_data["prompt"],
        route="python",
        post_processing="extract_python",
        entry_point=test_data["entry_point"],
        check=10,
        check_route="ldb_check",
        dataset="HumanEval",
        metadata={"test_cases": test_data["test"]}  # 添加测试用例到 metadata
    )
    print(obs)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;框架设计基于最新的神经科学研究成果和机器学习算法，能够在多变的环境中自我调整，以实现更高效的智能推理和决策。&lt;/p&gt;
&lt;h2 id="快速开始"&gt;快速开始&lt;/h2&gt;&lt;h3 id="安装"&gt;安装&lt;/h3&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/femto/minion.git &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;minion &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="nb"&gt;cp &lt;/span&gt;config/config.yaml.example config/config.yaml
&lt;span class="nb"&gt;cp &lt;/span&gt;config/.env.example config/.env
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后编辑 config/config.yaml：&lt;/p&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;models&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;default"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;api_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai"&lt;/span&gt;
    &lt;span class="na"&gt;base_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${DEFAULT_BASE_URL}"&lt;/span&gt;
    &lt;span class="na"&gt;api_key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${DEFAULT_API_KEY}"&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-chat"&lt;/span&gt;
    &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着编辑 config/.env：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DEFAULT_API_KEY=sk-xxx
DEFAULT_BASE_URL=base_url
DEFAULT_MODEL=...
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="使用 Docker Python 环境"&gt;使用 Docker Python 环境&lt;/h3&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; intercode-python &lt;span class="nt"&gt;-f&lt;/span&gt; docker/python.Dockerfile &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;brain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Brain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# 默认将使用 docker python 环境
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="或使用 rpyc 环境"&gt;或使用 rpyc 环境&lt;/h3&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;python docker/utils/python_server.py &lt;span class="nt"&gt;--port&lt;/span&gt; 3007
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;brain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Brain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;python_env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;RpycPythonEnv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3007&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="演示视频"&gt;演示视频&lt;/h2&gt;
&lt;p&gt;查看这些演示视频，了解 Minion 的实际应用：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/-LW7TCMUfLs" rel="nofollow" target="_blank" title=""&gt;Minion Demo 1&lt;/a&gt; - 数学/编程能力&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/udrCUAcaEG4" rel="nofollow" target="_blank" title=""&gt;Minion Demo 2&lt;/a&gt; - 长篇创意写作&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/DxSdlxerdwE" rel="nofollow" target="_blank" title=""&gt;Minion Demo 3&lt;/a&gt; - dcot（动态思维链），仅使用 DeepSeek 解决 AIME 问题，达到 Claude 3.5 Sonnet 的 167%&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="社区与支持"&gt;社区与支持&lt;/h2&gt;
&lt;p&gt;加入我们的 Discord 社区，与其他 Minion 用户交流，获取支持，并了解最新动态。&lt;/p&gt;
&lt;h2 id="为什么选择 Minion？"&gt;为什么选择 Minion？&lt;/h2&gt;
&lt;p&gt;与现有的 AI 解决方案相比，Minion 框架不仅能够支持复杂的多任务处理，还能适应不同领域的需求。其模块化设计允许用户根据具体需求进行功能定制和扩展，从而提高智能系统的灵活性和适用性。&lt;/p&gt;
&lt;h2 id="相关链接"&gt;相关链接&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;GitHub 仓库：&lt;a href="https://github.com/femto/minion" rel="nofollow" target="_blank" title=""&gt;https://github.com/femto/minion&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;项目网站：&lt;a href="http://femto.github.io/minion_website/" rel="nofollow" target="_blank" title=""&gt;http://femto.github.io/minion_website/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;欢迎大家试用并提供反馈！如果你对 AGI 和人工智能感兴趣，Minion 将是一个很好的工具和学习资源。 &lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Fri, 07 Mar 2025 12:13:51 +0800</pubDate>
      <link>https://ruby-china.org/topics/44081</link>
      <guid>https://ruby-china.org/topics/44081</guid>
    </item>
    <item>
      <title>比较奇怪的特性</title>
      <description>&lt;p&gt;开一个 irb, Time.now&amp;lt;Time.now 有时候返回 false,
（大部分时候返回 true)
Time.now.to_f&amp;lt;Time.now.to_f 总是返回 true&lt;/p&gt;

&lt;p&gt;正常来说，前一个调用发生在后一个调用之前，
所以前一个时间戳总比后一个时间戳早，
然而 Time.now&amp;lt;Time.now 返回 false 是
什么原因呢，查了一下 Time 的精度，Time.now.to_f
到小数点后 6 位，也就是微秒级别的精度。
看来是我机器太快了。。&lt;/p&gt;

&lt;p&gt;Time.now.to_f&amp;lt;Time.now.to_f 总是返回 true
多一个 to_f 调用 2 者之差就超过 1 微秒了。
(不要问我为什么需要这个，在做 least recently used cache,
所以需要时间戳的比较。。)&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sun, 29 Oct 2023 19:58:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/43428</link>
      <guid>https://ruby-china.org/topics/43428</guid>
    </item>
    <item>
      <title>实现了一个 human interpreter</title>
      <description>&lt;p&gt;&lt;a href="https://github.com/femto/hi" rel="nofollow" target="_blank"&gt;https://github.com/femto/hi&lt;/a&gt;
目的，像自然语言一样的跟你的操作系统交流&lt;/p&gt;

&lt;p&gt;比如 hi could you please count the total line numbers of files in  current dir&lt;/p&gt;

&lt;p&gt;安装&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -U python-pi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;使用，既可以命令行使用&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hi could you please count the total line numbers of files &lt;span class="k"&gt;in  &lt;/span&gt;current &lt;span class="nb"&gt;dir&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以作为 shellbang interpreter 使用，比如写一个 tidy 文件夹的脚本：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env hi&lt;/span&gt;

loop over all files &lt;span class="o"&gt;(&lt;/span&gt;ignoring directories&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;first argument&lt;span class="o"&gt;(&lt;/span&gt;first argument is a directory&lt;span class="o"&gt;)&lt;/span&gt;

move each file into a subdirectory &lt;span class="k"&gt;in &lt;/span&gt;the format year-month

&lt;span class="k"&gt;while &lt;/span&gt;the task is running show an ascii loading spinner

show how many files where moved
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;所执行的和所表达的意思相同&lt;/p&gt;

&lt;p&gt;原理，hi 是 bin, 后面其他的部分发送到 llm 转成 bash(当然会有缓存) 然后执行 &lt;/p&gt;

&lt;p&gt;可以参考 samples 下其他文件&lt;/p&gt;

&lt;p&gt;项目地址
&lt;a href="https://github.com/femto/hi" rel="nofollow" target="_blank"&gt;https://github.com/femto/hi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;请大家试用和给出反馈:)&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sat, 12 Aug 2023 20:02:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/43271</link>
      <guid>https://ruby-china.org/topics/43271</guid>
    </item>
    <item>
      <title>请教 Python 的 coroutine 的 task 的同步语义</title>
      <description>&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;what&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;what&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;started at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%X&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;say_after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;say_after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;world&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;finished at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%X&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;output:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;started at 17:13:52
hello
world
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;finished at 17:13:55&lt;/p&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;task1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nf"&gt;say_after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="n"&gt;task2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nf"&gt;say_after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;world&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;started at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%X&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Wait until both tasks are completed (should take
&lt;/span&gt;    &lt;span class="c1"&gt;# around 2 seconds.)
&lt;/span&gt;    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;task1&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;task2&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;finished at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%X&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that expected output now shows that the snippet runs 1 second faster than before:
output:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;started at 17:14:32
hello
world
finished at 17:14:34
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看出 task 比 coroutine 快了一秒，也就是 python 是同步执行多个 task 的，
我知道 coroutine 只有一个操作系统线程，yield 来 yield 去，那么 asyncio 是怎么实现 task 的，
有同步问题么？（即一个 task 访问修改一个数据结构，另一个 task 同时访问修改该数据结构，
会 corrupt 该数据结构么？)&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sat, 05 Aug 2023 17:05:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/43257</link>
      <guid>https://ruby-china.org/topics/43257</guid>
    </item>
    <item>
      <title>请教有什么好的 Python 中文论坛？</title>
      <description>&lt;p&gt;请教有什么好的 Python 中文论坛？
就像 ruby-china 之于 ruby 一样，
Thanks.&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sat, 05 Aug 2023 15:07:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/43254</link>
      <guid>https://ruby-china.org/topics/43254</guid>
    </item>
    <item>
      <title>求教这个 LaTex 怎么输入？</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/femto/74020e9d-3ac1-4f48-8e52-761b12c50e76.png!large" title="" alt=""&gt;
如图所示，这个 Latex 上上下下的带 style 的怎么输入？是有特殊字符么？
或者在 Latex 本身中能输入么？(假定 github readme 能带 mathjax 渲染)(我问的是直接输入，html 构造成这样估计也有办法)&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sat, 15 Apr 2023 15:30:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/43005</link>
      <guid>https://ruby-china.org/topics/43005</guid>
    </item>
    <item>
      <title>ActionCable 的 background broadcast 实现原理是什么？</title>
      <description>&lt;p&gt;ActionCable 的 background broadcast 实现原理是什么？如果是 rails server,
那么通过 websocket 传回数据到前端，然后前端更新是很正常的，
但是他能在 background process(比如 sidekiq 的 worker) 里头做 broadcast,
前端也能更新，这是什么原理？&lt;/p&gt;

&lt;p&gt;而且泛化一下，一般前端只跟一个 rails server process 的 websocket 相连吧？
如果从另一个 rails server process 调用 broadcast，前端也能更新，
这又是什么原理？&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Thu, 06 Apr 2023 11:37:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/42986</link>
      <guid>https://ruby-china.org/topics/42986</guid>
    </item>
    <item>
      <title>关于 AI 带来的冲击以及能做什么？</title>
      <description>&lt;p&gt;反正 ai 带来的冲击肯定这几年慢慢就要彰显了，我们又能做些什么呢？
大语言模型又是大公司需要花大钱才能搞的东西，个人或者小公司
又能做些什么呢？
难道什么都不能做，就等着浪潮慢慢过来么？能做的最多一些跟
AIGC 相关的投机吧？&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Mon, 20 Mar 2023 20:53:51 +0800</pubDate>
      <link>https://ruby-china.org/topics/42952</link>
      <guid>https://ruby-china.org/topics/42952</guid>
    </item>
    <item>
      <title>各位觉得这个怎么样?</title>
      <description>&lt;p&gt;在浏览器里运行 python
&lt;a href="https://pyscript.net/" rel="nofollow" target="_blank"&gt;https://pyscript.net/&lt;/a&gt;&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Sat, 02 Jul 2022 20:25:17 +0800</pubDate>
      <link>https://ruby-china.org/topics/42496</link>
      <guid>https://ruby-china.org/topics/42496</guid>
    </item>
    <item>
      <title>[上海] 芝麻开花,移动医疗 创业，广募精英 (更新办公环境)</title>
      <description>&lt;p&gt;芝麻开花——节节高 没错，我们的名字就是上海芝麻开花医疗科技有限公司。我们是一家由上海知名上市医疗公司，专业投资基金和业内资深的专业人士共同创建的创业型移动互联网企业。我们有相当雄厚的资金基础和后援力量。我们相信通过互联网技术可以让我们的生活变得更美好。如果你是有创业精神的有志之士，欢迎前来加入，我们将提供良好诱人的股权激励方案。如果你是互联网技术的大拿，欢迎前来加入，我们将为你提供施展身手的平台和优厚的薪资待遇，如果你是立志于在互联网行业中找到自己的发展路径，欢迎加入，我们将为你提供充分发展的机会和良好的公司福利。&lt;/p&gt;

&lt;p&gt;公司位于上海张江高科技园区，地铁 2 号线沿线。交通便利，让您上下班畅通便利；环境优美，给您舒适的办公环境；
&lt;img src="https://l.ruby-china.com/photo/2015/993ffc4805553b364478182b655ff958.png" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/2015/036f19669f2eca708ad9ef99f69da43f.png" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/2015/2dce3bef8559ac504743e849af382d6a.png" title="" alt=""&gt;
同事友善，给您良好的工作氛围。我们提供有竞争力的的薪资 + 股权激励 + 丰厚的年终奖 (10K-20K),根据能力来。&lt;/p&gt;

&lt;p&gt;我们招募如下精英：后端开发工程师 前端开发工程师 IOS 和 Android 工程师 UI 设计师&lt;/p&gt;
&lt;h2 id="Ruby开发工程师"&gt;Ruby 开发工程师&lt;/h2&gt;
&lt;p&gt;职位要求：
良好的 Ruby 语言基础及开发/重构能力;
熟练使用 Ruby On Rails, Sinatra 等 Web 框架的开发和部署;
熟练使用 Git, Linux 常见指令及用法;
熟悉常用的数据库及缓存技术，例如 MongoDB, MySQL, Postgresql,Redis 等;
熟悉 RESTful Service API 设计;
熟悉 TDD 开发模式，熟练使用 Rspec/Cucumber;
熟悉 Mac 开发环境&lt;/p&gt;

&lt;p&gt;加分项：
熟悉前端技术和框架，包括 HTML/CSS, Javascript, jQuery/AngularJS 等;
熟悉 Resque/Sidekiq/RabbitMQ 等消息处理框架；
对于技术热情，熟悉其他语言比如 Python,Erlang 等；&lt;/p&gt;
&lt;h2 id="前端开发工程师"&gt;前端开发工程师&lt;/h2&gt;
&lt;p&gt;工作职责
Web 应用的设计与开发；
Javascript 数据处理与 Ajax 交互开发；
Web 接口设计与开发；&lt;/p&gt;

&lt;p&gt;岗位要求
2 年以上前端开发经验，有完整的前端项目经验；
熟练使用 jQuery,AngularJS 等主流 Javascript 库/框架；
良好的编码习惯、沟通协作能力和学习能力；
对前端新技术和新应用有浓厚的兴趣。
熟悉 Mac 开发环境&lt;/p&gt;

&lt;p&gt;加分项：掌握一门后端语言比如 Ruby 或者 NodeJS。&lt;/p&gt;
&lt;h2 id="ios工程师"&gt;ios 工程师&lt;/h2&gt;
&lt;p&gt;岗位职责： &lt;/p&gt;

&lt;p&gt;1.从事 IOS 相关客户端功能开发； 
2.根据产品或者项目需求完成架构和模块设计、编码、测试工作； 
3.能按照项目计划，按时提交高质量的代码，完成开发任务； &lt;/p&gt;

&lt;p&gt;岗位要求： 
1.计算机或相关专业，大专及以上学历； 
2.精通 iPhone 移动 app 开发，有两年以上的开发经验，有 App Store 上架作品优先； 
3.熟悉 Mac OS 平台下的开发；熟悉算法思想，有较强的解决问题的能力，对 OOD/OOP 有深刻的理解，具有良好的编程习惯； 
4.精通 C++/Objective C/Cocoa 编程，熟练使用 iPhone/iPad SDK 及相关开发工具； 
5.熟悉或者精通 IOS 移动 app 开发重点优先考虑； 
6.了解和熟悉医疗行业、了解互联网应用、了解移动互联网相关业务的优先考虑； 
7.工作责任心强，积极主动，思路清晰有条理，有良好的团队协作精神。&lt;/p&gt;

&lt;p&gt;其他招聘帖子请移步我们的猎聘招聘贴:
&lt;a href="http://www.liepin.com/zhaopin/?searchField=2&amp;amp;key=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;industries=&amp;amp;jobTitles=&amp;amp;dqs=&amp;amp;compscale=&amp;amp;compkind=&amp;amp;pubTime=&amp;amp;salary=&amp;amp;searchType=1&amp;amp;clean_condition=&amp;amp;init=1" rel="nofollow" target="_blank"&gt;http://www.liepin.com/zhaopin/?searchField=2&amp;amp;key=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;industries=&amp;amp;jobTitles=&amp;amp;dqs=&amp;amp;compscale=&amp;amp;compkind=&amp;amp;pubTime=&amp;amp;salary=&amp;amp;searchType=1&amp;amp;clean_condition=&amp;amp;init=1&lt;/a&gt;
或者 51job 招聘贴:
&lt;a href="http://search.51job.com/jobsearch/search_result.php?fromJs=1&amp;amp;jobarea=020000&amp;amp;funtype=0000&amp;amp;industrytype=00&amp;amp;keyword=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;keywordtype=0&amp;amp;lang=c&amp;amp;stype=1&amp;amp;postchannel=0000&amp;amp;fromType=1" rel="nofollow" target="_blank"&gt;http://search.51job.com/jobsearch/search_result.php?fromJs=1&amp;amp;jobarea=020000&amp;amp;funtype=0000&amp;amp;industrytype=00&amp;amp;keyword=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;keywordtype=0&amp;amp;lang=c&amp;amp;stype=1&amp;amp;postchannel=0000&amp;amp;fromType=1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;请发送简历到邮箱 femtowin+hire@gmail.com&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Thu, 09 Jul 2015 10:46:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/26403</link>
      <guid>https://ruby-china.org/topics/26403</guid>
    </item>
    <item>
      <title>前端使用 middleman 配合后端 rails 开发</title>
      <description>&lt;p&gt;在我的公司，最近让前端的小朋友熟悉了一下 middleman，然后用来配合后端 rails 开发，
感觉一个字爽，真的很方便很有效率。&lt;/p&gt;

&lt;p&gt;说说我对 middleman 的修改配置:
默认 middleman 生成的目录结构跟 rails 的有点区别，改:
assets 全部搬到 source/assets 目录下，
改一下 config.rb 即可：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set :css_dir, 'assets/stylesheets'

set :js_dir, 'assets/javascripts'

set :images_dir, 'assets/images'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后把 layouts 和其他 page 搬到 source/views/下面 (这个目录自己建拉):
然后每次修改，由于 middleman 也是支持 scss,coffeescript，前端加的 scss,coffeescript
直接 assets 目录整个拷贝到 rails 里头就好，layouts 也可以直接拷贝，因为代码都一样，
唯一就每一个 page，动态部分 middleman 和 rails 差别很大，这个就没办法了。&lt;/p&gt;

&lt;p&gt;关于 page 在 source/views 目录下：多了一层 views，如果嫌调试的时候多打路径/views，可以 config.rb 里头加 proxy:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dir["source/views/**/*"].each do |file|
  if File.file?(file) &amp;amp;&amp;amp; file !~ /^source\/views\/layouts/
    #puts file
    file = file.sub(/\.erb$/,"") #chop off last component
    #puts file.sub(/^source/,"")
    #puts file.sub(/^source\/views/,"")
    proxy file.sub(/^source\/views/,""), file.sub(/^source/,"")
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;把所有文件都 proxy 少 views 路径一份，
这个 proxy 也可以不带扩展名，&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# proxy "/index.html", "/views/home/index.html"
# proxy "/index2", "/views/home/index.html"
# proxy "/", "/views/home/index.html"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样可以模拟 rails 一些路由，因为 middleman 是不支持路由的。&lt;/p&gt;

&lt;p&gt;大功告成，什么，你说 layout 里头还有 flash 的显示两边不一样？
这好办，用 helper method:
layout:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;
  &amp;lt;%= flash_message %&amp;gt;
...
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;middleman 里头建立 helpers/flash_helper.rb&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module FlashHelper
  def flash_message
    #空实现就好
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;rails 里头 application_helper.rb:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def flash_message
    result = ""
    flash.each do |key, value|
      result &amp;lt;&amp;lt; content_tag(:div,:class=&amp;gt;"alert alert-#{key}") do
         content_tag(:a,:"data-dismiss"=&amp;gt;"close",:class=&amp;gt;"close",:href=&amp;gt;"#") do
           "x"
         end +
        content_tag(:ul) do
          content_tag(:li) do
            value
          end
        end
      end


    end
    result.html_safe
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;###发现前端这里代码都看的懂，直接帮我改了:)
大功告成:) 真的很方便&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Wed, 08 Jul 2015 13:23:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/26381</link>
      <guid>https://ruby-china.org/topics/26381</guid>
    </item>
    <item>
      <title>[微信] 微信运动是如何实现的?</title>
      <description>&lt;p&gt;请教微信运动是如何实现的？
自己做一个公众号或者 app 有办法用相关的微信 api 吗，
比如什么 api 可以获得运动数据，用微信账号登陆的 app
可以拿到类似于微信运动的数据吗？
请知道的大侠指出一些方向。Thanks。
ps，因为貌似没有微信节点，所以发到了 rails 下面，thanks.&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Fri, 19 Jun 2015 14:48:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/26111</link>
      <guid>https://ruby-china.org/topics/26111</guid>
    </item>
    <item>
      <title>[上海] 芝麻开花,移动医疗 创业，广募精英 (更新办公环境)</title>
      <description>&lt;p&gt;芝麻开花——节节高 没错，我们的名字就是上海芝麻开花医疗科技有限公司。我们是一家由上海知名上市医疗公司，专业投资基金和业内资深的专业人士共同创建的创业型移动互联网企业。我们有相当雄厚的资金基础和后援力量。我们相信通过互联网技术可以让我们的生活变得更美好。如果你是有创业精神的有志之士，欢迎前来加入，我们将提供良好诱人的股权激励方案。如果你是互联网技术的大拿，欢迎前来加入，我们将为你提供施展身手的平台和优厚的薪资待遇，如果你是立志于在互联网行业中找到自己的发展路径，欢迎加入，我们将为你提供充分发展的机会和良好的公司福利。&lt;/p&gt;

&lt;p&gt;公司位于上海张江高科技园区，地铁 2 号线沿线。交通便利，让您上下班畅通便利；环境优美，给您舒适的办公环境；
&lt;img src="https://l.ruby-china.com/photo/2015/993ffc4805553b364478182b655ff958.png" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/2015/036f19669f2eca708ad9ef99f69da43f.png" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/2015/2dce3bef8559ac504743e849af382d6a.png" title="" alt=""&gt;
同事友善，给您良好的工作氛围。我们提供有竞争力的的薪资 + 股权激励 + 丰厚的年终奖 (10K-20K),根据能力来。&lt;/p&gt;

&lt;p&gt;我们招募如下精英：后端开发工程师 前端开发工程师 IOS 和 Android 工程师 UI 设计师&lt;/p&gt;
&lt;h2 id="Ruby开发工程师"&gt;Ruby 开发工程师&lt;/h2&gt;
&lt;p&gt;职位要求：
良好的 Ruby 语言基础及开发/重构能力;
熟练使用 Ruby On Rails, Sinatra 等 Web 框架的开发和部署;
熟练使用 Git, Linux 常见指令及用法;
熟悉常用的数据库及缓存技术，例如 MongoDB, MySQL, Postgresql,Redis 等;
熟悉 RESTful Service API 设计;
熟悉 TDD 开发模式，熟练使用 Rspec/Cucumber;&lt;/p&gt;

&lt;p&gt;加分项：
熟悉前端技术和框架，包括 HTML/CSS, Javascript, jQuery/AngularJS 等;
熟悉 Resque/Sidekiq/RabbitMQ 等消息处理框架；
对于技术热情，熟悉其他语言比如 Python,Erlang 等；&lt;/p&gt;
&lt;h2 id="前端开发工程师"&gt;前端开发工程师&lt;/h2&gt;
&lt;p&gt;工作职责
Web 应用的设计与开发；
Javascript 数据处理与 Ajax 交互开发；
Web 接口设计与开发；&lt;/p&gt;

&lt;p&gt;岗位要求
2 年以上前端开发经验，有完整的前端项目经验；
熟练使用 jQuery,AngularJS 等主流 Javascript 库/框架；
良好的编码习惯、沟通协作能力和学习能力；
对前端新技术和新应用有浓厚的兴趣。&lt;/p&gt;

&lt;p&gt;加分项：掌握一门后端语言比如 Ruby 或者 NodeJS。&lt;/p&gt;
&lt;h2 id="ios工程师"&gt;ios 工程师&lt;/h2&gt;
&lt;p&gt;岗位职责： &lt;/p&gt;

&lt;p&gt;1.从事 IOS 相关客户端功能开发； 
2.根据产品或者项目需求完成架构和模块设计、编码、测试工作； 
3.能按照项目计划，按时提交高质量的代码，完成开发任务； &lt;/p&gt;

&lt;p&gt;岗位要求： 
1.计算机或相关专业，大专及以上学历； 
2.精通 iPhone 移动 app 开发，有两年以上的开发经验，有 App Store 上架作品优先； 
3.熟悉 Mac OS 平台下的开发；熟悉算法思想，有较强的解决问题的能力，对 OOD/OOP 有深刻的理解，具有良好的编程习惯； 
4.精通 C++/Objective C/Cocoa 编程，熟练使用 iPhone/iPad SDK 及相关开发工具； 
5.熟悉或者精通 IOS 移动 app 开发重点优先考虑； 
6.了解和熟悉医疗行业、了解互联网应用、了解移动互联网相关业务的优先考虑； 
7.工作责任心强，积极主动，思路清晰有条理，有良好的团队协作精神。&lt;/p&gt;

&lt;p&gt;其他招聘帖子请移步我们的猎聘招聘贴:
&lt;a href="http://www.liepin.com/zhaopin/?searchField=2&amp;amp;key=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;industries=&amp;amp;jobTitles=&amp;amp;dqs=&amp;amp;compscale=&amp;amp;compkind=&amp;amp;pubTime=&amp;amp;salary=&amp;amp;searchType=1&amp;amp;clean_condition=&amp;amp;init=1" rel="nofollow" target="_blank"&gt;http://www.liepin.com/zhaopin/?searchField=2&amp;amp;key=%E8%8A%9D%E9%BA%BB%E5%BC%80%E8%8A%B1&amp;amp;industries=&amp;amp;jobTitles=&amp;amp;dqs=&amp;amp;compscale=&amp;amp;compkind=&amp;amp;pubTime=&amp;amp;salary=&amp;amp;searchType=1&amp;amp;clean_condition=&amp;amp;init=1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;请发送简历到邮箱 femtowin+hire@gmail.com&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Tue, 12 May 2015 10:57:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/25533</link>
      <guid>https://ruby-china.org/topics/25533</guid>
    </item>
    <item>
      <title>这里有 UCloud 的同学吗?</title>
      <description>&lt;p&gt;你们的 api 不 working 啊，
Error public_key,
github 上面一搜 ucloud，全是韩国 ucloud,
找到的只有 python sdk 和 php sdk,
只好照着仿了一下，即使传进 PUBLIC_KEY 和 access_token,
还是报 Error public_key，没有更详细的信息。文档我就不吐槽什么了，
$params['public_key']           =      $public_key;
$params['access_token']         = verfyAC($private_key,$params);
$data = $rest-&amp;gt;get("/ufirewall",$params,'json');
verfyAC 未定义，$rest 未定义，
而且又不是所有人都看得懂 php。。
（后来才发现这些方法是你们 php sdk 里的。。)&lt;/p&gt;

&lt;p&gt;仿制 verify_ac&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def _verfy_ac(private_key, params):
    items=params.items()
    items.sort()

    params_data = "";
    for key, value in items:
        params_data = params_data + str(key) + str(value)

    params_data = params_data+private_key

    '''use sha1 to encode keys'''
    hash_new = hashlib.sha1() 
    hash_new.update(params_data)
    hash_value = hash_new.hexdigest()
    return hash_value
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看起来是根据 key sort，然后拼接 sha1,
下面是我的实现，应该也没错啊。&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def verify_ac(params)
      params = params.clone

      params_data = ""
      params.sort.each do |key, value|
        params_data = params_data + key.to_s + value.to_s

        params_data = params_data + UcloudApiClient.private_key

        #'''use sha1 to encode keys'''

      end
      Digest::SHA1.hexdigest params_data
    end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(&lt;a href="https://github.com/femto/ucloud-ruby-sdk" rel="nofollow" target="_blank"&gt;https://github.com/femto/ucloud-ruby-sdk&lt;/a&gt;)
只能说你们的 api 完全不 working 了。。&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Mon, 07 Apr 2014 10:53:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/18447</link>
      <guid>https://ruby-china.org/topics/18447</guid>
    </item>
    <item>
      <title>大家有碰到这样的问题吗？VMWare Unity</title>
      <description>&lt;p&gt;大家有碰到这样的问题吗？VMWare 使用 Unity 之后，
系统 Lubuntu 13.10，出来的 LTterminal 有时候老是
自己莫名其名关掉，怎么办？&lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Thu, 13 Feb 2014 11:43:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/17221</link>
      <guid>https://ruby-china.org/topics/17221</guid>
    </item>
    <item>
      <title>做了一个这个项目,大家看看有没用处</title>
      <description>&lt;p&gt;受到 meteor 的启发，做了一个 autodeps:
&lt;a href="https://github.com/femto/autodeps" rel="nofollow" target="_blank"&gt;https://github.com/femto/autodeps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;现在 reactive programming 这么热，做一个 reactive programming
(reactive programming 意思就是 a=b+c,
传统 imperative programming 就是一次赋值，而
reactive programming a 就等于 b+c，哪怕 b 或者 c 值 change，也会 propagate 到 a&lt;/p&gt;

&lt;p&gt;对于 Persistent 部分，
比如赞，一个用户赞另外一个用户，&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Laud

  include MongoMapper::Document
  include Autodeps::Persistency #这里添加对Autodeps::Persistency 的依赖

  key :user_id, Integer, :required =&amp;gt; true
  key :user_name, String
  depend_on "User", :value_mapping =&amp;gt; {:name =&amp;gt; :user_name} #默认可以省略 :key_mapping=&amp;gt; {:id=&amp;gt;:user_id}

  key :dest_user_id, Integer, :required =&amp;gt; true
  key :dest_user_name, String
  depend_on "User", :key_mapping =&amp;gt; {:id =&amp;gt; :dest_user_id}, :value_mapping =&amp;gt; {:name =&amp;gt; :dest_user_name}

  timestamps!

  ensure_index([[:user_id,1],[:dest_user_id,1]])
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;即可，
然后 user.save 的时候，&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user=User.first
user.name="123"
user.save ==&amp;gt;#这里会propagate change到Laud
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在 development 环境下，有可能 User 加载了而 Laud 完全没加载，可以在后面写对 Laud 的引用强迫 load Laud 文件&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class User
  #some attributes
end
Laud
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;##这样
&lt;a href="/huacnlee" class="user-mention" title="@huacnlee"&gt;&lt;i&gt;@&lt;/i&gt;huacnlee&lt;/a&gt;这样 Ruby-China UserName 的 update 就简单多了吧？&lt;/p&gt;

&lt;p&gt;##另外做了一个&lt;strong&gt;ReactiveData&lt;/strong&gt;:
a=b+c，相当于 b,c 用 ReactiveData，则 a 会自动知道 b,c 的变化，
可以参看 autodeps_test.rb:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def test_invalidate
    a = 3
    b = nil
    computation = Autodeps.autorun do |computation|
      b = a
    end
    assert_equal b,a

    a = 5
    computation.invalidate
    assert_equal b,a

  end

  def test_reactive_integer
    a = Autodeps::ReactiveData.new(3)
    b = nil
    computation = Autodeps.autorun do |computation|
      b = a.value
    end
    assert_equal b,3

    a.change_to 5

    assert_equal b,5
  end

  def test_reactive_integer_add
    a = Autodeps::ReactiveData.new(3)
    b = Autodeps::ReactiveData.new(5)
    c = nil
    computation = Autodeps.autorun do |computation|
      c = a.value + b.value
    end
    assert_equal c,8

    a.change_to 5

    assert_equal c,10

    b.change_to 15

    assert_equal c,20
  end
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>femto</author>
      <pubDate>Wed, 12 Feb 2014 18:34:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/17206</link>
      <guid>https://ruby-china.org/topics/17206</guid>
    </item>
    <item>
      <title>[上海] 中和软件有限公司 找 Ruby/Rails 程序员</title>
      <description>&lt;p&gt;Ruby on Rails Developer&lt;/p&gt;

&lt;p&gt;Requirements
2+ years experience with RoR with demonstrable experience using best practices. (ex. 'separation of concerns', 'skinny controllers / fat models', 'progressive enhancement')
Testing frameworks - preferably RSpec/Cucumber/Web as well as Continuous Integration (both setup and use).
Git - should be comfortable with not only basic usage - but more advanced features as well - push/pull branches, gitflow, etc.
HTML5 &amp;amp; CSS3 - best practices and graceful degradation
Javascript- Should be very comfortable with Javascript/JQuery/Ajax
Experience with payment gateways and e-commerce solutions.&lt;/p&gt;

&lt;p&gt;For leader, the followings are plus:
Must have excellent communication skills - both verbal and written, able to articulate ideas.
Ability to break a job into smaller tasks and accurately estimate time to complete overall project
Agile: can take a user story and run with it.
=============================================================上海中和软件有限公司
&lt;a href="http://www.chuwa.com.cn" rel="nofollow" target="_blank"&gt;http://www.chuwa.com.cn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;上海复旦复华科技股份有限公司 
&lt;a href="http://www.fudan-forward.com/forwardgroup/field.aspx?menuword=%C8%ED%BC%FE%BF%AA%B7%A2" rel="nofollow" target="_blank"&gt;http://www.fudan-forward.com/forwardgroup/field.aspx?menuword=%C8%ED%BC%FE%BF%AA%B7%A2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;我是代招，有兴趣的同学可以给我发邮件 femtowin@gmail.com。
这个项目是对美的项目，对于英语要求比较高。  &lt;/p&gt;</description>
      <author>femto</author>
      <pubDate>Wed, 02 May 2012 18:06:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/3035</link>
      <guid>https://ruby-china.org/topics/3035</guid>
    </item>
  </channel>
</rss>
