Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sliding window

by BrowserUk (Patriarch)
on Jan 27, 2012 at 14:47 UTC ( #950381=note: print w/replies, xml ) Need Help??


in reply to Sliding window

"Sliding window" is a decptive title, but the problem is interesting.

A not very perlish solution:

#! perl -slw use strict; my %hash = (a=>2, b=>1, c=>5, d=>3, e=>4); my $input = "abcdaeec"; our $N //= 2; $,= ' '; print map{ my $iplus = ord() - ord('a'); $iplus = ( $iplus + $N ) % keys %hash; $iplus = chr( ord('a') + $iplus ); $hash{ $_ } + $hash{ $iplus }; } split '', $input; __END__ C:\test>junk41 -N=2 7 4 9 5 7 5 5 9 C:\test>junk41 -N=3 5 5 7 4 5 9 9 7 C:\test>junk41 -N=4 6 3 6 8 6 7 7 6

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-01-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (73 votes). Check out past polls.

    Notices?