Uses R to create bar plots of region server writes.
-
Save the sample data into ~/tmp/region-data.csv
-
Install R and start R console
| # Build and run then open browser to http://localhost:9000/hello.html. | |
| # Then open browser console. It has an error message like this: | |
| # Uncaught TypeError: Cannot read property 'Jf' of undefined hello.js:6587 | |
| # Also the REPL hangs. | |
| # If I replace :advanced with :whitespace in project.clj then the browser | |
| # console reports no errors. Also the REPL works fine. | |
| # Make test directory. | |
| mkdir -p $HOME/tmp/cljs-test |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| import org.apache.crunch.DoFn; | |
| import org.apache.crunch.Emitter; | |
| import org.apache.crunch.PipelineResult; | |
| import org.apache.crunch.io.From; | |
| import org.apache.crunch.io.To; | |
| import org.apache.crunch.types.writable.Writables; | |
| import org.apache.crunch.util.CrunchTool; |
| ; Note: This script requires lein exec | |
| ; Follow instructions for installing lein and lein-exec | |
| ; Then run this as lein exec snipr.clj FILE.md | |
| (require '[clojure.string :as str]) | |
| (require '[clojure.java.io :as io]) | |
| (defn load-script [script] | |
| (load-file | |
| (->> [(System/getenv "HOME") "Dropbox" "Env" "clj" script] (str/join "/")))) |
| // Load tweets. | |
| import scala.util.control.Breaks._ | |
| import scala.collection.JavaConversions._ | |
| import twitter4j.{Twitter,Query,TwitterFactory} | |
| val twitter = TwitterFactory.getSingleton | |
| val query = new twitter4j.Query("lang:en") | |
| query.setCount(100) | |
| query.setSince("2016-01-13") |
| #!/bin/sh | |
| # vim: filetype=sh | |
| ## Init. | |
| # Define variables. | |
| source_bucket=asimj-lambda-test | |
| lambda_name=helloworld | |
| lambda_execution_role_name=lambda-${lambda_name}-execution |
This is a test.