This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Compute Jaro distance between two strings | |
| jaro :: String -> String -> Double | |
| jaro "" _ = 0.0 | |
| jaro _ "" = 0.0 | |
| jaro s1 s2 | |
| | s1 == s2 = 1.0 | |
| | s1 /= s2 = | |
| let | |
| -- Length of both strings | |
| l1 = length s1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Levenshtein distance between two strings | |
| levenshtein :: String -> String -> Int | |
| levenshtein "" "" = 0 | |
| levenshtein s1 "" = length s1 | |
| levenshtein "" s2 = length s2 | |
| levenshtein s t = d !! (length s) !! (length t) | |
| where | |
| d = [[distance m n | n <- [0..length t]] | m <- [0..length s]] | |
| distance i 0 = i | |
| distance 0 j = j |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Cologne Method: compute 'Kölner Verfahren' for a string | |
| cologneMethod :: String -> Integer | |
| cologneMethod "" = 0 | |
| cologneMethod s = intListToInt $ foldr cons [] $ filter (> 0) $ cologne [toUpper x | x <- s] '\NUL' | |
| where | |
| -- Construct list of Ints while adjacent elements would never be the same | |
| cons :: Integer -> [Integer] -> [Integer] | |
| cons x [] = [x] | |
| cons x acc | |
| | x == head acc = acc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module TestHompare | |
| where | |
| import Text.Printf | |
| import Control.Exception | |
| import Control.Concurrent (threadDelay) | |
| import System.CPUTime | |
| import Hompare | |
| time :: IO t -> IO t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Network | |
| main = withSocketsDo $ sendTo "localhost" (PortNumber $ toEnum 256) "hello socket world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| str = str.replaceAll("ä", "ä"); | |
| str = str.replaceAll("ö", "ö"); | |
| str = str.replaceAll("ü", "ü"); | |
| str = str.replaceAll("Ä", "Ä"); | |
| str = str.replaceAll("Ö", "Ö"); | |
| str = str.replaceAll("Ü", "Ü"); | |
| str = str.replaceAll("ß", "ß"); | |
| str = str.replaceAll("ï", "ï"); | |
| str = str.replaceAll("à", "à"); | |
| str = str.replaceAll("ò", "ò"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * JmsQueueTest.java | |
| * Created on 10. Februar 2006, 13:26 | |
| */ | |
| package jmstest; | |
| import java.util.Hashtable; | |
| import javax.jms.DeliveryMode; | |
| import javax.jms.JMSException; | |
| import javax.jms.Message; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import de.schlichtherle.io.File; | |
| import de.schlichtherle.io.RaesFiles; | |
| import de.schlichtherle.key.AesKeyProvider; | |
| import de.schlichtherle.key.KeyManager; | |
| import de.schlichtherle.key.KeyProvider; | |
| import de.schlichtherle.key.UnknownKeyException; | |
| import java.io.IOException; | |
| /** | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Copyright (C) 2007 Ralf Bensmann | |
| # | |
| class RmanDuplicate | |
| # Working directory | |
| attr_accessor :workingDirectory | |
| # An array containing hashes for substitutions of init.ora parameter values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyBundleActivator implements BundleActivator { | |
| /** | |
| * Logger. | |
| */ | |
| private static Logger log = LoggerFactory.getLogger(MyBundleActivator.class) | |
| /** | |
| * A bundle listener. | |
| */ |