In the following example, the timer sends a message to the channel every 1 second. It will automatically terminate when the count reaches 10 times. func main() { fmt.Println("Commencing countdown.") tick := time.Tick(1 * time.Second) for countdown :=…

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

在下面这个示例中,定时器每 1 秒向 channel 发生一次消息。当数量达到 10 次时,会自动终止。 func main() { fmt.Println("Commencing countdown.") tick := time.Tick(1 * time.Second) for countdown := 10; countdown > 0; countdown-- { v := <-tick fmt.Println(countdown, v) } } 但是,如果需要中途取消,则需要使用 selec…

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

MYSQL database transactions support the following isolation levels: Read Uncommitted Read Committed Repeatable Read Serializable In each session, the isolation level for transactions can be set, and if not set, the database's default isolation level will be us…

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

MYSQL 数据库事务支持以下几种隔离级别: Read Uncommitted(读取未提交内容) Read Committed(读取提交内容) Repeatable Read(可重读) Serializable(可串行化) 每个会话中,都可以设置事务的隔离级别,如果不设置,就会使用数据库默认的隔离级别。 查询数据库默认隔离级别: show variables like 'transaction_isolation'; SELECT @@transaction_isolation 在当前会话中,设置事务的隔离级别: …

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

Background In Windows, applications can use the app.manifest asset file to configure the role permissions used when the program is launched. The effect is as follows: Under normal circumstances, adding the following configuration to app.manifest is sufficient:…

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

问题背景 在 Windows 中,开发的应用可以使用 app.manifest 资产文件配置程序启动时,使用何种角色权限启动。 效果如下: 正常情况下,在 app.manifest 加上以下配置即可: 如果项目中没有这个文件,可以在项目中新建项-清单文件。 <trustInfo xmlns='urn:schemas-microsoft-com:asm.v2'> <security> <requestedPrivileges xmlns='urn:schemas-microsoft-co…

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

[TOC] Background Actually, I've been planning to write this article for a while, but I've been quite lazy, so I've kept delaying it. Recently, updates are happening too quickly and the competition is intense, so taking advantage of the release of .NET 7, I sta…

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

[TOC] 背景 其实,规划这篇文章有一段时间了,但是比较懒,所以一直拖着没写。 最近时总更新太快了,太卷了,所以借着 .NET 7 正式版发布,熬夜写完这篇文章,希望能够追上时总的一点距离。 本文主要介绍如何在 .NET 和 Go 语言中如何生成系统(Windows)动态链接库,又如何从代码中引用这些库中的函数。 在 .NET 部分,介绍如何使用 AOT、减少二进制文件大小、使用最新的 [LibraryImport] 导入库函数; 在 Go 语言部分,介绍如何使用 GCC 编译 Go 代码、如何通过 syscal…

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

Background During local development, the internal network's HTTPS is considered insecure. This can result in JS requests not being sent. To secure HTTPS, the automatic generation and installation of certificates for local localhost is implemented here. Writing…

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

背景 因为本地开发时,内网的 https 是不安全的 https。 会导致 js 发不出请求。 为了让 https 安全,这里实现了本地 localhost 自动生成证书以及安装的过程。 写代码 生成证书使用的是 .NET 自带的库,不需要引入第三方包。 using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text; 生成证书的方法参考 https://github…

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

Fluentd is deployed in Kubernetes using the fluentd-daemonset-elasticsearch-rbac.yaml file, which contains configurations for RBAC permissions, etc. However, after starting, when checking the Fluentd logs, it shows unread. The reason is an issue with the log l…

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

Fluentd 在 Kubernetes 下部署时,需要使用 fluentd-daemonset-elasticsearch-rbac.yaml 文件,里面配置了 RABC 权限等,但是启动起来后,查看 Fluentd 日志,发现 unread ,原因是日志位置的问题。 原版日志收集配置: volumeMounts: - name: varlog mountPath: /var/log # When actual pod logs in /var/lib/docker/containers, the followi…

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

地址: https://devblogs.microsoft.com/dotnet/configuring-https-in-asp-net-core-across-different-platforms/ 创建一个 https.config 文件: [ req ] default_bits = 2048 default_md = sha256 default_keyfile = key.pem prompt = no encrypt_key = no distinguished_name = r[......]继…

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

地址: https://devblogs.microsoft.com/dotnet/configuring-https-in-asp-net-core-across-different-platforms/ 创建一个 https.config 文件: [ req ] default_bits = 2048 default_md = sha256 default_keyfile = key.pem prompt = no encrypt_key = no distinguished_name = req_distin…

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

默认情况下,MAUI 全屏的时候,任务栏会被屏蔽掉。 参考解决方法:GitHub Issue 5478 获取窗口对象: IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window); WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle); AppWin[......]继续阅读

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

默认情况下,MAUI 全屏的时候,任务栏会被屏蔽掉。 参考解决方法:https://github.com/dotnet/maui/issues/5478 获取窗口对象: IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window); WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);[......]继续阅读

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

Due to the requirements of the new versions of Docker and Kubernetes for the system, the following operations must first be performed to ensure that Docker and kubelet can work properly. First, modify or add the /etc/docker/daemon.json file with the following …

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

由于新版本的 docker 跟 kubernetes 对系统有要求,因此首先要做以下操作,确保 docker、kubelet 可以正常工作。 首先修改或添加 /etc/docker/daemon.json,内容替换如下: { "registry-mirrors": ["https://94zlnekp1.mirror.aliyuncs.com"], "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "1" }, "exec…

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

有以下 N 个因子: new List<string>{"A","B","C"}, // Position 0 new List<string>{"1","2","3"}, // Position 1 new List<string>{"①","②","③"}, new List<string&g…

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

有以下 N 个因子: new List<string>{"A","B","C"}, // 位置 0 new List<string>{"1","2","3"}, // 位置 1 new List<string>{"①","②","③"}, new List<string>{"Ⅰ","Ⅱ","Ⅲ"}, new List<string>{"一","二","三"}, 可以组成多个 n 长度的数组,如: A 1 ① Ⅰ 一 M[......]继续阅读

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