Get:
- Ten most frequently occurring non-stop words in a text file (including how often they occur).
- Alphabetized list of words occurring exactly three times.
Considerations:
- Stop words
- Stemming
- Laziness
| (ns lcmap-data-clj.logger | |
| (:require [clojure.logging.impl :as log-impl]) | |
| (:import [ch.qos.logback.classic Level])) | |
| (comment "Usage example" | |
| (set-level! 'lcmap-data-clj :debug) | |
| (set-level! '[org.apache org.gdal] :info) | |
| (set-level! '[com.datastax.driver co.paralleluniverse] :error)) |
| (defrecord Accept [media-range quality accept-extension]) | |
| (defn accept [str] | |
| "Parse a single accept string into a map" | |
| ; according to RFC2616, the "q" parameter must precede the accept-extension | |
| (let [pattern #"([^;]+)\s*(?:;q=([0-9+\.]+))?\s*(;.+)*" | |
| matches (re-find pattern str) | |
| [_ media-range qvalue accept-extension] matches | |
| quality (java.lang.Double/parseDouble (or qvalue "1"))] | |
| (Accept. media-range quality accept-extension))) |
| """ Moo. | |
| """ | |
| import gdal | |
| import osr | |
| import math | |
| import subprocess | |
| import time | |
| (ns shokunin.euler) | |
| ;; sum of multiples of 3 and 5 < 1000 | |
| ;; https://projecteuler.net/problem=1 | |
| (defn multiple-seq [n] | |
| (iterate (partial + n) n)) | |
| (let [x3 (take-while #(< % 1000) (multiple-seq 3)) | |
| x5 (take-while #(< % 1000) (multiple-seq 5)) |
| (ns accept.core) | |
| ;; Content Type matters in a REST API. | |
| (defrecord Accept [media-range quality accept-extension]) | |
| (defn accept [str] | |
| "Parse a single accept string into a map" | |
| ; according to RFC2616, the "q" parameter must precede the accept-extension |
| FROM centos:centos6 | |
| MAINTAINER jmorton@usgs.gov | |
| # Apache | |
| RUN yum install -y httpd httpd-devel | |
| RUN chkconfig httpd on | |
| RUN apachectl start | |
| # Dependencies | |
| RUN yum groupinstall -y "Development tools" |
| require 'em-imap' | |
| require 'logger' | |
| require 'yaml' | |
| # | |
| # Watch IMAP mailboxes for messages and react however you like. | |
| # | |
| # Usage Example: | |
| # | |
| # Mailbag.run do |message| |
| (defn fizzer [n] | |
| (if (= 0 (mod n 3)) "Fizz")) | |
| (defn buzzer [n] | |
| (if (= 0 (mod n 5)) "Buzz")) | |
| (defn fizzerbuzzer [num] | |
| (let [res [(fizzer num) (buzzer num)]] | |
| (if (every? nil? res) num (apply str res)))) |
| /** | |
| * Usage: | |
| * | |
| * <script src="augmenter.js" type="text/javascript"></script> | |
| * <script> | |
| * new Augmenter({ attr: 'data-employee', url: '/employee?id=' }) | |
| * </script> | |
| * | |
| * Any elements like this in your document: | |
| * |