Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Return ordered list of near match items based on tag matches

// description of your code here

select t2.dbid, t2.tag, count(t2.dbid) as match_count from tags as t1, tags as t2 where t1.dbid = '105319' and t2.tag = t1.tag and t1.dbid != t2.dbid GROUP BY t2.dbid 1 ORDER BY match_count;

near? function

    near?: func [
        {Returns true if the values are <= 1E-15 apart.}
        value1 [number! money! time!]
        value2 [number! money! time!]
        /within  "Specify an alternate maximum difference (epsilon)."
            e [number! money! time!] "The epsilon value."
    ][
        e: abs any [e  to value1 1E-15]
        e >= abs value1 - value2
    ]
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS