Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
Clojure functions and/or relevant notes are on the right. | |
For clojure functions, symbols indicate existing method definitions, in the | |
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
ruby-to-clojure.*/* functions can be obtained from the source files in this | |
gist. | |
If no method symbol is given, we use the following notation: |
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *) | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl" | |
if (count every window) = 0 then | |
make new window | |
end if | |
set found to false |
''' | |
aero님께서 구현하신 구글/네이버/싸이월드/콩나물 좌표변환은 펄/자바스크립트로 되어있습니다. | |
펄/자바스크립트에 익숙지 않은지라, 수식을 파이썬으로 번역해보았습니다. | |
''' | |
from pyproj import Proj | |
from pyproj import transform | |
WGS84 = { 'proj':'latlong', 'datum':'WGS84', 'ellps':'WGS84', } |
(ns hbase.cascalog.core | |
(:require [cascalog.workflow :as w]) | |
(:import [cascading.hbase HBaseTap HBaseScheme ByteHolder] | |
[cascading.tuple Fields] | |
org.apache.hadoop.hbase.util.Bytes)) | |
(defn hbase-tap [table-name key-field column-family & value-fields] | |
(let [scheme (HBaseScheme. (w/fields key-field) column-family (w/fields value-fields))] | |
(HBaseTap. table-name scheme))) |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
;; Datomic example code | |
(use '[datomic.api :only (db q) :as d]) | |
;; ?answer binds a scalar | |
(q '[:find ?answer :in ?answer] | |
42) | |
;; of course you can bind more than one of anything | |
(q '[:find ?last ?first :in ?last ?first] | |
"Doe" "John") |
(ns queries | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:use [datomic.api :only [q]])) | |
(defn query [rule xs] | |
(let [prule (prep rule)] | |
(map #(binding-map* prule (prep %)) xs))) | |
;; --- |
(ns arc.core | |
(:use compojure.core) | |
(:require [compojure.route :as route] | |
[compojure.handler :as handler] | |
[ring.util.response :as response] | |
[ring.adapter.jetty :as jetty])) | |
(def route-map (ref {})) | |
(def ^:dynamic *params* nil) |
(defn ambrose?- | |
[& bindings] | |
(let [[name bindings] (flow/parse-exec-args bindings) | |
bindings (mapcat (partial apply normalize-sink-connection) | |
(partition 2 bindings)) | |
flow (-> (apply compile-flow name bindings) | |
flow/flow-def | |
flow/compile-hadoop) | |
server (EmbeddedAmbroseCascadingNotifier.)] | |
(.addListener flow server) |
;; This gist roughly transribes the demo | |
;; by Jim Weirich during his talk on Y-Combinator | |
;; called Y-Not. | |
;; http://www.infoq.com/presentations/Y-Combinator | |
;; Jim does a phenomenal job of explaining in the demo. | |
;; Therefore, this gist only attempts to provide | |
;; the code example from the poor quality video | |
;; The examples are simplified at some places | |
;; based on how I tried to understand it |