C#
文章平均质量分 50
fyifei0558
先后就职于文思海辉,爱立信,京东,从事自动化测试、性能测试以及开发工作
展开
-
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 · 161 阅读 · 0 评论 -
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 · 175 阅读 · 0 评论 -
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 · 110 阅读 · 0 评论 -
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 · 472 阅读 · 0 评论 -
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 · 107 阅读 · 0 评论 -
泛型的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 · 151 阅读 · 0 评论 -
C# IOC Unity
Unity (IOC)Unity.Configuration.interception可以从配置文件读入原创 2020-04-17 14:58:17 · 186 阅读 · 0 评论 -
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 · 163 阅读 · 0 评论 -
算法面试题:求出给定整数组的最大联系子数组的和
这题的问题的关键就是:tmpMaxSum若是负数时,清零。public static int GetMaxSubSum(int [] arr, int len) { if(arr == null || len == 0) { throw new ArgumentNullException("");原创 2017-07-14 09:35:00 · 350 阅读 · 0 评论 -
Lru cache算法以及他的锁的问题
Lru cache codes:1. use double linked list for LRU.2. For the lockusing System;using System.Collections.Generic;using System.Text;namespace LruCache_20170421{ public class LruCache {原创 2017-04-24 16:54:17 · 612 阅读 · 0 评论 -
.net GC (GC roots)小结
reference article: https://www.simple-talk.com/dotnet/.net-framework/understanding-garbage-collection-in-.net/http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html#RequiredS原创 2015-12-23 14:16:53 · 651 阅读 · 0 评论 -
Singleton模式的实现方式 C#
最好用public sealed class Singleton{ static readonly Singleton instance=new Singleton(); // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit转载 2015-12-16 17:50:28 · 748 阅读 · 0 评论 -
custom WCF data service
• WCFDataService• ODataDescription • http://www.odata.org/getting-started/basic-tutorial/• CustomWCF DataService Provider• http://blogs.msdn.com/b/alexj/archi原创 2015-12-31 17:13:36 · 425 阅读 · 0 评论 -
Lock (C#)的理解
Lock ( resource object){expression;}当第一个thread访问这段代码时,就会给这个对象“resource ojbect” 加把锁,当后来的thread访问这段代码时,1. 通过object.EqualReference(没有用实际code验证)去判断刚才加锁的对象是目前这个线程的对象吗? (这就有一个对象访问权限的问题,他是priv原创 2015-11-30 15:59:12 · 841 阅读 · 0 评论 -
局部动态变量可以作为返回值吗(C++/C#)
对于C++创建对象有两种方式:A a(5,5); 这种对象是将他的成员变量值放在运行栈上的,当这个函数结束时,该函数的所有局部变量将被从栈中弹出,即释放;所以这种方式的变量是不能作为返回值的;另一中方式就是:A *a = new A(5,5); 这是对象是个指针,他的内存释放在堆上的; 它是可以作为返回值的;因为只是一个指针的赋予;这种方式就是C#里用的 A a = ne原创 2015-07-19 23:12:03 · 1157 阅读 · 0 评论 -
C#一个关于反序列化的小问题 http://www.csharpwin.com/csharpspace/12720r6124.shtml
C#一个关于反序列化的小问题 2011-04-15 来自:CNBLOGS 字体大小:【大 中 小】摘要:本文介绍C#反序列化的一个小问题和这个反序列化小问题的解决方法。-大家都知道,我们具有三种定义可序列化类型的方式:在类型上应用SerializableAttribute特性;应用DataContractAttribute/DataMemberAtt转载 2012-12-02 19:03:24 · 624 阅读 · 0 评论 -
.net remoting http://www.cnblogs.com/wayfarer/archive/2004/07/30/28723.html
http://www.cnblogs.com/wayfarer/archive/2004/07/30/28723.html原创 2013-04-11 10:44:56 · 865 阅读 · 0 评论 -
IOCP的使用以及.net的应用
http://blog.sina.com.cn/s/blog_494305f30100sb2n.html 这个文章说了,.net下是否用了IOCP,the link ishttp://msdn.microsoft.com/en-us/library/ms973903.aspx这个可以证明.net 的threadpool use IOCP; 这个文章解释了什么是IOCP.htt原创 2013-04-16 19:16:17 · 802 阅读 · 0 评论 -
load all plugin sample dynamically.
plugin的load:loprivate void LoadObjects(Assembly assembly) { IEnumerable types = null; try { types = from type in assembly.GetTypes(原创 2014-11-25 11:38:11 · 408 阅读 · 0 评论 -
得到二叉树的深度
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication4{ class Program { static void Main(st原创 2015-01-26 16:38:08 · 684 阅读 · 0 评论 -
visual studio在environment debug steps:
Copy the necessary pdb files to product serversOpen .cs file;Attached its processLoad symbols via debug/view->"Modules";Note:1).please check Tools-->options-->Debugging uncheck "Enab原创 2015-01-14 10:04:31 · 666 阅读 · 0 评论 -
IE自带的network traffic capturing.
IE --"F12", then "ctrl+4" to enable "network", then start ">" to enable "network traffic capturing"原创 2014-12-10 15:49:16 · 1322 阅读 · 0 评论 -
Linq queryable implement
http://blogs.msdn.com/mattwar/pages/linq-links.aspx and http://www.codeplex.com/IQToolkit原创 2015-05-09 15:18:11 · 412 阅读 · 0 评论 -
.net developer page
http://www.cnblogs.com/vNext/p/4464466.html转载 2015-05-09 23:45:22 · 329 阅读 · 0 评论 -
.net经典解读(事件和委托)
http://www.cnblogs.com/JimmyZhang/archive/2007/09/23/903360.html原创 2015-05-20 20:01:25 · 391 阅读 · 0 评论 -
C++数据在内存中的存放的三个区域全局数据区,堆和栈
全局数据区存放的是全局变量和static变量堆是否new的对象栈是放其他变量数据。原创 2015-06-11 19:42:03 · 1314 阅读 · 0 评论 -
LPVoid*
void *则为“无类型指针”,void *可以指向任何类型的数据。 即任何类型的指针都可赋予它。 和void不同LPVOID* 长类型指针,应该是占4字节的指针吧? 百度上很全: http://baike.baidu.com/view/1004734.htm 规则四 如果函数的参数可以是任意类型指针,那么应声明其参数为void * 典型的如内存操作原创 2012-11-14 15:41:54 · 2734 阅读 · 0 评论
分享