惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
量子位
N
Netflix TechBlog - Medium
The Cloudflare Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
B
Blog
博客园_首页
博客园 - Franky
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
H
Help Net Security
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - VeryDxZ

创业公司做数据分析(转载) 初始化一台linux server来做项目管理和测试 Tanglement, although optional 灰常不错的SC2剧情分析 Sketching & Story telling [VBA] 1-MSScriptControl 2-JSON Got the whole picture of what I'm doing 自用Excel VBA技巧整理 - VeryDxZ - 博客园 自用Excel VBA函数整理 part2 自用Excel VBA函数整理 part1 论文没抽中盲检,心情爽多了 又到了Intern大批离职的时候,真伤感额 几个提高Windows(主要是XP)桌面产能的小软件 好久不碰Blog,最近要二次毕业了,继续写点警醒自己的话 Michael Joseph Jackson (August 29, 1958 – June 25, 2009) 第一次租房子,人生哦~ Me on twitter Collective Intelligence,一个牛逼的新马甲 许久没认真上网,发现网络还是挺有正面用途的
自用Excel VBA函数整理 part3
VeryDxZ · 2010-10-16 · via 博客园 - VeryDxZ

'http://en.wikipedia.org/wiki/Levenshtein_distance
Public Function EditDistance(s, t, Optional costIns As Integer = 1, Optional costDel As Integer = 1, Optional costSub As Integer = 1) As Integer
    'declaration, d(i,j) will hold the Levenshtein distance between
    'the first i chars of s and the first j chars ot t
    Static d(0 To EDIT_DISTANCE_CACHE, 0 To EDIT_DISTANCE_CACHE) As Integer
    
    'initialization, note that (m+1)*(n+1) distances is used
    m = Len(s): n = Len(t)
    For x = 0 To m
        For y = 0 To n
            d(x, y) = 0
        Next y
    Next x
    
    'source prefixes can be transformed into empty string by dropping all chars
    For i = 1 To m
        d(i, 0) = i * costDel
    Next i
    'target prefixes can be reached from empty source prefix by inserting every chars
    For j = 1 To n
        d(0, j) = j * costIns
    Next j
    
    For j = 1 To n
        For i = 1 To m
            If Mid(s, i, 1) = Mid(t, j, 1) Then
                d(i, j) = d(i - 1, j - 1)
            Else
                d(i, j) = WorksheetFunction.Min( _
                    d(i - 1, j) + costDel, _
                    d(i, j - 1) + costIns, _
                    d(i - 1, j - 1) + costSub)
            End If
        Next i
    Next j
    EditDistance = d(m, n)
End Function

EditDistance

Example of workbook already enabled:
1. JSON
2. XmlHttp (via usage of API for Geocoding) 
3. Geo Distance Calculation From Lng & Lat
[Download Here]