neovalle commited on
Commit
da55937
·
verified ·
1 Parent(s): 2f28fa9

Upload 9 files

Browse files
corpus/169.254.txt ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Why can't I connect with a 169.254.x.x IP address?
2
+
3
+ Search First! Then browse: Categories | Full Archive | By Date | Newsletter
4
+ Home � Networking � Network IP Addressing
5
+
6
+
7
+ Summary: 169.254.x.x IP addresses are self-assigned when your computer can't get an address any other way. It's an almost sure sign of a problem.
8
+
9
+ My IP address was 192.168.x.xx, and somehow it was changed to 169.254.xx.xx. Because of this I can't access the internet. Any ideas?
10
+
11
+
12
+
13
+ Your IP address wasn't "changed" so much as it was broken.
14
+
15
+ If you end up with an IP in the 169.254.x.x address range, then something is definitely wrong.
16
+
17
+
18
+
19
+ For most folks, the IP address of your computer is assigned when you boot your machine. Using DHCP, your computer asks for an IP address, and a DHCP server responds by assigning one:
20
+
21
+
22
+
23
+ If you're behind a NAT router it'll be the one handing out IP addresses and you'll most commonly get an address in the 192.168.x.x range. If you're directly connected to the internet your IP address could be almost anything. Exactly what range it'll be in is defined by which IP address ranges have been assigned to your ISP.
24
+
25
+ 169.254.x.x, however, is special.
26
+
27
+ Consider: what happens when your computer asks for an IP address and no one responds? Due to a network problem, or maybe not being on a network at all, perhaps there's no DHCP server to hand out IP addresses.
28
+
29
+ What happens is this: your machine waits for a while and then gives up. But when it gives up it invokes Automatic Private IP Addressing, or APIPA, and makes up its own IP address. And those "made up" IP addresses are in the 169.254.x.x range.
30
+
31
+ "It's like having an unlisted phone number that's so unlisted that even the phone company doesn't know it."Now, a 169.254.x.x IP address is pretty close to useless. The reason that IP addresses are assigned is so that the upstream networking equipment knows where to send or how to route packets that are destined to reach a machine at a particular address. In other words, when things work that equipment knows that your machine has this address. If your machine makes up its own address, no one else knows. As a result, there's no way to know how to get to your machine.
32
+
33
+ It's like having an unlisted phone number that's so unlisted that even the phone company doesn't know it. No one can call you.
34
+
35
+ Even connecting "out" to visit, say, a web site or other server doesn't work because there's no way to know where to send the response.
36
+
37
+ In fact, the only utility I've ever found with a 169.254.x.x address is if machines are connected directly to each other, then some protocols can be made to work machine-to-machine using the IP addresses. Most, however, do not.
38
+
39
+ It's frustrating enough that I consider a 169.254.x.x the same as "it's broken" and move on to resolving the underlying cause.
40
+
41
+ About all you can really say from getting one of those addresses is simply that the machine cannot reach the DHCP server over the network.
42
+
43
+ �If you're connected via a NAT router, then either your computer is not actually connected on the network to that router, or the router itself isn't responding to the DHCP request. I typically triple-check my cabling, and perhaps reboot the router.
44
+
45
+ �If you're connected to the internet directly then there's something about that that isn't working. Check the cabling to your broadband modem, and check the cabling from your broadband modem to your telephone or cable line. And, if all else fails, call your ISP - it may be their DHCP server or some other item they control that's at fault.
46
+
47
+ Bottom line: if you're getting a 169.254.x.x IP address then something about your network setup isn't working, and you probably want to investigate what and why.
48
+
49
+ Share
50
+ Related:
51
+
52
+ Helpful? Get new articles weekly by email in my FREE newsletter!
53
+
54
+ Your Name:
55
+ Your Email:
56
+
57
+
58
+ Why Subscribe?
59
+
60
+ �Ask Leo! - What is DHCP?
61
+
62
+ �Ask Leo! - Why doesn't my machine's IP address match what I'm told on the internet?
63
+
64
+ �Ask Leo! - Why does my home network only work with one computer at a time?
65
+
66
+ Article C3090 - July 18, 2007
67
+
68
+ Was this article helpful? �Yes� �No�
69
+
70
+ Recent Comments
71
+ 29 Comments
72
+ The best way I have found this issue to be resolved if all wlse fails like
73
+ netsh winsock reset catalog (vista)
74
+ or netsh winsock reset (XP)
75
+ try resetting the TCP/IP Stack in cmd prompt which is netsh int ip reset resetlog.txt
76
+ see if that works. Sometimes as i have learnt Winsock does not always repair the issue even though it's a last resort cmd. but resetting the tcp/ip stack can sometimes resolve this issue.
77
+
78
+ Posted by: Mark H at June 23, 2009 11:11 AM
79
+ Hello
80
+ I have the same problem, But this occur in my phone
81
+ recently i updated the software then after i cant access WIFI in my phone . Strange thing is I can access other Wireless network & My own Pc internet is working fine . I req everybodu plz help me . My OS is vista home
82
+ big thanks in advance
83
+
84
+ Posted by: vikram at July 24, 2009 4:25 AM
85
+ Thank You, Thank You, Thank YOU to "Mark H"!!!
86
+ I've just spend 8 hours in hell (can I say that word?), trying to revive my system from restore points and backups from (fortunately only) a week ago, but keeping track of everything ... well long story short, my problem was this "dead network" connectivity with the 169.254.x.x IP address.
87
+ Well, Mark H's comments to the rescue, the command: "netsh winsock reset" for my XP did the trick! I'll also look at the other command, "netsh int ip reset resetlog.txt" as I'm curious about that one.
88
+ Also, does anyone have more info on "WINSOCKFIX" program, is it anything more than just these two commands above? I'm leery of a downloaded program from the web (e.g. the DLL fixers) as you hear such war stories about them.
89
+ Best Regards to all, and again THANK YOU for having a site with such valuable posting, and to Mark H for the "winning" post!
90
+
91
+ Posted by: John (Andrews) at January 18, 2010 10:05 PM
92
+ Microsoft offers a utility that will "hard reset" an IP address that has 'defaulted' to a bad \ip address.
93
+
94
+ Generally you can get the system to reconfigure itself... the issue is caused from a timing issue and static charge.. When you tell the system to reset the IP address it may not work.. do it several times.. then before trying to connect online power cycle your machine.. turn the machine completely off and even unplug it/remove battery. It may take several cycles of this.
95
+
96
+ The windows utility and directions for a manual stack dump can be found here:
97
+
98
+ http://support.microsoft.com/kb/299357
99
+
100
+ Posted by: Ian at January 20, 2010 4:00 AM
101
+ I have two other laptops connecting fine. Except this one with default ip address of 169.254.145.125.. I tried the above "netsh winsock reset" and "netsh int ip reset resetlog.txt" rebooted and still not able to connect to Wireless Network for 192.168.2.1...using WinXP Svc 1.
102
+
103
+ Posted by: Rachel at February 26, 2010 6:40 PM
104
+ See all 29 comments...
105
+
106
+
107
+ Post a comment on "Why can't I connect with a 169.254.x.x IP address?":
108
+
109
+ Name: (Required)
110
+
111
+ (Name will be included when your comment is published.)
112
+
113
+ Email Address: (Required)
114
+
115
+ (Email Address will not be published.)
116
+
117
+ Remember Me? YesNo
118
+
119
+ By popular demand...
120
+ my tip jar
121
+
122
+ Buy Leo a Latte!
123
+ Comments: (you may use HTML tags for style)
124
+
125
+ Subscribe to the RSS Feed specifically for comments on this article.
126
+
127
+
128
+ Before commenting, please...
129
+ Read the article at the top of this page. If your comment shows you didn't, it'll be deleted and ignored.
130
+ Comment only on this article. Use the Google search box at the top of the page if you have a question about something else.
131
+ Don't include personal information in the comment. No email addresses. No phone numbers. No physical addresses.
132
+ Don't spam. Excessive links to unrelated sites within a comment or across multiple comments will cause all such comments to be removed.
133
+ Don't ask me to recover lost passwords or hacked accounts. I can't, and those comments will be deleted.
134
+ I can't respond to every comment. And I can't vouch for the accuracy of others who do.
135
+ Read Why didn't you answer my question? for hints on getting an answer.
136
+ By posting a comment you agree to the Terms of Service. Don't agree? Don't post.
137
+ Read the article at the top of this page. If your comment shows you didn't, it'll be deleted and ignored. Yes, I'm saying this twice; you'd be amazed.
138
+
139
+
140
+
141
+ Please wait. Your comment is being processed ...
142
+
143
+
corpus/LICENSE - Unknown - LICENSE.txt ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Python 2.1.1 license (http://www.python.org/2.1.1/license.html)
2
+
3
+ A. HISTORY OF THE SOFTWARE
4
+ ==========================
5
+
6
+ Python was created in the early 1990s by Guido van Rossum at Stichting
7
+ Mathematisch Centrum (CWI) in the Netherlands as a successor of a
8
+ language called ABC. Guido is Python's principal author, although it
9
+ includes many contributions from others. The last version released
10
+ from CWI was Python 1.2. In 1995, Guido continued his work on Python
11
+ at the Corporation for National Research Initiatives (CNRI) in Reston,
12
+ Virginia where he released several versions of the software. Python
13
+ 1.6 was the last of the versions released by CNRI. In 2000, Guido and
14
+ the Python core development team moved to BeOpen.com to form the
15
+ BeOpen PythonLabs team. Python 2.0 was the first and only release
16
+ from BeOpen.com.
17
+
18
+ Following the release of Python 1.6, and after Guido van Rossum left
19
+ CNRI to work with commercial software developers, it became clear that
20
+ the ability to use Python with software available under the GNU Public
21
+ License (GPL) was very desirable. CNRI and the Free Software
22
+ Foundation (FSF) interacted to develop enabling wording changes to the
23
+ Python license. Python 1.6.1 is essentially the same as Python 1.6,
24
+ with a few minor bug fixes, and with a different license that enables
25
+ later versions to be GPL-compatible. Python 2.1 is a derivative work
26
+ of Python 1.6.1, as well as of Python 2.0.
27
+
28
+ After Python 2.0 was released by BeOpen.com, Guido van Rossum and the
29
+ other PythonLabs developers joined Digital Creations. All
30
+ intellectual property added from this point on, starting with Python
31
+ 2.1 and its alpha and beta releases, is owned by the Python Software
32
+ Foundation (PSF), a non-profit modeled after the Apache Software
33
+ Foundation. See http://www.python.org/psf/ for more information about
34
+ the PSF.
35
+
36
+ Thanks to the many outside volunteers who have worked under Guido's
37
+ direction to make these releases possible.
38
+
39
+
40
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
41
+ ===============================================================
42
+
43
+ PSF LICENSE AGREEMENT
44
+ ---------------------
45
+
46
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
47
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
48
+ otherwise using Python 2.1.1 software in source or binary form and its
49
+ associated documentation.
50
+
51
+ 2. Subject to the terms and conditions of this License Agreement, PSF
52
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
53
+ license to reproduce, analyze, test, perform and/or display publicly,
54
+ prepare derivative works, distribute, and otherwise use Python 2.1.1
55
+ alone or in any derivative version, provided, however, that PSF's
56
+ License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
57
+ 2001 Python Software Foundation; All Rights Reserved" are retained in
58
+ Python 2.1.1 alone or in any derivative version prepared by Licensee.
59
+
60
+ 3. In the event Licensee prepares a derivative work that is based on
61
+ or incorporates Python 2.1.1 or any part thereof, and wants to make
62
+ the derivative work available to others as provided herein, then
63
+ Licensee hereby agrees to include in any such work a brief summary of
64
+ the changes made to Python 2.1.1.
65
+
66
+ 4. PSF is making Python 2.1.1 available to Licensee on an "AS IS"
67
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
68
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
69
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
70
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.1.1 WILL NOT
71
+ INFRINGE ANY THIRD PARTY RIGHTS.
72
+
73
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
74
+ 2.1.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
75
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.1.1,
76
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
77
+
78
+ 6. This License Agreement will automatically terminate upon a material
79
+ breach of its terms and conditions.
80
+
81
+ 7. Nothing in this License Agreement shall be deemed to create any
82
+ relationship of agency, partnership, or joint venture between PSF and
83
+ Licensee. This License Agreement does not grant permission to use PSF
84
+ trademarks or trade name in a trademark sense to endorse or promote
85
+ products or services of Licensee, or any third party.
86
+
87
+ 8. By copying, installing or otherwise using Python 2.1.1, Licensee
88
+ agrees to be bound by the terms and conditions of this License
89
+ Agreement.
90
+
91
+
92
+ BEOPEN.COM TERMS AND CONDITIONS FOR PYTHON 2.0
93
+ ----------------------------------------------
94
+
95
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
96
+
97
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
98
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
99
+ Individual or Organization ("Licensee") accessing and otherwise using
100
+ this software in source or binary form and its associated
101
+ documentation ("the Software").
102
+
103
+ 2. Subject to the terms and conditions of this BeOpen Python License
104
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
105
+ royalty-free, world-wide license to reproduce, analyze, test, perform
106
+ and/or display publicly, prepare derivative works, distribute, and
107
+ otherwise use the Software alone or in any derivative version,
108
+ provided, however, that the BeOpen Python License is retained in the
109
+ Software, alone or in any derivative version prepared by Licensee.
110
+
111
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
112
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
113
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
114
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
115
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
116
+ INFRINGE ANY THIRD PARTY RIGHTS.
117
+
118
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
119
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
120
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
121
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
122
+
123
+ 5. This License Agreement will automatically terminate upon a material
124
+ breach of its terms and conditions.
125
+
126
+ 6. This License Agreement shall be governed by and interpreted in all
127
+ respects by the law of the State of California, excluding conflict of
128
+ law provisions. Nothing in this License Agreement shall be deemed to
129
+ create any relationship of agency, partnership, or joint venture
130
+ between BeOpen and Licensee. This License Agreement does not grant
131
+ permission to use BeOpen trademarks or trade names in a trademark
132
+ sense to endorse or promote products or services of Licensee, or any
133
+ third party. As an exception, the "BeOpen Python" logos available at
134
+ http://www.pythonlabs.com/logos.html may be used according to the
135
+ permissions granted on that web page.
136
+
137
+ 7. By copying, installing or otherwise using the software, Licensee
138
+ agrees to be bound by the terms and conditions of this License
139
+ Agreement.
140
+
141
+
142
+ CNRI OPEN SOURCE GPL-COMPATIBLE LICENSE AGREEMENT
143
+ -------------------------------------------------
144
+
145
+ 1. This LICENSE AGREEMENT is between the Corporation for National
146
+ Research Initiatives, having an office at 1895 Preston White Drive,
147
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
148
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
149
+ source or binary form and its associated documentation.
150
+
151
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
152
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
153
+ license to reproduce, analyze, test, perform and/or display publicly,
154
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
155
+ alone or in any derivative version, provided, however, that CNRI's
156
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
157
+ 1995-2001 Corporation for National Research Initiatives; All Rights
158
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
159
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
160
+ Agreement, Licensee may substitute the following text (omitting the
161
+ quotes): "Python 1.6.1 is made available subject to the terms and
162
+ conditions in CNRI's License Agreement. This Agreement together with
163
+ Python 1.6.1 may be located on the Internet using the following
164
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
165
+ Agreement may also be obtained from a proxy server on the Internet
166
+ using the following URL: http://hdl.handle.net/1895.22/1013".
167
+
168
+ 3. In the event Licensee prepares a derivative work that is based on
169
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
170
+ the derivative work available to others as provided herein, then
171
+ Licensee hereby agrees to include in any such work a brief summary of
172
+ the changes made to Python 1.6.1.
173
+
174
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
175
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
176
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
177
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
178
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
179
+ INFRINGE ANY THIRD PARTY RIGHTS.
180
+
181
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
182
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
183
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
184
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
185
+
186
+ 6. This License Agreement will automatically terminate upon a material
187
+ breach of its terms and conditions.
188
+
189
+ 7. This License Agreement shall be governed by the federal
190
+ intellectual property law of the United States, including without
191
+ limitation the federal copyright law, and, to the extent such
192
+ U.S. federal law does not apply, by the law of the Commonwealth of
193
+ Virginia, excluding Virginia's conflict of law provisions.
194
+ Notwithstanding the foregoing, with regard to derivative works based
195
+ on Python 1.6.1 that incorporate non-separable material that was
196
+ previously distributed under the GNU General Public License (GPL), the
197
+ law of the Commonwealth of Virginia shall govern this License
198
+ Agreement only as to issues arising under or with respect to
199
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
200
+ License Agreement shall be deemed to create any relationship of
201
+ agency, partnership, or joint venture between CNRI and Licensee. This
202
+ License Agreement does not grant permission to use CNRI trademarks or
203
+ trade name in a trademark sense to endorse or promote products or
204
+ services of Licensee, or any third party.
205
+
206
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
207
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
208
+ bound by the terms and conditions of this License Agreement.
209
+
210
+ ACCEPT
211
+
212
+
213
+ CWI PERMISSIONS STATEMENT AND DISCLAIMER
214
+ ----------------------------------------
215
+
216
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
217
+ The Netherlands. All rights reserved.
218
+
219
+ Permission to use, copy, modify, and distribute this software and its
220
+ documentation for any purpose and without fee is hereby granted,
221
+ provided that the above copyright notice appear in all copies and that
222
+ both that copyright notice and this permission notice appear in
223
+ supporting documentation, and that the name of Stichting Mathematisch
224
+ Centrum or CWI not be used in advertising or publicity pertaining to
225
+ distribution of the software without specific, written prior
226
+ permission.
227
+
228
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
229
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
230
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
231
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
232
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
233
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
234
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
corpus/What Unix Gets Right.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s05.html
corpus/degrees of freedom.txt ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Degrees of freedom is a fundamental concept in statistics, and it plays a particularly important role in distributions like the t-distribution.
2
+
3
+ In a broad sense, degrees of freedom refers to the number of independent pieces of information available to estimate statistical parameters. When you are estimating parameters from a sample, each data point provides some information that you can use in your estimation. However, as you start estimating more parameters, each one reduces the amount of information available for estimating the next. So, the degrees of freedom in a situation is often the number of data points minus the number of parameters being estimated.
4
+
5
+ For example, when you calculate the sample mean from n data points, you're estimating one parameter, so you have n-1 degrees of freedom left for estimating the standard deviation or other parameters. This is why the standard deviation formula divides by n-1 instead of n.
6
+
7
+ In the context of the t-distribution, the degrees of freedom often refers to the number of independent observations in a sample minus the number of parameters estimated. The t-distribution is used in situations where the population variance is unknown and has to be estimated from the sample data, leaving you with fewer degrees of freedom. The shape of the t-distribution changes depending on the degrees of freedom, with fewer degrees of freedom resulting in heavier tails.
8
+
9
+ The concept of degrees of freedom is essential in statistical tests like the t-test, where it is used to calculate the critical values. It also affects the confidence intervals around an estimate. Understanding degrees of freedom helps you understand how much information you have for your estimates and how certain you can be about them.
10
+
11
+
12
+
13
+ Sure, let's consider a simple example of a t-test, which uses the t-distribution and the concept of degrees of freedom. Suppose we have a small sample of data and we want to test if the sample mean is significantly different from a hypothesized population mean.
14
+
15
+ Let's say we have the following five data points, representing the ages of five randomly selected individuals: 21, 23, 24, 22, 26. We want to test if this sample provides evidence that the population mean age is different from 22.
16
+
17
+ Step 1: Calculate the sample mean (x̄) and the sample standard deviation (s).
18
+
19
+ x̄ = (21+23+24+22+26)/5 = 23.2
20
+
21
+ We calculate the variance (s²) first, before finding the standard deviation (s).
22
+
23
+ s² = [(21-23.2)² + (23-23.2)² + (24-23.2)² + (22-23.2)² + (26-23.2)²] / (5-1)
24
+ = [4.84 + 0.04 + 0.64 + 1.44 + 7.84] / 4
25
+ = 14.8 / 4
26
+ = 3.7
27
+
28
+ s = sqrt(3.7) ≈ 1.9235
29
+
30
+ Step 2: Determine the degrees of freedom.
31
+
32
+ In a t-test, the degrees of freedom are given by the sample size minus 1. In this case, we have 5 observations, so df = 5 - 1 = 4.
33
+
34
+ Step 3: Calculate the t-score.
35
+
36
+ The t-score is calculated as:
37
+
38
+ t = (x̄ - μ) / (s / sqrt(n))
39
+
40
+ where μ is the hypothesized population mean. If we're testing against a population mean of 22:
41
+
42
+ t = (23.2 - 22) / (1.9235 / sqrt(5)) ≈ 1.118
43
+
44
+ Step 4: Compare the calculated t-score to the critical t-value.
45
+
46
+ At this point, you would look up the critical t-value for a specified significance level (e.g., 0.05) and 4 degrees of freedom in a t-distribution table or use statistical software. If the absolute value of your calculated t-score is greater than the critical t-value, you would reject the null hypothesis that the population mean is 22.
47
+
48
+ Please note that this is a simplified example. Real-world data analysis would typically involve larger sample sizes and could also involve more complex scenarios such as two-sample t-tests, paired t-tests, or adjustments for multiple comparisons.
corpus/doscommands.txt ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ For more information on a specific command, type HELP command-name
2
+ ASSOC Displays or modifies file extension associations.
3
+ AT Schedules commands and programs to run on a computer.
4
+ ATTRIB Displays or changes file attributes.
5
+ BREAK Sets or clears extended CTRL+C checking.
6
+ CACLS Displays or modifies access control lists (ACLs) of files.
7
+ CALL Calls one batch program from another.
8
+ CD Displays the name of or changes the current directory.
9
+ CHCP Displays or sets the active code page number.
10
+ CHDIR Displays the name of or changes the current directory.
11
+ CHKDSK Checks a disk and displays a status report.
12
+ CHKNTFS Displays or modifies the checking of disk at boot time.
13
+ CLS Clears the screen.
14
+ CMD Starts a new instance of the Windows command interpreter.
15
+ COLOR Sets the default console foreground and background colors.
16
+ COMP Compares the contents of two files or sets of files.
17
+ COMPACT Displays or alters the compression of files on NTFS partitions.
18
+ CONVERT Converts FAT volumes to NTFS. You cannot convert the
19
+ current drive.
20
+ COPY Copies one or more files to another location.
21
+ DATE Displays or sets the date.
22
+ DEL Deletes one or more files.
23
+ DIR Displays a list of files and subdirectories in a directory.
24
+ DISKCOMP Compares the contents of two floppy disks.
25
+ DISKCOPY Copies the contents of one floppy disk to another.
26
+ DOSKEY Edits command lines, recalls Windows commands, and creates macros.
27
+ ECHO Displays messages, or turns command echoing on or off.
28
+ ENDLOCAL Ends localization of environment changes in a batch file.
29
+ ERASE Deletes one or more files.
30
+ EXIT Quits the CMD.EXE program (command interpreter).
31
+ FC Compares two files or sets of files, and displays the differences
32
+ between them.
33
+ FIND Searches for a text string in a file or files.
34
+ FINDSTR Searches for strings in files.
35
+ FOR Runs a specified command for each file in a set of files.
36
+ FORMAT Formats a disk for use with Windows.
37
+ FTYPE Displays or modifies file types used in file extension associations.
38
+ GOTO Directs the Windows command interpreter to a labeled line in a
39
+ batch program.
40
+ GRAFTABL Enables Windows to display an extended character set in graphics
41
+ mode.
42
+ HELP Provides Help information for Windows commands.
43
+ IF Performs conditional processing in batch programs.
44
+ LABEL Creates, changes, or deletes the volume label of a disk.
45
+ MD Creates a directory.
46
+ MKDIR Creates a directory.
47
+ MODE Configures a system device.
48
+ MORE Displays output one screen at a time.
49
+ MOVE Moves one or more files from one directory to another directory.
50
+ PATH Displays or sets a search path for executable files.
51
+ PAUSE Suspends processing of a batch file and displays a message.
52
+ POPD Restores the previous value of the current directory saved by PUSHD.
53
+ PRINT Prints a text file.
54
+ PROMPT Changes the Windows command prompt.
55
+ PUSHD Saves the current directory then changes it.
56
+ RD Removes a directory.
57
+ RECOVER Recovers readable information from a bad or defective disk.
58
+ REM Records comments (remarks) in batch files or CONFIG.SYS.
59
+ REN Renames a file or files.
60
+ RENAME Renames a file or files.
61
+ REPLACE Replaces files.
62
+ RMDIR Removes a directory.
63
+ SET Displays, sets, or removes Windows environment variables.
64
+ SETLOCAL Begins localization of environment changes in a batch file.
65
+ SHIFT Shifts the position of replaceable parameters in batch files.
66
+ SORT Sorts input.
67
+ START Starts a separate window to run a specified program or command.
68
+ SUBST Associates a path with a drive letter.
69
+ TIME Displays or sets the system time.
70
+ TITLE Sets the window title for a CMD.EXE session.
71
+ TREE Graphically displays the directory structure of a drive or path.
72
+ TYPE Displays the contents of a text file.
73
+ VER Displays the Windows version.
74
+ VERIFY Tells Windows whether to verify that your files are written
75
+ correctly to a disk.
76
+ VOL Displays a disk volume label and serial number.
77
+ XCOPY Copies files and directory trees.
corpus/precision and recall.txt ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ When trying to understand a model quality, there are two important metrics
2
+
3
+ - Precision and Recall
4
+
5
+ To understand them, we first need to understand what is a True Positive, True Negative, False Positive and False Negative.
6
+
7
+ Imagine a model that classifies plant images as poisonous or not
8
+
9
+ What are the possible answers? The model predicts:
10
+
11
+ - the plant IS poisonous and it really IS. This is a True Positive (TP)👍
12
+
13
+ - the plant is NOT poisonous and it really ISN'T. This is a True Negative (TN)👍
14
+
15
+ When the model goes wrong and it predicts
16
+
17
+ - the plant is poisonous but it isn't. Also known as False Positive (FP) or Type 1 error 👎
18
+
19
+ - the plant is NOT poisonous but it is!!. This is a False Negative (FN) Type 2 error 😱
20
+
21
+ A FN can lead to intoxication and death ☠️😵
22
+
23
+ Now, we can calculate Precision and Recall
24
+
25
+ Definition: Precision measures how many of the model's positive predictions are really correct.
26
+
27
+ How: divide the all the TP by all positives (sum of TP and FP)
28
+ No alt text provided for this image
29
+
30
+ Definition: Recall answers what proportion of the positives, among all possible, that were really
31
+
32
+ How: divide TP add all TP (all correct poisonous detected) and also FN (all poisonous detected as ok emoji)
33
+ No alt text provided for this image
34
+
35
+ Both Precision and Recall are important.
36
+
37
+ Improving Precision reduces Recall so you have to take that into account when optimizing
38
+
39
+ No model is perfect all the time, se we have to have in mind which kind of errors we want to decrease
40
+
41
+ On our example, FN are a problem, so decrease that and increase Recall
corpus/rj45.txt ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ September newsletter:
2
+ the X10 Files
3
+ A simple PC Network
4
+
5
+
6
+
7
+
8
+
9
+ I've been asked often enough why I don't do more on data networking - what with the Cisco & Microsoft cert's people usually assume it's my strong point. Whether that's true or not, I'd have to agree that it deserves more attention, so here goes!
10
+
11
+ Doing a home-based (or business-based for that matter) PC network is not really that difficult. While there are different kinds of networks (Token Ring, Thinnet, Ethernet), 99.9% of us will use the latter: Ethernet.
12
+
13
+ Also called 10/100 Base-T, it's the simplest & least expensive standard you can use. Actually, it's pretty rare to find a new installation that ISN'T ethernet! In order to do yours, you'll need good ol' Category 5 (or higher) cabling, data jacks, a punch tool (advisable - or possibly crimpers) and network cards for your computers. Oh,... if you have more than two computers you'll also need either a hub or switch.
14
+
15
+
16
+
17
+ --------------------------------------------------------------------------------
18
+
19
+ Cabling:
20
+
21
+ Let's start first with the cabling: If all you want to do is connect two computers, your cabling simply runs from one machine to the other. Otherwise, you need to run cabling from all your PC's to your hub/switch. In theory, this is the easiest part!
22
+
23
+
24
+ --------------------------------------------------------------------------------
25
+
26
+ Termination:
27
+
28
+ You're fired! - just kidding...
29
+ Termination refers to punching your wiring down into jacks or patch panels, or just using RJ45 connectors (they look like big 8-pin telephone connectors). You can terminate your cabling in a couple of ways:
30
+
31
+ The simplest way (if you have the tools) is to just put RJ45 connectors on the ends of your cables. This eliminates the need for jacks or patch panels & will save you a few dollars. On the other hand, I think that wires sticking out of your wall (instead of from a jack in the wall) make for a not-so-clean installation - but if you do this you'll need to get your hands on a good set of crimpers. And if you really want a clean installation and you're installing a lot of drops, you might want to consider actually using a patch panel.
32
+
33
+ It's better if you use jacks at all your PC locations. The jacks are all color-coded to make it a little easier. After all, the big mystery for most people is the order of the wiring pin-outs (what order to punch the wiring down).
34
+
35
+ Speaking of pin-outs, below are the standards you should use (I'll explain in a moment). As you look this over, bear in mind that white/green means a wire that's mostly white with green markings; green/white = green wire with white markings, etc....
36
+
37
+
38
+ --------------------------------------------------------------------------------
39
+
40
+ TW568-A
41
+
42
+ pin #1 white/green
43
+ pin #2 green/white
44
+ pin #3 white/orange
45
+ pin #4 blue/white
46
+ pin #5 white/blue
47
+ pin #6 orange/white
48
+ pin #7 white/brown
49
+ pin #8 brown/white
50
+ TW568-B
51
+
52
+ pin #1 white/orange
53
+ pin #2 orange/white
54
+ pin #3 white/green
55
+ pin #4 blue/white
56
+ pin #5 white/blue
57
+ pin #6 green/white
58
+ pin #7 white/brown
59
+ pin #8 brown/white
60
+
61
+ --------------------------------------------------------------------------------
62
+
63
+ You don't even need to know this if you're using jacks at both ends, but you will if you're using the RJ45's (F.Y.I. - Ethernet will actually only use pins 1,2,3, and 6. The other wires are unused).
64
+
65
+ Unfortunately, things get a little more complicated at this point in the discussion. Most times you'll terminate your cable with the same standard (either one) at both ends - that's called a "straight-thru" connection - but occasionally you'll need to use 568-A at one end & 568-B at the other (a "cross-over" connection).
66
+
67
+ If you're connecting two PC's directly, you'll need a cross-over connection between them.
68
+
69
+ If you're connecting everything through a hub/switch, all your cabling will be straight-thru.
70
+
71
+ If you have a DSL Router, it will connect to your hub via cross-over & all your other cabling should be straight-thru. Also, some DSL routers have built-in hubs/switches. In this case, your PC's connect to it with a straight-thru cable.
72
+
73
+
74
+ --------------------------------------------------------------------------------
75
+
76
+ Now, let's assume that you have an internet connection that you want to share with your entire network. If you're like most of us, your ISP is going to give you a single IP address - but that's only good for ONE computer!
77
+
78
+ Fortunately, there are several workarounds which can give all your networked machines access to the internet. Microsoft introduced in Windows 98 "Internet Connection Sharing" (not my favorite solution). Better though, if you have a DSL Router it probably has a feature called "NAT" (network address translation) built in to it.
79
+
80
+ NAT works by taking the IP address given you from your ISP, storing it in memory (sort of), and then allocating other private IP addresses to your machines. It keeps track of, and translates the IP addresses, ports, etc.
81
+
82
+ Gets kind of complicated. If you want to read more, you can go to the networking section for a tutorial on this and IP addressing.
83
+
84
+ However, the really important thing about NAT and your DSL Router is that is provides a reasonable degree of "firewall" protection. Especially important if you have an "always-on" connection, a firewall will help keep hackers out of your PC. It's incredible how many people there are who are cruising for hacking opportunities.... By the way, you can also get software-based firewalls at pretty reasonable prices.
85
+
86
+
87
+ --------------------------------------------------------------------------------
88
+
89
+ Once you have everything up and running (network cards installed successfully & connected), you're ready to share files & folders. How you do that depends on your operating system, but I'm going to assume Windows 95/98 for the moment.
90
+
91
+ Go to "Start|Settings|Control Panel" and double-click the "Network" icon. Make your primary network logon "Client for Microsoft Networks" in the dropdown window. If it isn't there, click "Add|Client|Microsoft| Client for Microsoft Networks." The other thing you'll want to do is click "File and Print Sharing" and check the boxes. Restart your computer if you need to do so.
92
+
93
+ Sharing folders on the network is easy. Right-click on "My Computer" on your desktop, select "explore," and navigate to the folder you want to share. Once you've found it, right-click on the folder and select "sharing." You now have a dialogue for setting up your network share as you see fit! You're done! Within minutes of doing this, your folder will appear under "Network Neighborhood" on other machines with the rights you assigned (read-only or full-access).
94
+
95
+ And that's just about all you need to know to get up and running. You'll find an abundance of informational resources on the web if you need to know more. I've already mentioned networking, but if you're into seriously heavy stuff, check out www.Cisco.com for more than you ever wanted to know about IP addressing, routing, and still way too much more.
96
+
97
+ Till next time,
98
+
99
+ Andy Jackson,
100
+ Integratorpro.com
101
+ SmarthomeUSA.com
102
+ Andy@Integratorpro.com
103
+
104
+ Back
105
+
106
+
107
+
corpus/splitting in columns - Unknown.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ via perl
3
+
4
+ ls -l | perl -ane 'print "$F[8]\n"' # perl flag -a separate the fields into array F
5
+
6
+ via cut
7
+
8
+ ls -l | cut -d ' ' -f 2-7 # field separator is only ONE space
9
+
10
+ via awk
11
+
12
+ ls -l | awk '{print $9}'
corpus/xpath cheatsheet.txt ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // XPath CheatSheet
2
+ // To test XPath in your Chrome Debugger: $x('/html/body')
3
+ // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
4
+
5
+
6
+ // 0. XPath Examples.
7
+ // More: http://xpath.alephzarro.com/content/cheatsheet.html
8
+
9
+
10
+ '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
11
+ '//table[count(tr)=1 and count(tr/td)=2]' // all tables with 1 row and 2 cols
12
+ '//div/form/parent::*' // all divs that have form
13
+ './div/b' // a relative path
14
+ '//table[parent::div[@class="pad"] and not(@id)]//a' // any anchor in a table without id, contained in a div of "pad" class
15
+ '/html/body/div/*[preceding-sibling::h4]' // give me whatever after h4
16
+ '//tr/td[font[@class="head" and text()="TRACK"]]' // all td that has font of a "head" class and text "TRACK"
17
+ './table/tr[last()]' // the last row of a table
18
+ '//rdf:Seq/rdf:li/em:id' // using namespaces
19
+ '//a/@href' // hrefs of all anchors
20
+ '//*[count(*)=3]' // all nodes with 3 children
21
+ '//var|//acronym' // all vars and acronyms
22
+
23
+
24
+ // 1. General.
25
+
26
+
27
+ '/html' // whole web page (css: html)
28
+ '/html/body' // whole web page body (css: body)
29
+ '//text()' // all text nodes of web page
30
+ '/html/body/.../.../.../E' // element <E> by absolute reference (css: body > … > … > … > E)
31
+
32
+
33
+ // 2. Tag.
34
+
35
+
36
+ '//E' // element <E> by relative reference (css: E)
37
+ '(//E)[2]' // second <E> element anywhere on page
38
+ '//img' // image element (css: img)
39
+ '//E[@A]' // element <E> with attribute A (css: E[A])
40
+ '//E[@A="t"]' // element <E> with attribute A containing text 't' exactly (css: E[A='t'])
41
+ '//E[contains(@A,"t")]' // element <E> with attribute A containing text 't' (css: E[A*='t'])
42
+ '//E[starts-with(@A, "t")]' // element <E> whose attribute A begins with 't' (css: E[A^='t'])
43
+ '//E[ends-with(@A, "t")]' // element <E> whose attribute A ends with 't' (css: E[A$='t'])
44
+ '//E[contains(concat(" ", @A, " "), " w ")' // element <E> with attribute A containing word 'w' (css: E[A~='w'])
45
+ '//E[matches(@A, "r")]' // element <E> with attribute A matching regex ‘r’
46
+ '//E1[@id=I1] | //E2[@id=I2]' // element <E1> with id I1 or element <E2> with id I2 (css: E1#I1, E2#I2)
47
+ '//E1[@id=I1 or @id=I2]' // element <E1> with id I1 or id I2 (css: E1#I1, E1#I2)
48
+
49
+
50
+ // 3. Attribute.
51
+
52
+
53
+ '//E/@A' // attribute A of element <E> (css: E@A)
54
+ '//*/@A' // attribute A of any element (css: *@A)
55
+ '//E[@A2="t"]/@A1' // attribute A1 of element <E> where attribute A2 is 't' exactly (css: E[A2='t']@A1)
56
+ '//E[contains(@A,"t")]/@A' // attribute A of element <E> where A contains 't' (css: E[A*='t']@A)
57
+
58
+
59
+ // 4. ID & Name.
60
+
61
+
62
+ '//*[@id="I"]' // element with id I (css: #I)
63
+ '//E[@id="I"]' // element <E> with id I (css: E#I)
64
+ '//*[@name="N"]' // element with name (css: [name='N'])
65
+ '//E[@name="N"]' // element <E> with name (css: E[name='N'])
66
+ '//*[@id="X" or @name="X"]' // element with id X or, failing that, a name X
67
+ '//*[@name="N"][v+1]' // element with name N & specified 0-based index ‘v’ (css: [name='N']:nth-child(v+1))
68
+ '//*[@name="N"][@value="v"]' // element with name N & specified value ‘v’ (css: *[name='N'][value='v’])
69
+
70
+
71
+ // 5. Lang & Class.
72
+
73
+
74
+ '//E[@lang="L" or starts-with(@lang, concat("L", "-"))]' // element <E> is explicitly in language L or subcode (css: E[lang|=L])
75
+ '//*[contains(concat(" ", @class, " "), " C ")]' // element with a class C (css: .C)
76
+ '//E[contains(concat(" ", @class, " "), " C ")]' // element <E> with a class C (css: E.C)
77
+
78
+
79
+ // 6. Text & Link.
80
+
81
+
82
+ '//*[.="t"]' // element containing text 't' exactly
83
+ '//E[contains(text(), "t")]' // element <E> containing text 't' (css: E:contains('t'))
84
+ '//a' // link element (css: a)
85
+ '//a[.="t"]' // element <a> containing text 't' exactly
86
+ '//a[contains(text(), "t")]' // element <a> containing text 't' (css: a:contains('t'))
87
+ '//a[@href="url"]' // <a> with target link 'url' (css: a[href='url'])
88
+ '//a[.="t"]/@href' // link URL labeled with text 't' exactly
89
+
90
+
91
+ // 7. Parent & Child.
92
+
93
+
94
+ '//E/*[1]' // first child of element <E> (css: E > *:first-child)
95
+ '//E[1]' // first <E> child (css: E:first-of-type)
96
+ '//E/*[last()]' // last child of element E (css: E *:last-child)
97
+ '//E[last()]' // last <E> child (css: E:last-of-type)
98
+ '//E[2]' // second <E> child (css: E:nth-of-type(2))
99
+ '//*[2][name()="E"]' // second child that is an <E> element (css: E:nth-child(2))
100
+ '//E[last()-1]' // second-to-last <E> child (css: E:nth-last-of-type(2))
101
+ '//*[last()-1][name()="E"]' // second-to-last child that is an <E> element (css: E:nth-last-child(2))
102
+ '//E1/[E2 and not( *[not(self::E2)])]' // element <E1> with only <E2> children
103
+ '//E/..' // parent of element <E>
104
+ '//*[@id="I"]/.../.../.../E' // descendant <E> of element with id I using specific path (css: #I > … > … > … > E)
105
+ '//*[@id="I"]//E' // descendant <E> of element with id I using unspecified path (css: #I E)
106
+ '//E[count(*)=0]' // element <E> with no children (E:empty)
107
+ '//E[count(*)=1]' // element <E> with an only child
108
+ '//E[count(preceding-sibling::*)+count(following-sibling::*)=0]' // element <E> that is an only child (css: E:only-child)
109
+ '//E[count(../E) = 1]' // element <E> with no <E> siblings (css: E:only-of-type)
110
+ '//E[position() mod N = M + 1]' // every Nth element starting with the (M+1)th (css: E:nth-child(Nn+M))
111
+
112
+
113
+ // 8. Sibling.
114
+
115
+
116
+ '//E2/following-sibling::E1' // element <E1> following some sibling <E2> (css: E2 ~ E1)
117
+ '//E2/following-sibling::*[1][name()="E1"]' // element <E1> immediately following sibling <E2> (css: E2 + E1)
118
+ '//E2/following-sibling::*[2][name()="E1"]' // element <E1> following sibling <E2> with one intermediary (css: E2 + * + E1)
119
+ '//E/following-sibling::*' // sibling element immediately following <E> (css: E + *)
120
+ '//E2/preceding-sibling::E1' // element <E1> preceding some sibling <E2>
121
+ '//E2/preceding-sibling::*[1][name()="E1"]' // element <E1> immediately preceding sibling <E2>
122
+ '//E2/preceding-sibling::*[2][name()="E1"]' // element <E1> preceding sibling <E2> with one intermediary
123
+ '//E/preceding-sibling::*[1]' // sibling element immediately preceding <E>
124
+
125
+
126
+ // 9. Table Cell.
127
+
128
+
129
+ '//*[@id="TestTable"]//tr[3]//td[2]' // cell by row and column (e.g. 3rd row, 2nd column) (css: #TestTable tr:nth-child(3) td:nth-child(2))
130
+ '//td[preceding-sibling::td="t"]' // cell immediately following cell containing 't' exactly
131
+ 'td[preceding-sibling::td[contains(.,"t")]]' // cell immediately following cell containing 't' (css: td:contains('t') ~ td)
132
+
133
+
134
+ // 10. Dynamic.
135
+
136
+
137
+ '//E[@disabled]' // user interface element <E> that is disabled (css: E:disabled)
138
+ '//*[not(@disabled)]' // user interface element that is enabled (css: E:enabled)
139
+ '//*[@checked]' // checkbox (or radio button) that is checked (css: *:checked)
140
+
141
+
142
+ // 11. XPath Functions.
143
+ // https://developer.mozilla.org/en-US/docs/Web/XPath/Functions
144
+
145
+
146
+ // 11.1. Conversion.
147
+
148
+
149
+ boolean(expression) // evaluates an expression and returns true or false.
150
+ string([object]) // converts the given argument to a string.
151
+ number([object]) // converts an object to a number and returns the number.
152
+
153
+
154
+ // 11.2. Math.
155
+
156
+
157
+ ceiling(number) // evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number.
158
+ floor(number) // evaluates a decimal number and returns the largest integer less than or equal to the decimal number.
159
+ round(decimal) // returns a number that is the nearest integer to the given number.
160
+ sum(node-set) // returns a number that is the sum of the numeric values of each node in a given node-set.
161
+
162
+
163
+ // 11.3. Logic.
164
+
165
+
166
+ true() // returns a boolean value of true.
167
+ false() // returns boolean false.
168
+ not(expression) // evaluates a boolean expression and returns the opposite value.
169
+
170
+
171
+ // 11.4. Node.
172
+
173
+
174
+ lang(string) // determines whether the context node matches the given language and returns boolean true or false.
175
+ name([node-set]) // returns a string representing the QName of the first node in a given node-set.
176
+ namespace-uri([node-set]) // returns a string representing the namespace URI of the first node in a given node-set.
177
+
178
+
179
+ // 11.5. Context.
180
+
181
+
182
+ count(node-set) // counts the number of nodes in a node-set and returns an integer.
183
+ function-available(name) // determines if a given function is available and returns boolean true or false.
184
+ last() // returns a number equal to the context size from the expression evaluation context.
185
+ position() // returns a number equal to the context position from the expression evaluation context.
186
+
187
+
188
+ // 11.6. String.
189
+
190
+
191
+ contains(haystack-string, needle-string) // determines whether the first argument string contains the second argument string and returns boolean true or false.
192
+ concat(string1, string2 [stringn]*) // concatenates two or more strings and returns the resulting string.
193
+ normalize-space(string) // strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.
194
+ starts-with(haystack, needle) // checks whether the first string starts with the second string and returns true or false.
195
+ string-length([string]) // returns a number equal to the number of characters in a given string.
196
+ substring(string, start [length]) // returns a part of a given string.
197
+ substring-after(haystack, needle) // returns a string that is the rest of a given string after a given substring.
198
+ substring-before(haystack, needle) // returns a string that is the rest of a given string before a given substring.
199
+ translate(string, abc, XYZ) // evaluates a string and a set of characters to translate and returns the translated string.
200
+
201
+
202
+ // 12. XPath Axes.
203
+
204
+ ancestor // indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node.
205
+ ancestor-or-self // indicates the context node and all of its ancestors, including the root node.
206
+ attribute (@) // indicates the attributes of the context node. Only elements have attributes. This axis can be abbreviated with the at sign (@).
207
+ child (/) // indicates the children of the context node. If an XPath expression does not specify an axis, this is understood by default. Since only the root node or element nodes have children, any other use will select nothing.
208
+ descendant (//) // indicates all of the children of the context node, and all of their children, and so forth. Attribute and namespace nodes are not included - the parent of an attribute node is an element node, but attribute nodes are not the children of their parents.
209
+ descendant-or-self // indicates the context node and all of its descendants. Attribute and namespace nodes are not included - the parent of an attribute node is an element node, but attribute nodes are not the children of their parents.
210
+ following // indicates all the nodes that appear after the context node, except any descendant, attribute, and namespace nodes.
211
+ following-sibling // indicates all the nodes that have the same parent as the context node and appear after the context node in the source document.
212
+ parent(..) // indicates the single node that is the parent of the context node. It can be abbreviated as two periods (..).
213
+ preceding // indicates all the nodes that precede the context node in the document except any ancestor, attribute and namespace nodes.
214
+ preceding-sibling // indicates all the nodes that have the same parent as the context node and appear before the context node in the source document.
215
+ self (.) // indicates the context node itself. It can be abbreviated as a single period (.).
216
+