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
^\SIGQUIT: quit | |
PC=0x241db | |
goroutine 1 [IO wait]: | |
net.runtime_pollWait(0x9f4f00, 0x72, 0x0) | |
/usr/local/go/src/pkg/runtime/znetpoll_darwin_amd64.c:118 +0x82 | |
net.(*pollDesc).WaitRead(0xc201474350, 0x23, 0xc200147960) | |
/usr/local/go/src/pkg/net/fd_poll_runtime.go:75 +0x31 | |
net.(*netFD).accept(0xc2014742d0, 0x4d0b18, 0x0, 0xc200147960, 0x23, ...) |
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
# start sync gateway if not already | |
# push pull on device1 | |
http POST localhost:8080/_replicate source="cblite-test" target="http://10.0.2.2:4984/db" continuous:=true | |
http POST localhost:8080/_replicate target="cblite-test" source="http://10.0.2.2:4984/db" continuous:=true | |
# push pull on device2 | |
http POST localhost:8081/_replicate source="cblite-test" target="http://10.0.2.2:4984/db" continuous:=true | |
http POST localhost:8081/_replicate target="cblite-test" source="http://10.0.2.2:4984/db" continuous:=true |
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
type RandomThinker struct { | |
ourTeamId int | |
} | |
func (r *RandomThinker) Start(ourTeamId int) { | |
r.ourTeamId = ourTeamId | |
} | |
func (r RandomThinker) Think(gameState GameState) (bestMove ValidMove) { |
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
public void startReplicationsWithFacebookToken(String accessToken, String email) { | |
Log.d(TAG, "startReplicationsWithFacebookToken()"); | |
httpClient = new CBLiteHttpClient(server); | |
dbInstance = new StdCouchDbInstance(httpClient); | |
// create a local database | |
couchDbConnector = dbInstance.createConnector(DATABASE_NAME, true); |
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
public CBLReplicator(CBLDatabase db, URL remote, boolean continuous, HttpClientFactory clientFacotry, ScheduledExecutorService workExecutor) { | |
this.db = db; | |
this.continuous = continuous; | |
this.workExecutor = workExecutor; | |
this.remote = remote; | |
this.remoteRequestExecutor = Executors.newCachedThreadPool(); | |
if (remote.getQuery() != null && !remote.getQuery().isEmpty()) { |
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
votes := &OutgoingVotes{} | |
votesId := fmt.Sprintf("vote:%s", game.user.Id) | |
err := game.db.Retrieve(votesId, votes) | |
if err != nil { | |
logg.LogTo("MAIN", "Unable to find existing vote doc: %v", votesId) | |
} | |
votes.Id = votesId | |
votes.Turn = game.gameState.Turn |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"time" | |
) | |
/* |
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
class Person { | |
private Document document; | |
private Map<String, Object> properties; | |
public Person() { | |
this(getDatabaseSomehow().createDocument()); | |
} | |
public Person(Document documentParam) { |
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
Query query = view.createQuery(); | |
QueryEnumerator queryEnumerator = query.run(); | |
while (queryEnumerator.hasNext()) { | |
QueryRow row = queryEnumerator.next(); | |
Document document = database.getDocument(row.getDocumentId()); | |
Person person = new Person(document); | |
person.setName(person.getName() + "."); | |
person.save(); | |
} |
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
buildscript { | |
repositories { | |
maven { url 'http://repo1.maven.org/maven2' } | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.7.+' | |
} | |
} | |
apply plugin: 'android-library' | |
apply plugin: 'maven' |
OlderNewer