04 十二月, 2009
Posted by: asd In: 科技新知| 軟體使用 ()
在WinXP上安裝一張虛擬網路卡,用途是在無法存取網路時,在虛擬網路環境中測試。
例如本機 WinXP 使用網芳或 ssh 與 vmware 上的 linux 連線
安裝步驟如下
1. [控制台]->「新增硬體]
2. 按一下 [是,我已連接這個硬體],然後按一下 [下一步]。
3. 按一下位於清單底部的 [新增硬體裝置],然後按一下 [下一步]。
4. 按一下 [安裝我從清單中手動選取的硬體],再按一下 [下一步]。
5. 按一下 [網路介面卡],再按一下 [下一步]。
6. 在 [製造商] 方塊中,按一下 [Microsoft]。
7. 在 [網路介面卡] 方塊中,按一下 [Microsoft Loopback Adapter],然後按一下 [下一步]。
8. 按一下 [完成]。
參考
1. [控制台]->「新增硬體]
2. 按一下 [是,我已連接這個硬體],然後按一下 [下一步]。
3. 按一下位於清單底部的 [新增硬體裝置],然後按一下 [下一步]。
4. 按一下 [安裝我從清單中手動選取的硬體],再按一下 [下一步]。
5. 按一下 [網路介面卡],再按一下 [下一步]。
6. 在 [製造商] 方塊中,按一下 [Microsoft]。
7. 在 [網路介面卡] 方塊中,按一下 [Microsoft Loopback Adapter],然後按一下 [下一步]。
8. 按一下 [完成]
03 十一月, 2009
Posted by: asd In: 科技新知| 軟體使用 ()
在windows下,如果要在console下命令,根據檔名開啟預設的應用程式
start 123.txt # 開啟預設文字編輯器
start http://www.google.com #開啟預設的瀏覽器
start mailto:admin@123.com //開啟預設的email軟體
若是在linux 下,使用的是gnome
gnome-open 123.txt
gnome-open http://www.google.com
gnome-open mailto:admin@123.com
參考 Open a file from the command line using its default application
Use Perl here documents to print multiple lines of output
example:
PERL:
-
-
Perl offers a convenient way of printing multiple lines of output through an interesting feature known as a "Perl here document".
-
-
A multiline Perl here document works like this:
-
<ol>
-
<li>The first line of your command will include the two characters <code><<</code> followed by a "special" identifier string, followed by a semi-colon. (For my example I will use the identifier string <code>FOO</code>. More on this shortly.)</li>
-
<li>Next, just enter all of the lines of output that you want to
print.</li>
-
<li>When you are ready to terminate the output, put your special identifier string on a line by itself to end the output.</li>
-
</ol>
-
FOO
遇到反斜線需要 double。
12 十月, 2009
Posted by: asd In: Web| 程式設計 ()
xml data
CODE:
-
<?xml version="1.0" encoding="ISO-8859-1"?>
-
<catalog>
-
<cd country="USA">
-
<title>Empire Burlesque</title>
-
<artist>Bob Dylan</artist>
-
<price>10.90</price>
-
</cd>
-
<cd country="UK">
-
<title>Hide your heart</title>
-
<artist>Bonnie Tyler</artist>
-
<price>10.0</price>
-
</cd>
-
<cd country="USA">
-
<title>Greatest Hits</title>
-
<artist>Dolly Parton</artist>
-
<price>9.90</price>
-
</cd>
-
</catalog>
XPath expressions
/catalog |
selects the root element |
/catalog/cd |
selects all the cd elements of the catalog element |
/catalog/cd/price |
selects all the price elements of all the cd elements of the catalog element |
/catalog/cd[price>10.0] |
selects all the cd elements with price greater than 10.0 |
starts with a slash(/) |
represents an absolute path to an element |
starts with two slashes(//) |
selects all elements that satisfy the criteria |
//cd |
selects all cd elements in the document |
/catalog/cd/title | /catalog/cd/artist |
selects all the title and artist elements of the cd elements of catalog |
//title | //artist |
selects all the title and artist elements in the document |
/catalog/cd/* |
selects all the child elements of all cd elements of the catalog element |
/catalog/*/price |
selects all the price elements that are grandchildren of catalog |
/*/*/price |
selects all price elements which have two ancestors |
//* |
selects all elements in the document |
/catalog/cd[1] |
selects the first cd child of catalog |
/catalog/cd[last()] |
selects the last cd child of catalog |
/catalog/cd[price] |
selects all the cd elements that have price |
/catalog/cd[price=10.90] |
selects cd elements with the price of 10.90 |
/catalog/cd[price=10.90]/price |
selects all price elements with the price of 10.90 |
//@country |
selects all "country" attributes |
//cd[@country] |
selects cd elements which have a "country" attribute |
//cd[@*] |
selects cd elements which have any attribute |
//cd[@country='UK'] |
selects cd elements with "country" attribute equal to 'UK' |
reference:
Manipulate XML data with XPath and XmlDocument (C#)
XPath Tutorial