[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



    Joe> Well, since I've already been labeled a spoil sport...  :)

Gah, yes it misses multiple matches per block.  I blame the mucus
currently clogging my throbbing sinuses for the past couple of days.

$ perl -le 'print "a" x 400, "\xff" x 16, "a" x 400, "\xff" x 16, "a" x 400, "\xff" x 16' > foo 
$ perl -lne 'BEGIN{$/=\1024}$o=($.-1)*1024-length$b;$b.=$_;print"hit byte ",$o+$-[0]while$b=~/\xff{16}/g;$b=substr($b,-15,15)' foo
hit byte 400
hit byte 816
hit byte 1232

[...]

    Joe> Notice also that I have cut down on the gratuitous use of
    Joe> needless white space without any loss of readability :)

Yup, you don't really need it in there and I tend not to really use it
on the command line.  If it was a real program this'd look much
different (with $offset and $buf rather than $o and $b, yadda yadda
yadda).

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00766" href="msg00766.html">[ale] Binary Grep</a></strong>
<ul><li><em>From:</em> joe at madewell.com (Joe Steele)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00766.html">[ale] Binary Grep</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00768.html">[ale] TiVo Will No Longer Skip Past Advertisers</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00766.html">[ale] Binary Grep</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00746.html">[ale] Three d[a]emonic questions</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00767"><strong>Date</strong></a></li>
<li><a href="threads.html#00767"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>