SAX: It is an event based parsing API, it provides a low level access, is memory efficient and faster than DOM since it doesn’t load the whole document tree in memory but it doesn’t provide support for navigation like the one provided by XPath, although it is more efficient it is harder to use too.
DOM(DOM4J and JDOM): It as model based parser that loads a tree structure document in memory, so we have the original elements order, we can navigate our document both directions, it provides an API for reading and writing, it offers XML manipulation and it is very easy to use although the price is high strain on memory resources.
StAX: It offers the ease of DOM and the efficiency of SAX but it lacks of some functionality provided by DOM like XML manipulation and it only allows us to navigate the document forward.
JAXB: It allows us to navigate the document in both directions, it is more efficient than DOM, it allows conversion from XML to java types and it supports XML manipulation but it can only parse a valid XML document.
New UI design sytem is called fluent, the website is at https://www.microsoft.com/design/fluent/. It can help let developer know how to design an Windows style application UI and the guide of UWP web app design.
Fabric.js is an open source js framework using canvas as the basic style of UI components, the official site is at http://fabricjs.com/.
Useful links:
Directly reuse existing Microsoft designed and implemented components is very convinient as long as your application can work well with these codes.
The object is still under active development, there are more and more new features added, reading the documents can get the updated information. As for now, there are below bullet points:
操作数栈(Operand Stack)也常称为操作栈,它是一个后入先出(Last In First Out, LIFO)栈。同局部变量表一样,操作数栈的最大深度也在编译的时候写入到Code属性的max_stacks数据项中。操作数栈的每一个元素可以是任意的Java数据类型,包括long和double。
@Override public String call()throws Exception { Thread.sleep(1000); //return the thread name executing this callable task return Thread.currentThread().getName(); } publicstaticvoidmain(String args[]){
// the standard idiom for using the wait method synchonized(o){ // 防止线程被无意唤醒,需要while loop保证代码安全 while(!condition){ o.wait(); // do something // notifyAll能保证需要被唤醒的线程的活性。如果都在等待同一个条件,可以用notify() o.notifyAll(); } // do something when condition is fulfilled. }
线程调度器Scheduler
static Thread.yeild():可以让步出当前线程的优先级,让其他同优先级的线程先跑。
Thread.join(): 当前线程等待一个线程t(join的实例)完成后再继续执行。类似于
1 2 3 4 5 6 7 8
synchronized(this){ // if t is alive, keep waiting while(isAlive()){ wait(); } // continue current thread }
publicfinalclassSystem { //System 类不能被实例化。 privateSystem() {} //在 System 类提供的设施中,有标准输入、标准输出和错误输出流;对外部定义的属性 //和环境变量的访问;加载文件和库的方法;还有快速复制数组的一部分的实用方法。 /** * src and dest都必须是同类型或者可以进行转换类型的数组. * @param src the source array. * @param srcPos starting position in the source array. * @param dest the destination array. * @param destPos starting position in the destination data. * @param length the number of array elements to be copied. */ publicstaticnativevoidarraycopy(Object src, int srcPos, Object dest, int destPos, int length); } package com.lang.reflect;
如果两个指定的 long 型数组彼此相等,则返回 true。如果两个数组包含相同数量的元素,并且两个数组中的所有相应元素对都是相等的,则认为这两个数组是相等的。换句话说,如果两个数组以相同顺序包含相同的元素,则两个数组是相等的。同样的方法适用于所有的其他基本数据类型(Byte,short,Int等)。
public static void fill(int[] a, int val)
将指定的 int 值分配给指定 int 型数组指定范围中的每个元素。同样的方法适用于所有的其他基本数据类型(Byte,short,Int等)。