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 web01.core | |
(:import | |
java.util.Map | |
java.util.HashMap | |
[java.io File InputStream] | |
[clojure.lang IDeref IFn ISeq]) | |
(:use | |
compojure.core, | |
ring.adapter.jetty | |
clojure.contrib.json.read |
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 algorithms.core | |
(:use clojure.test)) | |
;; ----------------------------------------------------------------------------- | |
;; A simple BST implemented in Clojure using both defrecord and defprotocol. | |
;; Note the use of the unwind function to update the graph after each insertion. | |
;; | |
;; References: | |
;; | |
;; BST/Clojure |
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 algorithms.problems.diningphilosophers) | |
; ---------------------------------------------- | |
; Dining Philosopher Problem | |
; | |
; This implementation satisfies the following story | |
; line: | |
; | |
; Our waiters set several tables of various | |
; sizes for dinner. One by one, the various hungry |
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 justforfun.speedtest1 | |
(:use justforfun.NonBlockingHashMap)) | |
(set! *warn-on-reflection* true) | |
;; I've simply extended Mark Engelberg's test code for his NonBlockingHashMap and | |
;; included my test results -- TDG | |
(defmacro xtime | |
"Evaluates expr and returns the time." |
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
-module(dynamic_file). | |
%% notes: | |
%% http://www.matisse.net/bitcalc/?input_amount=17179869184&input_units=bits¬ation=legacy | |
%% http://20bits.com/articles/network-programming-in-erlang/ | |
%% ------------------------------------------------------------------ | |
%% API Function Exports | |
%% ------------------------------------------------------------------ |
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
%% -*- mode: nitrogen -*- | |
-module (abc). | |
-compile(export_all). | |
-include_lib("nitrogen_core/include/wf.hrl"). | |
-include("records.hrl"). | |
main() -> #template { file="./site/templates/bare.html" }. | |
title() -> "Hello from abc.erl!". |
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
-module(capitalize). | |
-behaviour(gen_server). | |
-define(SERVER, ?MODULE). | |
-include_lib("eunit/include/eunit.hrl"). | |
%% ------------------------------------------------------------------ | |
%% API Function Exports | |
%% ------------------------------------------------------------------ | |
-export([ |
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
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Chapter 1 Examples</title> | |
<style type="text/css"> | |
header,nav,footer,article {display:block;} | |
nav {float:left; width:20%;} | |
article {float:right; width:79%;} | |
footer {clear:both;} |
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
%% -*- mode: nitrogen -*- | |
-module (mypage). | |
-compile(export_all). | |
-include_lib("nitrogen_core/include/wf.hrl"). | |
-include("records.hrl"). | |
main() -> #template { file="./site/templates/html5.html" }. | |
title() -> "Todd's <b>Html5</b> Page". |
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
%% -*- mode: nitrogen -*- | |
-module (myraphaelpage). | |
-compile(export_all). | |
-include_lib("nitrogen_core/include/wf.hrl"). | |
-include_lib("nitrogen_core/include/google_chart.hrl"). | |
-include("records.hrl"). | |
main() -> #template { file="./site/templates/raphael.html" }. | |
title() -> "Todd's <b>Raphael</b> Page". |
OlderNewer