日常生活的交流与学习

首页 新随笔 联系 管理
  812 随笔 :: 0 文章 :: 2 评论 :: 16万 阅读

2025年2月12日 #

摘要: golang 十进制数转换成八位二进制数 字节操作 移位操作 package main import ( "fmt" ) func main() { mapOne := []byte{191, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 阅读全文
posted @ 2025-02-12 10:42 宇宙无敌美少男战士 阅读(0) 评论(0) 推荐(0) 编辑

2025年2月8日 #

摘要: Golang 值类型 指针类型 package main import "fmt" type Pomodoro struct { todos []string } type Alice struct { pomodoro map[uint16]Pomodoro } type Alex struct 阅读全文
posted @ 2025-02-08 08:00 宇宙无敌美少男战士 阅读(1) 评论(0) 推荐(0) 编辑

2025年1月23日 #

摘要: Task C#后台任务 C# 创建一个没有返回值的任务 using System; using System.Threading; using System.Threading.Tasks; class Program { static async Task Main(string[] args) 阅读全文
posted @ 2025-01-23 08:00 宇宙无敌美少男战士 阅读(9) 评论(0) 推荐(0) 编辑

摘要: 回调函数 事件处理 dotnet .net 有界队列 背压机制(Backpressure)有界队列 通过有界队列来实现背压,确保生产者不会以超过消费者处理能力的速度发送数据。 using System.Threading.Channels; public class Program { static 阅读全文
posted @ 2025-01-23 08:00 宇宙无敌美少男战士 阅读(2) 评论(0) 推荐(0) 编辑

摘要: 回调函数 dotnet .net 消费处理系统 生产者-消费者类型 一个简单的消息处理系统,它使用了.NET的System.Threading.Channels命名空间来创建一个无界的通道(channel),用于在不同的任务之间传递MessageWrapper对象。 无界限的消息队列(Unbound 阅读全文
posted @ 2025-01-23 08:00 宇宙无敌美少男战士 阅读(6) 评论(0) 推荐(0) 编辑

2025年1月20日 #

摘要: golang 多线程 备份文件夹到兄弟层级 wail group D:\GolangTools\src\config\config.go package config type ConfigHandler struct { includeDirNames []string includeFileNa 阅读全文
posted @ 2025-01-20 22:08 宇宙无敌美少男战士 阅读(2) 评论(0) 推荐(0) 编辑

摘要: 按键交换reg 注册表的位置 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout reg案例 交换 Esc 和 Caps_Lock 键位 Windows Registry Editor Version 5.00 [H 阅读全文
posted @ 2025-01-20 08:00 宇宙无敌美少男战士 阅读(15) 评论(0) 推荐(0) 编辑

2025年1月19日 #

摘要: code2md golang D:\GolangTools\src\config\config.go package config type ConfigHandler struct { includeDirNames []string includeFileNames []string exclu 阅读全文
posted @ 2025-01-19 08:00 宇宙无敌美少男战士 阅读(2) 评论(0) 推荐(0) 编辑

2025年1月18日 #

摘要: golang 指针传递和值传递 package main import "fmt" type MyStruct struct { Value string } // 值传递 // ModifyStruct takes a MyStruct by value and tries to modify i 阅读全文
posted @ 2025-01-18 08:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

2025年1月12日 #

摘要: golang中 &和*的区别 & 用于获取地址 * 用于声明时,就是声明指针类型, 用于解引用时,就是解引用指针。 & 是取地址操作符,用于获取变量的内存地址。例如: package main import "fmt" func main() { var num int = 10 // 获取 num 阅读全文
posted @ 2025-01-12 08:00 宇宙无敌美少男战士 阅读(36) 评论(0) 推荐(0) 编辑

2025年1月11日 #

摘要: golang 函数和方法的区别 一句话总结就是,func直接函数名就是函数,否则就是方法. 至于是谁的的方法,看函数前面有没有*号的指向. golang中函数第一等公民,所以以函数优先. demo\main.go package main import "fmt" // 定义一个结构体 type S 阅读全文
posted @ 2025-01-11 22:48 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

摘要: golang 单元测试 命令行 日志打印 测试结果打印控制台 test.bat @REM go test -timeout 30s -run ^TestMultiPong$ github.com/jergoo/go-grpc-tutorial/ping @REM go test -timeout 3 阅读全文
posted @ 2025-01-11 22:11 宇宙无敌美少男战士 阅读(24) 评论(0) 推荐(0) 编辑

2025年1月10日 #

摘要: prism中依赖注入的使用 BlankApp\BlankApp\App.xaml.cs using System.Windows; using BlankApp.Views; using Prism.Ioc; namespace BlankApp { /// <summary> /// Intera 阅读全文
posted @ 2025-01-10 08:00 宇宙无敌美少男战士 阅读(7) 评论(0) 推荐(0) 编辑

2025年1月9日 #

摘要: 如何执行lua脚本 :lua vim.print(package.loaded) 如何映射jk键 vim.keymap.set('i', 'jk', '<Esc>') vim.keymap.set('t', 'jk', [[<C-\><C-n>]]) 上面中的参数t是什么意思,在什么场景中的使用 在 阅读全文
posted @ 2025-01-09 08:00 宇宙无敌美少男战士 阅读(59) 评论(0) 推荐(0) 编辑

2025年1月1日 #

摘要: DataTable 的线程安全问题 背景 虽然说一般只读不太会涉及到线程安全问题, 但是实际在编写代码的过程中发现data table即使是读取也是线程不安全的. 我的当时的代码是想要在多线中基于此data table创建一个data row,一开始以为是闭包的问题, 后来解决闭包问题之后,发现还有 阅读全文
posted @ 2025-01-01 08:00 宇宙无敌美少男战士 阅读(11) 评论(0) 推荐(0) 编辑

2024年12月26日 #

摘要: AutoMapper中映射对象属性不同的处理 Creating Rules for Mapping Properties With Different Names But what if we have different property names in our source and desti 阅读全文
posted @ 2024-12-26 08:00 宇宙无敌美少男战士 阅读(9) 评论(0) 推荐(0) 编辑

摘要: AutoMapper的使用 根据上传的文件内容,可以看到AutoMapper被用来映射不同对象之间的属性。具体来说,它用于将一个类的实例转换为另一个类的实例,而这两个类拥有相似的结构或部分相似的属性。以下是基于提供的代码对AutoMapper用法的总结: 安装和引用: 在TodoList.Api.c 阅读全文
posted @ 2024-12-26 08:00 宇宙无敌美少男战士 阅读(14) 评论(0) 推荐(0) 编辑

摘要: AutoMapper的默认映射规则 convertions map complex object to flat/simple ones Default conventions AutoMapper uses the following conventions: It will automatica 阅读全文
posted @ 2024-12-26 08:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

2024年12月21日 #

摘要: dotnet ef migrations Infrastructure\DependencyInjection\InfrastructureDependencyInjection.cs services.AddDbContext<MySqlDatabase>(options => { options 阅读全文
posted @ 2024-12-21 08:00 宇宙无敌美少男战士 阅读(5) 评论(0) 推荐(0) 编辑

2024年12月4日 #

摘要: SQLSugar中查询DataTable public class BaseRespository : IBaseRespository { private readonly ISqlSugarClient _dbOracleSAPSR3; private readonly ILogger<Base 阅读全文
posted @ 2024-12-04 08:00 宇宙无敌美少男战士 阅读(37) 评论(0) 推荐(0) 编辑

2024年11月30日 #

摘要: 手动批量注入service 自动依赖注入 C# asp.net dontet 依赖注入 public static class ServiceCollectionExtensions { // 批量注入所有的继承IBaseService的Service public static void AddP 阅读全文
posted @ 2024-11-30 08:00 宇宙无敌美少男战士 阅读(9) 评论(0) 推荐(0) 编辑

2024年11月27日 #

摘要: SeedData 怎么写 数据库上下文 怎么拿到 依赖注入 builder.Services.AddDbContext<BlazorMovieContext>(options => options.UseSqlServer( builder.Configuration.GetConnectionSt 阅读全文
posted @ 2024-11-27 08:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

摘要: blazor 折叠按钮 功能 <div class="top-row ps-3 navbar navbar-dark"> <div class="container-fluid"> <!-- 👇👇👇 --> <button title="Navigation menu" class="navb 阅读全文
posted @ 2024-11-27 08:00 宇宙无敌美少男战士 阅读(13) 评论(0) 推荐(0) 编辑

摘要: 实体状态 分离状态 未更改状态 已添加状态 已删除状态 已修改状态 Entity Framework Detached、Unchanged、Added、Deleted、Modified efcore 五种状态 Detached(分离状态): 当实体对象被创建但尚未与任何Entity Framewor 阅读全文
posted @ 2024-11-27 08:00 宇宙无敌美少男战士 阅读(22) 评论(0) 推荐(0) 编辑

摘要: QuickGrid 使用 Blazor 依赖注入 builder.Services.AddQuickGridEntityFrameworkAdapter(); 绑定使用 QuickGrid的使用如下: 在BlazorMovie-main\BlazorMovie\Pages\Movies\Index. 阅读全文
posted @ 2024-11-27 08:00 宇宙无敌美少男战士 阅读(48) 评论(0) 推荐(0) 编辑

摘要: Blazor razor 注释参数 SupplyParameterFromQuery SupplyParameterFromForm OnInitializedAsync 参数属性: [SupplyParameterFromQuery] public int Id { get; set; } [Su 阅读全文
posted @ 2024-11-27 08:00 宇宙无敌美少男战士 阅读(12) 评论(0) 推荐(0) 编辑

2024年11月20日 #

摘要: vimiun chrome msedge 配置 { "name": "Vimium C", "@time": "2024/11/20 19:54:58", "time": 1732103698988, "environment": { "extension": "1.99.994", "platfo 阅读全文
posted @ 2024-11-20 20:24 宇宙无敌美少男战士 阅读(18) 评论(0) 推荐(0) 编辑

摘要: vscode 配置markdown的代码片及其不生效问题解决 markdown.json 的配置文件 // Place your snippets for markdown here. Each snippet is defined under a snippet name and has a pr 阅读全文
posted @ 2024-11-20 20:20 宇宙无敌美少男战士 阅读(42) 评论(0) 推荐(0) 编辑

2024年11月15日 #

摘要: 为什么说說深呼吸實際上也無法讓人放鬆? 從呼吸肌肉的觀點來看當你遇到周遭親朋好友緊張、焦慮、情緒激動的時候,你會給他們什麼建議呢? 相信大家都會不加思索地說:趕快做深呼吸。 的確,大家從小就被灌輸一個觀念,深呼吸是一個讓人很放鬆的呼吸方式。 我一直也是這麼認為,直到我在加拿大學習放鬆減量呼吸訓練,聽 阅读全文
posted @ 2024-11-15 18:48 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

2024年11月8日 #

摘要: dotnet cli 发布脚本 publish_remote.bat 该脚本实现一键主要发布到远程的共享文件夹中 @echo off :: 定义变量 SHARE_PATH:共享文件夹, SOURCE_DIR:代码发布的文件夹, TARGET_DIR:目标文件夹(共享文件夹的映射) set PRO_P 阅读全文
posted @ 2024-11-08 08:00 宇宙无敌美少男战士 阅读(24) 评论(0) 推荐(0) 编辑

2024年11月3日 #

摘要: asp.net dotnet razor page mvc 过滤器 数据验证过滤器 数据库事务过滤器 Program.cs注册过滤器 services.AddRazorPages(opt => { opt.Conventions.ConfigureFilter(new DbContextTransa 阅读全文
posted @ 2024-11-03 16:46 宇宙无敌美少男战士 阅读(10) 评论(0) 推荐(0) 编辑

摘要: webapi dotnet Program.cs 的封装 精简代码 拆分成两个部分RegisterServices(builder);和ConfigureApplication(app); 或者使用代码块,大括号来进行拆分. using HtmlTags; using MediatR; using 阅读全文
posted @ 2024-11-03 16:46 宇宙无敌美少男战士 阅读(7) 评论(0) 推荐(0) 编辑

摘要: asp.net MiniProfiler 性能分析工具 1. 依赖包 这里使用了MiniProfiler.AspNetCore.Mvc和MiniProfiler.EntityFrameworkCore两个依赖包。从ContosoUniversity.csproj文件中可以看到相关的引用: <Pack 阅读全文
posted @ 2024-11-03 16:45 宇宙无敌美少男战士 阅读(31) 评论(0) 推荐(0) 编辑

2024年10月31日 #

摘要: # wpf 数据绑定 DataContext App\App\MainWindow.xaml <Window x:Class="Application.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentati 阅读全文
posted @ 2024-10-31 19:49 宇宙无敌美少男战士 阅读(19) 评论(0) 推荐(0) 编辑

摘要: # wpf UI 界面 数据绑定 四种类型 ComplicatedButton\ComplicatedButton\MainWindow.xaml <Window x:Class="WpfApp.MainWindow" xmlns="http://schemas.microsoft.com/winf 阅读全文
posted @ 2024-10-31 19:01 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

摘要: button 按钮 content属性 阅读全文
posted @ 2024-10-31 08:00 宇宙无敌美少男战士 阅读(6) 评论(0) 推荐(0) 编辑

摘要: 列宽,行宽,倍数关系 跨行,跨列 阅读全文
posted @ 2024-10-31 08:00 宇宙无敌美少男战士 阅读(1) 评论(0) 推荐(0) 编辑

摘要: 描述性注释 MS_Description 查看特别表,所有字段 描述性注释 SELECT obj.name AS ObjectName, col.name AS ColumnName, ep.value AS Description FROM sys.extended_properties ep I 阅读全文
posted @ 2024-10-31 08:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

2024年10月29日 #

摘要: wpf 触发器 多条件触发器 <Window x:Class="GridDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microso 阅读全文
posted @ 2024-10-29 19:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

摘要: wpf 数据绑定 viewmodel 阅读全文
posted @ 2024-10-29 19:00 宇宙无敌美少男战士 阅读(3) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示