Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

OverlordQ's scratchpad

by OverlordQ (Hermit)
on Jun 02, 2004 at 20:26 UTC ( #359715=scratchpad: print w/ replies, xml ) Need Help??

#!/usr/bin/perl use Text::Unaccent; use utf8; unac_debug($Text::Unaccent::DEBUG_HIGH); my $blah = unac_string('utf-8','Spontanansökan Produktion Bjuv'); print "U: $blah\n";
Working box:
unac.c:13708: unac_data0[19] & unac_positions[0][20]: 0x0053 => untouc +hed unac.c:13708: unac_data0[16] & unac_positions[0][17]: 0x0070 => untouc +hed unac.c:13708: unac_data0[15] & unac_positions[0][16]: 0x006f => untouc +hed unac.c:13708: unac_data0[14] & unac_positions[0][15]: 0x006e => untouc +hed unac.c:13708: unac_data0[20] & unac_positions[0][21]: 0x0074 => untouc +hed unac.c:13708: unac_data0[1] & unac_positions[0][2]: 0x0061 => untouche +d unac.c:13708: unac_data0[14] & unac_positions[0][15]: 0x006e => untouc +hed unac.c:13708: unac_data0[1] & unac_positions[0][2]: 0x0061 => untouche +d unac.c:13708: unac_data0[14] & unac_positions[0][15]: 0x006e => untouc +hed unac.c:13708: unac_data0[19] & unac_positions[0][20]: 0x0073 => untouc +hed unac.c:13708: unac_data3[23] & unac_positions[3][23]: 0x00f6 => 0x006f + unac.c:13708: unac_data0[11] & unac_positions[0][12]: 0x006b => untouc +hed unac.c:13708: unac_data0[1] & unac_positions[0][2]: 0x0061 => untouche +d unac.c:13708: unac_data0[14] & unac_positions[0][15]: 0x006e => untouc +hed unac.c:13708: unac_data0[0] & unac_positions[0][1]: 0x0020 => untouche +d unac.c:13708: unac_data0[16] & unac_positions[0][17]: 0x0050 => untouc +hed unac.c:13708: unac_data0[18] & unac_positions[0][19]: 0x0072 => untouc +hed unac.c:13708: unac_data0[15] & unac_positions[0][16]: 0x006f => untouc +hed unac.c:13708: unac_data0[4] & unac_positions[0][5]: 0x0064 => untouche +d unac.c:13708: unac_data0[21] & unac_positions[0][22]: 0x0075 => untouc +hed unac.c:13708: unac_data0[11] & unac_positions[0][12]: 0x006b => untouc +hed unac.c:13708: unac_data0[20] & unac_positions[0][21]: 0x0074 => untouc +hed unac.c:13708: unac_data0[9] & unac_positions[0][10]: 0x0069 => untouch +ed unac.c:13708: unac_data0[15] & unac_positions[0][16]: 0x006f => untouc +hed unac.c:13708: unac_data0[14] & unac_positions[0][15]: 0x006e => untouc +hed unac.c:13708: unac_data0[0] & unac_positions[0][1]: 0x0020 => untouche +d unac.c:13708: unac_data0[2] & unac_positions[0][3]: 0x0042 => untouche +d unac.c:13708: unac_data0[10] & unac_positions[0][11]: 0x006a => untouc +hed unac.c:13708: unac_data0[21] & unac_positions[0][22]: 0x0075 => untouc +hed unac.c:13708: unac_data0[22] & unac_positions[0][23]: 0x0076 => untouc +hed U: Spontanansokan Produktion Bjuv
Other box:
unac_string: Invalid argument U:

sub decrement { my $string = shift; return '' unless length($string); my @parts = split//,$string; my $last = pop @parts; if( ord($last) == 32 ) { my $ret = decrement(join '',@parts); $ret .= (scalar @parts) ? "\x7E" : ''; return $ret; } else { my $ret = join '',@parts,chr(ord($last)-1); return $ret; } }

my $key = ( ( int( str2time($date) / $INTERVAL ) + ( str2time($date) % $INTERVAL ? 1 : 0 ) ) * $INTERVAL );
#!/usr/bin/perl use File::Map qw(:map :constants); use strict; use warnings; use Date::Parse; use POSIX qw(strftime); my $file = shift; map_file(my $map, $file); my %h; my $re = qr/(?-xism:\[((?:\S+)\s+(?:\S+)\s+(?:\d+)\s+(?:\S+)\s+(?:\d{4 +}))\]\s+(?:\[(?:\w+)\])?).*(Timeout.*)/; $h{$1}++ while $map =~ m{$re}g; my $INTERVAL = 600; my %blarg; my $offset = 300; foreach my $date (keys %h) { my $key = ( ( ( int( (str2time($date) - $offset ) / $INTERVAL ) + ( ( str2time($date) - $offset ) % $INTERVAL ? 1 : 0 ) ) ) * $INTERVAL ) + $offset; $blarg{$key}++; } my ($first) = (sort keys %blarg)[0]; my $window = $first; while($window < time) { my $now_string = strftime "%e, %I:%M:%S %p", localtime($window); print "$now_string, " . ($blarg{$window} ? $blarg{$window} : 0) . +"\n"; $window += $INTERVAL; }
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2015-07-02 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls