text:
var SetFixture = function () {
  this.$setFixture = jQuery('.kkl-match-fixture');
  this.$locationForm = jQuery('#location');
  this.$datePicker = jQuery('#fixture');

  this.$waitMsg = jQuery('.kkl-match-fixture .wait');
  this.$successMsg = jQuery('.kkl-match-fixture .success');
};

/**
 * Init SetFixture
 */
SetFixture.prototype.init = function () {
  console.log("initing");
  this.eventHandler();
  this.initDatepicker();
};

/**
 * Event Handler
 *
 * Change Match and choose Location
 * Submit Form
 */
SetFixture.prototype.eventHandler = function () {
  var _this = this;

  jQuery(document).on('change', '#match', function () {
    var locationId = parseInt(jQuery(this + ':selected').attr('data-location'));

    if (locationId) {
      _this.$locationForm.val(locationId);
    } else {
      _this.$locationForm.val('unknown');
    }
  });

  jQuery(document).on('submit', '#set_match_fixture', function (event) {
    event.preventDefault();

    _this.validateForm('set_match_fixture', function (formData) {
      _this.$waitMsg.addClass('-in');
      var sendData = {
        email: formData.email,
        match: {
          fixture: formData.fixture
        }
      };

      if (formData.location !== 'unknown') {
        sendData.match['location'] = formData.location
      }

      $.ajax({
        url: formData.apiUrl + '/wp-json/kkl/v1/matches/' + formData.match + '/fixture',
        type: 'PATCH',
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        data: JSON.stringify(sendData),
        success: function (response) {
          console.log('submit success', response);
          _this.$waitMsg.removeClass('-in');
          _this.$successMsg.addClass('-in');
        },
        error: function (e) {
          console.error('submit error', e);
        }
      });
    });

  });
};

/**
 * Init DateTimePicker
 * https://github.com/xdan/datetimepicker
 */
SetFixture.prototype.initDatepicker = function () {
  this.$datePicker.datetimepicker({
    i18n: {
      de: {
        months: [
          'Januar', 'Februar', 'März', 'April',
          'Mai', 'Juni', 'Juli', 'August',
          'September', 'Oktober', 'November', 'Dezember'
        ],
        dayOfWeek: [
          "So.", "Mo", "Di", "Mi",
          "Do", "Fr", "Sa."
        ]
      }
    },
    format: 'Y-m-d H:m',
    defaultTime: "20:00"
  });
};

/**
 * Validate and return Form Data
 *
 * @param form_id
 * @param callback
 */
SetFixture.prototype.validateForm = function (form_id, callback) {
  var $form = jQuery('#' + form_id);
  var i = 0;
  data = {
    formular: form_id,
    apiUrl: $form.attr('data-url')
  };

  // revert form errors
  $form.find('.required').removeClass('has-error');

  // find & validate formfields
  $form.find('input, select').each(function (index) {
    if (jQuery(this).attr('type') === 'text' || jQuery(this).attr('type') === 'number') {
      if (jQuery(this).val() === '') {
        i++;
        jQuery(this).addClass('has-error');
      } else {
        data[jQuery(this).attr('name')] = jQuery(this).val();
      }

    } else if (jQuery(this).attr('type') === 'email') {
      var email = jQuery.trim(jQuery(this).val());
      var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,12})$/;

      if (!regex.test(email)) {
        i++;
        jQuery(this).addClass('has-error');
      } else {
        data[jQuery(this).attr('name')] = jQuery(this).val();
      }
    } else {
      data[jQuery(this).attr('name')] = jQuery(this).val();
    }
  });

  if (i === 0) {
    callback(data);
  }
};

/**
 *
 * @type {SetFixture}
 */
jQuery(document).ready(function () {
  console.log("INCLUDED");
  var setFixture = new SetFixture();
  setFixture.init();
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 88: 119 (2003)

#### Original name
Mycosphaerella veratri-lobeliani Fakirova & Denchev

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package org.apache.flink.streaming.api.runners.python.beam;

import org.apache.flink.annotation.Internal;
import org.apache.flink.python.env.PythonEnvironmentManager;
import org.apache.flink.python.metric.FlinkMetricContainer;
import org.apache.flink.util.Preconditions;

import org.apache.beam.model.pipeline.v1.RunnerApi;
import org.apache.beam.runners.core.construction.ModelCoders;
import org.apache.beam.runners.core.construction.graph.ExecutableStage;
import org.apache.beam.runners.core.construction.graph.ImmutableExecutableStage;
import org.apache.beam.runners.core.construction.graph.PipelineNode;
import org.apache.beam.runners.core.construction.graph.SideInputReference;
import org.apache.beam.runners.core.construction.graph.TimerReference;
import org.apache.beam.runners.core.construction.graph.UserStateReference;
import org.apache.beam.runners.fnexecution.state.StateRequestHandler;
import org.apache.beam.sdk.coders.ByteArrayCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.GlobalWindow;
import org.apache.beam.sdk.util.WindowedValue;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import static org.apache.beam.runners.core.construction.BeamUrns.getUrn;

/**
 * A {@link BeamPythonFunctionRunner} used to execute Python stateless functions.
 */
@Internal
public abstract class BeamPythonStatelessFunctionRunner extends BeamPythonFunctionRunner {
	private static final String INPUT_ID = "input";
	private static final String OUTPUT_ID = "output";
	private static final String TRANSFORM_ID = "transform";

	private static final String MAIN_INPUT_NAME = "input";
	private static final String MAIN_OUTPUT_NAME = "output";

	private static final String INPUT_CODER_ID = "input_coder";
	private static final String OUTPUT_CODER_ID = "output_coder";
	private static final String WINDOW_CODER_ID = "window_coder";

	private static final String WINDOW_STRATEGY = "windowing_strategy";

	private final String functionUrn;

	public BeamPythonStatelessFunctionRunner(
		String taskName,
		PythonEnvironmentManager environmentManager,
		String functionUrn,
		Map<String, String> jobOptions,
		FlinkMetricContainer flinkMetricContainer) {
		super(taskName, environmentManager, StateRequestHandler.unsupported(), jobOptions, flinkMetricContainer);
		this.functionUrn = Preconditions.checkNotNull(functionUrn);
	}

	@Override
	@SuppressWarnings("unchecked")
	public ExecutableStage createExecutableStage() throws Exception {
		RunnerApi.Components components =
			RunnerApi.Components.newBuilder()
				.putPcollections(
					INPUT_ID,
					RunnerApi.PCollection.newBuilder()
						.setWindowingStrategyId(WINDOW_STRATEGY)
						.setCoderId(INPUT_CODER_ID)
						.build())
				.putPcollections(
					OUTPUT_ID,
					RunnerApi.PCollection.newBuilder()
						.setWindowingStrategyId(WINDOW_STRATEGY)
						.setCoderId(OUTPUT_CODER_ID)
						.build())
				.putTransforms(
					TRANSFORM_ID,
					RunnerApi.PTransform.newBuilder()
						.setUniqueName(TRANSFORM_ID)
						.setSpec(RunnerApi.FunctionSpec.newBuilder()
							.setUrn(functionUrn)
							.setPayload(
								org.apache.beam.vendor.grpc.v1p26p0.com.google.protobuf.ByteString.copyFrom(
									getUserDefinedFunctionsProtoBytes()))
							.build())
						.putInputs(MAIN_INPUT_NAME, INPUT_ID)
						.putOutputs(MAIN_OUTPUT_NAME, OUTPUT_ID)
						.build())
				.putWindowingStrategies(
					WINDOW_STRATEGY,
					RunnerApi.WindowingStrategy.newBuilder()
						.setWindowCoderId(WINDOW_CODER_ID)
						.build())
				.putCoders(
					INPUT_CODER_ID,
					getInputCoderProto())
				.putCoders(
					OUTPUT_CODER_ID,
					getOutputCoderProto())
				.putCoders(
					WINDOW_CODER_ID,
					getWindowCoderProto())
				.build();

		PipelineNode.PCollectionNode input =
			PipelineNode.pCollection(INPUT_ID, components.getPcollectionsOrThrow(INPUT_ID));
		List<SideInputReference> sideInputs = Collections.EMPTY_LIST;
		List<UserStateReference> userStates = Collections.EMPTY_LIST;
		List<TimerReference> timers = Collections.EMPTY_LIST;
		List<PipelineNode.PTransformNode> transforms =
			Collections.singletonList(
				PipelineNode.pTransform(TRANSFORM_ID, components.getTransformsOrThrow(TRANSFORM_ID)));
		List<PipelineNode.PCollectionNode> outputs =
			Collections.singletonList(
				PipelineNode.pCollection(OUTPUT_ID, components.getPcollectionsOrThrow(OUTPUT_ID)));
		return ImmutableExecutableStage.of(
			components, createPythonExecutionEnvironment(), input, sideInputs, userStates, timers, transforms, outputs, createValueOnlyWireCoderSetting());
	}

	private Collection<RunnerApi.ExecutableStagePayload.WireCoderSetting> createValueOnlyWireCoderSetting() throws IOException {
		WindowedValue<byte[]> value = WindowedValue.valueInGlobalWindow(new byte[0]);
		Coder<? extends BoundedWindow> windowCoder = GlobalWindow.Coder.INSTANCE;
		WindowedValue.FullWindowedValueCoder<byte[]> windowedValueCoder =
			WindowedValue.FullWindowedValueCoder.of(ByteArrayCoder.of(), windowCoder);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		windowedValueCoder.encode(value, baos);

		return Arrays.asList(
			RunnerApi.ExecutableStagePayload.WireCoderSetting.newBuilder()
				.setUrn(getUrn(RunnerApi.StandardCoders.Enum.PARAM_WINDOWED_VALUE))
				.setPayload(
					org.apache.beam.vendor.grpc.v1p26p0.com.google.protobuf.ByteString.copyFrom(baos.toByteArray()))
				.setInputOrOutputId(INPUT_ID)
				.build(),
			RunnerApi.ExecutableStagePayload.WireCoderSetting.newBuilder()
				.setUrn(getUrn(RunnerApi.StandardCoders.Enum.PARAM_WINDOWED_VALUE))
				.setPayload(
					org.apache.beam.vendor.grpc.v1p26p0.com.google.protobuf.ByteString.copyFrom(baos.toByteArray()))
				.setInputOrOutputId(OUTPUT_ID)
				.build()
		);
	}

	protected abstract byte[] getUserDefinedFunctionsProtoBytes();

	protected abstract RunnerApi.Coder getInputCoderProto();

	protected abstract RunnerApi.Coder getOutputCoderProto();

	/**
	 * Gets the proto representation of the window coder.
	 */
	private RunnerApi.Coder getWindowCoderProto() {
		return RunnerApi.Coder.newBuilder()
			.setSpec(
				RunnerApi.FunctionSpec.newBuilder()
					.setUrn(ModelCoders.GLOBAL_WINDOW_CODER_URN)
					.build())
			.build();
	}
}


text:
namespace map {

class GroupMapElementSystem : public MapElementSystem
{
public:
    DEFINE_SYSTEM_BASE(GroupMapElementSystem)
    GroupMapElementSystem();
protected:
    virtual void Init();
    virtual void Update( double DeltaTime );
private:
};

} // namespace map

#endif//INCLUDED_MAP_GROUP_MAP_ELEMENT_SYSTEM_H

//command:  "classgenerator.exe" -g "map_element_system" -c "group_map_element_system" -t "group_map_element"


text:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://api.service.data.esb.ymsino.com/")
package com.ymsino.water.service.data.collectTask;


text:
// Copyright (c) 2014 Oleg Eterevsky. Licensed under the MIT license.

/**
 * @file A compability layer over different types of storage.
 * Depending on the environment in which this code is run and the required
 * lifetime of stored data, different APIs are used. Four types of storage are
 * available. Here's the list of APIs used for each kind in the order of
 * priority:
 *   'permanent' - chrome.storage.sync, localStorage
 *   'local'     - chrome.storage.local, localStorage
 *   'session'   - array in background page, sessionStorage
 *   'memory'    - in-memory array
 *
 * Storage for each type is a singleton. The exposed interface of the storage
 * is similar to the API of chrome.storage.
 *
 * There are slight differences in how various implentations handle null and
 * undefined as stored values.
 */

var storageByImplType = {};

/**
 * @param {string} type
 * @return {StorageInterface}
 */
function getStorage(type) {
  var implType;

  switch (type) {
    case 'permanent':
      if (typeof chrome !== 'undefined' && chrome.storage) {
        implType = 'chrome.storage.sync';
      } else {
        implType = 'localStorage';
      }
      break;

    case 'local':
      if (typeof chrome !== 'undefined' && chrome.storage) {
        implType = 'chrome.storage.local';
      } else {
        implType = 'localStorage';
      }
      break;

    case 'session':
      if (BackgroundStorage.isAvailable()) {
        implType = 'background';
      } else {
        implType = 'sessionStorage';
      }
      break;

    case 'memory':
      implType = 'memory';
      break;

    default:
      throw 'Unknown storage type: ' + type;
  }

  if (implType in storageByImplType)
    return storageByImplType[implType];

  var storage;

  switch (implType) {
    case 'chrome.storage.sync':
      storage = new ChromeStorageWrapper(chrome.storage.sync, 'sync');
      break;

    case 'chrome.storage.local':
      storage = new ChromeStorageWrapper(chrome.storage.local, 'local');
      break;

    case 'localStorage':
      storage = new WebStorageWrapper(localStorage);
      break;

    case 'sessionStorage':
      storage = new WebStorageWrapper(sessionStorage);
      break;

    case 'background':
      storage = new BackgroundStorage();
      break;

    case 'memory':
      storage = new ObjectStorage();
      break;

    default:
      throw 'Internal error';
  }

  storageByImplType[implType] = storage;
  return storage;
}

/**
 * @constructor
 * @interface
 */
function StorageInterface() {}

/**
 * @type {boolean|undefined}
 */
StorageInterface.prototype.isSynchronous = false;

/**
 * @param {string|Object|Array.<string>} keys String: key of the element to be
 * retrieved, array: keys to be retrieved, object: elements to be retrieved with
 * defaults.
 * @param {function(Object)|null} opt_callback A callback, called with
 * a dictionary {key: value} for the requested elements. In case of null,
 * the value will be returned from this function directly, or the exception will
 * be raised.
 * @return {number|string|Object|undefined} In case callback is provided,
 * nothing is returned. In case it is not, and keys is a string, and the
 * undelying storage allows synchronous retrieval, the value is returned.
 */
StorageInterface.prototype.get = function(keys, opt_callback) {};

/**
 * @param {Object} items
 * @param {function} opt_callback
 */
StorageInterface.prototype.set = function(items, opt_callback) {};

/**
 * @param {string|Array.<string>} keys}
 * @param {function} opt_callback
 */
StorageInterface.prototype.remove = function(keys, opt_callback) {};

/**
 * @param {function(Object)} callback
 */
StorageInterface.prototype.addListener = function(callback) {};

/**
 * @constructor
 * @implements {StorageInterface}
 */
function ObjectStorage() {
  this.values_ = {};
  this.listeners_ = [];
}

ObjectStorage.prototype.isSynchronous = true;

ObjectStorage.prototype.get = function(keys, opt_callback) {
  if (!opt_callback) {
    if (typeof keys === 'string')
      return this.values_[keys];
    throw 'No callback and key is not string.';
  }

  var result = {};

  switch (typeof keys) {
    case 'string':
      result[keys] = this.values_[keys];
      break;

    case 'object':
      if (Array.isArray(keys)) {
        for (var i = 0; i < keys.length; i++) {
          result[keys[i]] = this.values_[keys[i]];
        }
      } else {
        for (var key in keys) {
          result[key] = (key in this.values_) ? this.values_[key]
                                              : keys[key];
        }
      }
      break;

    default:
      throw 'Wrong type of keys.';
  }

  setTimeout(opt_callback.bind(null, result), 0);
};

ObjectStorage.prototype.set = function(items, opt_callback) {
  var changes = {};
  for (var key in items) {
    changes[key] = {'oldValue': this.values_[key], 'newValue': items[key]};
    this.values_[key] = items[key];
  }

  this.fire_(changes);

  if (opt_callback) {
    setTimeout(opt_callback, 0);
  }
};

ObjectStorage.prototype.remove = function(keys, opt_callback) {
  if (typeof keys === 'string')
    keys = [keys];

  var changes = {};
  for (var i = 0; i < keys.length; i++) {
    changes[keys[i]] = {'oldValue': this.values_[keys[i]]};
    delete this.values_[keys[i]];
  }

  this.fire_(changes);
  if (opt_callback) {
    setTimeout(opt_callback, 0);
  }
};

ObjectStorage.prototype.addListener = function(listener) {
  this.listeners_.push(listener);
};

ObjectStorage.prototype.fire_ = function(changes) {
  for (var i = 0; i < this.listeners_.length; i++) {
    setTimeout(this.listeners_[i].bind(null, changes), 0);
  }
};

/**
 * @constructor
 * @implements {StorageInterface}
 * @param {Object} storage Either chrome.storage.local or chrome.storage.sync.
 * @param {string} areaName 'local' or 'sync'.
 */
function ChromeStorageWrapper(storage, areaName) {
  this.area_ = areaName;
  this.listeners_ = [];
  this.get = storage.get.bind(storage);
  this.set = storage.set.bind(storage);
  this.remove = storage.remove.bind(storage);
  chrome.storage.onChanged.addListener(this.handleChanges_.bind(this));
}

ChromeStorageWrapper.prototype.isSynchronous = false;

ChromeStorageWrapper.prototype.addListener = function(listener) {
  this.listeners_.push(listener);
};

ChromeStorageWrapper.prototype.handleChanges_ = function(changes, areaName) {
  if (areaName === this.area_) {
    for (var i = 0; i < this.listeners_.length; i++) {
      this.listeners_[i](changes);
    }
  }
};

/**
 * @constructor
 * @implements {StorageInterface}
 * @param {Storage} storage localStorage or sessionStorage.
 */
function WebStorageWrapper(storage, opt_window) {
  this.storage_ = storage;
  this.listeners_ = [];
  if (!opt_window)
    opt_window = window;
  opt_window.addEventListener('storage', this.handleEvent_.bind(this));
}

WebStorageWrapper.prototype.isSynchronous = true;

WebStorageWrapper.prototype.get = function(keys, opt_callback) {
  if (!opt_callback) {
    if (typeof keys === 'string')
      return JSON.parse(this.storage_.getItem(keys));
    throw 'No callback and key is not string.';
  }

  var result = {};

  switch (typeof keys) {
    case 'string':
      result[keys] = JSON.parse(this.storage_.getItem(keys));
      break;

    case 'object':
      if (Array.isArray(keys)) {
        for (var i = 0; i < keys.length; i++) {
          result[keys[i]] = JSON.parse(this.storage_.getItem(keys[i]));
        }
      } else {
        for (var key in keys) {
          var value = this.storage_.getItem(key);
          result[key] = (value === null) ? keys[key] : JSON.parse(value);
        }
      }
      break;

    default:
      throw 'Wrong type of keys.';
  }

  setTimeout(opt_callback.bind(null, result), 0);
};

/**
 * @param {Object} items
 * @param {function} opt_callback
 */
WebStorageWrapper.prototype.set = function(items, opt_callback) {
  var changes = {};
  for (var key in items) {
    changes[key] = {'oldValue': JSON.parse(this.storage_.getItem(key)),
                    'newValue': items[key]};
    this.storage_.setItem(key, JSON.stringify(items[key]));
  }

  this.fire_(changes);

  if (opt_callback) {
    setTimeout(opt_callback, 0);
  }
};

/**
 * @param {string|Array.<string>} keys}
 * @param {function} opt_callback
 */
WebStorageWrapper.prototype.remove = function(keys, opt_callback) {
  if (typeof keys === 'string')
    keys = [keys];

  var changes = {};
  for (var i = 0; i < keys.length; i++) {
    changes[keys[i]] = {'oldValue': JSON.parse(this.storage_.getItem(keys[i]))};
    this.storage_.removeItem(keys[i]);
  }

  this.fire_(changes);
  if (opt_callback) {
    setTimeout(opt_callback, 0);
  }
};

WebStorageWrapper.prototype.addListener = function(listener) {
  this.listeners_.push(listener);
};

WebStorageWrapper.prototype.fire_ = function(changes) {
  for (var i = 0; i < this.listeners_.length; i++) {
    setTimeout(this.listeners_[i].bind(null, changes), 0);
  }
};

/**
 * @param {Event} event
 */
WebStorageWrapper.prototype.handleEvent_ = function(event) {
  if (event.storageArea != this.storage_)
    return;

  var changes = {};
  var oldValue = null;
  var newValue = null;
  if (event.oldValue !== null && event.oldValue !== undefined)
    oldValue = JSON.parse(event.oldValue);
  if (event.newValue !== null && event.newValue !== undefined)
    newValue = JSON.parse(event.newValue);
  changes[event.key] = {'oldValue': oldValue, 'newValue': newValue};
  this.fire_(changes);
};

if (typeof exports !== 'undefined') {
  exports.getStorage = getStorage;
  exports.ObjectStorage = ObjectStorage;
  exports.WebStorageWrapper = WebStorageWrapper;
}

/**
 * Store data in ObjectStorage created on the background page. For this to work
 * @constructor
 */
function BackgroundStorage() {
}

/**
 * We can't synchronously check whether the background page contains Storage.
 */
BackgroundStorage.isAvailable = function() {
  if (!(typeof chrome !== 'undefined' &&
        chrome.runtime &&
        chrome.runtime.getBackgroundPage &&
        chrome.runtime.getManifest))
    return false;
  var manifest = chrome.runtime.getManifest();
  return manifest['app'] &&
         manifest['app']['background'] &&
         manifest['app']['background']['scripts'] ||  // <-- OR
         manifest['background'] &&
         manifest['background']['scripts'];
};

BackgroundStorage.prototype.isSynchronous = false;

BackgroundStorage.prototype.get = function(keys, callback) {
  chrome.runtime.getBackgroundPage(function(bg) {
    bg.getStorage('memory').get(keys, callback);
  }.bind(this));
};

BackgroundStorage.prototype.set = function(items, opt_callback) {
  chrome.runtime.getBackgroundPage(function(bg) {
    bg.getStorage('memory').set(items, opt_callback);
  }.bind(this));
};

BackgroundStorage.prototype.remove = function(keys, opt_callback) {
  chrome.runtime.getBackgroundPage(function(bg) {
    bg.getStorage('memory').remove(keys, opt_callback);
  }.bind(this));
};

BackgroundStorage.prototype.addListener = function(listener) {
  chrome.runtime.getBackgroundPage(function(bg) {
    bg.getStorage('memory').addListener(listener);
  }.bind(this));
};


text:
module Schnitzelpress
  module Fixture
    # Fixture class for font_awesome_char_map.yml
    class FontAwesomeCharMap

      FILE = 'font_awesome_char_map.yml'.freeze

      # Return all items of Font Awesome char map
      #
      # @return [Hash]
      #
      # @api private
      #
      def self.all
        @all ||= YAML.load_file(Schnitzelpress.fixtures.join(FILE))
      end

    end
  end
end


text:
CREATE DATABASE WashingMachineService

GO

use WashingMachineService

GO

CREATE TABLE Clients
(
	ClientId int PRIMARY KEY IDENTITY,
	FirstName varchar(50) NOT NULL,
	LastName varchar(50) NOT NULL,
	Phone char(12) NOT NULL
)

CREATE TABLE Mechanics
(
	MechanicId int PRIMARY KEY IDENTITY,
	FirstName varchar(50) NOT NULL,
	LastName varchar(50) NOT NULL,
	Address varchar(255) NOT NULL
)

CREATE TABLE Models
(
	ModelId int PRIMARY KEY IDENTITY,
	Name varchar(50) NOT NULL UNIQUE
)

CREATE TABLE Jobs
(
	JobId int PRIMARY KEY IDENTITY,
	ModelId int NOT NULL,
	Status varchar(50) CHECK (Status = 'Pending' OR Status = 'In Progress' OR Status = 'Finished') DEFAULT 'Pending' NOT NULL,
	ClientId int NOT NULL,
	MechanicId int,
	IssueDate date NOT NULL,
	FinishDate date,
	CONSTRAINT FK_Jobs_Models
	FOREIGN KEY (ModelId)
	REFERENCES Models(ModelId),
	CONSTRAINT FK_Jobs_Clients
	FOREIGN KEY (ClientId)
	REFERENCES Clients(ClientId),
	CONSTRAINT FK_Jobs_Mechanics
	FOREIGN KEY (MechanicId)
	REFERENCES Mechanics(MechanicId)
)

CREATE TABLE Orders
(
	OrderId int PRIMARY KEY IDENTITY,
	JobId int NOT NULL,
	IssueDate date,
	Delivered bit DEFAULT 0 NOT NULL
	CONSTRAINT FK_Orders_Jobs
	FOREIGN KEY (JobId)
	REFERENCES Jobs(JobId)
)

CREATE TABLE Vendors
(
	VendorId int PRIMARY KEY IDENTITY,
	Name varchar(50) NOT NULL UNIQUE
)

CREATE TABLE Parts
(
	PartId int PRIMARY KEY IDENTITY,
	SerialNumber varchar(50) UNIQUE NOT NULL,
	Description varchar(50),
	Price decimal(6,2) CHECK (Price > 0 AND Price < 9999.99) NOT NULL,
	VendorId int NOT NULL,
	StockQty int CHECK (StockQty >= 0) DEFAULT 0
	CONSTRAINT FK_Parts_Vendors
	FOREIGN KEY (VendorId)
	REFERENCES Vendors(VendorId)
)

CREATE TABLE OrderParts
(
	OrderId int NOT NULL,
	PartId int NOT NULL,
	Quantity int CHECK (Quantity > 0) DEFAULT 1 NOT NULL,
	CONSTRAINT PK_OrderId_PartId
	PRIMARY KEY (OrderId, PartId),
	CONSTRAINT FK_OrderParts_Orders
	FOREIGN KEY (OrderId)
	REFERENCES Orders(OrderId),
	CONSTRAINT FK_OrderParts_Parts
	FOREIGN KEY (PartId)
	REFERENCES Parts(PartId)
)

CREATE TABLE PartsNeeded
(
	JobId int NOT NULL,
	PartId int NOT NULL,
	Quantity int CHECK (Quantity > 0) DEFAULT 1 NOT NULL,
	CONSTRAINT PK_JobId_PartId
	PRIMARY KEY (JobId, PartId),
	CONSTRAINT FK_PartsNeeded_Jobs
	FOREIGN KEY (JobId)
	REFERENCES Jobs(JobId),
	CONSTRAINT FK_PartsNeeded_Parts
	FOREIGN KEY (PartId)
	REFERENCES Parts(PartId)
)


text:
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../modules/main');
var Route = Router.Route;
var Link = Router.Link;

var AsyncReactComponent = {
  loadedComponent: null,

  load: function() {
    if (this.constructor.loadedComponent) {
      return;
    }

    this.bundle(function(component) {
      this.constructor.loadedComponent = component;
      this.forceUpdate();
    }.bind(this));
  },

  componentDidMount: function() {
    setTimeout(this.load, 1000); // feel it good
  },

  render: function() {
    var component = this.constructor.loadedComponent;
    return component ? component(this.props) : this.preRender();
  }
};

var PreDashboard = React.createClass({
  mixins: [AsyncReactComponent],
  bundle: require('bundle?lazy!./dashboard.js'),
  preRender: function() {
    return
Loading dashboard...

  }
});

var PreInbox = React.createClass({
  mixins: [AsyncReactComponent],
  bundle: require('bundle?lazy!./inbox.js'),
  preRender: function() {
    return
Loading inbox...

  }
});

var App = React.createClass({
  render: function() {
    return (

Partial App

<Link to="dashboard">Dashboard</Link>

        {this.props.activeRouteHandler()}

    );
  }
});

var routes = (
  <Route handler={App}>
    <Route name="dashboard" path="dashboard" handler={PreDashboard}>
      <Route name="inbox" path="dashboard/inbox" handler={PreInbox}/>
    </Route>
  </Route>
);

React.renderComponent(routes, document.body);


text:
use rustc_data_structures::stable_set::FxHashSet;

use crate::ty::{PolyTraitRef, TyCtxt};

/// Given a PolyTraitRef, get the PolyTraitRefs of the trait's (transitive) supertraits.
///
/// A simplfied version of the same function at `rustc_infer::traits::util::supertraits`.
pub fn supertraits<'tcx>(
    tcx: TyCtxt<'tcx>,
    trait_ref: PolyTraitRef<'tcx>,
) -> impl Iterator<Item = PolyTraitRef<'tcx>> {
    Elaborator { tcx, visited: FxHashSet::from_iter([trait_ref]), stack: vec![trait_ref] }
}

struct Elaborator<'tcx> {
    tcx: TyCtxt<'tcx>,
    visited: FxHashSet<PolyTraitRef<'tcx>>,
    stack: Vec<PolyTraitRef<'tcx>>,
}

impl<'tcx> Elaborator<'tcx> {
    fn elaborate(&mut self, trait_ref: PolyTraitRef<'tcx>) {
        let supertrait_refs = self
            .tcx
            .super_predicates_of(trait_ref.def_id())
            .predicates
            .into_iter()
            .flat_map(|(pred, _)| {
                pred.subst_supertrait(self.tcx, &trait_ref).to_opt_poly_trait_ref()
            })
            .map(|t| t.value)
            .filter(|supertrait_ref| self.visited.insert(*supertrait_ref));

        self.stack.extend(supertrait_refs);
    }
}

impl<'tcx> Iterator for Elaborator<'tcx> {
    type Item = PolyTraitRef<'tcx>;

    fn next(&mut self) -> Option<PolyTraitRef<'tcx>> {
        if let Some(trait_ref) = self.stack.pop() {
            self.elaborate(trait_ref);
            Some(trait_ref)
        } else {
            None
        }
    }
}


text:
#include <ScatterCtrl/ScatterCtrl.h>
#include <ScatterCtrl/PieCtrl.h>

using namespace Upp;

#define LAYOUTFILE <ScatterCtrl_Demo/ScatterCtrl_Demo.lay>
#include <CtrlCore/lay.h>

#define IMAGECLASS MyImages
#define IMAGEFILE <ScatterCtrl_Demo/ScatterCtrl_Demo.iml>
#include <Draw/iml_header.h>

struct ScatterDemo : StaticRect {
	virtual void Init() {};
	virtual ScatterCtrl &Scatter() = 0;
};

void RegisterExample(const char *name, ScatterDemo* (*ctrl)(), String fileName);

class Tab1 : public WithTab1<ScatterDemo> {
public:
	typedef Tab1 CLASSNAME;

	virtual void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1;
	double s2y[5];
	double s3x[5], s3y[5];
	Vector<double> s4x, s4y;
	VectorMap<double, double> s5;
};

class Tab2 : public WithTab2<ScatterDemo> {
public:
	typedef Tab2 CLASSNAME;

	void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

	Callback back1, back2, back3;
};

class Tab3 : public WithTab3<ScatterDemo> {
public:
	typedef Tab3 CLASSNAME;

	void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};
};

class Tab4 : public WithTab4<ScatterDemo> {
public:
	typedef Tab4 CLASSNAME;

	void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1, s2;
};

class Tab5 : public WithTab5<ScatterDemo> {
public:
	typedef Tab5 CLASSNAME;

	void Init();
	void Animate();
	void Start();
	void Stop();
	void Reset();
	void PgDown();
	void PgUp();
	void Plus();
	void Minus();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	double t;
	Vector<Pointf> s1, s2;
};

class Tab6 : public WithTab6<ScatterDemo> {
public:
	typedef Tab6 CLASSNAME;

	void Init();
	void FormatX(String& s, int i, double d);
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1;
};

class Tab7 : public WithTab7<ScatterDemo> {
public:
	typedef Tab7 CLASSNAME;

	void Init();
	void AddSeries();
	void RemoveFirstSeries();
	void RemoveLastSeries();
	void RemoveAllSeries();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Array<Vector<Pointf> > series;
};

class Tab8 : public WithTab8<ScatterDemo> {
public:
	typedef Tab8 CLASSNAME;

	void Init();
	void MyFormat(String& s, int i, double d)
	{
		s = Format("%Mon", fround(d));
		if (!s.IsEmpty())
			s << "\n2011";
	}
	void MyFormatDelta(String& s, int i, double d)
	{
		s = FormatDouble(d, 1) + " " + t_("months");
	}
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1,s2, s3;
};

class Tab9 : public WithTab9<ScatterDemo> {
public:
	typedef Tab9 CLASSNAME;

	void Init();
	void OnFastView()		{scatter.SetFastViewX(fastView);};
	void OnSequentialX()	{scatter.SetSequentialXAll(sequentialX);};
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1,s2;
};

class Tab10 : public WithTab10<ScatterDemo> {
public:
	typedef Tab10 CLASSNAME;

	void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	double sx[5], sy[5];
};

class Tab11 : public WithTab11<ScatterDemo> {
public:
	typedef Tab11 CLASSNAME;

	Tab11() {};
	void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<double> sx, sy;
	LinearEquation linear;
	PolynomialEquation poly2, poly4;
	FourierEquation fourier;
};

class Tab12 : public WithTab12<ScatterDemo> {
public:
	typedef Tab12 CLASSNAME;

	virtual void Init();
	virtual ScatterCtrl &Scatter()	{return scatter;};

private:
	Vector<Pointf> s1;
};

class TabPie : public WithTabPie<StaticRect> {
public:
	typedef TabPie CLASSNAME;

	void Init();
};

class ScatterCtrl_Demo : public WithScatterCtrl_Demo<TopWindow> {
	typedef ScatterCtrl_Demo CLASSNAME;

public:
	ScatterCtrl_Demo();
	TabPie tabPie;

private:
	void Preview();
	void SavePNG();
	void SaveJPG();
#ifdef PLATFORM_WIN32
	void SaveEMF();
#endif
	void CopyClipboard();
	void SetMode();

	void OnSel();

	Vector<StaticRect *> examplesRects;
};

#endif


text:
package org.apache.flink.runtime.rest.messages.job.metrics;

import org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore;
import org.apache.flink.runtime.rest.messages.MessageQueryParameter;

/**
 * {@link MessageQueryParameter} for filtering metrics provided by {@link MetricStore}.
 *
 * @see org.apache.flink.runtime.rest.handler.job.metrics.AbstractMetricsHandler
 */
public class MetricsFilterParameter extends MessageQueryParameter<String> {

    private static final String QUERY_PARAMETER_NAME = "get";

    public MetricsFilterParameter() {
        super(QUERY_PARAMETER_NAME, MessageParameterRequisiteness.OPTIONAL);
    }

    @Override
    public String convertStringToValue(String value) {
        return value;
    }

    @Override
    public String convertValueToString(String value) {
        return value;
    }

    @Override
    public String getDescription() {
        return "Comma-separated list of string values to select specific metrics.";
    }
}


text:
@IMPORT url("../team/user-profile-badges.css");

.targetAudience span label {
	display: inline;
}

.targetAudience span input[type="checkbox"]{
	width:10%;
	-ms-transform: scale(1.6); /* IE */
  	-moz-transform: scale(1.6); /* FF */
  	-webkit-transform: scale(1.6); /* Safari and Chrome */
  	-o-transform: scale(1.6); /* Opera */
  	margin-bottom: 5px;
}

.domain span label {
	display: inline;
}

.domain span input[type="checkbox"]{
	width:10%;
}


text:
import logging
from collections import OrderedDict, namedtuple
from types import SimpleNamespace

from ufo2ft.constants import OPENTYPE_CATEGORIES_KEY
from ufo2ft.errors import InvalidFeaturesData
from ufo2ft.featureWriters import ast

INSERT_FEATURE_MARKER = r"\s*# Automatic Code.*"

class BaseFeatureWriter:
    """Abstract features writer.

    The `tableTag` class attribute (str) states the tag of the OpenType
    Layout table which the generated features are intended for.
    For example: "GPOS", "GSUB", "BASE", etc.

    The `features` class attribute defines the set of all the features
    that this writer supports. If you want to only write some of the
    available features you can provide a smaller sequence to 'features'
    constructor argument. By the default all the features supported by
    this writer will be outputted.

    Two writing modes are defined here:
    1) "skip" (default) will not write features if already present;
    2) "append" will add additional lookups to an existing feature,
       if present, or it will add a new one at the end of all features.
    Subclasses can set a different default mode or define a different
    set of `_SUPPORTED_MODES`.

    The `options` class attribute contains a mapping of option
    names with their default values. These can be overridden on an
    instance by passing keyword arguments to the constructor.
    """

    tableTag = None
    features = frozenset()
    mode = "skip"
    insertFeatureMarker = INSERT_FEATURE_MARKER
    options = {}

    _SUPPORTED_MODES = frozenset(["skip", "append"])

    def __init__(self, features=None, mode=None, **kwargs):
        if features is not None:
            features = frozenset(features)
            assert features, "features cannot be empty"
            unsupported = features.difference(self.__class__.features)
            if unsupported:
                raise ValueError("unsupported: %s" % ", ".join(unsupported))
            self.features = features

        if mode is not None:
            self.mode = mode
        if self.mode not in self._SUPPORTED_MODES:
            raise ValueError(self.mode)

        options = dict(self.__class__.options)
        for k in kwargs:
            if k not in options:
                raise TypeError("unsupported keyword argument: %r" % k)
            options[k] = kwargs[k]
        self.options = SimpleNamespace(**options)

        logger = ".".join([self.__class__.__module__, self.__class__.__name__])
        self.log = logging.getLogger(logger)

    def setContext(self, font, feaFile, compiler=None):
        """Populate a temporary `self.context` namespace, which is reset
        after each new call to `_write` method.
        Subclasses can override this to provide contextual information
        which depends on other data, or set any temporary attributes.

        The default implementation sets:
        - the current font;
        - the current FeatureFile object;
        - the current compiler instance (only present when this writer was
          instantiated from a FeatureCompiler);
        - a set of features (tags) to be generated. If self.mode is "skip",
          these are all the features which are _not_ already present.

        Returns the context namespace instance.
        """
        todo = set(self.features)
        insertComments = None
        if self.mode == "skip":
            if self.insertFeatureMarker is not None:
                insertComments = self.collectInsertMarkers(
                    feaFile, self.insertFeatureMarker, todo
                )
            # find existing feature blocks
            existing = ast.findFeatureTags(feaFile)
            # ignore features with insert marker
            if insertComments:
                existing.difference_update(insertComments.keys())
            # remove existing feature without insert marker from todo list
            todo.difference_update(existing)

        self.context = SimpleNamespace(
            font=font,
            feaFile=feaFile,
            compiler=compiler,
            todo=todo,
            insertComments=insertComments,
        )

        return self.context

    def shouldContinue(self):
        """Decide whether to start generating features or return early.
        Returns a boolean: True to proceed, False to skip.

        Sublcasses may override this to skip generation based on the presence
        or lack of other required pieces of font data.
        """
        if not self.context.todo:
            self.log.debug("No features to be generated; skipped")
            return False
        return True

    def write(self, font, feaFile, compiler=None):
        """Write features and class definitions for this font to a feaLib
        FeatureFile object.
        Returns True if feature file was modified, False if no new features
        were generated.
        """
        self.setContext(font, feaFile, compiler=compiler)
        try:
            if self.shouldContinue():
                return self._write()
            else:
                return False
        finally:
            del self.context

    def _write(self):
        """Subclasses must override this."""
        raise NotImplementedError

    def _insert(
        self,
        feaFile,
        classDefs=None,
        anchorDefs=None,
        markClassDefs=None,
        lookups=None,
        features=None,
    ):
        """
        Insert feature, its classDefs or markClassDefs and lookups at insert
        marker comment.

        If the insert marker is at the top of a feature block, the feature is
        inserted before that block, and after if the insert marker is at the
        bottom.
        """

        statements = feaFile.statements
        inserted = {}

        # First handle those with a known location, i.e. insert markers
        insertComments = self.context.insertComments
        indices = []
        for ix, feature in enumerate(features):
            if insertComments and feature.name in insertComments:
                block, comment = insertComments[feature.name]
                markerIndex = block.statements.index(comment)

                onlyCommentsBefore = all(
                    isinstance(s, ast.Comment) for s in block.statements[:markerIndex]
                )
                onlyCommentsAfter = all(
                    isinstance(s, ast.Comment) for s in block.statements[markerIndex:]
                )

                # Remove insert marker(s) from feature block.
                del block.statements[markerIndex]

                # insertFeatureMarker is in a block with only comments.
                # Replace that block with new feature block.
                if onlyCommentsBefore and onlyCommentsAfter:
                    index = statements.index(block)
                    statements.remove(block)

                # insertFeatureMarker is at the top of a feature block
                # or only preceded by other comments.
                elif onlyCommentsBefore:
                    index = statements.index(block)

                # insertFeatureMarker is at the bottom of a feature block
                # or only followed by other comments
                elif onlyCommentsAfter:
                    index = statements.index(block) + 1

                # insertFeatureMarker is in the middle of a feature block
                # preceded and followed by statements that are not comments
                #
                # Glyphs3 can insert a feature block when rules are before
                # and after the insert marker.
                # See
                # https://github.com/googlefonts/ufo2ft/issues/351#issuecomment-765294436
                # This is currently not supported.
                else:
                    raise InvalidFeaturesData(
                        "Insert marker has rules before and after, feature "
                        f"{block.name} cannot be inserted. This is not supported."
                    )

                statements.insert(index, feature)
                indices.append(index)
                inserted[id(feature)] = True

                # Now walk feature list backwards and insert any dependent features
                for i in range(ix - 1, -1, -1):
                    if id(features[i]) in inserted:
                        break
                    # Insert this before the current one i.e. at same array index
                    statements.insert(index, features[i])
                    # All the indices recorded previously have now shifted up by one
                    indices = [index] + [j + 1 for j in indices]
                    inserted[id(features[i])] = True

        # Finally, deal with any remaining features
        for feature in features:
            if id(feature) in inserted:
                continue
            index = len(statements)
            statements.insert(index, feature)
            indices.append(index)

        # Write classDefs, anchorsDefs, markClassDefs, lookups at earliest
        # opportunity.
        others = []
        minindex = min(indices)
        for defs in [classDefs, anchorDefs, markClassDefs]:
            if defs:
                others.extend(defs)
                others.append(ast.Comment(""))
        # Insert lookups
        if lookups:
            if minindex > 0 and not others:
                others.append(ast.Comment(""))
            others.extend(lookups)
        if others:
            feaFile.statements = statements = (
                statements[:minindex] + others + statements[minindex:]
            )

    @staticmethod
    def collectInsertMarkers(feaFile, insertFeatureMarker, featureTags):
        """
        Returns a dictionary of tuples (block, comment) keyed by feature tag
        with the block that contains the comment matching the insert feature
        marker, for given feature tags.
        """
        insertComments = dict()
        for match in ast.findCommentPattern(feaFile, insertFeatureMarker):
            blocks, comment = match[:-1], match[-1]
            if len(blocks) == 1 and isinstance(blocks[0], ast.FeatureBlock):
                block = blocks[0]
                if block.name in featureTags and block.name not in insertComments:
                    insertComments[block.name] = (block, comment)
        return insertComments

    def makeUnicodeToGlyphNameMapping(self):
        """Return the Unicode to glyph name mapping for the current font."""
        # Try to get the "best" Unicode cmap subtable if this writer is running
        # in the context of a FeatureCompiler, else create a new mapping from
        # the UFO glyphs
        compiler = self.context.compiler
        cmap = None
        if compiler is not None:
            table = compiler.ttFont.get("cmap")
            if table is not None:
                cmap = table.getBestCmap()
        if cmap is None:
            from ufo2ft.util import makeUnicodeToGlyphNameMapping

            if compiler is not None:
                glyphSet = compiler.glyphSet
            else:
                glyphSet = self.context.font
            cmap = makeUnicodeToGlyphNameMapping(glyphSet)
        return cmap

    def getOrderedGlyphSet(self):
        """Return OrderedDict[glyphName, glyph] sorted by glyphOrder."""
        compiler = self.context.compiler
        if compiler is not None:
            return compiler.glyphSet

        from ufo2ft.util import _GlyphSet, makeOfficialGlyphOrder

        font = self.context.font
        # subset glyphSet by skipExportGlyphs if any
        glyphSet = _GlyphSet.from_layer(
            font,
            skipExportGlyphs=set(font.lib.get("public.skipExportGlyphs", [])),
        )
        glyphOrder = makeOfficialGlyphOrder(glyphSet, font.glyphOrder)
        return OrderedDict((gn, glyphSet[gn]) for gn in glyphOrder)

    def compileGSUB(self):
        """Compile a temporary GSUB table from the current feature file."""
        from ufo2ft.util import compileGSUB

        compiler = self.context.compiler
        if compiler is not None:
            # The result is cached in the compiler instance, so if another
            # writer requests one it is not compiled again.
            if hasattr(compiler, "_gsub"):
                return compiler._gsub

            glyphOrder = compiler.ttFont.getGlyphOrder()
        else:
            # the 'real' glyph order doesn't matter because the table is not
            # compiled to binary, only the glyph names are used
            glyphOrder = sorted(self.context.font.keys())

        gsub = compileGSUB(self.context.feaFile, glyphOrder)

        if compiler and not hasattr(compiler, "_gsub"):
            compiler._gsub = gsub
        return gsub

    def getOpenTypeCategories(self):
        """Return 'public.openTypeCategories' values as a tuple of sets of
        unassigned, bases, ligatures, marks, components."""
        font = self.context.font
        unassigned, bases, ligatures, marks, components = (
            set(),
            set(),
            set(),
            set(),
            set(),
        )
        openTypeCategories = font.lib.get(OPENTYPE_CATEGORIES_KEY, {})

        for glyphName, category in openTypeCategories.items():
            if category == "unassigned":
                unassigned.add(glyphName)
            elif category == "base":
                bases.add(glyphName)
            elif category == "ligature":
                ligatures.add(glyphName)
            elif category == "mark":
                marks.add(glyphName)
            elif category == "component":
                components.add(glyphName)
            else:
                self.log.warning(
                    f"The '{OPENTYPE_CATEGORIES_KEY}' value of {glyphName} in "
                    f"{font.info.familyName} {font.info.styleName} is '{category}' "
                    "when it should be 'unassigned', 'base', 'ligature', 'mark' "
                    "or 'component'."
                )
        return namedtuple(
            "OpenTypeCategories", "unassigned base ligature mark component"
        )(
            frozenset(unassigned),
            frozenset(bases),
            frozenset(ligatures),
            frozenset(marks),
            frozenset(components),
        )

    def getGDEFGlyphClasses(self):
        """Return a tuple of GDEF GlyphClassDef base, ligature, mark, component
        glyph names.
        Sets are `None` if no 'public.openTypeCategories' values are defined or
        if no GDEF table is defined in the feature file.
        """
        feaFile = self.context.feaFile

        if ast.findTable(feaFile, "GDEF") is not None:
            return ast.getGDEFGlyphClasses(feaFile)

        unassigned, bases, ligatures, marks, components = self.getOpenTypeCategories()

        if not any((unassigned, bases, ligatures, marks, components)):
            return ast._GDEFGlyphClasses(None, None, None, None)
        return ast._GDEFGlyphClasses(
            frozenset(bases),
            frozenset(ligatures),
            frozenset(marks),
            frozenset(components),
        )


text:
'use strict'
/* global describe, it */
const assert = require('assert')
const supertest = require('supertest')

describe('Admin User CountryController', () => {
  let adminUser, userID, customerID

  before((done) => {

    adminUser = supertest.agent(global.app.packs.express.server)
    // Login as Admin
    adminUser
      .post('/auth/local')
      .set('Accept', 'application/json') //set header for this test
      .send({username: 'admin', password: 'admin1234'})
      .expect(200)
      .end((err, res) => {
        assert.ok(res.body.user.id)
        assert.ok(res.body.user.current_customer_id)
        userID = res.body.user.id
        customerID = res.body.user.current_customer_id
        done(err)
      })
  })
  it('should exist', () => {
    assert(global.app.api.controllers['CountryController'])
  })
})


text:
:mod:`cogen.core.proactors.select_impl`
=======================================

.. automodule:: cogen.core.proactors.select_impl
    :members:
    :undoc-members:
    :show-inheritance:


text:
using System;
using System.Collections.Generic;
using System.Linq;
using BlueSheep.Common.Protocol.Types;
using BlueSheep.Common.IO;
using BlueSheep.Engine.Types;

namespace BlueSheep.Common.Protocol.Messages
{
    public class AchievementFinishedInformationMessage : AchievementFinishedMessage
    {
        public new const uint ID =6381;
        public override uint ProtocolID
        {
            get { return ID; }
        }

        public string name;
        public int playerId;

        public AchievementFinishedInformationMessage()
        {
        }

        public AchievementFinishedInformationMessage(short id, byte finishedlevel, string name, int playerId)
         : base(id, finishedlevel)
        {
            this.name = name;
            this.playerId = playerId;
        }

        public override void Serialize(BigEndianWriter writer)
        {
            base.Serialize(writer);
            writer.WriteUTF(name);
            writer.WriteVarInt(playerId);
        }

        public override void Deserialize(BigEndianReader reader)
        {
            base.Deserialize(reader);
            name = reader.ReadUTF();
            playerId = reader.ReadVarInt();
            if (playerId < 0)
                throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
        }

    }

}


text:
See Cisco

## Term Format

* _action::_ The action to take when matched. See Actions section for valid options.
* _address::_ One or more network address tokens, matches source or destination.
* _comment::_ A text comment enclosed in double-quotes.  The comment can extend over multiple lines if desired, until a closing quote is encountered.
* _destination-address::_ One or more destination address tokens
* _destination-exclude::_ Exclude one or more address tokens from the specified destination-address
* _destination-port::_ One or more service definition tokens
* _dscp_match::_ Match a DSCP number.
* _expiration::_ stop rendering this term after specified date. [YYYY](YYYY.md)-[MM](MM.md)-[DD](DD.md)
* _icmp-code::_ Specifies the ICMP code to filter on.
* _icmp-type::_ Specify icmp-type code to match, see section [ICMP TYPES](PolicyFormat#ICMP_TYPES.md) for list of valid arguments
* _logging::_ Specify that this packet should be logged via syslog.
* _name::_ Name of the term.
* _option::_ See platforms supported Options section.
* _owner::_ Owner of the term, used for organizational purposes.
* _platform::_ one or more target platforms for which this term should ONLY be rendered.
*_platform-exclude:: one or more target platforms for which this term should NEVER be rendered.
* _protocol::_ the network protocols this term will match, such as tcp, udp, icmp, or a numeric value.
* _source-address::_ one or more source address tokens.
* _source-exclude::_ exclude one or more address tokens from the specified source-address.
* _source-port::_ one or more service definition tokens.
* _verbatim::_ this specifies that the text enclosed within quotes should be rendered into the output without interpretation or modification.  This is sometimes used as a temporary workaround while new required features are being added.

## Sub Tokens

### Actions

* _accept_
* _deny_
* _next_
* _reject_
* _reject-with-tcp-rst_

### Option

* _established::_ Only match established connections, implements tcp-established for tcp and sets destination port to 1024- 65535 for udp if destination port is not defined.
* _is-fragment::_ Matches on if a packet is a fragment.
* _tcp-established::_ Only match established tcp connections, based on statefull match or TCP flags. Not supported for other protocols.
* _tcp-initial::_ Only match initial packet for TCP protocol.


text:
package sonata.kernel.vimadaptor.commons.vnfd;

import com.fasterxml.jackson.annotation.JsonProperty;

public class NicCapabilities {

  private boolean mirroring;
  @JsonProperty("SR-IOV")
  private boolean srIov;

  public boolean isMirroring() {
    return mirroring;
  }

  public boolean isSrIov() {
    return srIov;
  }

  public void setMirroring(boolean mirroring) {
    this.mirroring = mirroring;
  }

  public void setSrIov(boolean srIov) {
    this.srIov = srIov;
  }

}


text:
This is a modified version of ipython-d3networkx originally developed by Jonathan Frederic (jon.freder@gmail.com). The original can be found [here](https://github.com/jdfreder/ipython-d3networkx).

This package is installed automatically when PySCeSToolbox is installed.

The original readme follows below:

# ipython-d3networkx

An IPython notebook widget that uses D3.js and NetworkX to make really cool, interactive, force directed graphs.

## Installation

In a terminal/commandline inside this directory, run

```
pip install .
```

For a development install, run

```
pip install -e .
```

## Examples

Inside the `examples` directory you'll find some examples of how to use the widget.

- `demo simple.ipynb`
  **Start here** for a demonstration of how the API can be used.
- `demo generators.ipynb`
  This example uses built-in NetworkX generators to render some interesting graphs.
- `demo factor.ipynb`
  This is a small example that factors a number between 0-100.
- `demo twitter.ipynb`
  This example renders Twitter retweets in realtime.


text:
#region copyright

/* * * * * * * * * * * * * * * * * * * * * * * * * */
/* Carl Zeiss Industrielle Messtechnik GmbH        */
/* Softwaresystem PiWeb                            */
/* (c) Carl Zeiss 2017                             */
/* * * * * * * * * * * * * * * * * * * * * * * * * */

#endregion

namespace Zeiss.PiWeb.Formplot.Common
{
	#region usings

	using System;

	#endregion

	/// <summary>
	/// Class containing helper methods for comparing doubles.
	/// (see https://msdn.microsoft.com/en-us/library/ya2zha7s(v=vs.110).aspx, Technique 1).
	///
	/// Comparing Nullables is done like in .NET Framework:
	/// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/using-nullable-types
	///
	/// Comparing nullables returns:
	///
	/// double? num1 = 10;
	/// double? num2 = null;
	/// double? num3 = null;
	///
	/// num1 == num2 = False
	/// num1 != num2 = True
	/// num1 >  num2 = False
	/// num1 >= num2 = False
	/// num1 <  num2 = False
	/// num1 <= num2 = False
	///
	/// num3 == num2 = True
	/// num3 != num2 = False
	/// num3 >  num2 = False
	/// num3 >= num2 = False
	/// num3 <  num2 = False
	/// num3 <= num2 = False
	/// </summary>
	internal static class DoubleCompareExtensions
	{
		#region constants

		internal const double DefaultPrecision = 1e-15;

		#endregion

		#region methods

		/// <summary>
		/// Checks if the given doubles can be considered "equal" under the given tolerance.
		/// </summary>
		/// <param name="x">First value.</param>
		/// <param name="y">Second value.</param>
		/// <param name="tolerance">Equality tolerance.</param>
		/// <returns>
		/// True if the distance between both values is smaller than the given tolerance. Otherwise false.
		/// </returns>
		internal static bool IsCloseTo( this double x, double y, double tolerance = DefaultPrecision )
		{
			// ReSharper disable once CompareOfFloatsByEqualityOperator
			return x == y || Math.Abs( x - y ) <= tolerance;
		}

		/// <summary>
		/// Checks if the given doubles can be considered "equal" under the given tolerance.
		/// </summary>
		/// <param name="x">First value.</param>
		/// <param name="y">Second value.</param>
		/// <param name="tolerance">Equality tolerance.</param>
		/// <returns>
		/// True if both are null or the distance between them is smaller than the given tolerance. Otherwise false.
		/// </returns>
		internal static bool IsCloseTo( this double? x, double? y, double tolerance = DefaultPrecision )
		{
			if( !x.HasValue && !y.HasValue )
				return true;

			if( !x.HasValue || !y.HasValue )
				return false;

			return IsCloseTo( x.Value, y.Value, tolerance );
		}

		#endregion
	}
}


text:
<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LoginFragment_web_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="me.jefferey.imguruploader.ui.fragments.LoginFragment">
</WebView>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SaperLibrary
{
    public class CellChangedEventArgs : EventArgs
    {
        public int x;
        public int y;

        public CellChangedEventArgs(int x, int y)
        {
            this.x = x;
            this.y = y;
        }
    }
}


text:
//	Manages geometry of a TableView that has the same width and height for
//	every cell

#ifndef _H_WIN_LTableMonoGeometry
#define _H_WIN_LTableMonoGeometry
#pragma once

#include <WIN_UTableHelpers.h>

// ---------------------------------------------------------------------------

class	LTableMonoGeometry : public LTableGeometry {
public:
						LTableMonoGeometry(
								LTableView			*inTableView,
								UInt16				inColWidth,
								UInt16				inRowHeight);
	virtual				~LTableMonoGeometry() { }

	virtual void		GetImageCellBounds(
								const STableCell	&inCell,
								SInt32				&outLeft,
								SInt32				&outTop,
								SInt32				&outRight,
								SInt32				&outBottom) const;

	virtual TableIndexT	GetRowHitBy(
								const CPoint		&inImagePt) const;
	virtual TableIndexT	GetColHitBy(
								const CPoint		&inImagePt) const;

	virtual void		GetTableDimensions(
								UInt32				&outWidth,
								UInt32				&outHeight) const;

	virtual UInt16		GetRowHeight(
								TableIndexT			/* inRow */) const
							{
								return mRowHeight;
							}

	virtual void		SetRowHeight(
								UInt16				inHeight,
								TableIndexT			inFromRow,
								TableIndexT			inToRow);

	virtual UInt16		GetColWidth(
								TableIndexT			/* inCol */) const
							{
								return mColWidth;
							}

	virtual void		SetColWidth(
								UInt16				inWidth,
								TableIndexT			inFromCol,
								TableIndexT			inToCol);

protected:
	UInt16		mColWidth;
	UInt16		mRowHeight;
};

#endif


text:
namespace maestropanel.plesklib.Models
{
    using System.Xml.Serialization;

    [XmlRoot("packet")]
    public class SubdomainAddResult : IResponseResult
    {
        private ApiResponse _response;

        public SubdomainAddResult()
        {
            this._response = new ApiResponse();
            this.subdomain = new SubdomainAddSubdomainResult();
        }

        [XmlElement("subdomain")]
        public SubdomainAddSubdomainResult subdomain { get; set; }

        public void SaveResult(ApiResponse response)
        {
            this._response = response;
        }

        public ResponseResult ToResult()
        {
            this.subdomain.add.result.apiResponse = _response;
            return this.subdomain.add.result;
        }
    }

    public class SubdomainAddSubdomainResult
    {
        public SubdomainAddSubdomainResult()
        {
            this.add = new SubdomainAddAddResult();
        }

        [XmlElement("add")]
        public SubdomainAddAddResult add { get; set; }
    }

    public class SubdomainAddAddResult
    {
        public SubdomainAddAddResult()
        {
            this.result = new ResponseResult();
        }

        [XmlElement("result")]
        public ResponseResult result { get; set; }
    }
}


text:
const nock = require("nock")
const bindAll = require("lodash/fp/bindAll")

class GithubMocks {
  constructor({ githubToken }) {
    bindAll(Object.getOwnPropertyNames(GithubMocks.prototype), this)

    this.authed = nock("https://api.github.com")
      .matchHeader("accept", "application/json")
      .matchHeader("user-agent", "Beekeeper Util/1.0")
      .matchHeader("authorization", `token ${githubToken}`)
  }

  getRepo() {
    this.authed.get("/repos/some-owner/example-repo-name").reply(200, {
      private: true,
    })
    return this
  }

  createRelease() {
    this.authed
      .post("/repos/some-owner/example-repo-name/releases", {
        tag_name: "v1.0.0",
        target_commitish: "master",
        name: "v1.0.0",
        body: "some message",
        draft: false,
        prerelease: false,
      })
      .reply(201)
  }

  cleanup() {
    nock.cleanAll()
  }

  done() {
    this.authed.done()
  }
}

module.exports = GithubMocks


text:
// Originally from ClientTests/Transport/StandardTesting/Client_Rescript_Get_ResponseTypes_Lists_Volume.xls;
package uk.co.exemel.disco.tests.clienttests.standardtesting;

import com.betfair.baseline.v2.BaselineSyncClient;
import com.betfair.baseline.v2.to.SimpleResponse;
import uk.co.exemel.disco.api.ExecutionContext;
import uk.co.exemel.disco.tests.clienttests.ClientTestsHelper;
import uk.co.exemel.disco.tests.clienttests.DiscoClientResponseTypeUtils;
import uk.co.exemel.disco.tests.clienttests.DiscoClientWrapper;
import uk.co.exemel.testing.utils.disco.helpers.DiscoHelpers;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Date;

import static org.testng.AssertJUnit.assertEquals;

/**
 * Ensure that when a testParameterStylesQA operation with escaped character & as a parameter is performed against disco via a disco client the request is sent and the response is handled correctly
 */
public class ClientGetResponseTypesListsVolumeTest {
    @Test(dataProvider = "TransportType")
    public void doTest(DiscoClientWrapper.TransportType tt) throws Exception {
        // Set up the client to use rescript transport
        DiscoClientWrapper discoClientWrapper1 = DiscoClientWrapper.getInstance(tt);
        DiscoClientWrapper wrapper = discoClientWrapper1;
        BaselineSyncClient client = discoClientWrapper1.getClient();
        ExecutionContext context = discoClientWrapper1.getCtx();
        // Create a date object to be passed as a parameter
        DiscoClientResponseTypeUtils discoClientResponseTypeUtils2 = new DiscoClientResponseTypeUtils();
        DiscoHelpers helper = new DiscoHelpers();
       Date convertedDate= helper.convertToSystemTimeZone("2009-06-01T13:50:00.0Z");
        Date dateParam = discoClientResponseTypeUtils2.createDateFromString("2009-06-01T13:50:00.0Z");
        // Make call to the method via client and validate the response is as expected
        SimpleResponse response3 = client.testParameterStylesQA(context, com.betfair.baseline.v2.enumerations.TestParameterStylesQAHeaderParamEnum.Foo, "this & that is 100%", convertedDate);
        assertEquals("headerParam=Foo,queryParam=this & that is 100%,dateQueryParam="+helper.dateInUTC(convertedDate), response3.getMessage());
    }

    @DataProvider(name="TransportType")
    public Object[][] clients() {
        return ClientTestsHelper.clientsToTest();
    }

}


text:
<?php

namespace Sitewards\DBCompare\Test;

use Sitewards\DBCompare\CompareApplication;

class CompareApplicationTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test that the arguments on the command are reset to 0
     */
    public function testCommandHasNoArguments()
    {
        $oCompareApp    = new CompareApplication();
        $oDefinition    = $oCompareApp->getDefinition();
        $iArgumentCount = $oDefinition->getArgumentCount();
        $this->assertEquals(0, $iArgumentCount);
    }
}


text:
#ifndef MLIR_HLO_UTILS_LHLO_UTILS_H
#define MLIR_HLO_UTILS_LHLO_UTILS_H

#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_common.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Types.h"

namespace mlir {
namespace lmhlo {

template <typename OpT>
static LogicalResult VerifyAllReduce(OpT op) {
  if (failed(mlir::hlo::VerifyReplicaGroups(op, /*is_uniform_sized=*/false)))
    return failure();

  // AllReduce has variadic operands and results that have the same size.
  // Each member of the operand should have the same type as the corresponding
  // member of the result.
  for (auto it : llvm::enumerate(
           llvm::zip(op.operands().getTypes(), op.results().getTypes()))) {
    Type operandType = std::get<0>(it.value());
    Type resultType = std::get<1>(it.value());
    if (operandType != resultType)
      return op.emitOpError("requires operand #")
             << it.index() << " (type: " << operandType << ") and result #"
             << it.index() << " (type: " << resultType << ") to have same type";
  }
  return success();
}

}  // namespace lmhlo
}  // namespace mlir

#endif  // MLIR_HLO_UTILS_LHLO_UTILS_H


text:
**To Do:**
* drive the robot towards a line of tape
* stop when you see the line
* turn until you see the line with the other TopHat


text:
$(document).ready(function() {
    $.validator.setDefaults({
        errorElement: "span",
        errorClass: "help-block",
        highlight: function(element, errorClass, validClass) {
            $(element).closest('.form-group').addClass('has-error');
        },
        unhighlight: function(element, errorClass, validClass) {
            $(element).closest('.form-group').removeClass('has-error');
        },
        errorPlacement: function(error, element) {
            if (element.parent('.input-group').length || element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
                error.insertAfter(element.parent());
            } else {
                error.insertAfter(element);
            }
        }
    });
});


text:
<script src="/lib/jquery-2.1.4.js"></script>
<script src="/lib/fastclick.js"></script>
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script>
<script src="/js/jquery-weui.js"></script>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TabletopPunkaCoreIntegration" parallel="methods" thread-count="4">

</suite>


text:
extern "C" {
#endif

#include <features.h>

#define __NEED_pid_t
#define __NEED_time_t
#define __NEED_suseconds_t
#define __NEED_struct_timeval

#include <bits/alltypes.h>

struct utmpx {
	short ut_type;
	pid_t ut_pid;
	char ut_line[32];
	char ut_id[4];
	char ut_user[32];
	char ut_host[256];
	struct {
		short __e_termination;
		short __e_exit;
	} ut_exit;
	long ut_session;
	struct timeval ut_tv;
	unsigned ut_addr_v6[4];
	char __unused[20];
};

void          endutxent(void);
struct utmpx *getutxent(void);
struct utmpx *getutxid(const struct utmpx *);
struct utmpx *getutxline(const struct utmpx *);
struct utmpx *pututxline(const struct utmpx *);
void          setutxent(void);

#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define e_exit __e_exit
#define e_termination __e_termination
void updwtmpx(const char *, const struct utmpx *);
int utmpxname(const char *);
#endif

#define EMPTY           0
#define RUN_LVL         1
#define BOOT_TIME       2
#define NEW_TIME        3
#define OLD_TIME        4
#define INIT_PROCESS    5
#define LOGIN_PROCESS   6
#define USER_PROCESS    7
#define DEAD_PROCESS    8

#ifdef __cplusplus
}
#endif

#endif


text:
using System.Collections.Generic;
using System.Linq;

namespace CFlow.Parser
{
    public static class CFlowParser
    {
        public static FunctionNode Parse(IList<string> graph)
        {
            var nodes = graph.Select(x => ParseLine(x)).Where(x => x != null);

            return BuildGraph(nodes.ToList());
        }

        private static FunctionNode BuildGraph(List<ParseFragment> nodes)
        {
            var root = nodes.First().Node;
            foreach (var node in nodes.Skip(1))
            {
                var level = node.Indent;
                var iterator = root;
                while (level > 1)
                {
                    level--;
                    iterator = iterator.Children.Last();
                }

                iterator.Children.Add(node.Node);
            }

            return root;
        }

        internal static ParseFragment ParseLine(string line)
        {
            // main: int (void), <c:\Users\Morten\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\main.cpp 14>
            var leadingWhiteSpace = line.TakeWhile(c => char.IsWhiteSpace(c)).Count();
            var leadingTabs = leadingWhiteSpace / 4;

            if (Regexes.LineWithFileInfo.IsMatch(line))
                return ParseLineWithFileInfo(line, leadingTabs);
            else if (Regexes.LineWithoutFileInfo.IsMatch(line))
                return ParseLineWithoutFileInfo(line, leadingTabs);
            else if (Regexes.LineWithoutFileAndSignatureInfo.IsMatch(line))
                return ParseLineWithoutFileAndSignatureInfo(line, leadingTabs);
            else
                return null;

        }

        private static ParseFragment ParseLineWithoutFileAndSignatureInfo(string line, int leadingTabs)
        {
            var match = Regexes.LineWithoutFileAndSignatureInfo.Match(line);

            var leadingSpace = match.Groups[1].Value;
            var name = match.Groups[2].Value;
            var signature = string.Empty;
            var filename = string.Empty;
            var lineNumber = "0";

            return new ParseFragment
            {
                Node = new FunctionNode(Function.Create(name, signature, filename, lineNumber), null),
                Indent = leadingTabs
            };
        }

        private static ParseFragment ParseLineWithoutFileInfo(string line, int leadingTabs)
        {
            var match = Regexes.LineWithoutFileInfo.Match(line);

            var leadingSpace = match.Groups[1].Value;
            var name = match.Groups[2].Value;
            var signature = match.Groups[3].Value;
            var filename = string.Empty;
            var lineNumber = "0";

            return new ParseFragment
            {
                Node = new FunctionNode(Function.Create(name, signature, filename, lineNumber), null),
                Indent = leadingTabs
            };
        }

        private static ParseFragment ParseLineWithFileInfo(string line, int leadingTabs)
        {
            var match = Regexes.LineWithFileInfo.Match(line);

            var leadingSpace = match.Groups[1].Value;
            var name = match.Groups[2].Value;
            var signature = match.Groups[3].Value;
            var filename = match.Groups[4].Value;
            var lineNumber = match.Groups[5].Value;

            return new ParseFragment
            {
                Node = new FunctionNode(Function.Create(name, signature, filename, lineNumber), null),
                Indent = leadingTabs
            };
        }
    }
}


text:
//
//  NSDate+Extension.m
//  TXCategories (https://github.com/tlsion/TXCategories)
//
//  Created by 王-庭协 on 2017/1/12.
//  Copyright © 2017年 ApeStar. All rights reserved.
//

#import "NSDate+TXExtension.h"
#import "NSDate+TXUtilities.h"

@implementation NSDate (TXExtension)

- (NSUInteger)tx_day {
    return [NSDate tx_day:self];
}

- (NSUInteger)tx_month {
    return [NSDate tx_month:self];
}

- (NSUInteger)tx_year {
    return [NSDate tx_year:self];
}

- (NSUInteger)tx_hour {
    return [NSDate tx_hour:self];
}

- (NSUInteger)tx_minute {
    return [NSDate tx_minute:self];
}

- (NSUInteger)tx_second {
    return [NSDate tx_second:self];
}

+ (NSUInteger)tx_day:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitDay) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSDayCalendarUnit) fromDate:date];
#endif

    return [dayComponents day];
}

+ (NSUInteger)tx_month:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitMonth) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSMonthCalendarUnit) fromDate:date];
#endif

    return [dayComponents month];
}

+ (NSUInteger)tx_year:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitYear) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSYearCalendarUnit) fromDate:date];
#endif

    return [dayComponents year];
}

+ (NSUInteger)tx_hour:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitHour) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSHourCalendarUnit) fromDate:date];
#endif

    return [dayComponents hour];
}

+ (NSUInteger)tx_minute:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitMinute) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSMinuteCalendarUnit) fromDate:date];
#endif

    return [dayComponents minute];
}

+ (NSUInteger)tx_second:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSDateComponents *dayComponents = [calendar components:(NSCalendarUnitSecond) fromDate:date];
#else
    NSDateComponents *dayComponents = [calendar components:(NSSecondCalendarUnit) fromDate:date];
#endif

    return [dayComponents second];
}

- (NSUInteger)tx_daysInYear {
    return [NSDate tx_daysInYear:self];
}

+ (NSUInteger)tx_daysInYear:(NSDate *)date {
    return [self tx_isLeapYear:date] ? 366 : 365;
}

- (BOOL)tx_isLeapYear {
    return [NSDate tx_isLeapYear:self];
}

+ (BOOL)tx_isLeapYear:(NSDate *)date {
    NSUInteger year = [date tx_year];
    if ((year % 4  == 0 && year % 100 != 0) || year % 400 == 0) {
        return YES;
    }
    return NO;
}

- (NSString *)tx_formatYMD {
    return [NSDate tx_formatYMD:self];
}

+ (NSString *)tx_formatYMD:(NSDate *)date {
    return [NSString stringWithFormat:@"%lu-%02lu-%02lu",[date tx_year],[date tx_month], [date tx_day]];
}

- (NSUInteger)tx_weeksOfMonth {
    return [NSDate tx_weeksOfMonth:self];
}

+ (NSUInteger)tx_weeksOfMonth:(NSDate *)date {
    return [[date tx_lastdayOfMonth] tx_weekOfYear] - [[date tx_begindayOfMonth] tx_weekOfYear] + 1;
}

- (NSUInteger)tx_weekOfYear {
    return [NSDate tx_weekOfYear:self];
}

+ (NSUInteger)tx_weekOfYear:(NSDate *)date {
    NSUInteger i;
    NSUInteger year = [date tx_year];

    NSDate *lastdate = [date tx_lastdayOfMonth];

    for (i = 1;[[lastdate tx_dateAfterDay:-7 * i] tx_year] == year; i++) {

    }

    return i;
}

- (NSDate *)tx_dateAfterDay:(NSUInteger)day {
    return [NSDate tx_dateAfterDate:self day:day];
}

+ (NSDate *)tx_dateAfterDate:(NSDate *)date day:(NSInteger)day {
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *componentsToAdd = [[NSDateComponents alloc] init];
    [componentsToAdd setDay:day];

    NSDate *dateAfterDay = [calendar dateByAddingComponents:componentsToAdd toDate:date options:0];

    return dateAfterDay;
}

- (NSDate *)tx_dateAfterMonth:(NSUInteger)month {
    return [NSDate tx_dateAfterDate:self month:month];
}

+ (NSDate *)tx_dateAfterDate:(NSDate *)date month:(NSInteger)month {
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *componentsToAdd = [[NSDateComponents alloc] init];
    [componentsToAdd setMonth:month];
    NSDate *dateAfterMonth = [calendar dateByAddingComponents:componentsToAdd toDate:date options:0];

    return dateAfterMonth;
}

- (NSDate *)tx_begindayOfMonth {
    return [NSDate tx_begindayOfMonth:self];
}

+ (NSDate *)tx_begindayOfMonth:(NSDate *)date {
    return [self tx_dateAfterDate:date day:-[date tx_day] + 1];
}

- (NSDate *)tx_lastdayOfMonth {
    return [NSDate tx_lastdayOfMonth:self];
}

+ (NSDate *)tx_lastdayOfMonth:(NSDate *)date {
    NSDate *lastDate = [self tx_begindayOfMonth:date];
    return [[lastDate tx_dateAfterMonth:1] tx_dateAfterDay:-1];
}

- (NSUInteger)tx_daysAgo {
    return [NSDate tx_daysAgo:self];
}

+ (NSUInteger)tx_daysAgo:(NSDate *)date {
    NSCalendar *calendar = [NSCalendar currentCalendar];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    NSDateComponents *components = [calendar components:(NSCalendarUnitDay)
                                               fromDate:date
                                                 toDate:[NSDate date]
                                                options:0];
#else
    NSDateComponents *components = [calendar components:(NSDayCalendarUnit)
                                               fromDate:date
                                                 toDate:[NSDate date]
                                                options:0];
#endif

    return [components day];
}

- (NSInteger)tx_weekday {
    return [NSDate tx_weekday:self];
}

+ (NSInteger)tx_weekday:(NSDate *)date {
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    NSDateComponents *comps = [gregorian components:(NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear | NSCalendarUnitWeekday) fromDate:date];
    NSInteger weekday = [comps weekday];

    return weekday;
}

- (NSString *)tx_dayFromWeekday {
    return [NSDate tx_dayFromWeekday:self];
}

+ (NSString *)tx_dayFromWeekday:(NSDate *)date {
    switch([date tx_weekday]) {
        case 1:
            return @"星期天";
            break;
        case 2:
            return @"星期一";
            break;
        case 3:
            return @"星期二";
            break;
        case 4:
            return @"星期三";
            break;
        case 5:
            return @"星期四";
            break;
        case 6:
            return @"星期五";
            break;
        case 7:
            return @"星期六";
            break;
        default:
            break;
    }
    return @"";
}

- (BOOL)tx_isSameDay:(NSDate *)anotherDate {
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *components1 = [calendar components:(NSCalendarUnitYear
                                                          | NSCalendarUnitMonth
                                                          | NSCalendarUnitDay)
                                                fromDate:self];
    NSDateComponents *components2 = [calendar components:(NSCalendarUnitYear
                                                          | NSCalendarUnitMonth
                                                          | NSCalendarUnitDay)
                                                fromDate:anotherDate];
    return ([components1 year] == [components2 year]
            && [components1 month] == [components2 month]
            && [components1 day] == [components2 day]);
}

- (BOOL)tx_isToday {
    return [self tx_isSameDay:[NSDate date]];
}

- (NSDate *)tx_dateByAddingDays:(NSUInteger)days {
    NSDateComponents *c = [[NSDateComponents alloc] init];
    c.day = days;
    return [[NSCalendar currentCalendar] dateByAddingComponents:c toDate:self options:0];
}

/**
 *  Get the month as a localized string from the given month number
 *
 *  @param month The month to be converted in string
 *  [1 - January]
 *  [2 - February]
 *  [3 - March]
 *  [4 - April]
 *  [5 - May]
 *  [6 - June]
 *  [7 - July]
 *  [8 - August]
 *  [9 - September]
 *  [10 - October]
 *  [11 - November]
 *  [12 - December]
 *
 *  @return Return the given month as a localized string
 */
+ (NSString *)tx_monthWithMonthNumber:(NSInteger)month {
    switch(month) {
        case 1:
            return @"January";
            break;
        case 2:
            return @"February";
            break;
        case 3:
            return @"March";
            break;
        case 4:
            return @"April";
            break;
        case 5:
            return @"May";
            break;
        case 6:
            return @"June";
            break;
        case 7:
            return @"July";
            break;
        case 8:
            return @"August";
            break;
        case 9:
            return @"September";
            break;
        case 10:
            return @"October";
            break;
        case 11:
            return @"November";
            break;
        case 12:
            return @"December";
            break;
        default:
            break;
    }
    return @"";
}

+ (NSString *)tx_stringWithDate:(NSDate *)date format:(NSString *)format {
    return [date tx_stringWithFormat:format];
}

- (NSString *)tx_stringWithFormat:(NSString *)format {
    NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
    [outputFormatter setDateFormat:format];

    NSString *retStr = [outputFormatter stringFromDate:self];

    return retStr;
}

+ (NSDate *)tx_dateWithString:(NSString *)string format:(NSString *)format {
    NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
    [inputFormatter setDateFormat:format];

    NSDate *date = [inputFormatter dateFromString:string];

    return date;
}

- (NSUInteger)tx_daysInMonth:(NSUInteger)month {
    return [NSDate tx_daysInMonth:self month:month];
}

+ (NSUInteger)tx_daysInMonth:(NSDate *)date month:(NSUInteger)month {
    switch (month) {
        case 1: case 3: case 5: case 7: case 8: case 10: case 12:
            return 31;
        case 2:
            return [date tx_isLeapYear] ? 29 : 28;
    }
    return 30;
}

- (NSUInteger)tx_daysInMonth {
    return [NSDate tx_daysInMonth:self];
}

+ (NSUInteger)tx_daysInMonth:(NSDate *)date {
    return [self tx_daysInMonth:date month:[date tx_month]];
}

- (NSString *)tx_timeInfo {
    return [NSDate tx_timeInfoWithDate:self];
}

+ (NSString *)tx_timeInfoWithDate:(NSDate *)date {
    return [self tx_timeInfoWithDateString:[self tx_stringWithDate:date format:[self tx_ymdHmsFormat]]];
}

+ (NSString *)tx_timeInfoWithDateString:(NSString *)dateString {
    NSDate *date = [self tx_dateWithString:dateString format:[self tx_ymdHmsFormat]];

    NSDate *curDate = [NSDate date];
    NSTimeInterval time = -[date timeIntervalSinceDate:curDate];

    int month = (int)([curDate tx_month] - [date tx_month]);
    int year = (int)([curDate tx_year] - [date tx_year]);
    int day = (int)([curDate tx_day] - [date tx_day]);

    NSTimeInterval retTime = 1.0;
    if (time < 60)
    {
        return @"刚刚";
    }
    else if (time < 3600) { // 小于一小时
        retTime = time / 60;
        retTime = retTime <= 0.0 ? 1.0 : retTime;
        return [NSString stringWithFormat:@"%.0f分钟前", retTime];
    } else if (time < 3600 * 24) { // 小于一天,也就是今天
        retTime = time / 3600;
        retTime = retTime <= 0.0 ? 1.0 : retTime;
        return [NSString stringWithFormat:@"%.0f小时前", retTime];
    } else if (time < 3600 * 24 * 2 && [date tx_isYesterday]) {
        return @"昨天";
    }
    // 第一个条件是同年,且相隔时间在一个月内
    // 第二个条件是隔年,对于隔年,只能是去年12月与今年1月这种情况
    else if ((abs(year) == 0 && abs(month) <= 1)
             || (abs(year) == 1 && [curDate tx_month] == 1 && [date tx_month] == 12)) {
        int retDay = 0;
        if (year == 0) { // 同年
            if (month == 0) { // 同月
                retDay = day;
            }
        }

        if (retDay <= 0) {
            // 获取发布日期中,该月有多少天
            int totalDays = (int)[self tx_daysInMonth:date month:[date tx_month]];

            // 当前天数 + (发布日期月中的总天数-发布日期月中发布日,即等于距离今天的天数)
            retDay = (int)[curDate tx_day] + (totalDays - (int)[date tx_day]);
        }

        return [NSString stringWithFormat:@"%d天前", (abs)(retDay)];
    } else  {
        if (abs(year) <= 1) {
            if (year == 0) { // 同年
                return [NSString stringWithFormat:@"%d个月前", abs(month)];
            }

            // 隔年
            int month = (int)[curDate tx_month];
            int preMonth = (int)[date tx_month];
            if (month == 12 && preMonth == 12) {// 隔年,但同月,就作为满一年来计算
                return @"1年前";
            }
            return [NSString stringWithFormat:@"%d个月前", (abs)(12 - preMonth + month)];
        }

        return [NSString stringWithFormat:@"%d年前", abs(year)];
    }

    return @"1小时前";
}

/**
 * 返回*年*月*天*小时*分钟*秒
 */
- (NSString *)tx_timeLeft{
    return [NSDate tx_timeLeftWithDate:self];
}

+ (NSString *)tx_timeLeftWithDate:(NSDate *)date{
    return [self tx_timeLeftWithDateString:[self tx_stringWithDate:date format:[self tx_ymdHmsFormat]]];
}

+ (NSString *)tx_timeLeftWithDateString:(NSString *)dateString{
    NSDate *date = [self tx_dateWithString:dateString format:[self tx_ymdHmsFormat]];
    long int delta = lround( [date timeIntervalSinceDate:[NSDate date]] );

    NSMutableString * result = [NSMutableString string];

    if ( delta >= TX_D_YEAR )
    {
        NSInteger years = ( delta / TX_D_YEAR );
        [result appendFormat:@"%ld年", (long)years];
        delta -= years * TX_D_YEAR ;
    }

    if ( delta >= TX_D_MONTH )
    {
        NSInteger months = ( delta / TX_D_MONTH );
        [result appendFormat:@"%ld月", (long)months];
        delta -= months * TX_D_MONTH ;
    }

    if ( delta >= TX_D_DAY )
    {
        NSInteger days = ( delta / TX_D_DAY );
        [result appendFormat:@"%ld天", (long)days];
        delta -= days * TX_D_DAY ;
    }

    if ( delta >= TX_D_HOUR )
    {
        NSInteger hours = ( delta / TX_D_HOUR );
        [result appendFormat:@"%ld小时", (long)hours];
        delta -= hours * TX_D_HOUR ;
    }

    if ( delta >= TX_D_MINUTE )
    {
        NSInteger minutes = ( delta / TX_D_MINUTE );
        [result appendFormat:@"%ld分钟", (long)minutes];
        delta -= minutes * TX_D_MINUTE ;
    }

    NSInteger seconds = ( delta / TX_D_SECOND );
    [result appendFormat:@"%ld秒", (long)seconds];

    return result;
}

- (NSString *)tx_ymdFormat {
    return [NSDate tx_ymdFormat];
}

- (NSString *)tx_hmsFormat {
    return [NSDate tx_hmsFormat];
}

- (NSString *)tx_ymdHmsFormat {
    return [NSDate tx_ymdHmsFormat];
}

+ (NSString *)tx_ymdFormat {
    return @"yyyy-MM-dd";
}

+ (NSString *)tx_hmsFormat {
    return @"HH:mm:ss";
}

+ (NSString *)tx_ymdHmsFormat {
    return [NSString stringWithFormat:@"%@ %@", [self tx_ymdFormat], [self tx_hmsFormat]];
}

- (NSDate *)tx_offsetYears:(int)numYears {
    return [NSDate tx_offsetYears:numYears fromDate:self];
}

+ (NSDate *)tx_offsetYears:(int)numYears fromDate:(NSDate *)fromDate {
    if (fromDate == nil) {
        return nil;
    }

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
#else
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSGregorianCalendar];
#endif

    NSDateComponents *offsetComponents = [[NSDateComponents alloc] init];
    [offsetComponents setYear:numYears];

    return [gregorian dateByAddingComponents:offsetComponents
                                      toDate:fromDate
                                     options:0];
}

- (NSDate *)tx_offsetMonths:(int)numMonths {
    return [NSDate tx_offsetMonths:numMonths fromDate:self];
}

+ (NSDate *)tx_offsetMonths:(int)numMonths fromDate:(NSDate *)fromDate {
    if (fromDate == nil) {
        return nil;
    }

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
#else
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSGregorianCalendar];
#endif

    NSDateComponents *offsetComponents = [[NSDateComponents alloc] init];
    [offsetComponents setMonth:numMonths];

    return [gregorian dateByAddingComponents:offsetComponents
                                      toDate:fromDate
                                     options:0];
}

- (NSDate *)tx_offsetDays:(int)numDays {
    return [NSDate tx_offsetDays:numDays fromDate:self];
}

+ (NSDate *)tx_offsetDays:(int)numDays fromDate:(NSDate *)fromDate {
    if (fromDate == nil) {
        return nil;
    }

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
#else
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSGregorianCalendar];
#endif

    NSDateComponents *offsetComponents = [[NSDateComponents alloc] init];
    [offsetComponents setDay:numDays];

    return [gregorian dateByAddingComponents:offsetComponents
                                      toDate:fromDate
                                     options:0];
}

- (NSDate *)tx_offsetHours:(int)hours {
    return [NSDate tx_offsetHours:hours fromDate:self];
}

+ (NSDate *)tx_offsetHours:(int)numHours fromDate:(NSDate *)fromDate {
    if (fromDate == nil) {
        return nil;
    }

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
    // NSDayCalendarUnit
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
#else
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSGregorianCalendar];
#endif

    NSDateComponents *offsetComponents = [[NSDateComponents alloc] init];
    [offsetComponents setHour:numHours];

    return [gregorian dateByAddingComponents:offsetComponents
                                      toDate:fromDate
                                     options:0];
}
@end


text:
ezie.gui.config.bindings.variations_bar = [
];


text:
__version__ = '0.0.3'
__all__ = ['parser']

try:
    from . import *
except ImportError:
    pass  # imports will fail during dependency collection