SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 The Yak Corral
 Twit List
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 88

Stoad strehngthend
Yak Posting Veteran

54 Posts

Posted - 09/05/2008 :  12:26:38  Show Profile  Visit Stoad strehngthend's Homepage  Reply with Quote
Of crs, I saw it. I meant "abcdef" = "abcdefxyzxyz", no referring to human names.
Secondly, my exact taste is: CompareText(txt1, txt2) => LCS(txt1, txt2) / MAX(Len(txt1), Len(txt2)) * 100%,
where LCS is Longest Common Subsequence of txt1 and txt2: http://en.wikipedia.org/wiki/Longest_common_subsequence
And of course it's slow (O(n*m)):

CREATE FUNCTION mf_LCSLength
(
    @x varchar(8000),
    @y varchar(8000)
)
returns int
AS
/*
Computing the length of the LCS: http://en.wikipedia.org/wiki/Longest_common_subsequence

The below function takes as input sequences X[1..m] and Y[1..n] computes the LCS
between X[1..i] and Y[1..j] for all 1 = i = m and 1 = j = n, and stores it in
C[i,j]. C[m,n] will contain the length of the LCS of X and Y.

function LCSLength(X[1..m], Y[1..n])
    C = array(0..m, 0..n)
    for i := 0..m
       C[i,0] = 0
    for j := 0..n
       C[0,j] = 0
    for i := 1..m
        for j := 1..n
            if X[i] = Y[j]
                C[i,j] := C[i-1,j-1] + 1
            else:
                C[i,j] := max(C[i,j-1], C[i-1,j])
    return C[m,n]
*/
BEGIN
declare @i int
declare @j int
declare @p int
declare @q int
declare @n int
declare @m int
declare @t table (m int, a int, b int)
select @n = len(@x), @m = len(@y), @i = 0

while @i <= @m
    begin
        insert into @t select @i, 0, 0 
        set @i = @i + 1
    end

set @i = 1
while @i <= @n
begin
    set @j = 1
    while @j <= @m
        begin
            if substring(@x, @i, 1) = substring(@y, @j, 1)
                update @t set b = (select a from @t where m = @j - 1) + 1 where m = @j
            else
                begin
                    select @p = a from @t where m = @j
                    select @q = b from @t where m = @j - 1
                    if @p < @q set @p = @q
                    update @t set b = @p where m = @j
                end
            set @j = @j + 1
        end
    update @t set a = b
    set @i = @i + 1
end
RETURN(select max(b) from @t)
END




set nocount on

declare @x varchar(8000)
declare @y varchar(8000)

select
@x = 'yupgayyeuntubajfncjxeyupxbpxfnxbntuxlyaludskiufntukonoyapanonaxlfojup',
@y = 'hfoqujhexjalicjxeyupfxpunapufangayyeualnujufnalibjxpntunapuhxsnjhannxntunapuhxsfxyqua'

select
@x=lower(@x), --@x=replace(@x,'a',''),@x=replace(@x,'e',''),@x=replace(@x,'i',''),@x=replace(@x,'o',''),@x=replace(@x,'u',''),
@y=lower(@y)--, @y=replace(@y,'a',''),@y=replace(@y,'e',''),@y=replace(@y,'i',''),@y=replace(@y,'o',''),@y=replace(@y,'u','')

select 'blindman:', dbo.CompareText(@x,@y)
select 'stoad:', 100.0*dbo.mf_LCSLength(@x,@y)/case when len(@x)>len(@y) then len(@x) else len(@y) end


                      

--------- ----------- 
blindman:          45 
                                           
------------- ---------------------------- 
stoad:             38.823529411764 


-------------------------------------------------------------------------
WITHOUT VOWELES:                      
--------- ---------------------------------------------------------------
blindman:          39 
                                           
------------- ---------------------------- 
stoad:             40.350877192982 


Why two different blindman's results?
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 09/05/2008 :  13:33:13  Show Profile  Reply with Quote
Because two different Stoad inputs.

Boycotted Beijing Olympics 2008
Go to Top of Page

Stoad strehngthend
Yak Posting Veteran

54 Posts

Posted - 09/05/2008 :  17:45:22  Show Profile  Visit Stoad strehngthend's Homepage  Reply with Quote
Yes I thought this:

--Convert to uppercase and remove noise characters
set @TempString = UPPER(@InputString)
set @TempString = replace(@TempString, 'A', '')
set @TempString = replace(@TempString, 'E', '')
set @TempString = replace(@TempString, 'I', '')
set @TempString = replace(@TempString, 'O', '')
set @TempString = replace(@TempString, 'U', '')

in dbo.CompareText()
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 09/05/2008 :  21:23:31  Show Profile  Reply with Quote
Just sad. Why do people keep trying to help this guy? http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=110081

You might as well try to teach SQL to your dog. At least your dog wouldn't be rude.




CODO ERGO SUM
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 09/07/2008 :  12:16:57  Show Profile  Reply with Quote
quote:
Originally posted by Stoad strehngthend

Yes I thought this:

--Convert to uppercase and remove noise characters
set @TempString = UPPER(@InputString)
set @TempString = replace(@TempString, 'A', '')
set @TempString = replace(@TempString, 'E', '')
set @TempString = replace(@TempString, 'I', '')
set @TempString = replace(@TempString, 'O', '')
set @TempString = replace(@TempString, 'U', '')

in dbo.CompareText()


That, doe$sn^t re@m0ve no!se ch@ra)ters. I+t jus/t rem(o)ves v_owels.

Boycotted Beijing Olympics 2008
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 09/25/2008 :  01:28:52  Show Profile  Reply with Quote
Astounding.
Until now, the realm of DBAs has been nearly devoid of business buzzwords. But Certus, in a single thread, has greatly expanded our lexicon.
Little Gems such as "Pactory", "Tractory", "Enactory", and "Exactory" start showing up around post #64, and he throws in "heterarchically" later on.
Thanks to his "EAV On Steroids" database design, we can finally hold our own when talking to mid-level managers.
http://www.dbforums.com/showthread.php?t=1633864&page=5

Boycotted Beijing Olympics 2008
Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 09/25/2008 :  08:27:24  Show Profile  Reply with Quote
But it leaves so many questions unanswered! What about the semantics in the underlying model theory? What notions of reification are there? How does that link in with context and provenance?
(Actually, it's quite possible these were all discussed: I didn't read any more than the posts on the linked page).

Edited by - Arnold Fribble on 09/25/2008 08:29:51
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 09/25/2008 :  08:43:44  Show Profile  Reply with Quote
I suspect he is developing some kind of super "Entity Attribute Vocabulary" (EAV), where words themselves have no meaning except in relation to other words, thus saving us the tedious overhead of dictionaries. Now, anybody will be able to define any word to mean anything they want, without having to worry about restrictions such as grammar or spelling.
Eventually, we will only need one word: "Marklar".

Boycotted Beijing Olympics 2008
Go to Top of Page

LaurieCox
Posting Yak Master

USA
149 Posts

Posted - 09/25/2008 :  09:22:27  Show Profile  Reply with Quote
that's glory for you
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 09/25/2008 :  10:51:54  Show Profile  Reply with Quote
quote:
Originally posted by blindman

Astounding.
Until now, the realm of DBAs has been nearly devoid of business buzzwords. But Certus, in a single thread, has greatly expanded our lexicon.
Little Gems such as "Pactory", "Tractory", "Enactory", and "Exactory" start showing up around post #64, and he throws in "heterarchically" later on.
Thanks to his "EAV On Steroids" database design, we can finally hold our own when talking to mid-level managers.
http://www.dbforums.com/showthread.php?t=1633864&page=5

Boycotted Beijing Olympics 2008


That "design" seems perfectly engineered to generate a steady stream of consulting revenue.

I’m sure we will soon get posts where someone tries to implement it in SQL Server. "Help, every query I write with this database is 4,000 lines long, takes days to run, and tells me my inventory quantity on-hand is “Light Blue".


Edit:
Has anyone ever mentioned to the EVA designers that SQL Server has all that stuff built-in and supported directly by the database engine: sysobjects, syscolumns, systypes, sysreferences, sysconstraints, etc. Just saying...





CODO ERGO SUM

Edited by - Michael Valentine Jones on 09/25/2008 11:03:43
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 09/25/2008 :  10:57:26  Show Profile  Reply with Quote
...or help requests such as "How can I enactor my pactors?"

Boycotted Beijing Olympics 2008
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30212 Posts

Posted - 09/26/2008 :  05:30:49  Show Profile  Visit SwePeso's Homepage  Reply with Quote
I love this guy raky for many many similar posts
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=111451



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 09/26/2008 :  09:08:57  Show Profile  Reply with Quote
quote:
Originally posted by Michael Valentine Jones

Just sad. Why do people keep trying to help this guy? http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=110081

You might as well try to teach SQL to your dog. At least your dog wouldn't be rude.




CODO ERGO SUM

That's why it's a good thing that lions eat their young....Weed out the weaklings!

Terry
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 09/27/2008 :  05:35:53  Show Profile  Reply with Quote
This guy doesnt seem to look into solutions provided before posting again

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=111518
Go to Top of Page

uberman
Posting Yak Master

158 Posts

Posted - 10/27/2008 :  09:13:40  Show Profile  Reply with Quote
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=94903 ... potential twit-hood beckoning for appyks?
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

United Kingdom
3608 Posts

Posted - 10/27/2008 :  10:11:01  Show Profile  Reply with Quote
quote:
Originally posted by uberman

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=94903 ... potential twit-hood beckoning for appyks?


My head hurts now and I gave up trying to read what he typed after the first few words.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 11/11/2008 :  12:13:31  Show Profile  Reply with Quote
I think we need a new forum called "Just Write the Code for Me"
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=114090







CODO ERGO SUM
Go to Top of Page

DavidChel
Constraint Violating Yak Guru

USA
474 Posts

Posted - 11/12/2008 :  17:02:51  Show Profile  Reply with Quote
visakh16 is a saint.
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 11/12/2008 :  18:26:56  Show Profile  Visit spirit1's Homepage  Reply with Quote
probably just wants to claim Peso's title


_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!

Edited by - spirit1 on 11/12/2008 18:27:07
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30212 Posts

Posted - 11/19/2008 :  04:26:15  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Copy and paste reaches new heights!

http://forums.asp.net/t/1339487.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=96424

Source
http://weblogs.sqlteam.com/peterl/archive/2008/10/10/Keep-track-of-all-your-jobs-schedules.aspx


E 12°55'05.63"
N 56°04'39.26"

Edited by - SwePeso on 11/19/2008 04:29:47
Go to Top of Page
Page: of 88 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000