Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@sliminality
sliminality / begin.rkt
Created November 7, 2016 15:42
Recitation 6: Imperative Programming
; (begin
; <FunctionCall#1>
; <FunctionCall#2>
; ...
; <ReturnFunctionCall>)
; ; executes a sequence of function calls, one at a time
; ; returns the value of the last one
; vend/outside-stock : number -> string or number
@sliminality
sliminality / Expectation Maximization.carbide.md
Last active September 17, 2017 19:37
Expectation Maximization

Expectation Maximization

EM Examples

@sliminality
sliminality / Hidden Markov Models.carbide.md
Last active November 12, 2016 23:32
Hidden Markov Models

Hidden Markov Models

@sliminality
sliminality / about.md
Last active April 10, 2019 07:19
Example of structural inheritance in Racket

Structural inheritance

If you have a bunch of structs with common properties or functions (in the English sense, not the CS sense), it makes sense to define a parent type (or base type) encoding those common properties and functions, and have other types inherit those properties and functions from the parent.

If type A inherits from type B, then A is a subtype (or child type) of B. A subtype is a "more specific" version of its parent type.

Defining a subtype

Here is the syntax for declaring a subtype:

@sliminality
sliminality / conditionals.rkt
Created January 30, 2017 04:11
w17 eecs 111 review 1
;; Conditionals
(require 2htdp/image)
(require cs111/iterated)
;; boolean is one of
;; - true (#true, #t)
;; - false (#false, #f)
;; and : boolean, boolean, ... -> boolean
@sliminality
sliminality / Default (OSX).sublime-keymap
Last active March 1, 2025 23:59
Racket and Sublime Text 3
{
// 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
@sliminality
sliminality / vim.md
Last active March 26, 2017 20:13
a vim cheat sheet by Jason Bertsche (https://github.com/TheBizzle)

Essentials

Command Meaning
:q quit
:w save
:w <filename> save as <filename>
:w! force save
:help <topic> get help on <topic>
:e open the file given by ``