Commit graph

41 commits

Author SHA1 Message Date
Damien Elmes
55f4b9b7d0 favour integers, change due representation, fact&card ordering, more
- removed 'created' column from various tables. We don't care when things like
  models are created, and card creation time didn't reflect the actual time a
  card was created
- facts were previously ordered by their creation date. The code would
  manually set the creation time for subsequent facts on import by 0.0001
  seconds, and then card due times were set by adding the fact time to the
  ordinal number*0.000001. This was prone to error, and the number of zeros used
  was actually different in different parts of the code. Instead of this, we
  replace it with a 'pos' column on facts, which increments for each new fact.
- importing should add new facts with a higher pos, but concurrent updates in
  a synced deck can have multiple facts with the same pos

- due times are completely different now, and depend on the card type
- new cards have due=fact.pos or random(0, 10000)
- reviews have due set to an integer representing days since deck
  creation/download
- cards in the learn queue use an integer timestamp in seconds

- many columns like modified, lastSync, factor, interval, etc have been converted to
  integer columns. They are cheaper to store (large decks can save 10s of
  megabytes) and faster to search for.

- cards have their group assigned on fact creation. In the future we'll add a
  per-template option for a default group.

- switch to due/random order for the review queue on upgrade. Users can still
  switch to the old behaviour if they want, but many people don't care what
  it's set to, and due is considerably faster, which may result in a better
  user experience
2011-04-28 09:23:28 +09:00
Damien Elmes
9421a037f6 remove self explanatory module docstrings; strip trailing whitespace 2011-04-28 09:21:07 +09:00
Damien Elmes
4302306fe9 use a checksum for field values; fixed import->update number
Previously we had an index on the value field, which was very expensive for
long fields. Instead we use a separate column and take the first 8 characters
of the field value's md5sum, and index that. In decks with lots of text in
fields, it can cut the deck size by 30% or more, and many decks improve by
10-20%. Decks with only a few characters in fields may increase in size
slightly, but this is offset by the fact that we only generate a checksum for
fields that have uniqueness checking on.

Also, fixed import->update reporting the total # of available facts instead of
the number of facts that were imported.
2011-04-28 09:21:06 +09:00
Damien Elmes
b426ad4271 fix html comments in translator's patch 2011-02-01 18:57:44 +09:00
Damien Elmes
6071f8e209 include latex in alt tags of generated image 2011-01-26 13:01:12 +09:00
Damien Elmes
29a53b268f strip qt's rtl marker 2011-01-14 00:31:07 +09:00
Damien Elmes
4d2d9eab81 generate latex at fact modification, not review
- latex now slots in to the formatQA hook to render images in the q/a
- moved call() to utils
- cache/uncache latex have been obsoleted. User can delete manually, and
  images will be regenerated with a DB check
2010-12-11 01:40:49 +09:00
Damien Elmes
84b99b1ae5 don't allow tags to be prefixed with a colon, as this breaks sqlite 2010-11-26 03:49:01 +09:00
Damien Elmes
34d6efe1df marcus: handle html entities properly when stripping html 2010-10-27 20:12:00 +09:00
Damien Elmes
8ce0ff5b8b add a field cache for searching without html 2010-10-27 19:00:49 +09:00
Damien Elmes
ea3bf14019 if using no points of precision, take the floor 2010-10-26 12:54:58 +09:00
Damien Elmes
27694adf1a patch from Chris Burel, fix qt html rewriting on 4.6.1+ 2010-02-23 17:25:12 +09:00
Damien Elmes
ec263d0d63 if there is a period, always use the plural 2010-01-29 20:05:04 +09:00
Damien Elmes
9172c9b697 remove obsolete time span pair code 2010-01-29 19:28:38 +09:00
Damien Elmes
52be4b059d make short times i18n 2009-08-17 06:52:14 +09:00
Damien Elmes
a478e9af6b apply translation patch from piotr 2009-06-16 02:23:56 +09:00
Damien Elmes
d7961413b4 make sure to set card model id when creating cards, tweak code formatting 2009-06-06 01:09:08 +09:00
Damien Elmes
b136e505b0 strip <style> tags as well 2009-06-04 07:07:49 +09:00
Damien Elmes
4b3532f3eb on python2.4, fall back to non-localized strings 2009-03-29 03:52:49 +09:00
Susanna Björverud
f4adc657bd Added fmtFloat def 2009-03-25 11:20:42 +01:00
Susanna Björverud
dfb477ec4b new def to format percentages with current locale decimal point 2009-03-25 11:02:50 +09:00
Damien Elmes
eed5df1038 use format_string() 2009-03-24 09:05:35 +09:00
Damien Elmes
9fba248489 fix locale.format location 2009-03-24 08:52:53 +09:00
Damien Elmes
1648d254d6 format decimals using locale 2009-03-24 08:38:29 +09:00
Damien Elmes
1098bb1c5c make fmtTimeSpan strings translatable 2009-03-23 10:48:28 +09:00
Damien Elmes
d127ae4175 separate tags with spaces 2009-02-08 03:13:37 +09:00
Damien Elmes
6ce63b4889 fix plural definition 2009-01-04 11:57:41 +09:00
Damien Elmes
feb0acf52c don't remove leading/trailing whitespace 2008-12-23 18:39:14 +09:00
Damien Elmes
6434d5c03e don't collapse multiple spaces 2008-12-23 18:38:54 +09:00
Damien Elmes
21b59408cd refactor features to use hooks, update stdmodels, update findTags()
- remove description from fields, cards and models
- remove features and use field names instead
2008-12-03 19:22:15 +09:00
Damien Elmes
cd64b0db9e add user tags list, sort tags in canonify 2008-11-28 18:53:04 +09:00
Damien Elmes
8f983d5bcc always keep as unicode 2008-11-21 23:41:14 +09:00
Damien Elmes
90487d86ad remove obsolete code 2008-11-21 20:24:23 +09:00
Damien Elmes
c4d30a20d9 remove mergeTags() 2008-11-21 00:22:23 +09:00
Damien Elmes
b2d0e5d3df wip 2008-11-07 18:44:49 +09:00
Damien Elmes
c130dac060 temporarily disable history, add canonifyTags 2008-10-19 18:46:05 +09:00
Damien Elmes
12e4953dc9 add short interval alternatives 2008-10-16 00:02:34 +09:00
Damien Elmes
b0ad2be961 use unicode tags, don't go under 0 in sync timestamp 2008-10-12 04:46:14 +09:00
Damien Elmes
23379cd600 get rid of 'deck is empty message' 2008-10-12 00:19:58 +09:00
Damien Elmes
21bce8192b add id de(coding) 2008-10-08 01:18:03 +09:00
Damien Elmes
5da3a0f5d3 initial commit from hg 2008-09-27 23:50:03 +09:00