Troubleshooting » History » Version 2

Marcus Pearce, 2014-11-10 06:43 PM

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 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.
12 1 Marcus Pearce
13 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).
14 1 Marcus Pearce
15 1 Marcus Pearce
h2. The lisp debugger
16 1 Marcus Pearce
17 1 Marcus Pearce
If you find yourself with something like this:
18 1 Marcus Pearce
19 1 Marcus Pearce
<pre>
20 1 Marcus Pearce
* (/ 1 0)
21 1 Marcus Pearce
22 1 Marcus Pearce
debugger invoked on a DIVISION-BY-ZERO:
23 1 Marcus Pearce
  arithmetic error DIVISION-BY-ZERO signalled
24 1 Marcus Pearce
Operation was SB-KERNEL::DIVISION, operands (1 0).
25 1 Marcus Pearce
26 1 Marcus Pearce
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
27 1 Marcus Pearce
28 1 Marcus Pearce
restarts (invokable by number or by possibly-abbreviated name):
29 1 Marcus Pearce
  0: [ABORT] Exit debugger, returning to top level.
30 1 Marcus Pearce
31 1 Marcus Pearce
(SB-KERNEL::INTEGER-/-INTEGER 1 0)
32 1 Marcus Pearce
0] 
33 1 Marcus Pearce
</pre>
34 1 Marcus Pearce
35 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.
36 2 Marcus Pearce
37 2 Marcus Pearce
h2. Removing cached long-term models and resampling configurations
38 2 Marcus Pearce
39 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.
40 1 Marcus Pearce
41 1 Marcus Pearce
h2. Updating or reinstalling IDyOM
42 1 Marcus Pearce
43 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.
44 1 Marcus Pearce
45 1 Marcus Pearce
h2. Using different SQL database systems
46 1 Marcus Pearce
47 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>:
48 1 Marcus Pearce
49 1 Marcus Pearce
<pre>
50 1 Marcus Pearce
(clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3)
51 1 Marcus Pearce
</pre>
52 1 Marcus Pearce
53 1 Marcus Pearce
Alternatively, to connect to an existing local MySQL database:
54 1 Marcus Pearce
55 1 Marcus Pearce
<pre>
56 1 Marcus Pearce
(clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql)
57 1 Marcus Pearce
</pre>
58 1 Marcus Pearce
59 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.
60 1 Marcus Pearce
61 1 Marcus Pearce
h2. Problems loading foreign database libraries:
62 1 Marcus Pearce
63 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
64 1 Marcus Pearce
need to "tell CLSQL where it can find these libraries":http://clsql.b9.com/manual/appendix.html#foreignlibs, e.g.
65 1 Marcus Pearce
66 1 Marcus Pearce
<pre>
67 1 Marcus Pearce
(clsql:push-library-path "/usr/local/mysql/lib/")
68 1 Marcus Pearce
</pre>
69 1 Marcus Pearce
70 1 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.