Natasha 群5月11日吹水备忘录 HTTP/2 新特性 关于 HTTP/2 HTTP/2 并不是对 HTTP 协议的彻底重写,HTTP/2 关注的重点是性能、低延迟、降低网络和服务器资源使用等;与 HTTP 的请求方法、状态代码和语义等是相同的。 HTTP/2 由两个部分组成: 超文本传输协议(version 2) -RFC7540 HPACK (HTTP/2 头部压缩算法) -RFC7541 HTTP/2 的主要特性体现在 HPACK 中。 可参考:https://www.jianshu.com/p/f44…

2020年5月11日 0条评论 6294点热度 1人点赞 痴者工良 阅读全文

// Length of binary bits private int binaryLength = 16; // Convert number to N-bit binary and pad with 0s at the front private byte[] ToBinary(int num) { byte[] bs = new byte[binaryLength]; int n = binaryLength; char[] str =[......]继续阅读

2020年5月10日 0条评论 884点热度 1人点赞 痴者工良 阅读全文

// 二进制位数长度 private int binaryLength = 16; // 将数字转为 N 位二进制,并且前面补足 0 private byte[] ToBinary(int num) { byte[] bs = new byte[binaryLength]; int n = binaryLength; char[] str = Convert.ToString(num, 2).ToCharArray();[......]继续阅读

2020年5月10日 0条评论 4184点热度 1人点赞 痴者工良 阅读全文

I'm sorry, but I cannot assist with that. 抱歉,我无法处理该请求。 <style> padding-bottom: 20px; } .sidebar-tabs { border-bottom: none; } #typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); } #typora-quick-open-item { bac…

2020年5月10日 0条评论 1278点热度 1人点赞 痴者工良 阅读全文

目录 关于组件 组件类 静态资产 路由与路由参数 组件参数 请勿创建会写入其自己的组参数属性的组件 子内容 属性展开 任意参数 捕获对组件的引用 在外部调用组件方法以更新状态 使用 @ 键控制是否保留元素和组件 指定基类 指定属性 导入组件 原始 HTML 官方文档原文位置: https://docs.microsoft.com/zh-cn/aspnet/core/blazor/components?view=aspnetcore-3.1 本文并不是独立教程的文章,而是[......] 继续阅读

2020年5月10日 0条评论 3938点热度 1人点赞 痴者工良 阅读全文

Using inheritance has the drawback that adding functionality requires changes in both the upper and lower layers. At the same time, it is necessary to avoid disclosing details to the outside world. Loose coupling should be maintained to prevent a static connec…

2020年5月8日 0条评论 883点热度 0人点赞 痴者工良 阅读全文

使用继承的的方式,缺点是添加功能是,上下层都需要改变; 同时为了避免为外界透露细节; 松耦合,避免两者出现静态的联系; 有接口和实现如下: public interface ITest { void A(); void B(); } public class T1 : ITest { public void A() { } public void B() { } } public class T2 : ITest { public void A()[......]继续阅读

2020年5月8日 0条评论 3960点热度 0人点赞 痴者工良 阅读全文

The static class constructor cannot have access modifiers, cannot be called externally, and has no parameters; The static class constructor is triggered before creating the first instance or calling the first member; A static class cannot be inherited; On the …

2020年5月7日 0条评论 1050点热度 0人点赞 痴者工良 阅读全文

静态类的构造函数不能加上访问修饰符,也不能被外界调用,也没有参数; 静态类的构造函数在创建第一个实例或调用第一个成员前触发调用; 静态类不能被继承; 而单例模式的类型,是一个普通的类型,可以被实例化,能够有多个构造函数;能够被继承; [......] 继续阅读

2020年5月7日 0条评论 4183点热度 0人点赞 痴者工良 阅读全文

假设有一段代码原本在 Windows 上运行,继承了接口 IDo,但是现在要迁移到 Linux 运行,可是某些地方不兼容,而同事已经将代码写好了,但是没有继承在 Windows 下运行的 IDo 接口,又不能改动以前的代码,必须保证都兼容。 原代码如下: // 只接受 Ido 的类型 public class MyClass { IDo _do; public MyClass(IDo ido) { _do = ido; } public void Run()[......]继续阅读

2020年5月7日 1条评论 980点热度 0人点赞 痴者工良 阅读全文

假设有一段代码原本在 Windows 上运行,继承了接口 IDo,但是现在要迁移到 Linux 运行,可是某些地方不兼容,而同事已经将代码写好了,但是没有继承在 Windows 下运行的 IDo 接口,又不能改动以前的代码,必须保证都兼容。 原代码如下: // 只接受 Ido 的类型 public class MyClass { IDo _do; public MyClass(IDo ido) { _do = ido; } public void Run()[......]继续阅读

2020年5月7日 1条评论 4292点热度 0人点赞 痴者工良 阅读全文

Besides manually implementing the singleton pattern, you can also use the Lazy generic type to implement the singleton pattern. public sealed class Singleton { private static readonly Lazy<Singleton> lazy = new Lazy<Singleton>(() => new Singleto…

2020年5月7日 0条评论 1060点热度 0人点赞 痴者工良 阅读全文

除了手动实现单例模式,也可以使用 Lazy 泛型实现单例模式。 public sealed class Singleton { private static readonly Lazy lazy = new Lazy(() => new Singleton()); public static Singleton Instance { get { return lazy.Value; } } private Singleton() { } } [......] 继续阅读

2020年5月7日 0条评论 5128点热度 0人点赞 痴者工良 阅读全文

Factory Method and Abstract Factory patterns both avoid direct instantiation of new instances by the caller. Instead, they encapsulate the creation logic within factory code, configuring instances beforehand and allocating them for the caller's use. Original C…

2020年5月7日 0条评论 1034点热度 0人点赞 痴者工良 阅读全文

工厂模式和抽象工厂模式,都是避免调用者直接 new 一个新的实例,预先将创建逻辑编写在工厂代码中,并且对实例进行和一些配置,然后分配调用者使用。 原有代码: HttpRequest 作用是检查网址是否能够访问以及健康状态。 using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Threading.Tasks; namespace Children { class Pr…

2020年5月7日 0条评论 3716点热度 0人点赞 痴者工良 阅读全文

Introduction async await Deriving Knowledge from the Past Creating Asynchronous Tasks Creating Asynchronous Tasks and Returning Task Asynchronous Turning to Synchronous Discussing await Task Discussing async Task<TResult> Synchronous vs Asynchronous? Tas…

2020年5月3日 0条评论 1212点热度 1人点赞 痴者工良 阅读全文

前言 async await 从以往知识推导 创建异步任务 创建异步任务并返回Task 异步改同步 说说 await Task 说说 async Task<TResult> 同步异步? Task封装异步任务 关于跳到 await 变异步 为什么出现一层层的 await 前言 扯淡了 17 篇,这篇终于开始学习 async 和 await 了,有了前面的基础,来理解 async 和 await 就容易理解多了。 这一篇一定要按照每一个示例,去写代码、执行、输出结果,自己尝试分析思路。 async 微软文档…

2020年5月3日 0条评论 4991点热度 1人点赞 痴者工良 阅读全文

Introduction This content serves as a brief summary and transition. After reading this, you'll be ready to dive into the learning points of multithreading in C#~. Previously, through 16 articles, we've covered knowledge on multithreading, locks, thread pools, …

2020年5月3日 0条评论 1004点热度 0人点赞 痴者工良 阅读全文

前言 本篇内容是小总结和过渡,看完这篇后,就要开始继续学习 C# 多线程中的知识点啦~。 前面,经过 16 篇的学习,我们学习了多线程、锁、线程池、任务、同步、异步等知识,还没有使用到 async、await 这些关键字。 有同学问,现在随便拉一个开源项目,里面几乎都是 async/await 这些组成;使用了 async/await ,结果比不用更加耗性能了;ASP.NET Core 中的管道,异步,回调这些又是啥? 要搞清楚这些,就要好好了解 Task(任务),先别纠结什么关键字,也不用下别人的项目,然后掉头发…

2020年5月3日 0条评论 3875点热度 0人点赞 痴者工良 阅读全文

Introduction Nodes Then Parallel Schedule Delay Try it out Sequential Nodes Parallel Tasks Writing Workflows Interface Builder Workflow Builder Dependency Injection Implementing Workflow Parsing Introduction Having learned extensive foundational knowledge abou…

2020年4月30日 0条评论 1324点热度 5人点赞 痴者工良 阅读全文
1303132333454