text:
// source: tendermint/consensus/wal.proto
/**
 * @fileoverview
 * @enhanceable
 * @suppress {missingRequire} reports error on implicit type usages.
 * @suppress {messageConventions} JS Compiler reports an error if a variable or
 *     field starts with 'MSG_' and isn't a translatable message.
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

var gogoproto_gogo_pb = require('../../gogoproto/gogo_pb.js');
goog.object.extend(proto, gogoproto_gogo_pb);
var tendermint_consensus_types_pb = require('../../tendermint/consensus/types_pb.js');
goog.object.extend(proto, tendermint_consensus_types_pb);
var tendermint_types_events_pb = require('../../tendermint/types/events_pb.js');
goog.object.extend(proto, tendermint_types_events_pb);
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.object.extend(proto, google_protobuf_duration_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
goog.exportSymbol('proto.tendermint.consensus.EndHeight', null, global);
goog.exportSymbol('proto.tendermint.consensus.MsgInfo', null, global);
goog.exportSymbol('proto.tendermint.consensus.TimedWALMessage', null, global);
goog.exportSymbol('proto.tendermint.consensus.TimeoutInfo', null, global);
goog.exportSymbol('proto.tendermint.consensus.WALMessage', null, global);
goog.exportSymbol('proto.tendermint.consensus.WALMessage.SumCase', null, global);
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tendermint.consensus.MsgInfo = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.tendermint.consensus.MsgInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.tendermint.consensus.MsgInfo.displayName = 'proto.tendermint.consensus.MsgInfo';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tendermint.consensus.TimeoutInfo = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.tendermint.consensus.TimeoutInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.tendermint.consensus.TimeoutInfo.displayName = 'proto.tendermint.consensus.TimeoutInfo';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tendermint.consensus.EndHeight = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.tendermint.consensus.EndHeight, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.tendermint.consensus.EndHeight.displayName = 'proto.tendermint.consensus.EndHeight';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tendermint.consensus.WALMessage = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tendermint.consensus.WALMessage.oneofGroups_);
};
goog.inherits(proto.tendermint.consensus.WALMessage, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.tendermint.consensus.WALMessage.displayName = 'proto.tendermint.consensus.WALMessage';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tendermint.consensus.TimedWALMessage = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.tendermint.consensus.TimedWALMessage, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.tendermint.consensus.TimedWALMessage.displayName = 'proto.tendermint.consensus.TimedWALMessage';
}

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tendermint.consensus.MsgInfo.prototype.toObject = function(opt_includeInstance) {
  return proto.tendermint.consensus.MsgInfo.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tendermint.consensus.MsgInfo} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.MsgInfo.toObject = function(includeInstance, msg) {
  var f, obj = {
    msg: (f = msg.getMsg()) && tendermint_consensus_types_pb.Message.toObject(includeInstance, f),
    peerId: jspb.Message.getFieldWithDefault(msg, 2, "")
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tendermint.consensus.MsgInfo}
 */
proto.tendermint.consensus.MsgInfo.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tendermint.consensus.MsgInfo;
  return proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tendermint.consensus.MsgInfo} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tendermint.consensus.MsgInfo}
 */
proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new tendermint_consensus_types_pb.Message;
      reader.readMessage(value,tendermint_consensus_types_pb.Message.deserializeBinaryFromReader);
      msg.setMsg(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setPeerId(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tendermint.consensus.MsgInfo.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tendermint.consensus.MsgInfo} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getMsg();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      tendermint_consensus_types_pb.Message.serializeBinaryToWriter
    );
  }
  f = message.getPeerId();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
};

/**
 * optional Message msg = 1;
 * @return {?proto.tendermint.consensus.Message}
 */
proto.tendermint.consensus.MsgInfo.prototype.getMsg = function() {
  return /** @type{?proto.tendermint.consensus.Message} */ (
    jspb.Message.getWrapperField(this, tendermint_consensus_types_pb.Message, 1));
};

/**
 * @param {?proto.tendermint.consensus.Message|undefined} value
 * @return {!proto.tendermint.consensus.MsgInfo} returns this
*/
proto.tendermint.consensus.MsgInfo.prototype.setMsg = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.MsgInfo} returns this
 */
proto.tendermint.consensus.MsgInfo.prototype.clearMsg = function() {
  return this.setMsg(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.MsgInfo.prototype.hasMsg = function() {
  return jspb.Message.getField(this, 1) != null;
};

/**
 * optional string peer_id = 2;
 * @return {string}
 */
proto.tendermint.consensus.MsgInfo.prototype.getPeerId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};

/**
 * @param {string} value
 * @return {!proto.tendermint.consensus.MsgInfo} returns this
 */
proto.tendermint.consensus.MsgInfo.prototype.setPeerId = function(value) {
  return jspb.Message.setProto3StringField(this, 2, value);
};

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.toObject = function(opt_includeInstance) {
  return proto.tendermint.consensus.TimeoutInfo.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tendermint.consensus.TimeoutInfo} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.TimeoutInfo.toObject = function(includeInstance, msg) {
  var f, obj = {
    duration: (f = msg.getDuration()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
    height: jspb.Message.getFieldWithDefault(msg, 2, 0),
    round: jspb.Message.getFieldWithDefault(msg, 3, 0),
    step: jspb.Message.getFieldWithDefault(msg, 4, 0)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tendermint.consensus.TimeoutInfo}
 */
proto.tendermint.consensus.TimeoutInfo.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tendermint.consensus.TimeoutInfo;
  return proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tendermint.consensus.TimeoutInfo} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tendermint.consensus.TimeoutInfo}
 */
proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new google_protobuf_duration_pb.Duration;
      reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
      msg.setDuration(value);
      break;
    case 2:
      var value = /** @type {number} */ (reader.readInt64());
      msg.setHeight(value);
      break;
    case 3:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setRound(value);
      break;
    case 4:
      var value = /** @type {number} */ (reader.readUint32());
      msg.setStep(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tendermint.consensus.TimeoutInfo} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getDuration();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      google_protobuf_duration_pb.Duration.serializeBinaryToWriter
    );
  }
  f = message.getHeight();
  if (f !== 0) {
    writer.writeInt64(
      2,
      f
    );
  }
  f = message.getRound();
  if (f !== 0) {
    writer.writeInt32(
      3,
      f
    );
  }
  f = message.getStep();
  if (f !== 0) {
    writer.writeUint32(
      4,
      f
    );
  }
};

/**
 * optional google.protobuf.Duration duration = 1;
 * @return {?proto.google.protobuf.Duration}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.getDuration = function() {
  return /** @type{?proto.google.protobuf.Duration} */ (
    jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 1));
};

/**
 * @param {?proto.google.protobuf.Duration|undefined} value
 * @return {!proto.tendermint.consensus.TimeoutInfo} returns this
*/
proto.tendermint.consensus.TimeoutInfo.prototype.setDuration = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.TimeoutInfo} returns this
 */
proto.tendermint.consensus.TimeoutInfo.prototype.clearDuration = function() {
  return this.setDuration(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.hasDuration = function() {
  return jspb.Message.getField(this, 1) != null;
};

/**
 * optional int64 height = 2;
 * @return {number}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.getHeight = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};

/**
 * @param {number} value
 * @return {!proto.tendermint.consensus.TimeoutInfo} returns this
 */
proto.tendermint.consensus.TimeoutInfo.prototype.setHeight = function(value) {
  return jspb.Message.setProto3IntField(this, 2, value);
};

/**
 * optional int32 round = 3;
 * @return {number}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.getRound = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};

/**
 * @param {number} value
 * @return {!proto.tendermint.consensus.TimeoutInfo} returns this
 */
proto.tendermint.consensus.TimeoutInfo.prototype.setRound = function(value) {
  return jspb.Message.setProto3IntField(this, 3, value);
};

/**
 * optional uint32 step = 4;
 * @return {number}
 */
proto.tendermint.consensus.TimeoutInfo.prototype.getStep = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};

/**
 * @param {number} value
 * @return {!proto.tendermint.consensus.TimeoutInfo} returns this
 */
proto.tendermint.consensus.TimeoutInfo.prototype.setStep = function(value) {
  return jspb.Message.setProto3IntField(this, 4, value);
};

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tendermint.consensus.EndHeight.prototype.toObject = function(opt_includeInstance) {
  return proto.tendermint.consensus.EndHeight.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tendermint.consensus.EndHeight} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.EndHeight.toObject = function(includeInstance, msg) {
  var f, obj = {
    height: jspb.Message.getFieldWithDefault(msg, 1, 0)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tendermint.consensus.EndHeight}
 */
proto.tendermint.consensus.EndHeight.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tendermint.consensus.EndHeight;
  return proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tendermint.consensus.EndHeight} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tendermint.consensus.EndHeight}
 */
proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {number} */ (reader.readInt64());
      msg.setHeight(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tendermint.consensus.EndHeight.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tendermint.consensus.EndHeight.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tendermint.consensus.EndHeight} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.EndHeight.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getHeight();
  if (f !== 0) {
    writer.writeInt64(
      1,
      f
    );
  }
};

/**
 * optional int64 height = 1;
 * @return {number}
 */
proto.tendermint.consensus.EndHeight.prototype.getHeight = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};

/**
 * @param {number} value
 * @return {!proto.tendermint.consensus.EndHeight} returns this
 */
proto.tendermint.consensus.EndHeight.prototype.setHeight = function(value) {
  return jspb.Message.setProto3IntField(this, 1, value);
};

/**
 * Oneof group definitions for this message. Each group defines the field
 * numbers belonging to that group. When of these fields' value is set, all
 * other fields in the group are cleared. During deserialization, if multiple
 * fields are encountered for a group, only the last value seen will be kept.
 * @private {!Array<!Array<number>>}
 * @const
 */
proto.tendermint.consensus.WALMessage.oneofGroups_ = [[1,2,3,4]];

/**
 * @enum {number}
 */
proto.tendermint.consensus.WALMessage.SumCase = {
  SUM_NOT_SET: 0,
  EVENT_DATA_ROUND_STATE: 1,
  MSG_INFO: 2,
  TIMEOUT_INFO: 3,
  END_HEIGHT: 4
};

/**
 * @return {proto.tendermint.consensus.WALMessage.SumCase}
 */
proto.tendermint.consensus.WALMessage.prototype.getSumCase = function() {
  return /** @type {proto.tendermint.consensus.WALMessage.SumCase} */(jspb.Message.computeOneofCase(this, proto.tendermint.consensus.WALMessage.oneofGroups_[0]));
};

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tendermint.consensus.WALMessage.prototype.toObject = function(opt_includeInstance) {
  return proto.tendermint.consensus.WALMessage.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tendermint.consensus.WALMessage} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.WALMessage.toObject = function(includeInstance, msg) {
  var f, obj = {
    eventDataRoundState: (f = msg.getEventDataRoundState()) && tendermint_types_events_pb.EventDataRoundState.toObject(includeInstance, f),
    msgInfo: (f = msg.getMsgInfo()) && proto.tendermint.consensus.MsgInfo.toObject(includeInstance, f),
    timeoutInfo: (f = msg.getTimeoutInfo()) && proto.tendermint.consensus.TimeoutInfo.toObject(includeInstance, f),
    endHeight: (f = msg.getEndHeight()) && proto.tendermint.consensus.EndHeight.toObject(includeInstance, f)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tendermint.consensus.WALMessage}
 */
proto.tendermint.consensus.WALMessage.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tendermint.consensus.WALMessage;
  return proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tendermint.consensus.WALMessage} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tendermint.consensus.WALMessage}
 */
proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new tendermint_types_events_pb.EventDataRoundState;
      reader.readMessage(value,tendermint_types_events_pb.EventDataRoundState.deserializeBinaryFromReader);
      msg.setEventDataRoundState(value);
      break;
    case 2:
      var value = new proto.tendermint.consensus.MsgInfo;
      reader.readMessage(value,proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader);
      msg.setMsgInfo(value);
      break;
    case 3:
      var value = new proto.tendermint.consensus.TimeoutInfo;
      reader.readMessage(value,proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader);
      msg.setTimeoutInfo(value);
      break;
    case 4:
      var value = new proto.tendermint.consensus.EndHeight;
      reader.readMessage(value,proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader);
      msg.setEndHeight(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tendermint.consensus.WALMessage.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tendermint.consensus.WALMessage.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tendermint.consensus.WALMessage} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.WALMessage.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getEventDataRoundState();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      tendermint_types_events_pb.EventDataRoundState.serializeBinaryToWriter
    );
  }
  f = message.getMsgInfo();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter
    );
  }
  f = message.getTimeoutInfo();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter
    );
  }
  f = message.getEndHeight();
  if (f != null) {
    writer.writeMessage(
      4,
      f,
      proto.tendermint.consensus.EndHeight.serializeBinaryToWriter
    );
  }
};

/**
 * optional tendermint.types.EventDataRoundState event_data_round_state = 1;
 * @return {?proto.tendermint.types.EventDataRoundState}
 */
proto.tendermint.consensus.WALMessage.prototype.getEventDataRoundState = function() {
  return /** @type{?proto.tendermint.types.EventDataRoundState} */ (
    jspb.Message.getWrapperField(this, tendermint_types_events_pb.EventDataRoundState, 1));
};

/**
 * @param {?proto.tendermint.types.EventDataRoundState|undefined} value
 * @return {!proto.tendermint.consensus.WALMessage} returns this
*/
proto.tendermint.consensus.WALMessage.prototype.setEventDataRoundState = function(value) {
  return jspb.Message.setOneofWrapperField(this, 1, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.WALMessage} returns this
 */
proto.tendermint.consensus.WALMessage.prototype.clearEventDataRoundState = function() {
  return this.setEventDataRoundState(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.WALMessage.prototype.hasEventDataRoundState = function() {
  return jspb.Message.getField(this, 1) != null;
};

/**
 * optional MsgInfo msg_info = 2;
 * @return {?proto.tendermint.consensus.MsgInfo}
 */
proto.tendermint.consensus.WALMessage.prototype.getMsgInfo = function() {
  return /** @type{?proto.tendermint.consensus.MsgInfo} */ (
    jspb.Message.getWrapperField(this, proto.tendermint.consensus.MsgInfo, 2));
};

/**
 * @param {?proto.tendermint.consensus.MsgInfo|undefined} value
 * @return {!proto.tendermint.consensus.WALMessage} returns this
*/
proto.tendermint.consensus.WALMessage.prototype.setMsgInfo = function(value) {
  return jspb.Message.setOneofWrapperField(this, 2, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.WALMessage} returns this
 */
proto.tendermint.consensus.WALMessage.prototype.clearMsgInfo = function() {
  return this.setMsgInfo(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.WALMessage.prototype.hasMsgInfo = function() {
  return jspb.Message.getField(this, 2) != null;
};

/**
 * optional TimeoutInfo timeout_info = 3;
 * @return {?proto.tendermint.consensus.TimeoutInfo}
 */
proto.tendermint.consensus.WALMessage.prototype.getTimeoutInfo = function() {
  return /** @type{?proto.tendermint.consensus.TimeoutInfo} */ (
    jspb.Message.getWrapperField(this, proto.tendermint.consensus.TimeoutInfo, 3));
};

/**
 * @param {?proto.tendermint.consensus.TimeoutInfo|undefined} value
 * @return {!proto.tendermint.consensus.WALMessage} returns this
*/
proto.tendermint.consensus.WALMessage.prototype.setTimeoutInfo = function(value) {
  return jspb.Message.setOneofWrapperField(this, 3, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.WALMessage} returns this
 */
proto.tendermint.consensus.WALMessage.prototype.clearTimeoutInfo = function() {
  return this.setTimeoutInfo(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.WALMessage.prototype.hasTimeoutInfo = function() {
  return jspb.Message.getField(this, 3) != null;
};

/**
 * optional EndHeight end_height = 4;
 * @return {?proto.tendermint.consensus.EndHeight}
 */
proto.tendermint.consensus.WALMessage.prototype.getEndHeight = function() {
  return /** @type{?proto.tendermint.consensus.EndHeight} */ (
    jspb.Message.getWrapperField(this, proto.tendermint.consensus.EndHeight, 4));
};

/**
 * @param {?proto.tendermint.consensus.EndHeight|undefined} value
 * @return {!proto.tendermint.consensus.WALMessage} returns this
*/
proto.tendermint.consensus.WALMessage.prototype.setEndHeight = function(value) {
  return jspb.Message.setOneofWrapperField(this, 4, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.WALMessage} returns this
 */
proto.tendermint.consensus.WALMessage.prototype.clearEndHeight = function() {
  return this.setEndHeight(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.WALMessage.prototype.hasEndHeight = function() {
  return jspb.Message.getField(this, 4) != null;
};

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.toObject = function(opt_includeInstance) {
  return proto.tendermint.consensus.TimedWALMessage.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tendermint.consensus.TimedWALMessage} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.TimedWALMessage.toObject = function(includeInstance, msg) {
  var f, obj = {
    time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
    msg: (f = msg.getMsg()) && proto.tendermint.consensus.WALMessage.toObject(includeInstance, f)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tendermint.consensus.TimedWALMessage}
 */
proto.tendermint.consensus.TimedWALMessage.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tendermint.consensus.TimedWALMessage;
  return proto.tendermint.consensus.TimedWALMessage.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tendermint.consensus.TimedWALMessage} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tendermint.consensus.TimedWALMessage}
 */
proto.tendermint.consensus.TimedWALMessage.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setTime(value);
      break;
    case 2:
      var value = new proto.tendermint.consensus.WALMessage;
      reader.readMessage(value,proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader);
      msg.setMsg(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tendermint.consensus.TimedWALMessage.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tendermint.consensus.TimedWALMessage} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.tendermint.consensus.TimedWALMessage.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getTime();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getMsg();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      proto.tendermint.consensus.WALMessage.serializeBinaryToWriter
    );
  }
};

/**
 * optional google.protobuf.Timestamp time = 1;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.getTime = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
};

/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.tendermint.consensus.TimedWALMessage} returns this
*/
proto.tendermint.consensus.TimedWALMessage.prototype.setTime = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.TimedWALMessage} returns this
 */
proto.tendermint.consensus.TimedWALMessage.prototype.clearTime = function() {
  return this.setTime(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.hasTime = function() {
  return jspb.Message.getField(this, 1) != null;
};

/**
 * optional WALMessage msg = 2;
 * @return {?proto.tendermint.consensus.WALMessage}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.getMsg = function() {
  return /** @type{?proto.tendermint.consensus.WALMessage} */ (
    jspb.Message.getWrapperField(this, proto.tendermint.consensus.WALMessage, 2));
};

/**
 * @param {?proto.tendermint.consensus.WALMessage|undefined} value
 * @return {!proto.tendermint.consensus.TimedWALMessage} returns this
*/
proto.tendermint.consensus.TimedWALMessage.prototype.setMsg = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};

/**
 * Clears the message field making it undefined.
 * @return {!proto.tendermint.consensus.TimedWALMessage} returns this
 */
proto.tendermint.consensus.TimedWALMessage.prototype.clearMsg = function() {
  return this.setMsg(undefined);
};

/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.tendermint.consensus.TimedWALMessage.prototype.hasMsg = function() {
  return jspb.Message.getField(this, 2) != null;
};

goog.object.extend(exports, proto.tendermint.consensus);


text:
**************************************
Using Serialbox as an external library
**************************************

This section provides a brief introduction on how to use Serialbox as an external library using the CMake modules of Serialbox.

.. _CMakeModule:

CMake modules
-------------

There are several CMake modules located in ``install/cmake/``. To assist in the loading of the settings of the Serialbox project (e.g include and link directories), Serialbox provides a `find_package <https://cmake.org/cmake/help/v3.0/command/find_package.html>`_ module. In addition, to run the preprocessor script ``pp_ser.py`` a tooling module is provided. For a working example, see ``examples/fortran/perturbation``.

.. _FindSerialbox:

FindSerialbox
^^^^^^^^^^^^^

Try to find Serialbox headers and libraries.

Use this module by invoking find_package with the form::

  find_package(Serialbox
    [version]                  # Minimum version e.g. 2.0
    [REQUIRED]                 # Fail with error if Serialbox is not found
    [COMPONENTS <languages>]   # Components of Serialbox i.e the languages: C++, C, Fortran. C++ is always ON.
  )

Example to find Serialbox headers and `shared` libraries for the C, C++ and Fortran interfaces::

  set(SERIALBOX_USE_SHARED_LIBS ON)
  find_package(Serialbox REQUIRED COMPONENTS C++ C Fortran)

The Serialbox module will look for the `exact` boost version used during compilation and append
the necessary libraries to the ``SERIALBOX_[LANGUAGE]_LIBRARIES`` variable. If Serialbox was
compiled with OpenSSL and/or NetCDF support, the necessary libraries will be appended as well.

Variables used by this module, they can change the default behaviour and need to be set before
calling find_package::

  SERIALBOX_ROOT                  - Set this variable to the root installation of Serialbox if the
                                    module has problems finding the proper installation path.
  SERIALBOX_USE_SHARED_LIBS       - Use the shared libraries (.so or .dylib) of Serialbox.
  SERIALBOX_NO_EXTERNAL_LIBS      - Don't look for external libraries (Boost, NetCDF and OpenSSL)

Variables defined by this module::

  SERIALBOX_FOUND                 - True if headers and requested libraries were found
  SERIALBOX_VERSION               - Version string of Serialbox (e.g "2.0.1")
  SERIALBOX_INCLUDE_DIRS          - The location of the Serialbox headers (i.e to include the
                                    C Interface ${SERIALBOX_INCLUDE_DIRS}/serialbox-c/Serialbox.h)
                                    and possibly the boost headers.
  SERIALBOX_LIBRARY_DIR           - The location of the Serialbox libraries and Fortran mod files.
  SERIALBOX_HAS_C                 - Serialbox was compiled with C support
  SERIALBOX_HAS_FORTRAN           - Serialbox was compiled with Fortran support
  SERIALBOX_CXX_LIBRARIES         - The C++ libraries of Serialbox (libSerialboxCore) and
                                    possibly the external libraries.
  SERIALBOX_C_LIBRARIES           - The C libraries of Serialbox (libSerialboxC) and
                                    possibly the external libraries.
  SERIALBOX_FORTRAN_LIBRARIES     - The Fortran libraries of Serialbox (libSerialboxFortran) and
                                    possibly the external libraries.
  SERIALBOX_PPSER                 - Path to the pp_ser.py script.
  SERIALBOX_BOOST_VERSION         - Boost version used during compilation.
  SERIALBOX_HAS_OPENSSL           - Serialbox was compiled with OpenSSL support.
  SERIALBOX_HAS_NETCDF            - Serialbox was compiled with NetCDF support.

.. _SerialboxTooling:

SerialboxTooling
^^^^^^^^^^^^^^^^

This module contains the ``serialbox_run_pp_ser`` function which is used to preprocess Fortran
source code using the pp_ser.py script.

Function arguments::

  SOURCES       - Sources to preprocess
  OUTPUT_DIR    - Output directory of the the source files. If nothing is specified ${CMAKE_BINARY_DIR}/pp is used.

redpajama_set_name: RedPajamaGithub


text:
window.DOM = {
  isSubmittable: function(element) {
    if (!element) {
      return false;
    }
    if (element.localName !== 'input')
      return false;
    if (element.hasAttribute('submit'))
      return true;
    while (element = element.parentElement) {
      if (element.localName === 'form')
        return true;
    }
    return false;
  },
  isEditable: function(element) {
    if (!element) {
      return false;
    }
    if (element.localName === 'textarea' ||
        element.hasAttribute('contenteditable'))
      return true;
    if (element.localName !== 'input')
      return false;
    var type = element.getAttribute('type');
    switch (type) {
      case 'button':
      case 'checkbox':
      case 'color':
      case 'file':
      case 'hidden':
      case 'image':
      case 'radio':
      case 'reset':
      case 'submit':
      case 'week':
        return false;
    }
    return true;
  },
  isTextElement: function(element) {
    if (!element) {
      return false;
    }
    if (element.localName === 'input' || element.localName === 'textarea') {
      return true;
    }
    while (element) {
      if (element.isContentEditable) {
        return true;
      }
      element = element.parentElement;
    }
    return false;
  },
  nodeSelectorMatch: function(node, selector) {
    if (selector.indexOf('[') === -1 && selector.indexOf(' ') === -1) {
      switch (selector.charAt(0)) {
      case '.':
        return node.className === selector.slice(1).split('.').join(' ');
      case '#':
        return node.id === selector.slice(1);
      }
    }
    var fragment = document.createDocumentFragment();
    fragment.appendChild(node.cloneNode(false));
    return !!fragment.querySelector(selector);
  }
};


text:
@interface GRProSlider : NSSlider

@end

@interface GRProSliderCell : NSSliderCell

@end


text:
Documention
!!!!!!!!!!!

This directory contains source and tools to build the GA4GH schemas
documentation.

The `GA4GH schemas documentation
<http://ga4gh-schemas.readthedocs.org/>`_ is built automatically by
Read the Docs, typically within two minutes of a commit to the master
branch.

Building
@@@@@@@@

To build documentation, type::

  make docs

in the schemas root directory.  The resulting documentation will be in
the ``target/doc/html`` directory.  (You will need certain
prerequisites and, for the moment, you'll have to ferret those out
yourself.)

Building Process
@@@@@@@@@@@@@@@@

The current doc flow is roughly as follows::

  avdl ----1----> avpr ----2----> rst -|
                                       | ----3----> html
                                  rst -|

  |- doc/source/schema/Makefile  -| |--  sphinx  --|
  |------ top-level Makefile ('make docs') --------|

* 1 = avro-tools, downloaded on demand; requires java
* 2 = avpr2rest.py, a custom script in tools/sphinx/
* 3 = sphinx-build, part of the sphinx package

.. warning:: Because we cannot currently run step 1 at Read the Docs,
             it is imperative that developers type `make docs-schema`
             at the top level if avdl files are updated, and then
             commit the changed rst files.

Documentation tips
@@@@@@@@@@@@@@@@@@

Documents are written in `ReStructured Text
<http://sphinx-doc.org/rest.html>`_ using `Sphinx
<http://sphinx-doc.org/>`_.  documentation being extracted from the
schemas.

- Abbreviations are stored in ``epilog.rst``.
- Reference avro elements with ``:avro:key``.


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="reference" name="DC.Type" />
<meta name="DC.Title" content="Using the databaseMetaData optional tool" />
<meta name="abstract" content="The databaseMetaData optional tool creates functions and table functions corresponding to most of the methods in the java.sql.DatabaseMetaData interface." />
<meta name="description" content="The databaseMetaData optional tool creates functions and table functions corresponding to most of the methods in the java.sql.DatabaseMetaData interface." />
<meta content="optional tools, databaseMetaData, databaseMetaData optional tool, tools" name="DC.subject" />
<meta content="optional tools, databaseMetaData, databaseMetaData optional tool, tools" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="ctoolsopttools.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptforeignviews.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucene.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="rtoolsoptdbmetadata" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>Using the databaseMetaData optional tool</title>

Using the databaseMetaData optional tool

The <samp class="codeph">databaseMetaData</samp> optional tool creates functions
and table functions corresponding to most of the methods in the
java.sql.DatabaseMetaData interface.

Before you run the <samp class="codeph">databaseMetaData</samp> optional tool, make sure
that your classpath contains the
Derby jar files, including
<samp class="codeph">derbytools.jar</samp>.

You can load and unload the <samp class="codeph">databaseMetaData</samp> tool by using
the <samp class="codeph">SYSCS_UTIL.SYSCS_REGISTER_TOOL</samp> system procedure. See the
Derby Reference Manual for information about this
procedure.

To load the <samp class="codeph">databaseMetaData</samp> tool, use the following
statement:

call syscs_util.syscs_register_tool( 'databaseMetaData', true )

This command creates metadata functions and table functions in the current
schema. The functions and table functions have the same names as the
corresponding java.sql.DatabaseMetaData methods which they wrap. Once you
have loaded this tool, you can filter and join these functions to create
powerful metadata queries. For instance, the following query lists the column
names and datatypes for all columns in tables created by users:

select t.table_schem, t.table_name, c.column_name, c.type_name
from table( getTables( null, '%', '%' ) ) t,
     table( getColumns( null, '%', '%', '%') ) c
where c.table_schem = t.table_schem
and c.table_name = t.table_name
and t.table_type = 'TABLE'
order by table_schem, table_name, column_name

A few DatabaseMetaData methods take array arguments. Because those
arguments cannot be represented as
Derby types, the arguments
are eliminated. This means that the trailing types arguments to
getTables() and getUDTs() have been eliminated. In addition, the
following DatabaseMetaData methods do not have corresponding metadata
routines:

getRowIdLifetime() is eliminated because
Derby does not provide an
implementation of java.sql.RowIdLifetime.

getSchemas() is eliminated because
Derby does not support
overloads. The more general getSchemas( String, String ) method is
included.

supportsConvert() is eliminated because
Derby does not support
overloads. The more general supportsConvert( int, int ) is included.

When you have finished joining metadata results, you can drop this package of
functions and table functions as follows:

call syscs_util.syscs_register_tool( 'databaseMetaData', false )

Parent topic: Optional tools

Related reference

Using the foreignViews optional tool

Using the luceneSupport optional tool


text:
package org.apache.camel.component.jms;

import javax.jms.ConnectionFactory;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;

import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class JmsSelectorInTest extends CamelTestSupport {

    @Test
    public void testJmsSelectorIn() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Carlsberg", "Santa Rita");

        template.sendBodyAndHeader("activemq:queue:foo", "Carlsberg", "drink", "beer");
        template.sendBodyAndHeader("activemq:queue:foo", "Coca Cola", "drink", "soft");
        template.sendBodyAndHeader("activemq:queue:foo", "Santa Rita", "drink", "wine");

        mock.assertIsSatisfied();

        // and there should also only be 2 if browsing as the selector was configured in the route builder
        JmsQueueEndpoint endpoint = context.getEndpoint("activemq:queue:foo", JmsQueueEndpoint.class);
        assertEquals(2, endpoint.getExchanges().size());
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();

        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        JmsComponent component = jmsComponentAutoAcknowledge(connectionFactory);
        camelContext.addComponent("activemq", component);
        return camelContext;
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                JmsEndpoint endpoint = context.getEndpoint("activemq:queue:foo", JmsEndpoint.class);
                endpoint.setSelector("drink IN ('beer', 'wine')");

                from(endpoint).to("log:drink").to("mock:result");
            }
        };
    }
}


text:
require 'spec_helper'

describe "Cart" do
  it "shows cart icon on non-cart pages" do
    visit spree.root_path
    lambda { find("li#link-to-cart a") }.should_not raise_error(Capybara::ElementNotFound)
  end

  it "hides cart icon on cart page" do
    visit spree.cart_path
    lambda { find("li#link-to-cart a") }.should raise_error(Capybara::ElementNotFound)
  end

  it "prevents double clicking the remove button on cart", :js => true do
    @product = create(:product, :name => "RoR Mug", :on_hand => 1)

    visit spree.root_path
    click_link "RoR Mug"
    click_button "add-to-cart-button"

    # prevent form submit to verify button is disabled
    page.execute_script("$('#update-cart').submit(function(){return false;})")

    page.should_not have_selector('button#update-button[disabled]')
    page.find(:css, '.delete img').click
    page.should have_selector('button#update-button[disabled]')
  end

  # Regression test for #2006
  it "does not error out with a 404 when GET'ing to /orders/populate" do
    visit '/orders/populate'
    within(".error") do
      page.should have_content(I18n.t(:populate_get_error))
    end
  end

  it 'allows you to remove an item from the cart', :js => true do
    create(:product, :name => "RoR Mug", :on_hand => 1)
    visit spree.root_path
    click_link "RoR Mug"
    click_button "add-to-cart-button"
    within("#line_items") do
      click_link "delete_line_item_1"
    end
    page.should_not have_content("Line items quantity must be an integer")
  end
end


text:
using System.Threading.Tasks;

namespace Ixy.AppService.Interface
{
    public interface IEmailSender
    {
        Task SendEmailAsync(string email, string subject, string message);
    }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Login_model extends CI_Model {

	public function accountCheck(){
		$qury = $this->db->count_all('admin');
		if($qury == 0){
			return true;
		}else{
			return false;
		}
	}

	public function userCheck(){
		$username = $this->input->post('username');
		$password = $this->input->post('password');
		$now = date('d-m-Y H:i:s');

		$kueri = $this->db->where('USERNAME', $username)->where('PASSWORD', md5($password))->get('admin');
		if($kueri->num_rows() > 0){
			$data = array(
				'username'	=> $kueri->row()->USERNAME,
				'logged_in'	=> true,
				'role'		=> $kueri->row()->ROLE
			);

			$this->session->set_userdata($data);
			$id = $kueri->row()->ID_ADMIN;
			$this->db->set('LAST_LOGIN', $now)->where('ID_ADMIN', $id)->update('admin');
			return true;
		}else{
			return false;
		}
	}

}

/* End of file Login_model.php */
/* Location: ./application/models/Login_model.php */


text:
import { Injectable } from "@angular/core";

const randomElement = <T>(items: any[T]): T => {
    return items[Math.floor(Math.random() * items.length)];
}

export class Category {
    uniqueIdentifier: number;
    wildcard: boolean;
    name: string;

    constructor(id: number, nm: string, wildcard?: boolean) {
        this.uniqueIdentifier = id;
        this.wildcard = wildcard;
        this.name = nm;
    }
}

export class Item {
    description: string;
    category: Category;
    title: string;
    price: number;
    img: string;

    constructor(title: string, img: string, desc: string, cat: Category, price: number) {
        this.category = cat;
        this.description = desc;
        this.price = price;
        this.title = title;
        this.img = img;
    }
}

export function randomCategories(): Category[] {
    let categories: Category[] = [];
    let defaults = ["Gold", "Silver", "Bronze"];
    let length = 3;

    for (let i = 0; i < length; i++) {
        categories.push(new Category(i, defaults[i]));
    }

    return categories;
}

const descPlaceholder = `
    This silver cup is from 1945 and is in great condition.
    Made by XX it was created specifically as part of a set.
`

export function randomItems(length: number, categories: Category[]): Item[] {
    let items: Item[] = [];
    let title = "Product";
    let image = "images/silver.jpg";
    let desc = descPlaceholder;
    let price = 10.0;

    for (let i = 0; i < length; i++) {
        const randomCategory = randomElement<Category>(categories);
        items.push(new Item(title, image, desc, randomCategory, price));
    }

    return items;
}

@Injectable()
export class Model {
    items: Item[];
    categories: Category[];

    constructor() {
        this.categories = randomCategories();
        this.items = randomItems(6, this.categories);
        this.categories.unshift(new Category(this.categories.length, "All", true));
    }

    itemsWithCategory(category: Category): number {
        let occurances = 0;
        this.items.forEach(item => {
            occurances += item.category == category ? 1 : 0;
        });
        return occurances;
    }

    wildcardCategory(): Category {
        let wildcard = null;

        this.categories.forEach(category => {
            if (category.wildcard) {
                wildcard = category;
            }
        });

        return wildcard;
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.drivelabels.v2beta.model;

/**
 * The capabilities related to this choice on applied metadata.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Drive Labels API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities extends com.google.api.client.json.GenericJson {

  /**
   * Whether the user can read related applied metadata on items.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean canRead;

  /**
   * Whether the user can use this choice in search queries.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean canSearch;

  /**
   * Whether the user can select this choice on an item.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean canSelect;

  /**
   * Whether the user can read related applied metadata on items.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getCanRead() {
    return canRead;
  }

  /**
   * Whether the user can read related applied metadata on items.
   * @param canRead canRead or {@code null} for none
   */
  public GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities setCanRead(java.lang.Boolean canRead) {
    this.canRead = canRead;
    return this;
  }

  /**
   * Whether the user can use this choice in search queries.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getCanSearch() {
    return canSearch;
  }

  /**
   * Whether the user can use this choice in search queries.
   * @param canSearch canSearch or {@code null} for none
   */
  public GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities setCanSearch(java.lang.Boolean canSearch) {
    this.canSearch = canSearch;
    return this;
  }

  /**
   * Whether the user can select this choice on an item.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getCanSelect() {
    return canSelect;
  }

  /**
   * Whether the user can select this choice on an item.
   * @param canSelect canSelect or {@code null} for none
   */
  public GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities setCanSelect(java.lang.Boolean canSelect) {
    this.canSelect = canSelect;
    return this;
  }

  @Override
  public GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities set(String fieldName, Object value) {
    return (GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities) super.set(fieldName, value);
  }

  @Override
  public GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities clone() {
    return (GoogleAppsDriveLabelsV2betaFieldSelectionOptionsChoiceAppliedCapabilities) super.clone();
  }

}


text:
#ifndef _DECAF_INTERNAL_NET_URITYPE_H_
#define _DECAF_INTERNAL_NET_URITYPE_H_

#include <string>
#include <decaf/util/Config.h>

namespace decaf {
namespace internal {
namespace net {

    /**
     * Basic type object that holds data that composes a given URI
     */
    class DECAF_API URIType {
    private:

        std::string source;
        std::string scheme;
        std::string schemeSpecificPart;
        std::string authority;
        std::string userinfo;
        std::string host;
        int port;
        std::string path;
        std::string query;
        std::string fragment;
        bool opaque;
        bool absolute;
        bool serverAuthority;
        bool valid;

    public:

        URIType( const std::string& source ) : source( source ),
                                               scheme(),
                                               schemeSpecificPart(),
                                               authority(),
                                               userinfo(),
                                               host(),
                                               port( -1 ),
                                               path(),
                                               query(),
                                               fragment(),
                                               opaque( false ),
                                               absolute( false ),
                                               serverAuthority( false ),
                                               valid( false ) {
        }

        URIType() : source(),
                    scheme(),
                    schemeSpecificPart(),
                    authority(),
                    userinfo(),
                    host(),
                    port( -1 ),
                    path(),
                    query(),
                    fragment(),
                    opaque( false ),
                    absolute( false ),
                    serverAuthority( false ),
                    valid( false ) {
        }

        virtual ~URIType() {}

        /**
         * Gets the source URI string that was parsed to obtain this URIType
         * instance and the resulting data,
         * @returns the source URI string
         */
        std::string getSource() const {
            return this->source;
        }

        /**
         * Sets the source URI string that was parsed to obtain this URIType
         * instance and the resulting data,
         * @param source - the source URI string
         */
        void setSource( const std::string& source ) {
            this->source = source;
        }

        /**
         * Gets the Scheme of the URI, e.g. scheme ("http"/"ftp"/...).
         * @return scheme part string.
         */
        std::string getScheme() const {
            return scheme;
        }

        /**
         * Sets the Scheme of the URI, e.g. scheme ("http"/"ftp"/...).
         * @param scheme - scheme part string.
         */
        void setScheme( const std::string& scheme ) {
            this->scheme = scheme;
        }

        /**
         * Gets the Scheme Specific Part of the URI.
         * @return scheme specific part string.
         */
        std::string getSchemeSpecificPart() const {
            return schemeSpecificPart;
        }

        /**
         * Sets the Scheme Specific Part of the URI.
         * @param schemeSpecificPart - scheme specific part string.
         */
        void setSchemeSpecificPart( const std::string& schemeSpecificPart ) {
            this->schemeSpecificPart = schemeSpecificPart;
        }

        /**
         * Gets the Authority of the URI.
         * @return Authority part string.
         */
        std::string getAuthority() const {
            return authority;
        }

        /**
         * Sets the Authority of the URI.
         * @param authority Authority part string.
         */
        void setAuthority( const std::string& authority ) {
            this->authority = authority;
        }

        /**
         * Gets the user info part of the URI, e.g. user name, as in
         * http://user:passwd@host:port/
         * @return user info part string.
         */
        std::string getUserInfo() const {
            return userinfo;
        }

        /**
         * Sets the user info part of the URI, e.g. user name, as in
         * http://user:passwd@host:port/
         * @param userinfo - user info part string.
         */
        void setUserInfo( const std::string& userinfo ) {
            this->userinfo = userinfo;
        }

        /**
         * Gets the Host name part of the URI.
         * @return Host name part string.
         */
        std::string getHost() const {
            return host;
        }

        /**
         * Sets the Host name part of the URI.
         * @param host - Host name part string.
         */
        void setHost( const std::string& host ) {
            this->host = host;
        }

        /**
         * Gets the port part of the URI.
         * @return port part string, -1 if not set.
         */
        int getPort() const {
            return port;
        }

        /**
         * Sets the port part of the URI.
         * @param port - port part string, -1 if not set.
         */
        void setPort( int port ) {
            this->port = port;
        }

        /**
         * Gets the Path part of the URI.
         * @return Path part string.
         */
        std::string getPath() const {
            return path;
        }

        /**
         * Sets the Path part of the URI.
         * @param path - Path part string.
         */
        void setPath( const std::string& path ) {
            this->path = path;
        }

        /**
         * Gets the Query part of the URI.
         * @return Query part string.
         */
        std::string getQuery() const {
            return query;
        }

        /**
         * Sets the Query part of the URI.
         * @param query - Query part string.
         */
        void setQuery( const std::string& query ) {
            this->query = query;
        }

        /**
         * Gets the Fragment part of the URI.
         * @return Fragment part string.
         */
        std::string getFragment() const {
            return fragment;
        }

        /**
         * Sets the Fragment part of the URI.
         * @param fragment - Fragment part string.
         */
        void setFragment( const std::string& fragment ) {
            this->fragment = fragment;
        }

        /**
         * Gets if the URI is Opaque.
         * @return true if opaque.
         */
        bool isOpaque() const {
            return opaque;
        }

        /**
         * Sets if the URI is Opaque.
         * @param opaque true if opaque.
         */
        void setOpaque( bool opaque ) {
            this->opaque = opaque;
        }

        /**
         * Gets if the URI is Absolute.
         * @return true if Absolute.
         */
        bool isAbsolute() const {
            return absolute;
        }

        /**
         * Sets if the URI is Absolute.
         * @param absolute - true if Absolute.
         */
        void setAbsolute( bool absolute ) {
            this->absolute = absolute;
        }

        /**
         * Gets if the URI is a Server Authority.
         * @return true if Server Authority.
         */
        bool isServerAuthority() const {
            return serverAuthority;
        }

        /**
         * Sets if the URI is a Server Authority.
         * @param serverAuthority - true if Server Authority.
         */
        void setServerAuthority( bool serverAuthority ) {
            this->serverAuthority = serverAuthority;
        }

        /**
         * Gets if the URI is valid, meaning that the source has been set and
         * parsed and all relevant data fields have been set.
         * @returns true if the URIType contains valid data.
         */
        bool isValid() const {
            return valid;
        }

        /**
         * Sets if the URI is valid, meaning that the source has been set and
         * parsed and all relevant data fields have been set.
         * @param valid - true if the URIType contains valid data.
         */
        void setValid( bool valid ) {
            this->valid = valid;
        }

    };

}}}

#endif /* _DECAF_INTERNAL_NET_URITYPE_H_ */


text:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class StageGameOverMenu : MonoBehaviour
{
#pragma warning disable 0649
    [SerializeField]
    private string quitScene = "Title";
    [SerializeField]
    private Text scoreNumberText, highScoreNumberText;
    [SerializeField]
    private GameObject highScoreIndicator;
    [SerializeField]
    private float showcaseModeCooldown = 60f;
    [SerializeField]
    private float quitShiftTime;
    [SerializeField]
    private AudioSource musicSource;
    [SerializeField]
    private float retryTransitionDuration = .5f;
#pragma warning restore 0649

    private float BGGoalAlpha;
    private float lastGameOverTime;
    private bool gameOverActive;

    private Animator menuAnimator;

    private void Awake()
    {
        menuAnimator = GetComponent<Animator>();
    }

    public void Trigger(int score)
    {
        lastGameOverTime = Time.time;

        gameOverActive = true;
        PauseManager.disablePause = true;

        menuAnimator.SetBool("Active", true);

        musicSource.Play();

        int currentHighScore = PrefsHelper.getHighScore(gameObject.scene.name);
        if (highScoreIndicator != null)
            highScoreIndicator.SetActive(score > currentHighScore);
        if (score > currentHighScore)
        {
            currentHighScore = score;
            PrefsHelper.setHighScore(gameObject.scene.name, currentHighScore);
        }
        setNumber(scoreNumberText, score);
        setNumber(highScoreNumberText, currentHighScore);
	}

    void Update()
    {
        if (gameOverActive
            && GameController.instance.ShowcaseMode
            && Time.time > lastGameOverTime + showcaseModeCooldown)
        {
            GameMenu.subMenu = GameMenu.SubMenu.Splash;
            quit();
        }
    }

    public void retry()
    {
        // TODO callback to stage FSM
        menuAnimator.SetBool("Active", false);
        Invoke("EndRetryTransition", retryTransitionDuration);
    }

    void EndRetryTransition()
    {
        PauseManager.disablePause = false;
        musicSource.Stop();
    }

    public void quit()
    {
        menuAnimator.SetTrigger("Quit");
        GameController.instance.sceneShifter.startShift(quitScene, quitShiftTime);
        enabled = false;
    }

    void setNumber(Text textComponent, int score)
    {
        textComponent.text = textComponent.text.Substring(0, textComponent.text.Length - 3);

        int number = score;
        textComponent.text += number.ToString("D3");
    }
}


text:
' Copyright (c) 2015 ZZZ Projects. All rights reserved
' Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods)
' Website: http://www.zzzprojects.com/
' Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927
' All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library

Public Module Extensions_169

	''' <summary>
	'''     Multiplies two specified  values.
	''' </summary>
	''' <param name="d1">The multiplicand.</param>
	''' <param name="d2">The multiplier.</param>
	''' <returns>The result of multiplying  and .</returns>
	<System.Runtime.CompilerServices.Extension> _
	Public Function Multiply(d1 As [Decimal], d2 As [Decimal]) As [Decimal]
		Return [Decimal].Multiply(d1, d2)
	End Function
End Module


text:
import { Component, Input, OnInit, AfterViewInit, ChangeDetectorRef } from '@angular/core';
import { UserSkill, RatingToText } from '../shared/user-skill/user-skill.model';

@Component({
  selector: 'app-user-skill-card',
  templateUrl: 'user-skill-card.component.html',
  styleUrls: ['user-skill-card.component.scss']
})

export class UserSkillCardComponent implements OnInit, AfterViewInit {
  @Input() userSkill: UserSkill;

  constructor(
    private _changeDetectionRef: ChangeDetectorRef,
    private ratingToText: RatingToText) { }

  // Trigger change detection to let angular know that we expect a binded value to be changed after ngOnInit.
  // Sliders in card will update their value based on passed in value, userSkill
  ngAfterViewInit(): void {
      this._changeDetectionRef.detectChanges();
  }

  ngOnInit() {
  }

}


text:
require 'rubygems'
require_relative '../lib/engine'
require 'rspec'

RSpec.configure do |config|
end


text:
package networkdb

import (
	"fmt"
	"time"

	"github.com/Sirupsen/logrus"
	"github.com/hashicorp/serf/serf"
)

type networkData struct {
	LTime    serf.LamportTime
	ID       string
	NodeName string
	Leaving  bool
}

type networkPushPull struct {
	LTime    serf.LamportTime
	Networks []networkData
}

type delegate struct {
	nDB *NetworkDB
}

func (d *delegate) NodeMeta(limit int) []byte {
	return []byte{}
}

func (nDB *NetworkDB) handleNetworkEvent(nEvent *networkEventData) bool {
	// Update our local clock if the received messages has newer
	// time.
	nDB.networkClock.Witness(nEvent.LTime)

	nDB.Lock()
	defer nDB.Unlock()

	nodeNetworks, ok := nDB.networks[nEvent.NodeName]
	if !ok {
		// We haven't heard about this node at all.  Ignore the leave
		if nEvent.Event == networkLeave {
			return false
		}

		nodeNetworks = make(map[string]*network)
		nDB.networks[nEvent.NodeName] = nodeNetworks
	}

	if n, ok := nodeNetworks[nEvent.NetworkID]; ok {
		// We have the latest state. Ignore the event
		// since it is stale.
		if n.ltime >= nEvent.LTime {
			return false
		}

		n.ltime = nEvent.LTime
		n.leaving = nEvent.Event == networkLeave
		if n.leaving {
			n.leaveTime = time.Now()
		}

		return true
	}

	if nEvent.Event == networkLeave {
		return false
	}

	// This remote network join is being seen the first time.
	nodeNetworks[nEvent.NetworkID] = &network{
		id:    nEvent.NetworkID,
		ltime: nEvent.LTime,
	}

	nDB.networkNodes[nEvent.NetworkID] = append(nDB.networkNodes[nEvent.NetworkID], nEvent.NodeName)
	return true
}

func (nDB *NetworkDB) handleTableEvent(tEvent *tableEventData) bool {
	// Update our local clock if the received messages has newer
	// time.
	nDB.tableClock.Witness(tEvent.LTime)

	if entry, err := nDB.getEntry(tEvent.TableName, tEvent.NetworkID, tEvent.Key); err == nil {
		// We have the latest state. Ignore the event
		// since it is stale.
		if entry.ltime >= tEvent.LTime {
			return false
		}
	}

	entry := &entry{
		ltime:    tEvent.LTime,
		node:     tEvent.NodeName,
		value:    tEvent.Value,
		deleting: tEvent.Event == tableEntryDelete,
	}

	if entry.deleting {
		entry.deleteTime = time.Now()
	}

	nDB.Lock()
	nDB.indexes[byTable].Insert(fmt.Sprintf("/%s/%s/%s", tEvent.TableName, tEvent.NetworkID, tEvent.Key), entry)
	nDB.indexes[byNetwork].Insert(fmt.Sprintf("/%s/%s/%s", tEvent.NetworkID, tEvent.TableName, tEvent.Key), entry)
	nDB.Unlock()

	var op opType
	switch tEvent.Event {
	case tableEntryCreate:
		op = opCreate
	case tableEntryUpdate:
		op = opUpdate
	case tableEntryDelete:
		op = opDelete
	}

	nDB.broadcaster.Write(makeEvent(op, tEvent.TableName, tEvent.NetworkID, tEvent.Key, tEvent.Value))
	return true
}

func (nDB *NetworkDB) handleCompound(buf []byte) {
	// Decode the parts
	trunc, parts, err := decodeCompoundMessage(buf[1:])
	if err != nil {
		logrus.Errorf("Failed to decode compound request: %v", err)
		return
	}

	// Log any truncation
	if trunc > 0 {
		logrus.Warnf("Compound request had %d truncated messages", trunc)
	}

	// Handle each message
	for _, part := range parts {
		nDB.handleMessage(part)
	}
}

func (nDB *NetworkDB) handleTableMessage(buf []byte) {
	var tEvent tableEventData
	if err := decodeMessage(buf[1:], &tEvent); err != nil {
		logrus.Errorf("Error decoding table event message: %v", err)
		return
	}

	if rebroadcast := nDB.handleTableEvent(&tEvent); rebroadcast {
		// Copy the buffer since we cannot rely on the slice not changing
		newBuf := make([]byte, len(buf))
		copy(newBuf, buf)

		nDB.RLock()
		n, ok := nDB.networks[nDB.config.NodeName][tEvent.NetworkID]
		nDB.RUnlock()

		if !ok {
			return
		}

		broadcastQ := n.tableBroadcasts
		broadcastQ.QueueBroadcast(&tableEventMessage{
			msg:   newBuf,
			id:    tEvent.NetworkID,
			tname: tEvent.TableName,
			key:   tEvent.Key,
			node:  nDB.config.NodeName,
		})
	}
}

func (nDB *NetworkDB) handleNetworkMessage(buf []byte) {
	var nEvent networkEventData
	if err := decodeMessage(buf[1:], &nEvent); err != nil {
		logrus.Errorf("Error decoding network event message: %v", err)
		return
	}

	if rebroadcast := nDB.handleNetworkEvent(&nEvent); rebroadcast {
		// Copy the buffer since it we cannot rely on the slice not changing
		newBuf := make([]byte, len(buf))
		copy(newBuf, buf)

		nDB.networkBroadcasts.QueueBroadcast(&networkEventMessage{
			msg:  newBuf,
			id:   nEvent.NetworkID,
			node: nEvent.NodeName,
		})
	}
}

func (nDB *NetworkDB) handleBulkSync(buf []byte) {
	var bsm bulkSyncMessage
	if err := decodeMessage(buf[1:], &bsm); err != nil {
		logrus.Errorf("Error decoding bulk sync message: %v", err)
		return
	}

	if bsm.LTime > 0 {
		nDB.tableClock.Witness(bsm.LTime)
	}

	nDB.handleMessage(bsm.Payload)

	// Don't respond to a bulk sync which was not unsolicited
	if !bsm.Unsolicited {
		nDB.RLock()
		ch, ok := nDB.bulkSyncAckTbl[bsm.NodeName]
		nDB.RUnlock()
		if ok {
			close(ch)
		}

		return
	}

	if err := nDB.bulkSyncNode(bsm.Networks, bsm.NodeName, false); err != nil {
		logrus.Errorf("Error in responding to bulk sync from node %s: %v", nDB.nodes[bsm.NodeName].Addr, err)
	}
}

func (nDB *NetworkDB) handleMessage(buf []byte) {
	msgType := messageType(buf[0])

	switch msgType {
	case networkEventMsg:
		nDB.handleNetworkMessage(buf)
	case tableEventMsg:
		nDB.handleTableMessage(buf)
	case compoundMsg:
		nDB.handleCompound(buf)
	case bulkSyncMsg:
		nDB.handleBulkSync(buf)
	default:
		logrus.Errorf("%s: unknown message type %d payload = %v", nDB.config.NodeName, msgType, buf[:8])
	}
}

func (d *delegate) NotifyMsg(buf []byte) {
	if len(buf) == 0 {
		return
	}

	d.nDB.handleMessage(buf)
}

func (d *delegate) GetBroadcasts(overhead, limit int) [][]byte {
	return d.nDB.networkBroadcasts.GetBroadcasts(overhead, limit)
}

func (d *delegate) LocalState(join bool) []byte {
	d.nDB.RLock()
	defer d.nDB.RUnlock()

	pp := networkPushPull{
		LTime: d.nDB.networkClock.Time(),
	}

	for name, nn := range d.nDB.networks {
		for _, n := range nn {
			pp.Networks = append(pp.Networks, networkData{
				LTime:    n.ltime,
				ID:       n.id,
				NodeName: name,
				Leaving:  n.leaving,
			})
		}
	}

	buf, err := encodeMessage(networkPushPullMsg, &pp)
	if err != nil {
		logrus.Errorf("Failed to encode local network state: %v", err)
		return nil
	}

	return buf
}

func (d *delegate) MergeRemoteState(buf []byte, isJoin bool) {
	if len(buf) == 0 {
		logrus.Error("zero byte remote network state received")
		return
	}

	if messageType(buf[0]) != networkPushPullMsg {
		logrus.Errorf("Invalid message type %v received from remote", buf[0])
	}

	pp := networkPushPull{}
	if err := decodeMessage(buf[1:], &pp); err != nil {
		logrus.Errorf("Failed to decode remote network state: %v", err)
		return
	}

	if pp.LTime > 0 {
		d.nDB.networkClock.Witness(pp.LTime)
	}

	for _, n := range pp.Networks {
		nEvent := &networkEventData{
			LTime:     n.LTime,
			NodeName:  n.NodeName,
			NetworkID: n.ID,
			Event:     networkJoin,
		}

		if n.Leaving {
			nEvent.Event = networkLeave
		}

		d.nDB.handleNetworkEvent(nEvent)
	}

}


text:
package com.linecorp.armeria.server.jetty;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;

import javax.annotation.Nullable;

import org.eclipse.jetty.io.ArrayByteBufferPool;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
import org.eclipse.jetty.util.thread.Scheduler;

import io.netty.util.concurrent.GlobalEventExecutor;

final class ArmeriaConnector extends ContainerLifeCycle implements Connector {

    private static final String PROTOCOL_NAME = "armeria";
    private static final List<String> PROTOCOL_NAMES = Collections.singletonList(PROTOCOL_NAME);

    private final Server server;
    private final HttpConfiguration httpConfig;
    private final Executor executor;
    private final Scheduler scheduler;
    private final ByteBufferPool byteBufferPool;
    private final ArmeriaConnectionFactory connectionFactory;
    private final Collection<ConnectionFactory> connectionFactories;

    ArmeriaConnector(Server server) {
        this.server = server;
        executor = server.getThreadPool();

        final HttpConfiguration httpConfig = server.getBean(HttpConfiguration.class);
        this.httpConfig = httpConfig != null ? httpConfig : new HttpConfiguration();

        final Scheduler scheduler = server.getBean(Scheduler.class);
        this.scheduler = scheduler != null ? scheduler : new ScheduledExecutorScheduler();

        final ByteBufferPool byteBufferPool = server.getBean(ByteBufferPool.class);
        this.byteBufferPool = byteBufferPool != null ? byteBufferPool : new ArrayByteBufferPool();

        addBean(server, false);
        addBean(executor);
        unmanage(executor);
        addBean(this.httpConfig);
        addBean(this.scheduler);
        addBean(this.byteBufferPool);

        connectionFactory = new ArmeriaConnectionFactory();
        connectionFactories = Collections.singleton(connectionFactory);
    }

    @Override
    public Object getTransport() {
        return this;
    }

    @Override
    public Server getServer() {
        return server;
    }

    public HttpConfiguration getHttpConfiguration() {
        return httpConfig;
    }

    @Override
    public Executor getExecutor() {
        return executor;
    }

    @Override
    public Scheduler getScheduler() {
        return scheduler;
    }

    @Override
    public ByteBufferPool getByteBufferPool() {
        return byteBufferPool;
    }

    @Nullable
    @Override
    public ConnectionFactory getConnectionFactory(String nextProtocol) {
        return PROTOCOL_NAME.equals(nextProtocol) ? connectionFactory : null;
    }

    @Nullable
    @Override
    @SuppressWarnings("unchecked")
    public <T> T getConnectionFactory(Class<T> factoryType) {
        return factoryType == ArmeriaConnectionFactory.class ? (T) connectionFactory : null;
    }

    @Override
    public ConnectionFactory getDefaultConnectionFactory() {
        return connectionFactory;
    }

    @Override
    public Collection<ConnectionFactory> getConnectionFactories() {
        return connectionFactories;
    }

    @Override
    public List<String> getProtocols() {
        return PROTOCOL_NAMES;
    }

    @Override
    public long getIdleTimeout() {
        return 0;
    }

    @Override
    public Collection<EndPoint> getConnectedEndPoints() {
        return Collections.emptyList();
    }

    @Override
    public String getName() {
        return "armeria";
    }

    @Override
    public Future<Void> shutdown() {
        return GlobalEventExecutor.INSTANCE.newSucceededFuture(null);
    }

    private static final class ArmeriaConnectionFactory implements ConnectionFactory {
        @Override
        public String getProtocol() {
            return PROTOCOL_NAME;
        }

        @Override
        public List<String> getProtocols() {
            return PROTOCOL_NAMES;
        }

        @Override
        public Connection newConnection(Connector connector, EndPoint endPoint) {
            throw new UnsupportedOperationException();
        }
    }
}


text:
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

(i.e.,  [0,1,2,4,5,6,7] might become  [4,5,6,7,0,1,2]).

Find the minimum element.

The array may contain duplicates.

## Example 1:
```
Input: [1,3,5]
Output: 1
```
## Example 2:
```
Input: [2,2,2,0,1]
Output: 0
```

### Note:
- This is a follow up problem to Find Minimum in Rotated Sorted Array.
- Would allow duplicates affect the run-time complexity? How and why?

#Array #Binary Search

#Similar questions [#33](../p033m/README.md) [#81](../p081m/README.md) [#153](../p153m/README.md) [#154](../154h/README.md)


text:
module.exports = require('/application/base/class').extend(function() {
	/* Require
	-------------------------------*/
	var $ = jQuery;

	/* Constants
	-------------------------------*/
	/* Public.Properties
	-------------------------------*/
	/* Protected Properties
	-------------------------------*/
	/* Private Properties
	-------------------------------*/
	/* Magic
	-------------------------------*/
	/* Public.Methods
	-------------------------------*/
	this.response = function(request) {
		var data = request.data;

		//if nothing was checked
		if(!data.action) {
			this.Controller().notify('Error', 'No bulk action chosen.', 'error');
			window.history.back();
			//do nothing
			return this;
		}

		//if nothing was checked
		if(!data.id || !data.id.length) {
			this.Controller().notify('Error', 'No items were chosen.', 'error');
			window.history.back();
			//do nothing
			return;
		}

		//what is the url base
		var url =  '/{{name}}/' + data.action + '/';

		//call the batch
		var batch = this.Controller().package('batch');

		//prepare the batch query
		for(var i = 0; i < data.id.length; i++) {
			batch.add(url + data.id[i]);
		}

		//call the batch remove
		batch.send(function(error, response) {
			if(error) {
				this.Controller().notify('Error', error, 'error');
				return;
			}

			if(response.error) {
				this.Controller().notify('Error', response.message, 'error');
				return;
			}

			for(var errors = false, i = 0; i < response.length; i++) {
				if(response[i].error && response[i].message) {
					errors = true;
					this.Controller().notify('Error', response[i].message, 'error');
				}
			}

			if(!errors) {
				this.Controller().notify('Success', 'Bulk Action ' + data.action + ' successful!', 'success');
			}

			window.history.back();
		}.bind(this));

		return this;
	};

	/* Protected Methods
	-------------------------------*/
	/* Private Methods
	-------------------------------*/
}).singleton();


text:
// -*- Mode:C++; Coding:us-ascii-unix; fill-column:158 -*-
/*******************************************************************************************************************************************************.H.S.**/
/**
 @file      mandelbrot_ltrap.cpp
 @author    Mitch Richling <https://www.mitchr.me>
 @brief     Draw a Mandelbrot set with an Mandelbrot curve as an orbert trap.@EOL
 @std       C++20
 @copyright
  @parblock
  Copyright (c) 1988-2015, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved.

  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation
     and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software
     without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  DAMAGE.
  @endparblock
*/
/*******************************************************************************************************************************************************.H.E.**/
/** @cond exj */

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
#include "ramCanvas.hpp"

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
typedef mjr::ramCanvas3c8b::colorType ct;

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
double lp(std::complex<double> z, int n) {
  std::complex<double> lpv(0.0, 0.0);
  for(int i=0; i<n; i++)
    lpv = std::pow(lpv, 2) + z;
  return std::abs(lpv) - 2;
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
int main(void) {
  std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
  const int    IMGSIZ = 7680;
  const int    MAXITR = 1024;
  const double MAXZSQ = 4.0;
  const int    NUMFRM = 10;

# pragma omp parallel for schedule(static,1)
  for(int frame=1;frame<=NUMFRM;frame++) {
#   pragma omp critical
    std::cout << "Frame " << frame << " of " << NUMFRM << std::endl;
    mjr::ramCanvas3c8b theRamCanvas(IMGSIZ, IMGSIZ, -2.2, 0.8, -1.5, 1.5);
    for(int y=0;y<theRamCanvas.getNumPixY();y++) {
      for(int x=0;x<theRamCanvas.getNumPixX();x++) {
        std::complex<double> c = theRamCanvas.int2real(x, y);
        std::complex<double> z(0.0, 0.0);
        double minDval = theRamCanvas.getCanvasWidD();
        double minDsgn = 0;
        int count = 0;
        while((std::norm(z)<MAXZSQ) && (count<=MAXITR)) {
          z=std::pow(z, 2) + c;
          double ld = lp(z, frame);
          if (std::abs(ld) < minDval) {
            minDval = std::abs(ld);
            minDsgn = (ld > 0 ? 1 : -1);
          }
          count++;
        }
        if(count < MAXITR) {
          ct::csIntType csIdx = static_cast<ct::csIntType>(std::log(1+minDval)*100);
          if (minDsgn > 0)
            theRamCanvas.drawPoint(x, y, ct::csCCfractalYB::c(csIdx));
          else
            theRamCanvas.drawPoint(x, y, ct::csCCfractalYR::c(csIdx));
        }
      }
    }
    theRamCanvas.writeTIFFfile("mandelbrot_ltrap_" + mjr::fmtInt(frame, 2, '0') + ".tiff");
  }
  std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
  std::cout << "Total Runtime " << runTime.count() << " sec" << std::endl;
}
/** @endcond */


text:
package main

import (
	"fmt"
	"net/http"
	"os"
	"flag"
	"io/ioutil"
	"strings"
)

type Settings struct {
	AccessToken *string
	AccessTokenSecret *string
	ServerId *string
}

const API_ROOT = "https://secure.sakura.ad.jp/cloud/zone/is1a/api/cloud/1.1/"

func main() {
	s := parseSettings()

	cli := http.DefaultClient
	req, err := http.NewRequest(
		"GET",
		API_ROOT + "server/" + *s.ServerId,
		strings.NewReader(""),
	)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	req.SetBasicAuth(*s.AccessToken, *s.AccessTokenSecret)

	req.Header.Add("X-Sakura-API-Beautify", "1")

	resp, err := cli.Do(req)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	defer resp.Body.Close()

	fmt.Println(resp.Status)

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	fmt.Println(string(body))

}

func parseSettings() *Settings {
	s := Settings{}

	s.AccessToken       = flag.String("access-token"       , "", "Access Token for Sakura Cloud API")
	s.AccessTokenSecret = flag.String("access-token-secret", "", "Access Token Secret for Sakura Cloud API")

	s.ServerId = flag.String("server-id", "", "Server ID on Sakura Cloud")

	flag.Parse()
	return &s
}


text:
'use strict';

//Setting up route
angular.module('music').config(['$stateProvider',
	function($stateProvider) {
		// Music state routing
		$stateProvider.
		state('listMusic', {
			url: '/music',
			templateUrl: 'modules/music/views/list-music.client.view.html'
		}).
		state('createMusic', {
			url: '/music/create',
			templateUrl: 'modules/music/views/create-music.client.view.html'
		}).
		state('viewMusic', {
			url: '/music/:musicId',
			templateUrl: 'modules/music/views/view-music.client.view.html'
		}).
		state('editMusic', {
			url: '/music/:musicId/edit',
			templateUrl: 'modules/music/views/edit-music.client.view.html'
		});
	}
]);


text:
<?php

namespace App\Repository;

use App\Entity\Slide;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * SlideRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SlideRepository extends ServiceEntityRepository
{
    /**
     * Repository constructor.
     * @param ManagerRegistry $registry
     */
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, Slide::class);
    }
}