摘要: 利用匿名属性可以用很简洁的语法来自动声明不可变(immutable)的元组(tuple)类型。 属性:在字段用来表示类型和对象的状态的前提下,希望状态不被随意的更改,字段一般应该设置为private,这也符合面向对象编程的数据封装,而可以通过方法来更改字段的值,这时候属性的出现简化了这些语法。 编译 阅读全文
posted @ 2016-07-01 12:00 AshLeakey 阅读(683) 评论(0) 推荐(0) 编辑
摘要: CLR(Common Language Runtime):一个可由多种编程语言使用的"运行时"。 CLR的核心功能(内存管理,程序集加载,安全性,异常处理,线程同步等)可由面向CLR的所有语言使用。 托管模块(managed module):标准的32位windows可移植执行体(PE32)文件,或 阅读全文
posted @ 2016-06-30 11:19 AshLeakey 阅读(665) 评论(0) 推荐(0) 编辑
摘要: 装箱:将值类型转换成引用类型用到的机制。 1.在托管堆中分配内存。分配的内存量是值类型各字段所需的内存量,还要加上托管对所有对象都有的两个额外成员(类型对象指针和同步索引块)所需的内存量。 2.值类型的字段复制到新分配的堆内存。 3.返回对象地址。现在该地址是对象引用:值类型成了引用类型。 拆箱:获 阅读全文
posted @ 2016-06-30 10:37 AshLeakey 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Difficulty: Hard here are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run ti 阅读全文
posted @ 2016-06-27 17:00 AshLeakey 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Difficulty: Medium Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "a 阅读全文
posted @ 2016-06-26 22:18 AshLeakey 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Difficulty: Medium You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their node 阅读全文
posted @ 2016-06-26 20:42 AshLeakey 阅读(185) 评论(4) 推荐(0) 编辑
摘要: Difficulty: Easy Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each in 阅读全文
posted @ 2016-06-26 20:37 AshLeakey 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 private void Replace(string oldStr, string newStr, string file) 2 { 3 FileStream fs = File.OpenRead(file); 4 //to know if this file is text file or binary... 阅读全文
posted @ 2016-06-02 15:46 AshLeakey 阅读(202) 评论(0) 推荐(0) 编辑
摘要: private void DisplayLogInfo(FileInfo _LastFile) { if (_LastFile != null) { StreamReader sr = null; try { ... 阅读全文
posted @ 2015-12-31 01:06 AshLeakey 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 我们第一步就是去了解三层架构和问题然后去看MVVM是怎么去解决这些问题的。 现在,感觉和事实是完全不同的两个东西。当你看到三层架构的框图的时候,你会觉得每层的职责被分配的很好。但是当你你真的去写代码的时候你会发现其实一些层被迫去做本不应该他们做的额外的事情(违反了SOLID原则的S)。 这个额外的... 阅读全文
posted @ 2015-11-06 00:17 AshLeakey 阅读(2508) 评论(0) 推荐(0) 编辑