Code: Numbers and data: decimal, stats, linalg, ml, plot and dot
Numbers: the code
The programs behind the slides. They need no server and run with Jennifer 0.26.0 from this folder. Only money.j and allocate.j use a deck: run jvc install once here first, which reads deck.toml and vendors @deckyard/money into vendor/.
floats.j:0.1 + 0.2, a float invoice and float rounding ("Floats cannot count money"). Run:jennifer run floats.jdecimal.j: the same invoice withdecimal, rounded once ("decimal: exact, and you say when to round"). Run:jennifer run decimal.jmodes.j: rounding modes, division with and without a scale ("Rounding modes and division"). Run:jennifer run modes.jperline.j: VAT rounded per line or on the total, splitting 100 in three ("Round per line, or on the total?"). Run:jennifer run perline.jmoney.j:@deckyard/moneyamounts in minor units, a sum and an exchange ("@deckyard/money: minor units and a code"). Needs:jvc install. Run:jennifer run money.jallocate.j:allocateToandallocatewithout losing a cent, mixing currencies throws ("money.allocate: no cent lost"). Needs:jvc install. Run:jennifer run allocate.jgrouping.j: an amount with a group separator and a decimal mark ("Money for a reader: grouping and the mark"). Run:jennifer run grouping.jintl.j: translated message templates around the formatted amount, with a fallback locale and a missing key ("intl: the words around the number"). Run:jennifer run intl.jstats.j: mean, median, spread and robust measures of 14 days of sales ("stats: what a normal day looks like"). Run:jennifer run stats.jregression.j: correlation and a linear regression ("Correlation and a straight line"). Run:jennifer run regression.jlinalg.j: the same fit by solving the normal equations ("The same fit with linalg"). Run:jennifer run linalg.jml.j: a regression with two features and a forecast ("ml: a second feature, and a forecast"). Run:jennifer run ml.jclusters.j: scaling, k-means and k-nearest neighbours ("ml: clusters, then neighbours"). Run:jennifer run clusters.jchart.j: writescones.svg, the scatter plot with the fitted line ("plot: a chart as an SVG string", "The chart"). Run:jennifer run chart.j, then optionallyrsvg-convert -w 640 cones.svg -o cones.pngbars.j: writesweek.svg, the grouped bar chart ("Bars, grouped"). Run:jennifer run bars.jinvoicegraph.j: prints the invoice state machine as Graphviz DOT ("dot: a graph from data"). Run:jennifer run invoicegraph.j | dot -Tpng -o invoice.png(dotis Graphviz, installed separately)limits.j: integer and float overflow,sqrtof a negative, the mean of an empty list, an exact2^64("Strict at the boundaries"). Run:jennifer run limits.j
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 2.7 KiB | raw |
| allocate.j | 713 B | raw |
| bars.j | 568 B | raw |
| chart.j | 876 B | raw |
| clusters.j | 618 B | raw |
| decimal.j | 402 B | raw |
| deck.toml | 258 B | raw |
| floats.j | 249 B | raw |
| grouping.j | 673 B | raw |
| intl.j | 1.0 KiB | raw |
| invoicegraph.j | 704 B | raw |
| limits.j | 455 B | raw |
| linalg.j | 742 B | raw |
| ml.j | 771 B | raw |
| modes.j | 410 B | raw |
| money.j | 475 B | raw |
| perline.j | 654 B | raw |
| regression.j | 631 B | raw |
| stats.j | 652 B | raw |