<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Home on Xianying&#39;s Blog</title>
    <link>https://shrektan.com/zh/</link>
    <description>Recent content in Home on Xianying&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Wed, 05 Aug 2026 01:00:00 +0800</lastBuildDate>
    <atom:link href="https://shrektan.com/zh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>直觉的另一半</title>
      <link>https://shrektan.com/zh/post/2026/08/05/the-other-half-of-intuition/</link>
      <pubDate>Wed, 05 Aug 2026 01:00:00 +0800</pubDate>
      <guid>https://shrektan.com/zh/post/2026/08/05/the-other-half-of-intuition/</guid>
      <description>&lt;p&gt;「相信你的直觉」，这句话大家都听过。但可能很少有人想过：直觉到底是什么，凭什么值得相信？&lt;/p&gt;&#xA;&lt;p&gt;我们上学的时候都学过进化论。往回数，我们是智人，智人之前是猿猴，再往前是哺乳动物、爬行动物，一路推回去，源头也许是水里的某个单细胞生物，和草履虫差不多的模样。从那样一个细胞，变成今天活生生、有智慧的人，中间经历的事情太多太多。而让这条生命线一直延续到今天的东西，就藏在我们身体里。&lt;/p&gt;</description>
    </item>
    <item>
      <title>归根到底，是 taste</title>
      <link>https://shrektan.com/zh/post/2026/04/14/it-all-comes-down-to-taste/</link>
      <pubDate>Tue, 14 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/04/14/it-all-comes-down-to-taste/</guid>
      <description>&lt;p&gt;乔布斯说过一句话：微软真正的问题，不在工程，而在没有 taste。我以前把它当成一句挖苦。但这几年，我把 AI 越来越深地用到自己真正在乎的事情上——做研究、写东西、给自己鼓捣一些小工具——才慢慢觉得，这句话讲的恰恰是全部。&lt;/p&gt;</description>
    </item>
    <item>
      <title>打造你自己的 Skill</title>
      <link>https://shrektan.com/zh/post/2026/04/04/build-your-own-skill/</link>
      <pubDate>Sat, 04 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/04/04/build-your-own-skill/</guid>
      <description>&lt;p&gt;Garry Tan 的 &lt;a href=&#34;https://github.com/garrytan/gstack&#34;&gt;gstack&lt;/a&gt; 最近很火——GitHub 近两万 star，Product Hunt 上趋势第一，到处都在讨论。他用这套 Skills 在 50 天里平均每周写 10,000 行代码、合并 100 个 PR。&lt;/p&gt;&#xA;&lt;p&gt;我装过，认真用了一段时间，然后全删了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>兜兜转转，还是 data.table</title>
      <link>https://shrektan.com/zh/post/2026/04/03/data-table-is-the-best/</link>
      <pubDate>Fri, 03 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/04/03/data-table-is-the-best/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://shrektan.com/zh/post/2026/04/03/data-table-is-the-best/cover.jpg&#34; alt=&#34;data.table 的方括号语法&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;dplyr、Pandas、Polars——这些年主流的 DataFrame 工具我都认真用过。兜兜转转，我现在觉得 data.table 还是综合最好用的数据分析工具，没有之一。&lt;/p&gt;</description>
    </item>
    <item>
      <title>反馈即进化</title>
      <link>https://shrektan.com/zh/post/2026/02/28/feedback-is-evolution/</link>
      <pubDate>Sat, 28 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/02/28/feedback-is-evolution/</guid>
      <description>&lt;p&gt;我以前一直觉得反馈挺重要的，但从来没想清楚它到底为什么重要。&lt;/p&gt;&#xA;&lt;p&gt;最近这两年，一些阅读和经历交织在一起，让我慢慢形成了一个新的认识：反馈不是一种评价，也不是什么工作中的小技巧。它是我们从真实世界获取信息的唯一方式，是我们一切行动的基础，甚至可以说是这个世界最基本的运行机制之一。&lt;/p&gt;</description>
    </item>
    <item>
      <title>知识是一张网</title>
      <link>https://shrektan.com/zh/post/2026/02/28/knowledge-is-a-network/</link>
      <pubDate>Sat, 28 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/02/28/knowledge-is-a-network/</guid>
      <description>&lt;p&gt;从小受的教育，容易给人一种印象：知识是一个一个的“点”。一个公式，一个定义，一个结论，记住了就算掌握了。&lt;/p&gt;&#xA;&lt;p&gt;这个理解是有问题的。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;大脑不是一个仓库，往里面塞东西就完事了。它更像是一个多维的结构，知识和知识之间是相互关联的。任何一个新东西进来，都必须跟已有的认知产生连接，才能真正留得住。没有连接的知识就是悬空的，就算硬背下来，过几天也会掉。&lt;/p&gt;</description>
    </item>
    <item>
      <title>魔方试纸</title>
      <link>https://shrektan.com/zh/post/2026/02/17/rubiks-cube-litmus-test/</link>
      <pubDate>Tue, 17 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2026/02/17/rubiks-cube-litmus-test/</guid>
      <description>&lt;p&gt;最近在跟小朋友一起学三阶魔方。&lt;/p&gt;&#xA;&lt;p&gt;我之前就会基础的层先法，能还原但速度很慢。这次想趁着跟孩子一起玩的机会，把第三层的解法从层先法升级到 CFOP——也就是学 OLL 和 PLL 那套更系统的公式。斯坦福有一份两三页的&lt;a href=&#34;https://cube.stanford.edu/class/files/rubiks_cube_solution.pdf&#34;&gt;教程&lt;/a&gt;，后半部分讲的就是这些内容，每种状态对应什么公式、怎么识别朝向，写得很清楚。照着学，并不难。&lt;/p&gt;</description>
    </item>
    <item>
      <title>从 R Shiny 到 FastAPI &#43; React</title>
      <link>https://shrektan.com/zh/post/2025/05/05/from-r-shiny-to-fastapi-react/</link>
      <pubDate>Mon, 05 May 2025 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2025/05/05/from-r-shiny-to-fastapi-react/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://shrektan.com/zh/post/2025/05/05/from-r-shiny-to-fastapi-react/images/image1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;五一假期期间，我请了几天年假，原计划与孩子共度美好时光，谁知从假期第一天清晨开始，孩子就患上了急性肠胃炎，连续几天呕吐腹泻，茶饭不思。在照顾孩子之余，我抽空研究了FastAPI + React + Tailwind的技术框架组合。&lt;strong&gt;直观感受是，结合&amp;quot;Vibe Coding&amp;quot;（AI辅助编程）后，这个框架比R Shiny更适合正式的工作场景，即便主要用于数据报表和可视化展示。&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>一起长大</title>
      <link>https://shrektan.com/zh/post/2025/05/05/grow-together/</link>
      <pubDate>Mon, 05 May 2025 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2025/05/05/grow-together/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://shrektan.com/zh/post/2025/05/05/grow-together/images/image2.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;闺女五岁了。自她牙牙学语开始，陪伴她的时光日渐丰盈。我希望她的童年能够快乐无忧，让人生最纯真的时光留下最美好的回忆。同时，我也期望她能为未来的人生之路奠定坚实基础：积极阳光的心态、坚韧健全的人格，以及永不熄灭的求知欲和好奇心。&lt;/p&gt;</description>
    </item>
    <item>
      <title>冰水混合物的温度为什么是零</title>
      <link>https://shrektan.com/zh/post/2024/07/07/ice-water-mixture-temperature/</link>
      <pubDate>Sun, 07 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2024/07/07/ice-water-mixture-temperature/</guid>
      <description>&lt;p&gt;中学学物理时，我曾经有一个疑惑：为什么冰水混合物的温度一定是零度？&lt;/p&gt;&#xA;&lt;p&gt;比如说，如果我从冰箱里拿出一大块冰，它的温度可能是零下18度，然后往里面倒些自来水，难道温度就会瞬间变成零度吗？又或者，我把手放在冰上，那一瞬间冰会融化一小点，那个局部的温度就是0度吗？这个“温度是零度”究竟指的是什么？冰水混合物到底是怎么回事？&lt;/p&gt;</description>
    </item>
    <item>
      <title>UTF-8万岁</title>
      <link>https://shrektan.com/zh/post/2022/11/30/utf-8-why-python3-exists/</link>
      <pubDate>Wed, 30 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/11/30/utf-8-why-python3-exists/</guid>
      <description>&lt;p&gt;这次参加R会议的talk还挺有收获，一是吐槽了下字符编码(Encoding)的各种恶心事，二是勾起了我学习下Python的兴趣。&lt;/p&gt;&#xA;&lt;p&gt;最近几日都在鼓捣Python，的确有很多好用的地方，目前粗略地总结了下：&lt;/p&gt;</description>
    </item>
    <item>
      <title>美帝某金融产品欺诈案杂评</title>
      <link>https://shrektan.com/zh/post/2022/05/20/comments-on-some-fraud-product/</link>
      <pubDate>Fri, 20 May 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/05/20/comments-on-some-fraud-product/</guid>
      <description>&lt;p&gt;最近，某国际集团因美帝管理的某金融产品欺诈，赔偿投资者50亿美元，罚款10亿美元，被迫折价出售在美资管业务。&lt;/p&gt;&#xA;&lt;p&gt;读了一遍美国司法部&lt;a href=&#34;https://www.sec.gov/files/litigation/admin/2022/34-94927.pdf&#34;&gt;原文&lt;/a&gt;，揭露的细节足够震惊：110亿美元规模的产品，提供给投资者的收益率、持仓信息都被随意篡改，更无论风险报告里的数字。&lt;/p&gt;&#xA;&lt;p&gt;我不感到意外。流程制度规范极多，然实质风险无人问津，在这么大的企业里，并不鲜见。毕竟，大企业的管理真的很难。&lt;/p&gt;</description>
    </item>
    <item>
      <title>七七八八</title>
      <link>https://shrektan.com/zh/post/2022/05/04/7788/</link>
      <pubDate>Wed, 04 May 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/05/04/7788/</guid>
      <description>&lt;h2 id=&#34;心态&#34;&gt;心态&lt;/h2&gt;&#xA;&lt;p&gt;五一节前，有一工作上的事惹得我特别生气。春节&lt;a href=&#34;https://shrektan.com/post/2022/02/08/self-reflection-the-man-who-cannot-stop/&#34;&gt;“小彻小悟”&lt;/a&gt;以来，还没有如此般不平静过。还好，功力并未全消。回头一想，根源还是心态又不好了，被这三个月来大量会议和极多杂事扰乱了内心。&lt;/p&gt;&#xA;&lt;p&gt;心态不好，不是这事挠心便是那事气愤，因此不谈也罢。原本还写了篇日志，想罢还是删了好。&lt;/p&gt;&#xA;&lt;p&gt;我这人，做事经常过于投入和认真，不加注意便会产生，公司是家，工作是事业的念头。进而用力过猛，思虑过度。也不是有错，但毕竟不是。如此，事不顺心，便易生烦恼，何苦。经常默念“万事先做60分即可”“这只是一个饭碗而已”，对我工作状态反而更好。须知，很多工作只能应付，太认真就错了，因为人的精力是稀缺的。这样，才能够放下执着，接纳和包容那些反感和看不惯之事。&lt;/p&gt;</description>
    </item>
    <item>
      <title>LaTeX 使用笔记</title>
      <link>https://shrektan.com/zh/post/2022/03/11/note-on-latex/</link>
      <pubDate>Fri, 11 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/03/11/note-on-latex/</guid>
      <description>&lt;p&gt;每一门语言都包含一些“隐性知识”。如果不了解这些知识，你会发现使用起来非常困难。这里，我根据自己最近的经验，记录一些关于 &lt;code&gt;$LaTeX$&lt;/code&gt; 的知识，以便读者和未来的自己可以节省一些时间。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小彻小悟（二）</title>
      <link>https://shrektan.com/zh/post/2022/02/22/self-and-now/</link>
      <pubDate>Tue, 22 Feb 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/02/22/self-and-now/</guid>
      <description>&lt;h1 id=&#34;我能停下来了&#34;&gt;我能停下来了&lt;/h1&gt;&#xA;&lt;p&gt;最近，我每天都在观察自己，是不是真的“变”了。虽然，我很强烈地感觉到，这次的“悟”是比较深层次的。但是，我也在想，会不会只是因为春节假期这7天我没有怎么收到工作中那些烦心事的“刺激”。我会不会一受“刺激”就会“旧病复发”？&lt;/p&gt;</description>
    </item>
    <item>
      <title>小彻小悟（一）</title>
      <link>https://shrektan.com/zh/post/2022/02/08/self-reflection-the-man-who-cannot-stop/</link>
      <pubDate>Tue, 08 Feb 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/02/08/self-reflection-the-man-who-cannot-stop/</guid>
      <description>&lt;p&gt;在2022年春节假期的最后一个晚上，我终于“开窍”了。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;过去这大半年，是我工作后最为痛苦的一段经历，既有我预料的部分也有未预料的部分，既有客观的因素也有主观的因素，既有偶然又有必然。无尽的会议，激烈的沟通，长期得不到休息，两周的几乎未眠……&lt;/p&gt;</description>
    </item>
    <item>
      <title>内卷的根源</title>
      <link>https://shrektan.com/zh/post/2022/01/30/source-of-internal-friction/</link>
      <pubDate>Sun, 30 Jan 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/01/30/source-of-internal-friction/</guid>
      <description>&lt;p&gt;当管理者由于各种原因，无法有效评估员工工作的“质”时，就会开始要求将员工工作“包装”为其能够“评估”的形式。&lt;/p&gt;&#xA;&lt;p&gt;这种形式往往就是各种文字的汇报，各种深夜周末的刷存在感，各种会议的组织和扯皮。&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitHub日历</title>
      <link>https://shrektan.com/zh/post/2022/01/08/github-calendar/</link>
      <pubDate>Sat, 08 Jan 2022 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2022/01/08/github-calendar/</guid>
      <description>&lt;h1 id=&#34;缘由&#34;&gt;缘由&lt;/h1&gt;&#xA;&lt;p&gt;今日在回益辉兄一个评论时，突然意识到，从2015年年中开始混迹于GitHub后，从未有如此长时间不码字的时候&amp;mdash;&amp;mdash;说明我2021年实在太惨了。于是乎截取了这些年在GitHub上混迹的足迹&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;，做点小小的回顾，以作纪念。&lt;/p&gt;</description>
    </item>
    <item>
      <title>多重选择</title>
      <link>https://shrektan.com/zh/post/2021/12/17/multiple-options/</link>
      <pubDate>Fri, 17 Dec 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/12/17/multiple-options/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;I ask if he recognises parallels with another natural: Lionel Messi. Federer, a football fan, lights up. He asks excitedly if I’ve met Messi (he hasn’t). “Funny enough,” he says, “I haven’t spoken about Messi nearly enough. What I love about Messi probably most is when he gets the ball and is able to turn the body towards goal, and then he has full vision. Then he’s going to pass, or dribble, or shoot. There’s always three options for him. He’s one of the few who’s got that.”&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust and R on Mac M1的一个注意事项</title>
      <link>https://shrektan.com/zh/post/2021/12/11/rust-and-r-on-mac-m1/</link>
      <pubDate>Sat, 11 Dec 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/12/11/rust-and-r-on-mac-m1/</guid>
      <description>&lt;p&gt;最近看到一个R包叫&lt;a href=&#34;https://extendr.github.io/rextendr/&#34;&gt;rextendr&lt;/a&gt;，能比较方便地把&lt;a href=&#34;https://www.rust-lang.org&#34;&gt;Rust语言&lt;/a&gt;和R语言粘起来。Rust语言我关注也比较久了，最近几年各大厂都开始使用，说明这个语言的确尤其过人之处，更重要的是使用的人多了就表明它变得成熟稳定而且配套的工具文档都丰富了起来。作为一个非专业的码农，我就不要去踩坑了，选择大神们走通的路就好。&lt;/p&gt;&#xA;&lt;p&gt;之所以想用Rust呢，是因为我的工作中的确有少些使用C++的场景。比如有时候会需要静态语言特性，因为部分模型比较复杂，用R这种动态语言容易出错，而且数据的各种问题在过程中都可能发生，我需要很清晰地提示出来。再比如，做一些量化回测的时候既要对于很多细节能够进行控制，还要对计算效率要求比较高。这个时候用C++处理一部分计算的内容，的确会很好。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用UTF8作为默认编码的Window R快来了</title>
      <link>https://shrektan.com/zh/post/2021/12/11/utf8-r-windows-is-coming/</link>
      <pubDate>Sat, 11 Dec 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/12/11/utf8-r-windows-is-coming/</guid>
      <description>&lt;p&gt;2021年12月8日，晚上21点56分（北京时间），Tomas Kalibera&#xA;在R-dev邮件列表上发了封邮件，通知Windows平台上的R用户们，在4.2版本后，（终于）就能使用UTF-8作为native&#xA;Encoding，可以和其他平台的R用户一样，保证读进来的字符默认都是UTF-8编码的了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bookdown的妙用一则</title>
      <link>https://shrektan.com/zh/post/2021/12/01/a-use-case-of-bookdown/</link>
      <pubDate>Wed, 01 Dec 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/12/01/a-use-case-of-bookdown/</guid>
      <description>&lt;h2 id=&#34;铺垫&#34;&gt;铺垫&lt;/h2&gt;&#xA;&lt;p&gt;公司采购的&lt;a href=&#34;https://posit.co/products/enterprise/connect/&#34;&gt;RStudio Connect&lt;/a&gt;只支持Rmarkdown，不支持Rnw自动转成PDF。但对于我来讲正好，因为我实在不喜欢辣眼睛的&lt;code&gt;$LaTeX$&lt;/code&gt;的斜杠，早就想转成纯Rmarkdown的生态，无奈公司很多时候还是会用到PDF文件。制作商业需要的PDF格式，虽然rmarkdown支持，但试了试感觉还是很麻烦，和在Rnw里手写&lt;code&gt;$LaTeX$&lt;/code&gt;差不多，总之是偏离了使用Rmarkdown的初心&amp;mdash;&amp;mdash;&amp;ldquo;简洁&amp;rdquo;。&lt;/p&gt;</description>
    </item>
    <item>
      <title>道理与证明</title>
      <link>https://shrektan.com/zh/post/2021/11/27/sense-and-proof/</link>
      <pubDate>Sat, 27 Nov 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/11/27/sense-and-proof/</guid>
      <description>&lt;p&gt;今天，YouTube推送了一个视频&lt;a href=&#34;https://youtu.be/dZdBoACtv3Q&#34;&gt;《林群院士：教科书讲得太复杂，学微积分只需要一个案例》&lt;/a&gt;，好奇地点了进去。&lt;/p&gt;&#xA;&lt;h2 id=&#34;关于学习微积分的故事&#34;&gt;关于学习微积分的故事&lt;/h2&gt;&#xA;&lt;p&gt;为什么好奇呢？因为本科学微积分时，我意识到一个现象：教科书和老师叽里咕噜地一开始就一堆一堆的证明这儿证明那儿，一整节课就基本在那里推公式。当时心想，这公式书上都有，上课推公式意义何在？更重要的是，精力和心思被大段的证明所淹没，证明这个定理的出发点和原因反而被轻飘飘地一笔带过。学了一学期，除了公式啥也没记住，更别谈如何在生活和工作中灵活地运用了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>创造X的价值，捕获Y的比例</title>
      <link>https://shrektan.com/zh/post/2021/11/23/create-x-value-and-capture-y/</link>
      <pubDate>Tue, 23 Nov 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/11/23/create-x-value-and-capture-y/</guid>
      <description>&lt;p&gt;最近看了一个Youtube的视频，是Peter Thiel在斯坦福的一个讲座，题目叫做&amp;quot;&lt;a href=&#34;https://www.youtube.com/watch?v=3Fx5Q8xGU8k&#34;&gt;Competition is for losers&lt;/a&gt;&amp;quot;。核心点就这么三个&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;：&lt;/p&gt;</description>
    </item>
    <item>
      <title>我为什么要用RStudio Team</title>
      <link>https://shrektan.com/zh/post/2021/11/21/why-do-i-choose-rstudio-team/</link>
      <pubDate>Sun, 21 Nov 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/11/21/why-do-i-choose-rstudio-team/</guid>
      <description>&lt;p&gt;昨天，在第十四届中国R会议分享了&lt;a href=&#34;https://github.com/shrektan/Use-ShinyProxy-To-Deploy-ShinyApps&#34;&gt;《如何使用ShinyProxy部署Shiny Apps》&lt;/a&gt;。讲的比较抽象，对于没有接触过ShinyProxy，或者没有考虑过Shiny App部署的听众来说，应该会比较枯燥。&lt;/p&gt;</description>
    </item>
    <item>
      <title>废寝忘食</title>
      <link>https://shrektan.com/zh/post/2021/10/21/%E5%BA%9F%E5%AF%9D%E5%BF%98%E9%A3%9F/</link>
      <pubDate>Thu, 21 Oct 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/10/21/%E5%BA%9F%E5%AF%9D%E5%BF%98%E9%A3%9F/</guid>
      <description>&lt;p&gt;一晃眼，又是凌晨2:30。我这个夜猫子作息恐怕一辈子也改不了了。&lt;/p&gt;&#xA;&lt;p&gt;最近这一周终于可以投入到码字大业里了，连续好几天晚上十点到家溜下娃后（夜猫子基因），继续鼓捣折腾（正在采购RStudio Team，在摸索怎么用Docker把环境部署好）。&lt;/p&gt;</description>
    </item>
    <item>
      <title>忘了常识</title>
      <link>https://shrektan.com/zh/post/2021/10/07/%E5%BF%98%E4%BA%86%E5%B8%B8%E8%AF%86/</link>
      <pubDate>Thu, 07 Oct 2021 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2021/10/07/%E5%BF%98%E4%BA%86%E5%B8%B8%E8%AF%86/</guid>
      <description>&lt;p&gt;工作这么久，见到太多忘记常识的人和事了，现在感触更深。&lt;/p&gt;&#xA;&lt;p&gt;正如芒格讲的，“常识，就是平常人不具备的知识”。我想，在工作中每个人都应该好好思考下，自己做这个事情是为了什么？太多的人就只是为了把这个事情做了，根本不管“为了什么”。其实，只要想想“为了什么”，也许就能很容易得出来答案，也许就会知道什么是正确的问题，也许就会知道很多事情抓住了重点根本没那么复杂，什么琐碎都要讨论可能是搞错了方向！&lt;/p&gt;</description>
    </item>
    <item>
      <title>低效的一天</title>
      <link>https://shrektan.com/zh/post/2020/11/04/low-productivity-day/</link>
      <pubDate>Wed, 04 Nov 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/11/04/low-productivity-day/</guid>
      <description>&lt;p&gt;最近手头事特别多，但今天特别低效，两件事：&lt;strong&gt;“杀毒软件”&lt;strong&gt;和&lt;/strong&gt;“Windows下的字符编码”&lt;/strong&gt;。&lt;/p&gt;&#xA;&lt;h1 id=&#34;杀毒软件&#34;&gt;杀毒软件&lt;/h1&gt;&#xA;&lt;p&gt;我们公司安全策略是所有Windows机器必须要安装两个软件：&lt;a href=&#34;https://www.trendmicro.com&#34;&gt;趋势科技&lt;/a&gt;还有&lt;a href=&#34;https://www.ivanti.com.cn/company/history/landesk&#34;&gt;LANDESK&lt;/a&gt;。前者是防病毒软件，后者为了防止员工使用网盘等非允许软件的控制程序。&lt;/p&gt;</description>
    </item>
    <item>
      <title>博客提速小记</title>
      <link>https://shrektan.com/zh/post/2020/10/06/blog-speed-up/</link>
      <pubDate>Tue, 06 Oct 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/10/06/blog-speed-up/</guid>
      <description>&lt;p&gt;刚刚用手机登录了下自己的网站，发现连接速度超级慢。用浏览器查看了下资源载入消耗的时间，发现了两个“罪魁祸首”：&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;yihui.name/js/center-img.js和yihui.name/js/math-code.js : 不知为何，最近半年来在天朝访问益辉兄的网站速度极慢，这相关资源的加载必然也就永无尽头，而且还是非异步的。于是乎，在益辉兄网站的&lt;a href=&#34;https://github.com/yihui/yihui.org&#34;&gt;Github仓库&lt;/a&gt;里扒出来了&lt;a href=&#34;https://github.com/yihui/yihui.org/tree/be87d74a0cf5ac8bf54fa14cd00dd6ba3b674be0/static/js&#34;&gt;源文件&lt;/a&gt;，替换之。&lt;/p&gt;</description>
    </item>
    <item>
      <title>在负载均衡下使用DT</title>
      <link>https://shrektan.com/zh/post/2020/10/05/use-dt-behind-a-load-balancer/</link>
      <pubDate>Mon, 05 Oct 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/10/05/use-dt-behind-a-load-balancer/</guid>
      <description>&lt;p&gt;过去这两年，陆陆续续一直有用户抱怨DT在负载均衡(load balancer)下使用不了，老是报错，比如&lt;a href=&#34;https://github.com/rstudio/DT/issues/849&#34;&gt;rstudio/DT#849&lt;/a&gt;和&lt;a href=&#34;https://github.com/rstudio/DT/issues/642&#34;&gt;rstudio/DT#642&lt;/a&gt;。&lt;/p&gt;&#xA;&lt;p&gt;关于“负载均衡”，我其实之前并没使用过，只是出于兴趣大概了解了下基本的原理。它就是一种类似于反向代理的东西，可以把客户发来的请求，按一定规则合理地分配给背后不同的服务器去处理。&lt;/p&gt;</description>
    </item>
    <item>
      <title>“五分钟”的陷阱</title>
      <link>https://shrektan.com/zh/post/2020/04/01/the-trap-of-you-can-do-it-in-five-minutes/</link>
      <pubDate>Wed, 01 Apr 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/04/01/the-trap-of-you-can-do-it-in-five-minutes/</guid>
      <description>&lt;p&gt;今天，有人私下发邮件问我能不能帮忙解决个问题，我没理会。后来，他又通过微信找我。我知道自己也许五分钟就能给他这个答案，而他可能需要花上一两个小时。但是我还是忍住了自己心中那“无所谓，五分钟小事而已”的冲动。&lt;/p&gt;</description>
    </item>
    <item>
      <title>溺爱</title>
      <link>https://shrektan.com/zh/post/2020/03/31/dotage/</link>
      <pubDate>Tue, 31 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/03/31/dotage/</guid>
      <description>&lt;p&gt;一年前，益辉兄的那篇&lt;a href=&#34;https://yihui.org/cn/2019/07/excessive-empathy/&#34;&gt;《共情过度》&lt;/a&gt;引发了我的共鸣，这些日子感触更深。&lt;/p&gt;&#xA;&lt;p&gt;可能是遗传的原因（我父母、我那刚满三个月的闺女都如此），我自己性格中有着急躁和火爆的一面，而且非常敏感（当然，往好了说就是观察力敏锐），遇到不舒服的事情，时常感觉五脏六腑都会紧绷。与此同时，我也有着强烈的同情心。正因为我能强烈地感受他人的感受，在工作中，我总是极力地想去帮助他人，极力地想把手头的工作做好，以避免给他人带来麻烦。&lt;/p&gt;</description>
    </item>
    <item>
      <title>自我陶醉</title>
      <link>https://shrektan.com/zh/post/2020/03/27/self-enjoyment/</link>
      <pubDate>Fri, 27 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/03/27/self-enjoyment/</guid>
      <description>&lt;p&gt;前两天，收到微信群里发的文件，是关于各家公司偿二代二期测试市场风险填报数据问题的情况。统计了下，有各种数据问题的保险公司真不少，竟然有125家，几乎所有中大型的保险公司都赫然在列。但又心中窃喜，暗自嘚瑟，我司不在名单之中。&lt;/p&gt;</description>
    </item>
    <item>
      <title>提问的态度</title>
      <link>https://shrektan.com/zh/post/2020/03/23/the-attitude-of-asking-questions/</link>
      <pubDate>Mon, 23 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/03/23/the-attitude-of-asking-questions/</guid>
      <description>&lt;p&gt;提问的人最好做一些功课，这样别人给了你答案，你便很快能理解，后续也会自主搜集相关信息，从而内化为自己的知识。&lt;/p&gt;&#xA;&lt;p&gt;如果提问的人不肯努力，解释再多也是徒劳。碎片化的回答不但占用回答人的宝贵时间，更是让提问人一头雾水——很多实际问题就是那么的复杂，总是试图简单理解，只能让自己越来越迷糊。&lt;/p&gt;</description>
    </item>
    <item>
      <title>幸福感</title>
      <link>https://shrektan.com/zh/post/2020/03/19/the-feel-of-happiness/</link>
      <pubDate>Thu, 19 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2020/03/19/the-feel-of-happiness/</guid>
      <description>&lt;p&gt;一转眼也已经是奔四的年纪了，幸福感却越来越少，负面情绪不时就会冒出来。&lt;/p&gt;&#xA;&lt;h1 id=&#34;工作&#34;&gt;工作&lt;/h1&gt;&#xA;&lt;p&gt;还记得刚工作那会，没日没夜，但还是经常能感到快乐。究其原因，一个刚成立的公司，人手奇缺，大量繁杂琐碎的工作需要人来完成。虽然很辛苦，但是领导同事都感觉是拧成一根绳，齐心协力地想把事情做好。可能正好我本身又是个万金油型的选手吧，不管擅长不擅长的工作，也都还能比较好地完成。领导同事的认可，以及不断地突破自我，让一个二十出头的小伙子很有成就感，很开心。&lt;/p&gt;</description>
    </item>
    <item>
      <title>R语言在保险资产管理中的应用实践分享</title>
      <link>https://shrektan.com/zh/post/2019/11/14/r-in-insurance-amc/</link>
      <pubDate>Thu, 14 Nov 2019 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2019/11/14/r-in-insurance-amc/</guid>
      <description>&lt;h1 id=&#34;来源&#34;&gt;来源&lt;/h1&gt;&#xA;&lt;p&gt;10月中旬应芳姐邀请，回系里分享了R在保险资管中的一些应用，主要是给大家普及下R可以做什么。自己实在临场发挥的水平不佳，就事先准备了一份发言稿。还是用心准备了好几天，所以就简单地整理后分享了出来。&lt;/p&gt;</description>
    </item>
    <item>
      <title>别在生产环境中用净土</title>
      <link>https://shrektan.com/zh/post/2019/11/14/use-no-tdv-in-production/</link>
      <pubDate>Thu, 14 Nov 2019 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2019/11/14/use-no-tdv-in-production/</guid>
      <description>&lt;p&gt;每次系统性地升级R包，我最担心的就是tidyverse相关的代码，因为不时地就会出现各种&amp;quot;break the existing code&amp;quot;的升级，令人非常头疼。果然不出所料，原来合法的代码又一次报错：&lt;/p&gt;</description>
    </item>
    <item>
      <title>创建一个能自动断开的数据库连接</title>
      <link>https://shrektan.com/zh/post/2019/07/26/create-a-database-connection-that-can-be-disconnected-automatically/</link>
      <pubDate>Fri, 26 Jul 2019 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2019/07/26/create-a-database-connection-that-can-be-disconnected-automatically/</guid>
      <description>&lt;p&gt;数据库连接是一种资源。虽然数据库会自动释放空闲连接，但最好还是自己主动释放。否则，可能会严重影响数据库的性能。&lt;/p&gt;&#xA;&lt;p&gt;在使用完毕后显式关闭连接是可以的，但太过冗长。而且，这种方式无法保证连接一定会被释放——想象一下，你的代码在关闭连接那行之前就抛出了错误。在 CPP 中，一个好的做法是通过将资源的使用封装到对象中来管理资源，这样只要对象离开作用域，资源就会被释放。这种技术叫做 &lt;a href=&#34;http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r1-manage-resources-automatically-using-resource-handles-and-raii-resource-acquisition-is-initialization&#34;&gt;RAII（Resource Acquisition Is Initialization，资源获取即初始化）&lt;/a&gt;。&lt;/p&gt;</description>
    </item>
    <item>
      <title>MS SQLServer 中特殊的 Unicode 字符 \uff0d</title>
      <link>https://shrektan.com/zh/post/2019/05/06/the-special-unicode-character-uff0d-in-ms-sqlserver/</link>
      <pubDate>Mon, 06 May 2019 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2019/05/06/the-special-unicode-character-uff0d-in-ms-sqlserver/</guid>
      <description>&lt;p&gt;现在是北京时间凌晨 01:57，我还没睡，拜这个“伟大”的 Unicode 字符 &lt;code&gt;\uff0d&lt;/code&gt; 所赐。它的官方名称是 &amp;ldquo;FULLWIDTH HYPHEN-MINUS&amp;rdquo;（打印出来是 &lt;code&gt;－&lt;/code&gt;，和 &lt;code&gt;-&lt;/code&gt; 长得非常像）。&lt;/p&gt;</description>
    </item>
    <item>
      <title>在 plumber API 中使用 `base::serialize()`</title>
      <link>https://shrektan.com/zh/post/2018/11/14/use-base-serializer-in-the-plumber-api/</link>
      <pubDate>Wed, 14 Nov 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/11/14/use-base-serializer-in-the-plumber-api/</guid>
      <description>&lt;p&gt;最近，我需要把服务器上的一个 R 模型分享给使用 R 的同事。我立刻想到了 &lt;a href=&#34;https://www.rplumber.io&#34;&gt;Plumber&lt;/a&gt;。用 plumber 构建 Web API 非常简单。我很喜欢它用 roxygen 风格来定义 API 的方式，既优雅又易于维护。&lt;/p&gt;&#xA;&lt;p&gt;通常，Web API 使用 &lt;a href=&#34;http://json.org/&#34;&gt;JSON&lt;/a&gt; 来表示数据。然而不幸的是，JSON 将对象编码为字符串，这可能导致信息丢失。例如，属性（除了 names 之外）无法被保留。这会带来一些麻烦：&lt;/p&gt;</description>
    </item>
    <item>
      <title>不争就输了</title>
      <link>https://shrektan.com/zh/post/2018/11/13/have-to-fight/</link>
      <pubDate>Tue, 13 Nov 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/11/13/have-to-fight/</guid>
      <description>&lt;p&gt;我的性格比较“温和”，天生就同理心特强，不太爱计较，不争强好胜。一方面，我是一个好相处的人，但另一方面，这种“好相处”源自于主要通过调整自己的行为，来适应环境，而不是去努力地改变环境。&lt;/p&gt;</description>
    </item>
    <item>
      <title>恒顺众生</title>
      <link>https://shrektan.com/zh/post/2018/09/19/solve-problems-by-respecting-the-habbits/</link>
      <pubDate>Wed, 19 Sep 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/09/19/solve-problems-by-respecting-the-habbits/</guid>
      <description>&lt;p&gt;偶然间朋友圈看到了一篇文章&lt;a href=&#34;https://perma.cc/3EUF-KK3X&#34;&gt;《宣化上人：“恒顺众生”不是顺着众生》&lt;/a&gt;，我对佛学并不了解，只是好奇随手翻翻，但是文章里的这句话，我产生了强烈的共鸣：&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;恒顺众生，是顺着众生的习惯，又要把他从逆流中救出来，这叫恒顺。怎么说从逆流里头把他救出来呢？因为众生都是颠倒的，颠倒就是逆流。好像水往东流，你从东往西那么摆这个船，这就叫逆流。你若是顺着众生就不能成佛，你若是想成佛就不能顺众生。&lt;/p&gt;</description>
    </item>
    <item>
      <title>在北京开个车真难</title>
      <link>https://shrektan.com/zh/post/2018/08/30/hard-to-drive-in-beijing/</link>
      <pubDate>Thu, 30 Aug 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/08/30/hard-to-drive-in-beijing/</guid>
      <description>&lt;p&gt;又到了一年一度折腾汽车指标的日子，实在忍不住，必须得吐槽下：在北京开个车真是难啊！&lt;/p&gt;&#xA;&lt;p&gt;我说的难，不是指那堵得要死的交通，那永远便秘状的南北向道路，那到处穿梭的小电驴，那一不小心就交通管制的长安街，那停车的贵和难……&lt;/p&gt;</description>
    </item>
    <item>
      <title>在Linux下使用odbc包连接MSSQL Server</title>
      <link>https://shrektan.com/zh/post/2018/08/10/using-the-odbc-package-to-connect-ms-sql-server/</link>
      <pubDate>Fri, 10 Aug 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/08/10/using-the-odbc-package-to-connect-ms-sql-server/</guid>
      <description>&lt;p&gt;在&lt;a href=&#34;https://shrektan.com/post/2018/05/07/cant-bear-with-encoding-any-longer/&#34;&gt;《忍无可忍的Encoding》&lt;/a&gt;一文中提到：&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/imanuelcostigan/RSQLServer&#34;&gt;RSQLServer包&lt;/a&gt;退役了，作者建议使用&lt;a href=&#34;https://github.com/r-dbi/odbc&#34;&gt;r-dbi/odbc包&lt;/a&gt;代替。但是，odbc包并没有像RODBC包一样（版本1.1.6已经修复这个问题），&lt;em&gt;预先把SQL字符编码转换成和数据库一致的字符编码&lt;/em&gt; ，导致无法正确执行包含中文的SQL语句（如果该语句的字符编码和数据库的编码不一致）。&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;举个栗子：&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;MSSQL Server数据库：一般放在某个中文Windows Server服务器上，大概率其数据库默认字符编码是GB2312;&lt;/p&gt;</description>
    </item>
    <item>
      <title>忍无可忍的Encoding</title>
      <link>https://shrektan.com/zh/post/2018/05/07/cant-bear-with-encoding-any-longer/</link>
      <pubDate>Mon, 07 May 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/05/07/cant-bear-with-encoding-any-longer/</guid>
      <description>&lt;h3 id=&#34;rsqlserver包正式退役了&#34;&gt;RSQLServer包正式退役了&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/imanuelcostigan/RSQLServer&#34;&gt;RSQLServer&lt;/a&gt;于2018年4月10日&lt;a href=&#34;https://cran.r-project.org/package=RSQLServer&#34;&gt;正式退役(Archive)&lt;/a&gt;，作者建议用&lt;a href=&#34;https://github.com/r-dbi/odbc&#34;&gt;r-dbi/odbc&lt;/a&gt;代替。&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This package is archived as there is now an excellent, much better supported package &lt;a href=&#34;https://github.com/r-dbi/odbc&#34;&gt;odbc&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;切换到odbc包&#34;&gt;切换到odbc包&lt;/h3&gt;&#xA;&lt;p&gt;作为一个长期混迹于Github的码农，很早前便注意到odbc这个包了。的确，odbc更快更轻（不需要安装Java），也在积极开发中。而RSQLServer则有点缺乏维护，加上之前引入了dplyr的一些功能，不时会引起冲突，我便一直手痒想切换过去。虽然做了一些比较和测试，基本没看出问题，但却暗暗担心会遇到些意想不到的毛病。&lt;/p&gt;</description>
    </item>
    <item>
      <title>不自信的复杂</title>
      <link>https://shrektan.com/zh/post/2018/05/02/lack-of-confidence-leads-to-over-complication/</link>
      <pubDate>Wed, 02 May 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/05/02/lack-of-confidence-leads-to-over-complication/</guid>
      <description>&lt;p&gt;昨天，去苹果店把淘汰的iPhone以旧换新，用折扣置换了个新款的iPad和Apple Pencil。回家用Apple Pencil在Good Reader上看了会儿pdf，感觉不错。我是电子书的推崇者，基本不怎么看纸质书了。原因很简单，电子书携带方便，尤其是对于我这种习惯于零散阅读的人（地铁上、中午吃饭、睡觉前……）。但是电子书也有一个明显的缺点，就是不太方便做笔记，或者说做笔记没那种感觉。我这人读书向来想法多，也喜欢在书上写写画画，打上去的字总是觉得差了点意思。用Apple Pencil看pdf，总算是勉强满足了我写写画画的“恶习”。&lt;/p&gt;</description>
    </item>
    <item>
      <title>&#34;人类的四舍五入&#34;——最近偶数舍入 vs 四舍五入</title>
      <link>https://shrektan.com/zh/post/2018/04/25/human-round-round-to-nearest-ties-away-from-zero/</link>
      <pubDate>Wed, 25 Apr 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/04/25/human-round-round-to-nearest-ties-away-from-zero/</guid>
      <description>&lt;p&gt;你有没有注意到，在 R 中 &lt;code&gt;base::round(2.5)&lt;/code&gt; 和 &lt;code&gt;base::round(1.5)&lt;/code&gt; 的返回值都是 &lt;code&gt;2&lt;/code&gt;？是不是觉得很奇怪？至少我在学校里只学过一种舍入规则，就是“四舍五入”。意思是小数部分达到五就进位，四则舍去。&lt;/p&gt;</description>
    </item>
    <item>
      <title>用 sprintf() 而不是 as.character()</title>
      <link>https://shrektan.com/zh/post/2018/04/12/use-sprintf-rather-than-as-character/</link>
      <pubDate>Thu, 12 Apr 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/04/12/use-sprintf-rather-than-as-character/</guid>
      <description>&lt;p&gt;把数字转成字符串很简单，很多时候甚至不需要显式调用转换函数。但当你需要精细控制输出格式时，就会发现 &lt;code&gt;as.character()&lt;/code&gt; 力不从心，而 &lt;code&gt;sprintf()&lt;/code&gt; 才是正解。下面我用几个实际场景来演示。&lt;/p&gt;</description>
    </item>
    <item>
      <title>用blogdown来管理工作事项</title>
      <link>https://shrektan.com/zh/post/2018/04/02/blogdown-todo/</link>
      <pubDate>Mon, 02 Apr 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/04/02/blogdown-todo/</guid>
      <description>&lt;p&gt;工作原因在Github上的项目越来越多，新的想法或者bug都会在项目下新建Issue。然而，Github并不支持在一个统一的地方去管理查看，我必须得去每个项目下点开了才知道情况。&lt;/p&gt;</description>
    </item>
    <item>
      <title>困难的定义</title>
      <link>https://shrektan.com/zh/post/2018/03/21/defining-is-the-hardest-part/</link>
      <pubDate>Wed, 21 Mar 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/03/21/defining-is-the-hardest-part/</guid>
      <description>&lt;p&gt;把想法写下来的确能让自己的思路更加清晰，写成博客以后查阅也比较方便，以后得勤写。&lt;/p&gt;&#xA;&lt;p&gt;记得以前看数学和物理发展史时，注意到一个现象，在某个概念或者问题的精确“定义”出现前很多很多年，人们其实已然有了对某个事物或者概念模糊的认识，科学先驱大神们最了不起的贡献之一其实是清晰地对之进行定义。因此，学习和理解某个概念的第一步是建立感性的认知，而不是死抠定义字眼。&lt;/p&gt;</description>
    </item>
    <item>
      <title>R中的字符编码</title>
      <link>https://shrektan.com/zh/post/2018/03/18/strings-encodings-in-r/</link>
      <pubDate>Sun, 18 Mar 2018 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/post/2018/03/18/strings-encodings-in-r/</guid>
      <description>&lt;p&gt;费了不少功夫，不出意外，总算是彻底解决了&lt;code&gt;data.table&lt;/code&gt;中文支持的问题（&lt;a href=&#34;https://github.com/Rdatatable/data.table/pull/2678&#34;&gt;PR#2678&lt;/a&gt;、&lt;a href=&#34;https://github.com/Rdatatable/data.table/pull/2566&#34;&gt;PR#2566&lt;/a&gt;)、 &lt;a href=&#34;https://github.com/Rdatatable/data.table/pull/3451&#34;&gt;PR#3451&lt;/a&gt;、 &lt;a href=&#34;https://github.com/Rdatatable/data.table/pull/3849&#34;&gt;PR#3849&lt;/a&gt;、 &lt;a href=&#34;https://github.com/Rdatatable/data.table/pull/3850&#34;&gt;PR#3850&lt;/a&gt;。散乱地写下些学习到的点，供以后参考：&lt;/p&gt;&#xA;&lt;h3 id=&#34;学习笔记&#34;&gt;学习笔记&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;R对象在C环境下统一为&lt;code&gt;SEXP&lt;/code&gt;类型(读音为S,EXP(external pointer)，不是SEX P)；&lt;/li&gt;&#xA;&lt;li&gt;R里面字符串的实施细节用到了字符串池(&lt;a href=&#34;https://cran.r-project.org/doc/manuals/r-release/R-ints.html#The-CHARSXP-cache&#34;&gt;The CHARSXP cache&lt;/a&gt;)来提高效率;&lt;/li&gt;&#xA;&lt;li&gt;对于字符串的排序，&lt;code&gt;data.table&lt;/code&gt;和base R里面的radix sort巧妙地使用了SEXP一个基本废弃的属性&lt;a href=&#34;https://cran.r-project.org/doc/manuals/r-release/R-ints.html#DOCF3&#34;&gt;&lt;code&gt;truelength&lt;/code&gt;&lt;/a&gt;。更具体地说，把&lt;code&gt;The CHARSXP cache&lt;/code&gt;当做一个哈希表(key -&amp;gt; value)，并将值储存在&lt;code&gt;truelength属性&lt;/code&gt;中；&lt;/li&gt;&#xA;&lt;li&gt;R字符在C level下，能够保存的Encoding属性只有三种：&lt;code&gt;Latin-1&lt;/code&gt;, &lt;code&gt;ASCII&lt;/code&gt; 和 &lt;code&gt;UTF-8&lt;/code&gt;，参见&lt;a href=&#34;https://cran.r-project.org/doc/manuals/r-release/R-ints.html#Rest-of-header&#34;&gt;此段最后一行&lt;/a&gt;和&lt;a href=&#34;https://cran.r-project.org/doc/manuals/r-release/R-ints.html#Encodings-for-CHARSXPs&#34;&gt;R Internals - Encodings for CHARSXPs&lt;/a&gt;；&lt;/li&gt;&#xA;&lt;li&gt;R中使用到&lt;code&gt;SEXP&lt;/code&gt;时，一定要注意思考垃圾回收有没有可能回收这个变量。垃圾回收导致的bug非常难以查找，&lt;a href=&#34;https://github.com/Rdatatable/data.table/issues/2674&#34;&gt;data.table issue#2674&lt;/a&gt;前前后后花了差不多6个小时才解决。标准的查虫流程为“发现异常、找到最小可重复的代码、定位问题、解决问题”，然而垃圾回收的触发是不可控的，因此要想复现此类bug非常困难；&lt;/li&gt;&#xA;&lt;li&gt;字符串的比较有两种方式，一是直接比较背后的编码(可以用&lt;code&gt;charToRaw()&lt;/code&gt;查看），二是统一转换为UTF-8编码后再比较；&lt;/li&gt;&#xA;&lt;li&gt;如何判断一个CHARSXP是不是ASCII, UTF8可参考：&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/wch/r-source/blob/44d54d6f848468a7353d99cc9be0255105185975/src/main/util.c#L1834&#34;&gt;R-source/util.c&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Rdatatable/data.table/blob/bb3ba9a39be1ee8386b86909e045947898cb0935/src/data.table.h#L50&#34;&gt;data.table/data.table.h&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;在R的C Routine中将字符转为UTF-8编码：&lt;code&gt;mkCharCE(translateCharUTF8(s), CE_UTF8)&lt;/code&gt;；&lt;/li&gt;&#xA;&lt;li&gt;Debug往往需要把相关变量值打印出来，然而R的C Routine中支持的&lt;code&gt;Rprintf()&lt;/code&gt;只能打印本地编码的字符，因此必须先将字符串用&lt;code&gt;translateChar&lt;/code&gt;转换后才能成功打印，如&lt;code&gt;Rprintf(&amp;quot;%s&amp;quot;, translateChar(value))&lt;/code&gt;，否则只会得到空白。&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Character-encoding-issues&#34;&gt;Character-encoding-issues&lt;/a&gt;: However, if they need to be interpreted as characters or output at C level then it would normally be correct to ensure that they are converted to the encoding of the current locale: this can be done by accessing the data in the CHARSXP by translateChar rather than by CHAR.&lt;/p&gt;</description>
    </item>
    <item>
      <title>关于我</title>
      <link>https://shrektan.com/zh/about/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://shrektan.com/zh/about/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;学了将近七年的&lt;a href=&#34;https://zh.wikipedia.org/wiki/%E7%B2%BE%E7%AE%97%E5%AD%A6&#34;&gt;精算&lt;/a&gt;，目前在金融行业从事量化相关工作。&lt;/li&gt;&#xA;&lt;li&gt;十岁时（大约 2000 年）父亲给我买了第一台电脑，从此一发不可收拾。由于当时家乡几乎没人懂电脑，一切只能自学。这段经历让我对计算机的运作方式有了不错的直觉，但真正意识到自己对编程的热爱，要等到第一次在寿险公司实习做助理精算师的时候。&lt;/li&gt;&#xA;&lt;li&gt;R 是我最喜欢的语言；需要高性能计算时会用 C++ 作为底层引擎。Excel 和 VBA 也是常用工具——在办公场景中确实方便。此外还接触过 VB.NET、Shell、JavaScript、CSS、HTML 等。&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
