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 xhrio-examples.examples | |
(:require [goog.net.XhrIo :as xhrio] | |
[goog.structs :as structs] | |
[goog.Uri.QueryData :as query])) | |
(def get-text-url "http://localhost:3000/get-text") | |
(def get-json-url "http://localhost:3000/get-json") | |
(def post-url "http://localhost:3000") | |
(def post-form-url "http://localhost:3000/post-form") | |
(def post-json-url "http://localhost:3000/post-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
;;; Extremely Primitve Markov Chain | |
;;; Doesn't try to handle punctuation, capitalization, or anything; just | |
;;; generates text as-is from the corpus. | |
;;; Corpus I used was: http://www.shakespeares-sonnets.com/all.php | |
;;; Considering how important capitalization, plurals, and punctuation is to | |
;;; sonnets, I think it might work a little better this way...I should check | |
;;; that out, later. | |
;; This is so you can create the same chain multiple times. | |
;; Basically, it fixes the seed. |
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 scraper-4clojure.core | |
(:require [clojure.string :as s]) | |
(:import (org.openqa.selenium By WebDriver WebElement) | |
(org.openqa.selenium.htmlunit HtmlUnitDriver))) | |
(defn selenium-example [] | |
(let [browser (HtmlUnitDriver.)] | |
(.get browser "http://www.google.com") | |
(let [element (.findElement browser (By/name "q"))] | |
(.sendKeys element (into-array ["Cheese!"])) |
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
;;;; 117 - For Science! | |
;;; Scratch: | |
;; https://github.com/MoyTW/4clojure/blob/master/ScratchPaper/117-wip.clj | |
;; Original: | |
(fn for-science [coll] | |
(letfn [(mark-next [coll] | |
(->> (conj coll \#) | |
(reduce (fn [[out p c] n] | |
(if (and (contains? #{\space \C} c) (or (= p \F) (= n \F))) | |
[(conj out \N) \N n] |