www.heteroclinic.net
Discussion of the Grammar First, we discuss the regular expression for ASCII strings represent number 0 to 255. To show it clearly, we didn't merge the identical entries. Latex formula: We draw the digram of the spanning tree for ASCII strings represent number 0 to 255. Second, we discuss the regular expression for an IP address V4 $P$for private network. But search strings matching pattern $P$ is not sufficient. For examples, 025.13.23.34, or 10.12.13.14.someisp.com, or 1.2.3.4.5.6.7 are not the information we are seeking. So the grammar is not context free. We need a wrapper pattern to validate a minimum context that the objective pattern is in. This wrapper pattern is dfined as $W$. Our assumption is that a valid string of ip address is delimited by a character that is not [0-9] or `.', or by begin of line `\verb|^| ' and end of line `\$'. |
||
Practice with egrep The example file `atest.txt': The results, we believe masks and broadcasts are valid ip addresses: Some other log examples. The ip address may not be delimited by white spaces. iptables: A log4j item It is produced by the following Java lines. If you find something wrong, please leave me a message by email. |
||
V. Different Sleeping Values We set different sleeping value in the main function to observe how the program behave. We know set ll as 1000ms, ul as 3000ms. First we set Sleep(800). Second we set Sleep(2000). Third we set Sleep(5000). From the above experiments, we know all the child threads exit as the main function terminated. Our current implementation doesn't show each child thread status if we end our program in such a way. So we know why need the condition variables. The usage will be shown in the next section. |
||
VI. Use Condition Variable Again we try to let the threads terminate prematurely by Sleep(800). Now we can check the child threads' status. |