I hereby claim:
- I am ptvirgo on github.
- I am ptvirgo (https://keybase.io/ptvirgo) on keybase.
- I have a public key ASAiGKbmaGb-JBhjQfGNtN7lQBNlWm9Bj4hUb0_59iUdnwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import unittest | |
| RUDE = b"\xe3\x80\x82".decode("utf-8") | |
| def limit_slice(maxlen, text): | |
| """Given a maximum length and text, return the text truncated to the provided | |
| length.""" |
| module Main where | |
| -- | Return a Knuth-Morris-Pratt index for a given string | |
| stringIndex :: String -> [Int] | |
| stringIndex "" = [] | |
| stringIndex txt = indexr [0] 0 1 where | |
| indexr :: [Int] -> Int -> Int -> [Int] | |
| indexr rsf subPos chrPos |