<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: qianduan</title>
    <description>The latest articles on DEV Community by qianduan (@huaian).</description>
    <link>https://dev.to/huaian</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3446677%2F14ddce05-4f5c-4606-83ff-9a93ce6341fe.png</url>
      <title>DEV Community: qianduan</title>
      <link>https://dev.to/huaian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/huaian"/>
    <language>en</language>
    <item>
      <title>让代码更加整洁</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Wed, 18 Mar 2026 09:23:17 +0000</pubDate>
      <link>https://dev.to/huaian/rang-dai-ma-geng-jia-zheng-ji-346o</link>
      <guid>https://dev.to/huaian/rang-dai-ma-geng-jia-zheng-ji-346o</guid>
      <description>&lt;p&gt;设计模式:&lt;/p&gt;

&lt;p&gt;组合模式&lt;br&gt;
模板模式&lt;br&gt;
单例模式&lt;/p&gt;

&lt;p&gt;领域驱动设计&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;上下文&lt;/li&gt;
&lt;li&gt;实体&lt;/li&gt;
&lt;li&gt;repository&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;关注点分离: &lt;/p&gt;

&lt;p&gt;坏味道:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;重复&lt;/li&gt;
&lt;li&gt;无法贡献&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;关键路径:&lt;br&gt;
找到性价比最高的提效方式,分析流程,找到其中的瓶颈,提升后重新分析瓶颈 如此循环&lt;/p&gt;

&lt;p&gt;设计质量&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Use open api to request</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Tue, 17 Mar 2026 12:02:04 +0000</pubDate>
      <link>https://dev.to/huaian/use-open-api-to-request-4afj</link>
      <guid>https://dev.to/huaian/use-open-api-to-request-4afj</guid>
      <description>&lt;p&gt;现在系统的相关请求是通过cookie传递的,现在要切换成通过openAPI,open API的机制是在头部设置 将 AccessToken 置于业务接口的 header 参数中，key 为 Authorization ; 在URL 请求参数中携带随机字符串和签名.获取token的方法 和 签名的方法都已经实现,使用openapi的方式进行请求可以更加安全&lt;/p&gt;

</description>
    </item>
    <item>
      <title>slowly install for pulsar</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Fri, 13 Mar 2026 08:09:53 +0000</pubDate>
      <link>https://dev.to/huaian/slowly-install-for-pulsar-283h</link>
      <guid>https://dev.to/huaian/slowly-install-for-pulsar-283h</guid>
      <description>&lt;p&gt;in package.json we install&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"scripts": {&lt;br&gt;
    "postinstall": "cd ./node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client &amp;amp;&amp;amp; pnpm run install",&lt;br&gt;
    "start": "cross-env NODE_ENV=development nodemon --watch app -e ts,tsx --exec ts-node --require tsconfig-paths/register --files app/index.ts",&lt;br&gt;
    "beautify": "npx prettier --write \"**/*.{js,ts,json,html,scss,css}\""&lt;br&gt;
  }&lt;/code&gt;,&lt;br&gt;
  "dependencies": {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"pulsar-client": "1.12.0",
"pulsar-flex": "^1.1.1",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

&lt;p&gt;add the following config into your .npmrc file to enhance the speed&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pulsar_binary_host_mirror=https://mirrors.huaweicloud.com/apache/pulsar/pulsar-client-node/&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>performance</category>
      <category>tooling</category>
    </item>
    <item>
      <title>solve download issue for nodejs</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Wed, 11 Mar 2026 03:35:28 +0000</pubDate>
      <link>https://dev.to/huaian/solve-download-issue-for-nodejs-5gfb</link>
      <guid>https://dev.to/huaian/solve-download-issue-for-nodejs-5gfb</guid>
      <description>&lt;p&gt;add the following settings in .npmrc file&lt;/p&gt;

&lt;p&gt;registry=&lt;a href="http://npm.ddxq.mobi/" rel="noopener noreferrer"&gt;http://npm.ddxq.mobi/&lt;/a&gt;&lt;br&gt;
disturl=&lt;a href="https://npmmirror.com/mirrors/node" rel="noopener noreferrer"&gt;https://npmmirror.com/mirrors/node&lt;/a&gt;&lt;br&gt;
NODEJS_ORG_MIRROR=&lt;a href="https://npmmirror.com/mirrors/node" rel="noopener noreferrer"&gt;https://npmmirror.com/mirrors/node&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to mujoco</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Tue, 10 Mar 2026 11:13:30 +0000</pubDate>
      <link>https://dev.to/huaian/introduction-to-mujoco-24ie</link>
      <guid>https://dev.to/huaian/introduction-to-mujoco-24ie</guid>
      <description>&lt;h1&gt;
  
  
  set environment
&lt;/h1&gt;

&lt;p&gt;echo "export PATH=$PATH:/Users/chenxiangyun05/MuJoCoBin/mujoco-3.3.0/bin" &amp;gt;&amp;gt; ~/.bashrc&lt;/p&gt;

&lt;p&gt;source ~/.bashrc&lt;/p&gt;

&lt;p&gt;既然你是 Bash，那么环境变量就应该写入 ~/.bash_profile（注意：不是 ~/.bashrc！）&lt;/p&gt;

&lt;p&gt;💡 macOS 上 Bash 的加载规则很特殊：&lt;/p&gt;

&lt;p&gt;登录式 shell（比如你打开 Terminal.app）会读取 ~/.bash_profile&lt;br&gt;
不会自动读取 ~/.bashrc&lt;br&gt;
而 Linux 上的 Bash 通常读 ~/.bashrc&lt;br&gt;
所以你之前写入 ~/.bashrc 是无效的！&lt;/p&gt;

&lt;h1&gt;
  
  
  注意：这里写入的是 ~/.zshrc，不是 ~/.bashrc！
&lt;/h1&gt;

&lt;p&gt;echo 'export PATH="$PATH:/Users/chenxiangyun05/MuJoCoBin/mujoco-3.3.0/bin"' &amp;gt;&amp;gt; ~/.zshrc&lt;/p&gt;

&lt;p&gt;source ~/.zshrc&lt;/p&gt;

&lt;p&gt;方法 1：查看当前 Shell 进程&lt;br&gt;
Bash&lt;br&gt;
编辑&lt;br&gt;
echo $0&lt;br&gt;
如果输出是 -zsh 或 /bin/zsh → 你正在用 Zsh&lt;br&gt;
如果输出是 -bash 或 /bin/bash → 你正在用 Bash&lt;/p&gt;

&lt;h1&gt;
  
  
  view model
&lt;/h1&gt;

&lt;p&gt;simulate ~/MuJoCoBin/mujoco-3.3.0/model/humanoid/humanoid.xml&lt;/p&gt;

&lt;h1&gt;
  
  
  record
&lt;/h1&gt;

&lt;p&gt;record ~/MuJoCoBin/mujoco-3.3.0/model/humanoid/humanoid.xml 5 60 rgb.out&lt;/p&gt;

&lt;h1&gt;
  
  
  save to mp4
&lt;/h1&gt;

&lt;p&gt;ffmpeg -f rawvideo -pixel_format rgb24 -video_size 2560x1440 \&lt;br&gt;
-framerate 60 -i rgb.out -vf "vflip,format=yuv420p" video.mp4&lt;/p&gt;

&lt;h1&gt;
  
  
  reference:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.csdn.net/nenchoumi3119/article/details/148085428" rel="noopener noreferrer"&gt;https://blog.csdn.net/nenchoumi3119/article/details/148085428&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://news.qq.com/rain/a/20250605A01TIV00" rel="noopener noreferrer"&gt;https://news.qq.com/rain/a/20250605A01TIV00&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.mujoco.cn/en/stable/overview.html" rel="noopener noreferrer"&gt;https://docs.mujoco.cn/en/stable/overview.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;g++ 编译&lt;/p&gt;

&lt;p&gt;g++ ~/c++/test.cpp \&lt;br&gt;
  -F /Users/chenxiangyun05/.mujoco \&lt;br&gt;
  -I /Users/chenxiangyun05/.mujoco/mujoco.framework/Headers \&lt;br&gt;
  -std=c++17 \&lt;br&gt;
  -Wl,-rpath,/Users/chenxiangyun05/.mujoco/mujoco.framework/Versions/A \&lt;br&gt;
  /Users/chenxiangyun05/.mujoco/mujoco.framework/Versions/A/mujoco \&lt;br&gt;
  -o ~/c++/test&lt;/p&gt;




&lt;p&gt;g++ ~/c++/stimulate_ball.cpp \&lt;br&gt;
  -F /Users/chenxiangyun05/.mujoco \&lt;br&gt;
  -I /Users/chenxiangyun05/.mujoco/mujoco.framework/Headers \&lt;br&gt;
  -std=c++17 \&lt;br&gt;
  -Wl,-rpath,/Users/chenxiangyun05/.mujoco/mujoco.framework/Versions/A \&lt;br&gt;
  /Users/chenxiangyun05/.mujoco/mujoco.framework/Versions/A/mujoco \&lt;br&gt;
  -o ~/c++/stimulate_ball&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to use js in nginx</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Mon, 22 Sep 2025 09:44:43 +0000</pubDate>
      <link>https://dev.to/huaian/how-to-use-js-in-nginx-5f49</link>
      <guid>https://dev.to/huaian/how-to-use-js-in-nginx-5f49</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I heard that js can be used in nginx. nginx has use quickjs ,so we can use js in nginx config. That is exciting to me, I want to try it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;But when I see the doc, I am crying. It is so complicated. I have to download source for njs and quickjs, and nginx. After all three source download, I have to run configure \ make &amp;amp;&amp;amp; make install . Oh my god&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I try to download all the source files&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/nginx/njs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; wget http://nginx.org/download/nginx-1.25.3.tar.gz  # 确保版本 ≥ 1.23.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
# 下载 OpenSSL 源码（以 3.0.8 为例）
wget https://www.openssl.org/source/openssl-3.0.8.tar.gz
tar -zxvf openssl-3.0.8.tar.gz
cd openssl-3.0.8

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 git clone https://github.com/bellard/quickjs
 cd quickjs/
CFLAGS='-fPIC' make libquickjs.a  # 生成位置无关代码

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
project_root/
├── nginx-1.25.3/       # Nginx 源码目录
└── quickjs/            # QuickJS 源码目录（需手动创建或克隆）
└── njs/            # QuickJS 源码目录（需手动创建或克隆）

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
# 授予当前用户读取权限
sudo chmod -R 755 ../quickjs

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;I feel so disappointed. We need to configure the file with command below
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./configure  --add-dynamic-module=../njs/nginx --with-openssl=../openssl-3.0.8  --with-cc-opt="-I $(pwd)/../quickjs"  --with-ld-opt="-L $(pwd)/../quickjs"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After configure step, we still need to make and make install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make &amp;amp;&amp;amp; sudo make install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I run nginx start .something wrong again, It shows mismatch for njs and nginx. I try to run command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;whereis nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nginx: /opt/homebrew/bin/nginx /opt/homebrew/share/man/man8/nginx.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It seems that I dont use the nginx I compiled. I tried to use direct path for nginx and then It can not find correct config file. So I decide to use all direct path&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./objs/nginx -c ~/workspace/nginx-1.25.3/conf/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;even if the config file use direct path&lt;/p&gt;

&lt;p&gt;Stop the nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./objs/nginx -c ~/workspace/nginx-1.25.3/conf/nginx.conf -s stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;start&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./objs/nginx -c ~/workspace/nginx-1.25.3/conf/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;visit the &lt;a href="http://localhost" rel="noopener noreferrer"&gt;http://localhost&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "message": "Request processed at 1758537787024",
  "stats": {
    "headerCount": 15,
    "customHeaders": 0
  },
  "serverInfo": "GET / HTTP/1.1"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>devops</category>
    </item>
    <item>
      <title>basic guide to anroid development</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Mon, 01 Sep 2025 08:38:23 +0000</pubDate>
      <link>https://dev.to/huaian/basic-guide-to-anroid-development-1hlm</link>
      <guid>https://dev.to/huaian/basic-guide-to-anroid-development-1hlm</guid>
      <description>&lt;ol&gt;
&lt;li&gt;gradlew Gradle Wrapper,use gradlew to build &lt;/li&gt;
&lt;li&gt;pay attention to settings in gradle: in fact there are two kinds of gradle file, one for project one for app. In gradle file, we set target SDK version and jdk version&lt;/li&gt;
&lt;li&gt;do not upgrade key versions: 1. target SDK version 2. jdk version &lt;/li&gt;
&lt;li&gt;sync if necessary: when update settings file,there will be a sync button shown, click the sync button to sync &lt;/li&gt;
&lt;li&gt;use mirror to accelarate your maven source: &lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>android</category>
      <category>gradle</category>
      <category>development</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to set access rights</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Fri, 29 Aug 2025 08:37:13 +0000</pubDate>
      <link>https://dev.to/huaian/how-to-set-access-rights-nai</link>
      <guid>https://dev.to/huaian/how-to-set-access-rights-nai</guid>
      <description>&lt;ol&gt;
&lt;li&gt;add auth string into route meta&lt;/li&gt;
&lt;li&gt;add auth string map into power managment&lt;/li&gt;
&lt;li&gt;add route in application and add auth stirng added step1 and step2&lt;/li&gt;
&lt;li&gt;add auth string to role &lt;/li&gt;
&lt;li&gt;add people into role if needed&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>security</category>
      <category>authentication</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>How to build anroid application</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Thu, 28 Aug 2025 07:16:58 +0000</pubDate>
      <link>https://dev.to/huaian/how-to-build-anroid-application-jog</link>
      <guid>https://dev.to/huaian/how-to-build-anroid-application-jog</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;//    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'&lt;br&gt;
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>android</category>
    </item>
    <item>
      <title>Use alasql to use sql feature in web</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Thu, 28 Aug 2025 07:09:00 +0000</pubDate>
      <link>https://dev.to/huaian/use-alasql-to-use-sql-feature-in-web-3plj</link>
      <guid>https://dev.to/huaian/use-alasql-to-use-sql-feature-in-web-3plj</guid>
      <description></description>
      <category>sql</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>why frontend developer is always get hurt</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Fri, 22 Aug 2025 05:05:22 +0000</pubDate>
      <link>https://dev.to/huaian/why-frontend-developer-is-always-get-hurt-10hf</link>
      <guid>https://dev.to/huaian/why-frontend-developer-is-always-get-hurt-10hf</guid>
      <description>&lt;ol&gt;
&lt;li&gt;directly face the UI process problems&lt;/li&gt;
&lt;li&gt;act a a tool to support many projects&lt;/li&gt;
&lt;li&gt;always be looked down upon by backend developer&lt;/li&gt;
&lt;li&gt;can not show value &lt;/li&gt;
&lt;li&gt;not farmiliiar with business&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>how to totally automatically generate vue form</title>
      <dc:creator>qianduan</dc:creator>
      <pubDate>Thu, 21 Aug 2025 12:05:31 +0000</pubDate>
      <link>https://dev.to/huaian/how-to-totally-automatically-generate-vue-form-mb8</link>
      <guid>https://dev.to/huaian/how-to-totally-automatically-generate-vue-form-mb8</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;generate a list ,each item has attributes like [{title: '', key:'',placeHolder: ''}]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when post data,put all the key values in one object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when query data from backend,all the value stored in one object. then we can use model to map each key&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
