Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
OK,

I found the solution for Jython. I must list my jars in CLASSPATH and not in
JYTHONPATH. I don't have to copy my native library to /usr/lib if I point to
them using the Java system property java.library.path.

:-)

2010/11/29 Pierre Thibault 

> I am able to do System.loadLibrary("sqlite_jni") in my Jython script so it
> seems the problem is more with Jython itself. I am progressing.
>
> I have this error instead:
>
> java.sql.SQLException: java.sql.SQLException: No suitable driver found for
> jdbc:sqlite:/home/pierreth/work/web2py/applications/welcome/databases/storage.sqlite
>
> --
> A+
>
> -
> Pierre
>



-- 
A+

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


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
I am able to do System.loadLibrary("sqlite_jni") in my Jython script so it
seems the problem is more with Jython itself. I am progressing.

I have this error instead:

java.sql.SQLException: java.sql.SQLException: No suitable driver found for
jdbc:sqlite:/home/pierreth/work/web2py/applications/welcome/databases/storage.sqlite

-- 
A+

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


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
2010/11/28 Timothy A. Sawyer 

> Not knowing much about your specific environment, wouldn't it be easier to
> just do what you need to do in Java without having to use C?
>
>
The point of all this is trying to use web2py, a Python web framework, with
the Jython implementation of Python on the Java platform. SQLite is the
default database manager of web2py so I want to make it work with Java
first.

I was able to make my Groovy script work but another version of the same
script written in Jython still does not work. I really don't know why. This
is where I am now.

-- 
A+

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


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
2010/11/28 Timothy A. Sawyer 

> Check the LD_LIBRARY_PATH variable and make sure that /usr/local/lib is in
> the path.
>
>
LD_LIBRARY_PATH is a awful solution. It is not working any better when I do
export LD_LIBRARY_PATH=/usr/local/lib.

Putting /usr/local/lib in the Java library path does not help either.

But copying to /usr/lib makes everything OK. It would be nice to know why.

-- 
A+

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


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Timothy A. Sawyer
Not knowing much about your specific environment, wouldn't it be easier to just 
do what you need to do in Java without having to use C?
--Original Message--
From: Pierre Thibault
Sender: sqlite-users-boun...@sqlite.org
To: sqlite-users@sqlite.org
ReplyTo: General Discussion of SQLite Database
Subject: Re: [sqlite] Unable to make SQLite working with Java
Sent: Nov 28, 2010 20:18

Hello,

I found that copying the library, libsqlite_jna.so and libsqlite_jna.la,
from /usr/local/lib to /usr/lib solve the problem. I don't why but it works.
:-)

2010/11/28 Pierre Thibault 

> Hello,
>
> I am unable to access an sqlite file in Groovy:
>
> import java.sql.DriverManager
> driverManager = Class.forName("java.sql.DriverManager").newInstance();
> //Class.forName("org.sqlite.JDBC").newInstance(); // SQLite.JDBCDriver
> org.sqlite.JDBC
> print
> DriverManager.getConnection("jdbc:sqlite:/media/pierreth-backup/work/web2py/applications/welcome/databases/storage.sqlite")
>
> I have this error:
>
> Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: no sqlite_jni in
> java.library.path
> Caught: java.sql.SQLException: java.lang.UnsatisfiedLinkError:
> SQLite.Database.internal_init()V
>
> But my class path is OK:
>
> /usr/local/share/java/sqlite.jar:/opt/java/lib/sqlitejdbc-v056.jar
>
> and java.library.path is /usr/local/lib  where I have libsqlite_jni.so.
>
> Any idea?
>
> --
> A+
>
> -
> Pierre
>



-- 
A+

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


** Sent from my mobile device with the tiny keys **

Timothy A. Sawyer, CISSP
Managing Director
MBD Consulting, LLC
55 Madison Av., Suite 400 
Morristown, NJ 07960
Phone: (973) 285-3261 | Fax: (973) 538-0503
Web: http://www.mybowlingdiary.com
Email: tsaw...@mybowlingdiary.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Timothy A. Sawyer
Check the LD_LIBRARY_PATH variable and make sure that /usr/local/lib is in the 
path. 
--Original Message--
From: Pierre Thibault
Sender: sqlite-users-boun...@sqlite.org
To: sqlite-users@sqlite.org
ReplyTo: General Discussion of SQLite Database
Subject: Re: [sqlite] Unable to make SQLite working with Java
Sent: Nov 28, 2010 20:18

Hello,

I found that copying the library, libsqlite_jna.so and libsqlite_jna.la,
from /usr/local/lib to /usr/lib solve the problem. I don't why but it works.
:-)

2010/11/28 Pierre Thibault 

> Hello,
>
> I am unable to access an sqlite file in Groovy:
>
> import java.sql.DriverManager
> driverManager = Class.forName("java.sql.DriverManager").newInstance();
> //Class.forName("org.sqlite.JDBC").newInstance(); // SQLite.JDBCDriver
> org.sqlite.JDBC
> print
> DriverManager.getConnection("jdbc:sqlite:/media/pierreth-backup/work/web2py/applications/welcome/databases/storage.sqlite")
>
> I have this error:
>
> Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: no sqlite_jni in
> java.library.path
> Caught: java.sql.SQLException: java.lang.UnsatisfiedLinkError:
> SQLite.Database.internal_init()V
>
> But my class path is OK:
>
> /usr/local/share/java/sqlite.jar:/opt/java/lib/sqlitejdbc-v056.jar
>
> and java.library.path is /usr/local/lib  where I have libsqlite_jni.so.
>
> Any idea?
>
> --
> A+
>
> -
> Pierre
>



-- 
A+

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


** Sent from my mobile device with the tiny keys **

Timothy A. Sawyer, CISSP
Managing Director
MBD Consulting, LLC
55 Madison Av., Suite 400 
Morristown, NJ 07960
Phone: (973) 285-3261 | Fax: (973) 538-0503
Web: http://www.mybowlingdiary.com
Email: tsaw...@mybowlingdiary.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
Hello,

I found that copying the library, libsqlite_jna.so and libsqlite_jna.la,
from /usr/local/lib to /usr/lib solve the problem. I don't why but it works.
:-)

2010/11/28 Pierre Thibault 

> Hello,
>
> I am unable to access an sqlite file in Groovy:
>
> import java.sql.DriverManager
> driverManager = Class.forName("java.sql.DriverManager").newInstance();
> //Class.forName("org.sqlite.JDBC").newInstance(); // SQLite.JDBCDriver
> org.sqlite.JDBC
> print
> DriverManager.getConnection("jdbc:sqlite:/media/pierreth-backup/work/web2py/applications/welcome/databases/storage.sqlite")
>
> I have this error:
>
> Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: no sqlite_jni in
> java.library.path
> Caught: java.sql.SQLException: java.lang.UnsatisfiedLinkError:
> SQLite.Database.internal_init()V
>
> But my class path is OK:
>
> /usr/local/share/java/sqlite.jar:/opt/java/lib/sqlitejdbc-v056.jar
>
> and java.library.path is /usr/local/lib  where I have libsqlite_jni.so.
>
> Any idea?
>
> --
> A+
>
> -
> Pierre
>



-- 
A+

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie

On Nov 28, 2010, at 6:19 PM, Rick Regan wrote:

> On Sun, Nov 28, 2010 at 5:52 PM, Doug Currie  wrote:
> 
>> 
>> There is a new publication on this subject that may be of interest to those
>> looking at providing solutions:
>> 
>> http://portal.acm.org/citation.cfm?id=1806623
>> 
>> It (Grisu2) works without bignums if you are willing to settle for the
>> shortest string in 99.8% of cases, and an accurate but not shortest string
>> in the remaining cases.
>> 
> 
> Thanks for the reference. I wonder how it compares to David Gay's dtoa.c?

The paper compares the performance of sprintf from glibc 2.11 and Grisu. I 
don't know if glibc sprintf is based on Gay's code; at one point I thought it 
was, but I cannot find an authoritative reference.

In any case, the Grisus benchmarked about 5x to 10x faster than sprintf on 
average for random double inputs. The code should be simpler than dtoa.c since 
there are no bignums involved, and fewer special cases.

Anyone still reading this thread might be interested in the directed rounding 
mode subtleties discovered by Rick Regan: 
http://www.exploringbinary.com/incorrect-directed-conversions-in-david-gays-strtod/

e

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Rick Regan
On Sun, Nov 28, 2010 at 5:52 PM, Doug Currie  wrote:

>
> There is a new publication on this subject that may be of interest to those
> looking at providing solutions:
>
> http://portal.acm.org/citation.cfm?id=1806623
>
> It (Grisu2) works without bignums if you are willing to settle for the
> shortest string in 99.8% of cases, and an accurate but not shortest string
> in the remaining cases.
>

Thanks for the reference. I wonder how it compares to David Gay's dtoa.c?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie

On Nov 28, 2010, at 5:37 PM, Rick Regan wrote:

> On Sun, Nov 28, 2010 at 4:01 PM, Doug Currie  wrote:
> 
>> On Nov 28, 2010, at 11:18 AM, Rick Regan wrote:
>> 
>>> Michael,
>>> Thanks for the very thorough analysis.
>> 
>> This is a difficult problem; fortunately it was solved 20 years ago...
>> 
>> Well, it's not solved on Windows. :)

There is a new publication on this subject that may be of interest to those 
looking at providing solutions:

http://portal.acm.org/citation.cfm?id=1806623

It (Grisu2) works without bignums if you are willing to settle for the shortest 
string in 99.8% of cases, and an accurate but not shortest string in the 
remaining cases.

e

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Rick Regan
On Sun, Nov 28, 2010 at 4:01 PM, Doug Currie  wrote:

> On Nov 28, 2010, at 11:18 AM, Rick Regan wrote:
>
> > Michael,
> > Thanks for the very thorough analysis.
>
> This is a difficult problem; fortunately it was solved 20 years ago...
>
>  Well, it's not solved on Windows. :)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Multilingual query

2010-11-28 Thread SQLumee SQLumee

Both answer was great, thanks a lot for your help Igor and Michael.
Regards, and thanks again

Date: Wed, 24 Nov 2010 07:10:58 -0600
From: michael.bla...@ngc.com
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Multilingual query

Depends on what he means by "first".
 
If alphabetically Igor's solution worksbut I'm not sure why you alphabetize 
singled query result like that.
 
If you want the first ones inserted into the table try this:
 
 
select * from table2 t1where t1.language = 'spanish' or not exists (select 1 
from table2 t2 where t2.id = t1.id and (t2.language = 'spanish' or t2.rowid < 
t1.rowid));
 
 
For this data
CREATE TABLE table2 (id integer, language text, title text, primary key (id, 
language));
INSERT INTO "table2" VALUES(1,'spanish','title1');
INSERT INTO "table2" VALUES(2,'english','title2');
INSERT INTO "table2" VALUES(3,'russian','title3');
INSERT INTO "table2" VALUES(3,'english','title3');
INSERT INTO "table2" VALUES(3,'spanish','title3');
INSERT INTO "table2" VALUES(2,'dutch','title2');
INSERT INTO "table2" VALUES(2,'danish','title2');
 
Igor's produces:
1|spanish|title1
3|spanish|title3
2|danish|title2
 
The rowid one produces:
1|spanish|title1
2|english|title2
3|spanish|title3
 
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 
 

 
From: sqlite-users-boun...@sqlite.org on behalf of Igor Tandetnik
Sent: Tue 11/23/2010 11:28 PM
To: sqlite-users@sqlite.org
Subject: EXTERNAL:Re: [sqlite] Multilingual query
 
 
 
SQLumee SQLumee  wrote:
> Hi all, I am trying to retrieve multilingual information from a table but I 
> don't know how to do this query.
>
> I have a table defined as:
> CREATE TABLE table2 (id integer, language text, title text, primary key (id, 
> language));
>
> What I want to retrieve are the rows with "spanish" titles or if there is no 
> spanish title available, select the title in the
> first language found.
 
Try this:
 
select * from table2 t1
where t1.language = 'spanish' or not exists (
select 1 from table2 t2
where t2.id = t1.id and (t2.language = 'spanish' or t2.language < 
t1.language)
);
 
Igor Tandetnik
 
___
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] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie
On Nov 28, 2010, at 11:18 AM, Rick Regan wrote:

> Michael,
> Thanks for the very thorough analysis.

This is a difficult problem; fortunately it was solved 20 years ago...

http://www.mail-archive.com/sqlite-users@sqlite.org/msg09529.html

e

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


Re: [sqlite] cascade-delete doesn't seem to work

2010-11-28 Thread Simon Slavin

On 28 Nov 2010, at 5:51pm, Chris Wolf wrote:

> Simon Slavin wrote:
>> Which version of SQLite are you using ?
> 
> It's 3.7.3 on MacOs 10.5  but I have two versions on my Mac - 3.4.0
> which comes out-of-the
> box and a dev version I'm hacking around with, 3.7.3.  I just forgot to
> qualify the shell name with "./".

Heh.  I win again.

> Sorry about that.  It works with 3.7.3 and pragma foreign_keys=on

You're doing it right.  I have found at least one thing in OS X 10.5 that 
upgrading the out-of-the-box version of SQLite breaks.  (I thought it would: I 
was testing it so I could write documentation.)  It's fixed in 10.6 but it 
seems the standard advice about SQLite and OS X is correct: keep two separate 
copies.

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


Re: [sqlite] cascade-delete doesn't seem to work

2010-11-28 Thread Chris Wolf


Simon Slavin wrote:
> On 28 Nov 2010, at 4:23pm, Chris Wolf wrote:
>
>   
>> Unfortunately, it's not deleting the child records.
>> 
>
> Which version of SQLite are you using ?
>   

It's 3.7.3 on MacOs 10.5  but I have two versions on my Mac - 3.4.0
which comes out-of-the
box and a dev version I'm hacking around with, 3.7.3.  I just forgot to
qualify the shell name with "./".

Sorry about that.  It works with 3.7.3 and pragma foreign_keys=on

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


Re: [sqlite] cascade-delete doesn't seem to work

2010-11-28 Thread Simon Slavin

On 28 Nov 2010, at 4:23pm, Chris Wolf wrote:

> Unfortunately, it's not deleting the child records.

Which version of SQLite are you using ?

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Rick Regan
BTW, I get the CORRECT result when running the precompiled command line on
Linux:

SQLite version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(d float);
sqlite> insert into t1 values(8.948471e15);
sqlite> select * from t1;
8.948471e+15
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] cascade-delete doesn't seem to work

2010-11-28 Thread Chris Wolf
I am trying to get child records to automatically delete upon deletion
of their parent record,
as described here:

http://www.sqlite.org/foreignkeys.html#fk_actions

Unfortunately, it's not deleting the child records.  Either with pragma
foreign_keys on or off.

Thanks for any help,

   -Chris

Here's the sample I'm working with:

drop table if exists artist;
CREATE TABLE artist(
  artistidINTEGER PRIMARY KEY,
  artistname  TEXT
);

drop table if exists track;
CREATE TABLE track(
  trackid INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) ON DELETE CASCADE
);

insert into artist (artistname) values('Dean Martin');
insert into artist (artistname) values('Frank Sinatra');
insert into track values(11, "That's Amore", 1);
insert into track values(12, "Christmes Blues", 1);
insert into track values(11, "My Way", 2);

delete from artist where artistid=2;

select * from track;
select '"My Way" should have been cascade-deleted.';

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Rick Regan
Michael,

Thanks for the very thorough analysis.

Yes, sorry, I forgot to state I was running on Windows. The results I got
came from running the command window (the precompiled Windows binary
sqlite-3_7_3.zip). I also got the same results from compiling the
amalgamation (sqlite-amalgamation-3_7_3.zip) using Visual Studio Express
2010.

I took that piece of code you highlighted and compiled and ran it standalone
under both Windows and Linux (gcc 4.4.3). I got the SAME results for each:
realvalue = 8.94847149 and 8.948471000103 at the two points you
mentioned. I didn't compile the amalgamation on Linux, nor did I use
optimizations -- maybe the difference lies in there?

BTW, when I traced the amalgamation on Windows for my example, this line of
code

for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}
has precision = 14, which suggests that the code is taking into account only
the part after the decimal point.

Here's the standalone code I tested (I hardcoded the values for my example,
plus added some printfs; one thing I wanted to check was that Windows and
gcc were converting the decimal literals to the same values):

#include 
int main(void)
{
 double realvalue = 8.948471e15;
 int  exp = 0, idx;
 double rounder;
printf ("1e32 = %.13a\n",1e32);
printf ("1e-32 = %.13a\n",1e-32);
printf ("1e8 = %.13a\n",1e8);
printf ("1e-8 = %.13a\n",1e-8);
while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; }
while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; }
while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }
while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; }
while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }
printf ("Realvalue = %.17g = %.13a\n",realvalue,realvalue);
for(idx=14, rounder=0.5; idx>0; idx--, rounder*=0.1){}
printf ("Rounder = %.17g = %.13a\n",rounder,rounder);
realvalue += rounder;
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
printf ("Realvalue = %.17g = %.13a\n",realvalue,realvalue);
}
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Black, Michael (IS)
There's a difference between GCC and MS Visual Studio 2008 Express.
 
GCC works fine.  But Visual Studio shows this problem.
 
The difference comes in this section of code where the rounding error during 
computation is different.
if( realvalue>0.0 ){

while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; }

while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; }

while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }

while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; }

while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }

}

Then it makes the mistake here in rounding

if( xtype!=etFLOAT ){

realvalue += rounder;

if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }

}

The first section rounds different when running the two of the while loops

Gcc ends up with 8.94847132

MS ends up with 8.94847149

Then the rounder takes them to

Gcc: 8.94847185

MS: 8.948471000103

So that's where your round error is.  I assume you're using a Microsoft product 
to compile?

 

I think the actual fix is to change the two %!.15g entries to %!.14g

It's a common misconception that double precision is 15 digits to the right of 
the decimal point.

That's incorrect.  It's 15 significant digits TOTAL regardless of the location 
of the decimal point.

By using 15g you're actually showing 16 significant digits and double-precision 
actually has 15.95 significant digits so you'll hit rounding errors with 16.

 

I find it interesting though that the math is different between the two 
compilers...I wonder which is actually "correct" ??

 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 



From: sqlite-users-boun...@sqlite.org on behalf of Rick Regan
Sent: Sat 11/27/2010 11:09 AM
To: sqlite-users@sqlite.org
Subject: EXTERNAL:[sqlite] Some floats of 15 digits or less do not round-trip



I expected floats of 15 significant decimal digits or less to round-trip:

sqlite> create table t1(d float);
sqlite> insert into t1 values(8.948471e15);
sqlite> select * from t1;
8.9484710001e+15

The double value stored in the database is correct (I traced the code and
printed the value of 'realvalue' in sqlite3VXPrintf()) -- it's
0x1.fca96433ce600p+52
= 111001010100101100111000011100110 = 89484710 =
8.948471e15. In other words, the original decimal to floating-point
conversion was done correctly, but the floating-point to decimal conversion
was not.

(This is different than the issue of bug
http://www.sqlite.org/src/tktview?name=1248e6cda8 .)

Rick Regan

--
Check out my blog: http://www.exploringbinary.com 
 
___
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] Question

2010-11-28 Thread Drake Wilson
Quoth Jason Dixon , on 2010-11-27 15:31:37 -0600:
> I was curious if there is a way to find out the cell number that a
> particular SMS file is from once I have identified the file in the backup
> folder on my computer.

This doesn't have anything directly to do with SQLite.  SQLite is only
a database engine that is used by many applications to store different
types of data.  You might go search for help related to the specific
handset software in use instead.

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


[sqlite] Question

2010-11-28 Thread Jason Dixon
Hello,

I was curious if there is a way to find out the cell number that a
particular SMS file is from once I have identified the file in the backup
folder on my computer.

Thank you so much.


Best,

Jason A. Dixon, MBA
Cell: 972.207.5118
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL file size

2010-11-28 Thread Yoni Londner
Hi,

 > For a large scale system you have a third choice: use some other RDBMS
 > which is implemented in one process and has a much better control over
 > its data and much better communication between readers and writers.
Well, I love sqlite, and I want to continue using it (small, fast, 
reliable ...).
I think it is better to solve such problems inside sqlite (Not to 
mention you don't need large scale system to reproduce this issue, 50 
lines of C code is enough).

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


[sqlite] Unable to make SQLite working with Java

2010-11-28 Thread Pierre Thibault
Hello,

I am unable to access an sqlite file in Groovy:

import java.sql.DriverManager
driverManager = Class.forName("java.sql.DriverManager").newInstance();
//Class.forName("org.sqlite.JDBC").newInstance(); // SQLite.JDBCDriver
org.sqlite.JDBC
print
DriverManager.getConnection("jdbc:sqlite:/media/pierreth-backup/work/web2py/applications/welcome/databases/storage.sqlite")

I have this error:

Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: no sqlite_jni in
java.library.path
Caught: java.sql.SQLException: java.lang.UnsatisfiedLinkError:
SQLite.Database.internal_init()V

But my class path is OK:

/usr/local/share/java/sqlite.jar:/opt/java/lib/sqlitejdbc-v056.jar

and java.library.path is /usr/local/lib  where I have libsqlite_jni.so.

Any idea?

-- 
A+

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