- 博客(95)
- 收藏
- 关注
转载 WPF中StringFormat的用法
转载地址http://www.cnblogs.com/zhengwen/archive/2010/06/19/1761036.htmlWPF中StringFormat的用法可以参照C#中string.Format的用法1、C#中用法:格式化货币(跟系统的环境有关,中文系统默认格式化人民币,英文系统格式化美元)示例:string.Format("{0:C}",
2015-03-12 09:25:06
1199
原创 ThreadPool的浅研究
线程的开销1.线程有其自己的数据结构,创建一个线程需要存储空间2.操作系统要调度线程,当线程切换(Context Switch)时3.线程执行完任务后要销毁,释放其所占用的资源,同样影响性能基于上述创建线程可能带来的问题,这就是为什么需要线程池了每个CLR有一个线程池,CLR的所有AppDomain共享一个线程池,CLR初始化时线程池是没有线程的,当线程池收到请求时,线程池试图
2015-03-05 12:59:32
608
原创 并发,并行与异步
并发:同时做多件事情比如服务端处理一个请求的同时可以处理另外一个请求。多线程是实现并发的一种方式。并行处理:把正在执行的大量任务分割成小块,分配给多个同时运行的线程。异步:不阻塞原有线程的执行,异步的程序在一段时间后执行。
2015-02-25 18:00:17
467
原创 simple understanding of manifest
why manifest file exist?An assembly manifest is an XML file that describes a side-by-side assembly. Assembly manifests describe the names and versions of side-by-side assemblies, files, and resour
2015-02-13 14:27:15
625
原创 2015年上半年主要目标
迷迷茫茫了大半年,总算找到了确定的学习方向和努力方向。记录于此。1.努力把代码写的简洁易懂,结构清晰,具有扩展性。2.把技术书籍让英语书籍靠拢,看过了发现真的差距真大。3.设计模式要吃透。4.对未知的东西仔细揣摩,尽量可以自己也写几个原创的研究博文。5. UML今年之内必须解决。6. WCF做深入研究,作为自己的看家本领。7.扩充分布式系统中的知识。
2015-02-11 18:27:32
503
转载 cache paramters
aching ExpirationMicrosoft Caching Application Block provides great use of the caching expiration functionality. For that, we need to add the namespace below: Collapse | Copy Codeusing Mic
2015-02-11 14:03:54
565
转载 重新组织函数的九种方法
转载自:http://blog.youkuaiyun.com/hguisu/article/details/7598066函数过长或者逻辑太混乱,重新组织和整理函数的代码,使之更合理进行封装。1. Extract Method 提炼函数提炼函数:(由复杂的函数提炼出独立的函数或者说大函数分解成由小函数组成)你有一段代码可以被组织在一起并独立出来。将这段代码放
2015-02-11 09:37:14
529
转载 简化函数调用
非常感谢这位同学的文章。http://blog.youkuaiyun.com/hguisu/article/details/7631886重构的确是编程人员的修养啊1. Rename Method 函数改名函数的名称未能揭示函数的用途。修改函数名称。大力提倡的一种编程风格是:将复杂的处理分解成小函数。但是,如果做得不好,这会使你费尽周折却弄不清楚这些小函数
2015-02-10 18:30:50
494
转载 简化条件表达式
简化条件表达式http://blog.youkuaiyun.com/hguisu/article/details/76137661.Decompose Conditional 分解条件表达式你有一个复杂的条件语句。从if、then、else三个段落中分别提炼出独立函数。程序之中,复杂的条件逻辑是最常导致复杂度上升的地点之一。你必须编写代码来检查不
2015-02-06 14:00:18
630
转载 数字证书原理
http://www.cnblogs.com/jeffreysun/archive/2010/06/24/1627247.html转发地址,感谢啊,看过后更清晰了一点文中首先解释了加密解密的一些基础知识和概念,然后通过一个加密通信过程的例子说明了加密算法的作用,以及数字证书的出现所起的作用。接着对数字证书做一个详细的解释,并讨论一下windows中数字证书的管理,最后演示使用makec
2015-01-21 17:15:40
704
转载 TPL dataflow
转载地址http://www.cnblogs.com/haoxinyue/archive/2013/03/01/2938959.html属性TPL Dataflow是微软面向高并发应用而推出的一个类库。借助于异步消息传递与管道,它可以提供比线程池更好的控制,也比手工线程方式具备更好的性能。我们常常可以消息传递,生产-消费模式或Actor-Agent模式中使用。在TDF是构建于Task Pa
2015-01-03 18:53:50
985
转载 Task基础知识
转载地址http://www.cnblogs.com/TianFang/archive/2009/11/02/1594783.htmlTask和ThreadPool的功能类似,可以用来创建一些轻量级的并行任务。对于将一个任务放进线程池 ThreadPool.QueueUserWorkItem(A);这段代码用Task来实现的话,方式如下: Task.Factor
2015-01-03 17:32:35
1224
原创 几种在并发编程中使用的集合
不可变集合不会经常修改,可以被多个线程安全访问的集合。特点:不可变集合的一个实例是永远不改变的。因为不会改变,所以绝对是线程安全的对不可变集合使用修改方法时,返回修改后的集合适用场合:共享状态。不适合用来做交换数据的通道,特别是在线程间的通信中不要使用不可变队列,可以适用生产者/消费者队列,可以获得更好的效果。例子:var dictionary = Immutabl
2015-01-01 20:15:03
700
原创 Discovery
首先服务发现的目的就是为了解决服务和服务消费者的解耦,以往正常的通信客户端需要知道服务的地址。wcf4.0为我们提供了2种模式的服务发现模型,一种是Managed proxy Discovery模型,一种是ad-hoc模式。Managed proxy Discovery模型,采取的集中管理方式对服务的终结点进行管理,首先它自己本身以一个服务来提供终结点的管理功能。这个服务需要继承自Syst
2015-01-01 18:43:01
524
转载 windows服务
我们将研究如何创建一个作为Windows服务的应用程序。内容包含什么是Windows服务,如何创建、安装和调试它们。会用到System.ServiceProcess.ServiceBase命名空间的类。什么是Windows服务? Windows服务应用程序是一种需要长期运行的应用程序,它对于服务器环境特别适合。它没有用户界面,并且也不会产生任何可视输出。任何用户消息都会被写进W
2014-11-30 21:49:38
707
转载 RabbitMQ
1. 历史 RabbitMQ是一个由erlang开发的AMQP(Advanced Message Queue )的开源实现。AMQP 的出现其实也是应了广大人民群众的需求,虽然在同步消息通讯的世界里有很多公开标准(如 COBAR的 IIOP ,或者是 SOAP 等),但是在异步消息处理中却不是这样,只有大企业有一些商业实现(如微软的 MSMQ ,IBM 的 Websphere MQ
2014-11-27 09:42:17
499
转载 AMQP协议
AMQP即高级消息队列协议,接下来从三个方面来浅析该协议。一、协议 AMQP协议分层类似于OSI或TCP/IP协议分层。从图中可以看出分三层:图1 AMQP协议分层图1、Model Layer 规范服务器端Broker的行为。2、Session Layer 定义客户端与服务器端Broker的Context。3、Transport Layer
2014-11-27 09:28:46
551
转载 应用程序服务器Application Server
(by huihoo.com tonyliu) 为什么要有应用程序服务器 近十年来,基于Internet的应用正以前所未有的高速度向前发展,其中一个重要的方向就是基于Web的应用系统的发展。在此期间,随着技术的不断更新和应用的不断深入,Web应用系统的发展也经历了几个阶段性的跨越。 在Web发展的初期,人们通常使用Web服务器作为信息发布工具,它接收用户的HTTP
2014-11-23 18:56:51
2264
转载 Refactoring Day 9 : Extract Interface
Today we look at an often overlooked refactoring. Extract Interface. When you notice more than one class using a similar subset of methods on a class, it is useful to break the dependency and introd
2014-11-18 15:35:41
437
转载 Refactoring Day 8 : Replace Inheritance with Delegation
All too often inheritance is used in the wrong scenarios. Inheritance should only be used in logical circumstances but it is often used for convenience purposes. I’ve seen this many times and it lea
2014-11-18 15:20:33
416
转载 Refactoring Day 7 : Rename (method, class, parameter)
This refactoring I use most often and is one of the most useful refactoring. All too often we do not name methods/classes/parameters properly that leads to a misunderstanding as to what the method
2014-11-18 15:14:59
487
转载 Refactoring Day 6 : Push Down Field
Opposite of the Pull Up Field refactoring is push down field. Again, this is a pretty straight forward refactoring without much description needed 1: public abstract class Task 2: { 3: prot
2014-11-18 15:12:15
401
转载 Refactoring Day 5 : Pull Up Field
Today we look at a refactoring that is similar to the Pull Up method. Instead of a method, it is obviously done with a field instead! 1: public abstract class Account 2: { 3: } 4: 5:
2014-11-18 15:09:20
491
转载 Refactoring Day 4 : Push Down Method
Yesterday we looked at the pull up refactoring to move a method to a base class so mutiple derived classes can use a method. Today we look at the opposite. Here is the code before the refactoring:
2014-11-18 15:03:32
402
转载 Refactoring Day 3 : Pull Up Method
The Pull Up Method refactoring is the process of taking a method and “Pulling” it up in the inheritance chain. This is used when a method needs to be used by multiple implementers. 1: public abst
2014-11-18 14:50:40
1003
转载 Refactoring Day 2 : Move Method
The refactoring today is pretty straightforward, although often overlooked and ignored as being a worthwhile refactoring. Move method does exactly what it sounds like, move a method to a better lo
2014-11-18 14:46:52
489
转载 Refactoring Day 1 封装集合
Refactoring Day 1 : Encapsulate Collection In certain scenarios it is beneficial to not expose a full collection to consumers of a class. Some of these circumstances is when there is additional
2014-11-18 14:40:53
438
转载 Style
Style 用来在类型的不同实例之间共享属性、资源和事件处理程序,您可以将 Style 看作是将一组属性值应用到多个元素的捷径。 这是MSDN上对Style的描述,翻译的还算中规中矩。Style(样式),简单来说,就是一种对属性值的批处理,类似于Html的CSS,可以快速的设置一系列属性值到UI元素。示例 一个最简单的Style的例子: 1: Win
2014-11-18 13:30:41
494
原创 WPF DataGridComboBoxColumn的使用方法
1.添加2个命名空间 xmlns:core="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:WpfApplication11"2.
2014-11-18 12:35:08
3889
转载 用命令创建MySQL数据库
用命令创建MySQL数据库 服务器或VPS用户如何用命令创建MYSQL数据库 一、连接MYSQL 格式: mysql -h主机地址 -u用户名 -p用户密码 1、 连接到本机上的MYSQL。 首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格,
2014-11-17 10:29:22
447
原创 Command
/// /// Class RelayCommand /// public class RelayCommand : ICommand { #region ... Variables ... /// /// /// readonly Action mExecute;
2014-11-17 09:17:18
465
原创 Listbox横向显示和dataTemplate
<Window x:Class="PhotoData.AddPhotosWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="AddP
2014-11-17 09:02:06
1956
转载 DBLinq
用惯了Visual Studio 2008的LINQ to SQL,突然转到使用Oracle,还真有些不适应,念代码之悠悠,独伧然而涕下呀。好在现在已有不少其他工具能够支持LINQ to Oracle,那咱么就试着想办法将他们和Visual Studio 2008整合起来。 从功能到易用性上都十分强大的当推Devart公司开发的dotConnect for Oracle,
2014-11-13 18:48:07
980
原创 Select和selectMany
class Bouquet{ public Liststring> Flowers { get; set; }}static void SelectVsSelectMany(){ List bouquets = new List() { new Bouquet { Flowers = new Liststring> { "sunflower", "dais
2014-11-10 17:00:47
496
原创 Linq筛选数据
System.Collections.ArrayList fruits = new System.Collections.ArrayList(4); fruits.Add("Mango"); fruits.Add("Orange"); fruits.Add("Apple"); fruits.Add(3.
2014-11-10 16:31:33
479
转载 VS调式技巧
这是我的博客中关于VS 2010和.NET 4发布系列的第二十六篇文章。 今天的博文将介绍Visual Studio中的一些实用调试技巧。这是受我朋友Scott Cate (他发表过几十篇很棒的VS技术文章) 启发。他最近告诉我,许多Visual Studio下的程序员,甚至一些很有经验的开发人员,都不知道这些技巧。希望这篇文章能帮你掌握这些技巧。它们都很简单,却能帮你节约大量的时间。
2014-11-07 18:22:30
776
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人