https://akuli.github.io/math-tutorial/
Practical math tutorial for programmers.
https://akuli.github.io/math-tutorial/
Last synced: about 2 months ago
JSON representation
Practical math tutorial for programmers.
- Host: GitHub
- URL: https://akuli.github.io/math-tutorial/
- Owner: Akuli
- License: other
- Archived: true
- Created: 2017-09-15T18:27:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T18:38:58.000Z (over 7 years ago)
- Last Synced: 2024-04-18T05:09:10.857Z (over 1 year ago)
- Language: Python
- Size: 9.99 MB
- Stars: 25
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- resources - Math for programmers (using python)
README
# Math for Programmers
You can read this tutorial on
[akuli.github.io/math-tutorial](https://akuli.github.io/math-tutorial).
## Updating the github.io site
These instructions assume a Debian-based Linux system (e.g. Ubuntu or
Mint). You can do everything on other platforms as well but you need to
figure out stuff yourself because I am not interested in writing
instructions for every possible platform.
1. Install dependencies.
$ sudo apt install git dvipng python3-pip asymptote graphviz texlive-binaries
$ python3 -m pip install --user --upgrade pip
$ python3 -m pip install --user git+https://github.com/akuli/htmlthingy
`texlive-binaries` is just for `dvisvgm`. If you know some other package
that contains a `dvisvgm` program you might be able to use it instead.
2. Check your asymptote version.
$ asy --version
If your asymptote version is less than 2.31 things might not work.
Click [here](https://sourceforge.net/projects/asymptote/files/) to
download a newer asymptote. Then compile it like this (replace 2.31
with the correct version number if you downloaded a different version):
$ sudo apt-get build-dep asymptote
$ cd path/to/where/you/downloaded/asymptote
$ tar xf asymptote-2.31.src.tgz
$ cd asymptote-2.31
$ ./configure --prefix=$HOME/.local && make && make install
Be sure to use `--prefix` instead of `sudo make install`. This way
nothing is too terribly screwed if something goes wrong.
Try `asy --version`. If it doesn't work, add this to `~/.bashrc`:
PATH="$HOME/.local/bin:$PATH"
You can also uninstall the old asymptote that came from apt:
$ sudo apt remove asymptote
2. *OPTIONAL:* Run the build script and view the output in a web browser
to make sure that everything's OK.
$ ./build.py
$ ( yourfavoritebrowser html/index.html &>/dev/null )&
If you get weird libGL errors like this one...
libGL error: failed to open drm device: Lupa evätty
libGL error: failed to load driver: i965
...the problem is probably something with 3D drawings. You can either
google for a "correct" solution or use this horribly dangerous
brute-force hack thing I used:
$ sudo chmod 777 /dev/dri/card0
Compiling 3D images still fails randomly. Run the build script multiple
times until it succeeds. When it has succeeded once the 3D images are in
`imagecache/` and it'll succeed every time (unless you change the 3D images
or delete them from `imagecache/`).
3. Run the crazy script if you dare!
$ ./publish.py