This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
(comment You will want just about everything in your hive/lib dir included in your Classpath) | |
(ns myproj.core | |
(:import [org.apache.hadoop.hive.service HiveClient] | |
[org.apache.thrift.transport TSocket] | |
[org.apache.thrift.protocol TBinaryProtocol])) | |
(defn send-hive | |
"Creates a new socket and Hive client connection, runs the query, pulls the result, and closes the connection. | |
Eventually modify to split and parse according to schema of result. |
; A REPL-based, annotated Seesaw tutorial | |
; Please visit https://github.com/daveray/seesaw for more info | |
; | |
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
; Seesaw's basic features and philosophy, but only scratches the surface | |
; of what's available. It only assumes knowledge of Clojure. No Swing or | |
; Java experience is needed. | |
; | |
; This material was first presented in a talk at @CraftsmanGuild in | |
; Ann Arbor, MI. |
;; This is a clojure.test test case which enters a value in a form | |
;; field in the browser, clicks the submit button and checks that the | |
;; correct information is displayed in the page and that the client | |
;; and server state is as it should be. 'database' is an atom in the | |
;; server and 'state' is an atom in the browser. | |
(deftest test-enter-name | |
(reset! database #{}) | |
;; evaluate two forms in the browser in the start.view namespace | |
(cljs-eval start.view | |
(dom/set-value :name-input "Ted") |
organization := "net.seratch" | |
name := "sandbox" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
libraryDependencies ++= Seq( | |
"junit" % "junit" % "4.9" withSources(), |
; Final pre-processed "transcriptions" of several Coltrane "Giant Steps" solos | |
; are here: https://github.com/daveray/yardbird | |
; Please take the data and do something fun with it! | |
; TODO | |
; Incorporate changes | |
; Convert to concert pitch | |
; Convert to correct octave | |
(use 'overtone.live) |
(ns pallet.crate.nexus | |
"Install and configure Nexus maven repository manager. | |
See: | |
http://www.sonatype.com/books/nexus-book/reference/install.html" | |
(:require | |
[pallet.action.directory :as directory] | |
[pallet.action.environment :as environment] | |
[pallet.action.exec-script :as exec-script] | |
[pallet.action.file :as file] |
require 'sinatra' | |
require 'redis' | |
require 'json' | |
require 'date' | |
class String | |
def &(str) | |
result = '' | |
result.force_encoding("BINARY") |
:environment | |
{:algorithms | |
{:lift-fn pallet.core/parallel-lift | |
:vmfest | |
{:create-nodes-fn pallet.compute.vmfest/parallel-create-nodes} | |
:converge-fn pallet.core/parallel-adjust-node-counts} | |
:phases {:bootstrap | |
(phase | |
(package-manager | |
:configure :proxy local-proxy))} |
@GrabResolver(name='jclouds snapshot', root='https://oss.sonatype.org/content/repositories/snapshots') | |
@Grab('org.jclouds:jclouds-allcompute:1.3.0-SNAPSHOT') | |
import org.jclouds.compute.ComputeServiceContextFactory | |
def accesskeyid = '...' | |
def secretkey = '...' | |
def context = new ComputeServiceContextFactory().createContext("aws-ec2", accesskeyid, secretkey) | |
def nodes = context.getComputeService().listNodes() |