bsc-projects-18.html
changeset 551 41cdc0680b74
parent 550 5412e0952fdb
child 552 4e2884c34f46
equal deleted inserted replaced
550:5412e0952fdb 551:41cdc0680b74
    79   innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string 
    79   innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string 
    80   <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact,
    80   <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact,
    81   Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself:
    81   Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself:
    82   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py">catastrophic.py</A> (Python version) and 
    82   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py">catastrophic.py</A> (Python version) and 
    83   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.rb">catastrophic.rb</A> 
    83   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.rb">catastrophic.rb</A> 
    84   (Ruby version). Here is a similar problem in Java: <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java">catastrophic.java</A> 
    84   (Ruby version). Here is a similar problem with the regular expression <code>(a*)* b</code>in Java: 
       
    85   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java">catastrophic.java</A> 
    85   </p> 
    86   </p> 
    86 
    87 
    87   <p>
    88   <p>
    88   You can imagine an attacker
    89   You can imagine an attacker
    89   mounting a nice <A HREF="http://en.wikipedia.org/wiki/Denial-of-service_attack">DoS attack</A> against 
    90   mounting a nice <A HREF="http://en.wikipedia.org/wiki/Denial-of-service_attack">DoS attack</A> against