I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.
def nQueens(n: Int) = (0 until n).permutations filter {p => // p[i] is the column of the queen on ith row (must be a permutation of 0 until n) | |
val i = p.zipWithIndex.toSet | |
i.map{case (c, d) => c + d}.size == n && i.map{case (c, d) => c - d}.size == n // No 2 queens can have same col + diag or col - diag | |
} | |
for { | |
(solution, num) <- nQueens(8).zipWithIndex | |
_ = println(s"Solution #${num + 1}:") | |
col <- solution | |
row = solution.indices.map(i => if (i == col) 'Q' else '-') |
(ns my-transducers.core | |
(:require [clojure.core.async :as async])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Understanding Transducers | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; | |
;; This is the source code for the blog post Understanding Transducers, found | |
;; here: http://elbenshira.com/blog/understanding-transducers | |
;; |
I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
import rbm | |
import scipy | |
import cpickle | |
import numpy as np | |
''' | |
This implementation is based on the MovieLens 100k dataset, | |
available at http://grouplens.org/datasets/movielens/ | |
''' |
# to install the latest stable version: | |
brew install scala --with-docs | |
# to install scala-2.10.0-RC1: | |
brew install https://raw.github.com/gist/3939012/scala.rb --with-docs | |
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands): | |
brew switch scala 2.9.2 | |
brew switch scala 2.10.0-RC1 |