This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns seive.core | |
| (:require [clojure.test :refer [is]])) | |
| ;; Create a list of consecutive integers from 2 through n: (2, 3, 4, ..., n). | |
| ;; Initially, let p equal 2, the first prime number. Starting from p, | |
| ;; enumerate its multiples by counting to n in increments of p, and mark them | |
| ;; in the list (these will be 2p, 3p, 4p, etc.; the p itself should not be | |
| ;; marked). Find the first number greater than p in the list that is not | |
| ;; marked. If there was no such number, stop. Otherwise, let p now equal this | |
| ;; new number (which is the next prime), and repeat from step 3.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns optimal.core | |
| "A solution to the coding problem found at | |
| http://www.careercup.com/question?id=6541570954231808 | |
| Essentially the problem is to find the maximum sum of nonconsecutive integers | |
| in an array." | |
| {:author "Vick aita"} | |
| (:require [clojure.test :refer [is]])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Have not tested this, just sketching things out and wanted to save this somewhere. | |
| class Delayed | |
| constuctor: (f) -> | |
| return new Delayed f if @ not instanceof Delayed | |
| empty = {} | |
| memo = empty | |
| @.deref = -> | |
| memo = f() if memo is empty | |
| memo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // handlers | |
| handlersLoggedOut: function() { | |
| var pm = this; | |
| $('.media-item').draggable({ | |
| revert: true, | |
| helper: 'clone', | |
| cursor: 'move', | |
| distance: 10, | |
| start: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Rider Class | |
| */ | |
| rad.Rider = { | |
| rider : rad.Things.rider(), | |
| init : function() { | |
| this.log("info", "Rider", "Rider Initializing"); | |
| var canvas = rad.Things.gameCanvas(); | |
| var context = canvas.getContext("2d"); |