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
// Michael Detmold | |
//A program that draws a box fractal | |
import org.learninggroovy.graphicswindow.GraphicsWindow | |
import java.awt.* | |
window = GraphicsWindow.getBlankWindow(700,700) | |
def ss = 5,dims = 670 | |
def sx =ss,sy =ss | |
ite = 7 |
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
/* | |
*Michael Detmold Groovy Coursework 1. November 2010. | |
*This program will fetch a web page and then construct an index of all the other pages the web page links to. It can do this for several layers of linking. | |
*/ | |
address = "http://www.google.com"//this is the base address to start building the list of links from | |
levels = 2 //this is how many levels of linking withing the base website the program should go. | |
// '/' DENOTES A REGULAR EXPRESSION |
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
var express = require('express'); | |
var app = express.createServer(express.logger()); | |
app.get('/', function(request, response) { | |
response.send('Hello World!'); | |
}); | |
var port = process.env.PORT || 5000; | |
app.listen(port, function() { |
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 d1.core (:gen-class)) | |
(use 'clojure.java.io) | |
;;To run these examples: | |
;; lein repl | |
;; user=> (require 'd1.core) | |
;; to call main | |
;; user=> (d1.core/-main) | |
(defn n-random | |
"I return a vector of N random numbers" | |
[n] |
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
(defproject weather "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[clj-http "0.7.7"]]) |
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 weather-find [something] | |
(let [ response (http/get (str weather-api "find") | |
{:query-params {:q something} | |
:as :json})] | |
(:body response))) | |
(defn get-london [] | |
(weather-find "London")) | |
;; This is broken and I don't understand why |
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 weather.core | |
(:require [clj-http.client :as http])) | |
;; utility Functions | |
(def weather-api | |
"http://api.openweathermap.org/data/2.5/") | |
(defn weather-find [something] | |
(let [ response (http/get (str weather-api "find") | |
{:query-params {:q something} | |
:as :json})] |
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
(cond | |
(>= ambition 90) (apply-to entrepreneurFirst) | |
(>= ambition 80) "something else" | |
(>= ambition 70) "something else" | |
(>= ambition 60) "etc..." | |
:else "F") | |
(case careerPath | |
"Founder" (apply-to entrepreneurFirst) | |
"Banker" (#Something else?#)) |
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
(filter #(and (= (:technical-ability %) "high") | |
(= (% :ambition) "extraordinary")) | |
[{:student true :ambition "extraordinary" :technical-ability "high"} | |
{:student true :ambition "average" :technical-ability "minimal"}]) | |
;;;;; OR THIS ;;;;; | |
(def applicants | |
[{:student true :ambition "extraordinary" :technical-ability "high"} |
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
We shall not cease from exploration | |
And the end of all our exploring | |
Will be to arrive where we started | |
And know the place for the first time. |
OlderNewer