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
| nmap <C-m> ggVG<C-c><C-c> |
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- strip-funny-chars | |
| "Strip out some characters that might cause trouble parsing the tree." | |
| [s] | |
| (-> s | |
| (.replaceAll "'" "-SQUOTE-") | |
| (.replaceAll "\"" "-DQUOTE-") | |
| (.replaceAll "~" "-TILDE-") | |
| (.replaceAll "`" "-BACKTICK-") | |
| (.replaceAll "," "-COMMA-") | |
| (.replaceAll "\\\\" "-BSLASH-") |
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
| #!/usr/bin/python | |
| import sys | |
| import shutil | |
| import os | |
| import os.path | |
| if os.path.exists("$(sourceFolder)"): | |
| try: | |
| shutil.rmtree("$(sourceFolder)") |
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 web-tag.core | |
| (:require [opennlp.nlp :as nlp]) | |
| (:use [compojure.core] | |
| [ring.adapter.jetty])) | |
| (defn parse-page | |
| [url] | |
| (println (str "url is " url)) ; printing nil for some reason | |
| (str "<h1>parsing: " url "</h1>")) |
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
| (defprotocol Searcher | |
| "An interface for searching" | |
| (score [this term text] "Score this text in similarity") | |
| (rank [this term text] "Rank sentences in this text")) | |
| (defrecord ContextSearcher [get-sentences tokenize pos-tag]) | |
| ; ... lots of impelementation details here ... |
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 clomoios.contextsearcher | |
| (:use [clomoios.core]) | |
| (:require [opennlp.nlp :as nlp])) | |
| (defprotocol Searcher | |
| "An interface for searching" | |
| (score [this term text] "Score this text in similarity") | |
| (rank [this term text] "Rank sentences in this text")) | |
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
| acm.upgrade.bottomPanel = new Ext.Panel({ | |
| id: 'acm.upgrade.bottomPanel', | |
| labelAlign: 'top' | |
| ,frame:true | |
| ,layout: 'fit' | |
| ,items: [{ | |
| layout: 'column' | |
| ,items: [{ | |
| columnWidth: .10 | |
| ,layout: 'form' |
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 seed-example | |
| (:use [clomoios.contextsearcher :as cs]) | |
| (:use [clomoios.seededcontextsearcher :as scs]) | |
| (:use [clojure.contrib.pprint :only [pprint]])) | |
| ; Both contextsearcher and seededcontextsearcher have different protocols that both have 'score' and 'rank' methods | |
| ;‹ ~/src/clj/clomoios › ∴ clj examples/ford/seed-example.clj | |
| ;WARNING: score already refers to: #'clomoios.contextsearcher/score in namespace: seed-example, being replaced by: #'clomoios.seededcontextsearcher/score |
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
| (defmacro mock-2 | |
| [class method arglist result] | |
| (let [mocked (gensym class)] | |
| `(let [~mocked (org.mockito.Mockito/mock ~class)] | |
| ~(list '.thenReturn | |
| (list 'org.mockito.Mockito/when | |
| (list* (symbol (str \. method)) mocked arglist)) | |
| result)))) | |
| user=> (macroexpand-1 '(mock-2 File myMethod ["foo" "foo"] "bar")) |
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 jmockit.core | |
| (:import [mockit Mockit])) | |
| (defprotocol MList | |
| (add [a])) | |
| (deftype MockList [] MList | |
| (add [a] (println "mocked"))) | |
| (Mockit/setUpMock java.util.ArrayList MockList) |