摘要: 什么是Windows Azure Queue Storage 队列存储Windows Azure Queue Storage存储大量的信息,可以在世界任何地方通过验证的调用,使用HTTP或HTTPS访问的服务。一个单一的队列信息可高达64KB的大小,队列可以包含数百万条消息,每个存储帐户(storage account)限制的总容量高达100TB。队列存储的常见用途包括:创建异步处理积压的工作从Windows Azure的Web角色的消息传递到Windows Azure Worker角色基本概念队列服务包含以下组件:URL 格式:队列服务,是通过REST来访问的,基于URL地址访问。格式如下: 阅读全文
posted @ 2012-12-24 16:34 EricWen 阅读(3389) 评论(0) 推荐(0) 编辑
摘要: Windows Azure Service Bus MessagingService Bus Messaging 有两种模式(Model),即Brokered Messaging和Relayed Messaging。以下图说明关系:Brokered Messaging是一种中间模式,在消息交换过程中充当中间人的角色。发送者将消息发给Broker,接受者从Broker那接受消息;发送者和接受者两者不需要碰面,也不需要同时在线;Broker将消息保存在队列中,具有持久功能(Durability),在消息到期前保存直到被接收者取出,这也说明Broker有一定的伸展功能(Scalability);Br 阅读全文
posted @ 2012-12-10 17:30 EricWen 阅读(1218) 评论(0) 推荐(0) 编辑
摘要: Service Bus Namespace 和 Access ControlService Bus Namespace简述https://yourapp.servicebus.windows.net/foo/bar/baz 就是一个namespace,我们熟悉的URL。Service Bus通过Namespace 来暴露公共的Endpoint,和管理服务组织架构。Namespace 由Schema+solution+domain+Nodes组成。Schema有三种,分别为SB、Http、Https。SB用于TCP连接,端口开了四个9350-9353。端口描述9350客户端无安全的单向连接Ser 阅读全文
posted @ 2012-12-07 16:41 EricWen 阅读(1412) 评论(0) 推荐(1) 编辑
摘要: 1. 概览1.1什么是Service Bus呢?软件开发初期,实现的功能比较单一,每个软件相对比较独立的工作。后来发展了,软件作为一种服务提供给其他软件使用。这样软件和软件之间需要沟通。首先在企业内部,软件开始面向服务的架构(Oriented service architecture),软件间的相互通信需要一定的标准和协议,这样ESB(Enterprise Service Bus)就出现了,ESB解决了软件之间互联的问题。后来又出现了Message Buffer,用来出来处理软件之沟通的消息,对消息进行异步传输、持久化等。为了使企业间互通,ISB(Internet Service Bus)应运 阅读全文
posted @ 2012-12-07 11:24 EricWen 阅读(2405) 评论(0) 推荐(0) 编辑
摘要: HeapSort is an sort algorithms, using heap tree(Full Binary Tree) for help.Implementing this sort should execute three steps1. Adjust an entire array to a heap tree(big heap tree for ascending, small heap tree for descending sort)2. Get the root of the heap tree arr[0] and swap it with last one of . 阅读全文
posted @ 2012-07-18 18:07 EricWen 阅读(205) 评论(0) 推荐(0) 编辑
摘要: A deck pokers have 52 pieces except small king and big king, which with four different suit. We want to generate 52 pieces of pokers and sort them by suit first or by value first.We make a rule that isSpade>Heart>Diamond>Club, assign values (4,3,2,1) to each of them.And anthter rule is code 阅读全文
posted @ 2012-07-17 01:04 EricWen 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 归并排序简言之,假设一个数组分成两个有同序的小数组(1/2组),然后将二者合并。递归的假设,将小组再假设分成两个有同序的小组(1/4组),然后合并二者。递归。。。。最后1/n组剩下一个数据了,两个1/n组合并。这应该easy哈。递归实现如下: ///<summary>///MergeSortO(nlogn)///</summary>///<paramname="arr"></param>publicstaticvoidMergeSort(int[]arr){if(arr==null){thrownewArgumentNullE 阅读全文
posted @ 2012-07-16 18:32 EricWen 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 希尔排序的一种缩小增量(Incremental)的排序,是直接插入排序的一种升级。基本思想就是,将原有的数组arr,分成Incremental 个小数组,然后对各个小数组进行插入排序,当然我认为,也可以用其他排序算法。然后将增量(Incremental)减半,再分组,再排序。直到最后Incremental=1,也必须等于1,这时,就只能分成一组了,相当于对整个数组进行一次插入排序。这样做的好处,在于,不断细分数组,使得在排序过程中减少了数据的移动量。我的C#实现如下:///<summary>///ShellsortO((nlogn)^2)///</summary>/// 阅读全文
posted @ 2012-07-16 16:01 EricWen 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 写一个方法得到一个素数数组,这些素数不能大于给定的自然数。我看网上大多数的实现都是用自然数n除以2到n/2+1的数,如果整除了,就判定不是素数。我的想法不一样,我一个数组保存已经得到的素数,然后用n除以这些素数,如果整除了,就判定不是素数。具体实现如下:staticint[]GetPrimeNumbers(intboundary){List<int>primeList=newList<int>();intn=2;while(n<=boundary){boolisPrime=true;for(inti=0;i<primeList.Count;i++){if(n 阅读全文
posted @ 2012-07-15 02:12 EricWen 阅读(2265) 评论(0) 推荐(0) 编辑
摘要: 关于排序的一些常识可以问百科,以下是用C#实现的排序算法。1.冒泡排序 BubbleSort///<summary>///BubblesortO(n^2)///</summary>///<paramname="arr"></param>publicstaticvoidBubbleSort(int[]arr){if(arr==null){thrownewArgumentNullException();}for(inti=0;i<arr.Length-1;i++){for(intj=arr.Length-1;j>i;j 阅读全文
posted @ 2012-07-15 01:54 EricWen 阅读(217) 评论(0) 推荐(0) 编辑