摘要:
IEnumerable allRules = from e in root.Elements("rule") select e; foreach (XElement rule in allRules) {} 阅读全文
摘要:
List wordsList = new List(); wordsList = File.ReadAllLines(inFilePath, Encoding.Unicode).ToList(); wordsList = wordsList.GroupBy(x => x.ToLower()).Select(grp => grp.FirstOrDefault()).OrderBy(x => x).ToList(); File.WriteAllLines(@"other.txt", wordsList, Encoding.Unicode); List word 阅读全文
摘要:
1、 常量字符串 在代码里直接出现的”abcdef”这种字符串,在程序执行的时候,系统会将它们放在常量区,所谓常量区就是一直存在的,只读的,不可更改的数据区域,并且一个字符串只会有一份。假设你在程序里有两行代码 char* p1 = “agcd” ; char* p2 = “agcd” ; 无论你... 阅读全文
摘要:
<html><script language="JavaScript">function changFont( x ){ var font_style = x; var article = document.getElementById("article"); if( typeof font_style == "string" ){ article.style.fontWeight = font_style; } else { article.style.fontSize = font_style; }}< 阅读全文
摘要:
<script type="text/javascript">// 定义构造函数,并设定一个属性function Person(name){ this.name = name;}// 为 Person 增加一个方法Person.prototype.showName = function(){ alert("我叫" + this.name);};// new 关键字实例化一个对象var Tom = new Person("Tom");// 运行该对象内的 showName() 方法Tom.showName();</sc 阅读全文
摘要:
cin >>i; p= new (nothrow) int[i]; // inot a constant value: if(p == NULL){ } else{ } 阅读全文
摘要:
Anoutletdescribes a connection between two objects. When you want an object (such as the view controller) to communicate with an object that it contains (such as the text field), you designate the contained object as an outlet. When the app runs, the outlet you create in Xcode is restored, allowin.. 阅读全文
摘要:
- (void)viewDidLoad { [superviewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // [self setupArray]; //读取p... 阅读全文
摘要:
值参数,在函数执行前会调用一次拷贝构造函数初始化这个临时对象。 func(A) 引用参数,不产生一个临时对象来保存对象信息,不调用拷贝构造函数。 func(A&) 值返回,会产生一个临时对象(返回),并执行一次拷贝构造函数。 A func() 引用返回,不需要创建临时对象来保存对象信息(直接... 阅读全文