Re: [sqlite] Use David Gay's fast & accurate strtod?

2012-02-21 Thread Richard Hipp
On Tue, Feb 21, 2012 at 9:07 PM, Bob Burger  wrote:

> > The license for David Gay's dtoa.c is not compatible with SQLite.
>
> Thanks for checking into it, and I'm very sorry to hear it's incompatible.
> Our software uses the SQLite binary interface to bind parameters in most
> cases, but there are a few occasions when users specify queries in text.
>
> What would you think of providing a configuration option for SQLite to use
> the strtod C library function?
>

strtod() doesn't work in all cases since it depends on locale - the radix
point character is usually 0x2e (".") but is sometimes 0x2c (",").
Strtod() could be made to work if we could guarantee that the locale always
specified 0x2e as the radix point character.

Also, strtod() requires UTF8 text whereas SQLite sometimes has the content
as UTF16. The string-to-binary converter for SQLite is able to handle
both.  The inability of strtod() to convert UTF16 could be worked around by
doing UTF16-to-UTF8 conversions when necessary.  But that would be still
more code that would need to be added and tested.


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



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


Re: [sqlite] Use David Gay's fast & accurate strtod?

2012-02-21 Thread Bob Burger
> The license for David Gay's dtoa.c is not compatible with SQLite.

Thanks for checking into it, and I'm very sorry to hear it's incompatible. Our 
software uses the SQLite binary interface to bind parameters in most cases, but 
there are a few occasions when users specify queries in text.

What would you think of providing a configuration option for SQLite to use the 
strtod C library function?

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


Re: [sqlite] SQLite data source in Visual Studio 2010

2012-02-21 Thread Joe Mistachkin

Agrawal, Manish wrote:
> 
> Since the 32-bit installer will install 32-bit assemblies, and VS2010
> is a 32-bit app, what is the benefit of installing 64-bit assemblies
> into the GAC.
> 

The 64-bit assemblies in the GAC could be used by any purely managed
application running on a 64-bit machine (since purely managed
applications always run with the native processor architecture of the
machine).

Having said that, the best practice would be to always deploy the
necessary assemblies (both native and managed) in the application
directory itself.

--
Joe Mistachkin

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


Re: [sqlite] SQLite data source in Visual Studio 2010

2012-02-21 Thread Agrawal, Manish
Thanks very much, hopefully my last question in the series:

Since the 32-bit installer will install 32-bit assemblies, and VS2010 is a 
32-bit app, what is the benefit of installing 64-bit assemblies into the GAC.

Thanks
Manish


>
> 2. If only the 32-bit setup files are useful, what is the use of the
64-bit setup
> files.
>

The 64-bit setups can do everything except install the design-time components, 
including putting 64-bit assemblies into the GAC.

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


Re: [sqlite] bug? Can't load file SQLiteConnection.cs under c:\dev\sqlite\dotnet\System.Data.SQLite.

2012-02-21 Thread Joe Mistachkin

LouOttawa wrote:
> 
> You explained that: "The path you are seeing is from the machine used to
> build the released binaries." I understand your explanation, but is this
not
> then a bug in SQLite? Doesn't "someone" build the binaries on the "SQLite
> machine" so to speak? 
> 

No, it's not a bug.  The compiler automatically embeds the original source
location in the PDBs.

> 
> I mean - its not a SharpDevelop problem, is it?
> 

Not really.  It's probably just reading the PDB and assuming that the source
code should be available locally in the same location as when it was built.
That assumption is invalid in this case; however, in the more general case
of
projects being developed with SharpDevelop, that might be OK.

--
Joe Mistachkin

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


Re: [sqlite] SQLite data source in Visual Studio 2010

2012-02-21 Thread Joe Mistachkin

Agrawal, Manish wrote:
>
> 1. To confirm, if I want data source and other visual support, I MUST
INSTALL the
> setups on my development machine. It is not adequate to just copy the dll
files
> to the project.
>

Basically, yes.  Otherwise you would have to manually run the design-time
component
installer tool, which is not recommended.

>
> 2. If only the 32-bit setup files are useful, what is the use of the
64-bit setup
> files.
>

The 64-bit setups can do everything except install the design-time
components,
including putting 64-bit assemblies into the GAC.

>
> 3. If I install the setups on my dev machine, when I distribute the app,
is it
> required to include the dll files and add references to them within the
project? 
>

When you deploy your application, the only additional files would be
"System.Data.SQLite.dll" (appropriate to the target processor since the
mixed-mode
assembly does contain native code) and optionally
"System.Data.SQLite.Linq.dll"
(if you use the LINQ support).  Also, if and only if you use the separate
managed
and native assemblies, you would need to include "SQLite.Interop.dll"
(appropriate
to the target processor).

--
Joe Mistachkin

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


Re: [sqlite] Reference error

2012-02-21 Thread Joe Mistachkin

David Horne wrote:
> 
> The only thing I haven't checked is the contents of the GAC for the
> possible stray that you mention. Can you tell me how to do this?
> 

Open a Visual Studio 2010 Command Prompt and type:

gacutil /l System.Data.SQLite 

--
Joe Mistachkin

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


Re: [sqlite] Use David Gay's fast & accurate strtod?

2012-02-21 Thread Richard Hipp
On Tue, Feb 21, 2012 at 4:18 PM, Bob Burger  wrote:

> On 1 Nov 2011, Richard Hipp wrote:
> > Floating-point numbers are approximations.  There is no way to represent
> > 290.08 or 6.97 or 283.11 in binary.  The closest  you can get to these
> > numbers using IEEE doubles is:
>
> >  290.079998408384271897375583648681640625
> >  6.96975131004248396493494510650634765625
> >  283.11000136424205265939235687255859375
>
> > And to compound the difficulty, SQLite does not attempt to get that
> close,
> > as doing so requires infinite-precision integer math in the worst case
> and
> > a noticeable performance hit.  SQLite, therefore, goes for a rougher
> > approximation and settles for 14 significant digits.
>
> Are you familiar with David Gay's fast, accurate & free strtod
> implementation (http://www.netlib.org/fp/dtoa.c)? It should be as fast
> as the SQLite implementation in util.c for strings with fewer than 9
> digits, and it will always return the correctly rounded result.
>

The license for David Gay's dtoa.c is not compatible with SQLite.


>
> Having the text parser accurately handle floating-point input is
> important to my company.


If you need extreme accuracy in handling floating point numbers, you should
skip the parser all together.  Use a
parametersuch as ? or
$value in the SQL, then bind your floating point value to it
using sqlite3_bind_double() .
That will be both faster and more accurate than even David Gay's
implementation.



> I have permission to donate my time to
> integrate his code and provide a suite of test cases, if you're
> interested.
>
> Sincerely,
> Bob Burger
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] Site/Login Confusion

2012-02-21 Thread LouOttawa

I can loggin under Nabble without a problem. But the SQLite web site at
"http://www.sqlite.org/src/login; seems to be quite separate in its
credentials, although it lists bug reports that I entered in Nabble. What is
that website for?

-- 
View this message in context: 
http://old.nabble.com/Site-Login-Confusion-tp33367132p33367132.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] bug? Can't load file SQLiteConnection.cs under c:\dev\sqlite\dotnet\System.Data.SQLite.

2012-02-21 Thread LouOttawa

Joe...
You explained that: "The path you are seeing is from the machine used to
build the released binaries." I understand your explanation, but is this not
then a bug in SQLite? Doesn't "someone" build the binaries on the "SQLite
machine" so to speak?

I mean - its not a SharpDevelop problem, is it?

Will it go into the "bug report list"?

Lou.



Joe Mistachkin-3 wrote:
> 
> 
> LouOttawa wrote:
>> 
>> Why is it looking for the ".cs" file? Why does it look for in the
> indicated
>> folder.
>> 
> 
> That message is coming from your IDE (SharpDevelop?) when it uses the PDB
> symbol information in an attempt to locate the source code for the
> SQLiteConnection class.  The path you are seeing is from the machine used
> to
> build the released binaries.
> 
>>
>> The code is essentially below. The GetSchema generates the error.
>>
> 
> The correct argument to pass to GetSchema in this case is
> "MetaDataCollections"
> (with an "s" at the end).
> 
> --
> Joe Mistachkin
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/bug--Can%27t-load-file-SQLiteConnection.cs-under-c%3A%5Cdev%5Csqlite%5Cdotnet%5CSystem.Data.SQLite.-tp33353617p33367058.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] Use David Gay's fast & accurate strtod?

2012-02-21 Thread Bob Burger
On 1 Nov 2011, Richard Hipp wrote:
> Floating-point numbers are approximations.  There is no way to represent
> 290.08 or 6.97 or 283.11 in binary.  The closest  you can get to these
> numbers using IEEE doubles is:

>  290.079998408384271897375583648681640625
>  6.96975131004248396493494510650634765625
>  283.11000136424205265939235687255859375

> And to compound the difficulty, SQLite does not attempt to get that close,
> as doing so requires infinite-precision integer math in the worst case and
> a noticeable performance hit.  SQLite, therefore, goes for a rougher
> approximation and settles for 14 significant digits.

Are you familiar with David Gay's fast, accurate & free strtod
implementation (http://www.netlib.org/fp/dtoa.c)? It should be as fast
as the SQLite implementation in util.c for strings with fewer than 9
digits, and it will always return the correctly rounded result.

Having the text parser accurately handle floating-point input is
important to my company. I have permission to donate my time to
integrate his code and provide a suite of test cases, if you're
interested.

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


Re: [sqlite] Is there way to modify table structure after > initial definition ?

2012-02-21 Thread gregorinator
On 2/21/12, Andrew Barnes  wrote:
>> You need to study the ALTER TABLE statement and its limitations.
{snip}
> SQLLite uses dynamic typing so you can put data of any type into any column.

Modification of the table structure might not be necessary in this
case, but in a general case, SQLite's ALTER TABLE command is very
limited.  One solution is to use a database administration tool that
supports a more full-featured table modification capability.  I use
SQLite Studio (http://sqlitestudio.one.pl) -- there are probably
others.  It allows removing and creating primary keys, foreign keys,
and many, many other table modifications that ALTER TABLE does not.  I
assume that "under the hood" it's building a new table and copying the
data from the old one, but all that's seamless to you.  It's made my
life a lot easier.

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


Re: [sqlite] Is there way to modify table structure after > initial definition ?

2012-02-21 Thread Andrew Barnes

> Huang Chen Min wrote:
> > Dear all:
> > Forgive for asking such stupid question. I use Xbase way to
> > understand SQLite.
> > It is allowed to modify dat type of column in clipper. In my personal
> > thoughts, Creating a brandnew table and copy those data from older version
> > might be an alternative way. Is there any instrument to meet my need
> > directly.
> > Best Regards
> > --
> > tom
> 
> You need to study the ALTER TABLE statement and its limitations.  See
> http://www.sqlite.org/lang_altertable.html .
> 

SQLLite uses dynamic typing so you can put data of any type into any column. 

http://sqlite.org/faq.html#q2

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


Re: [sqlite] Reference error

2012-02-21 Thread David Horne
Yes I do mean 'System.Data.SQLite.dll' and I've checked for any duplicates.
I've also removed the original download and installation, downloaded again
and re-installed.

The reference is to :

C:\Program FIles\System.Data.SQLite\2010\bin\System.Data.SQLite.dll.

This little test is about as simple as you can get - there is only the one
'Import' - but at runtime the program is waiting for something - the
message only appears if I step into the first statement with the debugger.

The only thing I haven't checked is the contents of the GAC for the
possible stray that you mention. Can you tell me how to do this?

Thanks for the help.


On 20 February 2012 22:23, Joe Mistachkin  wrote:

>
> David Horne wrote:
> >
> > Thanks for the help. If you've any other ideas then please let me know.
> >
>
> I'm confused, do you actually mean the "System.Data.SQLite.dll" file
> (not sqlite.dll)?
>
> Judging from the error message, it seems you may have an extraneous
> install of System.Data.SQLite somewhere.  Alternatively, there may be
> a stray managed-only System.Data.SQLite assembly in the GAC that
> attempts to load the 32-bit interop DLL.
>
> The error message itself is described here:
>
> http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q12
>
> However, I cannot easily explain it in this case because it appeared
> at first glance that you were using the DLL with the right processor
> architecture for your operating system.
>
> The only other explanation I can readily think of is that you are
> somehow setting a reference to the wrong System.Data.SQLite assembly
> in your project.
>
> --
> Joe Mistachkin
>
> ___
> 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] Relative path to sqlite database

2012-02-21 Thread Taleeb Anwar
Hi,

Your exe from desktop, perhaps, crashes because it can no longer find the
resources referenced by it (and present in debug folder)

For test purpose you can try ../../db/test.db3

But this will fail on deployment. You need to programmatically find the exe
location. One of the following may help:
1. Appliaction.StartupPath
2. Application.ExecutablePath
3. System.Reflection.Assembly.GetExecutingAssembly()

Thanks and Regards
Taleeb Anwar

*Hum Mashriq Ke "Miskeenon" Ka Dil Maghrib men Ja Atka Hai!!*




On Tue, Feb 21, 2012 at 7:02 PM, Pavel Ivanov  wrote:

> > Just a quick note though, when I move the .exe file to the desktop and
> double-click on it, it crashes, which suggests that the bin/debug location
> is only applicable when the application is run from within the IDE.
>
> Crash is probably because your desktop folder doesn't have db
> subdirectory where you want your database to be created. All relative
> paths are always relative to the current directory, not to the place
> where EXE file is located or where it was built.
>
>
> Pavel
>
>
> On Mon, Feb 20, 2012 at 10:11 PM, Agrawal, Manish 
> wrote:
> > Ah, I should have thought of that.
> >
> > When I run the application (Ctrl+F5), the path is created in bin/debug.
> This is also the folder where the .exe file is created.
> >
> > Just a quick note though, when I move the .exe file to the desktop and
> double-click on it, it crashes, which suggests that the bin/debug location
> is only applicable when the application is run from within the IDE.
> >
> > Thanks
> > Manish
> >
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org [mailto:
> sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
> > Sent: Monday, February 20, 2012 9:51 PM
> > To: General Discussion of SQLite Database
> > Subject: Re: [sqlite] Relative path to sqlite database
> >
> >
> > On 21 Feb 2012, at 2:49am, "Agrawal, Manish"  wrote:
> >
> >> All the sqlite examples I see use absolute paths to the sqlite database
> in Visual Studio projects, e.g. "C:\users\test\apps\db\test.db3".
> >>
> >> How can I specify the path to the sqlite database relative to the
> application root folder, e.g. "db\test.db3"?
> >
> > Have you tried specifying a filename without a path, just to see where
> the file ends up ?
> >
> > Simon.
> > ___
> > 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] Relative path to sqlite database

2012-02-21 Thread Pavel Ivanov
> Just a quick note though, when I move the .exe file to the desktop and 
> double-click on it, it crashes, which suggests that the bin/debug location is 
> only applicable when the application is run from within the IDE.

Crash is probably because your desktop folder doesn't have db
subdirectory where you want your database to be created. All relative
paths are always relative to the current directory, not to the place
where EXE file is located or where it was built.


Pavel


On Mon, Feb 20, 2012 at 10:11 PM, Agrawal, Manish  wrote:
> Ah, I should have thought of that.
>
> When I run the application (Ctrl+F5), the path is created in bin/debug. This 
> is also the folder where the .exe file is created.
>
> Just a quick note though, when I move the .exe file to the desktop and 
> double-click on it, it crashes, which suggests that the bin/debug location is 
> only applicable when the application is run from within the IDE.
>
> Thanks
> Manish
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
> Sent: Monday, February 20, 2012 9:51 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Relative path to sqlite database
>
>
> On 21 Feb 2012, at 2:49am, "Agrawal, Manish"  wrote:
>
>> All the sqlite examples I see use absolute paths to the sqlite database in 
>> Visual Studio projects, e.g. "C:\users\test\apps\db\test.db3".
>>
>> How can I specify the path to the sqlite database relative to the 
>> application root folder, e.g. "db\test.db3"?
>
> Have you tried specifying a filename without a path, just to see where the 
> file ends up ?
>
> Simon.
> ___
> 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] SQLite data source in Visual Studio 2010

2012-02-21 Thread Brady Kelly
On 21 February 2012 05:44, Joe Mistachkin  wrote:

>
>  NOTE #2: When installing the setup package, make sure that the option to
> install the assemblies into the GAC is checked if you plan on installing
> the design-time components.  In the next release, this box will be checked
> by default.
>

Thank you. This was what caused my problem, but I don't recall seeing it
the first time round.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite data source in Visual Studio 2010

2012-02-21 Thread Agrawal, Manish
Thanks very much, that is very helpful. I had three follow up questions:

1. To confirm, if I want data source and other visual support, I MUST INSTALL 
the setups on my development machine. It is not adequate to just copy the dll 
files to the project.

2. If only the 32-bit setup files are useful, what is the use of the 64-bit 
setup files.

3. If I install the setups on my dev machine, when I distribute the app, is it 
required to include the dll files and add references to them within the project?

Thanks
Manish 

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Joe Mistachkin
Sent: Monday, February 20, 2012 10:44 PM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] SQLite data source in Visual Studio 2010


As of System.Data.SQLite version 1.0.79.0, design-time installer support is 
included in the appropriate setup packages.  The instructions on the blog post 
you linked to should now be considered obsolete.

NOTE #1: Since Visual Studio itself is a 32-bit process, you will need to 
install the 32-bit setup package in order for the design-time components to 
install and work properly.

NOTE #2: When installing the setup package, make sure that the option to 
install the assemblies into the GAC is checked if you plan on installing the 
design-time components.  In the next release, this box will be checked by 
default.

--
Joe Mistachkin

___
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