Hacking the Mnemosyne databse

113 views
Skip to first unread message

Marcin M.

unread,
Sep 1, 2014, 10:06:19 AM9/1/14
to mnemosyne-...@googlegroups.com
Sometimes, when I misgrade a card, the next repetition is in several months. To fix it I thought about editing the SQLite database Mnemosyne uses.

What changes should be done to do a full regrade a card using a SQLite database browser. I can change the `grade` property but what to do with the `next rep` property? Are there any other card's properties to be changed?

Peter Bienstman

unread,
Sep 1, 2014, 10:27:30 AM9/1/14
to mnemosyne-...@googlegroups.com
Sorry, I really don't recommend manually changing the internals of the database, as this risks causing corruption and hard to debug problems later.

An 'undo' feature is on my todo list, though.

Peter
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/42fa1f43-e198-
> 417c-9163-34ded819f886%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/42fa1f43-
> e198-417c-9163-
> 34ded819f886%40googlegroups.com?utm_medium=email&utm_source=foo
> ter> .
> For more options, visit https://groups.google.com/d/optout.


Marcin M.

unread,
Sep 1, 2014, 11:14:17 AM9/1/14
to mnemosyne-...@googlegroups.com
So what's the recommended way of handling such cases until undo is implemented? 5 months (my case) is a lot.


On Monday, September 1, 2014 4:27:30 PM UTC+2, Peter Bienstman wrote:
Sorry, I really don't recommend manually changing the internals of the database, as this risks causing corruption and hard to debug problems later.

An 'undo' feature is on my todo list, though.

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Marcin M.
> Sent: 01 September 2014 16:06
> To: mnemosyne-...@googlegroups.com
> Subject: [mnemosyne-proj-users] Hacking the Mnemosyne databse
>
> Sometimes, when I misgrade a card, the next repetition is in several months.
> To fix it I thought about editing the SQLite database Mnemosyne uses.
>
> What changes should be done to do a full regrade a card using a SQLite
> database browser. I can change the `grade` property but what to do with the
> `next rep` property? Are there any other card's properties to be changed?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Peter Bienstman

unread,
Sep 1, 2014, 11:51:13 AM9/1/14
to mnemosyne-...@googlegroups.com
I'm afraid the recommended way for the moment is paying attention when you grade..
> > email to mnemosyne-proj-u...@googlegroups.com
> <javascript:> .
> > To post to this group, send email to mnemosyne-proj-
> > us...@googlegroups.com <javascript:> .
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43-e198- <https://groups.google.com/d/msgid/mnemosyne-
> proj-users/42fa1f43-e198->
> > 417c-9163-34ded819f886%40googlegroups.com
> <http://40googlegroups.com>
> > <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43- <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43->
> > e198-417c-9163-
> >
> 34ded819f886%40googlegroups.com?utm_medium=email&utm_source=foo
> <http://40googlegroups.com?utm_medium=email&utm_source=foo>
> > ter> .
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/5bd857ba-
> fda6-485d-9a03-73a0ab87d5dd%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/5bd857ba-
> fda6-485d-9a03-
> 73a0ab87d5dd%40googlegroups.com?utm_medium=email&utm_source=fo
> oter> .

Marcin M.

unread,
Sep 1, 2014, 12:34:16 PM9/1/14
to mnemosyne-...@googlegroups.com
Impossible if you have lots of cards and the majority is well-known to you. ;)

And as for hacking the database. If one would only set the grades to 0/1 and next rep to some value (don't know which) and did nothing else in the db, would it be safe?
>         > email to mnemosyne-proj-users+unsub...@googlegroups.com
> <javascript:> .
>         > To post to this group, send email to mnemosyne-proj-
>         > us...@googlegroups.com <javascript:> .
>         > To view this discussion on the web visit
>         > https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43-e198- <https://groups.google.com/d/msgid/mnemosyne-
> proj-users/42fa1f43-e198->
>         > 417c-9163-34ded819f886%40googlegroups.com
> <http://40googlegroups.com>
>         > <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43- <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/42fa1f43->
>         > e198-417c-9163-
>         >
> 34ded819f886%40googlegroups.com?utm_medium=email&utm_source=foo
> <http://40googlegroups.com?utm_medium=email&utm_source=foo>
>         > ter> .
>         > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Peter Bienstman

unread,
Sep 1, 2014, 11:32:42 PM9/1/14
to mnemosyne-...@googlegroups.com
No, you would mess up the sync protocol...

Peter

Marcin M.

unread,
Sep 2, 2014, 9:27:54 AM9/2/14
to mnemosyne-...@googlegroups.com
And what if such thing has been already done before posting? :)

Michael Campbell

unread,
Sep 2, 2014, 11:38:12 AM9/2/14
to mnemosyne-proj-users

There is no solution that is perfect nor one that can't be given a case that makes it unworkable so coming up with edge cases is not terribly useful at this point.

Nor would I agree that paying attention when you grade is impossible regardless of your deck quantity.

That said I would also like an undo feature since I make the occasional mistake also.  But my deck is not so sacred that a mistake warrants a database hacking.  If I see the card in 5 months vs 3 vs 1 day...eh.  Sozusagen. Shrug.

As always your mileage may vary.

To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
To post to this group, send email to mnemosyne-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/05b5a730-26de-4aab-a6e4-4e462eb526c7%40googlegroups.com.

Peter Bienstman

unread,
Sep 2, 2014, 12:30:53 PM9/2/14
to mnemosyne-...@googlegroups.com
Then I will not be able to help you if you run into sync problems...

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Marcin M.
> Sent: 02 September 2014 15:28
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] Hacking the Mnemosyne databse
>
> And what if such thing has been already done before posting? :)
>
> On Tuesday, September 2, 2014 5:32:42 AM UTC+2, Peter Bienstman wrote:
>
> No, you would mess up the sync protocol...
>
> Peter
>
>
> On September 1, 2014 6:34:16 PM CEST, "Marcin M."
> users+un...@googlegroups.com
> > <javascript:> .
> > > To post to this group, send email to
> mnemosyne-proj-
> > > us...@googlegroups.com <javascript:> .
> > > To view this discussion on the web visit
> > >
> https://groups.google.com/d/msgid/mnemosyne-proj-
> <https://groups.google.com/d/msgid/mnemosyne-proj->
> > users/42fa1f43-e198-
> <https://groups.google.com/d/msgid/mnemosyne-
> <https://groups.google.com/d/msgid/mnemosyne->
> > proj-users/42fa1f43-e198->
> > > 417c-9163-
> 34ded819f886%40googlegroups.com <http://40googlegroups.com>
> > <http://40googlegroups.com>
> > >
> <https://groups.google.com/d/msgid/mnemosyne-proj-
> <http://40googlegroups.com?utm_medium=email&utm_source=foo
> <http://40googlegroups.com?utm_medium=email&utm_source=foo> >
> > > ter> .
> > > For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> > .
> >
> >
> >
> >
> > --
> > You received this message because you are
> subscribed to the Google Groups
> > "mnemosyne-proj-users" group.
> > To unsubscribe from this group and stop receiving
> emails from it, send an
> > email to mnemosyne-proj-
> users+un...@googlegroups.com.
> > To post to this group, send email to mnemosyne-
> proj-
> > us...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/mnemosyne-
> proj-users/5bd857ba- <https://groups.google.com/d/msgid/mnemosyne-
> proj-users/5bd857ba->
> > fda6-485d-9a03-
> 73a0ab87d5dd%40googlegroups.com <http://40googlegroups.com>
> > <https://groups.google.com/d/msgid/mnemosyne-
> proj-users/5bd857ba- <https://groups.google.com/d/msgid/mnemosyne-
> proj-users/5bd857ba->
> > fda6-485d-9a03-
> >
> 73a0ab87d5dd%40googlegroups.com?utm_medium=email&utm_source=fo
> <http://40googlegroups.com?utm_medium=email&utm_source=fo>
> > oter> .
> > For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/05b5a730-
> 26de-4aab-a6e4-4e462eb526c7%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/05b5a730-
> 26de-4aab-a6e4-
> 4e462eb526c7%40googlegroups.com?utm_medium=email&utm_source=foo
> ter> .
> For more options, visit https://groups.google.com/d/optout.


Oisín

unread,
Sep 2, 2014, 6:32:02 PM9/2/14
to mnemosyne-...@googlegroups.com
Would exporting and re-importing the deck at this point sidestep the potential sync issues?


Peter Bienstman

unread,
Sep 3, 2014, 3:37:55 AM9/3/14
to mnemosyne-...@googlegroups.com
Not really, I'm afraid...

For obvious reasons, tinkering with the database without going through the libmnemosyne API is Mnemosyne's equivalent of 'warranty void when opened'...

Kind regards,
> <mailto:users%2Bunsu...@googlegroups.com>
> <mailto:users%2Bunsu...@googlegroups.com> .
> <mailto:mnemosyne-proj-users%2Bunsu...@googlegroups.com> .
> > To post to this group, send email to mnemosyne-proj-
>
> > us...@googlegroups.com.
>
> > To view this discussion on the web visit
>
> > https://groups.google.com/d/msgid/mnemosyne-proj-
> users/05b5a730-
> > 26de-4aab-a6e4-4e462eb526c7%40googlegroups.com
> > <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/05b5a730-
> > 26de-4aab-a6e4-
> >
> 4e462eb526c7%40googlegroups.com?utm_medium=email&utm_source=foo
> > ter> .
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to mnemosyne-proj-u...@googlegroups.com
> <mailto:mnemosyne-proj-users%2Bunsu...@googlegroups.com> .
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/007b01cfc6cb%243f5835c0%24be08a140%24%40UGent.be.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/CAO-
> 0pXDk0DKQiWn%2Bq31q5hZu%3Dca%2BA8wGWvz8ZNS-
> P6sZBz2_QA%40mail.gmail.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/CAO-
> 0pXDk0DKQiWn%2Bq31q5hZu%3Dca%2BA8wGWvz8ZNS-
> P6sZBz2_QA%40mail.gmail.com?utm_medium=email&utm_source=footer> .

Marcin M.

unread,
Sep 3, 2014, 10:52:27 AM9/3/14
to mnemosyne-...@googlegroups.com
And deleting and readding the affected cards?

Would it be possible to modify the grade by a python script importing libmnemosyne?
>         > email to mnemosyne-proj-users+unsub...@googlegroups.com
> <mailto:mnemosyne-proj-users%2Bunsu...@googlegroups.com> .
>         > To post to this group, send email to mnemosyne-proj-
>
>         > us...@googlegroups.com.
>
>         > To view this discussion on the web visit
>
>         > https://groups.google.com/d/msgid/mnemosyne-proj-
> users/05b5a730-
>         > 26de-4aab-a6e4-4e462eb526c7%40googlegroups.com
>         > <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/05b5a730-
>         > 26de-4aab-a6e4-
>         >
> 4e462eb526c7%40googlegroups.com?utm_medium=email&utm_source=foo
>         > ter> .
>
>         > For more options, visit https://groups.google.com/d/optout.
>
>
>         --
>         You received this message because you are subscribed to the Google
> Groups "mnemosyne-proj-users" group.
>         To unsubscribe from this group and stop receiving emails from it,
> <mailto:mnemosyne-proj-users%2Bunsu...@googlegroups.com> .
>         To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
>
>         To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/007b01cfc6cb%243f5835c0%24be08a140%24%40UGent.be.
>
>         For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Peter Bienstman

unread,
Sep 3, 2014, 11:02:16 AM9/3/14
to mnemosyne-...@googlegroups.com


> -----Original Message-----
> And deleting and readding the affected cards?

Would work, but the effects on your reviewing effort from starting these cards again would probably be bigger than just ignoring the fact that you accidentally misgraded a card.

> Would it be possible to modify the grade by a python script importing
> libmnemosyne?

There is a function to grade a card, but the idea is that you use that function around the time the card is scheduled. For undoing wrong grades, I need to write a new function which just undoes the latest changes.

Hope this helps,

Peter


> On Wednesday, September 3, 2014 9:37:55 AM UTC+2, Peter Bienstman
> wrote:
>
> Not really, I'm afraid...
>
> For obvious reasons, tinkering with the database without going
> through the libmnemosyne API is Mnemosyne's equivalent of 'warranty void
> when opened'...
>
> Kind regards,
>
> Peter
>
> > -----Original Message-----
> > From: mnemosyne-...@googlegroups.com <javascript:>
> [mailto:mnemosyne- <javascript:>
> > proj-...@googlegroups.com <javascript:> ] On Behalf Of Oisín
> > Sent: 03 September 2014 00:32
> > To: mnemosyne-...@googlegroups.com <javascript:>
> > Subject: Re: [mnemosyne-proj-users] Hacking the Mnemosyne
> databse
> >
> > Would exporting and re-importing the deck at this point sidestep
> the
> > potential sync issues?
> >
> >
> >
> > On 2 September 2014 17:30, Peter Bienstman <Peter.B...@ugent.be
> <javascript:> >
> > > users+un...@googlegroups.com <javascript:>
> > <mailto:users%2Bu...@googlegroups.com <javascript:> >
> > > users+un...@googlegroups.com <javascript:>
> > <mailto:users%2Bu...@googlegroups.com <javascript:> > .
> >
> > > > To post to this group, send email to
> mnemosyne-
> > > proj-
> >
> > > > us...@googlegroups.com.
> > > > To view this discussion on the web visit
> > > >
> https://groups.google.com/d/msgid/mnemosyne-
> <https://groups.google.com/d/msgid/mnemosyne->
> >
> > > proj-users/5bd857ba-
> > <https://groups.google.com/d/msgid/mnemosyne-
> <https://groups.google.com/d/msgid/mnemosyne->
> > > proj-users/5bd857ba->
> > > > fda6-485d-9a03-
> > > 73a0ab87d5dd%40googlegroups.com
> <http://40googlegroups.com>
> > <http://40googlegroups.com>
> > > >
> <https://groups.google.com/d/msgid/mnemosyne-
> <https://groups.google.com/d/msgid/mnemosyne->
> > > proj-users/5bd857ba->
> > > > fda6-485d-9a03-
> > > >
> > >
> >
> 73a0ab87d5dd%40googlegroups.com?utm_medium=email&utm_source=fo
> <http://40googlegroups.com?utm_medium=email&utm_source=fo>
> >
> > >
> > <http://40googlegroups.com?utm_medium=email&utm_source=fo
> > > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> > .
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > You received this message because you are subscribed to the
> > Google Groups
> > > "mnemosyne-proj-users" group.
> > > To unsubscribe from this group and stop receiving emails
> from it,
> > send an
> > > email to mnemosyne-proj-
> users+un...@googlegroups.com <javascript:>
> > <mailto:mnemosyne-proj-
> users%2Bunsu...@googlegroups.com <javascript:> > .
> > > To post to this group, send email to mnemosyne-proj-
> >
> > > us...@googlegroups.com <javascript:> .
> >
> > > To view this discussion on the web visit
> >
> > > https://groups.google.com/d/msgid/mnemosyne-proj-
> <https://groups.google.com/d/msgid/mnemosyne-proj->
> > users/05b5a730-
> > > 26de-4aab-a6e4-4e462eb526c7%40googlegroups.com
> > users/05b5a730-
> > > 26de-4aab-a6e4-
> > >
> >
> 4e462eb526c7%40googlegroups.com?utm_medium=email&utm_source=foo
> <https://groups.google.com/d/optout> .
> >
> >
> > --
> > You received this message because you are subscribed to the
> Google
> > Groups "mnemosyne-proj-users" group.
> > To unsubscribe from this group and stop receiving emails from
> it,
> > send an email to mnemosyne-proj-
> users+un...@googlegroups.com <javascript:>
> > <mailto:mnemosyne-proj-
> users%2Bunsu...@googlegroups.com <javascript:> > .
> > To post to this group, send email to mnemosyne-proj-
> > us...@googlegroups.com <javascript:> .
> >
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/mnemosyne-proj-
> <https://groups.google.com/d/msgid/mnemosyne-proj->
> > users/007b01cfc6cb%243f5835c0%24be08a140%24%40UGent.be.
> >
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
> >
> >
> >
> > --
> > You received this message because you are subscribed to the
> Google Groups
> > "mnemosyne-proj-users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an
> > email to mnemosyne-proj-u...@googlegroups.com
> <javascript:> .
> > To post to this group, send email to mnemosyne-proj-
> > us...@googlegroups.com <javascript:> .
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/mnemosyne-proj-users/CAO-
> users/CAO- <https://groups.google.com/d/msgid/mnemosyne-proj-
> users/CAO->
> > 0pXDk0DKQiWn%2Bq31q5hZu%3Dca%2BA8wGWvz8ZNS-
> >
> P6sZBz2_QA%40mail.gmail.com?utm_medium=email&utm_source=footer
> <http://40mail.gmail.com?utm_medium=email&utm_source=footer> > .
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/39bc4d28-
> 6684-4554-9513-ea7e1266027f%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/39bc4d28-
> 6684-4554-9513-
> ea7e1266027f%40googlegroups.com?utm_medium=email&utm_source=foot

Marcin M.

unread,
Sep 8, 2014, 2:46:08 PM9/8/14
to mnemosyne-...@googlegroups.com
Might no notice about 15 cards learned be caused by this?

Peter Bienstman

unread,
Sep 9, 2014, 2:39:46 AM9/9/14
to mnemosyne-...@googlegroups.com
No, this only deals with cards you memorise for the first time. Note that if you exit and restart Mnemosyne, it 'forgets' how many new cards you memorised in the previous session.

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Marcin M.
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-users/4151122c-98f9-
> 4342-9717-2a45da52fff0%40googlegroups.com
> <https://groups.google.com/d/msgid/mnemosyne-proj-users/4151122c-
> 98f9-4342-9717-
> 2a45da52fff0%40googlegroups.com?utm_medium=email&utm_source=foot
Reply all
Reply to author
Forward
0 new messages