Unoidl中的关键字

使用UNO的idl的时候,要避免使用Unoidl的关键字,如果使用了的话,编译的时候会报一些莫名的错误。

以下是它的关键字和保留字。

Keywords


The following table shows all keywords of the unoidl. All the keywords are
reserved and cannot be used as an identifier.

| any | attribute | boolean | bound | byte |
case
—|—|—|—|—|—
char | const | constants | constrained | default |
double

enum

| exception | float |

hyper

|

in

|

inout

interface

|

long

|

maybeambigious

|

maybedefault

|

maybevoid

|

module

needs

|

observes

|

oneway

|

optional

|

out

|

property

raises | readonly | removable | sequence | service |
short
string | struct | switch | transient | type |
typedef
union | unsigned | void | FALSE | False | TRUE
True | | | | |

U n

Why are some Text nodes empty when read xml with parser

Why are some Text nodes empty?

In XML, all whitespace has to be passed through to the application. This means
that if you have whitespace, such as carriage returns, between tags in your
source file, these have to be passed through, even if they’re just there for
pretty-printing. The DOM implementation has to put this whitespace somewhere,
and the only possibility is a text node. Thus you will get text nodes which
look empty, but in fact have a carriage return or other whitespace in them.

Note that some DOM implementations, which do not consider whitespace in
element content to be meaningful for the XML languages they support, discard
these whitespace nodes before exposing the DOM to their users.

Avoid Empty Text Nodes

Firefox, and some other browsers, will treat empty white-spaces or new lines
as text nodes, Internet Explorer will not.

This causes a problem when using the properties: firstChild, lastChild,
nextSibling, previousSibling.

To avoid navigating to empty text nodes (spaces and new-line characters
between element nodes), we use a function that checks the node type:

function get_nextSibling(n)
{
y=n.nextSibling;
while (y.nodeType!= 1 )
{
y=y.nextSibling;
}
return y;
}

The function above allows you to use get_nextSibling( node ) instead of the
property node .nextSibling.

Code explained:

Element nodes are type 1. If the sibling node is not an element node, it moves
to the next nodes until an element node is found. This way, the result will be
the same in both Internet Explorer and Firefox.

http://www.w3schools.com/dom/dom_nodes_navigate.asp

www.w3.org/DOM/faq.html#emptytext

make会做什么

it is important to understand that make is sort of two languages in one. The
first language describes dependency graphs consisting of targets and
prerequisites. The second language is a macro language for performing textual
substitution.

make是两种语言的结合,一种是用来描述依赖关系的,一种是一个宏语言,用来进行字符串操作。

When make runs, it performs its job in two phases. In the first phase, make
reads the makefile and any included makefiles. At this time, variables and
rules are loaded into make’s internal database and the dependency graph is
created. In the second phase, make analyzes the dependency graph and
determines the targets that need to be updated, then executes command scripts
to perform the required updates.

当make运行时,它的工作分为两个阶段。第一阶段:make会读取makefile和它include的makefiles,在这是变量和规则被加载到make的内部数据库中,同时依赖关系图被建立起来。第二阶段:make会分析建立好的依赖图,然后来决定哪些targets需要更新,然后来执行对应target的命令来完成所需要的更新。

以上摘自:Managing Projects with GNU make, 3rd Edition

节约用水

为了节约用水,为什么不把厕所洗脸盆使用过的水,导入到马桶蓄水的地方,这样就相当于水的二次利用了;

更进一步的话,还可以将脸盆的水存储起来,一端接马桶,再加上个龙头,出来的水可以拖地…

你们以为呢。

如何debug makefile文件

27.11 Debugging Make Rules

The rules and dependency trees generated by automake can get rather
complex, and leave the developer head-scratching when things don’t work as
expected. Besides the debug options provided by the make command (see
Options Summary
in The GNU Make Manual ), here’s a couple of
further hints for debugging makefiles generated by automake effectively:

  • If less verbose output has been enabled in the package with the use of silent rules (see Automake Silent Rules ), you can use make V=1 to see the commands being executed.
  • make -n can help show what would be done without actually doing it. Note however, that this will still execute commands prefixed with ‘ + ’, and, when using GNU make , commands that contain the strings ‘ $(MAKE) ’ or ‘ ${MAKE} ’ (see Instead of Execution in The GNU Make Manual ). Typically, this is helpful to show what recursive rules would do, but it means that, in your own rules, you should not mix such recursion with actions that change any files. 8 Furthermore, note that GNU make will update prerequisites for the Makefile file itself even with -n (see Remaking Makefiles in The GNU Make Manual ).
  • make SHELL="/bin/bash -vx" can help debug complex rules. See The Make Macro SHELL in The Autoconf Manual , for some portability quirks associated with this construct.
  • echo 'print: ; @echo "$(VAR)"' | make -f Makefile -f - print can be handy to examine the expanded value of variables. You may need to use a target other than ‘ print ’ if that is already used or a file with that name exists.
  • http://bashdb.sourceforge.net/remake/ provides a modified GNU make command called remake that copes with complex GNU make -specific Makefiles and allows to trace execution, examine variables, and call rules interactively, much like a debugger.

here are three command-line options I find most useful for debugging:

--just-print

--print-data-base

--warn-undefined-variables