Skip to content

Instantly share code, notes, and snippets.

(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.)
(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]]))
@vickaita
vickaita / Delayed
Created July 22, 2012 23:31
Delayed in coffeescript
# 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
// handlers
handlersLoggedOut: function() {
var pm = this;
$('.media-item').draggable({
revert: true,
helper: 'clone',
cursor: 'move',
distance: 10,
start: function() {
/**
* 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");