摘要:
题目:在数组中,数字减去它右边的数字得到一个数对之差。求所有数对之差的最大值。例如在数组{2, 4, 1, 16, 7, 5, 11, 9}中,数对之差的最大值是11,是16减去5的结果。publicclassMaxDiffer{/*Calculatethemaxvaluewhichisgeneratedbythenumbersubstract*thenumberwhichisintherightsideofthearray**/privateint[]arrayNumbers=null;publicMaxDiffer(int[]array){arrayNumbers=array;}publi 阅读全文
摘要:
functionchoose_date_czw(date_id,objtd){if(date_id=="choose_date_czw_close"){document.getElementById("choose_date_czw_id").style.display="none";return;}if(objtd!=undefined){if(objtd=="choose_date_czw_empty"){document.getElementById(date_id).value="";} 阅读全文
摘要:
1.Singleton:保持一个实例,多线程中要注意。需要lock(object);2.AbstractFactory:工厂的目的就是制造产品,在添加新产品的过程中如何更好的组织管理; 阅读全文
摘要:
stringtimestr="";DateTimedt=DateTime.Now;timestr=dt.ToString(); //2011-12-0516:32:26timestr=dt.ToShortDateString(); //2005-11-5timestr=dt.ToShortTimeString(); //16:32timestr=dt.ToLongDateString(); //2011-12-05timestr=dt.ToLongTimeString(); //16:32:26timestr=string.Format("{0:yyyy-HH-d 阅读全文
摘要:
Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,我们可以这样认为:一个URL地址,它用于描述一个网络上的资源,而HTTP中的GET,POST,PUT,DELETE就对应着对这个资源的查,改,增,删4个操作。到这里,大家应该有个大概的了解了,GET一般用于获取/查询资源信息,而POST一般用于更新资源信息。 1.根据HTTP规范,GET用于信息获取,而且应该是安全的和幂等的。 (1).所谓安全的意味着该操作用于获取信息而非修改信息。换句话说,GET 请求一般不应产生副作用。就是说,它仅仅是获取资源信息,就像数据库.. 阅读全文
摘要:
publicclassMatchSettor{/*Eachteamneedtoplayagamewithanotherteam.*Oneteamcanonlyplayonceinoneday*NeedtocompletethegameinintTeamNumber-1day*/intintTeamNumber=2;//TeamNum>=2;intintDayNumber=1;TeamSet[,]array=null;publicMatchSettor(intteamNum){intTeamNumber=teamNum;intDayNumber=teamNum-1;array=newTea 阅读全文
摘要:
publicclassHANOI{publicvoidHanoi(intn,stringa,stringb,stringc){if(n==1){Move(n,a,c);}else{Hanoi(n-1,a,c,b);Move(n,a,c);Hanoi(n-1,b,a,c);}}privatevoidMove(intn,stringi,stringj){Console.WriteLine("Movedisk{0}from{1}to{2}",n,i,j);}} 阅读全文
摘要:
staticvoidCollectFiles(DirectoryInfodir){if(ExcludeFolders.Contains(dir.Name)){return;}FileSystemInfo[]SystemFiles=dir.GetFileSystemInfos();if(SystemFiles.Length==0){return;}else{foreach(varfileindir.GetFiles("*.bak")){FileList.Add(file);}foreach(varfolderindir.GetDirectories()){CollectFil 阅读全文
摘要:
DimstrUrlAsString="http://www.mtsindices.com/datafiles/index_fixing/1730/eMTX_1730.xls"DimfilenameAsSystem.String="C:\Xignite\Services\Rates\MTX\today.xls"DimpathAsString="C:\Xignite\Services\Rates\MTX\"DimdtAsNewSystem.Data.DataTableDimstrDateAsSystem.String=NothingIf( 阅读全文
摘要:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Xml;usingSystem.Xml.Linq;namespaceConsoleApplication2{classOperateXML{XmlDocumentxmldoc;XmlNodexmlnode;XmlElementxmlelem;publicvoidCreateDocByDoc(){xmldoc=newXmlDocument();XmlDeclarationxDecl=xmldoc.CreateXmlDe 阅读全文