posts - 15,  comments - 13,  trackbacks - 0
公告
  置顶随笔
摘要: 随着Scrum的引入,测试被提到很重要的地位,特别是自动化测试,UI Automation是其中一个重要的部分,用来模拟用户的操作,来发现可能存在的问题,除了测试用例的有效,质量,速度也是必须考虑的。现在有这么一个场景,如果你有时间,并且感兴趣的话,不妨试一试,如果你的总体运行时间小于或者等于2秒的话,请说出你的实现逻辑,使用的工具,机器的相关配置。场景:在记事本里面输入"hello World",并将其保存在C:\a.txt,如果存在则替换。步骤:打开Notepad.exe输入hello world在工具栏点击Close 按钮在确认对话框中选择"保存"阅读全文
posted @ 2011-12-01 14:22 Nisten 阅读(778) 评论(2) 编辑
摘要: 在工作中碰到这么一个问题:给定一个已经排序的数组(升序),删除数组中重复的数据,但是只能使用一个数组,这个数组的大小可以变化.
例子: 数组:[1,1,2,2,3,3,4,5,7,10]
  输出:[1,2,3,4,5,7,10]  阅读全文
posted @ 2006-11-23 12:46 Nisten 阅读(946) 评论(0) 编辑
  2011年12月1日

随着Scrum的引入,测试被提到很重要的地位,特别是自动化测试, UI Automation是其中一个重要的部分,用来模拟用户的操作,来发现可能存在的问题,除了测试用例的有效,质量,速度也是必须考虑的。现在有这么一个场景,如果你有时间,并且感兴趣的话,不妨试一试,如果你的总体运行时间小于或者等于2秒的话,请说出你的实现逻辑,使用的工具,机器的相关配置。

场景:在记事本里面输入"hello World",并将其保存在C:\a.txt,如果存在则替换。

步骤:

  1. 打开Notepad.exe
  2. 输入hello world
  3. 在工具栏点击Close 按钮
  4. 在确认对话框中选择"保存"
  5. 输入文件路径和名字 C:\a.txt
  6. 如果文件已经存在,在确认对话框中选择"是

 

posted @ 2011-12-01 14:22 Nisten 阅读(778) 评论(2) 编辑
  2011年4月27日
 

Configuration Management

 

 

Version Control

 

Principles of managing application configuration

Managing your environments

Tools to manage environments

Manage the change process

 

posted @ 2011-04-27 10:53 Nisten 阅读(10) 评论(0) 编辑

What's the foundation of continuous delivery?

 

it's just Automation+Delivery.

 

Every Change Should Trigger the feedback process

 

Principles of software delivery

 

posted @ 2011-04-27 10:48 Nisten 阅读(15) 评论(0) 编辑
  2011年2月15日

CAB, in terms of Composite Application block, published by Microsoft Pattern & Design team. today we try to learn the event aggregator design pattern included in CAB, which could help understand how it's designed and implemented.

As unusal, module would interact with other module or itself, so it needs to take a reference other module, couple-loosed. is there decouple-loose? The anser is true,Event Aggregator,which could resolve this problem, there three important parts, Publisher, Subscriber and EventAggregator.

 

IEvent Interface
 1     public interface IEvent<TPayload>
 2     {
 3         SubscriptionToken Subscribe(Action<TPayload> action);
 4         SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption);
 5         SubscriptionToken Subscribe(Action<TPayload> action, bool keepSubscriberReferenceAlive);
 6         SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive);
 7         SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive, Predicate<TPayload> filter);
 8         void Publish(TPayload payload);
 9         void Unsubscribe(SubscriptionToken token);
10         void Unsubscribe(Action<TPayload> subscriber);
11         bool Contains(SubscriptionToken token);
12         bool Contains(Action<TPayload> subscriber);
13     }

 

 

 

 

 

 

 

posted @ 2011-02-15 13:06 Nisten 阅读(60) 评论(0) 编辑
  2011年1月28日

如果寻找给定的数组中第几大的数,采用前面的方法就不现实,因为我们不可能定义几个变量来存放,并且也不现实,这时我们当然想到了数组,而且是有序数组,按照从大到小的方式进行排序,再套用前面的逻辑就可以了.

 

 

代码
        internal static int FindIndexMaximum(int[] input, int index)
        {
            
if (input == null || input.Length < index)
            {
                
throw new InvalidOperationException("the input paramter is invalid, please check your input");
            }
            
//Get the sorted array
            int[] sorted = new int[index];
            
int k = 0;
            
for (int i = 0; i < index; i++)
            {
                k 
= i;
                
while (k > 0 && input[i] > sorted[k - 1])
                {
                    sorted[k] 
= sorted[k - 1];
                    k
--;
                }
                sorted[k] 
= input[i];
            }
            
//Compare the number one by one.
            for (int i = index; i < input.Length; i++)
            {
                k 
= index;
                
while (k > 0 && input[i] > sorted[k - 1])
                {
                    
if (k != index)
                    {
                        sorted[k] 
= sorted[k - 1];
                    }
                    k
--;
                }
                
if (input[i] > sorted[index - 1])
                {
                    sorted[k] 
= input[i];
                }
            }
            
return sorted[index - 1];
        }

 

其实这里主要是使用了两次插入式排序方式,第一次是用来初始化临时数组,并保存其有序.第二次就是从原始数组的index位置开始取数,一个一个地与临时数组的最小值进行比较,如果小于最小值就跳过,如果大于,则一一比较,并插入到合适的位置.这样临时数组的最后一个(?)就是你要找的数字. 这儿还是有一个问题在这儿,如果前面的数字有重复的,那这儿就会有问题?如果让你来改进,你会如何做呢?

另外,让你来设计它的测试用例,你会给出哪些呢? 如果你有不错的想法,请与大家分享.

posted @ 2011-01-28 13:02 Nisten 阅读(48) 评论(0) 编辑

1. Logic and visual trees

 

2. Dpendency Properites

what's the problem that dependency tries to resolve?

Dependency property implementation

Trigger

 

3.Routed Events

4.Commands

posted @ 2011-01-28 13:02 Nisten 阅读(15) 评论(0) 编辑
  2011年1月27日

给定一个数组,寻找次大的数,你会如何实现?

代码
 internal static int FindSecondMaximum(int[] input)
        {
            
if (input == null || input.Length < 2)
            {
                
throw new InvalidOperationException("the input paramter is invalid, please check your input");
            }
            
int max1 = input[0], max2 = input[1];
         
            Swap(
ref max1, ref max2);
            
for (int i = 2; i < input.Length; i++)
            {
                
if (input[i] > max2)
                {
                    max2 
= input[i];
                    Swap(
ref max1, ref max2);
                }            
            }
            
//if (max1 == max2)
            
//{
            
//    throw new InvalidOperationException("All the given values are same");
            
//}         
            return max2;
        }

        
private static void Swap(ref int max1, ref int max2)
        {
            
if (max1 < max2)
            {
                
int temp = max1;
                max1 
= max2;
                max2 
= temp;
            }
        }

 

由这里我们可以类推,如果让你实现寻找第十个大的数,你会如何做呢?

 

posted @ 2011-01-27 15:24 Nisten 阅读(75) 评论(1) 编辑
  2010年6月8日
摘要: 从今天开始学习WPF,力争三个月内能够全面地了解和使用.阅读全文
posted @ 2010-06-08 17:13 Nisten 阅读(17) 评论(0) 编辑
  2009年6月14日
摘要: 教学质量测评系统,采用BS+CS的架构方式来实现,同时结合最新的SOA的后台服务方式,具有易维护和升级的特点。http://www.nisten.com.cn 欢迎来电咨询。阅读全文
posted @ 2009-06-14 00:48 Nisten 阅读(30) 评论(0) 编辑
  2008年6月18日
posted @ 2008-06-18 12:53 Nisten 阅读(93) 评论(0) 编辑
仅列出标题  下一页