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
/** | |
* Authenticate against CouchDB, the <code>options</code> parameter is | |
*expected to have <code>name</code> and <code>password</code> fields. | |
* @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html | |
* #post--_session">docs for POST /_session</a> | |
* @param {ajaxSettings} options | |
* <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> | |
* jQuery ajax settings</a> | |
*/ | |
login: function(options) { |
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
# fresh raspbian image | |
# I'm using the Edimax EW-7811UN (http://www.amazon.co.uk/gp/product/B003MTTJOY) | |
# which requires a custom hostapd. I expect there are better options now that Just Work. | |
# Initial setup | |
expand partition | |
expand filesystem | |
memory split to 32 | |
configure sshd to publickey only (and add your key...) |
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
-include_lib("eunit/include/eunit.hrl"). | |
md5_collision_test() -> | |
Bin1 = <<93,17,105,62,30,51,75,44,179,136,239,170,240,208,236, | |
243,145,45,115,10,28,221,122,172,110,60,224,228,206,6, | |
123,177,142,115,199,186,162,106,168,25,102,194,134,22, | |
179,79,61,7,170,183,200,30,50,148,137,100,124,17,115,74, | |
63,175,3,234>>, | |
Bin2 = <<93,17,105,62,30,51,75,44,179,136,239,170,240,208,236, | |
243,145,45,115,10,28,221,122,172,110,60,224,228,206,6, |
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
diff --git a/src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java b/src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java | |
index 6928967..697b289 100644 | |
--- a/src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java | |
+++ b/src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java | |
@@ -167,10 +167,10 @@ public enum Analyzers { | |
NGRAM { | |
public Analyzer newAnalyzer(final String args) throws JSONException { | |
final JSONObject json = new JSONObject(args == null ? "{}" : args); | |
+ final Analyzer parent = Analyzers.getAnalyzer(json.optString("parent", "standard")); | |
int min = json.optInt("min", NGramTokenizer.DEFAULT_MIN_NGRAM_SIZE); |
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
diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl | |
index 8fe4b18..2dd14cd 100644 | |
--- a/src/couch_index_server.erl | |
+++ b/src/couch_index_server.erl | |
@@ -63,7 +63,16 @@ validate(DbName, DDoc) -> | |
lists:foldl(ValidateFun, ok, EnabledIndexers). | |
-get_index(Module, <<"shards/", _/binary>>=DbName, DDoc) -> | |
+get_index(Module, <<"shards/", _/binary>> = DbName, DDoc) -> |
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
1> {ok, Fd} = file:open("foobar.foobar", [read,write,raw,binary]). | |
{ok,{file_descriptor,prim_file,{#Port<0.494>,7}}} | |
2> Data = <<"foobar">>. | |
<<"foobar">> | |
3> Size = iolist_size(Data). | |
6 | |
4> {ok, Start} = file:position(Fd, cur). | |
{ok,0} | |
5> file:write(Fd, Data). | |
ok |
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
<logger name="org.apache.http"> | |
<level value="DEBUG"/> | |
</logger> |
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
➜ ~ rm -f ~/.erlang.cookie | |
➜ ~ erl -name foo | |
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] | |
Eshell V5.8.2 (abort with ^G) | |
([email protected])1> erlang:get_cookie(). | |
'HLOAVDPHNZNOKELLNYKQ' | |
^C | |
➜ ~ cat ~/.erlang.cookie | |
HLOAVDPHNZNOKELLNYKQ% |
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
diff --git a/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/FieldType.java b/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/FieldType.java | |
index aa5eb0d..3b77885 100644 | |
--- a/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/FieldType.java | |
+++ b/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/FieldType.java | |
@@ -145,7 +145,7 @@ public enum FieldType { | |
@Override | |
public Query toRangeQuery(final String name, final String lower, final String upper, | |
final boolean lowerInclusive, final boolean upperInclusive) { | |
- return NumericRangeQuery.newLongRange(name, precisionStep, toLong(lower), toLong(upper), | |
+ return NumericRangeQuery.newLongRange(name, toLong(lower), toLong(upper), |
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
diff --git a/src/mem3_util.erl b/src/mem3_util.erl | |
index bb15e0e..785a27e 100644 | |
--- a/src/mem3_util.erl | |
+++ b/src/mem3_util.erl | |
@@ -221,7 +221,12 @@ ensure_exists(DbName) -> | |
{ok, Db} -> | |
{ok, Db}; | |
_ -> | |
- couch_server:create(DbName, Options) | |
+ case couch_server:create(DbName, Options) of |