This file contains 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 org.mozilla.universalchardet.UniversalDetector; | |
import java.io.*; | |
import java.nio.charset.Charset; | |
public class DetectEncoding { | |
private static final int BUF_SIZE = 4096; | |
// open a BufferedReader detect encoding |
This file contains 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
def hamming(p1,p2,p3): | |
yield 1 | |
m2 = times(p1, hamming(p1,p2,p3)) | |
m3 = times(p2, hamming(p1,p2,p3)) | |
m5 = times(p3, hamming(p1,p2,p3)) | |
for h in merge(merge(m2, m3), m5): | |
yield h |