自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(225)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 what difference between make(chan int, 1) and make(chan int) in golang?

【代码】what difference between make(chan int, 1) and make(chan int) in golang?

2023-11-04 11:27:56 238

原创 模拟丢包等网路工具

Reference:

2023-09-13 16:34:27 237

原创 in golang, how many usages are there for pointer? and can you provide example for each of them?

``go*ptr = 42value := 0``````go// fields``````gocount intc.count++``````gonum := 42```

2023-09-07 09:58:20 77

原创 learn golang from jave

Java to Go in-depth tutorial · YourBasic Go

2023-08-27 11:27:37 53

原创 ACID的解释

I有read uncommitted, read committed, repeatable read (开启事物后,锁住第一次查询的数据行,不许读写更新操作。但是管不住插入行), serialization(加了范围锁,阻止整个范围其他事物再读写更新)

2023-08-22 10:21:06 50

原创 儿童启蒙英语

What's the Big Idea (画质不好) (画质不好) 腾讯 (高清) (高清))Charlie and Lora (不清晰) (不清晰)

2023-06-30 15:15:48 162

原创 Java的private, default, protected public的变量访问范围

对于这四个变量,private和public都很好记住。对于default和protected,总结如下:可以看到下面红色的字段是不能访问的。所以网上的我加了红色的部分

2023-05-03 10:50:57 90 1

原创 验证azure nlb可以用在后端是一个网卡多个IP下的通讯

azure lb

2022-06-11 11:13:32 258 1

原创 CSV file转成各个字段都加双引号

$path = "C:\tmp\112.csv"$data = Import-Csv -Path $Path$ColNames = ($data[0].psobject.Properties).name$header = ""foreach($column in $ColNames){ if(![string]::IsNullOrEmpty($header)){ $header = $header + "," $header = $header + $column

2022-06-01 17:18:47 1178

原创 快速排序C#代码

using System;namespace ConsoleApp12{ class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); int[] aa = new int[] {3,12,8,7,4,3,89,1 }; QuickSort(aa, 0, aa.Length .

2022-01-18 10:13:37 392

原创 leetcode :https://leetcode.com/problems/container-with-most-water/

public static int MaxArea(int[] b) { if (b.Length <= 1) { return 0; } int max = 0; int l = 0; int r = b.Length-1; while (l < r) .

2022-01-07 09:48:49 136

原创 求字符串中最长的回文字符串

using System;namespace ConsoleApp11{ class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); GetHuiWen2("cbbd"); } public static int GetHuiwen(string s, int l.

2021-12-30 09:50:54 191

原创 Add two numbers for leetcode

Loading...no more words, see codes:using System;namespace ConsoleApp10{ class Program { public class Node { public int data; public Node next; } //approach1: recursive public

2021-12-22 10:00:03 71

原创 Redis: requirepass and masterauth

version 6.2.1when I only set requirepass in redis.conf, and create redis cluster, the following error is raised in log:Unexpected reply to PSYNC from master: -NOAUTH Authentication required.so I add requirepass and masterauth in redis.conf. no erro.

2021-09-27 11:05:50 1338

原创 在构造函数还没有被执行的情况下,它的其他函数被执行了。

public class Class2 : IClass1 { public string cc = null; public Class2() : base("redis") { sssss = "1111"; cc = "cc"; } public override void SetConfig() { test();...

2021-09-01 09:47:25 176

原创 ReaderWriterLockSlim vs ReaderWriterLock

看MS official doc, we can know the performance Slim is better than ReadWriteLock.但是ReaderWriterLockSlim的使用场景也有限制比如这个TryEnterUpgradableReadMode, 这个Upgradable mode, 只能一个线程 in this mode,有点鸡肋(当然也有他的使用场景,比如只有一个线程可能写,其他线程只有读,可能好用)。...

2021-08-18 17:17:45 347

原创 ReaderWriterLock当获取Writelock时,是等到其他的ReaderLock都释放了,才能拿到WriteLock.

看代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.IO;using System.Reflection;using System.Threading;namespace ConsoleApplication23{ class Program { p

2021-08-18 17:09:07 124

原创 Kubernet ConfigMap读书笔记

1. 使用configmap的限制条件 a. ConfigMap必须在pod之前创建 b. ConfigMap也可以定义为属于某个Namespace.只有处于相同namespace中的Pod可以饮用它 c. ConfigMap中的配置管理还未能实现 d. kubelet...

2021-08-04 20:23:37 63

原创 泛型和多态的比较

比如T test<T>(T info){return T;}public class interface IInfo{}IInfo test(IInfo info) {return info;}对于这两个方法,下面接口的运行效率更高,因为泛型其实是会多生成若干份相似的代码。

2021-06-30 09:36:21 172

转载 aysnc await deadlock for UI applicaiton and asp.net application.

https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html

2021-05-08 10:01:42 69

原创 Git: checkin后,看到有文件只有The file only whitespace difference,如何解决如下,回退版本

The file only whitespace issue: 仍然显示Git checkout commitid fileNote: the commitid is git log的上一个版本commitid,不是特定文件的上一个版本Git addGit commitGit push 即可解决

2021-04-20 09:41:49 247

原创 serialize是想改变保存到文件中的assemblyName,可以在这里修改

保存类型如下:<Student z:Id="1" z:Type="ClassLibrary1.Student" z:Assembly="ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8879e74bfbe2761e" xmlns="http://schemas.datacontract.org/2004/07/ClassLibrary1" xmlns:i="http://www.w3.org/2001/XMLSche

2021-03-31 19:50:45 150

原创 Debugging custom rule codes with VS and FxCop UI

While writing your custom rule,you will likely come across a need to debug it and work out why it's behaving in a particular manner.Debugging within FxCopDebugging a custom rule within the FxCop UI is actually quite easy. To do so, simply:Open the Fx..

2021-02-28 12:53:33 83

原创 asp.net core lifetime transient, scoped, singleton.

如下是我在stackoverflow拷贝的一句话,觉得正确。最难理解的就是这个Scope:,我们大部分情况下,一个Scoped就是一个http request请求。其实上Scope就是Scopecontainer.CreateScope().ServiceProvider.GetService<ITestService>();这里就是新建立一个Scope了。这app.net core console里可以这样用。在asp.net core mvc里,每个request会默认创建了一个

2021-02-21 12:12:23 261

原创 ASP.net Core IApplicationBuilder Run and Use的区别

要配置多个中间件,请使用Use()扩展方法。与Run()方法类似,不同之处在于它包括用于调用序列中的下一个中间件的下一个参数publicvoidConfigure(IApplicationBuilderapp,IHostingEnvironmentenv){app.Use(async(context,next)=>{awaitcontext.Response.WriteAsync("1stMW!");awaitnext();})...

2021-02-21 10:53:47 1154

原创 asp.net core kestrel

kestrel只能作为单一的web server, 这样的话,若是在生产环境,同一个role需要多个进程,这是在kestrel前面就要加个反向代理的功能(这个可以用nignx或者iis来做),然后在发给后面的kestrel处理。

2021-02-19 19:05:09 224 1

原创 asp.net core mvc源代码本地调试

1. 在tools下的option下,找到debug->symbols下,把"Microsoft Symbol servers" and "Nuget.org symbol servers" 都勾选了;2. 在Debug下的general下,uncheck the "Enable just my codes";3. 然后跑起一个mvc 项目,期间它会自动下载symbol (可能会下载很慢,若没有美国代理)...

2021-02-09 13:07:52 436

转载 asp.net mvc request life cycle

http://geekswithblogs.net/chetan/archive/2015/06/30/a-detailed-walkthrough-of-asp.net-mvc-request-life-cycle.aspx

2021-02-02 16:38:02 82

转载 转载:io多路复用https://www.jianshu.com/p/7fbda1696789

https://www.jianshu.com/p/7fbda1696789

2021-01-11 08:13:24 422

转载 声明式编程与命令式编程

声明式编程和命令式编程https://blog.csdn.net/weixin_30443813/article/details/95675962?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLe

2020-12-15 10:11:37 73

转载 Apache一个协议的解释,一张图搞定

http://www.ruanyifeng.com/blog/2011/05/how_to_choose_free_software_licenses.html

2020-12-11 11:44:15 126 1

转载 微软在用的一个开源项目.netcore

https://github.com/geffzhang/NanoFabric

2020-10-27 18:01:42 237

原创 MYSQL优化注意点

MySQL:1. avoid full table scan, so please consider to create index on the column of where, orderby2. avoid null value check 应尽量避免在where子句中对字段进行null值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在num上设置默认值,确保表中num列没有null值,然后再如下查询selec.

2020-09-22 17:05:11 108

原创 泛型的T不一样,表示是不一样的类。里面的静态变量也表示不一样的

public class A<T>{private static object ss = new object();}A<int> a1 = new A<int>();A<int> a2 = new A<int>();A<Long> a3 = new A<Long>();A<int>.ss 是同一个变量,但是和A<Long>.ss是不同的变量...

2020-09-19 13:47:12 129

原创 web service api不能重载

web service的method是唯一标识,和参数多少返回值并没有关系。所以在web service api更新时,对老的api很大程度上还可以工作。

2020-06-19 16:58:15 148

原创 vue好的视频教程

https://www.bilibili.com/video/BV1Wp411d7Ur?p=7

2020-04-23 08:22:57 498

原创 C# IOC Unity

Unity (IOC)Unity.Configuration.interception可以从配置文件读入

2020-04-17 14:58:17 157

原创 工作总结:

1. git bash里用linux2. idea 跑java3. shell连linux

2020-04-15 10:53:56 101

原创 Custom IOC

using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensio...

2020-04-14 17:47:33 146

原创 CAP

CA: 比如我们的传统数据库,mysql, sql server,都是单机版的,不满足 可以分区 这条kakfa一些分布式的,满足 可以分区, 但是不满足一致性,所以是AP.

2020-03-01 18:07:55 121

Netty权威指南 PDF 完整版

NettyNetty权威指南 PDF电子书下载 带目录书签 完整版

2018-04-05

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除