Moved to a proper Git repository.
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
;; Copyright Jason Wolfe and Prismatic, 2013. | |
;; Licensed under the EPL, same license as Clojure | |
(use 'plumbing.core) | |
(require '[clojure.java.shell :as shell] | |
'[clojure.string :as str]) | |
(import '[java.util HashSet] '[java.io File]) | |
(defn double-quote [s] (str "\"" s "\"")) |
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
import spark.streaming.StreamingContext._ | |
import spark.streaming.{Seconds, StreamingContext} | |
import spark.SparkContext._ | |
import spark.storage.StorageLevel | |
import spark.streaming.examples.twitter.TwitterInputDStream | |
import com.twitter.algebird.HyperLogLog._ | |
import com.twitter.algebird._ | |
/** | |
* Example of using HyperLogLog monoid from Twitter's Algebird together with Spark Streaming's |
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
Goal: Process the 12 million plus records | |
from: http://seer.cancer.gov/popdata/download.html | |
using: a Scala API atop Cascading, aka SCALDING ( Inventors: Avi Bryant, Oscar Boykin, Argyris ) | |
to find: | |
THE FASTEST GROWING COUNTY IN THE UNITED STATES over the 1969-2011 timeframe. | |
----------------------------------------------------------------------------- | |
RESULTS: Scroll to the very bottom. | |
First, the scalding source... | |
--- |
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
module.exports = function(grunt) { | |
function noop() {} | |
grunt.initConfig({ | |
watch: { | |
reload: { | |
files: ['public/**', 'views/**'], | |
tasks: 'reload' | |
} |
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
{ "path": "/content/geometrixx/my-first-jinja-page", | |
"properties": [ | |
{ "name": "jcr:primaryType", | |
"value": "cq:Page" }], | |
"nodes": [ | |
{ "path": "jcr:content", | |
"properties": [ | |
{ "name": "jcr:primaryType", | |
"value": "cq:PageContent"}, |
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
Show hidden characters
# Copy the following and place it a file called Leiningen.sublime-build in the Sublime user packages folder (~/.config/sublime-text-2/Packages/User on Linux). | |
# Select this as the build system for the project using Tools/Build System/Leiningen. | |
# You can then bring up the Sublime Command Palette (ctrl+shift+P on Windows/Linux) and issue any of the commands # (build, documentation, clean, run, test, etc). By default, build is bound to ctrl+b and run to ctrl+shift+b. | |
{ | |
"cmd": ["lein", "compile", ":all"], | |
"working_dir": "$project_path", | |
"variants": [ | |
{ "cmd": ["lein", "marg", "-m", "-d", "docs"], |
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
var express = require('express'), | |
httpProxy = require('http-proxy'), | |
app = express(); | |
var proxy = new httpProxy.RoutingProxy(); | |
function apiProxy(host, port) { | |
return function(req, res, next) { | |
if(req.url.match(new RegExp('^\/api\/'))) { | |
proxy.proxyRequest(req, res, {host: host, port: port}); |
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
################################################## | |
### Before | |
irb(main):001:0> Song.limit(2) | |
Song Load (0.2ms) SELECT "songs".* FROM "songs" LIMIT 2 | |
=> [#<Song id: 5, key: "55197", name: "CONTRADICTION", singer: "ももいろクローバーZ", lyric: "前田たかひろ", music: "大隅知宇", body: "飼い馴らせない欲望を\n恥じるのなら\n�...", created_at: "2012-09-19 22:08:16", updated_at: "2012-09-19 22:29:21">, #<Song id: 6, key: "57767", name: "サンタさん", singer: "ももいろクローバーZ", lyric: "前山田健一", music: "前山田健一", body: " ランランラン…\n\nせーの!\nメリークリ�...", created_at: "2012-09-19 22:08:16", updated_at: "2012-09-19 22:29:21">] | |
################################################## | |
### Install |
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
import math._ | |
1L // Long型の 1 | |
1:Long // Long型の 1 | |
127:Byte // Byte型の 127 | |
32767:Short // Short型の 32767 | |
(1+2).toLong // Long型への変換 | |
(2+3) toLong // Long型への変換 |