Coder Social home page Coder Social logo

thomasrebele / minimal_examples Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 308 KB

A collection of small code examples, which can be used for learning syntax and idiosyncrasies. You can use it with a spaced repetition software (SRS), such as Anki.

License: GNU Affero General Public License v3.0

Python 81.55% Shell 14.36% TeX 2.07% CSS 2.02%

minimal_examples's Introduction

minimal examples

A collection of small code examples, which can be used for learning syntax and idiosyncrasies. You can use the examples to memorize features of programming languages. A spaced repetition software (SRS) such as Anki might help with that task.

Currently there are examples for

  • python3
  • latex
  • rust
  • web development (web_dev)

Screenshot of a flash card in Anki:

Screenshot Screenshot

Level assessment

Some examples are more difficult to understand. Therefore this project also aims to provide a method to sort them according to their level (difficulty). To assign a level to examples interactively, you can use the following command:

python3 level_assessment.py  <example-files>

The command will start a browser. You are presented with two cards. You select which of them is easier. All decisions are stored in output/level_data.json. The script level_estimate.py calculates a level based on these decisions.

Generating the cards

The script generate_cards.py converts the examples to flash cards. It uses the levels (see previous section) to sort the cards by difficulty. To generate the cards, use the command

python3 generate_cards.py  <example-files>  >  <output-file>

Problems are reported to standard error. The output is a file in the TSV (tab separated value) format. Its columns are

  • example: a unique identifier
  • description
  • pre: code that precedes the code that the user has to remember
  • step: this is the code that the user needs to know
  • post: code that shows how to apply the result
  • explanation: give more detail for for non-obvious/counter-intuitive answers

Importing into Anki

  1. Choose File -> Import
  2. Select the right type and deck (this project might provide a template at a later stage)
  3. "Fields separated by: Tab"
  4. "Update existing notes when first field matches"
  5. Activate "Allow HTML in fields"
  6. Map the columns
  7. Click on "Import"

Note that the order of already imported cards does not change. This could be achieved by an Anki add-on. Any help is appreciated.

Contributions

You can contribute in several ways:

  • give feedback on usability
  • provide examples for existing programming languages
  • add new programming languages
  • write addons for better integration with SRS (especially Anki)
  • ...

Any contribution shall be licensed by the same license as the project, see the license section below.

Acknowledgements

Logos:

License

This project is licensed under the AGPL, version 3 (LICENSE or https://www.gnu.org/licenses/agpl-3.0.en.html).

Disclaimer

The examples are provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The use of the logos of the programming languages (Python, Rust, ...) is for visual purposes only. It does not imply any endorsement by the respective projects.

minimal_examples's People

Contributors

thomasrebele avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.