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
View view = client.getView("beer", "by_name"); | |
Query query = new Query().setKey("Wrath").setIncludeDocs(true); | |
ViewResponse result = client.query(view, query); | |
System.out.printf("Query returned %s docs", result.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
//instantiate the client | |
List<URI> uris = new LinkedList<URI>(); | |
uris.add(URI.create("http://localhost:8091/pools")); | |
CouchbaseClient client = new CouchbaseClient(uris, "beer-sample", ""); | |
//add a doc | |
String key = "beer_Wrath"; | |
String value = "{'name':'Wrath','type':'beer','category':'Belgian and French Ale'}"; | |
client.set(key, 0, value).get(); |
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
//Assembly 1: Example.Entities.dll (no assembly references at all) | |
namespace Example.Entities | |
{ | |
//Customer does not implement interface | |
public class Customer | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
} | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
#modeled on a kv store that can be swapped | |
#semantics are memcached protocol | |
require 'dalli' | |
class DB | |
def initialize(servers) | |
@dc = Dalli::Client.new(servers) | |
end |
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
/* | |
I have a piece of .NET code that uses Asynchronous sockets that I want to cross | |
compile and run on Mono, however, when I attempt to run it, the AsyncCallback for | |
the BeginSend never gets called. I've boiled down the problem to a very simple | |
example. The example does not ever hit the callback, I have tried the following | |
configurations: | |
OS: Ubuntu 10.10 (Maverick Meerkat) | |
Mono 2.8.2 using Nathan Bridgewater's install shell script | |
Mono 2.10.2 using Nathan Bridgewater's updated shell script |
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
private const string key = "hello"; | |
private const string stringValue = "world!"; | |
private Exception exb; | |
private readonly KetchupClient cli = new KetchupClient(BuildConfiguration(), "default"); | |
private readonly ManualResetEvent mre = new ManualResetEvent(false); | |
[Fact] | |
public void SetWithSuccess() { | |
//have to do this for async operations in unit test framework | |
Reset(); |
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
public enum HostMessageEnum | |
{ | |
SendRequestHeader, | |
SendRequestHeadersComplete, | |
SendRequestBodyStart, | |
SendRequestBodyPart, | |
SendRequestBodyComplete, | |
BeginGetResponse, | |
Error | |
} |