08 2012 档案
摘要:1.观察两个类classA{protectedinti=0;publicA(){i=1;}publicvoidP(){System.Console.WriteLine("P:"+i.ToString());}publicvirtualvoidVP(){System.Console.WriteLine("VPinA:"+i.ToString());}}classB:A{publicB(){i=2;} public B(int i)// public B(int i) = public B(int i):base(){//this.i=i;//keepthi
阅读全文
摘要:-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.UITapGestureRecognizer*doubleTap=[[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(tapDetected:)];doubleTap.numberOfTapsRequired=2;[self.viewaddGestureRecognizer:doubleTap];UIPinchGestur
阅读全文
摘要:VX3VY-8GCVT-KJQCY-RQ99X-MCF2Rhttps://www.microsoft.com/visualstudio/registration/product?key=7FD7A672-E418-4467-8EC8-D8C0F795911F
阅读全文
摘要://#import "/usr/include/sqlite3.h"//add this to your header of code-(void)saveData{sqlite3_stmt*statement;constchar*dbpath=[databasePathUTF8String];if(sqlite3_open(dbpath,&contactDB)==SQLITE_OK){NSString*insertSQL=[NSStringstringWithFormat:@"INSERTINTOCONTACTS(name,address,phone)V
阅读全文
摘要:-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientationduration:(NSTimeInterval)duration{if(toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft||toInterfaceOrientation==UIInterfaceOrientationLandscapeRight){self.firstButton.frame=CGRectMake(20,20,482,7
阅读全文
摘要:Export a datatable to Excel and save as fileDimCurrentCIAsSystem.Globalization.CultureInfo=System.Threading.Thread.CurrentThread.CurrentCultureSystem.Threading.Thread.CurrentThread.CurrentCulture=NewSystem.Globalization.CultureInfo("en-US")If(tmpDataTableIsNothing)ThenReturnEndIfDimrowNumA
阅读全文
摘要:DimCurrentCIAsSystem.Globalization.CultureInfo=System.Threading.Thread.CurrentThread.CurrentCultureSystem.Threading.Thread.CurrentThread.CurrentCulture=NewSystem.Globalization.CultureInfo("en-US")It's a bug about Excel interop.adding the aboveprevious to your code.
阅读全文
摘要:#defineSWITCH_TAG102-(void)updateSwitch:(id)sender{//toggletheswitchfromitscurrentsettingUISwitch*s=[self.view.windowswitchWithTag:SWITCH_TAG];[ssetOn:!s.isOn];}-(void)updateTime:(id)sender{//setthelabeltothecurrenttime[self.view.windowlabelWithTag:LABEL_TAG].text=[[NSDatedate]description];}//Thisis
阅读全文
摘要:-(BOOL)connectedToNetwork{//Createzeroaddystructsockaddr_inzeroAddress;bzero(&zeroAddress,sizeof(zeroAddress));zeroAddress.sin_len=sizeof(zeroAddress);zeroAddress.sin_family=AF_INET;//RecoverreachabilityflagsSCNetworkReachabilityRefdefaultRouteReachability=SCNetworkReachabilityCreateWithAddress(
阅读全文
摘要:If your iOS app generates a crash reportwith the exception code 0x8badfood, thismeans that the iOSwatchdogtimer killed your app because it was unresponsive; such a crash may have been caused by a synchronousnetworking call.
阅读全文
摘要:classProgram{staticvoidMain(string[]args){stringdate="2011-08-15";DateTimed0=DateTime.Parse(date);Console.WriteLine(d0.ToString("D0IS:yyyy-MM"));DateTimed1=DateTime.Now;Console.WriteLine(d1.ToString("D1IS:yyyy-MM"));intr=GetDateDiffYears(d0,d1);Console.WriteLine(r.ToStr
阅读全文
摘要:#regionJsonhelperusingSystem.IO;usingSystem.Text;usingSystem.Runtime.Serialization.Json;publicclassJsonHelper{///<summary>///JSON序列化///</summary>publicstaticstringJsonSerializer<T>(Tt){DataContractJsonSerializerser=newDataContractJsonSerializer(typeof(T));MemoryStreamms=newMemorySt
阅读全文
摘要:-(void)SelectSort{NSLog(@"======startingsort=======");//intarr[100];//for(inti=0;i<100;i++)//{//arr[i]=i;//}intarr[]={1,3,9,5,2,7,10,20,11,6};//NSString*str=[NSStringstringWithFormat:@"I'm:%d",1];for(inti=0;i<10;i++){intmin=i;for(intj=i+1;j<10;j++){if(arr[j]<arr[m
阅读全文
摘要:staticvoidMain(string[]args){int[]arr=newint[1000];for(inti=0;i<arr.Length;i++){arr[i]=i;}//sequentialForEachintb=0;Stopwatchstopwatch=newStopwatch();stopwatch.Start();foreach(varxinarr){b=b+x;System.Threading.Thread.Sleep(1);//Console.WriteLine(x);}stopwatch.Stop();Console.WriteLine("Sequen
阅读全文