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 kits.test.homeless | |
(:use clojure.test) | |
(:require [kits.homeless :as h])) | |
;; | |
;; its rather silly to have homeless aliased - I should just use everything (via vi) :refer | |
;; | |
;; | |
(deftest raise |
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
;; ((((CAST(CAST(delivery_date_key as CHAR(8)) as DATE format 'YYYYMMDD') - CAST(CAST(order_date_key as CHAR(8)) as DATE format 'YYYYMMDD'))*5) | |
;; - ((day_of_week(CAST(CAST(order_date_key as CHAR(8)) as DATE format 'YYYYMMDD'))) - (day_of_week(CAST(CAST(delivery_date_key as CHAR(8)) as DATE format 'YYYYMMDD')))) * 2)/7) | |
;; - CASE WHEN day_of_week(CAST(CAST(order_date_key as CHAR(8)) as DATE format 'YYYYMMDD')) = 1 THEN 1 ELSE 0 END | |
;; - CASE WHEN day_of_week(CAST(CAST(delivery_date_key as CHAR(8)) as DATE format 'YYYYMMDD')) = 7 THEN 1 ELSE 0 END as days_order_to_delivery | |
(defn- day-of-week [date-time] | |
(case (.getDayOfWeek date-time) | |
1 2 | |
2 3 | |
3 4 |
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
;; lisp-1 | |
(define x "foo") | |
(define x (lambda () "bar")) | |
(eval (x)) => "bar" | |
;; lisp-2 | |
(define x "foo") | |
(define x (function () "bar")) |
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- referred-to-in-originals-pred [type originals] | |
(if-not (= type :require-refer) | |
(constantly false) | |
(fn [[ns1 _ [alias1]]] | |
(some (fn [[[ns2 _ alias2]]] | |
(if (symbol? alias2) | |
(and (= alias1 alias2) (= ns1 ns2)) | |
(and (= alias1 (first alias2)) (= ns1 ns2)))) | |
originals)))) |
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
; nREPL 0.1.3 | |
user> (use 'slam.hound) | |
nil | |
user> (println (reconstruct "/Users/francis/work/runa/slamhound/test/slam/hound_test.clj")) | |
WARNING: ex-info already refers to: #'clojure.core/ex-info in namespace: slingshot.ex-info, being replaced by: #'slingshot.ex-info/ex-info | |
WARNING: ex-data already refers to: #'clojure.core/ex-data in namespace: slingshot.ex-info, being replaced by: #'slingshot.ex-info/ex-data | |
UnsupportedOperationException nth not supported on this type: Symbol clojure.lang.RT.nthFrom (RT.java:846) | |
user> |
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
The situation: | |
I'm messing around with slamhound and run `(reconstruct "/Users/francis/work/runa/slamhound/test/slam/hound_test.clj")` at the REPL - it throws this stacktrace. | |
https://www.refheap.com/paste/9016 | |
So I begin to creat a regresssion test - however when I run it - no exception, outputs exactly what one would expect. | |
FAIL in (foo) (regrow_test.clj:75) | |
expected: (= "" (reconstruct "/Users/francis/work/runa/slamhound/test/slam/hound_test.clj")) |
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
1. build a tags file of all the clojure code (non-emacs) use find and xargs and etags | |
2. have emacs load the tags file via 'visit tags table' | |
3. tell emacs to preform some function on every tags match. | |
4. tell them to 'indent-sexp' for each matching tags |
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
;; The issue | |
; products that are excluded using category ID 'odd' are receiving a pre-abandonment offer. | |
;; The plan | |
; Define problem scope - does this problem only exist for category ID? |
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
;Hola, I'm have an issue with ELISP control structures - could anyone point me in the right direction? | |
;I currently have "\C-c\C-o" bound to rgrep via `global set key` I would like to automatically jump to the | |
;*grep* buffer when finished with grep, but I'm not sure how to say that without doing something like | |
(global-set-key "\C-c\C-o" (lambda (x) | |
(interactive "sSearch for:" | |
; then prompt for directory ect. | |
) | |
(rgrep %s) | |
;; the downside to this being that I lose the default behavior of rgrep (defaulting to the symbol under cursor, or selected text) |
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 v1 (s/replace currying | |
#"[\[\[\]\]''']" | |
"")) | |
;; (s/replace v1 #"\S+ \(\S+\s\S+\)\|" "") - this is almost what I want | |
(def content (let [relevent-content (first (s/split v1 #"== See also ==" )) | |
dirty-sections (re-seq #"==[A-Za-z ]*==" relevent-content) | |
clean-sections (map (fn [s] (s/trim (s/replace s #"==" ""))) dirty-sections)] | |
relevent-content | |
;; {:content relevent-content |
OlderNewer