RichTextBox syntax highlighting
The author use an RTF tag called /highlight# to implementing highlighting in RichTextBox: RichTextBox with background highlighting in VB.NET
Adds support for setting the background color in the RichTextBox: Background Highlighting with the RichTextBox the System way.
阅读全文
volatile关键字
volatile关键字是一种类型修饰符,用它声明的类型变量表示可以被某些编译器未知的因素更改,比如:操作系统、硬件或者其它线程等。遇到这个关键字声明的变量,编译器对访问该变量的代码就不再进行优化,从而可以提供对特殊地址的稳定访问。
使用该关键字的例子如下:
int volatile nVint;
当要求使用volatile 声明的变量的值的时候,系统总是重新从它所在的内存读取数据,即使它前面的指令刚刚从该处读取过数据。而且读取的数据立刻被保存。
例如:
volatile int i=10;
int a = i;
...
//其他代码,并未......
阅读全文
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Test {
public static void main(String[] args) {
List list = new ArrayList();
list.add(3);
list.add(2);
list.add(10);
list.add(4);
list.add(70);
/* System.out.println("---方法一 -----");
for(Iterator iterator = list.iterator();iterator.hasNext();){
int i = (Integer) iterator.next();
System.out.println(i);
}
/* S......
阅读全文
// The view controller that presented this view controller (or its farthest ancestor.)@property(nonatomic,readonly) UIViewController *presentingViewController NS_AVAILABLE_IOS(5_0);
a present b,b present c 。 现在要从c中直接回到a
if ([self respondsToSelector:@selector(presentingViewController)])
{
[self.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
}
阅读全文