随笔分类 -  C#.net

摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2022-11-17 11:36 zslm___ 阅读(465) 评论(0) 推荐(0) 编辑
摘要:1.java里可以使用Spring的 Spel或者Google的Aviator 如果使用 Aviator 则添加以下依赖 <dependency> <groupId>com.googlecode.aviator</groupId> <artifactId>aviator</artifactId> < 阅读全文
posted @ 2019-07-26 13:36 zslm___ 阅读(1659) 评论(0) 推荐(0) 编辑
摘要:1. Net Core 中有一个被.Net 基金会认可的库 Polly,可以用来简化熔断降级的处理。主要功能:重试(Retry);断路器(Circuit-breaker);超时检测(Timeout);缓存(Cache);降级(FallBack); 官网:https://github.com/App- 阅读全文
posted @ 2019-01-17 18:09 zslm___ 阅读(1252) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; namespace Test { public static class SmtpTest {... 阅读全文
posted @ 2018-10-29 09:58 zslm___ 阅读(397) 评论(0) 推荐(0) 编辑
摘要:/// /// 普通插入 /// [Fact] public void InsertOrder_Tests() { _sqlMapper.Setup(d => d.BeginTransaction()); _sqlMapper.Setup(d => d.Commit... 阅读全文
posted @ 2018-05-22 17:02 zslm___ 阅读(314) 评论(0) 推荐(0) 编辑
摘要:.net版本 java版本 阅读全文
posted @ 2018-04-04 09:25 zslm___ 阅读(2756) 评论(2) 推荐(0) 编辑
摘要:/// /// 无符号右移, 相当于java里的 value>>>pos /// /// /// /// public static int RightMove(this int value, int pos) { //移动 0 位时直接返回原值 ... 阅读全文
posted @ 2018-03-01 15:31 zslm___ 阅读(3238) 评论(0) 推荐(2) 编辑
摘要:1.java计算公式 2. .net计算公式 阅读全文
posted @ 2018-02-26 10:13 zslm___ 阅读(7007) 评论(1) 推荐(1) 编辑
摘要:1.两个list如果有重复元素(如List1: a,b,a List2: b,b,a) 是无法通过包含关系来判断是否相等的. 有两个办法,其一是两个List排序后再按顺序比较.另一个办法就是计算各元素的重复项再进行比较 第一种方案劣势太明显,时间复杂度过大 第二种以空间换时间,只需要遍历无需排序即可 阅读全文
posted @ 2018-02-05 18:31 zslm___ 阅读(14717) 评论(0) 推荐(1) 编辑
摘要:java的写法 阅读全文
posted @ 2018-02-04 18:45 zslm___ 阅读(388) 评论(0) 推荐(0) 编辑
摘要:public class AccessStatisticsAttribute : ActionFilterAttribute { /// /// log4net 日志 /// private static readonly ILog Logger = LogManager.GetLogger(typeof(AccessS... 阅读全文
posted @ 2018-02-04 18:44 zslm___ 阅读(384) 评论(0) 推荐(0) 编辑
摘要:可以看到 Remove的操作里涉及对List的存储空间重新赋值的工作.而多余占用的空间用Default(T)来填充并未回收 2.1 在尾部插入速度最快 2.2 在中间插入,涉及数组拷贝 2.3 元素不够时,涉及重新分配内在和数组拷贝 阅读全文
posted @ 2018-02-01 11:10 zslm___ 阅读(324) 评论(0) 推荐(0) 编辑
摘要:1.今天看一下StackExchange.Redis的源代码,里面有这样一段代码 调用时是这样调用的 顿时感觉到诧异,不明白为什么只有get方法的属性可以被初始化时赋值,如果是非初始化的赋值是不行的 但是实在不理解为什么初始化时可以. 于是测试了以下代码(结果是编译不通过) 又测试了下面的(奇迹出现 阅读全文
posted @ 2018-01-31 19:59 zslm___ 阅读(556) 评论(0) 推荐(0) 编辑
摘要:/// /// 金额区间判断帮助类 /// public static class DecimalRangeHelper { /// /// 是否有交集 /// /// /// /// public static bool IsInter... 阅读全文
posted @ 2018-01-31 17:12 zslm___ 阅读(3293) 评论(0) 推荐(0) 编辑
摘要:class AllocUser { //客户多于客服 public static void Test() { var customers = new List() { new Customer() { ... 阅读全文
posted @ 2018-01-25 19:28 zslm___ 阅读(517) 评论(0) 推荐(0) 编辑
摘要:class ListTest { public static void Test() { #region 值类型 var oListVal = new List() { 1,2,3,4 }; var nL... 阅读全文
posted @ 2018-01-21 11:01 zslm___ 阅读(2122) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Linq; using Castle.DynamicProxy; namespace AopTest { class AopTest { static public void Test() { var proxyGenerator = new ProxyGenerato... 阅读全文
posted @ 2017-12-20 15:15 zslm___ 阅读(733) 评论(0) 推荐(0) 编辑
摘要:/// /// 方法帮助类 /// public class ActionHelper { /// /// 统一计算执行时间 /// /// 执行方法 /// public static int ComputeMethodCostMilliseconds(Ac... 阅读全文
posted @ 2017-12-18 18:20 zslm___ 阅读(463) 评论(0) 推荐(0) 编辑
摘要:/// /// 简单分页列表类 /// public class SimplePagedList { /// /// 每页页面大小 /// public int PageSize { get; set; } /// /// 页面总数 /// ... 阅读全文
posted @ 2017-12-18 18:03 zslm___ 阅读(369) 评论(0) 推荐(0) 编辑
摘要:/// /// 分页列表类 /// public class PagedList { /// /// 每页页面大小 /// public int PageSize { get; private set; } /// /// 页面总数 /// ... 阅读全文
posted @ 2017-12-18 18:02 zslm___ 阅读(144) 评论(0) 推荐(0) 编辑

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