摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2014-05-29 15:03 erictanghu 阅读(100) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2014-05-29 15:01 erictanghu 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2014-05-29 15:00 erictanghu 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 服务端1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Text;4usingSystem.Net.Sockets;5usingSystem.Net;6usingSystem.Threading;78namespaceControl... 阅读全文
posted @ 2014-05-10 21:41 erictanghu 阅读(13201) 评论(0) 推荐(1) 编辑
摘要: 原文:http://blog.csdn.net/sanfengshou/article/details/4574604虚函数的定义: 虚函数必须是类的非静态成员函数(且非构造函数),其访问权限是public(可以定义为private or proteceted, 但是对于多态来说,没有意义。),在基类的类定义中定义虚函数的一般形式: virtual 函数返回值类型 虚函数名(形参表) { 函数体 }虚函数的作用是实现动态联编,也就是在程序的运行阶段动态地选择合适的成员函数,在定义了虚函数后,可以在基类的派生类中对虚函数重新定义(形式也是:virtual 函数返回值类型 虚函数名(形参表)... 阅读全文
posted @ 2014-03-18 16:34 erictanghu 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.wuzesheng.com/?p=1931在C中,类型转换相对比较简单,直接加括号强制转即可,不过这样做的后果,就是很难保证类型安全,所以,在C++中,虽然还允许C方式的类型转换,但是已经成为deprecated的方式了,良好的C++编程习惯都不推荐使用C方式的类型转换了。C++提供了类型相对安全的转换方式,本文的主要内容,就是介绍C++中的各种类型转换方式,以及各自用在什么样的场合下,有什么需要注意的地方,帮助大家更好的掌握类型转换,更好的驾驭自己的程序。dynamic_cast,static_cast, const_cast和reinterpret_cast在C 阅读全文
posted @ 2014-03-18 16:22 erictanghu 阅读(163) 评论(0) 推荐(0) 编辑
摘要: C# WinForm程序退出的方法1.this.Close(); 只是关闭当前窗口,若不是主窗体的话,是无法退出程序的,另外若有托管线程(非主线程),也无法干净地退出;2.Application.Exit(); 强制所有消息中止,退出所有的窗体,但是若有托管线程(非主线程),也无法干净地退出;3.A... 阅读全文
posted @ 2014-03-12 11:25 erictanghu 阅读(718) 评论(0) 推荐(0) 编辑
摘要: Process currentProcess = Process.GetCurrentProcess(); //获取当前进程 //获取当前运行程序完全限定名 string currentFileName = currentProcess.MainModule.FileName; //获取进程名为ProcessName的Process数组。 Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName); ... 阅读全文
posted @ 2014-03-12 11:24 erictanghu 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Reflection; 4 5 namespace test 6 { 7 public class test 8 { 9 public static void RunSchedule()10 {11 test type = Activator.CreateInstance(typeof(test), true) as test;12 13 MethodInfo m... 阅读全文
posted @ 2014-03-12 11:16 erictanghu 阅读(792) 评论(0) 推荐(0) 编辑
摘要: 原文:http://blog.csdn.net/lanwilliam/article/details/2467222日期转化一为了达到不同的显示效果有时,我们需要对时间进行转化,默认格式为:2007-01-03 14:33:34 ,要转化为其他格式,要用到DateTime.ToString的方法(String, IFormatProvider),如下所示:using System;using System.Globalization;String format="D";DateTime date=DataTime,Now;Response.Write(date.ToStri 阅读全文
posted @ 2014-03-12 11:10 erictanghu 阅读(148) 评论(0) 推荐(0) 编辑