Troubleshooting » History » Version 3

Marcus Pearce, 2016-04-18 11:27 AM

1 1 Marcus Pearce
h1. Troubleshooting
2 1 Marcus Pearce
3 2 Marcus Pearce
{{>toc}}
4 2 Marcus Pearce
5 1 Marcus Pearce
h2. Editing text files
6 1 Marcus Pearce
7 1 Marcus Pearce
If you use a text editor like Textedit (on MacOS) to edit lisp code (e.g., in the <code>.sbclrc</code> or <code>.emacs</code> files), it can insert non-ascii characters for things like curved quotation marks (smart quotes) which won't work. This is one reason (of many) to use Emacs as an editor. You never know, you might find you like it!
8 1 Marcus Pearce
9 1 Marcus Pearce
h2. Using SBCL within Emacs
10 1 Marcus Pearce
11 3 Marcus Pearce
SBCL can be used in a terminal window (simply type 'sbcl') but programming this way is tiresome (e.g., SBCL will not expand '~' into your home directory, give you access to previous commands, give you keyboard shortcuts for compiling files etc.). It is much, much easier to use lisp from within Emacs, which provides an Integrated Development Environment (IDE) for Lisp.
12 3 Marcus Pearce
13 1 Marcus Pearce
Used within Emacs, SBCL will do pathname completion (using TAB) and expansion of "~" into your home directory and other useful things. You can also get previous commands easily.
14 1 Marcus Pearce
15 1 Marcus Pearce
See "here":http://common-lisp.net/project/slime/ for more on Slime, the Emacs library which achieves this (it is automatically installed by Quicklisp).
16 1 Marcus Pearce
17 1 Marcus Pearce
h2. The lisp debugger
18 1 Marcus Pearce
19 1 Marcus Pearce
If you find yourself with something like this:
20 1 Marcus Pearce
21 1 Marcus Pearce
<pre>
22 1 Marcus Pearce
* (/ 1 0)
23 1 Marcus Pearce
24 1 Marcus Pearce
debugger invoked on a DIVISION-BY-ZERO:
25 1 Marcus Pearce
  arithmetic error DIVISION-BY-ZERO signalled
26 1 Marcus Pearce
Operation was SB-KERNEL::DIVISION, operands (1 0).
27 1 Marcus Pearce
28 1 Marcus Pearce
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
29 1 Marcus Pearce
30 1 Marcus Pearce
restarts (invokable by number or by possibly-abbreviated name):
31 1 Marcus Pearce
  0: [ABORT] Exit debugger, returning to top level.
32 1 Marcus Pearce
33 1 Marcus Pearce
(SB-KERNEL::INTEGER-/-INTEGER 1 0)
34 1 Marcus Pearce
0] 
35 1 Marcus Pearce
</pre>
36 1 Marcus Pearce
37 1 Marcus Pearce
Then you have typed something that lisp doesn't like. Be sure to read the information and the restart options and enter the appropriate restart number - usually this is the one labelled <code>[ABORT]</code> but, depending on the situation, <code>[CONTINUE]</code> may also be useful.
38 2 Marcus Pearce
39 2 Marcus Pearce
h2. Removing cached long-term models and resampling configurations
40 2 Marcus Pearce
41 2 Marcus Pearce
If you have changed the data corresponding to a given dataset id, then you will need to regenerate the cached resampling configuration and long-term models. The easiest way to do this is simply to delete the old files, as they will be regenerated on the next run. The cached long-term models are stored in the directory <code>~/idyom/data/models/</code> while the resampling sets are stored in <code>~/idyom/data/models</code>. Remember to save your resampling sets if you ever want to recreate exactly the same results as the data are randomly assigned to different folds in n-fold cross-validation when the resampling set is generated.
42 1 Marcus Pearce
43 1 Marcus Pearce
h2. Updating or reinstalling IDyOM
44 1 Marcus Pearce
45 1 Marcus Pearce
To update IDyOM simply remove the previously installation from the <code>.../quicklisp/local-projects/</code> directory and unzip the new version. Then restart Emacs/SBCL/IDyOM as described above.
46 1 Marcus Pearce
47 1 Marcus Pearce
h2. Using different SQL database systems
48 1 Marcus Pearce
49 1 Marcus Pearce
You may use different kinds of databases. For example, to create an SQLite database called 'example.db' in directory <code>DIR</code>:
50 1 Marcus Pearce
51 1 Marcus Pearce
<pre>
52 1 Marcus Pearce
(clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3)
53 1 Marcus Pearce
</pre>
54 1 Marcus Pearce
55 1 Marcus Pearce
Alternatively, to connect to an existing local MySQL database:
56 1 Marcus Pearce
57 1 Marcus Pearce
<pre>
58 1 Marcus Pearce
(clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql)
59 1 Marcus Pearce
</pre>
60 1 Marcus Pearce
61 1 Marcus Pearce
See the "CLSQL documentation":http://clsql.b9.com/manual/ for more on "connect":http://clsql.b9.com/manual/connect.html and "supported databases":http://clsql.b9.com/manual/prerequisites.html#idp8251808.
62 1 Marcus Pearce
63 1 Marcus Pearce
h2. Problems loading foreign database libraries:
64 1 Marcus Pearce
65 1 Marcus Pearce
Depending on how your system is configured, <code>clsql:connect</code> may give a "Couldn't load foreign libraries" error.  In this case, you
66 3 Marcus Pearce
need to "tell CLSQL where it can find these libraries":http://clsql.kpe.io/manual/appendix.html#foreignlibs, e.g.
67 1 Marcus Pearce
68 1 Marcus Pearce
<pre>
69 1 Marcus Pearce
(clsql:push-library-path "/usr/local/mysql/lib/")
70 1 Marcus Pearce
</pre>
71 1 Marcus Pearce
72 3 Marcus Pearce
The exact path will depend on your system.  Note that, for some database installations these libraries may not have been installed, and you should consult the database documentation. See also the following post on Stack Overflow: 
73 3 Marcus Pearce
74 3 Marcus Pearce
http://stackoverflow.com/questions/9430575/clsql-on-centos-installation