This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| Object | |
| Behavior | |
| ClassDescription | |
| Class | |
| Metaclass | |
| BlockClosure | |
| Boolean | |
| False | |
| True | |
| Browser |
| (defn neighbors-of [cell] | |
| (set (for [dx [-1 0 1] dy [-1 0 1] :when (not (= [dx dy] [0 0]))] | |
| [(+ dx (first cell)) (+ dy (second cell))]))) | |
| (defn alive? [[cell freqs] world] | |
| (or (and (= 2 freqs) (contains? world cell)) (= 3 freqs))) | |
| (defn tick [world] | |
| (let [frequencies (frequencies (reduce #(concat %1 (neighbors-of %2)) [] world))] | |
| (set (keys (filter #(alive? % world) frequencies))))) |
| MySQL commands (from http://www.pantz.org/software/mysql/mysqlcommands.html) | |
| Create a database on the sql server. | |
| mysql> create database [databasename]; | |
| List all databases on the sql server. | |
| mysql> show databases; | |
| Switch to a database. | |
| mysql> use [db name]; |
| "Chris Rathman / [email protected] | |
| ************************************************************************ | |
| * Allowable characters: * | |
| * - a-z * | |
| * - A-Z * | |
| * - 0-9 * | |
| * - .+/\*~<>@%|&? * | |
| * - blank, tab, cr, ff, lf * | |
| * * | |
| * Variables: * |