This file contains 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
(def g | |
(letfn [(ng-next [n] | |
(let [s (str n) | |
seg2-right (.length s) | |
seg1-right (quot seg2-right 2) | |
seg1 (.substring s 0 seg1-right)] | |
(if (= "" (.replaceAll s "9" "")) | |
(+ 2 n) | |
(if (even? seg2-right) | |
(let [seg1-ng (str (inc (Long/valueOf seg1)))] |
This file contains 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 ^{:doc "Find one path in a labyrinth"} | |
hands-on-march-2012.laby | |
(:use [midje.sweet] | |
[clojure | |
[pprint :only [pprint]] | |
[repl :only [doc]]])) | |
(unfinished ) | |
;; ------------- rules of the game ------------------ |
This file contains 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 battle | |
(:use [midje.sweet])) | |
(defn fizzbuzz "Fizzbuzz infinite sequence" | |
[] (let [mult? #(zero? (rem % %2))] | |
(map #(cond (mult? % 15) "fizzbuzz" | |
(mult? % 3) "fizz" | |
(mult? % 5) "buzz" | |
:else %) | |
(iterate inc 1)))) |
This file contains 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 dojo-coding-0.core | |
(:use [clojure.test :only [run-tests]]) | |
(:use [midje.sweet]) | |
(:use [clojure.contrib.repl-utils :only [show]]) | |
(:use [clojure.pprint :only [pprint]]) | |
(:use [clojure.walk :only [macroexpand-all]])) | |
(defn prime-numbers "Return the list of the n first prime numbers" | |
[n] | |
(loop [candidate 2 current n primes []] |
This file contains 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
(defn primes [n] nil | |
(reverse | |
(loop [candidate 2 current n acc []] | |
(if (zero? current) | |
acc | |
(if (every? #(not= 0 (rem candidate %)) acc) | |
(recur (inc candidate) (dec current) (cons candidate acc)) | |
(recur (inc candidate) current acc)))))) | |
(fact |
This file contains 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
;; Hey, Emacs! This is a -*- lisp -*- file! | |
;;; .stumpwmrc --- my StumpWM Init File | |
;; Copyright (C) 2008-2010 Fabrice Niessen | |
;; Time-stamp: <2010-06-21 Mon 14:30 sva on mundaneum> | |
;; Author: Fabrice Niessen <(concat "fni" at-symbol "mygooglest.com")> | |
;; Keywords: stumpwm, dotfile, config | |
;; $Revision: 1933 $ |
This file contains 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
denis@bigbig:~/tmp/vagrant_guide$ vagrant up | |
/usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/com/implementer/ffi.rb:95:in `call_and_check': Error in API call to get_guest_property_notification_patterns: 2147942405 (VirtualBox::Exceptions::FFIException) | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/com/implementer/ffi.rb:69:in `call_vtbl_function' | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/com/implementer/ffi.rb:36:in `read_property' | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/com/abstract_interface.rb:122:in `read_property' | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/com/abstract_interface.rb:64:in `guest_property_notification_patterns' | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/abstract_model/interface_attributes.rb:93:in `send' | |
from /usr/lib/ruby/gems/1.8/gems/virtualbox-0.8.6/lib/virtualbox/abstract_model/interface_attributes.rb:93:in `spec_to_proc' | |
from /usr/lib/ruby/gems/1.8/gems/vi |
This file contains 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
2011-05-15 04:52:31.655 | |
Error for / | |
java.lang.NoClassDefFoundError: javax.net.ssl.HttpsURLConnection is a restricted class. Please see the Google App Engine developer's guide for more details. | |
at com.google.appengine.runtime.Request.process-be4965fdf6d33756(Request.java) | |
at javax.net.ssl.HttpsURLConnection.<clinit>(HttpsURLConnection.java) | |
at org.apache.http.conn.ssl.SSLSocketFactory.<init>(SSLSocketFactory.java:255) | |
at org.apache.http.conn.ssl.SSLSocketFactory.<clinit>(SSLSocketFactory.java:166) | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:109) | |
at com.twinql.clojure.http$loading__4414__auto__.invoke(http.clj:1) |
This file contains 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
# ------------------------------------------------------------------------------ | |
# A few key remapping on GNU/Linux, for easier Emacs. | |
# | |
# Note: You need a querty keyboard in the first place because it removes the alt-gr key. | |
# | |
# Replace : | |
# - capslock by ctrl | |
# - altgr by alt | |
# | |
# To have an alt on the right and an easier ctrl on the left. |
This file contains 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
;; prefered order top-right-bottom-left | |
;; labyrinth x,y indexed at 0 : | |
;; x | |
;; +------> | |
;; | | |
;; y | | |
;; v | |
;; | |
;; dimension always NxN |
NewerOlder