Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Sqlite3 - INSERT statement question (Brent Yorgey) 2. Re: Can't find or open a Sqlite3 database inWindows Vista (Patrick Lynch) 3. Re: Can't find or open a Sqlite3 database inWindows Vista (Daniel Fischer) 4. Re: Lujvo forming with cmavo rafsi (Alex Rozenshteyn) 5. Re: Can't find or open a Sqlite3 database inWindows Vista (Patrick Lynch) ---------------------------------------------------------------------- Message: 1 Date: Thu, 3 Feb 2011 12:25:36 -0500 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] Sqlite3 - INSERT statement question To: beginners@haskell.org Message-ID: <20110203172535.ga14...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Thu, Feb 03, 2011 at 12:20:12PM -0500, Patrick Lynch wrote: > Good morning, > > I'm using "Real World Haskell" and a Windows Vista PC and I have Sqlite3 > installed...[note: I had to change test1.db to /users/user/test1.db in order > to get this to work, otherwise, neither the database nor the table could be > created -- also, note c:/users/user/test1.db gives a syntax error], ghci > doesn't like c:/]: > > I tried to use the following example from the book but it failed...see > following: > > Prelude> :m Database.HDBC Database.HDBC.Sqlite3 > Prelude Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 > "/users/user/test1.db" > ... > Prelude Database.HDBC Database.HDBC.Sqlite3> run conn "INSERT INTO test > VALUES (?, ?)" [toSql 0, toSql "zero"] > > <interactive>:1:43: > No instance for (Data.Convertible.Base.Convertible t SqlValue) > arising from a use of `toSql' at <interactive>:1:43-49 > Possible fix: > add an instance declaration for > (Data.Convertible.Base.Convertible t SqlValue) > In the expression: toSql 0 > In the third argument of `run', namely `[toSql 0, toSql "zero"]' > In the expression: > run conn "INSERT INTO test VALUES (?, ?)" [toSql 0, toSql > "zero"] I think the problem is that 0 is polymorphic, so GHC does not know what type you want it to have, but its type determines which Convertible instance is chosen. It should work if you put a type signature on the 0, like toSql (0 :: Int) or toSql (0 :: Integer) or whatever. -Brent ------------------------------ Message: 2 Date: Thu, 03 Feb 2011 13:01:41 -0500 From: "Patrick Lynch" <kmandpjly...@verizon.net> Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista To: "Patrick Lynch" <kmandpjly...@verizon.net>, <beginners@haskell.org> Message-ID: <30FEB635F1964258BBE4366CC75017F6@UserPC> Content-Type: text/plain; charset="iso-8859-1" ...oh dear, guess what -- I told you a lie...ghci does except either c:/users/user/test1.db or /users/user/test1.db but not the Windows folder separator of backslash '\'...please see following: ...this works: Prelude Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 "c:/users/user/test1.db" Prelude Database.HDBC Database.HDBC.Sqlite3> ...so does this: Prelude Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 "/users/user/test1.db" Prelude Database.HDBC Database.HDBC.Sqlite3> ...this doesn't work, note the back slash...also, this will only work, that is to create the database automatically and then subsquently create a table, if you user the 'users' folder...if you use 'program files, etal' you will not be able to create the database...bummer: Prelude Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 "c:\users\user\test1.db" <interactive>:1:27: lexical error in string/character literal at character 'u' ---- Original Message ----- From: Patrick Lynch To: Patrick Lynch ; beginners@haskell.org Sent: Thursday, February 03, 2011 11:24 AM Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista ...this seems to work: ghci> conn <- connectSqlite3 "/users/user/test1.db" ...this allows me to create a database in this directory, named test1.db, and then I can create a table in this database... ...I'm now working on writing some queries... ...wish me luck ----- Original Message ----- From: Patrick Lynch To: Kathleen Lynch ; beginners@haskell.org Sent: Thursday, February 03, 2011 10:08 AM Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista ...could this be the problem...in Windows Vista I cannot change the file name in the directory c:\Program Files (x86)\Haskell Platform\2010.2.0.0\winghci but can change it in c:\users\user directory... ...> ren "c:\Program Files (x86)\Haskell Platform\2010.2.0.0\winghci\test1.db" test2.db Access is denied. ...but I can see the contents of this file: ...> type test1.db hello, world! ...is it possible to specify the directory c:\users\user in ghci so that Sqlite3 will look there to open the database and then to create a table in it? Good day ----- Original Message ----- From: Kathleen Lynch To: beginners@haskell.org Sent: Wednesday, February 02, 2011 5:28 PM Subject: [Haskell-beginners] Can't find or open a Sqlite3 database in Windows Vista ...seems like I 'kicked over another bee hive'...plenty of messages in regard to this when you do google search--->[sqlite3.operational error unable to open database file in windows vista] ...i'm getting the following error messages when I try to create a database in Sqlite3: *Sandbox> dbh <- connect "poddbtest.db" *** Exception: SqlError {seState = "", seNativeError = 21, seErrorMsg = "prepare 6: BEGIN: unable to open database file"} *Sandbox> dbh <- connect "test1.db" *** Exception: SqlError {seState = "", seNativeError = 1, seErrorMsg = "step: SQL logic error or missing database"} Both come from Chapters 21 and 22 in "Real World Haskell" I can't invoke Sqlite3 from the command line using---> Sqlite3 myDatabase.db... I created blank files in folder C:\Program Files (x86)\Haskell Platform\2010.2.0.0\winghci -- seemed to get me a bit further along...at least I was able to connect... Is it possible to specify the folder that the database should be created in? Is it possible to run Sqlite3 from the command line - when it has been installed using the Haskell wiki? Has anyone had better success with MySql - I've used it in the past and it was very reliable? Thank you -------------------------------------------------------------------------- _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110203/778988af/attachment-0001.htm> ------------------------------ Message: 3 Date: Thu, 3 Feb 2011 19:39:24 +0100 From: Daniel Fischer <daniel.is.fisc...@googlemail.com> Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista To: beginners@haskell.org Message-ID: <201102031939.24443.daniel.is.fisc...@googlemail.com> Content-Type: text/plain; charset="utf-8" On Thursday 03 February 2011 19:01:41, Patrick Lynch wrote: > ...this doesn't work, note the back slash...also, this will only work, > that is to create the database automatically and then subsquently create > a table, if you user the 'users' folder...if you use 'program files, > etal' you will not be able to create the database...bummer: Prelude > Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 > "c:\users\user\test1.db" <interactive>:1:27: > ? ? ? ?lexical error in string/character literal at character 'u' The backslash is the escape marker, so if you want a backslash in a String, you have to escape it (as written, it tries to interpret the escape sequence '\u', which doesn't exist). Try with "c:\\users\\user\\test1.db" ------------------------------ Message: 4 Date: Thu, 3 Feb 2011 13:45:07 -0500 From: Alex Rozenshteyn <rpglove...@gmail.com> Subject: Re: [Haskell-beginners] Lujvo forming with cmavo rafsi Cc: beginners@haskell.org Message-ID: <AANLkTi=3gcxt7tc567t6ma6iyahc+9ndjzmprrjpf...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" ki'asai On Thu, Feb 3, 2011 at 12:10 PM, Brent Yorgey <byor...@seas.upenn.edu>wrote: > On Thu, Feb 03, 2011 at 11:52:13AM -0500, Alex Rozenshteyn wrote: > > Specifically, I want to form a lujvo meaning "omnicide" (to ta'o this is > due > > to the tvtropes trope "Omnicidal Maniac" ta'onai toi). {ro zei catra} or > > {rolcatra} seems to be wrong. > > > > {ro zei se catra} seems like it's all the victims, so maybe > selrolselcatra? > > > > I'm not quite clear on what it means to be a lujvo if you don't have a > tanru > > as the basis. > > Me neither. You probably need to use zygohistomorphic prepromorphisms. > > -Brent > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > -- Alex R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110203/50c10a7a/attachment-0001.htm> ------------------------------ Message: 5 Date: Thu, 03 Feb 2011 13:49:52 -0500 From: "Patrick Lynch" <kmandpjly...@verizon.net> Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista To: "Daniel Fischer" <daniel.is.fisc...@googlemail.com>, <beginners@haskell.org> Message-ID: <AD4B739D1E574740ACFFAF7BE1F148DA@UserPC> Content-Type: text/plain; format=flowed; charset=UTF-8; reply-type=original oh dear, i never thought of that - thanks... ----- Original Message ----- From: "Daniel Fischer" <daniel.is.fisc...@googlemail.com> To: <beginners@haskell.org> Cc: "Patrick Lynch" <kmandpjly...@verizon.net> Sent: Thursday, February 03, 2011 1:39 PM Subject: Re: [Haskell-beginners] Can't find or open a Sqlite3 database inWindows Vista On Thursday 03 February 2011 19:01:41, Patrick Lynch wrote: > ...this doesn't work, note the back slash...also, this will only work, > that is to create the database automatically and then subsquently create > a table, if you user the 'users' folder...if you use 'program files, > etal' you will not be able to create the database...bummer: Prelude > Database.HDBC Database.HDBC.Sqlite3> conn <- connectSqlite3 > "c:\users\user\test1.db" <interactive>:1:27: > lexical error in string/character literal at character 'u' The backslash is the escape marker, so if you want a backslash in a String, you have to escape it (as written, it tries to interpret the escape sequence '\u', which doesn't exist). Try with "c:\\users\\user\\test1.db" ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 32, Issue 7 ****************************************