首页
Search
1
41 阅读
2
FydeOS - 适合国内用户使用的Chrome OS系统
19 阅读
3
欣小逸食用指北
14 阅读
4
北理图集(4.28-5.16)
13 阅读
5
整合包食用说明
13 阅读
默认分类
笔记
登录
Search
标签搜索
日常
代码
欣小逸
bot
FydeOS
Electron
sqlite3
自动控制原理
笔记
拾雨
累计撰写
16
篇文章
累计收到
22
条评论
首页
栏目
默认分类
笔记
页面
搜索到
16
篇与
的结果
2024-03-09
给Markdown编辑器加了一个Mermaid支持(
MermaidMermaid 是一个基于JavaScript的图表工具,可以将Markdown语法的内容渲染成流程图等 然而之前我的博客的编辑器是不支持这个的,所以昨天折腾了一番加入了这个功能(graph TD; A-->B; A-->C; B-->D; C-->D;例如上面的代码可以被渲染成下面的流图 graph TD; A-->B; A-->C; B-->D; C-->D; 加入首先需要在页面中引入JS文件,可以通过Script标签的形式(<script type="module"> import mermaid from 'https://npm.elemecdn.com/mermaid@10/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script>这里我使用的是国内的CDN,加载速度会快一些,当然也可以用JsDeliver的CDNhttps://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs引入后会将页面中class=mermaid的元素内容自动渲染成流图,目前已知标签内必须是纯文本,不能有<br/>等,换行标记\n可以有 sequenceDiagram Alice->>Bob: Hello Bob, how are you ? Bob->>Alice: Fine, thank you. And you? create participant Carl Alice->>Carl: Hi Carl create actor D as Donald Carl->>D: Hi
2024年03月09日
4 阅读
0 评论
0 点赞
2023-11-01
A way to solve error in packing electron app with sqlite3
你现在看到的是本文章的英文版本,中文版本请前往 Electron应用打包Sqlite3报错的解决方案Recently I build a Electron program with database.I finally chose the Sqlite3 module to connect with my database. It worked well in dev mode. When I prepared to pack and publich it throwed the error below:ERROR in ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders <!doctype html> after installing pnpm i npm bluebird mock-aws-s3 aws-sdk nock --save-optionaland aws-sdk,mock-aws-s3,nock were not founda script .cs could not run(not C#, a powershell script)Ways to solveFor the first issue, it showes that HTML's loader was not found when webpack tried to pack program. So you should edit the config of webpack. Add the rules in the config's module->rules: { test: /\.html$/, use: { loader: 'html-loader', }, }This attach the HTML files with html-loader, which can properly handle the file.For the next issue, it is also lack of a loader for Sqlite3 to pack. I found for a while and got the solution in a Github issue #1700 :Install sqlite3-loader和node-loadernpm install sqlite3-loader node-loaderSamely update the config of webpack: { test: /sqlite3-binding\.js$/, use: [ 'sqlite3-loader' ], }, { test: /\.node$/, use: 'node-loader', },Repack and successTipsWhen finding the solution, someone said add this to webpack config:externals: { sqlite3: 'sqlite3' }I tried and it could pack, but will exclude the sqlite3 module and when running the packed program it cannot found it. So the program cannot run properly.
2023年11月01日
2 阅读
0 评论
0 点赞
2023-08-27
Electron应用打包Sqlite3报错的解决方案
You are watching the Chinese version of this passage, to English version, please check A way to solve error in packing electron app with sqlite3最近拿Electron写了一个GUI,然后用到了数据库数据库模块搜寻一番后用了Sqlite3这个模块,于是开始了长达四个小时的网络搜寻(在dev下程序可以正常运行,但是一到打包的时候就开始报错错误内容如下:(找的别的但是是这些个)ERROR in ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders <!doctype html> after installing pnpm i npm bluebird mock-aws-s3 aws-sdk nock --save-optional以及aws-sdk,mock-aws-s3,nock这三个库缺失以及一个脚本无法运行的问题,是.cs的脚本(一开始还以为是C#的代码)问题解决方案对于第一个问题,是webpack在打包过程中缺失了对HTML的loader,因此在webpack的config里的module->rules加入以下规则: { test: /\.html$/, use: { loader: 'html-loader', }, }即可消除这条错误对于后面四个,其实也是对sqlite3缺乏一个loader来进行打包,在网上找了巨久(终于在Github的一个issue里找到了解决方案 #1700 :安装 sqlite3-loader和node-loadernpm install sqlite3-loader node-loader同样更新webpack配置文件,在刚刚的rules里加上: { test: /sqlite3-binding\.js$/, use: [ 'sqlite3-loader' ], }, { test: /\.node$/, use: 'node-loader', },重新打包即可解决问题提示之前有看到说在config里加上externals: { sqlite3: 'sqlite3' }的,我试过了,能打包,就是运行之后会报错找不到模块sqlite3而已(
2023年08月27日
3 阅读
0 评论
0 点赞
2022-05-27
教学格式
回复中可以使用的特殊文本这些会被自动替换成对应的内容例:[name]早上好啊([name]会被自动替换成发送消息的人)[qq]——qq号[name]——昵称[r]——1-100之间的随机数[@qq]会变成at发送消息的人[hg]好感度回复,在回复中使用[hg]隔开,当好感度低于一定值时回复[hg]前面的内容,否则回复后面的内容(例如把回复内容设置为1[hg]2,则好感度低时回复1,高时回复2)分群教学(群主或群管理可以使用)格式分群教学[split]触发词[split]回复示例 {copy showText="点我复制" copyText="分群教学[split]小逸[split]我在!"/}分群教学[split]小逸[split]我在!小逸会告诉你这条消息的ID,请记住它,查询或者删除时需要使用,后期对接web端可以直接在网页上查看(咕咕咕)!{callout color="#ef4d4d"}注意:分群教学需要审核通过后才会启用,审核周期不定(咕咕咕),可以发送我的词库查看各个词库的状态{/callout}全局教学(仅小逸管理员可用)格式教学[split]触发词[split]回复
2022年05月27日
3 阅读
0 评论
0 点赞
2022-05-19
北理图集(4.28-5.16)
来咯!如果您是手机端,请点击右上角,选择“在浏览器中打开”,随后点击下载按钮! 下载! {abtn icon="fa-download" color="#66ccff" href="https://blog.kanosaikou.cn/images/Image04.zip" radius="17.5px" content="图片下载"/}
2022年05月19日
13 阅读
0 评论
0 点赞
1
2
3
4