Skip to content

Instantly share code, notes, and snippets.

View oflg's full-sized avatar

Li Guang oflg

View GitHub Profile
{
"request": [
{
"enable": true,
"name": "bing-cn-to-www",
"ruleType": "redirect",
"matchType": "prefix",
"pattern": "https://cn.bing.com",
"exclude": "",
"group": "bing-redirect",
@oflg
oflg / anki_algorithm.py
Created August 15, 2021 01:08 — forked from riceissa/anki_algorithm.py
my current understanding of Anki's spacing algorithm
"""
This is my understanding of the Anki scheduling algorithm, which I mostly
got from watching https://www.youtube.com/watch?v=lz60qTP2Gx0
and https://www.youtube.com/watch?v=1XaJjbCSXT0
and from reading
https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html
There is also https://github.com/dae/anki/blob/master/anki/sched.py but I find
it really hard to understand.
Things I don't bother to implement here: the random fudge factor (that Anki
@oflg
oflg / README.md
Last active December 18, 2023 02:23 — forked from fasiha/README.md
How Anki calculates intervals

Reading _nextRevIvl and its subfunction _constrainedIvl plus _rescheduleLapse will illuminate how Anki calculates the due date of a flashcard, based on whether you answer

  • again
  • hard
  • good
  • easy

This is more of a self-note, so I assume you’ve read the Anki manual top-to-bottom a couple of times.

Let factor be the flashcard’s factor, by default be the Starting Ease, default startingease = 2.5, which is Anki’s estimate for how well you’ve memorized this flashcard. The bigger the number, the better you understand it. It’s minimum is 1.3 and it gets incremented by 0.15 to 0.2 points every review, as we will s