<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Melchior on CLR</title>
    <link>https://verrickt.github.io/posts/</link>
    <description>Recent content in Posts on Melchior on CLR</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <managingEditor>Verrickt</managingEditor>
    <webMaster>Verrickt</webMaster>
    
    <lastBuildDate>Wed, 11 Mar 2026 15:38:00 +0800</lastBuildDate>
    
    <atom:link href="https://verrickt.github.io/posts/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>使ASP.NET Core端点同时支持JSON参数和流式文件上传</title>
      <link>https://verrickt.github.io/posts/supporting-json-parameter-and-streaming-fileupload-for-endpoints-in-asp-net-core/</link>
      <pubDate>Wed, 11 Mar 2026 15:38:00 +0800</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/supporting-json-parameter-and-streaming-fileupload-for-endpoints-in-asp-net-core/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;背景&lt;/h2&gt;&#xA;&lt;p&gt;我最近在开发一个中转网盘程序，网盘自身仅维护目录结构，内容的存储则由第三方块存储提供。&lt;/p&gt;&#xA;&lt;p&gt;这样的设计下，上传文件的端点需要同时接受参数和内容：&lt;/p&gt;&#xA;&lt;p&gt;请求参数&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Hexo博客迁移到Hugo</title>
      <link>https://verrickt.github.io/posts/migrate-blog-from-hexo-to-hugo/</link>
      <pubDate>Fri, 22 Aug 2025 19:42:57 +0800</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/migrate-blog-from-hexo-to-hugo/</guid>
      <description>&lt;p&gt;本博客使用&lt;a href=&#34;https://hexo.io/&#34;&gt;Hexo&lt;/a&gt;已经7年了。博文和内容增多后，hexo的生成速度越来越难以满足需求啦。我的个人博客迁移到&lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt;近一年了，生成的速度飞快，也没有遇到什么坑，是时候迁移了。&lt;del&gt;顺便还能水一篇文章&lt;/del&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;前期准备&#34;&gt;前期准备&lt;/h2&gt;&#xA;&lt;h3 id=&#34;安装hugo&#34;&gt;安装Hugo&lt;/h3&gt;&#xA;&lt;p&gt;我打算使用的主题&lt;a href=&#34;https://github.com/CaiJimmy/hugo-theme-stack&#34;&gt;Stack&lt;/a&gt;需要使用到&lt;code&gt;Hugo&lt;/code&gt;的扩展版&lt;code&gt;hugo-extended&lt;/code&gt;，如果你的主题没有额外的要求，按照普通版即可&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Before you start, make sure you have installed Hugo extended version. For more information, see &lt;a href=&#34;https://gohugo.io/getting-started/installing/&#34;&gt;Hugo&amp;rsquo;s documentation&lt;/a&gt;.&lt;br&gt;&#xA;This theme uses SCSS and TypeScript, that&amp;rsquo;s why Hugo extended version is required&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;choco install hugo-extended&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;新建网站&#34;&gt;新建网站&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;hugo new site-example&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd site-example&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;安装主题&#34;&gt;安装主题&lt;/h3&gt;&#xA;&lt;p&gt;我比较old-fashion，喜欢用sub module&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>上下文无关文法中左递归消除的证明</title>
      <link>https://verrickt.github.io/posts/left-recursion-elimination/</link>
      <pubDate>Fri, 15 Aug 2025 16:59:56 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/left-recursion-elimination/</guid>
      <description>&lt;h2 id=&#34;直接左递归消除&#34;&gt;直接左递归消除&lt;/h2&gt;&#xA;&lt;p&gt;针对左递归的上下文无关语法$A$，存在一种能够消除左递归的改写方式。&#xA;本文将不严谨(?)地证明这一点。&lt;/p&gt;&#xA;&lt;h3 id=&#34;左递归语法&#34;&gt;左递归语法&lt;/h3&gt;&#xA;&lt;p&gt;考虑如下语法&lt;/p&gt;&#xA;$$&#xD;&#xA;A \rarr A\alpha_1|A\alpha_2|A\alpha_3|\dots|A\alpha_m|\beta_1|\beta_2|\beta_3|\dots|\beta_n&#xD;&#xA;$$&lt;p&gt;令$\alpha = \alpha_{1\dots m}$，$\beta = \beta_{1 \dots n}$，则可简写为&#xA;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>删除/var/log后nginx出错</title>
      <link>https://verrickt.github.io/posts/inaccessable-log-caused-nginx-configuration-error/</link>
      <pubDate>Tue, 01 Nov 2022 20:52:36 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/inaccessable-log-caused-nginx-configuration-error/</guid>
      <description>&lt;p&gt;今天天气不错，我打开自己的小网站，准备欣赏下花了N久魔改的主题。敲好URL，提示500。套的Cloudflare提示我，SSL证书过期了。我用的是StartSSL提供的证书，默认有效期90天。而服务器的Linux版本又比较老，无法使用&lt;code&gt;certbot&lt;/code&gt;的自动续期功能，所以我啥时候想起来了就手动更新下证书。我这人比较佛系，证书过期也在所难免。所幸更新证书比较简单，&lt;code&gt;certbot --certonly renew&lt;/code&gt;就搞定了。&#xA;出乎意料的是，这次更新完证书后nginx报错&lt;code&gt;nginx: configuration file /etc/nginx/nginx.conf test failed&lt;/code&gt;。真奇怪，&lt;code&gt;certbot&lt;/code&gt;仅仅是生成公私钥对，并不会更改nginx的配置；而我自己也好几年没动过nginx了，到底是怎么回事？&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>记一次kernel panic调试</title>
      <link>https://verrickt.github.io/posts/debug-a-kernel-panic-caused-by-lock-ordering/</link>
      <pubDate>Thu, 28 Jul 2022 16:31:38 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/debug-a-kernel-panic-caused-by-lock-ordering/</guid>
      <description>&lt;p&gt;「一杯茶一包烟，一个BUG调一天」—— 题记&lt;/p&gt;&#xA;&lt;p&gt;最近在做MIT 6.S081的Lab Locks的Buffer cache，大致要求是实现一个LRU缓存队列，用于文件系统的块缓存(block cache)，在保证线程安全的前提下尽可能的实现高吞吐量。&lt;br&gt;&#xA;实验给原始代码是基于双向链表的LRU队列，用了一个自旋锁保护链表和其中所有元素的值，可想而知这个自旋锁的竞争非常激烈&#xA;实验给了很多提示，比如将缓存改成哈希表，用链地址解决冲突；给每个bucket配一个锁，不同bucket里的元素互不影响，可以并发执行；用时间戳记录访问时间，避免反向遍历；&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>逃出「Driver Verifier」导致的无限蓝屏</title>
      <link>https://verrickt.github.io/posts/escape-verifier-boot-loop/</link>
      <pubDate>Sun, 27 Mar 2022 12:00:44 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/escape-verifier-boot-loop/</guid>
      <description>&lt;h2 id=&#34;没啥用的前言&#34;&gt;没啥用的前言&lt;/h2&gt;&#xA;&lt;p&gt;我的电脑自从买来就故障不断，无故卡死、无故蓝屏、自动重启。好在频率都不高，忍一忍凑合用。最近一段时间蓝屏的频率激增到了忍无可忍的地步，作为一个Geek，我自然要想办法排查一下原因。蓝屏最常见的错误码是&lt;code&gt;KMODE_EXCEPTION_NOT_HANDLED&lt;/code&gt;,&lt;code&gt;IRQL_LESS_OR_NOT_EQUAL&lt;/code&gt;,&lt;code&gt;PAGE_FAULT_IN_NONPAGED_AREA&lt;/code&gt;,这将凶手指向了驱动。然而「Windows Debugger」却分析不到可疑的驱动，有几次分析甚至将故障原因指向硬件。这让找真凶的过程异常艰难。好在微软提供了一个自带工具「Driver Verifier」，它可以检测驱动程序在运行过程中存在的问题，这给“查案”带来了一丝转机。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Powershell、Github Actions、环境变量踩坑</title>
      <link>https://verrickt.github.io/posts/pwsh-github-actions-env-var-pit-fall/</link>
      <pubDate>Tue, 19 Oct 2021 10:51:23 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pwsh-github-actions-env-var-pit-fall/</guid>
      <description>&lt;h2 id=&#34;没用的前言&#34;&gt;没用的前言&lt;/h2&gt;&#xA;&lt;p&gt;最近做了一个AI安全会议的&lt;a href=&#34;https://github.com/Verrickt/ccf-deadlines&#34;&gt;倒计时网站&lt;/a&gt;，核心思想类似MVVM：开发者维护一份人类可读的&lt;code&gt;yml&lt;/code&gt;，网站则根据这些&lt;code&gt;yml&lt;/code&gt;生成对应HTML。开发和维护都比较友好，构建也有脚本自动化&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$dest_dir = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;./public&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$dest_dir = Join-Path $dest_dir &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;conference&amp;#39;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New-Item -Type dir $dest_dir -Force&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Copy-Item -Path &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;./conference/types.yml&amp;#39;&lt;/span&gt; -Destination (Join-Path $dest_dir &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;types.yml&amp;#39;&lt;/span&gt;) -Force&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$all_yml = Get-Content &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;./conference/*/*.yml&amp;#39;&lt;/span&gt; -Encoding UTF8&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Set-Content -Path (Join-Path $dest_dir &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;allconf.yml&amp;#39;&lt;/span&gt;) $all_yml -Encoding UTF8 -Force&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$updated_by = git config user.name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$updated_by = $updated_by.trim()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$last_updated = Get-ChildItem -Path(Join-Path $dest_dir &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;allconf.yml&amp;#39;&lt;/span&gt;) | select LastWriteTimeUtc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$content = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$($last_updated.LastWriteTimeUtc)&lt;span style=&#34;color:#e6db74&#34;&gt;,&lt;/span&gt;$($updated_by)&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Set-Content -Path (Join-Path $dest_dir &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;last_updated.json&amp;#39;&lt;/span&gt;) $content -Encoding UTF8 -Force&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Write-Host $content&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;唯一剩下的麻烦只有下部署了：&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使VSCode的中的Jupyter Notebook访问同conda环境下的依赖</title>
      <link>https://verrickt.github.io/posts/access-packages-from-jupyter--in-the-same-conda-environment-in-vscode/</link>
      <pubDate>Sat, 16 Jan 2021 15:33:16 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/access-packages-from-jupyter--in-the-same-conda-environment-in-vscode/</guid>
      <description>&lt;p&gt;作为Python的一个依赖管理工具，Anaconda实现了Pip「全局安装」和virtualenv「本地安装」的折衷，它使用「按名访问」的方式实现环境的隔离，使使用者能够灵活的隔离和共享环境。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用SJTU的Anaconda镜像</title>
      <link>https://verrickt.github.io/posts/conda-mirror-from-sjtu/</link>
      <pubDate>Sat, 12 Dec 2020 14:07:56 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/conda-mirror-from-sjtu/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://mirrors.tuna.tsinghua.edu.cn/&#34;&gt;清华&lt;/a&gt;的Anaconda镜像在华东地区是好是坏，好的时候一切顺利，坏的时候一个24K的包下5分钟；Anaconda的官方源则更惨，连repo.json都下不下来；&lt;br&gt;&#xA;今天又是清华的源大姨妈的一天：Pytorch下载到100MB就超时，折腾了三个小时也装不上。而同在华东的&lt;a href=&#34;https://mirrors.sjtug.sjtu.edu.cn/&#34;&gt;SJTU&lt;/a&gt;的镜像就很稳定，这次全线换成SJTU啦。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;首先执行&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;conda config --set show_channel_urls yes&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;在&lt;code&gt;/usr&lt;/code&gt;下生成&lt;code&gt;.condarc&lt;/code&gt;文件，然后将其内容替换为&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>半监督学习</title>
      <link>https://verrickt.github.io/posts/semi-supervised-learning/</link>
      <pubDate>Tue, 04 Aug 2020 15:27:52 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/semi-supervised-learning/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的是台湾大学2020机器学习&lt;a href=&#34;https://youtu.be/fX_guE7JNnY&#34;&gt;Semi-supervised leraning&lt;/a&gt;的笔记。奉行&lt;a href=&#34;why-semi-supervised.png&#34;&gt;Lazy evaluation&lt;/a&gt;策略，对这些知识更深层次的探究只在&lt;strong&gt;绝对必要&lt;/strong&gt;时完成。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;现在是所谓的大数据时代，每人每天产生的数据成千上万。对商业公司来说，数据的收集已经不是问题，但给数据添加标记的工作因为其所需要消耗的人力物力成为老大难问题；而在机器学习中，带标记数据的不足会给模型引入bias。一个很自然的想法是，能不能用这些不带标记的数据来提高模型的泛化性能呢？答案是肯定的。这就是半监督学习。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>支持向量机</title>
      <link>https://verrickt.github.io/posts/support-vector-machine/</link>
      <pubDate>Fri, 31 Jul 2020 19:49:52 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/support-vector-machine/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;支持向量机(Support Vector Machine,SVM)是一个能求解通用二元分类问题的模型。SVM使用Kernel trick，使得自己在能够表示非线性函数的同时Loss是有闭式解的Convex function。也有人把SVM当作线性模型向神经网络过渡的中间阶段。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>主成分分析</title>
      <link>https://verrickt.github.io/posts/principal-component-analysis/</link>
      <pubDate>Fri, 31 Jul 2020 19:49:41 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/principal-component-analysis/</guid>
      <description>&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;p&gt;主成分分析(Principal component analysis,PCA)是一种常用的无监督学习算法。经过PCA后的数据会在它所处理的维度上会不相关(decorelation)。 而PCA所选的维度又通常比本来的维度要小，因此也可以用来做降维处理。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用CUDA为Tensorflow加速</title>
      <link>https://verrickt.github.io/posts/gpu-accelerated-tranining-with-cuda/</link>
      <pubDate>Tue, 28 Jul 2020 21:39:05 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/gpu-accelerated-tranining-with-cuda/</guid>
      <description>&lt;p&gt;梯度下降法大部分时间都在进行向量和矩阵运算。这些运算是天然可以并行化的。因此使用GPU进行运算会比CPU运算快得多。而常用的框架Tensorflow就通过CUDA提供了GPU运算的支持。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>循环神经网络</title>
      <link>https://verrickt.github.io/posts/recurrent-neural-network/</link>
      <pubDate>Thu, 23 Jul 2020 18:21:45 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/recurrent-neural-network/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;p&gt;Recurrent Neural network(RNN)是一种专门处理序列的神经网络。正如CNN可以轻易地处理大规模的“网格状”数据，RNN能够处理其他网络架构都无法处理的长的序列。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>卷积神经网络</title>
      <link>https://verrickt.github.io/posts/convolutional-neural-network/</link>
      <pubDate>Sat, 18 Jul 2020 19:31:16 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/convolutional-neural-network/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;p&gt;任何一个机器学习的任务都可以被拆解为三步&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;找到一组函数(model)&lt;/li&gt;&#xA;&lt;li&gt;找到评价函数好坏的标准(loss)&lt;/li&gt;&#xA;&lt;li&gt;找出最好的函数(optimization)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;这三步在神经网络中同样成立。但在神经网络中，要找的不是一组函数，而是一种网络架构(architecture)。本文中的卷积神经网络(CNN)就是一种网络架构&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>神经网络中的Regularization</title>
      <link>https://verrickt.github.io/posts/regularization-of-neural-network/</link>
      <pubDate>Wed, 15 Jul 2020 10:22:44 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/regularization-of-neural-network/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;p&gt;Deep learning algorithms are typically applied to extremely complicated domains where the true generation process essentially involves simulating the entire universe&amp;hellip; Controlling the complexity of the model is not a simple matter of finding the model of the right size, with the right number of parameters. Instead, we might find—and indeed in practical deep learning scenarios, we almost always do find—that the best fitting model (in the sense of minimizing generalization error) is a large model that has been regularized appropriately&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>后向传播-进阶版的梯度下降算法</title>
      <link>https://verrickt.github.io/posts/back-propagation-gradient-descent-improved/</link>
      <pubDate>Sat, 11 Jul 2020 11:21:40 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/back-propagation-gradient-descent-improved/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;p&gt;本文是&lt;a href=&#34;http://speech.ee.ntu.edu.tw/~tlkagk/courses_ML20.html&#34;&gt;NTU ML 2020&lt;/a&gt;中&lt;a href=&#34;https://youtu.be/Dr-WRlEFefw&#34;&gt;BackPropagation&lt;/a&gt;部分的笔记。&lt;/p&gt;&#xA;&lt;p&gt;梯度下降是非常常用的优化算法。而在深度学习中，一个神经网络的参数动辄几百万，像线性模型那样人手工算好再告诉机器的方式已经不合适了，需要一种更高效的算法来计算梯度。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>从分类到对率回归再到到神经网络</title>
      <link>https://verrickt.github.io/posts/from-logistic-regression-to-neural-network/</link>
      <pubDate>Sat, 04 Jul 2020 22:01:07 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/from-logistic-regression-to-neural-network/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的是台湾大学2020机器学习的Classification&lt;a href=&#34;https://youtu.be/fZAZUYEeIMg&#34;&gt;1&lt;/a&gt;和&lt;a href=&#34;https://youtu.be/hSXFuypLukA&#34;&gt;2&lt;/a&gt;的笔记，奉行&lt;a href=&#34;https://en.wikipedia.org/wiki/Lazy_evaluation&#34;&gt;Lazy evaluation&lt;/a&gt;策略，对这些知识更深层次的探究只在&lt;strong&gt;绝对必要&lt;/strong&gt;时完成。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;h2 id=&#34;分类&#34;&gt;分类&lt;/h2&gt;&#xA;&lt;p&gt;在分类问题，我们要找一个函数f，f的输入是代表样本的向量，输出是一个代表类别的标量。将样本分为两类的叫做二元分类，多于两类的叫做多元分类。我们先考虑二元分类问题。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>机器学习基础——纸上谈兵</title>
      <link>https://verrickt.github.io/posts/machine-learning-in-pure-paperworks/</link>
      <pubDate>Fri, 03 Jul 2020 21:29:45 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/machine-learning-in-pure-paperworks/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的主体是Ian Goodfellow 「Deep Learning」第五章「MACHINE LEARNING BASICS」，未经动手实做，故称纸上谈兵。目前奉行&lt;a href=&#34;https://en.wikipedia.org/wiki/Lazy_evaluation&#34;&gt;Lazy evaluation&lt;/a&gt;，对相关知识的补充会在实践后进行。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>机器学习基础——数值计算</title>
      <link>https://verrickt.github.io/posts/machine-learning-basics-numerical-computation/</link>
      <pubDate>Sun, 28 Jun 2020 11:00:27 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/machine-learning-basics-numerical-computation/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的主体是机器学习中所用到的数值计算知识，因此奉行&lt;a href=&#34;https://en.wikipedia.org/wiki/Lazy_evaluation&#34;&gt;Lazy evaluation&lt;/a&gt;，对这些知识更深层次的探究只在&lt;strong&gt;绝对必要&lt;/strong&gt;时完成。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;h2 id=&#34;source-of-errors&#34;&gt;Source of errors&lt;/h2&gt;&#xA;&lt;h3 id=&#34;overflow-and-underflow&#34;&gt;Overflow and Underflow&lt;/h3&gt;&#xA;&lt;p&gt;计算机的内存是有限的，而有限的内存上无法实现无限精度的数值计算，因此数值计算是有误差的。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>机器学习基础——概率论与信息论</title>
      <link>https://verrickt.github.io/posts/machine-learning-basics-probability-and-information-theory/</link>
      <pubDate>Fri, 26 Jun 2020 22:25:05 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/machine-learning-basics-probability-and-information-theory/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的主体是机器学习中所用到的概率论知识，因此奉行&lt;a href=&#34;https://en.wikipedia.org/wiki/Lazy_evaluation&#34;&gt;Lazy evaluation&lt;/a&gt;，对这些知识更深层次的探究只在&lt;strong&gt;绝对必要&lt;/strong&gt;时完成。本文假设你学过《概率论与数理统计》，仅指出花书的现有定义的不同，同时补充花书中特有的知识&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>机器学习基础——线性代数</title>
      <link>https://verrickt.github.io/posts/machine-learning-basics-linear-algebra/</link>
      <pubDate>Wed, 24 Jun 2020 09:38:56 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/machine-learning-basics-linear-algebra/</guid>
      <description>&lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML&#39; async&gt;&lt;/script&gt;&#xD;&#xA;&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;本文的主体是机器学习中所用到的线性代数知识，因此奉行&lt;a href=&#34;https://en.wikipedia.org/wiki/Lazy_evaluation&#34;&gt;Lazy evaluation&lt;/a&gt;，对这些知识更深层次的探究只在&lt;strong&gt;绝对必要&lt;/strong&gt;时完成。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;h2 id=&#34;concepts&#34;&gt;Concepts&lt;/h2&gt;&#xA;&lt;h3 id=&#34;tensor&#34;&gt;Tensor&lt;/h3&gt;&#xA;&lt;p&gt;矩阵是向量的延申，而Tensor(张量)则是矩阵的延申。&#xA;向量可用一维数组表示，矩阵可用二维数组表示，而张量可用三维数组表示。&#xA;表示张量A的一个分量&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>HTML渲染为UWP的原生控件</title>
      <link>https://verrickt.github.io/posts/render-html-natively-in-uwp/</link>
      <pubDate>Tue, 21 Apr 2020 21:24:32 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/render-html-natively-in-uwp/</guid>
      <description>&lt;h3 id=&#34;没啥用的前言&#34;&gt;没啥用的前言&lt;/h3&gt;&#xA;&lt;p&gt;说着再做UWP就剁手，我还是开了一个新坑🤣&#xA;这次是&lt;a href=&#34;http://bog.ac&#34;&gt;B岛&lt;/a&gt;的&lt;a href=&#34;https://github.com/Verrickt/BogNMB.UWP&#34;&gt;UWP端&lt;/a&gt;&#xA;论坛客户端的一个老大难问题是内容的呈现。论坛一般以网页端为主，网页做好，论坛活跃起来后之后才会开发客户端/有开发者愿意做第三方的客户端。因此，API绝大多数情况是为网页端为一等公民的。此外，各个UI框架展示内容的格式也各有不同。以上两个原因导致HTML被选做富文本展示的通用语言。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1097 Deduplication on a Linked List</title>
      <link>https://verrickt.github.io/posts/pat-1097-deduplication-on-a-linked-list/</link>
      <pubDate>Fri, 03 Apr 2020 13:31:51 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1097-deduplication-on-a-linked-list/</guid>
      <description>&lt;h2 id=&#34;deduplication-on-a-linked-list&#34;&gt;Deduplication on a Linked List&lt;/h2&gt;&#xA;&lt;p&gt;Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or absolute value of its key equals K will be kept. At the mean time, all the removed nodes must be kept in a separate list. For example, given L being &lt;code&gt;21→-15→-15→-7→15&lt;/code&gt;, you must output &lt;code&gt;21→-15→-7&lt;/code&gt;, and the removed list &lt;code&gt;-15→15&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1021 Deepest Root</title>
      <link>https://verrickt.github.io/posts/pat-1021-deepest-root/</link>
      <pubDate>Mon, 23 Mar 2020 21:32:29 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1021-deepest-root/</guid>
      <description>&lt;h2 id=&#34;deepest-root&#34;&gt;Deepest Root&lt;/h2&gt;&#xA;&lt;p&gt;A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root is called &lt;strong&gt;the deepest root.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;&lt;strong&gt;Input Specification&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Each input file contains one test case. For each case, the first line contains a positive integer N (≤10​^4​​) which is the number of nodes, and hence the nodes are numbered from 1 to N. Then N−1 lines follow, each describes an edge by given the two adjacent nodes&amp;rsquo; numbers.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>重学「冒泡排序」</title>
      <link>https://verrickt.github.io/posts/yeah-that-naive-bubble-sort/</link>
      <pubDate>Tue, 17 Mar 2020 14:22:12 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/yeah-that-naive-bubble-sort/</guid>
      <description>&lt;p&gt;PAT里链表题有各式各样的&lt;a href=&#34;https://www.liuchuo.net/archives/2116&#34;&gt;骚操作&lt;/a&gt;。这些非常规操作易学易用，但是习惯了这些后，反而对题目真正想考察的知识生疏了。今天就碰到一道这样的题，想用正经的算法写却写不出来。希望大家以我为戒，不要过多的学习这些「奇技淫巧」&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805425780670464&#34;&gt;Linked List Sorting&lt;/a&gt;这道题很常规，是个很一般的链表排序题。链表不能随机访问，因此算法上的选择限制很大，只有冒泡、插入、选择排序可以选。我选了冒泡练手，没想到没做出来。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT-1038 Recover the Smallest Number</title>
      <link>https://verrickt.github.io/posts/pat-1038-recover-the-smallest-number/</link>
      <pubDate>Mon, 16 Mar 2020 12:04:00 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1038-recover-the-smallest-number/</guid>
      <description>&lt;h1 id=&#34;recover-the-smallest-number&#34;&gt;Recover the Smallest Number&lt;/h1&gt;&#xA;&lt;p&gt;Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given &lt;code&gt;{ 32, 321, 3214, 0229, 87 }&lt;/code&gt;, we can recover many numbers such like &lt;code&gt;32-321-3214-0229-87&lt;/code&gt; or &lt;code&gt;0229-32-87-321-3214&lt;/code&gt; with respect to different orders of combinations of these segments, and the smallest number is &lt;code&gt;0229-321-3214-32-87&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;&lt;strong&gt;Input Specification&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Each input file contains one test case. Each case gives a positive integer N (≤10​^4​​) followed by N number segments. Each segment contains a non-negative integer of no more than 8 digits. All the numbers in a line are separated by a space.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1007 Maximum Subsequence Sum</title>
      <link>https://verrickt.github.io/posts/pat-1007-maximum-subsequence-sum/</link>
      <pubDate>Wed, 11 Mar 2020 22:12:04 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1007-maximum-subsequence-sum/</guid>
      <description>&lt;h2 id=&#34;maximum-subsequence-sum&#34;&gt;Maximum Subsequence Sum&lt;/h2&gt;&#xA;&lt;p&gt;Given a sequence of K integers { N​1​​, N​2​​, &amp;hellip;, N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, &amp;hellip;, N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, given sequence { -2, 11, -4, 13, -5, -2 }, its maximum subsequence is { 11, -4, 13 } with the largest sum being 20.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>「C&#43;&#43;」踩坑</title>
      <link>https://verrickt.github.io/posts/cpp-the-double-edged-sword/</link>
      <pubDate>Wed, 21 Aug 2019 22:41:50 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/cpp-the-double-edged-sword/</guid>
      <description>&lt;p&gt;因为PAT刷题的缘故,开始再次接触C++.用过OOP语言再回来用C十分不习惯,C++就顺手多了.C没有泛型,字符串也不好用,C++就好多了,STL的容器和模板完美结合,字符串类也堪用.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Head of a Gang</title>
      <link>https://verrickt.github.io/posts/pat-1034-head-of-a-gang/</link>
      <pubDate>Tue, 20 Aug 2019 14:22:48 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1034-head-of-a-gang/</guid>
      <description>&lt;h2 id=&#34;head-of-a-gang&#34;&gt;Head of a gang&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805456881434624&#34;&gt;Head of a Gang&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;One way that the police finds the head of a gang is to check people&amp;rsquo;s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined to be the total time length of all the phone calls made between the two persons. A &amp;ldquo;Gang&amp;rdquo; is a cluster of more than 2 persons who are related to each other with total relation weight being greater than a given threthold K. In each gang, the one with maximum total weight is the head. Now given a list of phone calls, you are supposed to find the gangs and the heads.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>1018 Public Bike Management</title>
      <link>https://verrickt.github.io/posts/pat-1018-public-bike-management/</link>
      <pubDate>Fri, 16 Aug 2019 22:50:47 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1018-public-bike-management/</guid>
      <description>&lt;h2 id=&#34;public-bike-management&#34;&gt;Public Bike Management&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805489282433024&#34;&gt;1018 Public Bike Management&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the city.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;The Public Bike Management Center (PBMC) keeps monitoring the real-time capacity of all the stations. A station is said to be in perfect condition if it is exactly half-full. If a station is full or empty, PBMC will collect or send bikes to adjust the condition of that station to perfect. And more, all the stations on the way will be adjusted as well.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>回顾排队问题</title>
      <link>https://verrickt.github.io/posts/queueing-problem-revisited/</link>
      <pubDate>Fri, 16 Aug 2019 22:27:51 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/queueing-problem-revisited/</guid>
      <description>&lt;p&gt;刷PAT的过程中遇到了两类排队问题,这里总结一下&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;所有人在同一时刻到达,如&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805498207911936&#34;&gt;1014 Waiting in Line&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;每个人到达的时刻不同,如&lt;a href=&#34;(https://pintia.cn/problem-sets/994805342720868352/problems/994805491530579968)&#34;&gt;1017 Queueing at Bank&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;解决这类问题一个比较好的思路是递推.&#xA;对同一时刻到达的问题,可以每个窗口设置&lt;code&gt;front&lt;/code&gt;和&lt;code&gt;rear&lt;/code&gt;两个变量,分别表示队首和队尾离队时间.&lt;code&gt;front&lt;/code&gt;值最小的队列就是应该插入的队列.入队元素的离队时间可以由&lt;code&gt;rear+=current.duration&lt;/code&gt;递推给出.队首元素离队后,原来第二个元素成为新的队首元素.更新&lt;code&gt;front+=header.duration&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1014 Waiting in Line</title>
      <link>https://verrickt.github.io/posts/pat-1014-waiting-in-line/</link>
      <pubDate>Wed, 14 Aug 2019 20:56:09 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1014-waiting-in-line/</guid>
      <description>&lt;h2 id=&#34;waiting-in-line&#34;&gt;Waiting in Line&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805498207911936&#34;&gt;1014 Waiting in Line&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The space inside the yellow line in front of each window is enough to contain a line with M customers. Hence when all the N lines are full, all the customers after (and including) the (NM+1)st one will have to wait in a line behind the yellow line.&lt;/li&gt;&#xA;&lt;li&gt;Each customer will choose the shortest line to wait in when crossing the yellow line. If there are two or more lines with the same length, the customer will always choose the window with the smallest number.&lt;/li&gt;&#xA;&lt;li&gt;Customer&lt;code&gt;​i&lt;/code&gt;​​ will take T​i​​ minutes to have his/her transaction processed.&lt;/li&gt;&#xA;&lt;li&gt;The first N customers are assumed to be served at 8:00am.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now given the processing time of each customer, you are supposed to tell the exact time at which a customer has his/her business done.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Molecule to atoms</title>
      <link>https://verrickt.github.io/posts/molecule-to-atoms/</link>
      <pubDate>Thu, 08 Aug 2019 22:57:35 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/molecule-to-atoms/</guid>
      <description>&lt;p&gt;同学发过来一道有意思的题&lt;/p&gt;&#xA;&lt;p&gt;For a given chemical formula represented by a string, count the number of atoms of each element contained in the molecule and return an object (&lt;code&gt;associative array&lt;/code&gt; in PHP, &lt;code&gt;Dictionary&amp;lt;string, int&amp;gt;&lt;/code&gt; in C#, &lt;code&gt;Map&amp;lt;String,Integer&amp;gt;&lt;/code&gt; in Java).&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;water&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;H2O&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;parseMolecule&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;water&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// return {H: 2, O: 1}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;magnesiumHydroxide&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Mg(OH)2&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;parseMolecule&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;magnesiumHydroxide&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// return {Mg: 1, O: 2, H: 2}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;fremySalt&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;K4[ON(SO3)2]2&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;parseMolecule&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;fremySalt&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// return {K: 4, O: 14, N: 2, S: 4}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, some formulas have brackets in them. The index outside the brackets tells you that you have to multiply count of each atom inside the bracket on this index. For example, in Fe(NO3)2 you have one iron atom, two nitrogen atoms and six oxygen atoms.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1003 Emergency</title>
      <link>https://verrickt.github.io/posts/pat-1003-emergency/</link>
      <pubDate>Thu, 08 Aug 2019 22:10:09 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1003-emergency/</guid>
      <description>&lt;h2 id=&#34;emergency&#34;&gt;Emergency&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805523835109376&#34;&gt;1003 Emergency&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are marked on the map. When there is an emergency call to you from some other city, your job is to lead your men to the place as quickly as possible, and at the mean time, call up as many hands on the way as possible.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PAT 1004 Counting Leaves</title>
      <link>https://verrickt.github.io/posts/pat-1004-counting-leaves/</link>
      <pubDate>Mon, 05 Aug 2019 14:56:39 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/pat-1004-counting-leaves/</guid>
      <description>&lt;h2 id=&#34;counting-leaves&#34;&gt;Counting Leaves&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pintia.cn/problem-sets/994805342720868352/problems/994805521431773184&#34;&gt;1004 Counting Leaves&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;&lt;strong&gt;Input Specification:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Each input file contains one test case. Each case starts with a line containing 0&amp;lt;N&amp;lt;100, the number of nodes in a tree, and M (&amp;lt;N), the number of non-leaf nodes. Then M lines follow, each in the format:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>异常-控制流的突变</title>
      <link>https://verrickt.github.io/posts/exception-the-abnormal-control-flow/</link>
      <pubDate>Mon, 08 Jul 2019 19:10:02 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/exception-the-abnormal-control-flow/</guid>
      <description>&lt;h1 id=&#34;什么是异常&#34;&gt;什么是异常&lt;/h1&gt;&#xA;&lt;p&gt;「现代操作系统」和国内的教材都没有讲清楚「中断、异常」这一组概念，再加上自己懒，一直没弄出个所以然，今天看了CSAPP上的解释，醍醐灌顶。&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;p&gt;对于特定的进程来说，程序计数器按照时间升序所得的序列反映了指令的执行顺序，即控制流。理论上说，程序的控制流在编译期就已经决定。而实际中，经常会出现一些需要暂停执行当前程序，而转去处理更高优先级任务的情况。在这个过程中，程序的控制流就发生了改变。CSAPP中把控制流的&lt;strong&gt;非自愿&lt;/strong&gt;改变定义为异常。强调&lt;strong&gt;非自愿&lt;/strong&gt;，是因为程序自己也可以改变控制流，但那不属于异常。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>FluentTreeView Part.5</title>
      <link>https://verrickt.github.io/posts/fluent-treeview-part5/</link>
      <pubDate>Fri, 19 Apr 2019 21:18:17 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/fluent-treeview-part5/</guid>
      <description>&lt;h2 id=&#34;递归高亮&#34;&gt;递归高亮&lt;/h2&gt;&#xA;&lt;p&gt;先来修正选择高亮的问题吧。我更愿意图片中的效果称为递归高亮。递归高亮可以看作是子节点都处于非递归高亮状态。这么想的话实现起来应该非常容易。但我希望FluentTreeView能够更灵活一些。最好通过属性来切换高亮模式。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>FluentTreeView Part.4</title>
      <link>https://verrickt.github.io/posts/fluent-treeview-part4/</link>
      <pubDate>Fri, 19 Apr 2019 17:20:45 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/fluent-treeview-part4/</guid>
      <description>&lt;p&gt;这篇起我们正式开始实现FluentTreeView。先看看图片&#xA;&lt;img src=&#34;fluent-tree-view.jpg&#34; alt=&#34;FluentTreeView&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;TreeView左侧有一选择高亮，Item有一鼠标高亮。这两个高亮与整个TreeView一样宽。&#xA;再回想一下我们上一篇用Expander实现的TreeView，Item的缩进是如何实现的？&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>FluentTreeView Part.3</title>
      <link>https://verrickt.github.io/posts/fluent-treeview-part3/</link>
      <pubDate>Fri, 19 Apr 2019 15:22:06 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/fluent-treeview-part3/</guid>
      <description>&lt;p&gt;上一篇中我们用数据驱动界面的方式使用了TreeView。这一篇我们稍稍改一改TreeView的样式。把TreeView表示节点可以展开的小三角替换成Expander是个不错的开始。既能复习TreeView的可视化树，又避免步子太大扯到蛋。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>FluentTreeView Part.2</title>
      <link>https://verrickt.github.io/posts/fluent-treeview-part2/</link>
      <pubDate>Fri, 19 Apr 2019 14:18:40 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/fluent-treeview-part2/</guid>
      <description>&lt;h2 id=&#34;使用treeview&#34;&gt;使用TreeView&lt;/h2&gt;&#xA;&lt;p&gt;上次说到了TreeView具有递归的结构，而在WPF中是数据驱动界面，这就要求我们的数据源也具有一定的递归结构&lt;/p&gt;&#xA;&lt;!-- more --&gt;&#xD;&#xA;&lt;h3 id=&#34;数据的准备&#34;&gt;数据的准备&lt;/h3&gt;&#xA;&lt;p&gt;按照数据源是否可以继续展开下去，我们将数据源定义为两个ViewModel:&lt;code&gt;TreeNodeVM&lt;/code&gt;,&lt;code&gt;TreeLeafVM&lt;/code&gt;，其中&lt;code&gt;TreeNodeVM&lt;/code&gt;作为树的中间节点出现，其下可继续出现中间节点和叶子节点，&lt;code&gt;TreeLeafVM&lt;/code&gt;作为树的叶子节点出现，不能再出现其他节点。&lt;code&gt;TreeNodeVM&lt;/code&gt;中的子节点的个数是不定的，所以应该由集合表示。而&lt;code&gt;TreeNodeVM&lt;/code&gt;的子节点可能是&lt;code&gt;TreeNodeVM&lt;/code&gt;和&lt;code&gt;TreeLeafVM&lt;/code&gt;的任意一种，这就需要他们有一个公共的父类。这给我们如下的数据定义:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>FluentTreeView Part.1</title>
      <link>https://verrickt.github.io/posts/fluent-treeview-part1/</link>
      <pubDate>Fri, 19 Apr 2019 09:51:10 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/fluent-treeview-part1/</guid>
      <description>&lt;h2 id=&#34;itemscontrol&#34;&gt;ItemsControl&lt;/h2&gt;&#xA;&lt;p&gt;有时需要呈现一组逻辑上&lt;strong&gt;平级&lt;/strong&gt;的控件，他们可以是一个列表，也可以是一个网格；可以横向排列，也可以纵向排列；数量可以固定，也可以按需加载；普通控件的组合无能为力。所以，我们需要新的工具。&lt;code&gt;ItemsControl&lt;/code&gt;应运而生。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>获取程序的编译时间</title>
      <link>https://verrickt.github.io/posts/get-link-time-from-csharp/</link>
      <pubDate>Mon, 22 Oct 2018 23:16:44 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/get-link-time-from-csharp/</guid>
      <description>&lt;h2 id=&#34;日常新需求&#34;&gt;日常新需求&lt;/h2&gt;&#xA;&lt;p&gt;新的需求又来了。这次是程序在编译后6个月拒绝启动。BETA性质的软件都有类似的需求。但大部分软件要么是启动时检查更新，要么是联网判断是否过期。对于我们现在做的这个小工具太小题大做了。根据编译时间判断过期的需求看似奇葩，也是有点道理的。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用MSBuild编写构建脚本</title>
      <link>https://verrickt.github.io/posts/build-script-with-msbuild/</link>
      <pubDate>Thu, 30 Aug 2018 23:05:54 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/build-script-with-msbuild/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;背景&lt;/h2&gt;&#xA;&lt;p&gt;项目需求变更，需要从一份代码里编译出好几个不同的版本。编译和部署的复杂度都成指数增加，简单的Release构建搞不定了，写构建脚本迫在眉睫。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Build a (partial) self-contained WPF application</title>
      <link>https://verrickt.github.io/posts/self-contained-wpf-application/</link>
      <pubDate>Tue, 31 Jul 2018 22:43:47 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/self-contained-wpf-application/</guid>
      <description>&lt;h2 id=&#34;巨人的肩膀&#34;&gt;巨人的肩膀&lt;/h2&gt;&#xA;&lt;p&gt;新事物的产生总是与老事物有千丝万缕的联系。或是从中得到启发，或是对其全面改良。新事物的源头通常可以追溯到很久远的一些概念上。因此有了「站在巨人的肩膀上」 这样的说法。在程序设计里面，「巨人们的肩膀」 就是我们的应用程序使用的库了。踩在这些「巨人」们的肩膀上我们的程序才得以重见天日；为了实现一个库，有时候会使用到其他的库。我们所依赖的「巨人」又踩在了其他「巨人」的肩膀上，把依赖关系变成了树状结构，我们的程序处在根节点。&lt;/p&gt;&#xA;&lt;p&gt;扯远了:)&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>引用类型的开销</title>
      <link>https://verrickt.github.io/posts/overhead-of-reference-types/</link>
      <pubDate>Thu, 19 Jul 2018 20:26:05 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/overhead-of-reference-types/</guid>
      <description>&lt;h2 id=&#34;值类型与引用类型&#34;&gt;值类型与引用类型&lt;/h2&gt;&#xA;&lt;p&gt;C#中的类型分为引用类型和值类型。使用&lt;code&gt;struct&lt;/code&gt;或&lt;code&gt;enum&lt;/code&gt;关键字修饰的类型定义是值类型，使用&lt;code&gt;class&lt;/code&gt;或&lt;code&gt;delegate&lt;/code&gt;关键字修饰的类型是引用类型。引用类型和值类型各有限制，分别适用于不同的场景。不同于C++，C#中的值类型只能分配在栈上*1，引用类型只能分配在GC堆上。C#中的GC是精确式GC，这就对GC堆上的指针有了一些要求。这是引用类型有开销的原因之一。&lt;/p&gt;&#xA;&lt;h2 id=&#34;sync-block-index-与-type-object-pointer&#34;&gt;Sync block index 与 Type object pointer&lt;/h2&gt;&#xA;&lt;p&gt;读过C# vir CLR的同学会知道，引用类型的开销是Sync blockindex和Type object pointer。他们的长度是都是一个字长。即在32位CLR上是4字节，在64位CLR上是8字节。Sync block index在CLR中是用于实现&lt;code&gt;lock&lt;/code&gt;,&lt;code&gt;Monitor&lt;/code&gt;等线程同步原语，Type object pointer是指向当前对象运行时类型信息的一个指针。Sync block index与Type object pointer只在CLR层面存在，对C#程序来说是透明的。但是CLR将它们暴封装后露C#，例如线程同步原语和反射API。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>面向抽象编程</title>
      <link>https://verrickt.github.io/posts/program-upon-abstractions/</link>
      <pubDate>Thu, 12 Jul 2018 21:56:26 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/program-upon-abstractions/</guid>
      <description>&lt;h1 id=&#34;preface&#34;&gt;Preface&lt;/h1&gt;&#xA;&lt;p&gt;说来惭愧，直到近几天才明白了一点面向对象设计的。给我带来启发的是&lt;a href=&#34;https://en.wikipedia.org/wiki/SOLID&#34;&gt;&lt;strong&gt;SOLID&lt;/strong&gt;&lt;/a&gt;中的D，它代表Dependency Inversion（依赖反转）。尽管写/背定义很无聊，但我还是想写一下依赖反转的核心&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>记一次愉(dan)快(teng)的捉虫</title>
      <link>https://verrickt.github.io/posts/hell-mode-debugging/</link>
      <pubDate>Mon, 21 May 2018 21:03:59 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/hell-mode-debugging/</guid>
      <description>&lt;h2 id=&#34;废话&#34;&gt;废话&lt;/h2&gt;&#xA;&lt;p&gt;BUG是任何软件都会遇到的问题。它通常是开发人员考虑问题不全面而埋下的隐形炸弹，在条件合适的时候就会爆炸；开发自己埋BUG往往比较容易除错，因为代码都是自己写的，定位问题后&lt;code&gt;git blame&lt;/code&gt;一下就可以甩锅了；而程序依赖项里的BUG则排查起来则让人一筹莫展，尤其是在没有足够多信息的情况。&lt;/p&gt;&#xA;&lt;p&gt;面对来自客户和QA的压力，绞尽脑汁仍无法定位问题开发们只能找借口了🤣&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It&amp;rsquo;s a feature,not a bug.&lt;/li&gt;&#xA;&lt;li&gt;That&amp;rsquo;s the design decision, so not a bug&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;我以前也遇到框架出问题的情况，不过都是自己改代码改出来的，倒也不是很难排查。但这次挖出来的BUG就完全不一样了&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>闭包，变量捕获与重入问题</title>
      <link>https://verrickt.github.io/posts/closure-and-re-entrance/</link>
      <pubDate>Thu, 08 Mar 2018 19:59:20 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/closure-and-re-entrance/</guid>
      <description>&lt;h2 id=&#34;问题描述&#34;&gt;问题描述&lt;/h2&gt;&#xA;&lt;p&gt;公司的APP，在断网后进行一个10秒的倒计时操作，每秒钟都会尝试重新联网。当秒数到0时又重新开始计时，倒计时在用户退出程序或者连上网络结束。&lt;/p&gt;&#xA;&lt;p&gt;按理说是个很简单的Case。QA却报过来个BUG，说APP状态由&lt;/p&gt;&#xA;&lt;p&gt;联网-&amp;gt;断网-&amp;gt;联网-&amp;gt;断网&lt;/p&gt;&#xA;&lt;p&gt;变化后，倒计时的秒数变为&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;9 3 8 2 7 1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;变得不连续了。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>HTTPClient 踩坑记</title>
      <link>https://verrickt.github.io/posts/httpclient-good-part-and-tipfalls/</link>
      <pubDate>Tue, 24 Oct 2017 19:43:28 +0000</pubDate>
      <author>Verrickt</author>
      <guid>https://verrickt.github.io/posts/httpclient-good-part-and-tipfalls/</guid>
      <description>&lt;p&gt;HttpClient是随着.Net framework 4.5一起发布的现代Http库。比起WebClient，HttpClient最大的优点就是&#xA;加入了C#5中的async/await异步方法的支持。async/await的坑暂且不表，今天就来说一说这个HttpClient&lt;/p&gt;&#xA;&lt;h2 id=&#34;httpclient的坑&#34;&gt;HttpClient的坑&lt;/h2&gt;&#xA;&lt;p&gt;HttpClient实现了IDisposable接口，很多小伙伴一看到IDisposeable接口就纷纷把HttpClient套在了using里边&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-csharp&#34; data-lang=&#34;csharp&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;//bad httpclient usage&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;using(&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; client = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; HttpClient())&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;//do stuffs&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这种用法是&lt;strong&gt;错误&lt;/strong&gt;的.HttpClient在设计之初被设计为一个可重用的对象，它的生命周期应该与应用程序相一致.上述错误的用法每发起一个请求就会创建一个新的HttpClient，并且在收到回复之后立即把HttpClient dispose掉。众所周知TCP连接在真正断开之前会有几分钟处于CLOSE_WAIT状态。这个状态下TCP链接并没有真正断开。短时间内大量发出Http请求会使系统可用的端口急剧消耗。&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
