diff options
author | Anthony Wang | 2023-12-29 16:16:25 -0600 |
---|---|---|
committer | Anthony Wang | 2023-12-29 16:16:25 -0600 |
commit | 97722764e82b3748a6ec60574fd3d3752048c101 (patch) | |
tree | 61b6fe63c227693ee407d146f683d375e3df6414 /README.md | |
parent | 63f04f004110ecabfb5ec32408e77055a62a9122 (diff) |
Add command for creating table in README, add fish helper scripts
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4,7 +4,9 @@ This is a C port of [SD](https://git.exozy.me/a/SD), a very efficient (and a tin ## Usage -Flash cards are stored in the `cards` table of a SQLite database. There are four columns: `idx INTEGER PRIMARY KEY, weight INTEGER, key STRING, val STRING`. The `idx` is a unique index for each card, starting at 0. The weight is how often the card should come up. The key and value are the front and reverse sides of the card. You can use the `sqlite3` CLI to create a card deck. You may be able to get twice as fast performance by enabling WAL with `PRAGMA journal_mode=WAL` because WAL only writes the content once instead of twice. +Flash cards are stored in the `cards` table of a SQLite database. There are four columns: `idx INTEGER PRIMARY KEY, weight INTEGER, key STRING, val STRING`. The `idx` is a unique index for each card, starting at 0. The weight is how often the card should come up. The key and value are the front and reverse sides of the card. + +To create a card deck, use `sqlite3 cards "CREATE TABLE cards (idx INTEGER PRIMARY KEY, weight INTEGER, key STRING, val STRING)`. You may be able to get twice as fast performance by enabling WAL with `PRAGMA journal_mode=WAL` because WAL only writes the content once instead of twice. Now build this project with `gcc sd.c segmenttree.c -o sd -lsqlite3 -O2 -march=native` and run `./sd` to enjoy a fast flash cards experience! The program will display the `key` of a randomly selected card. Press any key to show the `val` of the card. Now press either `y` or `n` depending on whether you got the card correct, and the program adjusts that card's weight. |