Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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
[LanX]: he was "meating" Italian monks oO?
[erix]: then again, there are people who do 10 full triathlons on 10 consecutive days, so it must be doable
choroba's friend has done the Pacific Crest Trail, it's 4200 km
LanX Ladies and gentlemen: due to shortages of "Body of Christ" we have to resort to Body of Monks ...
LanX ... buon appetito!
[LanX]: Pacific Crest Trail is really hard stuff
[Eily]: erix he plans to go as far as leuca

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-12-13 15:10 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (369 votes). Check out past polls.