Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Skeeve's scratchpad

by Skeeve (Vicar)
on Aug 27, 2004 at 21:39 UTC ( #386500=scratchpad: print w/replies, xml ) Need Help??

for bart
<!-- xslt 2.0 --> <xsl:choose> <xsl:variable name="output"> <img src="{@src}"/> </xsl:variable> <xsl:when test="@popup"> <a href="{@popup}"> <xsl:copy-of select="$output"/> </a> </xwl:when> <xsl:otherwise> <xsl:copy-of select="$output"/> </xsl:otherwise> </xsl:choose> <!-- xslt 1.0 --> <xsl:choose> <xsl:when test="@popup"> <a href="{@popup}"> <xsl:call-template name="img"/> </a> </xwl:when> <xsl:otherwise> <xsl:call-template name="img"/> </xsl:otherwise> </xsl:choose> <xsl:template name="img"> <img src="{@src}"/> </xsl:template>
xd -- Hexdump
#!/usr/bin/perl @fill= qw( .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ); if (scalar(@ARGV)) { foreach $file(@ARGV) { $size= -s $file; $form= length(sprintf("%x",$size))-1; ++$form unless $form; print "File: ",$file,"\n"; open (IN,$file); &dump(*IN, $form); close (IN) } } else { &dump(*STDIN, 4); } sub dump { local(*IN, $form)= @_; my ($buf, $i); while ($rb= read(IN, $buf, 16)) { @x= unpack("H2" x $rb, $buf); $buf=~ s/[\x00-\x1f\x7f-\xff]/./g; $buf.= ' ' x (16-length($buf)); printf ("%0${form}x0: %s [%s]\n" ,$i++, ,sprintf ("%s %s %s %s %s %s %s %s - %s %s %s %s %s %s %s %s +", @x, @fill) ,$buf ); } }
dx -- undump
#!/usr/bin/perl if (scalar(@ARGV)) { foreach $file(@ARGV) { open (IN,$file); &undump(*IN); close (IN) } } else { &undump(*STDIN); } sub undump { local(*IN)= @_; local($_); while (<IN>) { # next unless s/^([0-9a-f]+)://; s/^([0-9a-f]+)://i; s/[^\-\s0-9a-f].*$//i; @match= /(\b[0-9a-f][0-9a-f]\b)/ig; print pack("H2" x scalar(@match), @match); } }
Log In?

What's my password?
Create A New User
[choroba]: My recent record is 10km in 1 hour :)
[perldigious]: Nice erix... perldigious' legs are so sore from portaging his kayak from place to place last weekend he can barely hobble 12m. :-)
[erix]: you're faster than me then :)
[erix]: well, at the moment, that is :)
[erix]: I should lose some weight although I keep telling myself that I'm doing extra training by lugging it along
[erix]: I saw a common kingfisher and a couple of bullfinches
[erix]: bullfinch ( a male and a female )
erix learned the word 'portaging' not so long ago (from vikings lugging their ships from one river-system to another)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-05-24 12:44 GMT
Find Nodes?
    Voting Booth?