点击下载安装cronolog
。
假设安装目录为:/usr/local/cronolog
{"type":"编程笔记"}
简单举例说明java和javascript在对象继承上的差别,javascript是原型继承,java甪是类继承:
Java | JavaScript |
---|---|
Strongly-typed | Loosely-typed |
Static | Dynamic |
Classical | Prototypal |
Classes | Functions |
Constructors | Functions |
Methods | Functions |
./configure \--prefix=/usr/local/apache2 \--enable-so \--enable-rewrite \--enable-module=most \--enable-shared=max \--enable-cgi \--enable-mime-magic \--enable-dav \--enable-dav-fs \--enable-maintainer-mode \--enable-ssl \--enable-proxy \--enable-proxy-connect \--enable-proxy-ftp \--enable-proxy-http \--enable-proxy-balancer \--with-included-apr |
The techniques we’ve covered so far use standard browser features for purposes other than that for which they were intended. As such, they lack many features you might want out of RPC-over-HTTP, such as the ability to check HTTP return codes and to specify username/password authentication information for requests. Modern browsers let you do JavaScript RPCs in a much cleaner, more elegant fashion with a flexible interface supporting the needed features missing from the previously discussed hacks.
Internet Explorer 5 and later support the XMLHTTP object and Mozilla-based browsers provide an XMLHTTPRequest object. These objects allow you to create arbitrary HTTP requests (including POSTs), send them to a server, and read the full response, including headers. Table 19-1 shows the properties and methods of the XMLHTTP object.
readyState
Integer indicating the state of the request, either 0
(uninitialized), 1
(loading), 2
(response headers received), 3
(some response body received), or 4
(request complete).
Onreadystatechange
Function to call whenever the readyState changes.
status
HTTP status code returned by the server (e.g., 200
).
statusText
Full status HTTP status line returned by the server (e.g., 200 OK
).
responseText
Full response from the server as a string.
responseXML
A Document object representing the server's response parsed as an XML document.
abort()
Cancels an asynchronous HTTP request.
getAllResponseHeaders()
Returns a string containing all the HTTP headers the server sent in its response. Each header is a name/value pair separated by a colon, and header lines are separated by a carriage return/linefeed pair.
getResponseHeader(headerName)
Returns a string corresponding to the value of the headerName header returned by the server (e.g., request.getResponseHeader("Set-cookie")).
open(method, url [, asynchronous[, user, password]])
Initializes the request in preparation for sending to the server. The method parameter is the HTTP method to use, for example, GET or POST. The url is the URL the request will be sent to. The optional asynchronous parameter indicates whether send() returns immediately or after the request is complete (default is true, meaning it returns immediately). The optional user and password arguments are to be used if the URL requires HTTP authentication. If no parameters are specified by the URL requiring authentication, the user will be prompted to enter it.
setRequestHeader(name, value)
Adds the HTTP header given by the name (without the colon) and value parameters.
send(body)
Initiates the request to the server. The body parameter should contain the body of the request, i.e., a string containing fieldname=value&fieldname2=value2… for POSTs or the empty string ("") for GETs.
XMLHTTP requests can be either synchronous or asynchronous, as specified by the optional third parameter to open(). The send() method of a synchronous request will return only once the request is complete, that is, the request completes “while you wait.” The send() method of an asynchronous request returns immediately, and the download happens in the background. In order to see if an asynchronous request has completed, you need to check its readyState. The advantage of an asynchronous request is that your script can go on to other things while it is made and the response received, for example, you could download a bunch of requests in parallel.
To create an XMLHTTP object in Mozilla-based browsers, you use the XMLHttpRequest constructor:
假如您使用的是专为 Windows PC 制造的键盘,请使用 Alt 键来取代 Option 键,以 Windows 标志键来取代 Command 键。部分 Mac 键盘和快捷键使用最上面一排的特殊键,按键上有音量、显示器亮度和其他功能的图像。您可以按图像键以执行该功能,或结合该键与 Fn 键以做为 F1、F2、F3 或其他标准功能键。
快捷键 | 说明 |
---|---|
Command-X | 剪切:移除所选项目,然后拷贝到剪贴板。 |
Command-C | 将所选项目拷贝到剪贴板。这也可以用在 Finder 中的文件。 |
Command-V | 将剪贴板的内容贴上目前的文件或 app 中。这也可以用在 Finder 中的文件。 |
Command-Z | 还原前一个指令。您可以按 Command-Shift-Z 以重做,反转还原指令。在某些 app 中,您可以还原与重做多个指令。 |
Command-A | 全选项目。 |
Command-F | 寻找:开启 Find 窗口或在文件中寻找项目。 |
Command-G | 再次寻找:寻找下一个之前找到的项目。若要寻找上一个,请按 Command-Shift-G。 |
Command-H | 隐藏最前方 app 的窗口。若要检视最前方 app 并同时隐藏所有其他 app,请按 Command-Option-H。 |
Command-M | 将最前方窗口缩到最小并缩到 Dock。若要将最前方 app 的所有窗口缩到最小,请按 Command-Option-M。 |
Command-N | 新增:开启新的文件或窗口。 |
Command-O | 开启所选项目,或开启对话框以选择要开启的文件。 |
Command-P | 列印目前文件。 |
Command-S | 储存目前文件。 |
Command-W | 关闭最前方窗口。若要关闭 app 的所有窗口,请按 Command-Option-W。 |
Command-Q | 结束 app。 |
Command-Option-Esc | 强制结束:选择 app 以强制结束。或按 Command-Shift-Option-Esc 并按住 3 秒,即可仅强制最前方 app 结束。 |
Command-空格键 | Spotlight:显示或隐藏 Spotlight 搜索栏位。若要从 Finder 窗口执行 Spotlight 搜索,按 Command-Option-空白键。若您使用多个输入来源来输入不同语言,则这些快捷键会变更输入来源,而不是显示 Spotlight。 |
空白键 | 快速查看:使用「快速查看」以预览所选项目。 |
Command-Tab | 切换 app:在开启中的 app 之间切换至下一个最近使用过的 app。 |
Command-Shift-波浪号(~) | 切换窗口:切换至最前方 app 的下一个最近使用过的窗口。 |
Command-Shift-3 | 屏幕快照:拍摄整个画面的屏幕快照。 |
Command-逗号(,) | 偏好设置:开启最前方 app 的偏好设置。 |
快捷键 | 说明 |
---|---|
按住电源键 5 秒 | 可强制 Mac 关机。 |
Command-Control-电源按钮 | 强制 Mac 重新启动。 |
Command-Option-电源按钮 | 使 Mac 进入睡眠。 |
Shift-Control-电源按钮 | 使显示器进入睡眠。 |
Command-Control-电源按钮 | 结束所有 app,然后重新启动 Mac。如果任何开启中文件尚有未储存的变更,系统会询问您是否要储存。 |
Command-Option-Control-电源按钮 | 结束所有 app,然后将 Mac 关机。如果任何开启中文件尚有未储存的变更,系统会询问您是否要储存。 |
Command-Shift-Q | 登出 OS X 使用者帐号。 |
Command-Shift-Option-Q | 立即登出 OS X 使用者帐号,系统不会要求确认。 |
快捷键 | 说明 |
---|---|
Command-B | 让所选文字变成粗体,或者开启或关闭文字粗体功能。 |
Command-I | 让所选文字变成斜体,或者开启或关闭文字斜体功能。 |
Command-U | 为所选文字加上底线,或者开启或关闭文字底线功能。 |
Command-T | 显示或隐藏「字体」窗口。 |
Command-D | 在「打开」对话框或「储存」对话框中选择桌面文件夹。 |
Command-Control-D | 显示或隐藏所选文字的定义。 |
Command-Shift-冒号(:) | 显示「拼字和文法检查」窗口。 |
Command-分号(;) | 寻找文件中拼字错误的字。 |
Option-Delete | 删除插入点的左侧文字。 |
Control-H | 删除插入点的左侧字元。或使用 Delete 键。 |
Control-D | 删除插入点的右侧字元。或使用 Fn-Delete。 |
Fn-Delete | 在没有往前删除 键的键盘上执行往前删除。或使用 Control-D。 |
Control-K | 删除从插入点到行尾或段落结尾之间的文字。 |
Command-Delete | 在含有「删除」或「不储存」按钮的对话框中,选择「删除」或「不储存」。 |
Fn-向上键 Page Up | 向上卷动一页。 |
Fn-向下键 Page Down | 向下卷动一页。 |
Fn-向左键 Home | 卷动到文件的开头。 |
Fn-向右键 End | 卷动到文件的结尾。 |
Command-向上键 | 将插入点移到文件开头。 |
Command-向下键 | 将插入点移到文件结尾。 |
Command-向左键 | 将插入点移到目前这一行的开头。 |
Command-向右键 | 将插入点移到目前这一行的结尾。 |
Option-向左键 | 将插入点移到前一个字的开头。 |
Option-向右键 | 将插入点移到下一个字的结尾。 |
Command-Shift-向上键 | 选择从插入点到文件开头之间的文字。 |
Command-Shift-向下键 | 选择从插入点到文件结尾之间的文字。 |
Command-Shift-向左键 | 选择从插入点到目前这一行开头之间的文字。 |
Command-Shift-向右键 | 选择从插入点到目前这一行结尾之间的文字。 |
Shift-向上键 | 将文字所选范围延伸到位在上面一行相同水平位置的最近字元。 |
Shift-向下键 | 将文字所选范围延伸到位在下面一行相同水平位置的最近字元。 |
Shift-向左键 | 把文字所选范围向左延伸一个字元。 |
Shift-向右键 | 把文字所选范围向右延伸一个字元。 |
Shift-Option-向上键 | 把文字所选范围延伸到目前段落的开头,再按一次就会延伸到上一个段落的开头。 |
Shift-Option-向下键 | 把文字所选范围延伸到目前段落的结尾,再按一次就会延伸到下一个段落的结尾。 |
Shift-Option-向左键 | 把文字所选范围延伸到目前这个字的开头,再按一次就会延伸到上一个字的开头。 |
Shift-Option-向右键 | 把文字所选范围延伸到目前这个字的结尾,再按一次就会延伸到下一个字的结尾。 |
Control-A | 移到一行或一段的开头。 |
Control-E | 移到一行或一段的结尾。 |
Control-F | 前进一个字元。 |
Control-B | 后退一个字元。 |
Control-L | 将光标或所选范围移到可视区域中央。 |
Control-P | 上移一行。 |
Control-N | 下移一行。 |
Control-O | 在插入点后面插入新的一行。 |
Control-T | 将插入点后方的字元与插入点之前的字元互换。 |
Command-左花括号({) | 靠左对齐。 |
Command-右花括号(}) | 靠右对齐。 |
Command-Shift-垂直线(|) | 中央对齐。 |
Command-Option-F | 前往搜索栏位。 |
Command-Option-T | 显示或隐藏 app 中的工具列。 |
Command-Option-C | 拷贝样式:将所选项目的格式设置拷贝到剪贴板。 |
Command-Option-V | 贴上样式:将所拷贝的样式套用到所选项目。 |
Command-Shift-Option-V | 贴上并符合样式:将周围内容的样式套用到贴入该内容的项目。 |
Command-Option-I | 显示或隐藏检阅器窗口。 |
Command-Shift-P | 页面设置:显示用于选择文件设置的窗口。 |
Command-Shift-S | 显示「储存为」对话框或复制目前文件。 |
Command-Shift-减号(-) | 缩小所选项目。 |
Command-Shift-加号(+) | 放大所选项目。Command-等号(=)可执行相同功能。 |
Command-Shift-问号(?) | 开启「帮助说明」选单。 |
快捷键 | 说明 |
---|---|
Command-D | 复制所选文件。 |
Command-E | 退出所选磁碟或卷宗。 |
Command-F | 在Finder 窗口中开始 Spotlight 搜索。 |
Command-I | 显示所选文件的「简介」窗口。 |
Command-Shift-C | 开启「电脑」窗口。 |
Command-Shift-D | 开启桌面文件夹。 |
Command-Shift-F | 开启「我的所有文件」窗口。 |
Command-Shift-G | 开启「前往文件夹」窗口。 |
Command-Shift-H | 开启目前 OS X 使用者帐号的个人专属文件夹。 |
Command-Shift-I | 开启 iCloud Drive。 |
Command-Shift-K | 开启「网路」窗口。 |
Command-Option-L | 开启「下载项目」文件夹。 |
Command-Shift-O | 开启「文件」文件夹。 |
Command-Shift-R | 开启 AirDrop 窗口。 |
Command-Shift-T | 新增所选 Finder 项目至 Dock(OS X Mountain Lion 或之前版本) |
Command-Shift-Control-T | 新增所选 Finder 项目至 Dock(OS X Mavericks 或以上版本) |
Command-Shift-U | 开启「工具程式」文件夹。 |
Command-Option-D | 显示或隐藏 Dock。即使您不在 Finder 中,通常也可以使用。 |
Command-Control-T | 新增所选项目至侧边栏(OS X Mavericks 或以上版本)。 |
Command-Option-P | 在 Finder 窗口中显示或隐藏路径列。 |
Command-Option-S | 在 Finder 窗口中显示或隐藏侧边栏。 |
Command-斜线(/) | 在 Finder 窗口中显示或隐藏状态列。 |
Command-J | 打开显示方式选项。 |
Command-K | 开启「连接伺服器」窗口。 |
Command-L | 制作所选项目的替身。 |
Command-N | 开启新的 Finder 窗口。 |
Command-Shift-N | 建立新文件夹。 |
Command-Option-N | 建立新的智慧型文件夹。 |
Command-R | 显示所选替身的原始文件。 |
Command-T | 在目前 Finder 窗口中开启单一标签页时显示或隐藏标签列。 |
Command-Shift-T | 显示或隐藏 Finder 标签页。 |
Command-Option-T | 在目前 Finder 窗口中开启单一标签页时显示或隐藏工具列。 |
Command-Option-V | 移动:将剪贴板中的文件从原始位置移到目前位置。 |
Command-Option-Y | 检视所选文件的「快速查看」幻灯片。 |
Command-Y | 使用「快速查看」来预览所选文件。 |
Command-1 | 在 Finder 窗口中使用图像显示方式检视项目。 |
Command-2 | 在 Finder 窗口中使用列表显示方式检视项目。 |
Command-3 | 在 Finder 窗口中使用直栏显示方式检视项目。 |
Command-4 | 在 Finder 窗口中使用 Cover Flow 显示方式检视项目。 |
Command-左方括号([) | 前往上一个文件夹。 |
Command-右方括号(]) | 前往下一个文件夹。 |
Command-向上键 | 开启包含目前文件夹的文件夹。 |
Command-Control-向上键 | 在新窗口中开启包含目前文件夹的文件夹。 |
Command-向下键 | 开启所选项目。 |
Command-Mission Control | 显示桌面。即使您不在 Finder 中也可以使用。 |
Command-调高亮度键 | 开启或关闭「目标显示器模式」。 |
Command-调低亮度键 | 当 Mac 连接多台显示器时,开启或关闭显示器镜像输出。 |
向右键 | 开启选取的文件夹。这只能在列表显示方式中使用。 |
向左键 | 关闭选取的文件夹。这只能在列表显示方式中使用。 |
Option-按两下 | 在独立窗口中打开文件夹,同时关闭目前窗口。 |
Command-按两下 | 在独立标签页或窗口中开启文件夹。 |
Command-Delete | 将所选项目移到垃圾桶。 |
Command-Shift-Delete | 清空垃圾桶。 |
Command-Shift-Option-Delete | 不显示确认对话框便直接清空垃圾桶。 |
Command-Y | 使用「快速查看」来预览文件。 |
Option-调高亮度键 | 开启「显示器」偏好设置。也可以使用调低亮度键。 |
Option-Mission Control | 开启 Mission Control 偏好设置。 |
Option-调高音量键 | 开启「声音」偏好设置。也可以使用调低音量键。 |
按住 Command 键同时拖移 | 将拖移的项目移到其他卷宗或位置。当您拖移项目时,指标会改变。 |
按住 Option 键同时拖移 | 拷贝拖移的项目。当您拖移项目时,指标会改变。 |
按 Command-Option 同时拖移 | 制作拖移项目的替身。当您拖移项目时,指标会改变。 |
按 Option 同时按一下显示三角形 | 开启所选文件夹中的所有文件夹。这只能在列表显示方式中使用。 |
按 Command 同时按一下窗口标题 | 查看包含目前文件夹的文件夹。 |