text:
<?php

namespace vulkan\System;

class Config {

    public static function settings($object, $params) {
        if ($params) {
            foreach ($params as $key => $data) {
                if (is_array($data) or method_exists($object, $key)) {
                    if (method_exists($object, $key)) {
                        $object->$key($data);
                    } elseif (isset($data['class'])) {
                        $newObject = new $data['class']();
                        $newObject->parent = $object;
                        self::settings($newObject, $data);
                        $object->$key = $newObject;
                        unset($data['class']);
                    } else {
                        $object->{$key} = $data;
                    }
                } else {
                    $object->{$key} = $data;
                }
            }
        }
    }

    public static function copyProperties($source, &$dest) {
        $refl = new \ReflectionClass($source);
        foreach ($refl->getProperties(\ReflectionProperty::IS_PUBLIC || \ReflectionProperty::IS_STATIC) as $prop) {
            echo $name = $prop->getName();
            $dest->$name = $source->$name;
        }
    }

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Odontochilus degeneri L.O.Williams

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
```javascript
{
  type: "datepicker",
  key: "start",
  templateOptions: {
    theme: "custom",
    placeholder: "Start date",
    minDate: minDate, // instance of Date
    maxDate: maxDate, // instance of Date
    filterDate: function(date) {
        // only weekends
        var day = date.getDay();
        return day === 0 || day === 6;
    }
  }
}
```

### Configuration

#### templateOptions.label _: string_

#### templateOptions.theme _: string_

#### templateOptions.disabled _: boolean_

#### templateOptions.className _: string | expression | array_

#### templateOptions.placeholder _: string_
The date input placeholder value

#### templateOptions.minDate _: Date_
Min date of choice

#### templateOptions.maxDate _: Date_
Max date of choice

#### templateOptions.filterDate _: function_
Function expecting a date and returning a boolean whether it can be selected or not.


text:
/*
 * Copyright 2004 Sandia Corporation.
 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 * license for use of this work by or on behalf of the
 * U.S. Government. Redistribution and use in source and binary forms, with
 * or without modification, are permitted provided that this Notice and any
 * statement of authorship are reproduced on all copies.
 */

// .NAME vtkUnstructuredGridHomogeneousRayIntegrator - performs peicewise constant ray integration.
//
// .SECTION Description
//
// vtkUnstructuredGridHomogeneousRayIntegrator performs homogeneous ray
// integration.  This is a good method to use when volume rendering scalars
// that are defined on cells.
//

#ifndef __vtkUnstructuredGridHomogeneousRayIntegrator_h
#define __vtkUnstructuredGridHomogeneousRayIntegrator_h

#include "vtkRenderingVolumeModule.h" // For export macro
#include "vtkUnstructuredGridVolumeRayIntegrator.h"

class vtkVolumeProperty;

class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridHomogeneousRayIntegrator : public vtkUnstructuredGridVolumeRayIntegrator
{
public:
  vtkTypeMacro(vtkUnstructuredGridHomogeneousRayIntegrator,
                       vtkUnstructuredGridVolumeRayIntegrator);
  static vtkUnstructuredGridHomogeneousRayIntegrator *New();
  virtual void PrintSelf(ostream &os, vtkIndent indent);

  virtual void Initialize(vtkVolume *volume, vtkDataArray *scalars);

  virtual void Integrate(vtkDoubleArray *intersectionLengths,
                         vtkDataArray *nearIntersections,
                         vtkDataArray *farIntersections,
                         float color[4]);

  // Description:
  // For quick lookup, the transfer function is sampled into a table.
  // This parameter sets how big of a table to use.  By default, 1024
  // entries are used.
  vtkSetMacro(TransferFunctionTableSize, int);
  vtkGetMacro(TransferFunctionTableSize, int);

protected:
  vtkUnstructuredGridHomogeneousRayIntegrator();
  ~vtkUnstructuredGridHomogeneousRayIntegrator();

  vtkVolume *Volume;
  vtkVolumeProperty *Property;

  int      NumComponents;
  float  **ColorTable;
  float  **AttenuationTable;
  double  *TableShift;
  double  *TableScale;
  vtkTimeStamp TablesBuilt;

  int UseAverageColor;
  int TransferFunctionTableSize;

  virtual void GetTransferFunctionTables(vtkDataArray *scalars);

private:
  vtkUnstructuredGridHomogeneousRayIntegrator(const vtkUnstructuredGridHomogeneousRayIntegrator&);  // Not implemented.
  void operator=(const vtkUnstructuredGridHomogeneousRayIntegrator&);  // Not implemented
};

#endif //__vtkUnstructuredGridHomogeneousRayIntegrator_h


text:
package com.amazonaws.services.ecs.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum LogDriver {

    JsonFile("json-file"),
    Syslog("syslog"),
    Journald("journald"),
    Gelf("gelf"),
    Fluentd("fluentd"),
    Awslogs("awslogs"),
    Splunk("splunk"),
    Awsfirelens("awsfirelens");

    private String value;

    private LogDriver(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return LogDriver corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static LogDriver fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (LogDriver enumEntry : LogDriver.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
SELECT TOP 1
  AVG(Salary) AS MinAverageSalary
FROM Employees
GROUP BY DepartmentID
ORDER BY MinAverageSalary


text:
'use strict';

exports.__esModule = true;

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _bootstrapUtils = require('./utils/bootstrapUtils');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var HelpBlock = function (_React$Component) {
  (0, _inherits3['default'])(HelpBlock, _React$Component);

  function HelpBlock() {
    (0, _classCallCheck3['default'])(this, HelpBlock);
    return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
  }

  HelpBlock.prototype.render = function render() {
    var _props = this.props;
    var className = _props.className;
    var props = (0, _objectWithoutProperties3['default'])(_props, ['className']);

    var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props);

    var bsProps = _splitBsProps[0];
    var elementProps = _splitBsProps[1];

    var classes = (0, _bootstrapUtils.getClassSet)(bsProps);

    return _react2['default'].createElement('span', (0, _extends3['default'])({}, elementProps, {
      className: (0, _classnames2['default'])(className, classes)
    }));
  };

  return HelpBlock;
}(_react2['default'].Component);

exports['default'] = (0, _bootstrapUtils.bsClass)('help-block', HelpBlock);
module.exports = exports['default'];


text:
#if !defined(STREAMS_H)
#define STREAMS_H

#include "../include/util.h"
#include <stdbool.h>

typedef struct Format {
	FILE *target;
	const char *left, *right;
	int lenOuter, lenLeft, lenRight, lenInner;
} Format;

/**\brief Write to the members in the format struct.
 * \param lenOuter The length of an entire line.
 * \param lBorder The left border string.
 * \param rBorder The right border string.
 * \return The same format struct pointer. */
Format *const Format_init(
		Format *const fmtDest,
		int lenOuter,
		const char *const lBorder,
		const char *const rBorder);

/**\brief Push a fixed-width message to stdout.
 * \param fmt The format struct to use.
 * \param szMessage A single line to print.
 * \return The number of characters printed. */
int Term_push(const Format *const fmt,
		cstr szMessage);

/**\brief Adds a border to the given message.
 * \param fmt The format struct to use.
 * \param szDest Destination of the output.
 * \param szMessage Message to be bordered.
 * \return The pointer to the destination string. */
str Term_border(const Format *const fmt,
		str szDest, cstr szMessage);

/**\brief Pads the given message (left/right).
 * \param fmt The format struct to use.
 * \param szDest The string to receive the result.
 * \param szMessage The message to align.
 * \param left True to align left, false otherwise.
 * \return The pointer to the destination string. */
str Term_align(const Format *const fmt,
		str szDest, cstr szMessage, bool left);

/**\brief Pads, borders, and prints the given message.
 * \param fmt The format struct to use.
 * \param szMessage The message to print.
 * \return The number of characters printed. */
int Term_pushBordered(const Format *const fmt,
		cstr szMessage);

/**\brief Format, pad, border, and print the args.
 * \param fmt The format struct to use.
 * \param szFormat The formatting to unpack the
 * 		following args.
 * \return The number of characters printed. */
int Term_fpush(const Format *const fmt,
		cstr szFormat, ...);

#endif


text:
using System;
using Guardtime.KSI.Exceptions;
using Guardtime.KSI.Hashing;
using Guardtime.KSI.Parser;

namespace Guardtime.KSI.Service
{
    /// <summary>
    ///     Aggregation request payload.
    /// </summary>
    [Obsolete]
    public sealed class LegacyAggregationRequestPayload : PduPayload
    {
        private RawTag _config;
        private ImprintTag _requestHash;
        private IntegerTag _requestId;
        private IntegerTag _requestLevel;

        /// <summary>
        /// Expected tag type
        /// </summary>
        protected override uint ExpectedTagType => Constants.AggregationRequestPayload.LegacyTagType;

        /// <summary>
        ///     Create aggregation request payload from TLV element.
        /// </summary>
        /// <param name="tag">TLV element</param>
        public LegacyAggregationRequestPayload(ITlvTag tag) : base(tag)
        {
        }

        /// <summary>
        ///     Create aggregation request payload from data hash.
        /// </summary>
        /// <param name="requestId">Request ID</param>
        /// <param name="hash">data hash</param>
        public LegacyAggregationRequestPayload(ulong requestId, DataHash hash) : base(Constants.AggregationRequestPayload.LegacyTagType, false, false, new ITlvTag[]
        {
            new IntegerTag(Constants.PduPayload.RequestIdTagType, false, false, requestId),
            new ImprintTag(Constants.AggregationRequestPayload.RequestHashTagType, false, false, hash)
        })
        {

        }

        /// <summary>
        ///     Create aggregation request payload from data hash.
        /// </summary>
        /// <param name="requestId">Request ID</param>
        /// <param name="hash">data hash</param>
        /// <param name="level">the level value of the aggregation tree node</param>
        public LegacyAggregationRequestPayload(ulong requestId, DataHash hash, uint level) : base(Constants.AggregationRequestPayload.LegacyTagType, false, false, new ITlvTag[]
        {
            new IntegerTag(Constants.PduPayload.RequestIdTagType, false, false, requestId),
            new ImprintTag(Constants.AggregationRequestPayload.RequestHashTagType, false, false, hash),
            new IntegerTag(Constants.AggregationRequestPayload.RequestLevelTagType, false, false, level)
        })
        {

        }
        /// <summary>
        /// Parse child tag
        /// </summary>
        protected override ITlvTag ParseChild(ITlvTag childTag)
        {
            switch (childTag.Type)
            {
                case Constants.PduPayload.RequestIdTagType:
                    return _requestId = GetIntegerTag(childTag);
                case Constants.AggregationRequestPayload.RequestHashTagType:
                    return _requestHash = GetImprintTag(childTag);
                case Constants.AggregationRequestPayload.RequestLevelTagType:
                    return _requestLevel = GetIntegerTag(childTag);
                case Constants.AggregationRequestPayload.ConfigTagType:
                    return _config = GetRawTag(childTag);
                default:
                    return base.ParseChild(childTag);
            }
        }

        /// <summary>
        /// Validate the tag
        /// </summary>
        protected override void Validate(TagCounter tagCounter)
        {
            base.Validate(tagCounter);

            if (tagCounter[Constants.PduPayload.RequestIdTagType] != 1)
            {
                throw new TlvException("Exactly one request id must exist in aggregation request payload.");
            }

            if (tagCounter[Constants.AggregationRequestPayload.RequestHashTagType] != 1)
            {
                throw new TlvException("Exactly one request hash must exist in aggregation request payload.");
            }

            if (tagCounter[Constants.AggregationRequestPayload.RequestLevelTagType] > 1)
            {
                throw new TlvException("Only one request level is allowed in aggregation request payload.");
            }

            if (tagCounter[Constants.AggregationRequestPayload.ConfigTagType] > 1)
            {
                throw new TlvException("Only one config tag is allowed in aggregation request payload.");
            }
        }

        /// <summary>
        ///     Get request hash.
        /// </summary>
        public DataHash RequestHash => _requestHash.Value;

        /// <summary>
        ///     Is config requested.
        /// </summary>
        public bool IsConfigRequested => _config == null;

        /// <summary>
        ///     Get request ID.
        /// </summary>
        public ulong RequestId => _requestId.Value;

        /// <summary>
        ///     Get request level if it exists.
        /// </summary>
        public ulong? RequestLevel => _requestLevel?.Value;
    }
}


text:
require 'art_deco/version'
require 'art_deco/decorator'
require 'art_deco/behaviour'

module ArtDeco

  class ViewContext
    def self.current=(context)
      @@current = context
    end

    cattr_reader :current if self.respond_to? :cattr_reader
  end

end


text:
create table book (
  primary_key               bigint not null,
  book_id                   varchar(255),
  name                      varchar(255),
  edition                   varchar(255),
  isbn                      varchar(255),
  price_new                 varchar(255),
  constraint uq_book_book_id unique (book_id),
  constraint pk_book primary key (primary_key))
;

create table offer (
  primary_key               bigint not null,
  offer_id                  varchar(255),
  condition                 varchar(255),
  price                     varchar(255),
  student_primary_key       bigint,
  book_primary_key          bigint,
  constraint uq_offer_offer_id unique (offer_id),
  constraint pk_offer primary key (primary_key))
;

create table request (
  primary_key               bigint not null,
  request_id                varchar(255),
  condition                 varchar(255),
  price                     varchar(255),
  student_primary_key       bigint,
  book_primary_key          bigint,
  constraint uq_request_request_id unique (request_id),
  constraint pk_request primary key (primary_key))
;

create table student (
  primary_key               bigint not null,
  student_id                varchar(255),
  name                      varchar(255),
  email                     varchar(255),
  constraint uq_student_student_id unique (student_id),
  constraint pk_student primary key (primary_key))
;

create sequence book_seq;

create sequence offer_seq;

create sequence request_seq;

create sequence student_seq;

alter table offer add constraint fk_offer_student_1 foreign key (student_primary_key) references student (primary_key) on delete restrict on update restrict;
create index ix_offer_student_1 on offer (student_primary_key);
alter table offer add constraint fk_offer_book_2 foreign key (book_primary_key) references book (primary_key) on delete restrict on update restrict;
create index ix_offer_book_2 on offer (book_primary_key);
alter table request add constraint fk_request_student_3 foreign key (student_primary_key) references student (primary_key) on delete restrict on update restrict;
create index ix_request_student_3 on request (student_primary_key);
alter table request add constraint fk_request_book_4 foreign key (book_primary_key) references book (primary_key) on delete restrict on update restrict;
create index ix_request_book_4 on request (book_primary_key);

# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists book;

drop table if exists offer;

drop table if exists request;

drop table if exists student;

SET REFERENTIAL_INTEGRITY TRUE;

drop sequence if exists book_seq;

drop sequence if exists offer_seq;

drop sequence if exists request_seq;

drop sequence if exists student_seq;


text:
FROM java:8

MAINTAINER delivery-engineering@netflix.com

COPY . workdir/

WORKDIR workdir

RUN ./gradlew buildDeb -x test

RUN dpkg -i ./rosco-web/build/distributions/*.deb

CMD ["/opt/rosco/bin/rosco"]


text:
/* FULL CALENDAR */
/* ====================================== */
/* Skin for Full Calendar */
#container .fc-unthemed th,
#container .fc-unthemed td,
#container .fc-unthemed hr,
#container .fc-unthemed thead,
#container .fc-unthemed tbody,
#container .fc-unthemed .fc-row,
#container .fc-unthemed .fc-popover {
  border-color: #e9e9e9;
}
#container .fc-row.fc-widget-header table th {
  height: 30px;
  vertical-align: middle;
  background-color: #42A5F5;
  color: #fff;
}
#container .fc-toolbar {
  margin-bottom: 0;
}
#container .fc-toolbar h2 {
  font-weight: 600;
  font-size: 20px;
}
#container .fc-toolbar .fc-left,
#container .fc-toolbar .fc-center,
#container .fc-toolbar .fc-right {
  margin-bottom: 10px;
  float: none;
}
#container .fc-toolbar > * > *,
#container .fc-toolbar .fc-button-group > * {
  float: none;
}
#container .fc-button,
#container .fc button {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.42857;
  height: auto;
  vertical-align: middle;
  box-shadow: none;
  text-shadow: none;
  transition: all .25s;
  text-transform: capitalize;
  background-image: none;
  background-color: #fbfbfb;
  border: 1px solid #d1d9de;
  color: #6c7b88;
}
#container .fc-button.fc-state-active,
#container .fc button.fc-state-active {
  background-color: #42A5F5;
  color: #fff;
  border-color: #42A5F5;
  box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2);
}
#container .fc-button:not(.disabled):not(:disabled):active,
#container .fc button:not(.disabled):not(:disabled).active {
  box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2);
}
#container .fc-state-default.fc-corner-left {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}
#container .fc-state-default.fc-corner-right {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}
#container .fc-unthemed .fc-today {
  background-color: #fbfccc;
}
#container .fc-popover.fc-more-popover .fc-event {
  padding: 5px 12px;
  font-size: 1em;
  margin-bottom: 5px;
}
#container .fc-view-container .fc-event {
  padding: 2px 5px;
  margin-bottom: 0;
  font-size: .85em;
}
#container .fc-event {
  background-color: #42A5F5;
  cursor: -webkit-grab;
  cursor: grab;
  color: #fff;
  border: 1px solid #42A5F5;
  padding: 7px 12px;
  font-size: 1em;
  margin-bottom: 10px;
  border-radius: 0;
  width: auto !important;
}
#container .fc-event.ui-draggable-dragging {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}
#container .fc-event.fc-list {
  background-color: #f5f5f5;
  color: inherit;
  border-color: transparent;
  position: relative;
  padding-left: 30px;
}
#container .fc-event.fc-list:before {
  content: '';
  display: block;
  background-color: #42A5F5;
  color: #fff;
  width: 8px;
  height: 8px;
  position: absolute;
  top: 50%;
  left: 5px;
  margin-top: -4px;
}
#container .fc-event.fc-list.ui-draggable-dragging {
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
#container .fc-event.info:not(.fc-list),
#container .fc-event[data-class="info"]:not(.fc-list),
#container .fc-event.info.fc-list:before,
#container .fc-event[data-class="info"].fc-list:before {
  background-color: #00BCD4;
  border-color: #00BCD4;
  color: #fff;
}
#container .fc-event.success:not(.fc-list),
#container .fc-event[data-class="success"]:not(.fc-list),
#container .fc-event.success.fc-list:before,
#container .fc-event[data-class="success"].fc-list:before {
  background-color: #8BC34A;
  border-color: #8BC34A;
  color: #fff;
}
#container .fc-event.warning:not(.fc-list),
#container .fc-event[data-class="warning"]:not(.fc-list),
#container .fc-event.warning.fc-list:before,
#container .fc-event[data-class="warning"].fc-list:before {
  background-color: #FFA726;
  border-color: #FFA726;
  color: #fff;
}
#container .fc-event.danger:not(.fc-list),
#container .fc-event[data-class="danger"]:not(.fc-list),
#container .fc-event.danger.fc-list:before,
#container .fc-event[data-class="danger"].fc-list:before {
  background-color: #ef5350;
  border-color: #ef5350;
  color: #fff;
}
#container .fc-event.mint:not(.fc-list),
#container .fc-event[data-class="mint"]:not(.fc-list),
#container .fc-event.mint.fc-list:before,
#container .fc-event[data-class="mint"].fc-list:before {
  background-color: #26A69A;
  border-color: #26A69A;
  color: #fff;
}
#container .fc-event.purple:not(.fc-list),
#container .fc-event[data-class="purple"]:not(.fc-list),
#container .fc-event.purple.fc-list:before,
#container .fc-event[data-class="purple"].fc-list:before {
  background-color: #BA68C8;
  border-color: #BA68C8;
  color: #fff;
}
#container .fc-event.pink:not(.fc-list),
#container .fc-event[data-class="pink"]:not(.fc-list),
#container .fc-event.pink.fc-list:before,
#container .fc-event[data-class="pink"].fc-list:before {
  background-color: #EC407A;
  border-color: #EC407A;
  color: #fff;
}
#container .fc-event.dark:not(.fc-list),
#container .fc-event[data-class="dark"]:not(.fc-list),
#container .fc-event.dark.fc-list:before,
#container .fc-event[data-class="dark"].fc-list:before {
  background-color: #37474F;
  border-color: #37474F;
  color: #fff;
}
#container .fc-highlight {
  opacity: .5;
}
@media (min-width: 640px) {
  #container .fc-toolbar .fc-left {
    float: left;
  }
  #container .fc-toolbar .fc-right {
    float: right;
  }
  #container .fc-toolbar > * > *,
  #container .fc-toolbar .fc-button-group > * {
    float: left;
  }
}


text:
module Azure::ServiceFabric::V6_5_0_36
  module Models
    #
    # Describes a setting for the container. The setting file path can be
    # fetched from environment variable "Fabric_SettingPath". The path for
    # Windows container is "C:\\secrets". The path for Linux container is
    # "/var/secrets".
    #
    class Setting

      include MsRestAzure

      # @return [String] The name of the setting.
      attr_accessor :name

      # @return [String] The value of the setting.
      attr_accessor :value

      #
      # Mapper for Setting class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Setting',
          type: {
            name: 'Composite',
            class_name: 'Setting',
            model_properties: {
              name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              value: {
                client_side_validation: true,
                required: false,
                serialized_name: 'value',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
/* globals decorator, filter html */
({
/**
 * Copyright 2022 Google LLC
 *
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file or at
 * https://developers.google.com/open-source/licenses/bsd
 */
render({fonts}) {
  return {
    friends: {
      models: fonts,
      decorator: 'decorator',
      filter: 'filter'
    },
  };
},

filter({fullName, suggested}) {
  return suggested && suggested.indexOf(fullName) != -1;
},

decorator({family, fullName, weight, style}, {suggested}) {
  const fweight = style.includes('Bold') ? 'bold' : weight;
  const fstyle = style.includes('Italic') ? 'italic' : style.includes('Oblique') ? 'oblique' : '';
  return {
    key: fullName,
    sortKey: family,
    name: fullName,
    displayStyle: `font-family: "${family}"; font-weight: ${fweight}; font-style: ${fstyle};`,
    suggested: suggested
  };
},

onFontClick({eventlet: {key}}) {
  return {pickedFont: key};
},

template: html`

{{friends}}

<template font_t>

    {{name}}
    Sample

</template>
`
})


text:
// Copyright (c) 2012, Event Store LLP
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 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.
// Neither the name of the Event Store LLP 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.
//

using NUnit.Framework;

namespace EventStore.Projections.Core.Tests.ClientAPI.when_handling_deleted.with_from_all_foreach_projection
{
    [TestFixture]
    public class when_running_and_events_are_indexed_but_more_events_and_tombstone :
        specification_with_standard_projections_runnning
    {
        protected override bool GivenStandardProjectionsRunning()
        {
            return false;
        }

        protected override void Given()
        {
            base.Given();
            PostEvent("stream-1", "type1", "{}");
            PostEvent("stream-2", "type1", "{}");
            PostEvent("stream-2", "type2", "{}");
            WaitIdle();
            EnableStandardProjections();
            WaitIdle();
            DisableStandardProjections();
            ;
            WaitIdle();

            // required to flush index checkpoint
            {
                EnableStandardProjections();
                WaitIdle();
                DisableStandardProjections();
                WaitIdle();
            }

            PostEvent("stream-1", "type2", "{}");
            HardDeleteStream("stream-1");
            WaitIdle();
        }

        protected override void When()
        {
            base.When();
            PostProjection(@"
fromAll().foreachStream().when({
    $init: function(){return {a:0}},
    type1: function(s,e){s.a++},
    type2: function(s,e){},
    $deleted: function(s,e){s.deleted=1},
}).outputState();
");
            WaitIdle();
        }

        [Test, Category("Network")]
        public void receives_deleted_notification()
        {
            AssertStreamTail("$projections-test-projection-stream-1-result", "Result:{\"a\":0,\"deleted\":1}");
        }
    }
}


text:
package org.apache.drill.exec.physical.impl;

import io.netty.buffer.ByteBuf;

import java.util.List;

import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.exec.memory.OutOfMemoryException;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.ops.MetricDef;
import org.apache.drill.exec.physical.config.SingleSender;
import org.apache.drill.exec.proto.ExecProtos.FragmentHandle;
import org.apache.drill.exec.proto.GeneralRPCProtos.Ack;
import org.apache.drill.exec.record.FragmentWritableBatch;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.record.RecordBatch.IterOutcome;
import org.apache.drill.exec.rpc.BaseRpcOutcomeListener;
import org.apache.drill.exec.rpc.RpcException;
import org.apache.drill.exec.rpc.data.DataTunnel;

public class SingleSenderCreator implements RootCreator<SingleSender>{

  @Override
  public RootExec getRoot(FragmentContext context, SingleSender config, List<RecordBatch> children)
      throws ExecutionSetupException {
    assert children != null && children.size() == 1;
    return new SingleSenderRootExec(context, children.iterator().next(), config);
  }

  private static class SingleSenderRootExec extends BaseRootExec {
    static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SingleSenderRootExec.class);
    private RecordBatch incoming;
    private DataTunnel tunnel;
    private FragmentHandle handle;
    private int recMajor;
    private FragmentContext context;
    private volatile boolean ok = true;
    private volatile boolean done = false;
    private final SendingAccountor sendCount = new SendingAccountor();

    public enum Metric implements MetricDef {
      BYTES_SENT;

      @Override
      public int metricId() {
        return ordinal();
      }
    }

    public SingleSenderRootExec(FragmentContext context, RecordBatch batch, SingleSender config) throws OutOfMemoryException {
      super(context, config);
      this.incoming = batch;
      assert(incoming != null);
      this.handle = context.getHandle();
      this.recMajor = config.getOppositeMajorFragmentId();
      FragmentHandle opposite = handle.toBuilder().setMajorFragmentId(config.getOppositeMajorFragmentId()).setMinorFragmentId(0).build();
      this.tunnel = context.getDataTunnel(config.getDestination(), opposite);
      this.context = context;
    }

    @Override
    public boolean innerNext() {
      if (!ok) {
        incoming.kill(false);

        return false;
      }

      IterOutcome out;
      if (!done) {
        out = next(incoming);
      } else {
        incoming.kill(true);
        out = IterOutcome.NONE;
      }
//      logger.debug("Outcome of sender next {}", out);
      switch (out) {
      case STOP:
      case NONE:
        FragmentWritableBatch b2 = FragmentWritableBatch.getEmptyLastWithSchema(handle.getQueryId(), handle.getMajorFragmentId(),
                handle.getMinorFragmentId(), recMajor, 0, incoming.getSchema());
        sendCount.increment();
        stats.startWait();
        try {
          tunnel.sendRecordBatch(new RecordSendFailure(), b2);
        } finally {
          stats.stopWait();
        }
        return false;

      case OK_NEW_SCHEMA:
      case OK:
        FragmentWritableBatch batch = new FragmentWritableBatch(false, handle.getQueryId(), handle.getMajorFragmentId(),
                handle.getMinorFragmentId(), recMajor, 0, incoming.getWritableBatch());
        updateStats(batch);
        sendCount.increment();
        stats.startWait();
        try {
          tunnel.sendRecordBatch(new RecordSendFailure(), batch);
        } finally {
          stats.stopWait();
        }
        return true;

      case NOT_YET:
      default:
        throw new IllegalStateException();
      }
    }

    public void updateStats(FragmentWritableBatch writableBatch) {
      stats.addLongStat(Metric.BYTES_SENT, writableBatch.getByteCount());
    }

    @Override
    public void stop() {
      ok = false;
      sendCount.waitForSendComplete();
      oContext.close();
      incoming.cleanup();
    }

    @Override
    public void receivingFragmentFinished(FragmentHandle handle) {
      done = true;
    }

    private class RecordSendFailure extends BaseRpcOutcomeListener<Ack>{

      @Override
      public void failed(RpcException ex) {
        sendCount.decrement();
        if (!context.isCancelled() && !context.isFailed()) {
          context.fail(ex);
        }
        stop();
      }

      @Override
      public void success(Ack value, ByteBuf buf) {
        sendCount.decrement();
        if (value.getOk()) {
          return;
        }

        logger.error("Downstream fragment was not accepted.  Stopping future sends.");
        // if we didn't get ack ok, we'll need to kill the query.
        context.fail(new RpcException("A downstream fragment batch wasn't accepted.  This fragment thus fails."));
        stop();
      }

    }

  }

}


text:
layout: post
title:  "How to create a blog"
date:   2017-02-03 18:20:19
category: Tips & Hacks
---

I want to create a blog.

Who would want to hear what I have to say? Good Question.

However, I see this not only as a means of communicating my work efforts with others, but also a way to document what I have done so I personally can keep track of the thought processes and decisions behind my various projects. If people have a little entertainment and learn somthing along the way then great.

So as a first post, here's how I went about creating this blog...

First off - I am cheap. I don't want to pay for someone to host my blog. Neither do I want unnecessary adverts clogging up the pages. Therefore ideally I wanted to do something free, at the cost of getting my hands a little dirtier than usual. I don't need any fancy dynamic stuff here, just static pages, so after a little digging I found that [Github](https://github.com/) is an ideal hosting platform for such a site. Setting up a site on Github is as easy as creating a new repository, and giving it a certain name.. i.e. [Your Username].github.io.

Easy!

Obviously you need to add some content though. I didn't go down this route, but Github does offer a number of templates which you can just deploy out of the box. None of them took my fancy, and also I didn't really want something that *everyone* else had.

Now, I`m not about to start creating a load of html and css. This project is for writing english, not code. So therefore I needed some out-of-the-box infrastructure to deploy to my new github repo. Another bout of digging and I stumbled upon [Jekyll](https://jekyllrb.com), which seems to be widely used for this sort of thing. There are heaps of sites based on Github/Jekyll.

After working through the install instructions, I decided that Jekyll was still too much like hard work.

A third bout of digging revealed that there is a whole community of hard working people who have create Jekyll themes. These are essentially entire jekyll-based sites, complete with advanced features like comments, social media integration, etc, all with pretty css - just waiting to be forked from their github repos. All you therefore have to do from that point on, is write posts in a markdown file.

Simple!

I`m picky about my colour schemes, but finally decided on [Paper Theme](https://github.com/dbtek/paper).

# Summary

The complete set of instructions to start blogging RIGHT NOW are :

- Fork the [repository](https://github.com/dbtek/paper).
- Rename forked repo as `username.github.io`.
- Add your blog name and details by editing `_config.yml`.
- Write some posts!

First Post. Done.


text:
package com.ettrema.ftp;

import java.util.concurrent.Callable;

/**
 *
 * @author brad
 */
public interface FtpActionListener {
    void onAction(Runnable r);
    <V> V onAction(Callable<V> c);
}


text:
using Nethereum.GSN.Interfaces;
using Nethereum.GSN.Models;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Nethereum.GSN.Policies
{
    public class DefaultRelayPolicy : IRelayPolicy
    {
        public IEnumerable<RelayOnChain> Execute(IEnumerable<RelayOnChain> relays)
        {
            return relays.OrderBy(x => x.Fee);
        }

        public Task GraceAsync(RelayOnChain relay)
        {
            return Task.FromResult(0);
        }

        public Task PenalizeAsync(RelayOnChain relay)
        {
            return Task.FromResult(0);
        }
    }
}


text:
#include "StdAfx.h"

#include "PagedTextDecor.h"
#include "ResStr.h"

#include "MiscScene.h"

namespace AISDL {

MiscScene::MiscScene(Director &director, Display &display) :
	SUPER(director, display, "Miscellaneous")
{
}

MiscScene::~MiscScene()
{
}

void MiscScene::OnAction()
{
	if (!miscTxt->NextPage(PagedTextDecor::Anim::FLING_UP)) {
		director.RequestNextScene();
	}
}

void MiscScene::OnCancel()
{
	miscTxt->PrevPage();
}

void MiscScene::Preload()
{
	SUPER::Preload();

	const std::string dir = display.res.resDir + "/text/misc/";
	miscTxt.reset(new PagedTextDecor(display, display.res.bodyFont,
		ResStr::Load(dir + "misc.txt"), 864));
}

void MiscScene::Reset()
{
	SUPER::Reset();

	miscTxt->FirstPage(PagedTextDecor::Anim::FLING_UP);
}

void MiscScene::Advance(Uint32 lastTick, Uint32 tick)
{
	miscTxt->Advance(tick);
}

void MiscScene::RenderContent()
{
	SDL_SetRenderDrawColor(display.renderer, 0x00, 0x00, 0x00, 0xff);
	SDL_RenderClear(display.renderer);

	display.SetHighRes();
	miscTxt->Render(80, 80);
}

}  // namespace AISDL


text:
import React from 'react';
import { useTheme, css } from '@superset-ui/core';
import { Tooltip as BaseTooltip } from 'antd';
import type { TooltipProps } from 'antd/lib/tooltip';
import { Global } from '@emotion/react';

export type { TooltipProps } from 'antd/lib/tooltip';

export const Tooltip = ({ overlayStyle, color, ...props }: TooltipProps) => {
  const theme = useTheme();
  const defaultColor = `${theme.colors.grayscale.dark2}e6`;
  return (
    <>
      {/* Safari hack to hide browser default tooltips */}
      <Global
        styles={css`
          .ant-tooltip-open {
            display: inline-block;
            &::after {
              content: '';
              display: block;
            }
          }
        `}
      />
      <BaseTooltip
        overlayStyle={{
          fontSize: theme.typography.sizes.s,
          lineHeight: '1.6',
          ...overlayStyle,
        }}
        color={defaultColor || color}
        {...props}
      />
    </>
  );
};

export default Tooltip;


text:
require 'rubygems'
require 'uri'
require 'socket'
require 'zookeeper'
require 'thread'

module Metaq

  #Metaq message
  class Message
    attr_accessor :id, :topic, :data, :attribute, :partition, :flag
    def initialize(topic, data, attribute=nil)
      @topic = topic
      @data = data
      @attribute = attribute
      @id = 0
      @flag = 0
      @partition = -1
    end

    def encode(partition, opaque)
      payload = encode_payload()
      payload="" if payload.nil?
      vlen = payload.size
      return "put #{@topic} #{partition} #{vlen} #{@flag} #{opaque}\r\n#{payload}"
    end

    private

    def encode_payload()
      return @data if @attribute.nil?
      attr_len = [@attribute.length].pack("N")
      @flag= @flag & 0xFFFFFFFE | 1
      return "#{attr_len}#{@attribute}#{@data}"
    end

  end

  class ParserError < StandardError
  end

  class ConnectionDeadError < StandardError
  end

  class NetworkError < StandardError
  end

  class MetaError < StandardError
  end

  class SendResult
    attr_accessor :success,:partition,:offset,:error

    def initialize(success,partition,offset,error=nil)
      @success = success
      @partition = partition
      @offset = offset
      @error = error
    end

    def to_s
      return "SendResult[success=#{@success},partition=#{@partition},offset=#{@offset},error=#{@error}]"
    end
  end

  ##Internal classes
  class JavaInt
    MIN = -2147483648
    MAX = 2147483647

    attr_accessor :value

    def initialize()
      @value=MIN
    end

    def inc_and_get()
      @value+=1
      if @value>=MAX
        @value=MIN
      end
      return @value
    end

  end

  class HttpStatus
    BadRequest = 400
    NotFound = 404
    Forbidden = 403
    Unauthorized = 401
    InternalServerError = 500
    ServiceUnavilable = 503
    GatewayTimeout = 504
    Success = 200
    Moved = 301
  end

  class Partition
    attr_accessor :broker_id,:partition

    def initialize(broker_id, partition)
      @broker_id = broker_id
      @partition = partition
    end

    def to_s
      return "#{@broker_id}-#{@partition}"
    end

    def  <=>(other)
      if @broker_id != other.broker_id
        return @broker_id <=> other.broker_id
      else
        return @partition <=> other.partition
      end
    end
  end

  class Broker
    attr_accessor :broker_id,:broker_uri

    def initialize(broker_id, broker_uri)
      @broker_id = broker_id
      @broker_uri = broker_uri
    end

    def to_s
      return "Broker[uri=#{@broker_uri}]"
    end

  end

  DEAD_RETRY = 5  # number of seconds before retrying a dead server.
  SOCKET_TIMEOUT = 10  #  number of seconds before sockets timeout.
  class Connection
    attr_accessor :uri, :socket

    def initialize(uri,dead_retry=DEAD_RETRY,socket_timeout=SOCKET_TIMEOUT,debug=true)
      @uri = uri
      @dead_retry = dead_retry
      @socket = nil
      @socket_timeout = socket_timeout
      @debug = debug
      @deaduntil = 0

      get_socket()
    end

    def close()
      if @socket
        @socket.close
        @socket = nil
      end
    end

    def send_packet(pkt)
      sock=get_socket()
      raise ConnectionDeadError if sock.nil?
      raise NetworkError if sock.send(pkt,0) != pkt.size
    end

    def readline
      sock=get_socket
      raise ConnectionDeadError if sock.nil?
      return sock.readline
    end

    def recv(len)
      sock=get_socket
      raise ConnectionDeadError if sock.nil?
      return sock.read(len)
    end

    def mark_dead(reason)
      debug("#{@uri}: #{reason}.  marking dead.")
      @deaduntil = Time.now() + @dead_retry
      close()
    end

    def debug(msg)
      if @debug
        STDERR.puts "[DEBUG]Connection[#{@uri}]: #{msg}"
      end
    end

    def get_socket()
      return nil if check_dead()
      return @socket if @socket

      begin
        uri=URI.parse(@uri)
        s=TCPSocket.open(uri.host,uri.port)
      rescue Exception => e
        mark_dead("connect failed:#{e.message}")
        return nil
      end
      debug("Connect to #{@uri} successfully.")
      @socket = s
      return @socket
    end

    def check_dead()
      return true if @deaduntil != 0  and @deaduntil > Time. now()
      @deaduntil = 0
      return false
    end

  end

  #Returns a round robin selector
  def self.get_round_robin_selector
    ji = JavaInt.new
    Proc.new do | topic, partitions, msg|
      raise MetaError.new("There is no available parition for topic #{topic} right now") if partitions.nil? or partitions.size == 0
      partitions[ ji.inc_and_get() % partitions.size]
    end
  end

  class MessageProducer
    attr_accessor :topic

    def initialize(topic, opts={})
      @topic = topic
      opts.each do |key, value|
        instance_variable_set "@#{key}", value
      end
      @opaque_counter = JavaInt.new
      @zk_servers ||= "localhost:2181"
      @partition_selector ||= Metaq.get_round_robin_selector
      @zk_timeout ||= 10000
      @zk_root ||= "/meta"
      @dead_retry ||= DEAD_RETRY
      @socket_timeout ||= SOCKET_TIMEOUT
      @debug ||= true

      raise MetaError,"Topic is nil" if @topic.nil?
      raise MetaError,"zookeeper servers is nil" if @zk_servers.nil? or @zk_servers.empty?

      @zk = Zookeeper.new(@zk_servers)
      @lock = Mutex.new
      @broker_topic_path = "#{@zk_root}/brokers/topics"
      @broker_ids_of_path = "#{@zk_root}/brokers/ids"
      @broker_hash = Hash.new
      @conn_hash = Hash.new
      @partition_list = Array.new
      update_broker_infos()
    end

    def send(msg)
      raise MetaError.new("Message is nil") if msg.nil?
      topic = msg.topic
      raise MetaError.new("Expect topic #{@topic},but was #{topic}") if topic != @topic
      data = msg.data
      raise MetaError.new("message data is none") if data.nil?
      partition = @partition_selector.call(topic, @partition_list, msg)
      raise MetaError.new("There is no avaiable partition for topic #{topic}") if partition.nil?
      conn = @conn_hash[partition.broker_id]
      raise MetaError.new("There is no avaiable server right now for topic #{topic}and partition #{partition.partition}") if conn.nil?
      opaque = @opaque_counter.inc_and_get()
      cmd = msg.encode(partition.partition,opaque)

      begin
        conn.send_packet(cmd)
        head = conn.readline()
        tmps = head.split(" ")
        status = tmps[1].to_i
        bodylen = tmps[2].to_i
        resp_opaque = tmps[3].to_i
        body = conn.recv(bodylen)
        if  body.nil? or body.size != bodylen
          conn.mark_dead("Response format error,expect body length is #{bodylen},but is #{body.size}")
          return SendResult.new(false,nil, -1, error="network error")
        end
        if resp_opaque != opaque
          conn.mark_dead("Response opaque is not equals to request opaque")
          return SendResult.new(false, nil, -1, error="network error")
        end
        if status == HttpStatus::Success
          tmps = body.split(" ")
          msg.id = tmps[0].to_i
          offset = tmps[2].to_i
          msg.partition = partition
          return SendResult.new(true, partition, offset)
        else
          return SendResult.new(false, nil, -1, error=body)
        end
      rescue ConnectionDeadError
        conn.mark_dead("Connection was broken")
        return SendResult.new(false, nil, -1, error="connection was broken")
      rescue  Exception => e
        return SendResult.new(false, nil, -1, error=e.message)
      end
    end

    def to_s
      "MessageProducer[topic =#{topic},  brokers=#{@broker_hash}"
    end

    def close()
      safe_zk_close()
      @conn_hash.values do |conn|
        conn.close()
      end
    end

    ##private methods
    private

    def safe_zk_close()
      begin
        @zk.close() if @zk
      rescue
        #ignore
      end
    end

    def safe_zk_get(path, count=0)
      begin
        return @zk.get({ :path => path })
      rescue Exception => e
        if count >= 3
          raise e
        else
          safe_zk_close()
          @zk = Zookeeper.new(@zk_servers)
          return safe_zk_get(path, count.succ)
        end
      end
    end

    def safe_zk_get_children(path, watcher, count=0)
      begin
        return @zk.get_children({:path => path, :watcher => watcher })
      rescue Exception => e
        if count >= 3
          raise e
        else
          safe_zk_close()
          @zk = Zookeeper.new(@zk_servers)
          return safe_zk_get_children(path, watcher, count.succ)
        end
      end
    end

    def debug(msg)
      STDERR.puts("[meta-producer-debug]:#{msg}")  if @debug
    end

    def update_broker_infos()
      @lock.synchronize do
        debug("begin to update broker infos from zookeeper with topic #{@topic}")
        topic_path = "#{@broker_topic_path}/#{@topic}"
        watcher = nil
        children = safe_zk_get_children(topic_path, watcher)[:children]
        broker_hash = Hash.new
        partition_list = Array.new
        if children and children.size > 0
          children.select{ |child| child =~ /.*-m$/ }.each do |child|
            broker_id = child[0,child.index("-m")].to_i
            broker = get_broker_by_id(broker_id)
            partition_list.concat(get_parts(child, broker_id))
            broker_hash[broker_id] = broker
            partition_list.sort!
          end
        end
        update_conn_hash(broker_hash)
        @broker_hash = broker_hash
        @partition_list = partition_list
        debug("New brokers for topic #{@topic}:#{@broker_hash}")
        debug("New partition list for topic#{topic}:#{@partition_list}")
        debug("End to update broker infos from zookeeper with topic #{topic}")
      end
    end

    def update_conn_hash(new_broker_hash)
      for broker_id in @broker_hash.keys()
        #broker is both in old brokers and new brokers
        if new_broker_hash[broker_id]
          #if broker uri changed
          if new_broker_hash[broker_id].broker_uri != @broker_hash[broker_id].broker_uri
            conn = @conn_hash[broker_id]
            #close old connection
            close_conn(conn)
            new_uri = new_broker_hash[broker_id].broker_uri
            #connect to new broker
            debug("connecting to #{new_uri}")
            @conn_hash[broker_id] = Connection.new(new_uri, @dead_retry, @socket_timeout, @debug)
          end
        else
          #Broker is not in new brokers,close it.
          conn = @conn_hash[broker_id]
          close_conn(conn)
        end
      end

      new_broker_hash.keys().each do | broker_id|
        #A new broker,we must connect it.
        if @broker_hash[broker_id].nil?
          new_uri = new_broker_hash[broker_id].broker_uri
          debug("connecting to #{new_uri}")
          @conn_hash[broker_id] = Connection.new(new_uri, @dead_retry, @socket_timeout, @debug)
        end
      end

    end

    def close_conn(conn)
      if conn
        @conn_hash.delete broker_id
        debug("Closing #{conn.uri}")
        conn.close()
      end
    end

    def get_parts(child,broker_id)
      n_parts = safe_zk_get("#{@broker_topic_path}/#{@topic}/#{child}")[:data].to_i
      (0..n_parts-1).collect do | n |
        Partition.new(broker_id, n)
      end
    end

    def get_broker_by_id(broker_id)
      broker_uri,_ = safe_zk_get("#{@broker_ids_of_path}/#{broker_id}/master")[:data]
      return Broker.new(broker_id, broker_uri)
    end

  end

end

if __FILE__ == $0
  producer =Metaq::MessageProducer.new("meta-test",{ :zk_root => "/avos-fetch-meta" })
  msg =Metaq::Message.new("meta-test","hello world")
  p producer.send(msg)
  producer.close
end


text:
package xyz.brassgoggledcoders.boilerplate.utils;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.world.World;

public class WorldGenUtils {
	public static void generateOre(World world, Random random, int chunkX, int chunkZ, int blockPerChunk, int minHeight,
			int maxHeight, int blocks, Block ore, int meta, Block blockToGenIn) {
		for(int i = 0; i < blockPerChunk; i++) {
			random.nextInt(16);
			random.nextInt(maxHeight - minHeight);
			random.nextInt(16);

			// TODO new WorldGenMinable(ore, meta, blocks,
			// blockToGenIn).generate(world, random, oreXCoord, oreYCoord,
			// oreZCoord);
		}
	}
}


text:
`/instructors`
```
{
  fullName: String,
  username: String,
  password: String,
}
```
-- `GET by ID`
`/instructors/:id`
```
{
    "_id": "Object ID",
    fullName: String,
    username: String,
    password: String,
}
```

-- `POST`
`/instructors/`
```
{
  fullName: String,
  username: String,
  password: String,
}
```
-- `PUT`
`/instructors/:id`
```
{
    "_id": "Object ID",
    fullName: String,
    username: String,
    password: String,
}
```
-- `DELETE`
`/instructors/:id`
```
{
  "_id": "Object ID",
  fullName: String,
  username: String,
  password: String,
}
```

-- `GET`
`/courses`
```
{
  name: String,
  _creator: { type: ObjectId, ref: 'Instructor' }
}
```
-- `GET by ID`
`/courses/:id`
```
{
    "_id": "Object ID",
    name: String,
    _creator: { type: ObjectId, ref: 'Instructor' }
}
```

-- `POST`
`/courses/`
```
{
  name: String,
  _creator: { type: ObjectId, ref: 'Instructor' }
}
```
-- `PUT`
`/courses/:id`
```
{
    "_id": "Object ID",
    name: String,
    _creator: { type: ObjectId, ref: 'Instructor' }
}
```
-- `DELETE`
`/courses/:id`
```
{
  "_id": "Object ID",
  firstName: String,
  lastName: String,
  phoneNumber: String,
  courses: { type: ObjectId, ref: 'Course' },
  streetAddress: String,
  miscAddress: String,
}
```

-- `GET`
`/students`
```
{
  firstName: String,
  lastName: String,
  phoneNumber: String,
  courses: { type: ObjectId, ref: 'Course' },
  streetAddress: String,
  miscAddress: String,
}
```
-- `GET by ID`
`/students/:id`
```
{
    "_id": "Object ID",
    firstName: String,
    lastName: String,
    phoneNumber: String,
    courses: { type: ObjectId, ref: 'Course' },
    streetAddress: String,
    miscAddress: String,
}
```

-- `POST`
`/students/`
```
{
  firstName: String,
  lastName: String,
  phoneNumber: String,
  courses: { type: ObjectId, ref: 'Course' },
  streetAddress: String,
  miscAddress: String,
}
```
-- `PUT`
`/students/:id`
```
{
    "_id": "Object ID",
    firstName: String,
    lastName: String,
    phoneNumber: String,
    courses: { type: ObjectId, ref: 'Course' },
    streetAddress: String,
    miscAddress: String,
}
```
-- `DELETE`
`/students/:id`
```
{
  "_id": "Object ID",
  firstName: String,
  lastName: String,
  phoneNumber: String,
  courses: { type: ObjectId, ref: 'Course' },
  streetAddress: String,
  miscAddress: String,
}
```
[Screenshot](http://imgur.com/a/tW2Gl)

Built with Mongoose, Express, React, and Node. Server hosted on mLab and app hosted on heroku


text:
MIT. See [LICENSE.MD](https://github.com/g3ortega/g3ortega.github.com/blob/master/LICENSE.md).
Thanks to ([Ben Centra](https://github.com/bencentra)) for base theme.


text:
<link rel="import" href="../polymer/polymer.html">

<link rel="import" href="../paper-shadow/paper-shadow.html">

<polymer-element name="lp-card-page" noscript>

  <template>

    <link rel="stylesheet" href="lp-card-page.css" />

      <content class="card-content" horizontal layout></content>
      <paper-shadow></paper-shadow>

  </template>

</polymer-element>


text:
using Newtonsoft.Json;

namespace BizwebSharp
{
    /// <summary>
    /// The class representing Bizweb redirect.
    /// </summary>
    public class Redirect : BaseEntity
    {
        /// <summary>
        /// The "before" path to be redirected. When the user navigates to this path, they will be redirected to the path specified by target.
        /// </summary>
        [JsonProperty("path")]
        public string Path { get; set; }

        /// <summary>
        /// The "after" path or URL to be redirected to. This property can be set to any path on the shop's site, or any URL, even one on a
        /// completely different domain.
        /// </summary>
        [JsonProperty("target")]
        public string Target { get; set; }
    }
}


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.SecurityInsights.Models
{
    internal partial class UnknownAutomationRuleAction : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("order");
            writer.WriteNumberValue(Order);
            writer.WritePropertyName("actionType");
            writer.WriteStringValue(ActionType.ToString());
            writer.WriteEndObject();
        }

        internal static UnknownAutomationRuleAction DeserializeUnknownAutomationRuleAction(JsonElement element)
        {
            int order = default;
            ActionType actionType = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("order"))
                {
                    order = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("actionType"))
                {
                    actionType = new ActionType(property.Value.GetString());
                    continue;
                }
            }
            return new UnknownAutomationRuleAction(order, actionType);
        }
    }
}


text:
using content::KeySystemInfo;
using content::SupportedCodecs;

namespace cdm {

// Return |name|'s parent key system.
static std::string GetDirectParentName(std::string name) {
  size_t last_period = name.find_last_of('.');
  DCHECK_GT(last_period, 0u);
  return name.substr(0u, last_period);
}

void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type,
                           SupportedCodecs supported_codecs,
                           std::vector<KeySystemInfo>* concrete_key_systems) {
  KeySystemInfo info(kWidevineKeySystem);

  switch (widevine_cdm_type) {
    case WIDEVINE:
      // For standard Widevine, add parent name.
      info.parent_key_system = GetDirectParentName(kWidevineKeySystem);
      break;
#if defined(OS_ANDROID)
    case WIDEVINE_HR_NON_COMPOSITING:
      info.key_system.append(".hrnoncompositing");
      break;
#endif  // defined(OS_ANDROID)
    default:
      NOTREACHED();
  }

  // TODO(xhwang): A container or an initDataType may be supported even though
  // there are no codecs supported in that container. Fix this when we support
  // initDataType.
  info.supported_codecs = supported_codecs;

#if defined(ENABLE_PEPPER_CDMS)
  info.pepper_type = kWidevineCdmPluginMimeType;
#endif  // defined(ENABLE_PEPPER_CDMS)

  concrete_key_systems->push_back(info);
}

}  // namespace cdm

#endif  // defined(WIDEVINE_CDM_AVAILABLE)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Apache JMeter - User's Manual: Listeners</title>

Index

Next

Prev

13. Introduction to listeners

A listener is a component that shows the results of the
samples. The results can be shown in a tree, tables, graphs or simply written to a log
file. To view the contents of a response from any given sampler, add either of the Listeners "
<tt class="code">View
Results Tree
</tt>
" or "
<tt class="code">View Results in table
</tt>
" to a test plan. To view the response time graphically, add
graph results.
The
listeners

section of the components page has full descriptions of all the listeners.

Different listeners display the response information in different ways.
However, they all write the same raw data to the output file - if one is specified.

The "
<tt class="code">Configure
</tt>
" button can be used to specify which fields to write to the file, and whether to
write it as CSV or XML.
CSV files are much smaller than XML files, so use CSV if you are generating lots of samples.

The file name can be specified using either a relative or an absolute path name.
Relative paths are resolved relative to the current working directory (which defaults to the
<tt class="code">bin/
</tt>
 directory).
JMeter also supports paths relative to the directory containing the current test plan (JMX file).
If the path name begins with "
<tt class="code">~/
</tt>
" (or whatever is in the
<tt class="code">jmeter.save.saveservice.base_prefix
</tt>
 JMeter property),
then the path is assumed to be relative to the JMX file location.

If you only wish to record certain samples, add the Listener as a child of the sampler.
Or you can use a Simple Controller to group a set of samplers, and add the Listener to that.
The same filename can be used by multiple samplers - but make sure they all use the same configuration!

13.1 Default Configuration

The default items to be saved can be defined in the
<tt class="code">jmeter.properties
</tt>
 (or
<tt class="code">user.properties
</tt>
) file.
The properties are used as the initial settings for the Listener Config pop-up, and are also
used for the log file specified by the
<tt class="code">-l
</tt>
 command-line flag (commonly used for non-GUI test runs).

To change the default format, find the following line in
<tt class="code">jmeter.properties
</tt>
:

jmeter.save.saveservice.output_format=

The information to be saved is configurable.  For maximum information, choose "
<tt class="code">xml
</tt>
" as the format and specify "
<tt class="code">Functional Test Mode
</tt>
" on the Test Plan element.  If this box is not checked, the default saved
data includes a time stamp (the number of milliseconds since midnight,
January 1, 1970 UTC), the data type, the thread name, the label, the
response time, message, and code, and a success indicator.  If checked, all information, including the full response data will be logged.

The following example indicates how to set
properties to get a vertical bar ("
<tt class="code">|
</tt>
") delimited format that will
output results like:.

timeStamp|time|label|responseCode|threadName|dataType|success|failureMessage
02/06/03 08:21:42|1187|Home|200|Thread Group-1|text|true|
02/06/03 08:21:42|47|Login|200|Thread Group-1|text|false|Test Failed:
    expected to contain: password etc.

The corresponding
<tt class="code">jmeter.properties
</tt>
 that need to be set are shown below.  One oddity
in this example is that the
<tt class="code">output_format
</tt>
 is set to
<tt class="code">csv
</tt>
, which
typically
indicates comma-separated values.  However, the
<tt class="code">default_delimiter
</tt>
 was
set to be a vertical bar instead of a comma, so the csv tag is a
misnomer in this case. (Think of CSV as meaning character separated values)

jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.default_delimiter=|

The full set of properties that affect result file output is shown below.

#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------

# This section helps determine how result data will be saved.
# The commented out values are the defaults.

# legitimate values: xml, csv, db.  Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=csv

# true when field should be saved; false otherwise

# assertion_results_failure_message only affects CSV output
#jmeter.save.saveservice.assertion_results_failure_message=true
#
# legitimate values: none, first, all
#jmeter.save.saveservice.assertion_results=none
#
#jmeter.save.saveservice.data_type=true
#jmeter.save.saveservice.label=true
#jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
#jmeter.save.saveservice.response_data=false
# Save ResponseData for failed samples
#jmeter.save.saveservice.response_data.on_error=false
#jmeter.save.saveservice.response_message=true
#jmeter.save.saveservice.successful=true
#jmeter.save.saveservice.thread_name=true
#jmeter.save.saveservice.time=true
#jmeter.save.saveservice.subresults=true
#jmeter.save.saveservice.assertions=true
#jmeter.save.saveservice.latency=true
#jmeter.save.saveservice.connect_time=true
#jmeter.save.saveservice.samplerData=false
#jmeter.save.saveservice.responseHeaders=false
#jmeter.save.saveservice.requestHeaders=false
#jmeter.save.saveservice.encoding=false
#jmeter.save.saveservice.bytes=true
#jmeter.save.saveservice.sent_bytes=true
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=true
#jmeter.save.saveservice.sample_count=false
#jmeter.save.saveservice.idle_time=true

# Timestamp format - this only affects CSV output files
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS

# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters.
# Default:
#jmeter.save.saveservice.default_delimiter=,
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.saveservice.default_delimiter=\t

# Only applies to CSV format files:
# Print field names as first line in CSV
#jmeter.save.saveservice.print_field_names=true

# Optional list of JMeter variable names whose values are to be saved in the result data files.
# Use commas to separate the names. For example:
#sample_variables=SESSION_ID,REFERENCE
# N.B. The current implementation saves the values in XML as attributes,
# so the names must be valid XML names.
# JMeter sends the variable to all servers
# to ensure that the correct data is available at the client.

# Optional xml processing instruction for line 2 of the file:
#jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="sample.xsl"?>

# Prefix used to identify filenames that are relative to the current base
#jmeter.save.saveservice.base_prefix=~/

# AutoFlush on each line written in XML or CSV output
# Setting this to true will result in less test results data loss in case of Crash
# but with impact on performances, particularly for intensive tests (low or no pauses)
# Since JMeter 2.10, this is false by default
#jmeter.save.saveservice.autoflush=false

# Put the start time stamp in logs instead of the end
sampleresult.timestamp.start=true

# Whether to use System.nanoTime() - otherwise only use System.currentTimeMillis()
#sampleresult.useNanoTime=true

# Use a background thread to calculate the nanoTime offset
# Set this to <= 0 to disable the background thread
#sampleresult.nanoThreadSleep=5000

The date format to be used for the
<tt class="code">timestamp_format
</tt>
 is described in

SimpleDateFormat

.
The timestamp format is used for both writing and reading files.
If the format is set to "
<tt class="code">ms
</tt>
", and the column does not parse as a long integer,
JMeter (2.9+) will try the following formats:

<tt class="code">yyyy/MM/dd HH:mm:ss.SSS
</tt>

<tt class="code">yyyy/MM/dd HH:mm:ss
</tt>

<tt class="code">yyyy-MM-dd HH:mm:ss.SSS
</tt>

<tt class="code">yyyy-MM-dd HH:mm:ss
</tt>

<tt class="code">MM/dd/yy HH:mm:ss
</tt>
 (this is for compatibility with previous versions; it is not recommended as a format)

Matching is now also strict (non-lenient).
JMeter 2.8 and earlier used lenient mode which could result in timestamps with incorrect dates
(times were usually correct).

13.1.1 Sample Variables

JMeter supports the
<tt class="code">sample_variables
</tt>

property to define a list of additional JMeter variables which are to be saved with
each sample in the JTL files. The values are written to CSV files as additional columns,
and as additional attributes in XML files. See above for an example.

13.1.2 Sample Result Save Configuration

Listeners can be configured to save different items to the result log files (JTL) by using the Config popup as shown below.
The defaults are defined as described in  the

Listener Default Configuration

 section above.
Items with (CSV) after the name only apply to the CSV format; items with (XML) only apply to XML format.
CSV format cannot currently be used to save any items that include line-breaks.

Configuration dialogue

Note that cookies, method and the query string are saved as part of the "
<tt class="code">Sampler Data
</tt>
" option.

13.2 non-GUI (batch) test runs

When running in non-GUI mode, the
<tt class="code">-l
</tt>
 flag can be used to create a top-level listener for the test run.
This is in addition to any Listeners defined in the test plan.
The configuration of this listener is controlled by entries in the file
<tt class="code">jmeter.properties
</tt>

as described in the previous section.

This feature can be used to specify different data and log files for each test run, for example:

jmeter -n -t testplan.jmx -l testplan_01.jtl -j testplan_01.log
jmeter -n -t testplan.jmx -l testplan_02.jtl -j testplan_02.log

Note that JMeter logging messages are written to the file
<tt class="code">jmeter.log
</tt>
 by default.
This file is recreated each time, so if you want to keep the log files for each run,
you will need to rename it using the
<tt class="code">-j
</tt>
 option as above.

JMeter supports variables in the log file name.
If the filename contains  paired single-quotes, then the name is processed
as a
<tt class="code">SimpleDateFormat
</tt>
 format applied to the current date, for example:

<tt class="code">log_file='jmeter_'yyyyMMddHHmmss'.tmp'
</tt>
.
This can be used to generate a unique name for each test run.

13.3 Resource usage

 Listeners can use a lot of memory if there are a lot of samples.

Most of the listeners currently keep a copy of every sample they display, apart from:

Simple Data Writer

BeanShell/JSR223 Listener

Mailer Visualizer

Monitor Results

Summary Report

The following Listeners no longer need to keep copies of every single sample.
Instead, samples with the same elapsed time are aggregated.
Less memory is now needed, especially if most samples only take a second or two at most.

Aggregate Report

Aggregate Graph

To minimize the amount of memory needed, use the Simple Data Writer, and use the CSV format.

13.4 CSV Log format

The CSV log format depends on which data items are selected in the configuration.
Only the specified data items are recorded in the file.
The order of appearance of columns is fixed, and is as follows:

<tt class="code">timeStamp
</tt>
 - in milliseconds since 1/1/1970

<tt class="code">elapsed
</tt>
 - in milliseconds

<tt class="code">label
</tt>
 - sampler label

<tt class="code">responseCode
</tt>
 - e.g.
<tt class="code">200
</tt>
,
<tt class="code">404
</tt>

<tt class="code">responseMessage
</tt>
 - e.g.
<tt class="code">OK
</tt>

<tt class="code">threadName
</tt>

<tt class="code">dataType
</tt>
 - e.g.
<tt class="code">text
</tt>

<tt class="code">success
</tt>
 -
<tt class="code">true
</tt>
 or
<tt class="code">false
</tt>

<tt class="code">failureMessage
</tt>
 - if any

<tt class="code">bytes
</tt>
 - number of bytes in the sample

<tt class="code">sentBytes
</tt>
 - number of bytes sent for the sample

<tt class="code">grpThreads
</tt>
 - number of active threads in this thread group

<tt class="code">allThreads
</tt>
 - total number of active threads in all groups

<tt class="code">URL
</tt>

<tt class="code">Filename
</tt>
 - if
<tt class="code">Save Response to File
</tt>
 was used

<tt class="code">latency
</tt>
 - time to first response

<tt class="code">connect
</tt>
 - time to establish connection

<tt class="code">encoding
</tt>

<tt class="code">SampleCount
</tt>
 - number of samples (1, unless multiple samples are aggregated)

<tt class="code">ErrorCount
</tt>
 - number of errors (0 or 1, unless multiple samples are aggregated)

<tt class="code">Hostname
</tt>
 - where the sample was generated

<tt class="code">IdleTime
</tt>
 - number of milliseconds of 'Idle' time (normally 0)

<tt class="code">Variables
</tt>
, if specified

13.5 XML Log format 2.1

The format of the updated XML (2.1) is as follows (line breaks will be different):

<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">

-- HTTP Sample, with nested samples

<httpSample t="1392" lt="351" ts="1144371014619" s="true"
     lb="HTTP Request" rc="200" rm="OK"
     tn="Listen 1-1" dt="text" de="iso-8859-1" by="12407">
  <httpSample t="170" lt="170" ts="1144371015471" s="true"
        lb="http://www.apache.org/style/style.css" rc="200" rm="OK"
        tn="Listen 1-1" dt="text" de="ISO-8859-1" by="1002">
    <responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
⋮
Content-Type: text/css
</responseHeader>
    <requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
    <responseData class="java.lang.String">body, td, th {
    font-size: 95%;
    font-family: Arial, Geneva, Helvetica, sans-serif;
    color: black;
    background-color: white;
}
⋮
</responseData>
    <cookies class="java.lang.String"></cookies>
    <method class="java.lang.String">GET</method>
    <queryString class="java.lang.String"></queryString>
    <url>http://www.apache.org/style/style.css</url>
  </httpSample>
  <httpSample t="200" lt="180" ts="1144371015641" s="true"
     lb="http://www.apache.org/images/asf_logo_wide.gif"
     rc="200" rm="OK" tn="Listen 1-1" dt="bin" de="ISO-8859-1" by="5866">
    <responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
⋮
Content-Type: image/gif
</responseHeader>
    <requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
    <responseData class="java.lang.String">http://www.apache.org/asf.gif</responseData>
      <responseFile class="java.lang.String">Mixed1.html</responseFile>
    <cookies class="java.lang.String"></cookies>
    <method class="java.lang.String">GET</method>
    <queryString class="java.lang.String"></queryString>
    <url>http://www.apache.org/asf.gif</url>
  </httpSample>
  <responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:13 GMT
⋮
Content-Type: text/html; charset=ISO-8859-1
</responseHeader>
  <requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
  <responseData class="java.lang.String"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
⋮

⋮

⋮

</responseData>
  <cookies class="java.lang.String"></cookies>
  <method class="java.lang.String">GET</method>
  <queryString class="java.lang.String"></queryString>
  <url>http://www.apache.org/</url>
</httpSample>

-- non HTTP Sample

<sample t="0" lt="0" ts="1144372616082" s="true" lb="Example Sampler"
    rc="200" rm="OK" tn="Listen 1-1" dt="text" de="ISO-8859-1" by="10">
  <responseHeader class="java.lang.String"></responseHeader>
  <requestHeader class="java.lang.String"></requestHeader>
  <responseData class="java.lang.String">Listen 1-1</responseData>
  <responseFile class="java.lang.String">Mixed2.unknown</responseFile>
  <samplerData class="java.lang.String">ssssss</samplerData>
</sample>

</testResults>

Note that the sample node name may be either "
<tt class="code">sample
</tt>
" or "
<tt class="code">httpSample
</tt>
".

13.6 XML Log format 2.2

The format of the JTL files is identical for 2.2 and 2.1. Format 2.2 only affects JMX files.

13.7 Sample Attributes

The sample attributes have the following meaning:

Attribute

Content

<tt class="code">by
</tt>

Bytes

<tt class="code">sby
</tt>

Sent Bytes

<tt class="code">de
</tt>

Data encoding

<tt class="code">dt
</tt>

Data type

<tt class="code">ec
</tt>

Error count (0 or 1, unless multiple samples are aggregated)

<tt class="code">hn
</tt>

Hostname where the sample was generated

<tt class="code">it
</tt>

Idle Time = time not spent sampling (milliseconds) (generally 0)

<tt class="code">lb
</tt>

Label

<tt class="code">lt
</tt>

Latency = time to initial response (milliseconds) - not all samplers support this

<tt class="code">ct
</tt>

Connect Time = time to establish the connection (milliseconds) - not all samplers support this

<tt class="code">na
</tt>

Number of active threads for all thread groups

<tt class="code">ng
</tt>

Number of active threads in this group

<tt class="code">rc
</tt>

Response Code (e.g.
<tt class="code">200
</tt>
)

<tt class="code">rm
</tt>

Response Message (e.g.
<tt class="code">OK
</tt>
)

<tt class="code">s
</tt>

Success flag (
<tt class="code">true
</tt>
/
<tt class="code">false
</tt>
)

<tt class="code">sc
</tt>

Sample count (1, unless multiple samples are aggregated)

<tt class="code">t
</tt>

Elapsed time (milliseconds)

<tt class="code">tn
</tt>

Thread Name

<tt class="code">ts
</tt>

timeStamp (milliseconds since midnight Jan 1, 1970 UTC)

<tt class="code">varname
</tt>

Value of the named variable

JMeter allows additional variables to be saved with the test plan.
Currently, the variables are saved as additional attributes.
The testplan variable name is used as the attribute name.
See

Sample variables

 (above) for more information.

13.8 Saving response data

As shown above, the response data can be saved in the XML log file if required.
However, this can make the file rather large, and the text has to be encoded so
that it is still valid XML. Also, images cannot be included.
Only sample responses with the type
<tt class="code">TEXT
</tt>
 can be saved.

Another solution is to use the Post-Processor
Save_Responses_to_a_file
.
This generates a new file for each sample, and saves the file name with the sample.
The file name can then be included in the sample log output.
The data will be retrieved from the file if necessary when the sample log file is reloaded.

13.9 Loading (reading) response data

To view an existing results file, you can use the File "
<tt class="code">Browse…
</tt>
" button to select a file.
If necessary, just create a dummy testplan with the appropriate Listener in it.

Results can be read from XML or CSV format files.
When reading from CSV results files, the header (if present) is used to determine which fields were saved.

In order to interpret a header-less CSV file correctly, the appropriate JMeter properties must be set.

JMeter does not clear any current data before loading the new file thus allowing files to be merged.
If you want to clear the current data, use the menu item:

 Run → Clear    (Ctrl + Shift + E)

or

 Run → Clear All    (Ctrl + E)

before loading the file.

13.10 Saving Listener GUI data

JMeter is capable of saving any listener as a PNG file. To do so, select the
listener in the left panel. Click

 Edit → Save Node As Image
.
A file dialog will
appear. Enter the desired name and save the listener.

The Listeners which generate output as tables can also be saved using Copy/Paste.
Select the desired cells in the table, and use the OS Copy short-cut (normally
Ctrl + C).
The data will be saved to the clipboard, from where it can be pasted into another application,
e.g. a spreadsheet or text editor.

Figure 1 -

 Edit → Save Node As Image

Index

Next

Prev

Copyright © 1999-2016, Apache Software Foundation

$Id: listeners.xml 1767377 2016-10-31 21:38:08Z pmouawad $

Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.


text:
package org.glowroot.agent.plugin.mongodb;

import org.glowroot.agent.plugin.api.QueryEntry;
import org.glowroot.agent.plugin.api.Timer;
import org.glowroot.agent.plugin.api.checker.Nullable;
import org.glowroot.agent.plugin.api.weaving.BindReceiver;
import org.glowroot.agent.plugin.api.weaving.BindReturn;
import org.glowroot.agent.plugin.api.weaving.BindTraveler;
import org.glowroot.agent.plugin.api.weaving.Mixin;
import org.glowroot.agent.plugin.api.weaving.OnAfter;
import org.glowroot.agent.plugin.api.weaving.OnBefore;
import org.glowroot.agent.plugin.api.weaving.OnReturn;
import org.glowroot.agent.plugin.api.weaving.Pointcut;
import org.glowroot.agent.plugin.mongodb.MongoCursorAspect.MongoCursorMixin;

public class MongoIterableAspect {

    // the field and method names are verbose since they will be mixed in to existing classes
    @Mixin({"com.mongodb.client.FindIterable", "com.mongodb.client.AggregateIterable"})
    public static class MongoIterableImpl implements MongoIterableMixin {

        // does not need to be volatile, app/framework must provide visibility of MongoIterables if
        // used across threads and this can piggyback
        private transient @Nullable QueryEntry glowroot$queryEntry;

        @Override
        public @Nullable QueryEntry glowroot$getQueryEntry() {
            return glowroot$queryEntry;
        }

        @Override
        public void glowroot$setQueryEntry(@Nullable QueryEntry queryEntry) {
            glowroot$queryEntry = queryEntry;
        }
    }

    // the method names are verbose since they will be mixed in to existing classes
    public interface MongoIterableMixin {

        @Nullable
        QueryEntry glowroot$getQueryEntry();

        void glowroot$setQueryEntry(@Nullable QueryEntry queryEntry);
    }

    @Pointcut(className = "com.mongodb.client.FindIterable", methodName = "*",
            methodParameterTypes = {".."}, methodReturnType = "com.mongodb.client.FindIterable")
    public static class MapAdvice {

        @OnReturn
        public static void onReturn(@BindReturn @Nullable MongoIterableMixin newMongoIterable,
                @BindReceiver MongoIterableMixin mongoIterable) {
            if (newMongoIterable != null) {
                newMongoIterable.glowroot$setQueryEntry(mongoIterable.glowroot$getQueryEntry());
            }
        }
    }

    @Pointcut(className = "com.mongodb.client.MongoIterable",
            subTypeRestriction = "com.mongodb.client.FindIterable"
                    + "|com.mongodb.client.AggregateIterable",
            methodName = "first", methodParameterTypes = {}, nestingGroup = "mongodb")
    public static class FirstAdvice {

        @OnBefore
        public static @Nullable Timer onBefore(@BindReceiver MongoIterableMixin mongoIterable) {
            QueryEntry queryEntry = mongoIterable.glowroot$getQueryEntry();
            return queryEntry == null ? null : queryEntry.extend();
        }

        @OnReturn
        public static void onReturn(@BindReturn @Nullable Object document,
                @BindReceiver MongoIterableMixin mongoIterable) {
            QueryEntry queryEntry = mongoIterable.glowroot$getQueryEntry();
            if (queryEntry == null) {
                return;
            }
            if (document != null) {
                queryEntry.incrementCurrRow();
            } else {
                queryEntry.rowNavigationAttempted();
            }
        }

        @OnAfter
        public static void onAfter(@BindTraveler @Nullable Timer timer) {
            if (timer != null) {
                timer.stop();
            }
        }
    }

    @Pointcut(className = "com.mongodb.client.MongoIterable",
            subTypeRestriction = "com.mongodb.client.FindIterable"
                    + "|com.mongodb.client.AggregateIterable",
            methodName = "iterator", methodParameterTypes = {},
            methodReturnType = "com.mongodb.client.MongoCursor", nestingGroup = "mongodb")
    public static class IteratorAdvice {

        @OnReturn
        public static void onReturn(@BindReturn @Nullable MongoCursorMixin mongoCursor,
                @BindReceiver MongoIterableMixin mongoIterable) {
            if (mongoCursor != null) {
                mongoCursor.glowroot$setQueryEntry(mongoIterable.glowroot$getQueryEntry());
            }
        }
    }
}


text:
<?php
require_once("resources/config.php");
require_once(TEMPLATES_PATH . "/header.php");
?>
<link href="css/style.css" rel="stylesheet" type="text/css">

Obtener la Moda

Seleccione los parámetros que quiere filtra

Deje vacío si no quiere filtrar la operación

	<form action="mode_result.php" method="POST">
		<?php
		require_once(TEMPLATES_PATH . "/filterForm.php");
		?>
  	</form>

<?php
require_once(TEMPLATES_PATH . "/footer.php");
?>


text:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\RperanPpm */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'bobot_kredit')->textInput(['maxlength' => true]) ?>

	<?php if (!Yii::$app->request->isAjax){ ?>

	        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

	<?php } ?>

    <?php ActiveForm::end(); ?>


text:
    <meta name="description" content="Pmw - a toolkit for building high-level compound widgets in Python">
    <meta name="content" content="python, megawidget, mega widget, compound widget, gui, tkinter">
    <title>Pmw.ScrolledFrame reference manual</title>

Pmw.ScrolledFrame

Name

Pmw.ScrolledFrame() -
    frame with optional scrollbars

Inherits

Pmw.MegaWidget

Description

    A scrolled frame consists of a scrollable interior frame within a
    clipping frame.  The programmer can create other widgets within
    the interior frame.  If the frame becomes larger than the
    surrounding clipping frame, the user can position the frame using
    the horizontal and vertical scrollbars.

    The scrollbars can be dynamic, which means that a scrollbar will
    only be displayed if it is necessary.  That is, if the frame is
    smaller than the surrounding clipping frame, the scrollbar will be
    hidden.

Options

Options for this megawidget and its base
classes are described below.

 borderframe

Initialisation option. If true, the borderframe component will be created. The default is 1.

 horizflex

Specifies how the width of the scrollable interior frame should be
    resized relative to the clipping frame.

    If 'fixed', the interior frame is set to the natural width, as
    requested by the child widgets of the frame.  If 'expand' and
    the requested width of the interior frame is less than the width
    of the clipping frame, the interior frame expands to fill the
    clipping frame.  If 'shrink' and the requested width of the
    interior frame is more than the width of the clipping frame, the
    interior frame shrinks to the width of the clipping frame.  If
    'elastic', the width of the interior frame is always set to the
    width of the clipping frame. The default is 'fixed'.

 horizfraction

Initialisation option. The fraction of the width of the clipper frame to scroll the
    interior frame when the user clicks on the horizontal scrollbar
    arrows. The default is 0.05.

 hscrollmode

The horizontal scroll mode.  If 'none', the horizontal scrollbar
    will never be displayed.  If 'static', the scrollbar will always
    be displayed.  If 'dynamic', the scrollbar will be displayed
    only if necessary. The default is 'dynamic'.

 labelmargin

Initialisation option. If the labelpos option is not None, this specifies the
        distance between the label component and the rest of the
        megawidget. The default is 0.

 labelpos

Initialisation option. Specifies where to place the label component.  If not
        None, it should be a concatenation of one or two of the
        letters 'n', 's', 'e' and 'w'.  The first letter
        specifies on which side of the megawidget to place the label.
        If a second letter is specified, it indicates where on that
        side to place the label.  For example, if labelpos is 'w',
        the label is placed in the center of the left hand side; if
        it is 'wn', the label is placed at the top of the left
        hand side; if it is 'ws', the label is placed at the
        bottom of the left hand side.

        If None, a label component is not created. The default is None.

 scrollmargin

Initialisation option. The distance between the scrollbars and the clipping frame. The default is 2.

 usehullsize

Initialisation option. If true, the size of the megawidget is determined solely by the
    width and height options of the hull component.

    Otherwise, the size of the megawidget is determined by the width
    and height of the clipper component, along with the size and/or
    existence of the other components, such as the label, the
    scrollbars and the scrollmargin option.  All these affect the
    overall size of the megawidget. The default is 0.

 vertflex

Specifies how the height of the scrollable interior frame should
    be resized relative to the clipping frame.

    If 'fixed', the interior frame is set to the natural height,
    as requested by the child widgets of the frame.  If 'expand' and
    the requested height of the interior frame is less than the height
    of the clipping frame, the interior frame expands to fill the
    clipping frame.  If 'shrink' and the requested height of the
    interior frame is more than the height of the clipping frame, the
    interior frame shrinks to the height of the clipping frame.  If
    'elastic', the height of the interior frame is always set to the
    height of the clipping frame. The default is 'fixed'.

 vertfraction

Initialisation option. The fraction of the height of the clipper frame to scroll the
    interior frame when the user clicks on the vertical scrollbar
    arrows. The default is 0.05.

 vscrollmode

The vertical scroll mode.  If 'none', the vertical scrollbar
    will never be displayed.  If 'static', the scrollbar will always
    be displayed.  If 'dynamic', the scrollbar will be displayed
    only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base
classes are described below.

 borderframe

A frame widget which snuggly fits around the clipper, to give the
    appearance of a border.  It is created with a border so that the
    clipper, which is created without a border, looks like it has a
    border. By default, this component is a Tkinter.Frame.

 clipper

The frame which is used to provide a clipped view of the frame
    component.  If the borderframe option is true, this is created
    with a borderwidth of 0 to overcome a known problem with using
    place to position widgets:  if a widget (in this case the
    frame component) is placed inside a frame (in this case the
    clipper component) and it extends across one of the edges of the
    frame, then the widget obscures the border of the frame.
    Therefore, if the clipper has no border, then this overlapping
    does not occur. By default, this component is a Tkinter.Frame.

 frame

The frame within the clipper to contain the widgets to be scrolled. By default, this component is a Tkinter.Frame.

 horizscrollbar

The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

 hull

This acts as the body for the entire megawidget.  Other components
    are created as children of the hull to further specialise this
    class. By default, this component is a Tkinter.Frame.

 label

If the labelpos option is not None, this component is
        created as a text label for the megawidget.  See the
        labelpos option for details.  Note that to set, for example,
        the text option of the label, you need to use the label_text
        component option. By default, this component is a Tkinter.Label.

 vertscrollbar

The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below.
For a description of its inherited methods, see the
manual for its base class
Pmw.MegaWidget.

 interior()

Return the frame within which the programmer may create widgets to
    be scrolled.  This is the same as component('frame').

 reposition()

Update the position of the frame component in the clipper and
    update the scrollbars.

    Usually, this method does not need to be called explicitly, since
    the position of the frame component and the scrollbars are
    automatically updated whenever the size of the frame or
    clipper components change or the user clicks in the scrollbars.
    However, if horizflex or vertflex is 'expand', the
    megawidget cannot detect when the requested size of the frame
    increases to greater than the size of the clipper.  Therefore,
    this method should be called when a new widget is added to the
    frame (or a widget is increased in size) after the initial
    megawidget construction.

 xview(mode = None, value = None, units = None)

Query or change the horizontal position of the scrollable interior
    frame.  If mode is None, return a tuple of two numbers, each
    between 0.0 and 1.0.  The first is the position of the left edge
    of the visible region of the contents of the scrolled frame,
    expressed as a fraction of the total width of the contents.  The
    second is the position of the right edge of the visible region.

    If mode == 'moveto', adjust the view of the interior so that
    the fraction value of the total width of the contents is
    off-screen to the left.  The value must be between 0.0 and
    1.0.

    If mode == 'scroll', adjust the view of the interior left or
    right by a fixed amount.  If what is 'units', move the view in
    units of horizfraction.  If what is pages, move the view in
    units of the width of the scrolled frame.  If value is positive,
    move to the right, otherwise move to the left.

 yview(mode = None, value = None, units = None)

Query or change the vertical position of the scrollable interior
    frame.  If mode is None, return a tuple of two numbers, each
    between 0.0 and 1.0.  The first is the position of the top edge
    of the visible region of the contents of the scrolled frame,
    expressed as a fraction of the total height of the contents.  The
    second is the position of the bottom edge of the visible region.

    If mode == 'moveto', adjust the view of the interior so that
    the fraction value of the total height of the contents is
    off-screen to the top.  The value must be between 0.0 and
    1.0.

    If mode == 'scroll', adjust the view of the interior up or
    down by a fixed amount.  If what is 'units', move the view in
    units of vertfraction.  If what is pages, move the view in
    units of the height of the scrolled frame.  If value is
    positive, move to down, otherwise move up.

Example

The image at the top of this manual is a snapshot
of the window (or part of the window) produced
by the following code.

class Demo:
    def __init__(self, parent):
        # Create the ScrolledFrame.
        self.sf = Pmw.ScrolledFrame(parent,
                labelpos = 'n', label_text = 'ScrolledFrame',
                usehullsize = 1,
                hull_width = 400,
                hull_height = 220,
        )

        # Create a group widget to contain the flex options.
        w = Pmw.Group(parent, tag_text='Flex')
        w.pack(side = 'bottom', padx = 5, pady = 3)

        hflex = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['fixed', 'expand', 'shrink', 'elastic'],
                command = self.sethflex,
                menubutton_width = 8,
        )
        hflex.pack(side = 'left', padx = 5, pady = 3)
        hflex.invoke('fixed')

        vflex = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['fixed', 'expand', 'shrink', 'elastic'],
                command = self.setvflex,
                menubutton_width = 8,
        )
        vflex.pack(side = 'left', padx = 5, pady = 3)
        vflex.invoke('fixed')

        # Create a group widget to contain the scrollmode options.
        w = Pmw.Group(parent, tag_text='Scroll mode')
        w.pack(side = 'bottom', padx = 5, pady = 0)

        hmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['none', 'static', 'dynamic'],
                command = self.sethscrollmode,
                menubutton_width = 8,
        )
        hmode.pack(side = 'left', padx = 5, pady = 3)
        hmode.invoke('dynamic')

        vmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['none', 'static', 'dynamic'],
                command = self.setvscrollmode,
                menubutton_width = 8,
        )
        vmode.pack(side = 'left', padx = 5, pady = 3)
        vmode.invoke('dynamic')

        self.radio = Pmw.RadioSelect(parent, selectmode = 'multiple',
            command = self.radioSelected)
        self.radio.add('center', text = 'Keep centered vertically')
        self.radio.pack(side = 'bottom')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(side = 'bottom')
        buttonBox.add('add', text = 'Add a button', command = self.addButton)
        buttonBox.add('yview', text = 'Show yview', command = self.showYView)
        buttonBox.add('scroll', text = 'Page down', command = self.pageDown)

        # Pack this last so that the buttons do not get shrunk when
        # the window is resized.
        self.sf.pack(padx = 5, pady = 3, fill = 'both', expand = 1)

        self.frame = self.sf.interior()

        self.row = 0
        self.col = 0

        for count in range(15):
            self.addButton()

    def sethscrollmode(self, tag):
        self.sf.configure(hscrollmode = tag)

    def setvscrollmode(self, tag):
        self.sf.configure(vscrollmode = tag)

    def sethflex(self, tag):
        self.sf.configure(horizflex = tag)

    def setvflex(self, tag):
        self.sf.configure(vertflex = tag)

    def addButton(self):
        button = Tkinter.Button(self.frame,
            text = '(%d,%d)' % (self.col, self.row))
        button.grid(row = self.row, column = self.col, sticky = 'nsew')

        self.frame.grid_rowconfigure(self.row, weight = 1)
        self.frame.grid_columnconfigure(self.col, weight = 1)
        if self.sf.cget('horizflex') == 'expand' or \
                self.sf.cget('vertflex') == 'expand':
            self.sf.reposition()

        if 'center' in self.radio.getcurselection():
            self.sf.update_idletasks()
            self.centerPage()

        if self.col == self.row:
            self.col = 0
            self.row = self.row + 1
        else:
            self.col = self.col + 1

    def showYView(self):
        print self.sf.yview()

    def pageDown(self):
        self.sf.yview('scroll', 1, 'page')

    def radioSelected(self, name, state):
        if state:
            self.centerPage()

    def centerPage(self):
        # Example of how to use the yview() method of Pmw.ScrolledFrame.
        top, bottom = self.sf.yview()
        size = bottom - top
        middle = 0.5 - size / 2
        self.sf.yview('moveto', middle)

    Pmw 1.3 -
     6 Aug 2007
     - Home

Manual page last reviewed: 18 February 2001