(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
| ;by doppelganger ([email protected]) | |
| ;This file is provided for your own use as-is. It will require the character rom data | |
| ;and an iNES file header to get it to work. | |
| ;There are so many people I have to thank for this, that taking all the credit for | |
| ;myself would be an unforgivable act of arrogance. Without their help this would | |
| ;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
| ;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| { | |
| // Evaluate file in the open SublimeREPL. | |
| // Depends on you creating the Packages/User/EvalInREPL.sublime-macro file. | |
| { "keys": ["super+r"], "command": "run_macro_file", "args": { "file": "Packages/User/EvalInREPL.sublime-macro" }, | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "source.elm" } | |
| ] | |
| }, | |
| // Reindent selection on tab |
| #lang racket | |
| (require json racket/draw math/base) | |
| (define (lat-lon->map-point coordinates) | |
| (match-define (list lon lat _ ...) coordinates) | |
| (define-values (x y) (values (degrees->radians lon) (asinh (tan (degrees->radians lat))))) | |
| (list (/ (+ 1 (/ x pi)) 2) (/ (- 1 (/ y pi)) 2))) | |
| (define (draw-polygon dc polygons) | |
| (define path |
| #lang sketching | |
| (require racket/list) | |
| (class Player Object | |
| (init-field x y x-vel y-vel attached) | |
| (super-new) | |
| ;direction is whether we're rotating clockwise or anti clockwise around the ball. | |
| ;either -1 or 1 | |
| (define-values (direction) (values 1)) |
| #lang racket | |
| (require math/array) | |
| ;; https://en.wikipedia.org/wiki/Conway's_Game_of_Life | |
| ;; These are the game rules for a single CELL which can be 1 (alive) or 0 | |
| ;; dead. NEIGHBOR-COUNT is the number of live neighbors the cell has. | |
| (define (game-rules cell neighbor-count) | |
| (cond | |
| ;; Any live cell with fewer than two live neighbours dies, as if by | |
| ;; underpopulation. |
Primality tests like the Fermat test and the Miller-Rabin test
rely on so-called "witnesses." In the case of Fermat, if a^{p-1} = 1 (mod p), for some a, then p is probably prime. The
a is called a Fermat witness. However, if a composite passes the test for a given a, then a is called a Fermat liar.
The same principle holds for Miller-Rabin, although the equation is slightly more complicated.
Which numbers are the most honest? Which ones are the most lying?
Run racket main.rkt to produce a bunch of heat maps that show the most honest (dark) and most lying (bright) numbers.
This one shows for the numbers 2 to 1024: