This file contains hidden or 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
    
  
  
    
  | @Test | |
| public void changeNameTest() { | |
| MutableClass original_name = new MutableClass("my name"); | |
| MutableClass expected_name = original_name; | |
| NameFilter filter = new NameFilter(); | |
| MutableClass new_name = filter.changeName(original_name, | |
| "new name"); | |
| assertEquals(new_name, expected_name); | 
  
    
      This file contains hidden or 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 transaction.queries | |
| (:use [cascalog.api]) | |
| (:require [cascalog.ops :as c] | |
| [cascalog.tap :as tap] | |
| [cascalog.workflow :as w]) | |
| (:import [com.google.common.hash Hashing] | |
| [org.joda.time.format DateTimeFormat] | |
| [cascading.scheme.hadoop TextDelimited]) | |
| (:gen-class)) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | (defn standard-tokenizer [text] | |
| "Uses the Lucene StandardTokenizer to tokenize the given text. Returns a vector containing | |
| the tokens." | |
| (let [analyzer (StandardAnalyzer. Version/LUCENE_31) | |
| tokenstream (.tokenStream analyzer "field" (StringReader. text)) | |
| termatt (.addAttribute tokenstream TermAttribute) | |
| terms []] | |
| (while (.incrementToken tokenstream) | |
| (print (.term termatt))))) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | geocode = function(location) { | |
| library(RJSONIO) | |
| api.uri = "http://api.infochimps.com/" | |
| geocode.uri = "geo/utils/geolocate?" | |
| api.key = "apikey=xxxxxxxxxxxx" | |
| print(location) | |
| uri = paste(api.uri, geocode.uri, api.key, "&f.address_text=", location, sep="") | |
| raw.data = readLines(uri, warn="F") | |
| results = fromJSON(raw.data) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | library(RJSONIO) | |
| library(ggplot2) | |
| api.uri <- "http://api.infochimps.com/" | |
| acs.topline <- "social/demographics/us_census/topline/search?" | |
| api.key <- "apikey=xxxxxxxxxx" # replace the x's with your Infochimps API key | |
| radius <- 10000 # in meters | |
| lat <- 44.768202 | |
| long <- -91.491603 | 
NewerOlder