Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Corion]: marto: Ooof - but yes, being there as only second level support or third level support is good and if you have enough things that you can work on, it won't be a wasted (if paid) day
[marto]: I've opted for a day off later on, rather than pay. I only have to do about 45 mins work for the client, but do need to hang around
[Corion]: marto: Even better ;)
[marto]: and I'm off next week1
[Corion]: Whee! ;)
[Corion]: I was away last week already, so I know how good a week off is ;))

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-02-28 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (399 votes). Check out past polls.