Tauri is an application building toolkit that enables you to build software for all major desktop operating systems using web technologies. Official website: https://tauri.app/zh-cn/ Tauri can build fast, secure, and front-end isolated applications that are cr…

2022年12月28日 7条评论 23868点热度 0人点赞 痴者工良 阅读全文

Tauri 是一款应用构建工具包,让您能够为使用 Web 技术的所有主流桌面操作系统构建软件。 官网地址:https://tauri.app/zh-cn/ Tauri 可以构建跨平台的快速、安全、前端隔离应用,Tauri 支持多种创建项目模板的方式: 安装开发环境 Tauri 支持使用 Windows、Linux、Mac 系统进行开发,笔者将介绍在 Windows 下如何开发。 首先需要安装 C++ core desktop features 组件,到这里可以下载: https://learn.microsoft.…

2022年12月28日 7条评论 24353点热度 0人点赞 痴者工良 阅读全文

通常程序执行 IO 操作时,需要涉及用户空间和内核空间的两个缓冲区。 Only the kernel can operate with hardware such as disks; therefore, when data flows to the program, it must first reside in the kernel buffer, which is known as PageCache. The PageCache mechanism varies across different opera…

2022年12月22日 0条评论 2422点热度 29人点赞 痴者工良 阅读全文

通常程序执行 IO 操作时,需要涉及用户空间和内核空间的两个缓冲区。 只有内核才能跟磁盘等硬件进行操作,因此数据在流向程序时,必定会先存在于内核缓冲区,内核缓冲区又称为 PageCache,不同操作系统的 PageCache 机制不一样。 内核缓冲区:系统内核在内核空间中定义的内核缓冲区,即 PageCache。 用户缓冲区:通过 C 语言或其它语言提供的标准 IO 读写函数在用户空间定义的缓冲区。 从上图中可以看到,IO 操作有两种方式: 缓冲IO:同时使用用户缓冲区和内核缓冲区。需要 3 次数据复制以及 1 次…

2022年12月22日 0条评论 2388点热度 29人点赞 痴者工良 阅读全文

A field is an array. If this record does not exist in the array, add a record to the array. FilterDefinitionBuilder<WorkflowDo> fd = Builders<WorkflowDo>.Filter; var f = fd.And(fd.Eq(x => x.Id, record.Id), fd.Not(fd.ElemMatch(x => x.Definitio…

2022年12月7日 0条评论 2712点热度 28人点赞 痴者工良 阅读全文

1,一个字段是数组,如果数组中不存在这个记录时,向数组增加一个记录。 FilterDefinitionBuilder<WorkflowDo> fd = Builders<WorkflowDo>.Filter; var f = fd.And(fd.Eq(x => x.Id, record.Id), fd.Not(fd.ElemMatch(x => x.Definition, x => x.Version == newVersionStr))); UpdateDefinitio…

2022年12月7日 0条评论 2700点热度 28人点赞 痴者工良 阅读全文

背景: I searched many libraries, but either they charged fees or were too outdated to be used. After extensive testing, I wrote the relevant code for the printer. The implemented code does not rely on third-party libraries. Core Code Import these two libraries: …

2022年12月3日 0条评论 68点热度 4人点赞 痴者工良 阅读全文

背景: 查找了很多库,要么收费,要么太旧用不了。 经过大量测试,写了打印机的相关代码。 实现的代码不依赖于第三方库。 核心代码 引入这两个库: System.Drawing.Printing Vanara.PInvoke.Printing 这两个库用于使用 winspool.drv 服务,可以避免编写大量 库函数调用代码。 首先编写基础代码: public class PrinterBase { /// <summary> /// 获取默认打印机 /// </summary> /// �…

2022年12月3日 0条评论 4846点热度 4人点赞 痴者工良 阅读全文

Introduction to goioc goioc is a dependency injection framework written in Go language that is based on reflection. Supports generics; Simple and easy-to-use API; Simplified object lifecycle management, objects have a life within the scope; Lazy loading, objec…

2022年11月27日 0条评论 102点热度 0人点赞 痴者工良 阅读全文

goioc 介绍 goioc 是一个基于 GO 语言编写的依赖注入框架,基于反射进行编写。 支持泛型; 简单易用的 API; 简易版本的对象生命周期管理,作用域内对象具有生命; 延迟加载,在需要的时候才会实例化对象; 支持结构体字段注入,多层注入; 对象实例化线程安全,作用域内只会被执行一次。 下载依赖: go get -u github.com/whuanle/goioc v2.0.0 快速上手 定义接口: type IAnimal interface { Println(s string) } 实现接口: ty…

2022年11月27日 0条评论 2130点热度 0人点赞 痴者工良 阅读全文

Background: Unable to open remote settings. Also cannot open gpedit.msc. Repair Command (cmd): @echo off pushd "%~dp0" dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt dir /b C:\Windows\s…

2022年11月26日 0条评论 2603点热度 0人点赞 痴者工良 阅读全文

背景: 打不开远程设置。 也打不开 gpedit.msc。 修复命令(cmd): @echo off pushd "%~dp0" dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Pack…

2022年11月26日 0条评论 2649点热度 0人点赞 痴者工良 阅读全文

WorkflowDefinitionValidator is the main entry point for validation, which has a very complex object structure. Reference: https://github.com/serverlessworkflow/specification/blob/main/specification.md By using dependency injection, the fields of the next layer…

2022年11月24日 0条评论 60点热度 0人点赞 痴者工良 阅读全文

WorkflowDefinitionValidator 是整个验证入口,上一个非常复杂的对象结构。 参考:https://github.com/serverlessworkflow/specification/blob/main/specification.md 通过依赖注入,继续检查下一层的字段。 /// <summary> /// Represents the service used to validate <see cref="WorkflowDefinition"/>s /// &…

2022年11月24日 0条评论 2164点热度 0人点赞 痴者工良 阅读全文

The code example is as follows: System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true; services.ConfigureAll<HttpClientFactoryOptions>(options => { options.HttpMessag[......]继续阅读

2022年11月22日 0条评论 54点热度 0人点赞 痴者工良 阅读全文

代码示例如下: System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true; services.ConfigureAll<HttpClientFactoryOptions>(options => { options.HttpMessageHandlerBuilderActions.A[......]继续阅读

2022年11月22日 0条评论 2509点热度 0人点赞 痴者工良 阅读全文

Establishing Link SDK Official Repository Address: https://github.com/open-telemetry/opentelemetry-go Design an execution flow like this: Run executes Run1 and Run2 in sequence: a.Run1(newCtx) a.Run2(newCtx) Inside Run1, another function Run1-1 is also execute…

2022年11月20日 0条评论 114点热度 1人点赞 痴者工良 阅读全文

建立链路 SDK 官方仓库地址: https://github.com/open-telemetry/opentelemetry-go 设计一个这样的执行流程: Run 先后执行 Run1、Run2: a.Run1(newCtx) a.Run2(newCtx) Run1 中,还执行了另一个函数 Run1-1。 使用 opentelemetry SDK 的代码示例如下: package main import ( "context" "go.opentelemetry.io/otel" "io" "log" ) //…

2022年11月20日 0条评论 4024点热度 1人点赞 痴者工良 阅读全文

package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // We must use a buffered channel or risk missing the signal // if we're not ready to receive when the signal is…

2022年11月20日 0条评论 5074点热度 1人点赞 痴者工良 阅读全文

使用示例: package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // We must use a buffered channel or risk missing the signal // if we're not ready to receive when the signal is sent. c := make(chan os…

2022年11月20日 0条评论 5089点热度 1人点赞 痴者工良 阅读全文
191011121354