西维蜀黍

【XPath】Learning XPath

The XML Example Document

We will use the following XML document in the examples below.

<?xml version="1.0" encoding="UTF-8"?>

<bookstore>

<book>
  <title lang="en">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="en">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore>
  ...


【XML】XML DOM

According to the XML DOM, everything in an XML document is a node:

  • The entire document is a document node
  • Every XML element is an element node
  • The text in the XML elements are text nodes
  • Every attribute is an attribute node
  • Comments are comment nodes

The XML DOM Node Tree

The XML DOM views an XML document as a tree-structure. The tree structure is called a node-tree.

All nodes can be accessed through the tree. Their contents can be modified or deleted, and new elements can be created.

The node tree shows the set of nodes, and the connections between them. The tree starts at the root node and branches out to the text nodes at the lowest level of the tree:

  ...


【XML】Learning XML

The Difference Between XML and HTML

XML and HTML were designed with different goals:

  • XML was designed to carry data - with focus on what data is
  • HTML was designed to display data - with focus on how data looks
  • XML tags are not predefined like HTML tags are
  ...


【WordPress】WordPress安全性设置

自动安全扫描

安装安全插件 如 WordFence。安全插件能做的事,除了自动扫描还有很多,可以仔细查看插件配置页面。

  ...


【Java】macOS下编译JDK8

安装mercurial

brew install mercurial

  ...


【Node.js】Node.js 应用性能监测与分析

监控指标(Metrics to watch)

Tick频率(Tick frequency) - number of ticks per time

Tick周期(Tick Duration) - the time one tick takes

Active Handles and Requests

Garbbage Collection activity

  ...


【Node.js】Node.js中的单线程模型与多线程/进程

JavaScript语言的一大特点就是单线程,也就是说,同一个时间只能做一件事。

那么,为什么JavaScript不能有多个线程呢?这样能提高效率啊。

  ...


【Architectural Pattern】MVVM 与数据绑定

概念

**MVVM (Model - View - ViewModel)**最早由微软提出,它在MVC的基础之上,增加了数据绑定机制。

  ...


【Design Pattern】Structural - Template Method

1 动机

2 定义

在阎宏博士的《Java与模式》一书中开头是这样描述模板方法(Template Method)模式的:

模板方法模式是类的行为模式。准备一个抽象类,将部分逻辑以具体方法以及具体构造函数的形式实现,然后声明一些抽象方法来迫使子类实现剩余的逻辑。不同的子类可以以不同的方式实现这些抽象方法,从而对剩余的逻辑有不同的实现。这就是模板方法模式的用意。

  ...


【Design Pattern】Strctural - Composite

动机

  • 希望表达具有层次结构(部分-整体,part-whole)的实体
  • 对调用者来说,叶子元素和复合元素都是一样的
  ...