Skip to content

Instantly share code, notes, and snippets.

public class test {
public static void main(String[] args) throws Exception {
Socket s = new Socket();
s.connect(new InetSocketAddress("localhost", 6021));
s.setSoTimeout(100);
DataInputStream in;
DataOutputStream out;
Regarding the object deltas, I think there are a couple of ways to do it.
I've found a couple of different libraries for diffing objects:
https://github.com/SQiShER/java-object-diff
http://javers.org/documentation
These both seem kind of overkill.
Lets say we have a Person class as follows
// Given the following json object
JsonObject object = new JsonObject();
object.addProperty( "firstName", "Homer" );
object.addProperty( "lastName", "Simpson" );
JsonObject object2 = new JsonObject();
object2.addProperty( "name", "beer" );
object2.addProperty( "colour", "dark" );
=== Current client API ===
client.onClientLogin( callback );
// subscribes the client to 'client logins' - PRESENCE_JOIN is the constant I'm using
client.onClientLogout( callback );
// subscribes 'client logouts' - PRESENCE_REMOVE
client.getConnectedClients( callback );
// sends a PN|Q+ - essentially just a query on C.TOPIC.PRESENCE
=== Current server implementation ===
package io.deepstream;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import java.util.Properties;
public class test {
The main issue is that your line
q.query({uid:"dan"})
is not synchronous. So your promise resolves with undefined. You need to do two things:
1. Pass a callback to your query function so you can retrieve the value of your query
2. Resolve the promise with the result of this query.
So here we're passing a callback to your custom `query` function...
{
"genesis_time": "2019-09-04T14:29:02.563542Z",
"chain_id": "engine",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
{
"app_message": {
"accounts": [
{
"account_number": "0",
"address": "cosmos19s96k8judmxx7jwf3tug7adux5g7k9pmr2yqwm",
"coins": [
{ "amount": "1000", "denom": "dxt" },
{ "amount": "100000000", "denom": "stake" }
],
import { newKit } from '@celo/contractkit'
// import {
// // ensureLeading0x,
// privateKeyToPublicKey,
// trimLeading0x,
// } from '@celo/utils/lib/address'
// import { ECIES } from '@celo/utils/lib/ecies'
// import * as readline from 'readline'
// import {
// serializeSignature,
import Onboard from "@pooltogether/bnc-onboard"
import Web3 from "web3"
let web3 = null
function App() {
const send = async () => {
if (!web3) {
return
}