Fixing issues related to missing components in the system: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Checkhealth DISM.exe /Online /Cleanup-image /Restorehealth sfc /scannow [......] 继续阅读
Fixing issues related to missing components in the system: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Checkhealth DISM.exe /Online /Cleanup-image /Restorehealth sfc /scannow [......] 继续阅读
修复系统缺少组件等问题: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Checkhealth DISM.exe /Online /Cleanup-image /Restorehealth sfc /scannow [......] 继续阅读
原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.2 中引入的新类型:Span 和 Memory,文章深入研究 Span<T> 和 Memory<T> ,并演示如何在 C# 中使用它们。 本文所有代码用例在 .NET 6.0 下运行。 .NET 中…
原作者:Joydip Kanjilal 原文地址:https://www.codemag.com/Article/2207031/Writing-High-Performance-Code-Using-SpanT-and-MemoryT-in-C 本文采用半译方式。 在本文中,将会介绍 C# 7.2 中引入的新类型:Span 和 Memory,文章深入研究 Span<T> 和 Memory<T> ,并演示如何在 C# 中使用它们。 本文所有代码用例在 .NET 6.0 下运行。 .NET 中…
In MySQL, batch inserting auto-increment columns cannot return the auto-incremented IDs in bulk. To solve the problem of batch insertion, we use atomic operations in Redis to implement a lock-free atomic allocation of auto-incremented IDs. The core idea is to …
在 Mysql 中,批量插入自增列,是不能批量返回自增后的 Id,为了解决批量插入的问题,利用 Redis 的原子操作,实现无锁原子分配 自增 Id。 核心是在 Redis 中,保存表的最大 Id。 每次插入前,检查缓存 CacheId 跟数据库 MaxId 相比,如果 CacheId > MaxId,说明 CacheId 可以使用。这个阶段需要保证原子性。 插入前,需要向 Redis 申请获取一个范围的 Id,然后插入到数据库中。 定义接口: /// <summary> /// 自增列批量插入服…
When the collection is null, the code is as follows: List<int>? _a = null; List<int>? _b = null; var a = _a?.Any() == false; var b = _a?.Any() == true; var c = _b?.Any() == false; var d = _b?.Any() == true; When th[......] 继续阅读
[ThreadStatic] private static bool HasCreated = false; [ThreadStatic] private static int Value = 0; void Main() { Console.WriteLine(Thread.CurrentThread.ManagedThreadId); ThreadLocal<string> a = new ThreadLocal<string>(() => { if (HasCreated) re…
如下面代码: [ThreadStatic] private bool HasCreated = false; [ThreadStatic] private int Value = 0; void Main() { ThreadLocal<string> a = new ThreadLocal<string>(() => { if (HasCreated) return Value.ToString(); else { Value = Thread.CurrentThread.[....…
Docker Deployment: docker run -d \ --name=calibre-web \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -e DOCKER_MODS=linuxserver/mods:universal-calibre `#optional` \ -e OAUTHLIB_RELAX_TOKEN_SCOPE=1 `#optional` \ -p 8083:8083 \ -v /data/book/config:/confi…
Docker 部署: docker run -d \ --name=calibre-web \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -e DOCKER_MODS=linuxserver/mods:universal-calibre <code>#optional</code> \ -e OAUTHLIB_RELAX_TOKEN_SCOPE=1 <code>#optional</code> \ -p 8…
Execute fdisk -l to find the required disk. As you can see, this is a blank disk. Start executing commands to create a partition on the blank disk. fdisk /dev/sdc First, enter n. Command action <- Select the type of partition to create e extended <- Exte…
执行 fdisk -l 会发现需要的磁盘。 可以看到这是一个空白盘。 开始执行命令将空白磁盘创建分区。 fdisk /dev/sdc 先输入 n。 ommand action <- 选择要创建的分区类型 e extended <- 扩展分区 p primary partition (1-4) <- 主分区 输入 p,再输入 1,剩下选项直接回车。 输入 w ,保存并退出。 格式化并设置磁盘系统: mkfs.ext4 /dev/sdc1 挂载 mount /dev/sdc1 /data/ 查看磁盘挂…
Directory Structure: └─templates └─consolesync └─content ├─.template.config ├──template.json └─AAA.Web.API ### Template Directory 1. Create an empty directory at will, then create one inside it, and create the template directory under templates. The name of th…
When not using ASP.NET Core and without the FluentValidation framework, model validation can be implemented through the native API. public class A { [EmailAddress] public string B { get; set; } } void Main() { var result = new List<ValidationResult>(); v…
在不使用 ASP.NET Core 时,也不使用 FluentValidation 这里框架,通过原生的 API 实现模型验证。 public class A { [EmailAddress] public string B { get; set; } } void Main() { var result = new List<ValidationResult>(); var a = new A { B = "aa.com" }; var validationContext = new Validati…
Define the Converter: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return objectType.IsEnum; } public override Enum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions o…
定义转换器: public class EnumStringConverter : JsonConverter<Enum> { public override bool CanConvert(Type objectType) { return objectType.IsEnum; } public override Enum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var v…