<?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.xhhdd.cc/</link>
        <description>这是一个由NotionNext生成的站点</description>
        <lastBuildDate>Thu, 06 Apr 2023 16:15:49 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, xhhdd</copyright>
        <item>
            <title><![CDATA[被python打包逼疯了]]></title>
            <link>https://blog.xhhdd.cc/article/d8c7fe16-bca7-438f-a9b5-cf9d66b496e4</link>
            <guid>https://blog.xhhdd.cc/article/d8c7fe16-bca7-438f-a9b5-cf9d66b496e4</guid>
            <pubDate>Wed, 22 Mar 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[py2app，pyinstaller]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-d8c7fe16bca7438fa9b5cf9d66b496e4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-8a465eea464a4a798c107faf98e1acd4" data-id="8a465eea464a4a798c107faf98e1acd4"><span><div id="8a465eea464a4a798c107faf98e1acd4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8a465eea464a4a798c107faf98e1acd4" 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-7c54d7115f20403eb6f3c950e35aa71b">前段时间用python写了一个小工具，来方便一些日常的重复性工作。</div><div class="notion-text notion-block-8cbcc746dbad49169ba84e06e37caff1">使用pyside6，所以拥有了一个图形化的界面。</div><div class="notion-text notion-block-575ffc63efbf4c83a5629a296ea2465a">但是每次使用之前相对来说都比较麻烦，要不就是在编辑器里面运行，或者也要在命令行中输入命令。</div><div class="notion-text notion-block-8fb3a7134ffd43b198f3e0d2e173438a">所以我想打包成一个可执行的文件，变成一个软件，即点即用。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-391c35fbda7a4685bbf8a346f89abeb5" data-id="391c35fbda7a4685bbf8a346f89abeb5"><span><div id="391c35fbda7a4685bbf8a346f89abeb5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#391c35fbda7a4685bbf8a346f89abeb5" title="pyinstaller"><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">pyinstaller</span></span></h3><div class="notion-text notion-block-fba229d9b83840e8a275abb720e2232e">这是最多人推荐的一个打包工具，包括我在之前看到的一个pyside的教程上也推荐用这个工具打包。</div><div class="notion-text notion-block-a3a860009f2b409ea78bdc1a0f39da8d">当我填入参数打包之后，并不能正常的启动程序，原因是缺少一些什么组件。</div><div class="notion-text notion-block-adde94c548be496f84e912a482e219e7">教程上面说，pyinstaller不能识别一些动态导入的文件，于是我把<code class="notion-inline-code">main.ui</code> 也就是pyside的特性文件直接放进了软件包，但依然不能使用。</div><div class="notion-text notion-block-bdcfbaeda5e941f98308a11bed812ae1">后来有陆陆续续折腾了一下，无一例外，都打不开。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-cc940fef34a845a18a0063ba5a607ef8" data-id="cc940fef34a845a18a0063ba5a607ef8"><span><div id="cc940fef34a845a18a0063ba5a607ef8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#cc940fef34a845a18a0063ba5a607ef8" title="py2app"><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">py2app</span></span></h3><div class="notion-text notion-block-996eb2a6f4354db1a24a0da052273a9a">这个好像是专门在mac上进行使用的，我参考了知乎上的一篇文章，讲的很清楚。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-4c2dbaeda48c4e6eb5ef88abdca1273a" href="https://zhuanlan.zhihu.com/p/454550005"><div><div class="notion-bookmark-title">用 py2app 将 Python 脚本打包成 Mac OS 下的 APP 程序</div><div class="notion-bookmark-description">我们用 Python 写好了程序以后，立刻就可以享受到自动化带来的便利，一键处理各种数据。但是有时候同事、同学、朋友、女朋友看到你有这么厉害的工具，虽然没有任何编程基础，但是也想要用的时候，该怎么办呢？ 如…</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://static.zhihu.com/heifetz/assets/apple-touch-icon-152.81060cab.png" alt="用 py2app 将 Python 脚本打包成 Mac OS 下的 APP 程序" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://zhuanlan.zhihu.com/p/454550005</div></div></div></a></div><div class="notion-text notion-block-f8f4eb8b22ff4f58b5d9f08e43a468a7">前期的准备工作都差不多，只是py2app需要先生成一个<code class="notion-inline-code">setup.py</code> 文件。我们可以在这个文件中进行一定的设置，比如填写自己使用了什么包，或者是app的icon之类的。最后再运行一条命令就可以打包了。</div><div class="notion-text notion-block-86225aae6ae24b51a3e304809fea6fe1">不加<code class="notion-inline-code">-A</code> 就是类似于全量打包的意思，所有的依赖跟库都会全部放在软件包里面，可以直接发给别人使用。如果加上<code class="notion-inline-code">-A</code> 参数的话，那么实际上就类似于一个快捷方式，发给别人使用的话，别人还需要安装相应的环境，只是自己使用方便一点。</div><div class="notion-text notion-block-632d7931c9e44a5a974c0277a1237938">py2app让我看到了成功的曙光。虽然说不加<code class="notion-inline-code">-A</code> 参数没法使用，总是缺少什么依赖。但是加上这个参数之后，总算是可以把软件的界面给打开了。</div><div class="notion-text notion-block-5070f6db81aa4750b61771b393ebd4e2">虽然说界面可以顺利的打开，但是里面的按钮却没有任何的响应。我按照提示从终端进行启动，提示缺少相应的库。我估摸着这是pycharm的原因，pycharm安装库的时候跟我在命令行下安装，不是一个地方。我也搞不清楚是为什么，明明我只有一个python版本，可能是因为我没有搞清楚什么叫做解释器。。。不过问题不大，我重新在命令行下把缺少的安装了一遍，总算是把所有的功能都跑起来了。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-bccef4c19ed24c2c9dedacc555864868" data-id="bccef4c19ed24c2c9dedacc555864868"><span><div id="bccef4c19ed24c2c9dedacc555864868" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bccef4c19ed24c2c9dedacc555864868" 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-3674dc671a664fa3a09ac0855db0dece">我本来以为到这里已经搞好了，以上的操作都是我在桌面上完成的。因为怕影响本来的代码，所以复制了一份在桌面。</div><div class="notion-text notion-block-499f9696adbb429eaddb17b627575ab9">第二天起来等我把桌面的文件删掉之后，那个程序安装包都无法打开了。我意识到，是因为我的打包方式的问题，所以这个源文件不能删除。</div><div class="notion-text notion-block-abaacb5b396f463ebe8b4eb0724d6f84">于是我重新回到我代码本来的位置，然后重新之前的操作。接下来事态开始非常诡异了，我仍然是可以打开界面，但是第一个功能没办法使用。这个功能跟pd转换成Image图像有关系。我对代码进行了很多的调整，但是最终结果还是，这里一块功能没办法使用，而其他模块完全不受影响。</div><div class="notion-text notion-block-836337604cf4479094cfda9c19feb5eb">接着我尝试着试了一下anconda，在虚拟环境下操作。折腾了半天，也是不行，头都大了。我已经彻底心态崩溃。</div><div class="notion-blank notion-block-096c779870ec49e0b0144bc0f78e0780"> </div><div class="notion-text notion-block-c6f4c46caa644a58a6275faff1aaa53d">算了，爱谁谁，我不想搞了</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[jsonpath取notion数据]]></title>
            <link>https://blog.xhhdd.cc/article/dc2a8776-8df8-41e4-8cd9-ca39a770764c</link>
            <guid>https://blog.xhhdd.cc/article/dc2a8776-8df8-41e4-8cd9-ca39a770764c</guid>
            <pubDate>Tue, 14 Mar 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[jsonpath真好用]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-dc2a87768df841e48cd9ca39a770764c"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-d82d9b95165846658ba5fea049e7f86a" data-id="d82d9b95165846658ba5fea049e7f86a"><span><div id="d82d9b95165846658ba5fea049e7f86a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d82d9b95165846658ba5fea049e7f86a" title="run_query_database"><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">run_query_database</span></span></h3><div class="notion-text notion-block-5530aeaf2b4f49ac9a26b68500a3b678">最近在做一个小工具，需要对数据库进行查询并且解析notion api返回的数据。</div><div class="notion-text notion-block-debc800a617b4b98a9f5a5152e4bce84">上次推荐了一个比较好的封装</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-4d7153bd65cc4f8cac9713e49095cc07" href="https://notion-database.readthedocs.io/"><div><div class="notion-bookmark-title">Python Notion Database — notion-database latest documentation</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://notion-database.readthedocs.io/favicon.ico" alt="Python Notion Database — notion-database latest documentation" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://notion-database.readthedocs.io/</div></div></div></a></div><div class="notion-text notion-block-bfdae780a3bd4be1a0ff1243ed5fd397">但是在里面没有找到查询数据库的相关介绍</div><div class="notion-text notion-block-18d6382087594bc4b2542ade95efad07">自己研究了半天，发现有些函数没有被写到文档里</div><div class="notion-text notion-block-a7dbef21b3694648a21c01c48aeaec9e">我找到一个比较相关的<code class="notion-inline-code">run_query_database</code></div><div class="notion-text notion-block-f1a2f2f3d75449b68df59d2163d29711">提示需要输入<code class="notion-inline-code">database_id</code> 以及<code class="notion-inline-code">body</code> </div><div class="notion-text notion-block-3e709fd33d6c43b5872d4a73b910f73e">我直接去官网查看了一下</div><div class="notion-text notion-block-2569148e8ef74e5992ab1ad5dd9f0761">写出了以下代码</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-python">D = Database(integrations_token=token)
body = {
  &quot;filter&quot;: {
    &quot;property&quot;: &quot;喜马拉雅&quot;,
    &quot;url&quot;: {
      &quot;equals&quot;: &quot;https://m.ximalaya.com/album/73808503?from=pc&quot;
    }
  }
}
D.run_query_database(database_id=databes_rhythm_id, body=body)
result_dict = D.result
pprint.pprint(result_dict)</code></pre><div class="notion-text notion-block-0b9fce4a38984bf29fa3d82357991c7e">其中<code class="notion-inline-code">body</code> 是参照官网的格式来写的</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-6d684bff6741485191155c18001da1c6" href="https://developers.notion.com/reference/post-database-query-filter"><div><div class="notion-bookmark-title">Start building with the Notion API</div><div class="notion-bookmark-description">Connect Notion pages and databases to the tools you use every day, creating powerful workflows.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://dev.notion.so/front-static/favicon.ico" alt="Start building with the Notion API" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://developers.notion.com/reference/post-database-query-filter</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://files.readme.io/a507683-developer-portal-meta.png" alt="Start building with the Notion API" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-5c62a53307bc4ad3977ff940481a06de">其实<code class="notion-inline-code">url</code> 属性没有出现在列表中，我这个算是死马当活马医，结果顺利跑起来了。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-9678bf1e6c6042579c4a00a1645609a2" data-id="9678bf1e6c6042579c4a00a1645609a2"><span><div id="9678bf1e6c6042579c4a00a1645609a2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9678bf1e6c6042579c4a00a1645609a2" title="jsonpath"><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">jsonpath</span></span></h3><div class="notion-text notion-block-2d6dd3f27c8b4591a94a30f2486a55e5">数据跑出来之后会返回一大堆信息</div><div class="notion-text notion-block-54a5297266b9460c8b3e6c4aab7e03e5">然而我只需要里面的页面id等少数几个信息</div><div class="notion-text notion-block-a210c8fbfeff4f4aaf31aee7648e8590">我之前都是使用手动的方式定位信息，比如说</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-python">result[0][&#x27;id&#x27;][1]</code></pre><div class="notion-text notion-block-793d83fa533442928d146a7035e0c3d2">这实在是太蠢了…</div><div class="notion-text notion-block-c7e08d1509c544c1b864f3f242ddd136">接着看别人推荐了一下jsonpath</div><div class="notion-text notion-block-63be56507a974b6aa7f29625ec50729a">我参考了一下文档</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-6acaa7801fd94af9a2897975af1d9792" href="https://goessner.net/articles/JsonPath/"><div><div class="notion-bookmark-title">JSONPath - XPath for JSON</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://goessner.net/favicon.ico" alt="JSONPath - XPath for JSON" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://goessner.net/articles/JsonPath/</div></div></div></a></div><div class="notion-text notion-block-44264e071f094b388751222220e90a59">最重要的就是它的表格以及它的示例</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1dec220cf81345fc9f61a529a599f0be"><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%2F7cd16326-f55d-4977-8961-620535626fbc%2F%25E6%2588%25AA%25E5%25B1%258F2023-03-14_10.09.38.png?table=block&amp;id=1dec220c-f813-45fc-9f61-a529a599f0be" alt="notion image" loading="lazy" decoding="async"/></div></figure><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-json">{ &quot;store&quot;: {
    &quot;book&quot;: [ 
      { &quot;category&quot;: &quot;reference&quot;,
        &quot;author&quot;: &quot;Nigel Rees&quot;,
        &quot;title&quot;: &quot;Sayings of the Century&quot;,
        &quot;price&quot;: 8.95
      },
      { &quot;category&quot;: &quot;fiction&quot;,
        &quot;author&quot;: &quot;Evelyn Waugh&quot;,
        &quot;title&quot;: &quot;Sword of Honour&quot;,
        &quot;price&quot;: 12.99
      },
      { &quot;category&quot;: &quot;fiction&quot;,
        &quot;author&quot;: &quot;Herman Melville&quot;,
        &quot;title&quot;: &quot;Moby Dick&quot;,
        &quot;isbn&quot;: &quot;0-553-21311-3&quot;,
        &quot;price&quot;: 8.99
      },
      { &quot;category&quot;: &quot;fiction&quot;,
        &quot;author&quot;: &quot;J. R. R. Tolkien&quot;,
        &quot;title&quot;: &quot;The Lord of the Rings&quot;,
        &quot;isbn&quot;: &quot;0-395-19395-8&quot;,
        &quot;price&quot;: 22.99
      }
    ],
    &quot;bicycle&quot;: {
      &quot;color&quot;: &quot;red&quot;,
      &quot;price&quot;: 19.95
    }
  }
}</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4693fc82d040426082edaeb6f2802c5a"><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%2F108769c7-c279-4905-8e88-f40548e16d01%2F%25E6%2588%25AA%25E5%25B1%258F2023-03-14_10.10.32.png?table=block&amp;id=4693fc82-d040-4260-82ed-aeb6f2802c5a" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-a16edbd0da8a4e57be7a3a100c62849c">虽然说没有看的太懂，但是基本上够用了。</div><div class="notion-text notion-block-1617648d49594ca4a0ff497255590f1a">我主要是用的就是<code class="notion-inline-code">..</code> 无脑进行递归查找</div><div class="notion-text notion-block-d08003bf714744f794bf57ee0be2fd42">如果出来的结果太多，那么就写几个前缀缩小一下范围</div><div class="notion-text notion-block-b5c15ee5ba61472dae7fe4ed5a9cd279"><code class="notion-inline-code">page_id = jsonpath.jsonpath(D.result, &#x27;$.results[0].id&#x27;)</code></div><div class="notion-blank notion-block-49e40665abe84d6ea1a789d4a3cc697f"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pdf2image与分割五线谱]]></title>
            <link>https://blog.xhhdd.cc/article/87612a2e-ee66-4219-911f-6b49d4494983</link>
            <guid>https://blog.xhhdd.cc/article/87612a2e-ee66-4219-911f-6b49d4494983</guid>
            <pubDate>Sun, 05 Mar 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[效率依旧比较低]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-87612a2eee664219911f6b49d4494983"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-12be01dafbe3445198870d556738df57" data-id="12be01dafbe3445198870d556738df57"><span><div id="12be01dafbe3445198870d556738df57" class="notion-header-anchor"></div><a class="notion-hash-link" href="#12be01dafbe3445198870d556738df57" 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-9679797300bc444e9c0dfa121833dab6">我批量制作音乐习题或者视唱练耳的视频，通常会采用github上的一个开源项目。</div><a target="_blank" rel="noopener noreferrer" href="https://github.com/Chen-and-Sim/SmartCropper" class="notion-external notion-external-block notion-row notion-block-859513e0fef540ba81bdd4e1dbb1cb66"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">SmartCropper</div><div class="notion-external-subtitle"><span>Chen-and-Sim</span><span> • </span><span>Updated <!-- -->Mar 16, 2023</span></div></div></a><div class="notion-text notion-block-4903ad0689b84dc4b927e3e8a59ea9b8">这是陈文戈老师推荐的，确实是方便好用。</div><div class="notion-text notion-block-b095054d02544d629f40dc428ed2e16b">我这边使用的流程大致是：</div><ul class="notion-list notion-list-disc notion-block-089fc2f1e65942f99da7fe4f86828804"><li>由ly文件或者tex文件生成一个pdf文件</li></ul><ul class="notion-list notion-list-disc notion-block-066424d8d36142cca8cf7985bf7149e5"><li>接下来使用mac自带的自动操作里面的一个小功能，把pdf渲染出最高画质的png图像</li></ul><ul class="notion-list notion-list-disc notion-block-d1a13dd53ed14df58b5faa18c37367ec"><li>在windows上使用SmartCropper进行自动裁剪</li></ul><div class="notion-text notion-block-6afdd0f8a2ef4a5a97c77b8cebb17798">一切都非常顺利，但是最近在剪辑4k视频的时候，发现谱例有些毛边。</div><div class="notion-text notion-block-c1309f59150941d7b658473e27974148">难道矢量图还会模糊？</div><div class="notion-text notion-block-f2d9dbcf8adb4c5a8f5c60ee47b7ddbe">我仔细思索了一下，估计是只有在pdf文件格式的时候才是矢量的，一旦导出png图片就有了固定的像素？（不过png我怎么记得也是矢量的）</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-dee541d677b44aaa91e6f93f24490de2" data-id="dee541d677b44aaa91e6f93f24490de2"><span><div id="dee541d677b44aaa91e6f93f24490de2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dee541d677b44aaa91e6f93f24490de2" 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-4eac751d6ebc46c8954f3aad505e3744">那么怎么解决呢？</div><ol start="1" class="notion-list notion-list-numbered notion-block-6e20d5582ff64d6f83d6db23d99f27f3"><li>我尝试使用latex里面的memoir宏包，把字体调成超大字体的样式。但是失败了，因为会跟lualatex产生冲突。而且还有个问题，字体变大了就会导致pdf的页数变多。那么SmartCropper在识别的时候就会闪退。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-acd56f8d42084b2e9698601f3cd3e160"><li>把pdf导出非常高像素的图片，这样SmartCropper裁剪的时候就不会有问题。</li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c8e73dd3e0ab4fcb9fb54ae9d11abb6d" data-id="c8e73dd3e0ab4fcb9fb54ae9d11abb6d"><span><div id="c8e73dd3e0ab4fcb9fb54ae9d11abb6d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c8e73dd3e0ab4fcb9fb54ae9d11abb6d" title="pdf2image"><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>pdf2image</b></b></span></span></h4><div class="notion-text notion-block-1ea9219e8eae4590a56eb692b97d46f7">人人都说python的库非常丰富，我这次算是体验到了。不管是前两天跟notion相关的，还是今天找到这个。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-e2dd51125a084fcc8940a4ea850a8397" href="https://pypi.org/project/pdf2image/"><div><div class="notion-bookmark-title">pdf2image</div><div class="notion-bookmark-description">A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://pypi.org/static/images/favicon.35549fe8.ico" alt="pdf2image" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://pypi.org/project/pdf2image/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://pypi.org/static/images/twitter.abaf4b19.webp" alt="pdf2image" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-7589020c3e874f20ba6dbbb8616b5673">使用方法作者写的很清楚，首先需要安装<code class="notion-inline-code">poppler</code> 。如果是mac上的话可以直接brew，而windows的话可以在它提供的下载链接里直接下载。下载完成之后也不需要安装，只需要过会把路径填写到代码里面就行。</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-python"># 引入pdf转换的库
from pdf2image import convert_from_path
from pdf2image.exceptions import (
    PDFInfoNotInstalledError,
    PDFPageCountError,
    PDFSyntaxError
)

# 把pdf文件转换成一个Image对象列表
image_l = convert_from_path(pdf_path=&#x27;/Users/xhhdd/Desktop/1.pdf&#x27;, dpi=300, size=(10000, None), thread_count=15)
# 使用Image的save功能保存图片
i = 0
for v in image_l:
    i += 1
    v.save(f&#x27;temp/{str(i).zfill(3)}.png&#x27;, dpi=(300, 300), compress_level=1)</code></pre><div class="notion-text notion-block-39bd6d32e7d847d0be75725d3cab9296">使用流程算是非常清晰的：</div><ul class="notion-list notion-list-disc notion-block-2e99141c7a534d86965b22bf8062548d"><li>先把pdf文件转换成一个Image对象列表</li></ul><ul class="notion-list notion-list-disc notion-block-419a3bcfd3f14566809c74e58fbe16f0"><li>接着保存图片即可</li></ul><blockquote class="notion-quote notion-block-8e4addfe0cfa49acba009c5fdf1d229f"><div>使用过程中也遇到一些小问题，比如说<code class="notion-inline-code">convert_from_path</code> 里指定dpi，但如果Image保存的时候不指定dpi的话，生成的图片dpi都是默认的72。
另外就是，在转换Image对象列表的时候，内存占用挺大的，不知道是不是正常现象。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-7ffa9022c7a8481db4c3fedbd868e2f5" data-id="7ffa9022c7a8481db4c3fedbd868e2f5"><span><div id="7ffa9022c7a8481db4c3fedbd868e2f5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7ffa9022c7a8481db4c3fedbd868e2f5" 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-88ba25382672423a9330a26acb343399">我也不知道这样算不算好的解决方式，整套流程比之前话的时间多很多，而且更加高分辨率的图片也会加重SmartCropper的运算时间。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[一个比较好用的notion api封装]]></title>
            <link>https://blog.xhhdd.cc/article/2a9031fc-dca6-4aec-a04c-45ecd2a36c3f</link>
            <guid>https://blog.xhhdd.cc/article/2a9031fc-dca6-4aec-a04c-45ecd2a36c3f</guid>
            <pubDate>Fri, 03 Mar 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[是个能够看明白的项目]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-2a9031fcdca64aeca04c45ecd2a36c3f"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-08d8de356c6e401bbc42a4baf34409bb">前段时间研究了一下notion的api，学会了一点简单的使用方式。</div><div class="notion-text notion-block-f96b0a51ff0a4c64997d468ba6b7ce02">但是自己手动去实现功能，写的代码还是太乱了一点，也不是很会怎么去复用。</div><div class="notion-text notion-block-c1383039e28a4e1dae4d492fadb89980">于是在网上找那种notion的api封装项目，开箱即用的那种。</div><a target="_blank" rel="noopener noreferrer" href="https://github.com/jamalex/notion-py" class="notion-external notion-external-block notion-row notion-block-36a64662d9f34ab99b6aca63384adeb5"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">notion-py</div><div class="notion-external-subtitle"><span>jamalex</span><span> • </span><span>Updated <!-- -->Apr 5, 2023</span></div></div></a><div class="notion-text notion-block-dc7a9e03a9884b7880be84739aa03927">网上很多推荐的上面这个项目，但是很显然这个消息已经过时了。这个使用<code class="notion-inline-code">token_v2</code> 的起手式感觉已经是现在不能实现的事情。</div><div class="notion-text notion-block-be8385b61c8d4bb89374f9d10064e67b">在这个项目下有人回复，有一个可以代替的项目。</div><a target="_blank" rel="noopener noreferrer" href="https://github.com/lastorel/pytion" class="notion-external notion-external-block notion-row notion-block-eb58e50223f44833a73a787656b28e19"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">pytion</div><div class="notion-external-subtitle"><span>lastorel</span><span> • </span><span>Updated <!-- -->Apr 4, 2023</span></div></div></a><div class="notion-text notion-block-4946e34380504666bb006c43be687999">这个pytion我试了一下，它上面有提供范例代码。整体感觉还是不错的，而且可能是因为多进程的关系？运行起来比自己手动写api请求要快得多。</div><div class="notion-text notion-block-adbc5f21259e4618add3c14fb5903855">但是最令人头疼的地方来，这项目我看不懂怎么用！我真的用翻译软件来来回回看了很多次。好像懂了，好像没懂，有一些用法还在代码本身的注释里。我真的快被搞疯了。</div><div class="notion-text notion-block-e9ce203654e743b888cb0ed7ca5466d9">最终我还是放弃了， 没必要死抠。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4e20d17c2688479dbc1e18c2f9f8fb08" data-id="4e20d17c2688479dbc1e18c2f9f8fb08"><span><div id="4e20d17c2688479dbc1e18c2f9f8fb08" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4e20d17c2688479dbc1e18c2f9f8fb08" title="pypi上的意外发现"><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">pypi上的意外发现</span></span></h3><div class="notion-text notion-block-2bfe4f1b1b6b4b58bb8b900fe9453937">既然我要的就是一个python的库，那不如直接去pypi找。</div><div class="notion-text notion-block-a447d6e758654cab81cbf2ea63466df9">果然，被我找到一个用法简洁的库。</div><a target="_blank" rel="noopener noreferrer" href="https://github.com/minwook-shin/notion-database" class="notion-external notion-external-block notion-row notion-block-434cc755589440ab96b335976b11b195"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">notion-database</div><div class="notion-external-subtitle"><span>minwook-shin</span><span> • </span><span>Updated <!-- -->Mar 26, 2023</span></div></div></a><div class="notion-text notion-block-790bb712626049f489e2f4a53f8a891c">感恩，怎么会写的如此清楚！！！！！</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-15dea4651b64479eaad5beab9c95526a"><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%2F28173c0f-4a34-4210-a6db-f8440adc35a4%2F%25E6%2588%25AA%25E5%25B1%258F2023-03-03_08.36.24.png?table=block&amp;id=15dea465-1b64-479e-aad5-beab9c95526a" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f4d61a1de1e84d5aa9623ecf9c4737fb">照着这些试了一下，很快就实现了自己想要的功能！</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[关于lyluatex的折腾事件]]></title>
            <link>https://blog.xhhdd.cc/article/68508a72-55a2-45d9-a2be-3c8e7ba071e0</link>
            <guid>https://blog.xhhdd.cc/article/68508a72-55a2-45d9-a2be-3c8e7ba071e0</guid>
            <pubDate>Wed, 01 Mar 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[mac比windows慢一倍？]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-68508a7255a245d9a2be3c8e7ba071e0"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-806bb0296ce143feb198ea6cdc6223f5">前因后果都在这了</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-54672823abff430b80e80839df98e9cc" href="https://github.com/jperon/lyluatex/issues/303#issuecomment-1448909451"><div><div class="notion-bookmark-title">lyluatex runs slowly on mac · Issue #303 · jperon/lyluatex</div><div class="notion-bookmark-description">Hi author, I&amp;amp;#39;ve been using lyluatex to get lilypond to work perfectly with latex, but I recently switched to an Apple silicon computer and have some new problems. Background Computer: apple...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://github.com/fluidicon.png" alt="lyluatex runs slowly on mac · Issue #303 · jperon/lyluatex" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/jperon/lyluatex/issues/303#issuecomment-1448909451</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://opengraph.githubassets.com/c1edf6e75d25f74090e6816a507dcda41a58ad6a6741b61739603a0afa2943a4/jperon/lyluatex/issues/303" alt="lyluatex runs slowly on mac · Issue #303 · jperon/lyluatex" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-0697dab935424d2c9a2dc6267f4b29a8">简单的来说就是</div><div class="notion-text notion-block-af0d938ed04d4308a615108c41d6c647">我发现在mac上使用lyluatex的速度还不如在windows上的速度，甚至慢了一倍左右。</div><div class="notion-text notion-block-ce62ffb4f65f41ddb7973337e28f4e08">开发者非常友好，很细节的帮我找问题。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-945514e629dd4cd79ff623a670ff6c2e" data-id="945514e629dd4cd79ff623a670ff6c2e"><span><div id="945514e629dd4cd79ff623a670ff6c2e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#945514e629dd4cd79ff623a670ff6c2e" title="lilypond-book"><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">lilypond-book</span></span></h3><div class="notion-text notion-block-258833d6cca7441b96220198673bf22b">提到这个的原因是，想看看是lilypond有问题，还是出在别的方面。</div><div class="notion-text notion-block-284297252caa426590d91355d60d9734">lilypond-book速度非常的快，指的是从lytex生成tex文件。</div><div class="notion-text notion-block-d48a166f358043e0ab8e346f46a1a8c4">那么编译tex的时候就出鬼了，如果使用xelatex的话，速度还是相当快的，基本上几十秒就搞定了。但是如果使用lualatex的话就非常的缓慢，跟使用lyluatex的时候差不多。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-ce855eb8e1244dcda9d8d4c186abb415" data-id="ce855eb8e1244dcda9d8d4c186abb415"><span><div id="ce855eb8e1244dcda9d8d4c186abb415" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ce855eb8e1244dcda9d8d4c186abb415" title="lyluatex生成tmp-ly"><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">lyluatex生成tmp-ly</span></span></h3><div class="notion-text notion-block-8d3ab3d673f64b459f1201966eaeed7e">调用lyluatex对新文件进行编译的时候，会在当前目录下生成一个tmp-ly文件。这个文件下面装的是以hash为文件名的相关pdf等文件。等第二次或者接下来编译的时候，就会明显的缩短时间，因为不需要再次生成。</div><div class="notion-text notion-block-62f262eb45d24784bae2e83c51764b4f">事实上确实是这样。但就是生成tmp-ly文件的时候速度太慢了。</div><div class="notion-text notion-block-d664af933c844636bbbc7d2cc60d487e">开发者猜想lilypond-book是多线程的，而lyluatex是跟据lyluatex的上下文按顺序来的，所以不能多线程。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-8fc8cc6f15da4a8b84c27093eda4c6ee" data-id="8fc8cc6f15da4a8b84c27093eda4c6ee"><span><div id="8fc8cc6f15da4a8b84c27093eda4c6ee" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8fc8cc6f15da4a8b84c27093eda4c6ee" 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-7aa74d0cd21b49379d704e1ed8aca771">所以lilypond-book的快是必然的，同样的效果也要差一些。</div><div class="notion-text notion-block-867b4b70b51c4ef9abe3ec8702895108">lyluatex如果想要快，按作者的话说</div><blockquote class="notion-quote notion-block-c529e9b2ed8545f09876e1464a050c96"><div>I’d ensure that the binaries (from MacTeX and from LilyPond) are compiled natively for m2, not &quot;universal&quot; binaries. Otherwise, the only thing I see is avoiding to many changes on scores, so that the <code class="notion-inline-code">tmp-ly</code>cache shows its benefits…</div></blockquote><div class="notion-blank notion-block-f622d52aa8c54962b99633bd52a2184d"> </div><div class="notion-text notion-block-b781965ed92343b9b6a04e30a2ad974c">反正我已经是被搞晕了，再说吧，用反正是可以用。</div><div class="notion-blank notion-block-21504203d2094be6b4f8eb7a5cfa3720"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>