Skip to content

Instantly share code, notes, and snippets.

latitude longitude full_address
35.67077925703927 -78.82521725019633 108 BOATDOCK DR, HOLLY SPRINGS, NC 27540
35.86182403271283 -78.53973585742347 5305 FORSYTH PARK ST, RALEIGH, NC 27616
35.760958787507256 -78.88079964780793 7020 JENKS RD, UNINCORPORATED, NC 27519
35.93202626254228 -78.5683112135329 2759 HIDDEN WATERS CIR, RALEIGH, NC 27614
35.90069083020205 -78.66516671549235 1505 PECORE PL, RALEIGH, NC 27615
35.77824592372293 -78.390043058958 504 N KENNELMAN CIR, WENDELL, NC 27591
35.891118094876774 -78.52060057456369 3416 VENTURA CIR, UNINCORPORATED, NC 27587
35.68264921249343 -78.81453263711091 5601 MONARCH BIRCH DR, UNINCORPORATED, NC 27539
35.924561521478175 -78.70712154682505 4824 OAK WAY, UNINCORPORATED, NC 27613
-- Only 1 operation necessary to convert
select
levenshtein('cat', 'bat'); --1
-- Similar and not-so-similar names
select
levenshtein('christina', 'kristina'), --2
levenshtein('josephus', 'kristina'); --8
-- Similar and not-so-similar pronunciations
-- With metaphone, a hard C and hard K both code to 'K'
-- Note that you specify a maximum encoding length, since metaphone can return long encodings
select
metaphone('kristina', 100), -- KRSTN
metaphone('christina', 100); --KRSTN
-- Metaphone thinks the GH is pronounced like 'laugh'
-- But double metaphone knows the GH is silent
select
metaphone('hayleigh', 100), --HLF
-- Returns D620
select
soundex('drake');
-- Returns B420
select
soundex('blake');
-- Returns 2
select
CREATE EXTENSION fuzzystrmatch;
CombineFileInputFormat.setMaxInputSplitSize(job, 128000000);
"Private Selection"
"Kroger"
"Smithfield"
"Kellogg's"
"Ocean Spray"
"Keebler"
"Kraft"
"Purina"
"Coca-Cola"
"Monster"
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
if (fileBroken) {
return 1.0f;
} else if (start == end) {
return 0.0f;
} else {
return Math.min(1.0f, (getFilePosition() - start) / (float)(end - start));
}
if (newSize == 0 || fileBroken) {
key = null;
value = null;
return false;
} else {
return true;
}