Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-10-27 Thread Gert Van Assche
Sorry, stupid me... I clicked on the wrong link.

2014-10-27 17:32 GMT+01:00 Gert Van Assche :

> Andrea, any chance I can download the latest version of the DLL?
>
> thanks
>
> gert
>
> 2014-09-28 23:28 GMT+02:00 aperi2007 :
>
>> Hi Keith,
>> thx for hints.
>> I have apply all of them.
>>
>> The only one I like to explain:
>>
>> I know the warning for the void insted of int declaration of
>> stringmetricsFunc.
>> But if I put it as "int" I had a warning in the create_function that want
>> a void function.
>> So I preferred to maintain the warning on  return from stringmetricsFunc.
>>
>> However to have a compile without any warning,
>> I adopt this "hard" workaround:
>>
>> I define in wrapper_functions.h a
>> void stringmetricsFunc
>> and instead I declare a
>> int stringmetricFunc in wrapper_function.c
>>
>> Thx again,
>>
>> A.
>>
>>
>>
>> Il 28/09/2014 22:20, Keith Medcalf ha scritto:
>>
>>> src\wrapper_functions.c: In function 'stringmetricsFunc':
>>> src\wrapper_functions.c:350:16: warning: 'return' with a value, in
>>> function returning void [enabled by default]
>>>  return (1);
>>>  ^
>>>
>>> This is easy.  SQLite scalar functions are supposed to return an int
>>> status code.  That code is either SQLITE_ERR if there was an error, or
>>> SQLITE_OK if everything is OK.  So change the function definition to return
>>> an int, and the two return statements to return SQLITE_ERR (not 1) and
>>> SQLITE_OK (not nothing).
>>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-10-27 Thread Gert Van Assche
Andrea, any chance I can download the latest version of the DLL?

thanks

gert

2014-09-28 23:28 GMT+02:00 aperi2007 :

> Hi Keith,
> thx for hints.
> I have apply all of them.
>
> The only one I like to explain:
>
> I know the warning for the void insted of int declaration of
> stringmetricsFunc.
> But if I put it as "int" I had a warning in the create_function that want
> a void function.
> So I preferred to maintain the warning on  return from stringmetricsFunc.
>
> However to have a compile without any warning,
> I adopt this "hard" workaround:
>
> I define in wrapper_functions.h a
> void stringmetricsFunc
> and instead I declare a
> int stringmetricFunc in wrapper_function.c
>
> Thx again,
>
> A.
>
>
>
> Il 28/09/2014 22:20, Keith Medcalf ha scritto:
>
>> src\wrapper_functions.c: In function 'stringmetricsFunc':
>> src\wrapper_functions.c:350:16: warning: 'return' with a value, in
>> function returning void [enabled by default]
>>  return (1);
>>  ^
>>
>> This is easy.  SQLite scalar functions are supposed to return an int
>> status code.  That code is either SQLITE_ERR if there was an error, or
>> SQLITE_OK if everything is OK.  So change the function definition to return
>> an int, and the two return statements to return SQLITE_ERR (not 1) and
>> SQLITE_OK (not nothing).
>>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread Keith Medcalf


Yes, you are correct and I am wrong.  The function should indeed be a void 
function and should not return a status code.  There is presently no way to 
indicate an "error" or "exception" condition other that via the sqlite3_result 
values (and there are specific ones for indicating that there was an error).  
So both the header file and the c source should declare the function as a void 
function.

If you want a terminating error (ie, an exception) you use sqlite3_result_error 
to return the error string (same as sqlite3_result_text).  The difference is 
that setting the result using the sqlite3_result_error will signal an error 
condition and terminate the execution of the SQL statement being processed.  
sqlite3_result_error also always makes a copy of the message text, so you can 
deallocate it immediately after it returns.

The other thing is that the final parameters for the sqlite3_result_text needs 
to be set correctly.  Where you are returning a value allocated from the stack, 
this should be SQLITE_TRANSIENT.  This tells sqlite3 to make its own copy of 
the string that it will keep for as long as it needs -- you are free to modify 
or de-allocate such results immediately after the call to sqlite3_result_text 
returns.  

For return values which you have allocated (with malloc) you need to pass the 
function which will deallocate the memory when sqlite3 is finished with it (in 
that case, free).

>Hi Keith,
>thx for hints.
>I have apply all of them.
>
>The only one I like to explain:
>
>I know the warning for the void insted of int declaration of
>stringmetricsFunc.
>But if I put it as "int" I had a warning in the create_function that
>want a void function.
>So I preferred to maintain the warning on  return from stringmetricsFunc.
>
>However to have a compile without any warning,
>I adopt this "hard" workaround:
>
>I define in wrapper_functions.h a
>void stringmetricsFunc
>and instead I declare a
>int stringmetricFunc in wrapper_function.c
>Thx again,
>
>A.
>
>
>
>Il 28/09/2014 22:20, Keith Medcalf ha scritto:
>> src\wrapper_functions.c: In function 'stringmetricsFunc':
>> src\wrapper_functions.c:350:16: warning: 'return' with a value, in
>function returning void [enabled by default]
>>  return (1);
>>  ^
>>
>> This is easy.  SQLite scalar functions are supposed to return an int
>status code.  That code is either SQLITE_ERR if there was an error, or
>SQLITE_OK if everything is OK.  So change the function definition to
>return an int, and the two return statements to return SQLITE_ERR (not 1)
>and SQLITE_OK (not nothing).
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread aperi2007

Hi Keith,
thx for hints.
I have apply all of them.

The only one I like to explain:

I know the warning for the void insted of int declaration of 
stringmetricsFunc.
But if I put it as "int" I had a warning in the create_function that 
want a void function.

So I preferred to maintain the warning on  return from stringmetricsFunc.

However to have a compile without any warning,
I adopt this "hard" workaround:

I define in wrapper_functions.h a
void stringmetricsFunc
and instead I declare a
int stringmetricFunc in wrapper_function.c

Thx again,

A.



Il 28/09/2014 22:20, Keith Medcalf ha scritto:

src\wrapper_functions.c: In function 'stringmetricsFunc':
src\wrapper_functions.c:350:16: warning: 'return' with a value, in function 
returning void [enabled by default]
 return (1);
 ^

This is easy.  SQLite scalar functions are supposed to return an int status 
code.  That code is either SQLITE_ERR if there was an error, or SQLITE_OK if 
everything is OK.  So change the function definition to return an int, and the 
two return statements to return SQLITE_ERR (not 1) and SQLITE_OK (not nothing).


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread Keith Medcalf

A fixed up version can be found at 
http://www.dessus.com/libstringmetrics-fixed.zip which includes a working DLL 
compiled with 32-bit MinGW, plus modified source and the "compile.cmd" used to 
compile on Windows with MinGW installed.  I will remove it once Andrea has 
merged the changes.

>-Original Message-
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of Keith Medcalf
>Sent: Sunday, 28 September, 2014 14:21
>To: General Discussion of SQLite Database
>Subject: Re: [sqlite] A new extension for sqlite to analyze the
>stringmetrics
>
>
>Andrea, here are some problems and their solutions:
>
>(1) Where do you get a "tolower" function that takes a char* and returns
>a char*?  The one in ctypes.h works a character at a time (thus takes an
>int and returns an int).
>
>(2) Why is the entire sqlite3 engine included in an dll which is loaded
>as an extension to sqlite3?
>
>Please follow along and I will show you where we can find and fix these
>issues ... this might be helpful to other extension writers as well.
>
>First, the -std=c99 needs to be -std=gnu99 to permit the gnu extension
>functions to be recognized.
>Without the GNU extensions a bunch of non-ansi names are not recognized
>because c99 implies -ansi.  Once this change is made 99% of the errors go
>away.
>
>src\wrapper_functions.c: In function 'stringmetricsFunc':
>src\wrapper_functions.c:350:16: warning: 'return' with a value, in
>function returning void [enabled by default]
>return (1);
>^
>
>This is easy.  SQLite scalar functions are supposed to return an int
>status code.  That code is either SQLITE_ERR if there was an error, or
>SQLITE_OK if everything is OK.  So change the function definition to
>return an int, and the two return statements to return SQLITE_ERR (not 1)
>and SQLITE_OK (not nothing).
>
>
>src\wrapper_functions.c:353:4: warning: implicit declaration of function
>'tolower' [-Wimplicit-function-declaration]
>if(strcmp(tolower(kindofoutput),"similarity")==0) {
>^
>src\wrapper_functions.c:353:4: warning: passing argument 1 of 'strcmp'
>makes pointer from integer without a cast [enabled by default]
>In file included from src\wrapper_functions.c:57:0:
>c:\apps\mingw\include\string.h:55:37: note: expected 'const char *' but
>argument is of type 'int'
> _CRTIMP int __cdecl __MINGW_NOTHROW strcmp (const char*, const char*)
>__MINGW_ATTRIB_PURE;
> ^
>src\wrapper_functions.c:355:4: warning: passing argument 1 of 'strcmp'
>makes pointer from integer without a cast [enabled by default]
>} else if(strcmp(tolower(kindofoutput),"metric")==0) {
>^
>In file included from src\wrapper_functions.c:57:0:
>c:\apps\mingw\include\string.h:55:37: note: expected 'const char *' but
>argument is of type 'int'
> _CRTIMP int __cdecl __MINGW_NOTHROW strcmp (const char*, const char*)
>__MINGW_ATTRIB_PURE;
>
>
>The "tolower" function works on an int (single character) and returns an
>int (single character).  It does not work on whole strings.  The function
>for doing a case insensitive string compare is "stricmp":
>
>This can be fixed by making the following changes in wrapper_functions.c:
>
>if(kindofoutput!=NULL) {
>if(stricmp(kindofoutput,"similarity")==0) {
>sqlite3_result_double(context, similarity);
>} else if(stricmp(kindofoutput,"metric")==0) {
>sqlite3_result_text(context, metrics, strlen(metrics)+1,
>NULL);
>} else {
>mex = malloc(strlen(sm_name) + 200 + strlen(metrics)+1);
>sprintf(mex,"%s between \"%s\" & \"%s\" is \"%s\" and
>yields a %3.0f%% similarity",sm_name,par1,par2,metrics,similarity*100);
>sqlite3_result_text(context, mex, strlen(mex)+1, NULL);
>}
>} else {
>mex = malloc(strlen(sm_name) + 200 + strlen(metrics)+1);
>sprintf(mex,"%s between \"%s\" & \"%s\" is \"%s\" and yields
>a %3.0f%% similarity",sm_name,par1,par2,metrics,similarity*100);
>sqlite3_result_text(context, mex, strlen(mex)+1, NULL);
>
>(basically a global search and replace for
>"strcmp(tolower(kindofoutput)," and replacing it with
>"stricmp(kindofoutput,")
>
>
>Now we have left only the problem that the entirety of SQLite3 itself is
>compiled into the extension.
>
>Since we are not compiling the extension into the core, you simply need
>to use the correct header.  "wrapper_functions.c" 

Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread Keith Medcalf
between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "2" and yields a  92% similarity
select stringmetrics("matching_coefficient","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Matching Coefficient SimMetrics between "via giuseppe-garibaldi,25" & "via 
giuseppe garibaldi 25" is "1.00" and yields a  25% similarity
select stringmetrics("matching_coefficient_custom","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Matching Coefficient SimMetrics customized between "via giuseppe-garibaldi,25" 
& "via giuseppe garibaldi 25" is "4.00" and yields a 100% sim
ilarity
select stringmetrics("monge_elkan","phrase","via giuseppe-garibaldi,25", "via 
giuseppe garibaldi 25",",-");
Monge Elkan Similarity between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "1.012500" and yields a 101% similarity
select stringmetrics("monge_elkan_custom","phrase","via giuseppe-garibaldi,25", 
"via giuseppe garibaldi 25",",-");
Matching Coefficient SimMetrics customized STILL NOT IMPLEMENTED between "via 
giuseppe-garibaldi,25" & "via giuseppe garibaldi 25" is "still
 not implemented" and yields a   0% similarity
select stringmetrics("needleman_wunch","phrase","via giuseppe-garibaldi,25", 
"via giuseppe garibaldi 25",",-");
Needleman Wunch SimMetrics between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "2.00" and yields a  96% similarity
select stringmetrics("overlap_coefficient","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Overlap Coefficient Similarity between "via giuseppe-garibaldi,25" & "via 
giuseppe garibaldi 25" is "0.50" and yields a  50% similarity
select stringmetrics("overlap_coefficient_custom","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Overlap Coefficient Similarity customized between "via giuseppe-garibaldi,25" & 
"via giuseppe garibaldi 25" is "1.00" and yields a 100%
similarity
select stringmetrics("qgrams_distance","phrase","via giuseppe-garibaldi,25", 
"via giuseppe garibaldi 25",",-");
QGrams Distance between "via giuseppe-garibaldi,25" & "via giuseppe garibaldi 
25" is "12" and yields a  78% similarity
select stringmetrics("qgrams_distance_custom","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
QGrams Distance customized between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "0" and yields a 100% similarity
select stringmetrics("smith_waterman","phrase","via giuseppe-garibaldi,25", 
"via giuseppe garibaldi 25",",-");
Smith Waterman SimMetrics between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "21.00" and yields a  84% similarity
select stringmetrics("smith_waterman_gotoh","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Smith Waterman Gotoh SimMetrics between "via giuseppe-garibaldi,25" & "via 
giuseppe garibaldi 25" is "109.00" and yields a  87% similarity
select stringmetrics("soundex_phonetics","phrase","via giuseppe-garibaldi,25", 
"via giuseppe garibaldi 25",",-");
Soundex Phonetics between "via giuseppe-garibaldi,25" & "via giuseppe garibaldi 
25" is "V221 & V221" and yields a 100% similarity
select stringmetrics("metaphone_phonetics","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Metaphone Phonetics between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "FJSP & FJSP" and yields a 100% similarity
select stringmetrics("double_metaphone_phonetics","phrase","via 
giuseppe-garibaldi,25", "via giuseppe garibaldi 25",",-");
Double Metaphone Phonetics between "via giuseppe-garibaldi,25" & "via giuseppe 
garibaldi 25" is "FJSP & FJSP" and yields a 100% similarity

sqlite>



>-Original Message-
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of Andrea Peri
>Sent: Sunday, 28 September, 2014 02:53
>To: Gert Van Assche; General Discussion of SQLite Database
>Subject: Re: [sqlite] A new extension for sqlite to analyze the
>stringmetrics
>
>You should use SQLite 32bit
>Il 28/set/2014 10:45 "Gert Van Assche" <ger...@gmail.com> ha scritto:
>
>> Thanks Andrea.
>> When I download the DLL I get exactly the same error.
>> I'm using the 32bit SQLite3.exe on a Win 64 bit machine.
>> Could that cause the error?
>>
>> thanks
>>
>> gert
>>
>> 2014-09-27 20:27 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
>>
>>> https://github.com/aperi2007/libstringmetrics
>>>
>>>
>>> >Andrea, where do I find it?
>>> >
>>> >thanks
>>> >
>>> >gert
>>>
>>>
>>>
>>> --
>>> -
>>> Andrea Peri
>>> . . . . . . . . .
>>> qwerty àèìòù
>>> -
>>>
>>
>>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread dave
You succeeded, Andrea;

On my winxp box
//

D:\bin>sqlite3.exe
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select load_extension ( 'libstringmetrics.dll' );

sqlite> select stringmetrics();
usage:
$ stringmetrics("","","","","")

Where  is one of ("similarity", "metric", "phrase")

Where  is the list of char used as token. It is not used by all
the algoritms. The algorithms that use it are postfixed w
ith "custom". If it is omitted the list used is
"carriage return"
"newline (line feed)"
"horizontal tab"
"null character"
"no-break space"
"space"example:
select stringmetrics("block_distance","phrase","via giuseppe-garibaldi","via
giuseppe garibaldi",NULL);
vs
select stringmetrics("block_distance_custom","phrase","via
giuseppe-garibaldi","via giuseppe garibaldi","-");

Where  is one of:
block_distance_custom
cosine
cosine_custom
dice
dice_custom
euclidean_distance
euclidean_distance_custom
jaccard
jaccard_custom
jaro
jaro_winkler
levenshtein
matching_coefficient
matching_coefficient_custom
monge_elkan
monge_elkan_custom
needleman_wunch
overlap_coefficient
overlap_coefficient_custom
qgrams_distance
qgrams_distance_custom
smith_waterman
smith_waterman_gotoh
soundex_phonetics
metaphone_phonetics
double_metaphone_phonetics


sqlite>

//

-dave


> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Andrea Peri
> Sent: Sunday, September 28, 2014 3:53 AM
> To: Gert Van Assche; General Discussion of SQLite Database
> Subject: Re: [sqlite] A new extension for sqlite to analyze 
> the stringmetrics
> 
> 
> You should use SQLite 32bit
> Il 28/set/2014 10:45 "Gert Van Assche" <ger...@gmail.com> ha scritto:
> 
> > Thanks Andrea.
> > When I download the DLL I get exactly the same error.
> > I'm using the 32bit SQLite3.exe on a Win 64 bit machine.
> > Could that cause the error?
> >
> > thanks
> >
> > gert
> >
> > 2014-09-27 20:27 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
> >
> >> https://github.com/aperi2007/libstringmetrics
> >>
> >>
> >> >Andrea, where do I find it?
> >> >
> >> >thanks
> >> >
> >> >gert
> >>
> >>
> >>
> >> --
> >> -
> >> Andrea Peri
> >> . . . . . . . . .
> >> qwerty àèìòù
> >> -
> >>
> >
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-28 Thread Andrea Peri
You should use SQLite 32bit
Il 28/set/2014 10:45 "Gert Van Assche"  ha scritto:

> Thanks Andrea.
> When I download the DLL I get exactly the same error.
> I'm using the 32bit SQLite3.exe on a Win 64 bit machine.
> Could that cause the error?
>
> thanks
>
> gert
>
> 2014-09-27 20:27 GMT+02:00 Andrea Peri :
>
>> https://github.com/aperi2007/libstringmetrics
>>
>>
>> >Andrea, where do I find it?
>> >
>> >thanks
>> >
>> >gert
>>
>>
>>
>> --
>> -
>> Andrea Peri
>> . . . . . . . . .
>> qwerty àèìòù
>> -
>>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-27 Thread Andrea Peri
https://github.com/aperi2007/libstringmetrics


>Andrea, where do I find it?
>
>thanks
>
>gert



-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-27 Thread Gert Van Assche
Andrea, where do I find it?

thanks

gert

2014-09-27 13:48 GMT+02:00 Andrea Peri :

> Hi,
> I commit the new extension with the runtime statically liked.
> I test it on a clean machine and seem work.
>
> The extension is compiled on 32bit.
> So need a sqlite 32bit to work.
>
> I guess it should not work with a 64bit sqlite shell.
>
> Regards,
>
> A.
>
>
> 2014-09-26 17:38 GMT+02:00 Andrea Peri :
> >>For Andrea Peri's benefit, I did google and find where someone mentions
> the
> >>appropriate flags to statically link the dependency in, thus avoiding
> this
> >>problem.
> >>
> http://stackoverflow.com/questions/4702732/the-program-cant-start-because-li
> >>bgcc-s-dw2-1-dll-is-missing
> >>So Andrea may wish to rebuild and replace the existing dll for the
> benefit
> >>of the community.
> >
> > Thx for hints.
> > I dont notice the dll was commited in the github.
> > :)
> >
> > However, no problem to update the compile to produce a static-linkage
> version.
> > I guess a static linkage version of the lib is still compliant with
> > the license of sqlite and libsymmetric.
> >
> > Also I update the site and dll changing the settings as reported from
> > "keith" (thx).
> >
> > Unfortunately I have not a clean machine to test him for a true
> > static-linkage. Infact now it run for me , but I guess is still a
> > shared version.
> > I compile with minw and need some other lib to have a true
> static-linkage.
> >
> > I try to resolve in this week-end.
> >
> > Andrea
> > --
> > -
> > Andrea Peri
> > . . . . . . . . .
> > qwerty àèìòù
> > -
>
>
>
> --
> -
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-27 Thread Andrea Peri
Hi,
I commit the new extension with the runtime statically liked.
I test it on a clean machine and seem work.

The extension is compiled on 32bit.
So need a sqlite 32bit to work.

I guess it should not work with a 64bit sqlite shell.

Regards,

A.


2014-09-26 17:38 GMT+02:00 Andrea Peri :
>>For Andrea Peri's benefit, I did google and find where someone mentions the
>>appropriate flags to statically link the dependency in, thus avoiding this
>>problem.
>>http://stackoverflow.com/questions/4702732/the-program-cant-start-because-li
>>bgcc-s-dw2-1-dll-is-missing
>>So Andrea may wish to rebuild and replace the existing dll for the benefit
>>of the community.
>
> Thx for hints.
> I dont notice the dll was commited in the github.
> :)
>
> However, no problem to update the compile to produce a static-linkage version.
> I guess a static linkage version of the lib is still compliant with
> the license of sqlite and libsymmetric.
>
> Also I update the site and dll changing the settings as reported from
> "keith" (thx).
>
> Unfortunately I have not a clean machine to test him for a true
> static-linkage. Infact now it run for me , but I guess is still a
> shared version.
> I compile with minw and need some other lib to have a true static-linkage.
>
> I try to resolve in this week-end.
>
> Andrea
> --
> -
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -



-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-26 Thread dave
Okeydoke.  Well, keep in mind, you are already statically linking sqlite
(sort of), and apparently the libsymmeteric as well.  It’s only the gcc
runtime that is dynamically linked.  I believe if you just change the flags
as per the article linked, then that will happen with no further effort on
your part.

(I say 'sort of' on sqlite, because extension libraries actually just get a
forwarding pointer that uses the code in the host application, via the
magikry of sqlite3_ext.h.  I say libsymmetric is apparently statically
linked already, because there are no unrecognizable dll imports other than
gcc_blabblahblah.)

Even if your checking in of the dll binary was a error, you might consider
continuing it, since it makes it possible for folks like Gert to try it out
(since he is user rather than a developer).

Thanks for making it!

-dave

> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Andrea Peri
> Sent: Friday, September 26, 2014 10:38 AM
> To: General Discussion of SQLite Database
> Subject: [sqlite] A new extension for sqlite to analyze the 
> stringmetrics
> 
> 
> >For Andrea Peri's benefit, I did google and find where 
> someone mentions the
> >appropriate flags to statically link the dependency in, thus 
> avoiding this
> >problem.
> >http://stackoverflow.com/questions/4702732/the-program-cant-s
tart-because-li
>bgcc-s-dw2-1-dll-is-missing
>So Andrea may wish to rebuild and replace the existing dll for the benefit
>of the community.

Thx for hints.
I dont notice the dll was commited in the github.
:)

However, no problem to update the compile to produce a static-linkage
version.
I guess a static linkage version of the lib is still compliant with
the license of sqlite and libsymmetric.

Also I update the site and dll changing the settings as reported from
"keith" (thx).

Unfortunately I have not a clean machine to test him for a true
static-linkage. Infact now it run for me , but I guess is still a
shared version.
I compile with minw and need some other lib to have a true static-linkage.

I try to resolve in this week-end.

Andrea
-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-26 Thread Andrea Peri
>For Andrea Peri's benefit, I did google and find where someone mentions the
>appropriate flags to statically link the dependency in, thus avoiding this
>problem.
>http://stackoverflow.com/questions/4702732/the-program-cant-start-because-li
>bgcc-s-dw2-1-dll-is-missing
>So Andrea may wish to rebuild and replace the existing dll for the benefit
>of the community.

Thx for hints.
I dont notice the dll was commited in the github.
:)

However, no problem to update the compile to produce a static-linkage version.
I guess a static linkage version of the lib is still compliant with
the license of sqlite and libsymmetric.

Also I update the site and dll changing the settings as reported from
"keith" (thx).

Unfortunately I have not a clean machine to test him for a true
static-linkage. Infact now it run for me , but I guess is still a
shared version.
I compile with minw and need some other lib to have a true static-linkage.

I try to resolve in this week-end.

Andrea
-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-25 Thread Keith Medcalf

use -Wl,-Bstatic to force static linking (use lib.a in preference to 
lib.dll.a when linking)
use -static-libgcc to force a static link of the gcc runtime libraries

ie

gcc -s -O3 -mwin32 -pipe -march=i686 -mtune=i686 -shared 
-DSQLITE_API=__declspec(dllexport) -Wl,-Bstatic -mthreads 
-DSQLITE_THREADSAFE=1 -D_HAVE_SQLITE_CONFIG_H -DSQLITE_EXTRA_INIT=core_init 
-DSQLITE_CORE sqlite3x.c  -lz -o SQLite3.dll 
-Wl,--output-def,SQLite3.def,--out-implib,SQLite3.a 
-static-libgcc

but all on one line. (your options, defines, source, and output may vary) ...

>-Original Message-
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of dave
>Sent: Thursday, 25 September, 2014 11:27
>To: 'General Discussion of SQLite Database'
>Subject: Re: [sqlite] A new extension for sqlite to analyze the
>stringmetrics
>
>Update: never mind what I mentioned below; he said he is using mingw (it
>really does help to read the entire thread!)
>
>But I have tried and failed to load it (the prebuilt binary) myself; I
>notice there is a further dependency on libgcc-s-dw2-1.dll, so maybe
>that's
>the origin of Gert's problem.
>
>-dave
>
>> -Original Message-
>> From: sqlite-users-boun...@sqlite.org
>> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of dave
>> Sent: Thursday, September 25, 2014 11:59 AM
>> To: 'General Discussion of SQLite Database'
>> Subject: Re: [sqlite] A new extension for sqlite to analyze
>> the stringmetrics
>>
>>
>> Gert:
>>
>> Did you build it yourself, or download a binary?  Are you
>> running on XP, or
>> a later OS?
>>
>> I ask these questions because I have seen this code due to c
>> dll runtime
>> issues like (msvcrt100.dll), etc.
>> Depending on what tool was used to build the binary, some
>> changes may need
>> to be made to the build process so that the binary runs on
>> all platforms XP
>> - win8.  In particular, DS2012 broke the ability to make XP-compatible
>> builds, and the builder is using that, then (s)he needs to select the
>> 'v110_xp' toolset to make a binary that runs on all platforms.
>>
>> All this is purely a guess, and could easily be wrong; I
>> can't take a peek
>> at the lib myself right now; but I mention this now on the
>> chance that it
>> saves some time debugging.
>>
>> -dave
>>
>>
>> > -----Original Message-----
>> > From: sqlite-users-boun...@sqlite.org
>> > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert
>> Van Assche
>> > Sent: Thursday, September 25, 2014 10:25 AM
>> > To: General Discussion of SQLite Database
>> > Subject: Re: [sqlite] A new extension for sqlite to analyze
>> > the stringmetrics
>> >
>> >
>> > Andea,
>> >
>> > Seems like a very interesting extension to me.
>> > I cannot make it run on Windows.
>> > I get error code 0xc00012f.
>> >
>> > Any idea why this is ?
>> >
>> > thanks
>> >
>> > gert
>> >
>> > 2014-09-25 10:11 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
>> >
>> > > Hi,
>> > > for who eventually interested.
>> > >
>> > > Fr a specific internal use I develope a new simple
>> > extension for sqlite.
>> > > The LibStringmetrics.
>> > > https://github.com/aperi2007/libstringmetrics
>> > >
>> > > It is based on the LibSimmetrics c lib from Johnathan Botha
>> > > - available from here:
>> https://github.com/jokillsya/libsimmetrics -
>> > > It was a porting of another java library.
>> > >
>> > > The LibStringMetrics is compile using mingw .
>> > > All is released with a GPL3 to follow the same license of
>> > the original
>> > > libsimmetrics.
>> > >
>> > > The extension is usable after the usual load_extension command:
>> > >
>> > > select load_extension("libstringmetrics.dll");
>> > >
>> > > The extension add One new command:
>> > >
>> > > stringmetrics().
>> > >
>> > > calling it without any parameters
>> > > will return a simple help of the parameters and of the available
>> > > algorithms.
>> > >
>> > > Regards,
>> > >
>> > > --
>> > > -
>> > > Andrea Peri
>> > > . . . . . . . . .
>> > > qwerty àèìòù
>> > > -
>> > > ___
>> > > sqlite-users mailing list
>> > > sqlite-users@sqlite.org
>> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> > >
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-25 Thread dave
Since the source is there, I may give-it-a-go myself this eve, if it's not
too difficult to set up (the extension should be easy, but I don't know
about the other project that provides the actual implementation).  If I do,
I'll make it statically linked so there will be no dependencies.

For Andrea Peri's benefit, I did google and find where someone mentions the
appropriate flags to statically link the dependency in, thus avoiding this
problem.
http://stackoverflow.com/questions/4702732/the-program-cant-start-because-li
bgcc-s-dw2-1-dll-is-missing
So Andrea may wish to rebuild and replace the existing dll for the benefit
of the community.

-dave

> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert Van Assche
> Sent: Thursday, September 25, 2014 12:47 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] A new extension for sqlite to analyze 
> the stringmetrics
> 
> 
> thanks for your help Dave.
> 
> As I'm not a real developer but just an SQLite user, I cannot 
> compile the
> DLL -- I just downloaded the compiled DLL. So your guess is 
> correct. I'm
> working on a Win 8.1 PC and there's no libgcc-s-dw2-1.dll on 
> my system.
> 
> gert
> 
> 2014-09-25 19:26 GMT+02:00 dave <d...@ziggurat29.com>:
> 
> > Update: never mind what I mentioned below; he said he is 
> using mingw (it
> > really does help to read the entire thread!)
> >
> > But I have tried and failed to load it (the prebuilt 
> binary) myself; I
> > notice there is a further dependency on libgcc-s-dw2-1.dll, 
> so maybe that's
> > the origin of Gert's problem.
> >
> > -dave
...


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-25 Thread Gert Van Assche
thanks for your help Dave.

As I'm not a real developer but just an SQLite user, I cannot compile the
DLL -- I just downloaded the compiled DLL. So your guess is correct. I'm
working on a Win 8.1 PC and there's no libgcc-s-dw2-1.dll on my system.

gert

2014-09-25 19:26 GMT+02:00 dave <d...@ziggurat29.com>:

> Update: never mind what I mentioned below; he said he is using mingw (it
> really does help to read the entire thread!)
>
> But I have tried and failed to load it (the prebuilt binary) myself; I
> notice there is a further dependency on libgcc-s-dw2-1.dll, so maybe that's
> the origin of Gert's problem.
>
> -dave
>
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org
> > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of dave
> > Sent: Thursday, September 25, 2014 11:59 AM
> > To: 'General Discussion of SQLite Database'
> > Subject: Re: [sqlite] A new extension for sqlite to analyze
> > the stringmetrics
> >
> >
> > Gert:
> >
> > Did you build it yourself, or download a binary?  Are you
> > running on XP, or
> > a later OS?
> >
> > I ask these questions because I have seen this code due to c
> > dll runtime
> > issues like (msvcrt100.dll), etc.
> > Depending on what tool was used to build the binary, some
> > changes may need
> > to be made to the build process so that the binary runs on
> > all platforms XP
> > - win8.  In particular, DS2012 broke the ability to make XP-compatible
> > builds, and the builder is using that, then (s)he needs to select the
> > 'v110_xp' toolset to make a binary that runs on all platforms.
> >
> > All this is purely a guess, and could easily be wrong; I
> > can't take a peek
> > at the lib myself right now; but I mention this now on the
> > chance that it
> > saves some time debugging.
> >
> > -dave
> >
> >
> > > -Original Message-
> > > From: sqlite-users-boun...@sqlite.org
> > > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert
> > Van Assche
> > > Sent: Thursday, September 25, 2014 10:25 AM
> > > To: General Discussion of SQLite Database
> > > Subject: Re: [sqlite] A new extension for sqlite to analyze
> > > the stringmetrics
> > >
> > >
> > > Andea,
> > >
> > > Seems like a very interesting extension to me.
> > > I cannot make it run on Windows.
> > > I get error code 0xc00012f.
> > >
> > > Any idea why this is ?
> > >
> > > thanks
> > >
> > > gert
> > >
> > > 2014-09-25 10:11 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
> > >
> > > > Hi,
> > > > for who eventually interested.
> > > >
> > > > Fr a specific internal use I develope a new simple
> > > extension for sqlite.
> > > > The LibStringmetrics.
> > > > https://github.com/aperi2007/libstringmetrics
> > > >
> > > > It is based on the LibSimmetrics c lib from Johnathan Botha
> > > > - available from here:
> > https://github.com/jokillsya/libsimmetrics -
> > > > It was a porting of another java library.
> > > >
> > > > The LibStringMetrics is compile using mingw .
> > > > All is released with a GPL3 to follow the same license of
> > > the original
> > > > libsimmetrics.
> > > >
> > > > The extension is usable after the usual load_extension command:
> > > >
> > > > select load_extension("libstringmetrics.dll");
> > > >
> > > > The extension add One new command:
> > > >
> > > > stringmetrics().
> > > >
> > > > calling it without any parameters
> > > > will return a simple help of the parameters and of the available
> > > > algorithms.
> > > >
> > > > Regards,
> > > >
> > > > --
> > > > -
> > > > Andrea Peri
> > > > . . . . . . . . .
> > > > qwerty àèìòù
> > > > -
> > > > ___
> > > > sqlite-users mailing list
> > > > sqlite-users@sqlite.org
> > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-25 Thread dave
Update: never mind what I mentioned below; he said he is using mingw (it
really does help to read the entire thread!)

But I have tried and failed to load it (the prebuilt binary) myself; I
notice there is a further dependency on libgcc-s-dw2-1.dll, so maybe that's
the origin of Gert's problem.

-dave

> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of dave
> Sent: Thursday, September 25, 2014 11:59 AM
> To: 'General Discussion of SQLite Database'
> Subject: Re: [sqlite] A new extension for sqlite to analyze 
> the stringmetrics
> 
> 
> Gert:
> 
> Did you build it yourself, or download a binary?  Are you 
> running on XP, or
> a later OS?
> 
> I ask these questions because I have seen this code due to c 
> dll runtime
> issues like (msvcrt100.dll), etc.
> Depending on what tool was used to build the binary, some 
> changes may need
> to be made to the build process so that the binary runs on 
> all platforms XP
> - win8.  In particular, DS2012 broke the ability to make XP-compatible
> builds, and the builder is using that, then (s)he needs to select the
> 'v110_xp' toolset to make a binary that runs on all platforms.
> 
> All this is purely a guess, and could easily be wrong; I 
> can't take a peek
> at the lib myself right now; but I mention this now on the 
> chance that it
> saves some time debugging.
> 
> -dave
> 
> 
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org 
> > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert 
> Van Assche
> > Sent: Thursday, September 25, 2014 10:25 AM
> > To: General Discussion of SQLite Database
> > Subject: Re: [sqlite] A new extension for sqlite to analyze 
> > the stringmetrics
> > 
> > 
> > Andea,
> > 
> > Seems like a very interesting extension to me.
> > I cannot make it run on Windows.
> > I get error code 0xc00012f.
> > 
> > Any idea why this is ?
> > 
> > thanks
> > 
> > gert
> > 
> > 2014-09-25 10:11 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
> > 
> > > Hi,
> > > for who eventually interested.
> > >
> > > Fr a specific internal use I develope a new simple 
> > extension for sqlite.
> > > The LibStringmetrics.
> > > https://github.com/aperi2007/libstringmetrics
> > >
> > > It is based on the LibSimmetrics c lib from Johnathan Botha
> > > - available from here: 
> https://github.com/jokillsya/libsimmetrics -
> > > It was a porting of another java library.
> > >
> > > The LibStringMetrics is compile using mingw .
> > > All is released with a GPL3 to follow the same license of 
> > the original
> > > libsimmetrics.
> > >
> > > The extension is usable after the usual load_extension command:
> > >
> > > select load_extension("libstringmetrics.dll");
> > >
> > > The extension add One new command:
> > >
> > > stringmetrics().
> > >
> > > calling it without any parameters
> > > will return a simple help of the parameters and of the available
> > > algorithms.
> > >
> > > Regards,
> > >
> > > --
> > > -
> > > Andrea Peri
> > > . . . . . . . . .
> > > qwerty àèìòù
> > > -
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > 
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A new extension for sqlite to analyze the stringmetrics

2014-09-25 Thread dave
Gert:

Did you build it yourself, or download a binary?  Are you running on XP, or
a later OS?

I ask these questions because I have seen this code due to c dll runtime
issues like (msvcrt100.dll), etc.
Depending on what tool was used to build the binary, some changes may need
to be made to the build process so that the binary runs on all platforms XP
- win8.  In particular, DS2012 broke the ability to make XP-compatible
builds, and the builder is using that, then (s)he needs to select the
'v110_xp' toolset to make a binary that runs on all platforms.

All this is purely a guess, and could easily be wrong; I can't take a peek
at the lib myself right now; but I mention this now on the chance that it
saves some time debugging.

-dave


> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gert Van Assche
> Sent: Thursday, September 25, 2014 10:25 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] A new extension for sqlite to analyze 
> the stringmetrics
> 
> 
> Andea,
> 
> Seems like a very interesting extension to me.
> I cannot make it run on Windows.
> I get error code 0xc00012f.
> 
> Any idea why this is ?
> 
> thanks
> 
> gert
> 
> 2014-09-25 10:11 GMT+02:00 Andrea Peri <aperi2...@gmail.com>:
> 
> > Hi,
> > for who eventually interested.
> >
> > Fr a specific internal use I develope a new simple 
> extension for sqlite.
> > The LibStringmetrics.
> > https://github.com/aperi2007/libstringmetrics
> >
> > It is based on the LibSimmetrics c lib from Johnathan Botha
> > - available from here: https://github.com/jokillsya/libsimmetrics -
> > It was a porting of another java library.
> >
> > The LibStringMetrics is compile using mingw .
> > All is released with a GPL3 to follow the same license of 
> the original
> > libsimmetrics.
> >
> > The extension is usable after the usual load_extension command:
> >
> > select load_extension("libstringmetrics.dll");
> >
> > The extension add One new command:
> >
> > stringmetrics().
> >
> > calling it without any parameters
> > will return a simple help of the parameters and of the available
> > algorithms.
> >
> > Regards,
> >
> > --
> > -
> > Andrea Peri
> > . . . . . . . . .
> > qwerty àèìòù
> > -
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users