<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tools on Nansen Li's Blog
李楠森的博客</title><link>https://nansenli.com/categories/tools/</link><description>Recent content in Tools on Nansen Li's Blog
李楠森的博客</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Nansen Li 🌈 （李楠森）</copyright><lastBuildDate>Sat, 01 Feb 2025 13:01:39 +0000</lastBuildDate><atom:link href="https://nansenli.com/categories/tools/index.xml" rel="self" type="application/rss+xml"/><item><title>How to install Rodin software on a MacBook with an Apple chip</title><link>https://nansenli.com/post/2025/02/rodin/</link><pubDate>Sat, 01 Feb 2025 13:01:39 +0000</pubDate><guid>https://nansenli.com/post/2025/02/rodin/</guid><description>&lt;h3 id="steps-to-install-rodin-on-macos-m1-arm-architecture">&lt;strong>Steps to Install Rodin on macOS (M1 ARM Architecture):&lt;/strong>
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Install x86 JDK&lt;/strong>
&lt;ul>
&lt;li>
&lt;p>Download the &lt;strong>Intel x86 JDK 18&lt;/strong> (macOS .dmg) from Oracle:&lt;/p>
&lt;p>&lt;a class="link" href="https://download.oracle.com/java/18/archive/jdk-18.0.2.1_macos-x64_bin.dmg" target="_blank" rel="noopener"
>jdk-18.0.2.1_macos-x64_bin.dmg&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Run the installer; it automatically configures the Java environment.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Download and Install Rodin&lt;/strong>
&lt;ul>
&lt;li>
&lt;p>Get &lt;strong>Rodin 3.8/3.9&lt;/strong> (x86_64 version) from SourceForge:&lt;/p>
&lt;p>&lt;a class="link" href="https://sourceforge.net/projects/rodin-b-sharp/files/Core_Rodin_Platform/3.8/rodin-3.8.0.202304051545-af2f57e1e-macosx.cocoa.x86_64.tar.gz/download" target="_blank" rel="noopener"
>rodin-3.8.0.202304051545- macosx.cocoa.x86_64.tar.gz&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Extract the &lt;code>.tar.gz&lt;/code> file and move &lt;code>Rodin.app&lt;/code> to the &lt;code>/Applications&lt;/code> folder.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Fix macOS Security Permissions&lt;/strong>&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>Run this command to bypass &amp;ldquo;app is damaged&amp;rdquo; errors:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo xattr -cr /Applications/Rodin.app
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Rodin should be able to run without any additional steps (e.g., configuring the Java VM path).&lt;/p></description></item><item><title>How to handle the inconsistency in LaTeX formatting from ChatGPT between Obsidian and Craft.</title><link>https://nansenli.com/post/2024/10/raycast-craft/</link><pubDate>Sat, 26 Oct 2024 12:59:21 +0000</pubDate><guid>https://nansenli.com/post/2024/10/raycast-craft/</guid><description>&lt;p>In a previous article, I used Obsidian&amp;rsquo;s QuickAdd to create a script that automatically converts text copied from ChatGPT and fixes the LaTeX formatting. However, there is no suitable plugin available for the Craft app.&lt;/p>
&lt;p>We can use Raycast to achieve this functionality uniformly.&lt;/p>
&lt;hr>
&lt;h1 id="create-a-raycast-script">Create a Raycast Script
&lt;/h1>&lt;p>First, we need to create a script.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/2abd177df831.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>Next, select the Bash template.&lt;/p>
&lt;p>Then, we edit the Bash script and enter the following code:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#!/bin/bash
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Required parameters:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.schemaVersion 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.title Copy From ChatGPT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.mode silent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Optional parameters:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.icon 🤖&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.packageName ChatGPT Utils&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Documentation:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.description Copy From ChatGPT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.author Nansen Li&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># @raycast.authorURL nansenli.com&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Get clipboard content&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">clipboard_content&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>pbpaste&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Check if content was successfully retrieved&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">if&lt;/span> &lt;span class="o">[&lt;/span> -z &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$clipboard_content&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="o">]&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="k">then&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;Clipboard is empty or inaccessible.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">exit&lt;/span> &lt;span class="m">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Process clipboard content&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">modified_content&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>&lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$clipboard_content&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> sed &lt;span class="s1">&amp;#39;s/\\\[/$$/g; s/\\\]/$$/g; s/\\( /$/g; s/ \\\)/$/g&amp;#39;&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Write the modified content back to the clipboard&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$modified_content&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> pbcopy
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;hr>
&lt;p>After creating the script, we need to add the directory containing the script to Raycast.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/60724508c66a.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>In this step, select the directory where the script was just created. At this point, we can see the newly created script in &lt;code>Script Commands&lt;/code>.&lt;/p>
&lt;hr>
&lt;h1 id="how-to-use">How to Use
&lt;/h1>&lt;p>After copying a formula from ChatGPT, open the Raycast panel, find the newly created script, and run it. The clipboard content will be automatically fixed. Then, simply paste it into Obsidian or Craft.&lt;/p></description></item><item><title>Convert ChatGPT Formula Format to Obsidian-Compatible Format</title><link>https://nansenli.com/post/2024/10/obsidian-latex-fix/</link><pubDate>Mon, 14 Oct 2024 15:24:21 +0000</pubDate><guid>https://nansenli.com/post/2024/10/obsidian-latex-fix/</guid><description>&lt;p>The formulas generated by ChatGPT use the following format:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">\[
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Formula Content
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">\]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>However, Obsidian renders formulas using the following format:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">$$
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Formula Content
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$$
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>When copying a formula from ChatGPT to Obsidian, this difference prevents proper rendering.&lt;/p>
&lt;h2 id="solution">Solution
&lt;/h2>&lt;p>We can create a script for Obsidian to automatically replace the formula format when pasting.&lt;/p>
&lt;h3 id="1-create-the-script">1. Create the Script
&lt;/h3>&lt;p>We can solve this issue using a plugin in Obsidian.&lt;/p>
&lt;p>In your vault, create a file named &lt;code>fixlatex.js&lt;/code> under the &lt;code>template&lt;/code> directory, and input the following content:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">exports&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kr">async&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">params&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nx">quickAddApi&lt;/span> &lt;span class="p">}&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">params&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Get clipboard content
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kr">const&lt;/span> &lt;span class="nx">clipboardContent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kr">await&lt;/span> &lt;span class="nx">quickAddApi&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">utility&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getClipboard&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Check if content was successfully retrieved
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">clipboardContent&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">new&lt;/span> &lt;span class="nx">Notice&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Clipboard is empty or inaccessible.&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">modifiedContent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">clipboardContent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">.&lt;/span>&lt;span class="nx">replace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sr">/\\\[|\\\]/g&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;$$$$&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c1">// Convert \[ \] to $$ $$
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="p">.&lt;/span>&lt;span class="nx">replace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sr">/\\\(\s*|\s*\\\)/g&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;$$&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span> &lt;span class="c1">// Convert \( \) to $
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Write the modified content back to the clipboard
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kr">await&lt;/span> &lt;span class="nx">navigator&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">clipboard&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">writeText&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">modifiedContent&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">new&lt;/span> &lt;span class="nx">Notice&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Clipboard content has been processed and modified!&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="2-set-up-the-script-in-quickadd">2. Set Up the Script in QuickAdd
&lt;/h3>&lt;p>Install the QuickAdd plugin and create a &lt;code>Macro&lt;/code>, configuring it as shown below, then save it. The first step in the Macro is to execute our user script &lt;code>fixlatex.js&lt;/code>, the second step is to wait for 100 milliseconds, and the third step is to execute the paste action.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/ec99ec1deab8.png"
loading="lazy"
>&lt;/p>
&lt;h3 id="3-set-sidebar-shortcut-in-commander">3. Set Sidebar Shortcut in Commander
&lt;/h3>&lt;p>Install the Commander plugin and set up the QuickAdd action we just created as a sidebar shortcut. You can also skip this step and directly use an Obsidian command to execute this action.&lt;/p>
&lt;h3 id="4-verify-the-effect">4. Verify the Effect
&lt;/h3>&lt;p>Now, on the ChatGPT webpage (currently there seems to be an issue when clicking the copy button in the app), click the copy button, then in Obsidian, click the sidebar shortcut or manually execute the QuickAdd command. This will copy the content from ChatGPT to Obsidian and automatically convert the LaTeX format.&lt;/p></description></item><item><title>Investigation and Solution of Windows 10 SSD Periodic Stuttering Problems</title><link>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/%E5%85%B3%E4%BA%8E-windows-10-%E4%BD%BF%E7%94%A8-ssd-%E6%AF%8F%E9%9A%94%E4%B8%80%E6%AE%B5%E6%97%B6%E9%97%B4%E5%8D%A1%E9%A1%BF%E9%97%AE%E9%A2%98%E7%9A%84%E6%8E%A2%E7%A9%B6%E4%B8%8E%E8%A7%A3%E5%86%B3/</link><pubDate>Wed, 24 Oct 2018 11:47:00 +0000</pubDate><guid>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/%E5%85%B3%E4%BA%8E-windows-10-%E4%BD%BF%E7%94%A8-ssd-%E6%AF%8F%E9%9A%94%E4%B8%80%E6%AE%B5%E6%97%B6%E9%97%B4%E5%8D%A1%E9%A1%BF%E9%97%AE%E9%A2%98%E7%9A%84%E6%8E%A2%E7%A9%B6%E4%B8%8E%E8%A7%A3%E5%86%B3/</guid><description>&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>I was originally using an Intel i5-6500 CPU, but after switching to an AMD Ryzen 2700, frequent system freezes started occurring.&lt;/p>
&lt;h2 id="symptoms">Symptoms
&lt;/h2>&lt;p>During these freezes, I observed that the disk usage in Task Manager was at 100%, while both read and write rates were at 0. The SSD is a generic Lexar Hades 512 GB. In Event Viewer, there were numerous events with ID 129.&lt;/p>
&lt;h2 id="suspecting-hardware-issues">Suspecting Hardware Issues
&lt;/h2>&lt;p>After repeatedly changing SATA ports and reconnecting power cables, the freezes persisted.&lt;/p>
&lt;h2 id="searching-for-related-issues-online">Searching for Related Issues Online
&lt;/h2>&lt;p>Online searches mostly pointed to the root cause being Windows 10&amp;rsquo;s AHCI driver issues and SSD firmware problems.&lt;/p>
&lt;h2 id="solution-approach-1-replacing-the-ahci-driver---ineffective">Solution Approach 1: Replacing the AHCI Driver - Ineffective
&lt;/h2>&lt;p>To replace the AHCI driver, I tried downloading chipset drivers from both AMD&amp;rsquo;s official website and ASUS&amp;rsquo;s official website, and manually replaced the driver in Device Manager so that it showed as an AMD SATA driver. I also tried various motherboard drivers, but testing proved ineffective, and the problem remained unsolved.&lt;/p>
&lt;h2 id="solution-approach-2-converting-the-drive-to-raid-format---ineffective">Solution Approach 2: Converting the Drive to RAID Format - Ineffective
&lt;/h2>&lt;p>To convert to RAID format, I reinstalled Windows, but during the installation process, Windows could not recognize the SSD. According to AMD&amp;rsquo;s official English manual and official RAID drivers, I manually loaded the RAID drivers, but Windows still couldn&amp;rsquo;t see the SSD during installation. After multiple attempts, it remained undetected. This might be because volume mode RAID is not supported with only one drive. I abandoned this approach.&lt;/p>
&lt;h2 id="solution-approach-3-modifying-the-registry-disabling-msi---ineffective">Solution Approach 3: Modifying the Registry, Disabling MSI - Ineffective
&lt;/h2>&lt;p>&lt;a class="link" href="https://www.pconline.com.cn/win10/739/7395324.html" target="_blank" rel="noopener"
>https://www.pconline.com.cn/win10/739/7395324.html&lt;/a>&lt;/p>
&lt;blockquote>
&lt;p>In essence, when using the StorAHCI.sys driver in certain AHCI modes, some SSDs may not be able to complete input/output operations correctly in &amp;ldquo;Message Signaled Interrupt&amp;rdquo; (MSI) mode, ultimately resulting in system freezes with disk usage showing 100% in Task Manager. Of course, the solution is simple: just disable it (MSI Mode) directly in regedit.&lt;/p>
&lt;/blockquote>
&lt;blockquote>
&lt;p>　　4. Click Cortana, type &amp;ldquo;regedit&amp;rdquo; to launch the Registry Editor, navigate to &amp;ldquo;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum\PCI\xxxxx\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties&amp;rdquo; (where &amp;ldquo;xxxxx&amp;rdquo; is the &amp;ldquo;device instance path&amp;rdquo; you just recorded);&lt;/p>
&lt;/blockquote>
&lt;blockquote>
&lt;p>　　5. Finally, change the &amp;ldquo;MSISupported&amp;rdquo; key value in the right pane from 1 to 0;&lt;/p>
&lt;/blockquote>
&lt;p>Testing proved this ineffective.&lt;/p>
&lt;h2 id="solution-approach-4-changing-power-settings---ineffective">Solution Approach 4: Changing Power Settings - Ineffective
&lt;/h2>&lt;p>Setting the PCI-Express setting to OFF, testing proved ineffective.&lt;/p>
&lt;h2 id="solution-approach-5-changing-lpm---effective">Solution Approach 5: Changing LPM - Effective
&lt;/h2>&lt;p>&lt;a class="link" href="http://www.sohu.com/a/204645459_493865" target="_blank" rel="noopener"
>http://www.sohu.com/a/204645459_493865&lt;/a>&lt;/p>
&lt;p>&lt;a class="link" href="https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/event-id-129-storahci-resetting-raidport0/7b30c512-6597-438b-80cb-22fb2f85d62e" target="_blank" rel="noopener"
>https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/event-id-129-storahci-resetting-raidport0/7b30c512-6597-438b-80cb-22fb2f85d62e&lt;/a>&lt;/p>
&lt;p>The content is as follows:&lt;/p>
&lt;p>Most SSDs we use today support some power-saving features, such as DIPM/HIPM/Device Sleep.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/8ef2136fa9e4.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>When a state change request is initiated by the host, we call it HIPM (Host-Initiated LPM), and when it&amp;rsquo;s directly initiated by the device, we call it DIPM (Device-Initiated LPM). What are they requesting? Requesting to slow down, save energy, or enter Device Sleep.&lt;/p>
&lt;p>Both HIPM and DIPM rely on the computer&amp;rsquo;s LPM technology support. LPM, or Link Power Management, is a function at the physical layer of the SATA interface that can divide the link between the host and storage device into three states: Active state, Partial state, and Slumber state. The goal is to reduce the physical layer bus transmission speed, thus achieving power-saving effects.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/beb05312d902.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>LPM is generally enabled by default.&lt;/p>
&lt;p>So is enabling LPM good for SSDs?&lt;/p>
&lt;p>1. The host sends an HIPM state change command, but due to differing SSD device standards, it may not be well-supported, causing compatibility issues leading to stuttering or drive disconnection;&lt;/p>
&lt;p>2. The host sends HIPM state change commands too frequently, causing the SSD device to not respond in time, resulting in stuttering;&lt;/p>
&lt;p>3. After LPM is enabled, it increases SATA bus transmission delays, causing high-speed SSDs to become blocked and stutter;&lt;/p>
&lt;p>4. Conflicts between the SSD&amp;rsquo;s internal DIPM and the host&amp;rsquo;s requested HIPM cause stuttering.&lt;/p>
&lt;p>Often, SSD-induced computer stuttering and sudden drive disconnections are caused by LPM.&lt;/p>
&lt;p>LPM can help SATA devices achieve power-saving effects. However, it also affects SSD performance.&lt;/p>
&lt;p>So, for the sake of power saving, are you willing to pay the price of losing SSD performance?&lt;/p>
&lt;p>HDD power consumption is around 10-25W. Perhaps LPM was originally only intended for HDDs.&lt;/p>
&lt;p>SSD startup power consumption: 0.1W&lt;del>1W (2W), maximum power consumption: 5&lt;/del>10W, average power consumption: around 4~5W.&lt;/p>
&lt;p>Does our power supply care about these few watts from the SSD? Do we care about this bit of electricity cost? Should we even care!&lt;/p>
&lt;p>If SSDs don&amp;rsquo;t need LPM, which harms SSD performance, can we turn it off?&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/e3137f899356.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>Save as &amp;ldquo;.reg&amp;rdquo; format.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/bd0944771088.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>Click to run. It will automatically write to the registry, changing the LPM power settings.&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/cfc7398516b6.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/cb2106c96417.png"
loading="lazy"
alt="image"
>&lt;/p>
&lt;p>If your SSD is experiencing severe stuttering or disconnections, you can try this method.&lt;/p>
&lt;p>The main reason for SSD stuttering and disconnections is that the SSD is too poor quality. Indeed, with SSD prices constantly rising today, it&amp;rsquo;s very difficult to buy a good SSD at a relatively low price.&lt;/p>
&lt;p>&lt;strong>After testing, this was effective&lt;/strong>&lt;/p>
&lt;h2 id="solution-approach-6-changing-bios-settings-enabling-sata-hot-plug-functionality---recommended">Solution Approach 6: Changing BIOS Settings, Enabling SATA Hot Plug Functionality - Recommended
&lt;/h2>&lt;p>&lt;a class="link" href="https://www.aiweibk.com/5795.html" target="_blank" rel="noopener"
>https://www.aiweibk.com/5795.html&lt;/a>&lt;/p>
&lt;blockquote>
&lt;p>After enabling the Hot Plug attribute in the motherboard BIOS settings, there will be a side effect: the SSD&amp;rsquo;s LPM power saving will be turned off as hot-plugging is enabled, thereby avoiding data loss during hot-plugging or loss of response when reconnecting.&lt;/p>
&lt;/blockquote>
&lt;blockquote>
&lt;p>If your SSD and motherboard have compatibility issues causing intermittent stuttering, try enabling the Hot Plug option in the motherboard BIOS settings to disable LPM power saving, which might solve the problem.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>After testing, this was effective&lt;/strong>&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Why was there no problem with Intel before, but problems arose after switching to AMD? I suspect it&amp;rsquo;s because the original Intel motherboard was inferior and didn&amp;rsquo;t support SATA LPM, while Windows 10 has LPM enabled by default. The generic SSD doesn&amp;rsquo;t support LPM well, so even though its firmware supports LPM, serious issues can occur. Since the motherboard didn&amp;rsquo;t support LPM, even with Windows enabling LPM, the problem didn&amp;rsquo;t manifest.&lt;/p>
&lt;p>Now with a new motherboard that supports LPM, compatibility issues with the SSD have emerged under default settings. LPM functionality needs to be manually disabled.&lt;/p></description></item><item><title>SVN Learning Notes</title><link>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/svn%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/</link><pubDate>Sun, 01 Jul 2018 15:01:00 +0000</pubDate><guid>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/svn%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/</guid><description>&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>Learning SVN for work purposes. SVN is a C/S type version management system that heavily depends on servers. Most operations are related to the SVN server.&lt;/p>
&lt;h2 id="most-common-operation-flow">Most Common Operation Flow
&lt;/h2>&lt;p>Here we assume the server project address is svn://192.168.1.1/shop&lt;/p>
&lt;ul>
&lt;li>Checkout the project&lt;/li>
&lt;li>Update: update the server project to local&lt;/li>
&lt;li>Commit: submit local changes&lt;/li>
&lt;/ul>
&lt;h2 id="how-to-deploy-an-svn-server">How to Deploy an SVN Server
&lt;/h2>&lt;p>Since SVN is a C/S type software, you need to deploy a server to use it. So we need to set up a server for testing.
To keep it as simple as possible, we&amp;rsquo;ll install VisualSVN software on Windows to act as our server. Note that servers usually run on Linux, but we&amp;rsquo;re using Windows server software here just for ease of getting started. You can easily download VisualSVN Server software from the official website. I downloaded version 3.9. Use the latest stable version. During installation, there&amp;rsquo;s a step to select the standard edition; for other steps, just use the defaults. Pay attention to the port selection to avoid conflicts with ports on your machine. The default port is 443, but you can change it to 8443.&lt;/p>
&lt;h2 id="creating-a-test-project-on-the-server">Creating a Test Project on the Server
&lt;/h2>&lt;p>Since an SVN project is a repository, which is a folder, we need to create a folder. Open the D:\Repositories folder and run the command &lt;code>svnadmin create test1&lt;/code> in that directory to create a project. For other users to access this directory, you need to use the &lt;code>svnserve&lt;/code> command to start the server, which we&amp;rsquo;ll discuss later. You also need to configure permissions. Open the svnserve.conf file in the conf directory under test1, uncomment anon-access, and change its value to write. This allows anonymous access with write permissions.&lt;/p>
&lt;p>Then run the command in the D:\Repositories directory:
&lt;code>svnserve -d -r ./test1&lt;/code>
This step opens the SVN server&amp;rsquo;s listening state.&lt;/p>
&lt;h2 id="common-svn-client-operations">Common SVN Client Operations
&lt;/h2>&lt;p>Download and install TortoiseSVN.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Checkout
Right-click in the directory you want to synchronize, select repo-browser from TortoiseSVN, enter svn://127.0.0.1, and confirm. Right-click on the folder icon and select checkout, then confirm. The checkout is now successful.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Commit
Add a txt file and write something in it. Then right-click and select commit. This will commit to the server.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Update
After developer A submits data and the server changes, developer B needs to synchronize. Right-click and select update.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Ignore
To exclude files from being committed, right-click on the file and select &amp;ldquo;add to ignore list&amp;rdquo;&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="svn-versions">SVN Versions
&lt;/h2>&lt;p>SVN versions start from 1 and increment. SVN can roll back versions. SVN can perform branch and merge operations, but these differ significantly from Git&amp;rsquo;s branch operations. It seems like it creates a new project. The final merge only combines conflicts. This is different from Git&amp;rsquo;s branch operations, which are based on diffs.&lt;/p></description></item><item><title>How to Set Up Xiaohe Shuangpin in Microsoft Pinyin for Windows 10</title><link>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/%E5%A6%82%E4%BD%95%E5%9C%A8windows10%E7%9A%84%E5%BE%AE%E8%BD%AF%E6%8B%BC%E9%9F%B3%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%B0%8F%E9%B9%A4%E5%8F%8C%E6%8B%BC/</link><pubDate>Mon, 05 Jun 2017 06:16:00 +0000</pubDate><guid>https://nansenli.com/post/jianshu/%E9%9A%8F%E7%AC%94/%E5%A6%82%E4%BD%95%E5%9C%A8windows10%E7%9A%84%E5%BE%AE%E8%BD%AF%E6%8B%BC%E9%9F%B3%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%B0%8F%E9%B9%A4%E5%8F%8C%E6%8B%BC/</guid><description>&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>The latest version of Windows 10 system&amp;rsquo;s built-in Pinyin input method already supports Xiaohe Shuangpin. Mom no longer has to worry about me installing bloatware!&lt;/p>
&lt;p>After 4 years, here&amp;rsquo;s an updated advanced setup method. Mom no longer has to worry about me configuring keys one by one:&lt;/p>
&lt;ol>
&lt;li>Press Win + R, type regedit, and open Registry Editor&lt;/li>
&lt;li>Find the &lt;code>Computer\HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS&lt;/code> entry&lt;/li>
&lt;li>Create a new string value named UserDefinedDoublePinyinScheme0 with the value &lt;code>小鹤双拼*2*^*iuvdjhcwfg^xmlnpbksqszxkrltvyovt&lt;/code>&lt;/li>
&lt;li>Open Microsoft Pinyin input method settings and set &lt;code>Xiaohe Shuangpin&lt;/code> as the default scheme for Shuangpin.&lt;/li>
&lt;/ol>
&lt;p>If you&amp;rsquo;re concerned about registry modifications causing system issues, here&amp;rsquo;s a manual configuration method:&lt;/p>
&lt;h2 id="step-1-open-settings">Step 1: Open Settings
&lt;/h2>&lt;p>Although the system&amp;rsquo;s Pinyin input method doesn&amp;rsquo;t have Xiaohe Shuangpin by default, we can customize it.&lt;/p>
&lt;p>First, find the Shuangpin settings location. If you can&amp;rsquo;t find it, you can refer to the animated GIF:
&lt;img src="https://nansenli.com/img/rescued/98a28b5a7a49.gif"
loading="lazy"
alt="Find settings"
>&lt;/p>
&lt;h2 id="step-2-edit-custom-shuangpin">Step 2: Edit Custom Shuangpin
&lt;/h2>&lt;p>The Shuangpin settings are shown in the figure below&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/068b77b04598.png"
loading="lazy"
alt="Xiaohe scheme"
>&lt;/p>
&lt;p>Except for the template section which doesn&amp;rsquo;t need to be set, the rest should be configured according to the image. One is the zero initial mode, and the other is custom key mapping. Custom key mapping should be set according to the preview in the image. Note that there is no &amp;ldquo;er&amp;rdquo; syllable in Xiaohe Shuangpin, so you can set it to either the &amp;ldquo;e&amp;rdquo; or &amp;ldquo;r&amp;rdquo; key. Also, both the &amp;ldquo;ue&amp;rdquo; and &amp;ldquo;ve&amp;rdquo; syllables are set to the &amp;ldquo;T&amp;rdquo; key. Here&amp;rsquo;s a tip: when setting keys, you can directly press the corresponding key instead of finding the key to set.&lt;/p>
&lt;h2 id="step-3-save-the-scheme">Step 3: Save the Scheme
&lt;/h2>&lt;p>If the add button becomes available, it means the scheme is set correctly. After adding the scheme, set it as the default scheme, and you can now use Xiaohe Shuangpin!&lt;/p>
&lt;h2 id="testing">Testing
&lt;/h2>&lt;p>Perform a typing test to check if the settings are correct&lt;/p>
&lt;p>&lt;img src="https://nansenli.com/img/rescued/582a066041c2.gif"
loading="lazy"
alt="Testing"
>&lt;/p>
&lt;h2 id="step-4-click-like">Step 4: Click &amp;ldquo;Like&amp;rdquo;
&lt;/h2>&lt;p>Click &amp;ldquo;Like&amp;rdquo; to improve page ranking and help more people use Xiaohe Shuangpin on Windows 10&lt;/p></description></item></channel></rss>