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
(defn fact2 [x] | |
(let [x (if (<= x 1) 1 x)] | |
(apply * x (range 1 x)))) |
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
(defn perfect-number? [x] | |
(and (> x 0) | |
(== (apply + (filter #(= (rem x %) 0) (range 1 (inc x)))) | |
x))) | |
(defn list-perfs [num] | |
(filter perfect-number? (range num))) |
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
(defn current-iterations [projects-and-iterations] | |
(current-by | |
"Project" | |
(map (fn [[p [i]]] | |
{(-> p :project :name) | |
(-> i :iteration :stories)}) | |
projects-and-iterations))) |
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
# terminal | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " ☠ " | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
export PS1='\u@\h \W$(__git_ps1 "|")$(parse_git_branch)$ ' | |
#export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' | |
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
/* | |
* AppController.j | |
* scrollview | |
* | |
* Created by You on November 2, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> |
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
/* | |
* AppController.j | |
* scrollview | |
* | |
* Created by You on November 2, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> |
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
var GoogleChartURL = "http://chart.apis.google.com/chart", | |
CPGoogleVeriticalStackedBarChart = @"bvs", | |
CPGoogleHorizontalStackedBarChart = @"bhs" | |
CPGoogleVeriticalGroupedBarChart = @"bvs", | |
CPGoogleHorizontalGroupedBarChart = @"bhs", | |
CPGoogleLineChart = @"lc", | |
CPGooglePieChart = @"p", | |
CPGooglePieChart3D = @"p3"; | |
... |
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
(defn is-in? [v vs] | |
(some #{true} (map #(= % v) vs))) |
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 floyd.reports | |
(:use [clojure.contrib.seq-utils :only [includes?]] | |
[floyd.formatters :only [billing-minutes billing-seconds as-minutes]] | |
[floyd.str-utils :only [join-str to-display-str]])) | |
(defparseable column-descriptor | |
[:table-column {:required true}] | |
[:name {:type :pair :default :table-column}] | |
[:label {:type :pair :default (fn [this] (to-display-str (:name this)))}] | |
[:calc {:enums #{:sum :avg :count}}] |
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
:formatted-report (run-report | |
(build-query (parse-report billing) | |
{"call_date_start" startdate | |
"call_date_end" enddate | |
"main_account_number_equals" account}) | |
billing-formatter) |