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
diff --git a/xapian-bindings/java/SmokeTest.java b/xapian-bindings/java/SmokeTest.java | |
index 2304aff..02778ec 100644 | |
--- a/xapian-bindings/java/SmokeTest.java | |
+++ b/xapian-bindings/java/SmokeTest.java | |
@@ -117,8 +117,7 @@ public class SmokeTest { | |
} | |
Document m_doc = null; | |
- for (MSetIterator it = mset.iterator(); it.hasNext();) { | |
- Long docid = it.next(); |
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
diff --git a/xapian-core/common/pretty.h b/xapian-core/common/pretty.h | |
index e5418b3..47f0760 100644 | |
--- a/xapian-core/common/pretty.h | |
+++ b/xapian-core/common/pretty.h | |
@@ -39,6 +39,9 @@ struct PrettyOStream { | |
S & os; | |
PrettyOStream(S & os_) : os(os_) { } | |
+ template <typename T> PrettyOStream & operator|(const T & t){ | |
+ return *this | t; |
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
diff --git a/xapian-core/api/registry.cc b/xapian-core/api/registry.cc | |
index c6a0223..1241629 100644 | |
--- a/xapian-core/api/registry.cc | |
+++ b/xapian-core/api/registry.cc | |
@@ -165,7 +165,7 @@ Registry::register_lat_long_metric(const Xapian::LatLongMetric &metric) | |
const Xapian::LatLongMetric * | |
Registry::get_lat_long_metric(const string & name) const | |
{ | |
- LOGCALL(API, const Xapian::MatchSpy *, "Xapian::Registry::get_lat_long_metric", name); | |
+ LOGCALL(API, const Xapian::LatLongMetric *, "Xapian::Registry::get_lat_long_metric", name); |
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 yum | |
_yum = yum.YumBase() | |
all_repos = _yum.repos.findRepos('*') | |
repos = {} | |
for _repo in all_repos: | |
repos[_repo.name] = dict(_repo.cfg.items(_repo._section)) |
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
(defn write-builder [cube & ats] | |
(reduce (fn [builder [dim value]] (doto builder (.at dim value))) | |
(WriteBuilder. cube) | |
(filter #(not (empty? %)) ats))) | |
(defn read-builder [cube & ats] | |
(reduce (fn [builder [dim bucket value]] (doto builder (.at dim bucket value))) | |
(ReadBuilder. cube) |
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
(defmacro io-builder [klazz cube & ats] | |
`(reduce (fn [builder# x#] (doto builder# (.append x#))) | |
(new ~klazz ~cube) | |
[~@ats])) | |
(io-builder StringBuilder "first" ["one" "two"] ["three" "four"]) | |
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
(defn write-builder ^WriteBuilder [cube ats] | |
(let [-ats (filter #(not (empty? %)) ats)] | |
(loop [builder (WriteBuilder. cube) | |
ats# -ats] | |
(if (empty? ats#) | |
builder | |
(let [[dim value] (first ats#)] | |
(recur (.at builder dim value) (rest ats#))))))) |
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
(defmacro write-builder [cube & ats] | |
`(loop [builder# (WriteBuilder. ~cube) | |
ats# ~@ats] | |
(cond | |
(empty? ats#) builder# | |
:else (do | |
(recur (.at builder# (first ats#)) (rest ats#)))))) | |
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
(ns sample | |
(:import [java.net URL] | |
[java.io BufferedReader InputStreamReader])) | |
(let [url "http://google.com" | |
defaultSize 10240 | |
createBuffer (fn [s] (BufferedReader. s defaultSize)) | |
^BufferedReader stream (->> (URL. url) | |
.openStream | |
InputStreamReader. |
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
Exception in thread "main" java.lang.ClassCastException: sample$eval7$stream__8 cannot be cast to java.io.BufferedReader | |
at sample$eval7.invoke(meh.clj:11) | |
at clojure.lang.Compiler.eval(Compiler.java:6514) | |
at clojure.lang.Compiler.load(Compiler.java:6955) | |
at clojure.lang.Compiler.loadFile(Compiler.java:6915) | |
at clojure.main$load_script.invoke(main.clj:283) | |
at clojure.main$script_opt.invoke(main.clj:343) | |
at clojure.main$main.doInvoke(main.clj:427) | |
at clojure.lang.RestFn.invoke(RestFn.java:408) | |
at clojure.lang.Var.invoke(Var.java:415) |