<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>NotionNext BLOG</title>
        <link>https://blog.kinnnnnnnnnng.cn//</link>
        <description>这是一个由NotionNext生成的站点</description>
        <lastBuildDate>Tue, 31 Oct 2023 00:43:47 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2023, kk</copyright>
        <item>
            <title><![CDATA[使用IText+Freemarker生成PDF文件]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/38bad063-3707-473a-88b8-ba163765b6cf</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/38bad063-3707-473a-88b8-ba163765b6cf</guid>
            <pubDate>Tue, 20 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[使用IText+Freemarker生成PDF文件,简易代码示例]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-38bad0633707473a88b8ba163765b6cf"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-66cb93350454480ca5e700774ca4c8bb" data-id="66cb93350454480ca5e700774ca4c8bb"><span><div id="66cb93350454480ca5e700774ca4c8bb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#66cb93350454480ca5e700774ca4c8bb" title="背景"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">背景</span></span></h2><div class="notion-text notion-block-1f5bbccdb50c4de9a371e4cc02b532c0">最近公司有个打印文件的需求，既然是打印，为了格式统一肯定使用PDF文件比较好，查了一下JAVA中大部分是使用IText创建PDF的，学习了下他人的方法，最终实现根据Freemarker模板生成PDF的方法</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-97afea4f253f43488524396dd3b7cad9" data-id="97afea4f253f43488524396dd3b7cad9"><span><div id="97afea4f253f43488524396dd3b7cad9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#97afea4f253f43488524396dd3b7cad9" title="实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实现</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3a9e055713d444699407a010d08f728b" data-id="3a9e055713d444699407a010d08f728b"><span><div id="3a9e055713d444699407a010d08f728b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3a9e055713d444699407a010d08f728b" title="依赖"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>依赖</b></span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-8fe7df7554864c12945f9bf38482fe89" data-id="8fe7df7554864c12945f9bf38482fe89"><span><div id="8fe7df7554864c12945f9bf38482fe89" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8fe7df7554864c12945f9bf38482fe89" title="实际代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>实际代码</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-30b2d14c6bda4328af08943e0352f28b" data-id="30b2d14c6bda4328af08943e0352f28b"><span><div id="30b2d14c6bda4328af08943e0352f28b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30b2d14c6bda4328af08943e0352f28b" title="freemaker模板文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">freemaker模板文件</span></span></h4><div class="notion-text notion-block-624805bd6fa84b749cf82b8884499915">创建一个template.ftl，内容如下 ，可以使用freemaker语法做内容填充。 </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-62ea9fe5fc284a5aa8134d62dd424ade" data-id="62ea9fe5fc284a5aa8134d62dd424ade"><span><div id="62ea9fe5fc284a5aa8134d62dd424ade" class="notion-header-anchor"></div><a class="notion-hash-link" href="#62ea9fe5fc284a5aa8134d62dd424ade" title="模板转HTML"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">模板转HTML</span></span></h3><div class="notion-text notion-block-b5a9bc90a293424a960ee9de1fff756a">根据传入模板文件地址，将data数据进行填充，最后将html内容赋值到htmlTmp中</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3b0172904a8d4ac69fdeb9c65a1445d7" data-id="3b0172904a8d4ac69fdeb9c65a1445d7"><span><div id="3b0172904a8d4ac69fdeb9c65a1445d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3b0172904a8d4ac69fdeb9c65a1445d7" title="HTML转PDF文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">HTML转PDF文件</span></span></h3><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-79ae1fda0b4e4f498b13fe90f6d55e30" data-id="79ae1fda0b4e4f498b13fe90f6d55e30"><span><div id="79ae1fda0b4e4f498b13fe90f6d55e30" class="notion-header-anchor"></div><a class="notion-hash-link" href="#79ae1fda0b4e4f498b13fe90f6d55e30" title="测试"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">测试</span></span></h2><div class="notion-text notion-block-a9ec014df68a4787892264dd09445405">效果图</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-433d8b268b85492ca9ad0a107a717665"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F40d80979-d3e8-4a5c-b5c1-6caa372d79d8%2FSnipaste_2023-06-20_14-05-55.png?table=block&amp;id=433d8b26-8b85-492c-a9ad-0a107a717665" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-627ccc6b1ebf4698b6b98faf0058df06"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[proftpd 配置]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/ce6f975a-4a64-4ab5-85af-1b2c2d7d94d5</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/ce6f975a-4a64-4ab5-85af-1b2c2d7d94d5</guid>
            <pubDate>Fri, 07 Jul 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[proftpd 简单配置]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-ce6f975a4a644ab585af1b2c2d7d94d5"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-7302ac1b83e246c794d2969a825471d3" data-id="7302ac1b83e246c794d2969a825471d3"><span><div id="7302ac1b83e246c794d2969a825471d3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7302ac1b83e246c794d2969a825471d3" title="创建虚拟用户"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建虚拟用户</span></span></h2><ul class="notion-list notion-list-disc notion-block-d22b4477e034494381ea2c6e5cc808c9"><li>-passwd 密码</li></ul><ul class="notion-list notion-list-disc notion-block-525180279bd04592a7291f9fbcedb47b"><li>-file 校验的密码文件</li></ul><ul class="notion-list notion-list-disc notion-block-9a211a00830e419bae02f5f4fec3dd9c"><li>-name 用户名</li></ul><ul class="notion-list notion-list-disc notion-block-cc4a2b99a3ab4f588c2856a4ba614501"><li>-uid 用户 id，唯一，可以从 ftp.passwd 文件中查看</li></ul><ul class="notion-list notion-list-disc notion-block-ae4bd968a12f4af1a8804856cef82cd4"><li>-home 家文件</li></ul><ul class="notion-list notion-list-disc notion-block-abab7599e92748e0aad26ec127bab5d9"><li>-shell 不明</li></ul><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-b1ea2b9711ba47889b5a11354658ce57" data-id="b1ea2b9711ba47889b5a11354658ce57"><span><div id="b1ea2b9711ba47889b5a11354658ce57" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b1ea2b9711ba47889b5a11354658ce57" title="配置文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">配置文件</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-b3e481898ce745578a73af7877af8193" data-id="b3e481898ce745578a73af7877af8193"><span><div id="b3e481898ce745578a73af7877af8193" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b3e481898ce745578a73af7877af8193" title="权限控制说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">权限控制说明</span></span></h4><div class="notion-blank notion-block-0220212a34a2499f9cf424da610cb9d5"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pip临时使用镜像源]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/b2ae9094-c23d-47e8-a86d-2163018d69ea</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/b2ae9094-c23d-47e8-a86d-2163018d69ea</guid>
            <pubDate>Mon, 05 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[pip install 临时使用镜像源]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-b2ae9094c23d47e8a86d2163018d69ea"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-ad674b0eb7f24580beec7df78e9c0a98"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text"><b><b>pip临时使用镜像源</b></b></div></div><div class="notion-text notion-block-6900164715564df8b52e40cc674cf188">在使用pip的时候加参数<code class="notion-inline-code">-i </code><code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://pypi.tuna.tsinghua.edu.cn/simple">https://pypi.tuna.tsinghua.edu.cn/simple</a></code></div><div class="notion-text notion-block-f9a02c3c1b3343ec87bad8a1e09b6d59">国内镜像源:<div class="notion-text-children"><div class="notion-text notion-block-7c198275e6e4402fb328ca07ece7858d">清华：<code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://pypi.tuna.tsinghua.edu.cn/simple">https://pypi.tuna.tsinghua.edu.cn/simple</a></code></div><div class="notion-text notion-block-0074a23209f44848807ec6e40972923b">阿里云：<code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://mirrors.aliyun.com/pypi/simple/">http://mirrors.aliyun.com/pypi/simple/</a></code></div><div class="notion-text notion-block-a740887cc8e741bab29f3a448fb90265">豆瓣：<code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://pypi.douban.com/simple/">http://pypi.douban.com/simple/</a></code></div><div class="notion-text notion-block-a09fd868411b41cca02a8411ab236728">中国科技大学 <code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://pypi.mirrors.ustc.edu.cn/simple/">https://pypi.mirrors.ustc.edu.cn/simple/</a></code></div><div class="notion-text notion-block-fea89a9eb7a9464fb2e673b0ea02fc91">华中理工大学：<code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://pypi.hustunique.com/">http://pypi.hustunique.com/</a></code></div><div class="notion-text notion-block-110ddbd78f754b4d9d339eda6b47d440">山东理工大学：<code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://pypi.sdutlinux.org/">http://pypi.sdutlinux.org/</a></code></div></div></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ubuntu python升级]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/dae8bcce-2ce0-4490-b1a4-d7fd59e18b8e</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/dae8bcce-2ce0-4490-b1a4-d7fd59e18b8e</guid>
            <pubDate>Wed, 14 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[python升级]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-dae8bcce2ce04490b1a4d7fd59e18b8e"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-dfc04b6c849b48299f2e3eebda5b79c8" data-id="dfc04b6c849b48299f2e3eebda5b79c8"><span><div id="dfc04b6c849b48299f2e3eebda5b79c8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dfc04b6c849b48299f2e3eebda5b79c8" title="apt-get 更新列表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">apt-get 更新列表</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-f46aa03dc9ba4d7c9138f4f3906dc7df" data-id="f46aa03dc9ba4d7c9138f4f3906dc7df"><span><div id="f46aa03dc9ba4d7c9138f4f3906dc7df" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f46aa03dc9ba4d7c9138f4f3906dc7df" title="安装python3.8"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装python3.8</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-dda628bd250f4deab3e50ed555444e13" data-id="dda628bd250f4deab3e50ed555444e13"><span><div id="dda628bd250f4deab3e50ed555444e13" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dda628bd250f4deab3e50ed555444e13" title="切换python版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">切换python版本</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-7b42002c0f8b4d84acf59ab348d3115c" data-id="7b42002c0f8b4d84acf59ab348d3115c"><span><div id="7b42002c0f8b4d84acf59ab348d3115c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7b42002c0f8b4d84acf59ab348d3115c" title="查看python版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">查看python版本</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-adb497ede41b464093337b307f099fd5" data-id="adb497ede41b464093337b307f099fd5"><span><div id="adb497ede41b464093337b307f099fd5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#adb497ede41b464093337b307f099fd5" title="解决pip失效"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">解决pip失效</span></span></h3><div class="notion-blank notion-block-6e5c6aabc1a54744a57a8756c606a1ab"> </div><div class="notion-blank notion-block-518c3e6e916e424395e6b5362b3177c5"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List转Map]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/fee6a4e1-0d57-4638-bf71-82cec7842187</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/fee6a4e1-0d57-4638-bf71-82cec7842187</guid>
            <pubDate>Thu, 25 May 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[stream流 List转Map
转载至https://www.cnblogs.com/amberJava/p/12427777.html]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-fee6a4e10d574638bf7182cec7842187"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-608791fc586e47d9bab9ed49c3909173">1、指定key-value，value是<b>对象中的某个属性值</b>。</div><div class="notion-text notion-block-7935497a29e6430ea8a961f38aa28a2d">2、指定key-value，value是<b>对象本身</b>，User-&gt;User 是一个返回本身的lambda表达式</div><div class="notion-text notion-block-052a795d506440a3be733a10cbb3d094">3、指定key-value，value是对象本身，Function.identity()是简洁写法，也是返回对象本身</div><div class="notion-text notion-block-0f74e42070a744e3bfc7385b46c91fa2">4、指定key-value，value是对象本身，<b>Function.identity()是简洁写法，也是返回对象本身，key 冲突的解决办法，这里选择第二个key覆盖第一个key</b>。</div><div class="notion-text notion-block-f63fe0ffd6c74d1eb316fb002ab64413">5、指定key-value，value是List。</div><div class="notion-blank notion-block-a85315b3177b4272b64d90cc44c798f8"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[如何高效优雅的使用java枚举]]></title>
            <link>https://blog.kinnnnnnnnnng.cn//article/6e410d51-ea4e-4a13-9086-ff074a6dc7e2</link>
            <guid>https://blog.kinnnnnnnnnng.cn//article/6e410d51-ea4e-4a13-9086-ff074a6dc7e2</guid>
            <pubDate>Mon, 12 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[转载至 如何高效优雅的使用java枚举]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-6e410d51ea4e4a139086ff074a6dc7e2"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-5cb70d11a83946e89408a194e3b34af9"><div class="notion-page-icon-inline notion-page-icon-span"><img class="notion-page-icon" src="https://www.notion.so/icons/send-to_lightgray.svg?mode=light" alt="转载至 如何高效优雅的使用java枚举" loading="lazy" decoding="async"/></div><div class="notion-callout-text">转载至 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://mp.weixin.qq.com/s/CLr5bcxsG7C8v6qSsagEbw"><b>如何高效优雅的使用java枚举</b></a></div></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-32e5beb2a9ee4bc48685efea41ababcd" data-id="32e5beb2a9ee4bc48685efea41ababcd"><span><div id="32e5beb2a9ee4bc48685efea41ababcd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#32e5beb2a9ee4bc48685efea41ababcd" title="背景"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">背景</span></span></h2><div class="notion-text notion-block-1081764a7ba449a8b94e48890b9a78c7">枚举在系统中的地位不言而喻，状态、类型、场景、标识等等，少则十几个多则上百个，相信以下这段代码很常见，而且类似的代码到处都是，目标：消除这类冗余代码。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6a425f23008d41769b421dd7ed25eb61" data-id="6a425f23008d41769b421dd7ed25eb61"><span><div id="6a425f23008d41769b421dd7ed25eb61" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6a425f23008d41769b421dd7ed25eb61" title="枚举缓存"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">枚举缓存</span></span></h2><div class="notion-text notion-block-670e61df3a464c62a9e65c72381b99a0">减少代码冗余，代码简洁
去掉for循环，性能稳定高效</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-31c10626479b46d1ace64c8e496b0ee6" data-id="31c10626479b46d1ace64c8e496b0ee6"><span><div id="31c10626479b46d1ace64c8e496b0ee6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#31c10626479b46d1ace64c8e496b0ee6" title="模块设计图"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">模块设计图</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-7aa7c10afc664a61aa3ef893f53f103f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0e83ab84-eec7-4491-960e-a355fc261c57%2FUntitled.png?table=block&amp;id=7aa7c10a-fc66-4a61-aa3e-f893f53f103f" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-71eb2c52335c47e086ae0e9c286be4fa" data-id="71eb2c52335c47e086ae0e9c286be4fa"><span><div id="71eb2c52335c47e086ae0e9c286be4fa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#71eb2c52335c47e086ae0e9c286be4fa" title="缓存结构"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">缓存结构</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-57b7fff77368449ebc3ddf7f95fe3344"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:506px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F80a59ba1-6927-416a-98bd-7c17ed13a310%2FUntitled.png?table=block&amp;id=57b7fff7-7368-449e-bc3d-df7f95fe3344" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-0857e66189474fa4ae9f7e5fd2872dbd" data-id="0857e66189474fa4ae9f7e5fd2872dbd"><span><div id="0857e66189474fa4ae9f7e5fd2872dbd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0857e66189474fa4ae9f7e5fd2872dbd" title="源码分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">源码分析</span></span></h3><div class="notion-text notion-block-95a525dc6a104347a48595e86fc028af">源码展示</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-09fbb02fb84c471da9ecef809c473ae1" data-id="09fbb02fb84c471da9ecef809c473ae1"><span><div id="09fbb02fb84c471da9ecef809c473ae1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#09fbb02fb84c471da9ecef809c473ae1" title="关键解读"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">关键解读</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6d60f4152f39477b9501103d6fd1d7ae" data-id="6d60f4152f39477b9501103d6fd1d7ae"><span><div id="6d60f4152f39477b9501103d6fd1d7ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6d60f4152f39477b9501103d6fd1d7ae" title="开闭原则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">开闭原则</span></span></h3><div class="notion-text notion-block-735cfccf87a043b5ac73aeb46ee18b28">什么是开闭原则？</div><div class="notion-text notion-block-eb0238007a0c4747a0e3a1067b42eb9f">对修改是封闭的，对新增扩展是开放的。为了满足开闭原则，这里设计成有枚举主动注册到缓存，而不是有缓存主动加载枚举，这样设计的好处就是：当增加一个枚举时只需要在当前枚举的静态块中自主注册即可，不需要修改其他的代码
比如我们现在要新增一个状态类枚举：</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-bd1eef83b5d3427ca97904935f76b209" data-id="bd1eef83b5d3427ca97904935f76b209"><span><div id="bd1eef83b5d3427ca97904935f76b209" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bd1eef83b5d3427ca97904935f76b209" title="注册时机"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">注册时机</span></span></h3><div class="notion-text notion-block-dfed7527364c411d9dfd8effeaca8b44">将注册放在静态块中，那么静态块什么时候执行呢？</div><ol start="1" class="notion-list notion-list-numbered notion-block-4fddf3c3f60a4d338e29c429ae1f7160"><li>当第一次创建某个类的新实例时</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-1f2592f9a8f24bd1a6e9a78fa89cf322"><li>当第一次调用某个类的任意静态方法时</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-981d2dd401ee4e8ea3a919e30ad96895"><li>当第一次使用某个类或接口的任意非final静态字段时</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-9d2596f212b04e8db4d2afeff4fcc3aa"><li>当第一次<code class="notion-inline-code">Class.forName</code>时</li></ol><div class="notion-text notion-block-772e7452d79a4a85b4e0ff5d7815d254">如果我们入<code class="notion-inline-code">StatusEnum</code>创建枚举，那么在应用系统启动的过程中<code class="notion-inline-code">StatusEnum</code>的静态块可能从未执行过，则枚举缓存注册失败，所有我们需要考虑延迟注册，代码如下：</div><div class="notion-text notion-block-6a97231b7a65466f9cd489b017695d27"><code class="notion-inline-code">Class.forName(clazz.getName())</code>被执行的两个必备条件：</div><blockquote class="notion-quote notion-block-3df7c3d7d457486eaec55108b6ab0fcc"><div>1.缓存中没有枚举class的键，也就是说没有执行过枚举向缓存注册的调用，见<code class="notion-inline-code">EnumCache.find</code>方法对executeEnumStatic方法的调用；
2.<code class="notion-inline-code">executeEnumStatic</code>中的<code class="notion-inline-code">LOADED.put(clazz, true)</code>;还没有被执行过，也就是<code class="notion-inline-code">Class.forName(clazz.getName())</code>;没有被执行过；</div></blockquote><div class="notion-text notion-block-c87202e2b174431283995209f2d245a4">我们看到<code class="notion-inline-code">executeEnumStatic</code>中用到了双重检查锁，所以分析一下正常情况下代码执行情况和性能：</div><ol start="1" class="notion-list notion-list-numbered notion-block-4de50363d2b04dec904693134ccfe066"><li>当静态块还未执行时，大量的并发执行find查询。</li></ol><ul class="notion-list notion-list-disc notion-block-8c9e535e2bf7493b98d43e1cf74aace7"><li>此时<code class="notion-inline-code">executeEnumStatic中synchronized</code>会阻塞其他线程；第一个拿到锁的线程会执行<code class="notion-inline-code">Class.forName(clazz.getName())</code>;同时触发枚举静态块的同步执行；</li></ul><ul class="notion-list notion-list-disc notion-block-068f7511306f4986b72e0d604739b7ef"><li>之后其他线程会逐一拿到锁，第二次检查会不成立跳出executeEnumStatic；</li></ul><ol start="1" class="notion-list notion-list-numbered notion-block-287ae3c5bef04d1ba44c4a6e4a3bf034"><li>当静态块已经执行，且静态块里面正常执行了缓存注册，大量的并发执行find查询。
executeEnumStatic方法不会调用，没有synchronized引发的排队问题；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-3db1a89db0c64dfa8340650e8e793492"><li>当静态块已经执行，但是静态块里面没有调用缓存注册，大量的并发执行find查询。
find方法会调用executeEnumStatic方法，但是executeEnumStatic的第一次检查通不过；</li></ol><div class="notion-text notion-block-b5aed202e37944b0a38a6c7e53cc63ed">find方法会提示异常需要在静态块中添加注册缓存的代码；</div><div class="notion-text notion-block-cac5252e85084facaec0cce0fa6408d6">总结：第一种场景下会有短暂的串行，但是这种内存计算短暂串行相比应用系统的业务逻辑执行是微不足道的，也就是说这种短暂的串行不会成为系统的性能瓶颈</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-654c5e0ba33441fc82fbcc548a933fd7" data-id="654c5e0ba33441fc82fbcc548a933fd7"><span><div id="654c5e0ba33441fc82fbcc548a933fd7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#654c5e0ba33441fc82fbcc548a933fd7" title="样例展示"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">样例展示</span></span></h3><div class="notion-text notion-block-14a6a842b3be4f7a8ebb9bf5553f164a">构造枚举</div><div class="notion-text notion-block-f2260f7e83a34ad3a2bd59f7c25fd115">测试类</div><div class="notion-text notion-block-59b1ca2de99f4246bffa9fe93de1ec0c">执行结果</div><blockquote class="notion-quote notion-block-37e21d801f7b4717abbae180df73086a"><div>SUCCESS
INIT
INIT
SUCCESS
INIT
INIT</div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-877ceb9ce1544b45a9078c5cfe85128f" data-id="877ceb9ce1544b45a9078c5cfe85128f"><span><div id="877ceb9ce1544b45a9078c5cfe85128f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#877ceb9ce1544b45a9078c5cfe85128f" title="性能对比"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">性能对比</span></span></h2><div class="notion-text notion-block-5144d26b65b34f0e9ae9904696fba8f8">对比代码，如果OrderType中的实例数越多性能差异会越大</div><div class="notion-blank notion-block-580347862c4e49de802537a9e5993de2"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-c4cf648031f34ea39c94c27c14dbf125" data-id="c4cf648031f34ea39c94c27c14dbf125"><span><div id="c4cf648031f34ea39c94c27c14dbf125" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c4cf648031f34ea39c94c27c14dbf125" title="执行结果"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">执行结果</span></span></h3><div class="notion-blank notion-block-424db121fdc1452b82cf254fe3915abd"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-0d0548369a5246c0866bf83eccb6bc93" data-id="0d0548369a5246c0866bf83eccb6bc93"><span><div id="0d0548369a5246c0866bf83eccb6bc93" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0d0548369a5246c0866bf83eccb6bc93" title="总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总结</span></span></h2><div class="notion-text notion-block-c9b6b2cd067049f3a3926d85fd2acc0e">1、代码简洁；
2、枚举中实例数越多，缓存模式的性能优势越多；</div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>