text:
"""Security_Label TQL Filter"""
# standard library
from enum import Enum

# first-party
from tcex.api.tc.v3.api_endpoints import ApiEndpoints
from tcex.api.tc.v3.filter_abc import FilterABC
from tcex.api.tc.v3.tql.tql import Tql
from tcex.api.tc.v3.tql.tql_operator import TqlOperator
from tcex.api.tc.v3.tql.tql_type import TqlType

class SecurityLabelFilter(FilterABC):
    """Filter Object for SecurityLabels"""

    @property
    def _api_endpoint(self) -> str:
        """Return the API endpoint."""
        return ApiEndpoints.SECURITY_LABELS.value

    def color(self, operator: Enum, color: str):
        """Filter Color based on **color** keyword.

        Args:
            operator: The operator enum for the filter.
            color: The color of the security label (in hex triplet format).
        """
        self._tql.add_filter('color', operator, color, TqlType.STRING)

    def date_added(self, operator: Enum, date_added: str):
        """Filter Date Added based on **dateAdded** keyword.

        Args:
            operator: The operator enum for the filter.
            date_added: The date the security label was added to the system.
        """
        date_added = self.utils.any_to_datetime(date_added).strftime('%Y-%m-%d %H:%M:%S')
        self._tql.add_filter('dateAdded', operator, date_added, TqlType.STRING)

    def description(self, operator: Enum, description: str):
        """Filter Description based on **description** keyword.

        Args:
            operator: The operator enum for the filter.
            description: The description of the security label.
        """
        self._tql.add_filter('description', operator, description, TqlType.STRING)

    @property
    def has_group(self):
        """Return **GroupFilter** for further filtering."""
        # first-party
        from tcex.api.tc.v3.groups.group_filter import GroupFilter

        groups = GroupFilter(Tql())
        self._tql.add_filter('hasGroup', TqlOperator.EQ, groups, TqlType.SUB_QUERY)
        return groups

    def has_group_attribute(self, operator: Enum, has_group_attribute: int):
        """Filter Associated Group based on **hasGroupAttribute** keyword.

        Args:
            operator: The operator enum for the filter.
            has_group_attribute: A nested query for association to other groups.
        """
        self._tql.add_filter('hasGroupAttribute', operator, has_group_attribute, TqlType.INTEGER)

    @property
    def has_indicator(self):
        """Return **IndicatorFilter** for further filtering."""
        # first-party
        from tcex.api.tc.v3.indicators.indicator_filter import IndicatorFilter

        indicators = IndicatorFilter(Tql())
        self._tql.add_filter('hasIndicator', TqlOperator.EQ, indicators, TqlType.SUB_QUERY)
        return indicators

    def has_indicator_attribute(self, operator: Enum, has_indicator_attribute: int):
        """Filter Associated Indicator based on **hasIndicatorAttribute** keyword.

        Args:
            operator: The operator enum for the filter.
            has_indicator_attribute: A nested query for association to other indicators.
        """
        self._tql.add_filter(
            'hasIndicatorAttribute', operator, has_indicator_attribute, TqlType.INTEGER
        )

    @property
    def has_victim(self):
        """Return **VictimFilter** for further filtering."""
        # first-party
        from tcex.api.tc.v3.victims.victim_filter import VictimFilter

        victims = VictimFilter(Tql())
        self._tql.add_filter('hasVictim', TqlOperator.EQ, victims, TqlType.SUB_QUERY)
        return victims

    def has_victim_attribute(self, operator: Enum, has_victim_attribute: int):
        """Filter Associated Victim based on **hasVictimAttribute** keyword.

        Args:
            operator: The operator enum for the filter.
            has_victim_attribute: A nested query for association to other victims.
        """
        self._tql.add_filter('hasVictimAttribute', operator, has_victim_attribute, TqlType.INTEGER)

    def id(self, operator: Enum, id: int):  # pylint: disable=redefined-builtin
        """Filter ID based on **id** keyword.

        Args:
            operator: The operator enum for the filter.
            id: The ID of the security label.
        """
        self._tql.add_filter('id', operator, id, TqlType.INTEGER)

    def name(self, operator: Enum, name: str):
        """Filter Name based on **name** keyword.

        Args:
            operator: The operator enum for the filter.
            name: The name of the security label.
        """
        self._tql.add_filter('name', operator, name, TqlType.STRING)

    def owner(self, operator: Enum, owner: int):
        """Filter Owner ID based on **owner** keyword.

        Args:
            operator: The operator enum for the filter.
            owner: The owner ID of the security label.
        """
        self._tql.add_filter('owner', operator, owner, TqlType.INTEGER)

    def owner_name(self, operator: Enum, owner_name: str):
        """Filter Owner Name based on **ownerName** keyword.

        Args:
            operator: The operator enum for the filter.
            owner_name: The owner name of the security label.
        """
        self._tql.add_filter('ownerName', operator, owner_name, TqlType.STRING)

    def summary(self, operator: Enum, summary: str):
        """Filter Summary based on **summary** keyword.

        Args:
            operator: The operator enum for the filter.
            summary: The name of the security label.
        """
        self._tql.add_filter('summary', operator, summary, TqlType.STRING)

    def victim_id(self, operator: Enum, victim_id: int):
        """Filter Victim ID based on **victimId** keyword.

        Args:
            operator: The operator enum for the filter.
            victim_id: The ID of the victim the security label is applied to.
        """
        self._tql.add_filter('victimId', operator, victim_id, TqlType.INTEGER)


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M9.479,14H15.708V9.458H9.479ZM2.854,15.479V4.5H17.146V15.479Z"/>
</vector>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace PHPExiftool\Driver\Tag\Canon;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class ControlMode extends AbstractTag
{

    protected $Id = 18;

    protected $Name = 'ControlMode';

    protected $FullName = 'Canon::ShotInfo';

    protected $GroupName = 'Canon';

    protected $g0 = 'MakerNotes';

    protected $g1 = 'Canon';

    protected $g2 = 'Image';

    protected $Type = 'int16s';

    protected $Writable = true;

    protected $Description = 'Control Mode';

    protected $flag_Permanent = true;

    protected $Values = array(
        0 => array(
            'Id' => 0,
            'Label' => 'n/a',
        ),
        1 => array(
            'Id' => 1,
            'Label' => 'Camera Local Control',
        ),
        3 => array(
            'Id' => 3,
            'Label' => 'Computer Remote Control',
        ),
    );

}


text:
'use strict'

// use new relic agent
require('newrelic')

var engine = require('./engine')

engine()
  .then(function () {
    global.ABIBAO.debuggers.application('engine is running')
    setTimeout(() => {
      global.ABIBAO.services.bus.publish(global.ABIBAO.events.BusEvent.BUS_EVENT_IS_ALIVE, {
        name: global.ABIBAO.name,
        uuid: global.ABIBAO.uuid,
        message: 'has just connected into the bus'
      }, {type: 'fanout', exchangeName: 'amq.fanout'})
    }, 2000)
  })
  .catch(function (error) {
    global.ABIBAO.debuggers.error('engine is not running')
    console.log(error)
    process.exit(1)
  })


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

namespace Qoollo.PerformanceCounters
{
    /// <summary>
    /// Счётчик замера среднего числа значений
    /// </summary>
    public abstract class AverageCountCounter : Counter
    {
        /// <summary>
        /// Конструктор AverageCountCounter
        /// </summary>
        /// <param name="name">Имя</param>
        /// <param name="description">Описание</param>
        protected AverageCountCounter(string name, string description)
            : base(name, description, CounterTypes.AverageCount)
        {
        }

        /// <summary>
        /// Текущее значение
        /// </summary>
        public abstract double CurrentValue { get; }

        /// <summary>
        /// Зарегистрировать измерение
        /// </summary>
        /// <param name="value">Новое значение</param>
        public abstract void RegisterValue(long value);

        /// <summary>
        /// Сброс значений счётчика
        /// </summary>
        public override void Reset()
        {
        }

        /// <summary>
        /// Преобразование в строку с информацией
        /// </summary>
        /// <returns>Строка</returns>
        public override string ToString()
        {
            return string.Format("[Value: {0}, Name: {1}, CounterType: {2}]", CurrentValue, Name, Type);
        }
    }
}


text:
<!DOCTYPE html>

    <title>XMLNodeSet Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

 Docs (100% documented)

         Reference

        XMLNodeSet Class Reference

            Classes

                HTMLDocument

                XMLDocument

                XMLNode

                XMLNodeSet

            Enums

                XPathResult

            Extensions

                HTMLDocumentType

                XMLDocumentType

            Protocols

                Node

                Searchable

                XMLElement

            Structs

                CSSSelector

                HTMLParserOptions

                XMLParserOptions

XMLNodeSet

public final class XMLNodeSet

Instances of this class represent an immutable collection of DOM nodes. An instance provides the interface similar to
the Node’s one.

                    html

Concatenated HTML content of nodes in the collection. May be nil if no content is available.

Declaration

Swift

public var html: String?

                    xml

Concatenated XML content of nodes in the collection. May be nil if no content is available.

Declaration

Swift

public var xml: String?

                    innerHTML

Concatenated inner HTML content of nodes in the collection.

Declaration

Swift

public var innerHTML: String?

                    text

Concatenated text content of nodes in the collection. May be nil if no content is available.

Declaration

Swift

public var text: String?

                    init()

Creates an empty collection of nodes.

Declaration

Swift

public init()

                    init(nodes:)

Creates a collection of nodes from the provided array of XMLElements

Declaration

Swift

public init(nodes: [XMLElement])

Parameters

                                nodes

Nodes to create a node set from.

                    startIndex

The position of the first element in a nonempty collection.

If the collection is empty, startIndex is equal to endIndex.

Declaration

Swift

public var startIndex: Int

                    subscript(_:)

Accesses the element at the specified position.

The following example accesses an element of an array through its
subscript to print its value:

var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"]
print(streets[1])
// Prints "Bryant"

You can subscript a collection with any valid index other than the
collection’s end index. The end index refers to the position one past
the last element of a collection, so it doesn’t correspond with an
element.

Parameter

    Parameter position: The position of the element to access. position
must be a valid index of the collection that is not equal to the
endIndex property.

Declaration

Swift

public subscript(position: Int) -> XMLElement

Parameters

                                position

The position of the element to access. position must be a valid index of the collection that is not equal to the endIndex property.

                    endIndex

The collection’s <q>past the end</q> position—that is, the position one
greater than the last valid subscript argument.

When you need a range that includes the last element of a collection, use
the half-open range operator (..<) with endIndex. The ..< operator
creates a range that doesn’t include the upper bound, so it’s always
safe to use with endIndex. For example:

let numbers = [10, 20, 30, 40, 50]
if let index = numbers.index(of: 30) {
    print(numbers[index ..< numbers.endIndex])
}
// Prints "[30, 40, 50]"

If the collection is empty, endIndex is equal to startIndex.

Declaration

Swift

public var endIndex: Int

                    index(after:)

Returns the position immediately after the given index.

Parameter

    Parameter i: A valid index of the collection. i must be less than
endIndex.

Returns

    The index value immediately after i.

Declaration

Swift

public func index(after i: Int) -> Int

Parameters

                                i

A valid index of the collection. i must be less than endIndex.

Return Value

The index value immediately after i.

                    ==(_:_:)

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b,
a == b implies that a != b is false.

Parameters:

lhs: A value to compare.

rhs: Another value to compare.

Declaration

Swift

public static func ==(lhs: XMLNodeSet, rhs: XMLNodeSet) -> Bool

Parameters

                                lhs

A value to compare.

                                rhs

Another value to compare.

                    description

A textual representation of this instance.

Instead of accessing this property directly, convert an instance of any
type to a string by using the String(describing:) initializer. For
example:

struct Point: CustomStringConvertible {
    let x: Int, y: Int

    var description: String {
        return "(\(x), \(y))"
    }
}

let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"

The conversion of p to a string in the assignment to s uses the
Point type’s description property.

Declaration

Swift

public var description: String

© 2016 . All rights reserved. (Last updated: 2016-09-24)

Generated by jazzy ♪♫ v0.7.2, a Realm project.


text:
module Sass
  module Script
    class Variable # :nodoc:
      attr_reader :name

      def initialize(name)
        @name = name
      end

      def inspect
        "!#{name}"
      end

      def perform(environment)
        (val = environment.var(name)) && (return val)
        raise SyntaxError.new("Undefined variable: \"!#{name}\".")
      end
    end
  end
end


text:
"use strict";
exports.__esModule = true;
var React = require("react");
var redux_form_1 = require("redux-form");
var field_wrapper_1 = require("./field-wrapper");
function NumberFieldStateless(props) {
    var _a = props.input, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, invalid = props.meta.invalid, tooltipProps = props.tooltipProps, infoIconProps = props.infoIconProps, suffix = props.suffix, prefix = props.prefix;
    var invalidClassName = '';
    if (invalid) {
        invalidClassName = 'error';
    }
    var suffixEl = suffix
        ? React.createElement("span", { className: "suffix" }, suffix)
        : null;
    var prefixEl = prefix
        ? React.createElement("span", { className: "prefix" }, prefix)
        : null;
    return React.createElement(field_wrapper_1.FieldWrapper, { fieldProps: props, tooltipProps: tooltipProps, infoIconProps: infoIconProps },
        prefixEl,
        React.createElement("input", { type: 'text', value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, className: invalidClassName }),
        suffixEl);
}
exports.NumberFieldStateless = NumberFieldStateless;
function NumberField(props) {
    var tooltipProps = props.tooltip
        ? {
            tooltip: props.tooltip,
            tooltipPosition: props.tooltipPosition,
            tooltipAlignment: props.tooltipAlignment
        }
        : null;
    var infoIconProps = props.iconContent
        ? {
            iconContent: props.iconContent,
            iconCustomTypeName: props.iconCustomTypeName
        }
        : null;
    return React.createElement(redux_form_1.Field, { name: props.name, component: NumberFieldStateless, normalize: normalize, label: props.label, onBlur: props.onBlur, help: props.help, indicator: props.indicator, suffix: props.suffix, prefix: props.prefix, tooltipProps: tooltipProps, infoIconProps: infoIconProps });
}
exports.NumberField = NumberField;
/**
 * Expression to match numbers as they are typed
 * Allowed: '-', '-1', '-1.', '-1.2'
 */
var typableNumbers = /^[-|\d|\.]\d*\.?\d*$/;
function normalize(value, previous) {
    if (value === '') {
        return '';
    }
    if (typableNumbers.test(value)) {
        return value;
    }
    return previous;
}
//# sourceMappingURL=number-field.js.map


text:
from __future__ import print_function

import sys

# Can either be set explicitly, or left blank to auto-detect
# Except auto-detect doesn't work because the file has been passed
# through Python text processing, which makes all EOL a \n
line_end = '\\r\\n'

if __name__ == "__main__":
    filename = sys.argv[1]
    for line in open(filename, 'r').readlines():
        if not line_end:
            for ending in ('\r\n', '\r', '\n'):
                if line.endswith(ending):
                    line_end = ending.replace('\r', '\\r').replace('\n', '\\n')
                    break
            if not line_end:
                raise Exception("Couldn't auto-detect line-ending of %s" % filename)
        line = line.rstrip('\r\n')
        line = line.replace('\\', '\\\\')
        line = line.replace('"', '\\"')
        print('"%s%s"' % (line, line_end))


text:
{% extends 'base.html' %}
{% load render_bundle from webpack_loader %}
{% load crispy_forms_tags %}
{% load static %}
{% load i18n %}

{% block content %}

      {% if object %}

{% trans "Edit event" %}

      {% else %}

{% trans "Add an event" %}

{% trans "Use this calendar to share conferences, events, and gatherings that you think the P2PU community would be interested in. If you are trying to create a learning circle, " %}{% trans "do that here" %}.

      {% endif %}
      <form action="" method="POST" enctype="multipart/form-data">
        {% csrf_token %}
        {{ form|crispy }}

<button type="submit" class="btn p2pu-btn blue">{% trans "Save" %}</button>

      </form>

{% endblock %}

{% block css %}
<link type="text/css" rel="stylesheet" href="{% static 'css/datepicker.css' %}" charset="utf-8">
<link type="text/css" rel="stylesheet" href="{% static 'css/jquery.timepicker.css' %}" charset="utf-8">
{% endblock %}

{% block scripts %}

{% endblock %}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Templates on JP Cedeno</title>
    <link>http://jpcedeno.com/tags/templates/</link>
    <description>Recent content in Templates on JP Cedeno</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <copyright>© 2018</copyright>
    <lastBuildDate>Wed, 02 Apr 2014 00:00:00 +0000</lastBuildDate>

	<atom:link href="http://jpcedeno.com/tags/templates/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>(Hu)go Template Primer</title>
      <link>http://jpcedeno.com/post/hugo-template-primer/</link>
      <pubDate>Wed, 02 Apr 2014 00:00:00 +0000</pubDate>

      <guid>http://jpcedeno.com/post/hugo-template-primer/</guid>
      <description>Hugo uses the excellent go html/template library for its template engine. It is an extremely lightweight engine that provides a very small amount of logic. In our experience that it is just the right amount of logic to be able to create a good static website. If you have used other template systems from different languages or frameworks you will find a lot of similarities in go templates.
This document is a brief primer on using go templates.</description>
    </item>

  </channel>
</rss>


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package rdpclient.rdp;

import streamer.BaseElement;
import streamer.ByteBuffer;
import streamer.Element;
import streamer.Link;
import streamer.Pipeline;
import streamer.PipelineImpl;
import streamer.debug.MockSink;
import streamer.debug.MockSource;

public class ServerMCSPDU extends BaseElement {

    public ServerMCSPDU(String id) {
        super(id);
    }

    @Override
    public void handleData(ByteBuffer buf, Link link) {
        if (verbose)
            System.out.println("[" + this + "] INFO: Data received: " + buf + ".");

        byte headerByte = buf.readSignedByte();
        int type = headerByte >> 2;

        switch (type) {
        // Expected type: send data indication: 26 (0x1a, top 6 bits, or 0x68)
        case 0x1a: {
            // int userId = buf.readUnsignedShort() + 1001; // User ID: 1002 (1001+1)
            buf.skipBytes(2); // Ignore user ID

            int channelId = buf.readUnsignedShort(); // Channel ID: 1003

            int flags = buf.readSignedByte();
            if ((flags & 0x30) != 0x30)
                throw new RuntimeException("Fragmented MCS packets are not supported.");

            int payloadLength = buf.readVariableUnsignedShort();

            ByteBuffer data = buf.readBytes(payloadLength);

            buf.unref();

            pushDataToPad("channel_" + channelId, data);
            break;
        }

        case 0x8: {
            // Disconnection sequence.
            buf.unref();
            break;
        }

        default:
            throw new RuntimeException("Unsupported MCS packet type: " + type + "(" + headerByte + "), data: " + buf + ".");
        }

    }

    /**
     * Example.
     *
     */
    public static void main(String args[]) {
        // System.setProperty("streamer.Link.debug", "true");
        // System.setProperty("streamer.Element.debug", "true");
        // System.setProperty("streamer.Pipeline.debug", "true");

        byte[] packet = new byte[] {
                // TPKT
                (byte)0x03, (byte)0x00, // TPKT Header: TPKT version = 3
                (byte)0x00, (byte)0x1B, // TPKT length: 27 bytes

                // X224
                (byte)0x02, // X224 Length: 2 bytes
                (byte)0xF0, // X224 Type: Data
                (byte)0x80, // X224 EOT

                // MCS
                // Type: send data indication: 26 (0x1a, top 6 bits)
                (byte)0x68, // ??

                (byte)0x00, (byte)0x01, // User ID: 1002 (1001+1)
                (byte)0x03, (byte)0xEB, // Channel ID: 1003
                (byte)0x70, // Data priority: high, segmentation: begin|end
                (byte)0x0D, // Payload length: 13 bytes

                // Deactivate all PDU
                (byte)0x0D, (byte)0x00, // Length: 13 bytes (LE)

                // - PDUType: 22 (0x16, LE)
                // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU
                // ProtocolVersion: (000000000001....) 1
                (byte)0x16, (byte)0x00,

                (byte)0xEA, (byte)0x03, // PDU source: 1002 (LE)
                (byte)0xEA, (byte)0x03, (byte)0x01, (byte)0x00, // ShareID = 66538

                (byte)0x01, (byte)0x00, // Length if source descriptor: 1 (LE)
                (byte)0x00, // Source descriptor (should be set to 0): 0
        };

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element mcs = new ServerMCSPDU("mcs") {
            {
                verbose = true;
            }
        };
        Element tpkt = new ServerTpkt("tpkt");
        Element x224 = new ServerX224DataPdu("x224");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {
                // Deactivate all PDU
                (byte)0x0D, (byte)0x00, // Length: 13 bytes (LE)

                // - PDUType: 22 (0x16, LE)
                // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU
                // ProtocolVersion: (000000000001....) 1
                (byte)0x16, (byte)0x00,

                (byte)0xEA, (byte)0x03, // PDU source: 1002 (LE)
                (byte)0xEA, (byte)0x03, (byte)0x01, (byte)0x00, // ShareID = 66538

                (byte)0x01, (byte)0x00, // Length if source descriptor: 1 (LE)
                (byte)0x00, // Source descriptor (should be set to 0): 0
        }));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, tpkt, x224, mcs, sink);
        pipeline.link("source", "tpkt", "x224", "mcs >channel_1003", "sink");
        pipeline.runMainLoop("source", STDOUT, false, false);
    }

}


text:
using Sniper.Common;
using Sniper.Http;
using Sniper.TargetProcess.Routes;
using Xunit;

namespace Sniper.Tests.CRUD.Read.Common.GeneralFollowers
{
    public class ReadGeneralFollowerTests
    {
        [Fact]
        public void GeneralFollowerThrowsError()
        {
            var client = new TargetProcessClient
            {
                ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.GeneralFollowers)
            };
            var generalFollower = new GeneralFollower
            {
            };
        }
    }
}


text:
./example_birds.sh bird/bird_imagenet/bird_3_1.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_2.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_3.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_4.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_5.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_6.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_7.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_8.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_9.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_10.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_11.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_12.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_13.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_14.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_15.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_16.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_17.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_3_18.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_6.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_7.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_8.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_9.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_10.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_11.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_12.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_13.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_14.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_15.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_16.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_17.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_18.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_19.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_5_20.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_6_1.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_6_2.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_6_3.jpg sentence_0_12.jpg
./example_birds.sh bird/bird_imagenet/bird_6_4.jpg sentence_0_12.jpg


text:
#include <aws/appstream/model/DescribeUserStackAssociationsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::AppStream::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeUserStackAssociationsResult::DescribeUserStackAssociationsResult()
{
}

DescribeUserStackAssociationsResult::DescribeUserStackAssociationsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribeUserStackAssociationsResult& DescribeUserStackAssociationsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("UserStackAssociations"))
  {
    Array<JsonView> userStackAssociationsJsonList = jsonValue.GetArray("UserStackAssociations");
    for(unsigned userStackAssociationsIndex = 0; userStackAssociationsIndex < userStackAssociationsJsonList.GetLength(); ++userStackAssociationsIndex)
    {
      m_userStackAssociations.push_back(userStackAssociationsJsonList[userStackAssociationsIndex].AsObject());
    }
  }

  if(jsonValue.ValueExists("NextToken"))
  {
    m_nextToken = jsonValue.GetString("NextToken");

  }

  return *this;
}


text:
package org.drools.games.pong;

import org.kie.api.KieBaseConfiguration;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.internal.KnowledgeBase;
import org.kie.internal.KnowledgeBaseFactory;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.builder.KnowledgeBuilderFactory;
import org.kie.api.conf.EventProcessingOption;
import org.kie.internal.runtime.StatefulKnowledgeSession;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static org.kie.internal.io.ResourceFactory.newClassPathResource;
import static org.kie.api.io.ResourceType.DRL;

public class PongMain {

    /**
     * @param args
     */
    public static void main(String[] args) {
        new PongMain().init(true);
    }

    public PongMain() {
    }

    public void init(boolean exitOnClose) {
        KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
        final KieSession ksession = kc.newKieSession( "PongKS");
        PongConfiguration pconf = new PongConfiguration();
        pconf.setExitOnClose(exitOnClose);
        ksession.setGlobal("pconf", pconf);

        //ksession.getAgenda().getAgendaGroup("Init").setFocus( );

        runKSession(ksession);
    }

    public void runKSession(final KieSession ksession) {
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        executorService.submit(new Runnable() {
            public void run() {
                // run forever
                try {
                    ksession.fireUntilHalt();
                } catch ( Exception e ) {
                    e.printStackTrace();
                }
            }
        });
    }

}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ParameterValueReaderTests.cs" company="Reimers.dk">
//   Copyright © Reimers.dk 2014
//   This source is subject to the Microsoft Public License (Ms-PL).
//   Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
//   All other rights reserved.
// </copyright>
// <summary>
//   Defines the ParameterValueReaderTests type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Globalization;
using System.IO;
using System.Linq;
using Highway.Data.OData.Parser.Readers;
using NUnit.Framework;

namespace Highway.Data.Tests.OData.Parser.Readers
{
    [TestFixture]
	public class ParameterValueReaderTests
	{
		[TestCase("null", typeof(string))]
		[TestCase("'test'", typeof(string))]
		[TestCase("guid'D81D5F0C-2574-4D5C-A394-E280E6E02A7F'", typeof(Guid))]
		[TestCase("guid'926adbb7-328f-44c5-8900-e8f78e4a66f8'", typeof(Guid))]
		[TestCase("guid'D81D5F0C-2574-4D5C-A394-E280E6E02A7F'", typeof(Guid?))]
		[TestCase("guid'926adbb7-328f-44c5-8900-e8f78e4a66f8'", typeof(Guid?))]
		[TestCase("datetime'2012-04-21T12:34:56Z'", typeof(DateTime))]
		[TestCase("datetime'2012-04-21T12:34:56Z'", typeof(DateTime?))]
		[TestCase("null", typeof(DateTime?))]
		[TestCase("1.23M", typeof(decimal))]
		[TestCase("1.23m", typeof(decimal))]
		[TestCase("1.23", typeof(decimal))]
		[TestCase("1.23D", typeof(double))]
		[TestCase("1.23d", typeof(double))]
		[TestCase("1.23", typeof(double))]
		[TestCase("1.23F", typeof(float))]
		[TestCase("1.23f", typeof(float))]
		[TestCase("1.23", typeof(float))]
		[TestCase("123", typeof(long))]
		[TestCase("123", typeof(int))]
		[TestCase("123", typeof(short))]
		[TestCase("123", typeof(long?))]
		[TestCase("null", typeof(long?))]
		[TestCase("123", typeof(int?))]
		[TestCase("null", typeof(int?))]
		[TestCase("123", typeof(short?))]
		[TestCase("null", typeof(short?))]
		[TestCase("123", typeof(ulong))]
		[TestCase("123", typeof(uint))]
		[TestCase("123", typeof(ushort))]
		[TestCase("123", typeof(ulong?))]
		[TestCase("null", typeof(ulong?))]
		[TestCase("123", typeof(uint?))]
		[TestCase("123", typeof(ushort?))]
		[TestCase("null", typeof(ushort?))]
		[TestCase("1.23M", typeof(decimal?))]
		[TestCase("1.23m", typeof(decimal?))]
		[TestCase("1.23", typeof(decimal?))]
		[TestCase("null", typeof(decimal?))]
		[TestCase("1.23D", typeof(double?))]
		[TestCase("1.23d", typeof(double?))]
		[TestCase("1.23", typeof(double?))]
		[TestCase("null", typeof(double?))]
		[TestCase("1.23F", typeof(float?))]
		[TestCase("1.23f", typeof(float?))]
		[TestCase("1.23", typeof(float?))]
		[TestCase("null", typeof(float?))]
		[TestCase("12", typeof(byte))]
		[TestCase("f6", typeof(byte))]
		[TestCase("12", typeof(byte?))]
		[TestCase("f6", typeof(byte?))]
		[TestCase("null", typeof(byte?))]
		[TestCase("true", typeof(bool))]
		[TestCase("false", typeof(bool))]
		[TestCase("1", typeof(bool))]
		[TestCase("0", typeof(bool))]
		[TestCase("true", typeof(bool?))]
		[TestCase("false", typeof(bool?))]
		[TestCase("1", typeof(bool?))]
		[TestCase("0", typeof(bool?))]
		[TestCase("null", typeof(bool?))]
		[TestCase("Highway.Data.Tests.OData.Choice'That'", typeof(Choice))]
		[TestCase("X'ZWFzdXJlLg=='", typeof(byte[]))]
		[TestCase("binary'ZWFzdXJlLg=='", typeof(byte[]))]
		[TestCase("X'ZWFzdXJlLg=='", typeof(Stream))]
		[TestCase("binary'ZWFzdXJlLg=='", typeof(Stream))]
		public void CanConvertValidFilterValue(string token, Type type)
		{
			var reader = new ParameterValueReader(Enumerable.Empty<IValueExpressionFactory>());
			Assert.DoesNotThrow(() => reader.Read(type, token, CultureInfo.CurrentCulture));
		}

		[Test]
		public void DecimalIsNotAssignableFromDouble()
		{
			Assert.False(typeof(decimal).IsAssignableFrom(typeof(double)));
		}

		[Test]
		public void EnumIsAssignableFromAnEnumType()
		{
			Assert.IsTrue(typeof(Enum).IsAssignableFrom(typeof(Choice)));
		}
	}
}


text:
package com.intellij.testIntegration;

import com.intellij.navigation.GotoRelatedItem;
import com.intellij.navigation.GotoRelatedProvider;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import javax.annotation.Nonnull;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Konstantin Bulenkov
 */
public class GotoTestRelatedProvider extends GotoRelatedProvider {
  @Nonnull
  @Override
  public List<? extends GotoRelatedItem> getItems(@Nonnull DataContext context) {
    final PsiFile file = context.getData(LangDataKeys.PSI_FILE);
    List<PsiElement> result;
    final boolean isTest = TestFinderHelper.isTest(file);
    if (isTest) {
      result = TestFinderHelper.findClassesForTest(file);
    } else {
      result = TestFinderHelper.findTestsForClass(file);
    }

    if (!result.isEmpty()) {
      final List<GotoRelatedItem> items = new ArrayList<GotoRelatedItem>();
      for (PsiElement element : result) {
        items.add(new GotoRelatedItem(element, isTest ? "Tests" : "Testee classes"));
      }
      return items;
    }
    return super.getItems(context);
  }
}


text:
.class Landroid/view/TextureView$2;
.super Ljava/lang/Object;
.source "TextureView.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/view/TextureView;->destroySurfaceSafely()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/view/TextureView;

# direct methods
.method constructor <init>(Landroid/view/TextureView;)V
    .locals 0

    .prologue
    .line 822
    iput-object p1, p0, Landroid/view/TextureView$2;->this$0:Landroid/view/TextureView;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 1

    .prologue
    .line 824
    iget-object v0, p0, Landroid/view/TextureView$2;->this$0:Landroid/view/TextureView;

    # invokes: Landroid/view/TextureView;->destroySurface()V
    invoke-static {v0}, Landroid/view/TextureView;->access$100(Landroid/view/TextureView;)V

    .line 825
    return-void
.end method


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Read about my adventures, relationships, and traumas. Continue on about my thoughts, thought processes, principles, and wrongdoings.  Hear me judge but never judge me. Or I'll blacklist you from this blog.
">

    <title>Trying to Climb Skeleton Gorge - Leaving A Legacy (or at least ranting)</title>

    <link rel="canonical" href="/travel/2015/07/19/skeleton-gorge/">

    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <link rel="stylesheet" href="/css/clean-blog.css">

    <link rel="stylesheet" href="/css/syntax.css">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Leaving A Legacy (or at least ranting)

                    Main Site

                    Home

                    School

                    Travel

Trying to Climb Skeleton Gorge

'You will die.'...we'll try the Gardens instead.

                    Posted by Tali on July 19, 2015

                        ← Previous Post

                        Next Post →

Copyright © Leaving A Legacy (or at least ranting) 2015


text:
<?php
namespace App\Model\Table;

use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;

/**
 * ImmovablesTenants Model
 *
 * @property \Cake\ORM\Association\BelongsTo $Immovables
 * @property \Cake\ORM\Association\BelongsTo $Tenants
 *
 * @method \App\Model\Entity\ImmovablesTenant get($primaryKey, $options = [])
 * @method \App\Model\Entity\ImmovablesTenant newEntity($data = null, array $options = [])
 * @method \App\Model\Entity\ImmovablesTenant[] newEntities(array $data, array $options = [])
 * @method \App\Model\Entity\ImmovablesTenant|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
 * @method \App\Model\Entity\ImmovablesTenant patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
 * @method \App\Model\Entity\ImmovablesTenant[] patchEntities($entities, array $data, array $options = [])
 * @method \App\Model\Entity\ImmovablesTenant findOrCreate($search, callable $callback = null)
 *
 * @mixin \Cake\ORM\Behavior\TimestampBehavior
 */
class ImmovablesTenantsTable extends Table
{

    /**
     * Initialize method
     *
     * @param array $config The configuration for the Table.
     * @return void
     */
    public function initialize(array $config)
    {
        parent::initialize($config);

        $this->table('immovables_tenants');
        $this->displayField('id');
        $this->primaryKey('id');

        $this->addBehavior('Timestamp');

        $this->belongsTo('Immovables', [
            'foreignKey' => 'immovable_id',
            'joinType' => 'INNER'
        ]);
        $this->belongsTo('Tenants', [
            'foreignKey' => 'tenant_id',
            'joinType' => 'INNER'
        ]);
    }

    /**
     * Default validation rules.
     *
     * @param \Cake\Validation\Validator $validator Validator instance.
     * @return \Cake\Validation\Validator
     */
    public function validationDefault(Validator $validator)
    {
        $validator
            ->integer('id')
            ->allowEmpty('id', 'create');

        $validator
            ->date('date_end')
            ->allowEmpty('date_end');

        $validator
            ->date('date_begin')
            ->allowEmpty('date_begin');

        return $validator;
    }

    /**
     * Returns a rules checker object that will be used for validating
     * application integrity.
     *
     * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
     * @return \Cake\ORM\RulesChecker
     */
    public function buildRules(RulesChecker $rules)
    {
        $rules->add($rules->existsIn(['immovable_id'], 'Immovables'));
        $rules->add($rules->existsIn(['tenant_id'], 'Tenants'));

        return $rules;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

	<!-- 拦截器 -->
	<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean class="com.ansteel.core.context.SiteInterceptor"></bean>
		</mvc:interceptor>
	</mvc:interceptors>

	<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
		<property name="classesToBeBound">
			<list>
				<value>com.ansteel.dhtmlx.xml.Data</value>
			</list>
		</property>
	</bean>

	<!-- Enables the Spring MVC @Controller programming model -->
	<bean id="contentNegotiationManager"
		class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
		<!-- <property name="favorPathExtension" value="true" /> -->
		<property name="ignoreAcceptHeader" value="true" />
		<property name="defaultContentType" value="application/json" />
		<property name="favorParameter" value="true" />
		<property name="parameterName" value="format" />
		<property name="mediaTypes">
			<map>
				<entry key="html" value="text/html" />
				<entry key="xml" value="application/xml" />
				<entry key="json" value="application/json" />
			</map>
		</property>
	</bean>

	<mvc:annotation-driven
		content-negotiation-manager="contentNegotiationManager">
		<!-- <mvc:return-value-handlers> <bean class="com.ansteel.core.context.UIReturnValueHandler"
			/> </mvc:return-value-handlers> -->
		<mvc:message-converters register-defaults="true">
			<bean class="org.springframework.http.converter.StringHttpMessageConverter">
				<constructor-arg value="UTF-8" />
			</bean>
			<bean class="com.ansteel.core.context.MappingJacksonHttp3MessageConverter">
				<property name="objectMapper">
					<bean class="com.fasterxml.jackson.databind.ObjectMapper">
						<property name="dateFormat">
							<bean class="java.text.SimpleDateFormat">
								<constructor-arg type="java.lang.String" value="yyyy-MM-dd HH:mm:ss" />
							</bean>
						</property>
					</bean>
				</property>
			</bean>
			<bean
				class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
				<constructor-arg ref="jaxbMarshaller" />

				<property name="supportedMediaTypes" value="application/xml"></property>
			</bean>
		</mvc:message-converters>
		<mvc:argument-resolvers>
			<bean class="com.ansteel.core.argument.PathClassMethodArgumentResolver" />
			<bean class="com.ansteel.core.argument.PathEntityMethodArgumentResolver" />
			<bean
				class="com.ansteel.core.argument.PathDatabaseEntityMethodArgumentResolver" />
			<bean class="com.ansteel.core.argument.PathGridbaseMethodArgumentResolver" />
			<bean
				class="com.ansteel.core.argument.PathManyToOneNameMethodArgumentResolver" />
			<bean
				class="com.ansteel.core.argument.PathManyToOneClassMethodArgumentResolver" />
			<bean
				class="com.ansteel.core.argument.QueryJsonHandlerMethodArgumentResolver" />
		</mvc:argument-resolvers>
	</mvc:annotation-driven>

	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/" />
		<property name="suffix" value=".jsp" />
	</bean>

	<bean id="exceptionResolver" class="com.ansteel.core.exception.ExceptionHandler" />

	<!-- 自动扫描且只扫描@Controller -->
	<context:component-scan base-package="com.ansteel"
		use-default-filters="false">
		<context:include-filter type="annotation"
			expression="org.springframework.stereotype.Controller" />
		<context:include-filter type="annotation"
			expression="org.springframework.web.bind.annotation.ControllerAdvice" />
	</context:component-scan>

</beans>


text:
BUILD_DIR?=build
SHELL := /bin/bash

isort:
	isort --vb .

flake8:
	flake8

test:
	# delete any __pycache__ folders to avoid hard-to-debug caching issues
	find . -name __pycache__ -type d -exec rm -r {} +
	# pypy3 should be added to the first `if` once it supports py3.7
	if [[ "$$PYTHON_VERSION" =~ ^(3.7|3.8|3.9|3.10|nightly)$$ ]] ; then \
		echo "Python 3.7+, with asyncio"; \
		py.test -v $(PYTEST_ARGS) $(PYTEST_MARKER) $(PYTEST_JUNIT); \
	else \
		echo "Python < 3.7, without asyncio"; \
		py.test -v $(PYTEST_ARGS) $(PYTEST_MARKER) $(PYTEST_JUNIT) --ignore-glob='*/asyncio*/*'; \
	fi

coverage: PYTEST_ARGS=--cov --cov-context=test --cov-config=setup.cfg --cov-branch
coverage: export COVERAGE_FILE=.coverage.$(PYTHON_FULL_VERSION).$(WEBFRAMEWORK)
coverage: test

docs:
	bash ./scripts/build_docs.sh apm-agent-python ./docs ${BUILD_DIR}

.PHONY: isort flake8 test coverage docs


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

namespace Lighting.ShadowMapping.InsidePyramid
{
    partial class TriangleNode
    {
        private const string regularVert = @"#version 150

in vec3 inPosition;
in vec3 inColor;

uniform mat4 mvpMat;

out vec3 passColor;

void main() {
    gl_Position = mvpMat * vec4(inPosition, 1.0);
    passColor = inColor;
}
";

        private const string regularFrag = @"#version 150

in vec3 passColor;

out vec4 outColor;

void main() {
    outColor = vec4(passColor, 1.0);
}
";

    }
}


text:
This library abstracts away the details of the HTTP protocol, providing an alternative to calling a user-supplied function on each request. The return value of the user-supplied function determines the response that is sent to the HTTP client. This allows the end user to not have to worry about the semantics of communicating with an HTTP server.

In many ways, this module is analogous to the http.server module in Python documentation. See http://docs.python.org/py3k/library/http.server.html.

### Classes & Functions

```
def httpserver_registercallback(addresstuple, cbfunc):
```
   Registers a callback function on the (host, port).

   Notes:

   * addresstuple is an address 2-tuple to bind to: ('host', port).
   * cbfunc is the callback function to process requests. It takes one argument, which is a dictionary describing the HTTP request. It looks like      this (just an example):
        {
          'verb': 'HEAD',
          'path': '/',
          'querystr': 'foo=bar&baz',
          'querydict': { 'foo': 'bar', 'baz': None }
          'version': '0.9',
          'datastream': object with a file-like read() method,
          'headers': { 'Content-Type': 'application/x-xmlrpc-data'},
          'httpdid': 17,
          'remoteipstr': '10.0.0.4',
          'remoteportnum': 54001
        }
      ('datastream' is a stream of any HTTP message body data sent by the
      client.)

      It is expected that this callback function returns a dictionary of:
        {
          'version': '0.9' or '1.0' or '1.1',
          'statuscode': any integer from 100 to 599,
          'statusmsg' (optional): an arbitrary string without newlines,
          'headers': { 'X-Header-Foo': 'Bar' },
          'message': arbitrary string
        }
   * Exceptions (TypeError, ValueError, KeyError, IndexError) are raised if arguments to this function are malformed.
   * The (hostname, port) tuple cannot be restricted, already taken, etc.
   * Returns a handle for the listener (an httpdid). This can be used to stop the server.

```
def httpserver_stopcallback(callbackid):
```
   Removes an existing callback function, i.e. stopping the server.

   Notes:

   * callbackid is the id returned by httpserver_registercallback().
   * Raises IndexError or KeyError if the id is invalid or has already been deleted.

### Includes

[wiki:SeattleLib/urllib.repy](urllib.repy.md)

[wiki:SeattleLib/urlparse.repy](urlparse.repy.md)

[wiki:SeattleLib/uniqueid.repy](uniqueid.repy.md)

[wiki:SeattleLib/sockettimeout.repy](sockettimeout.repy.md)

[wiki:SeattleLib/httpretrieve.repy](httpretrieve.repy.md)


text:
package com.android_mvc.framework.ui.view.map;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.OverlayItem;

/**
 * オーバレイアイテムの基底クラス。
 * 適宜拡張すること。
 * @author id:language_and_engineering
 *
 */
public class BaseOverlayItem extends OverlayItem
{
    /**
     * 初期化
     */
    public BaseOverlayItem(GeoPoint gp, String name, String description)
    {
        super(gp, name, description);
    }

}


text:
package com.app.editor.web.controller;

import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.app.editor.web.controller.req.CreatePageReq;
import com.app.editor.web.controller.req.UpdateFractionReq;
import com.app.editor.web.controller.req.UpdatePageReq;
import com.app.editor.web.exception.HttpException;

/**
 * @author justburrow
 * @since 2017. 4. 9.
 */
@RequestMapping("/pages")
public interface PageController {
  /**
   * @param model
   * @return
   * @throws HttpException
   */
  @GetMapping("/{siteId:[1-9]\\d*}/create")
  String createForm(int siteId, final Model model) throws HttpException;

  /**
   * @param siteId
   * @param req
   * @param binding
   * @param model
   * @return
   * @throws HttpException
   */
  @PostMapping("/{siteId:[1-9]\\d*}")
  String create(int siteId, CreatePageReq req, BindingResult binding, Model model) throws HttpException;

  /**
   * @param siteId
   * @param pageId
   * @param model
   * @return
   * @throws HttpException
   */
  @GetMapping("/{siteId:[1-9]\\d*}/{pageId:[1-9]\\d*}")
  String detail(int siteId, int pageId, Model model) throws HttpException;

  /**
   * @param siteId
   * @param pageId
   * @param model
   * @return
   * @throws HttpException
   */
  @GetMapping("/{siteId:[1-9]\\d*}/{pageId:[1-9]\\d*}/edit")
  String updateForm(int siteId, int pageId, Model model) throws HttpException;

  /**
   * @param siteId
   * @param pageId
   * @param req
   * @param binding
   * @param model
   * @return
   */
  @PatchMapping("/{siteId:[1-9]\\d*}/{pageId:[1-9]\\d*}")
  String update(int siteId, int pageId, UpdatePageReq req, BindingResult binding, Model model);

  /**
   * @param siteId
   * @param pageId
   * @param fractionName
   * @param req
   * @param binding
   * @param model
   * @return
   * @throws HttpException
   */
  @PatchMapping("/{siteId:[1-9]\\d*}/{pageId:[1-9]\\d*}/{fractionName:[a-z]\\w*}")
  String updateFraction(
      int siteId, int pageId, String fractionName,
      UpdateFractionReq req, BindingResult binding, Model model)
      throws HttpException;
}


text:
Map
***

.. highlight:: c++

header
======

::

  #include <map>

  std::map<unsigned int, std::string> KeyMap;

Copy
====

::

  copyTo.erase(copyTo.begin(), copyTo.end());

  std::map<unsigned int, std::string>::const_iterator i;
  for(i = KeyMap.begin(); i != KeyMap.end(); ++i)
      copyTo[i->first] = i->second;

erase
=====

::

  KeyMap.erase(KeyMap.begin(), KeyMap.end());

Add an element
==============

::

  int idx(1);
  string keyMapID("value");

  KeyMap[idx] = keyMapID;

Find an element
===============

::

  int idx(1);

  std::map<unsigned int, std::string>::const_iterator i = KeyMap.find(idx);
  if(i != KeyMap.end())
      string value(i->second);


text:
package com.intellij.openapi.options.binding;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;

import javax.swing.*;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dmitry Avdeev
 */
public class ControlBinder {

  private final static Logger LOG = Logger.getInstance("#com.intellij.openapi.options.binding.ControlBinder");

  private final Object myBean;
  private final List<Pair<ControlValueAccessor, BeanValueAccessor>> myBindings = new ArrayList<>();

  public ControlBinder(Object bean) {
    myBean = bean;
  }

  public void bindControl(JComponent control, String propertyName, boolean instant) {
    final ControlValueAccessor controlAccessor;
    if (control instanceof JCheckBox) {
      controlAccessor = ValueAccessor.checkBoxAccessor((JCheckBox)control);
    }
    else if (control instanceof JTextField){
      controlAccessor = ValueAccessor.textFieldAccessor((JTextField)control);
    } else {
      throw new IllegalArgumentException("Cannot bind control of type " + control.getClass() + ".\n" +
                                         "Use bindControl(ControlValueAccessor, String) instead.");
    }
    bindControl(controlAccessor, propertyName, instant);
  }

  public synchronized void bindControl(ControlValueAccessor controlAccessor, String propertyName, boolean instant) {
    BeanValueAccessor beanAccessor = BeanValueAccessor.createAccessor(myBean, propertyName);
    final Pair<ControlValueAccessor, BeanValueAccessor> binding = Pair.create(controlAccessor, beanAccessor);
    myBindings.add(binding);
    if (instant) {
      controlAccessor.addChangeListener(() -> apply(binding));
    }
  }

  public synchronized void reset() {
    for (Pair<ControlValueAccessor, BeanValueAccessor> binding : myBindings) {
      if (!binding.first.isEnabled()) {
        continue;
      }
      Object value = binding.second.getValue();
      try {
        value = convert(value, binding.first.getType());
        binding.first.setValue(value);
      }
      catch (IllegalArgumentException e) {
        LOG.debug(e);
      }
    }
  }

  public synchronized void apply() {
    for (Pair<ControlValueAccessor, BeanValueAccessor> binding : myBindings) {
      apply(binding);
    }
  }

  private void apply(Pair<ControlValueAccessor, BeanValueAccessor> binding) {
    if (!binding.first.isEnabled()) {
      return;
    }
    Object value = binding.first.getValue();
    try {
      value = convert(value, binding.second.getType());
      binding.second.setValue(value);
    }
    catch (IllegalArgumentException e) {
      LOG.debug(e);
    }
  }

  public synchronized boolean isModified() {
    for (Pair<ControlValueAccessor, BeanValueAccessor> binding : myBindings) {
      if (!binding.first.isEnabled()) {
        continue;
      }
      Object value = binding.first.getValue();
      try {
        value = convert(value, binding.second.getType());
        if (!value.equals(binding.second.getValue())) {
          return true;
        }
      }
      catch (IllegalArgumentException e) {
        LOG.debug(e);
      }
    }
    return false;
  }

  protected Object convert(Object value, Class to) {
    Class from = value.getClass();
    if (!to.isAssignableFrom(from)) {
      if (to.isPrimitive()) {
        if (to.equals(Integer.TYPE)) {
          to = Integer.class;
        }
      }
      for (ValueTypeConverter converter : ValueTypeConverter.STANDARD) {
        if (from.equals(converter.getSourceType()) && to.equals(converter.getTargetType())) {
          return converter.from(value);
        }
        if (to.equals(converter.getSourceType()) && from.equals(converter.getTargetType())) {
          return converter.to(value);
        }
      }
    }
    return value;
  }

  public void bindAnnotations(Object form) {
    Field[] fields = form.getClass().getDeclaredFields();
    for (Field field : fields) {
      BindControl annotation = field.getAnnotation(BindControl.class);
      if (annotation != null) {
        String name = annotation.value();
        if (name.length() == 0) {
          name = field.getName();
        }
        try {
          field.setAccessible(true);
          bindControl((JComponent)field.get(form), name, annotation.instant());
        }
        catch (IllegalAccessException e) {
          throw new RuntimeException(e);
        }
      }
    }
  }
}


text:
package org.kaaproject.kaa.server.control.service.loadmgmt;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.thrift.TException;
import org.kaaproject.kaa.server.common.thrift.gen.bootstrap.BootstrapThriftService;
import org.kaaproject.kaa.server.common.thrift.gen.bootstrap.ThriftOperationsServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Andrey Panasenko
 *
 */
public class BootstrapThriftServiceImpl implements BootstrapThriftService.Iface {

    /** The Constant LOG. */
    private static final Logger LOG = LoggerFactory.getLogger(BootstrapThriftServiceImpl.class);

    private Map<String, ThriftOperationsServer> opServerMap;

    private final Object sync;

    public BootstrapThriftServiceImpl() {
        opServerMap = null;
        sync = new Object();
    }

    public Map<String, ThriftOperationsServer> getOperatonsServerMap() {
        synchronized (sync) {
            if (opServerMap == null) {
                try {
                    sync.wait(60000);
                } catch (InterruptedException e) {

                }
            }
        }

        return opServerMap;
    }

    public void reset() {
        synchronized (sync) {
            opServerMap = null;
            sync.notify();
        }
    }

    /*
     * (non-Javadoc)
     *
     * @see
     * org.kaaproject.kaa.server.common.thrift.gen.bootstrap.BootstrapThriftService
     * .Iface#onOperationsServerListUpdate(java.util.List)
     */
    @Override
    public void onOperationsServerListUpdate(List<ThriftOperationsServer> operationsServersList) throws TException {
        synchronized (sync) {
            if (operationsServersList.size() > 0 && opServerMap == null) {
                opServerMap = new HashMap<String, ThriftOperationsServer>();

                for (ThriftOperationsServer thriftServer : operationsServersList) {
                    LOG.info("onOperationsServerListUpdate: ThriftOperationsServer {} ", thriftServer.toString());
                    opServerMap.put(thriftServer.getId(), thriftServer);
                }

                sync.notify();
            }
        }
    }
}


text:
package clientClassTests;

import static org.junit.Assert.*;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;
import java.util.ArrayList;

import factories.GalileiGameMapFactory;
import it.polimi.ingsw.cg_19.GameMap;
import it.polimi.ingsw.cg_19.PlayerType;

import org.junit.Test;

import common.Card;
import common.ClientNotification;
import common.Coordinate;
import common.GamePublicData;
import common.PlayerToken;
import common.RRClientNotification;
import common.RemoteMethodCall;
import common.Sector;
import common.SectorType;
import common.SilenceSectorCard;
import client.Client;
import client.ClientConnection;
import client.ClientRemoteServices;

public class ClientRemoteServicesTests {
	private ClientRemoteServices clientServices;
	private Client client;
	@Test
	public void sendTokenTest() throws RemoteException, IOException {
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		PlayerToken token = new PlayerToken(PlayerType.ALIEN);
		clientServices.sendToken(token);
		assertEquals(token,client.getToken());
		token = new PlayerToken(PlayerType.HUMAN);
		clientServices.sendToken(token);
		assertEquals(token,client.getToken());
	}
	@Test
	public void sendAvailableGamesTest() throws RemoteException, IOException {
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		ArrayList<GamePublicData> gamesList = new ArrayList<GamePublicData>();
		gamesList.add(new GamePublicData(1,"game1"));
		clientServices.sendAvailableGames(gamesList);
		assertTrue(client.getAvailableGames().containsAll(gamesList));
		assertEquals(client.getAvailableGames().size(),gamesList.size());
		gamesList.clear();
		clientServices.sendAvailableGames(gamesList);
		assertTrue(client.getAvailableGames().containsAll(gamesList));
		assertEquals(client.getAvailableGames().size(),gamesList.size());
	}
	@Test
	public void allowTurnTest() throws RemoteException, IOException {
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		PlayerToken token = new PlayerToken(PlayerType.ALIEN);
		clientServices.sendToken(token);
		clientServices.allowTurn(token);
		assertTrue(client.getIsMyTurn());
		client.setIsMyTurn(false);
		token = new PlayerToken(PlayerType.HUMAN);
		clientServices.allowTurn(token);
		assertFalse(client.getIsMyTurn());
		client.setIsMyTurn(false);
		token = new PlayerToken(PlayerType.ALIEN);
		clientServices.allowTurn(token);
		assertFalse(client.getIsMyTurn());
	}
	@Test
	public void sendNotificationTest() throws RemoteException, IOException {
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		ClientNotification clientNotification = new RRClientNotification();
		clientNotification.setMessage("dsadsad");
		Sector sector = new Sector(new Coordinate('a',1),SectorType.HUMAN);
		Card card = new SilenceSectorCard();
		((RRClientNotification) clientNotification).setActionResult(true);;
		((RRClientNotification) clientNotification).addSector(sector);
		((RRClientNotification) clientNotification).addCard(card);
		clientServices.sendNotification(clientNotification);
		assertEquals(client.getCurrentNotification().getMessage(),"dsadsad");
		assertTrue(client.getCurrentNotification().getActionResult());
		assertTrue(client.getCurrentNotification().getDrawnCards().contains(card));
		assertEquals(client.getCurrentNotification().getDrawnCards().size(),1);
		assertTrue(client.getCurrentNotification().getLightedSectors().contains(sector));
		assertEquals(client.getCurrentNotification().getLightedSectors().size(),1);
	}
	@Test
	public void processRemoteInvocationTest() throws RemoteException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, SecurityException{
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		PlayerToken token = new PlayerToken(PlayerType.ALIEN);
		ArrayList<Object> parameters = new ArrayList<Object>();
		parameters.add(token);
		clientServices.processRemoteInvocation(new RemoteMethodCall("sendToken",parameters));
		assertEquals(client.getToken(),token);
		ArrayList<GamePublicData> gamesList = new ArrayList<GamePublicData>();
		gamesList.add(new GamePublicData(1,"game1"));
		parameters.clear();
		parameters.add(gamesList);
		clientServices.processRemoteInvocation(new RemoteMethodCall("sendAvailableGames",parameters));
		assertEquals(client.getAvailableGames().size(),1);
		assertTrue(client.getAvailableGames().containsAll(gamesList));
	}
	@Test
	public void sendMapTest() throws IOException{
		client = new Client(new ClientConnection(21323,"sdasd","sddsad"));
		clientServices = new ClientRemoteServices(client);
		PlayerToken token = new PlayerToken(PlayerType.ALIEN);
		clientServices.sendToken(token);
		GalileiGameMapFactory factory = new GalileiGameMapFactory();
		GameMap map = factory.makeMap();
		clientServices.sendMap("GALILEI", token);
		assertTrue(client.getIsMyTurn());
		assertEquals(client.getGameMap().getGraph().vertexSet(),map.getGraph().vertexSet());
		assertEquals("GALILEI",client.getGameMap().getName());
	}

}


text:
package darks.learning.neuron.gradient;

import org.jblas.DoubleMatrix;

import darks.learning.neuron.NNConfig;

/**
 * Gradient updater
 *
 * @author Darks.Liu
 *
 */
public class NNGradientComputer extends GradientComputer
{

	public NNGradientComputer(NNConfig config)
	{
		super(config);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void computeGradient(DoubleMatrix wGrad, DoubleMatrix vBiasGrad, DoubleMatrix hBiasGrad)
	{
		wOriginGradient = wGrad.dup();
		if (vBiasGrad != null)
		    vOriginGradient = vBiasGrad.dup();
        if (hBiasGrad != null)
            hOriginGradient = hBiasGrad.dup();
		DoubleMatrix wAdaGradLR = null;
		if (config.useAdaGrad)
		{
			buildAdaGrad(wGrad, vBiasGrad, hBiasGrad);
			wAdaGradLR = wAdaGrad.getLearnRates(wGrad);
			wGrad.muli(wAdaGradLR);
			if (hBiasGrad != null && hBiasAdaGrad != null)
			    hBiasGrad = hBiasGrad.mul(hBiasAdaGrad.getLearnRates(hBiasGrad));
            if (vBiasGrad != null && vBiasAdaGrad != null)
                vBiasGrad = vBiasGrad.mul(vBiasAdaGrad.getLearnRates(vBiasGrad));
		}
		else
		{
			wGrad.muli(learnRate);
            if (hBiasGrad != null)
                hBiasGrad = hBiasGrad.mul(learnRate);
            if (vBiasGrad != null)
                vBiasGrad = vBiasGrad.mul(learnRate);
		}

        double momentum = config.momentum;
        if (momentum > 0 && wGradient != null)
        {
        	wGrad.addi(wGradient.mul(momentum).add(wGrad.mul(1 - momentum)));
        }
        if (momentum > 0 && vGradient != null)
        {
        	vBiasGrad.addi(vGradient.mul(momentum).add(vBiasGrad.mul(1 - momentum)));
        }
        if (momentum > 0 && hGradient != null)
        {
        	hBiasGrad.addi(hGradient.mul(momentum).add(hBiasGrad.mul(1 - momentum)));
        }

        if (config.normalized)
        {
        	wGrad.divi(batchSize);
        	if (hBiasGrad != null)
        	    hBiasGrad.divi(batchSize);
            if (vBiasGrad != null)
                vBiasGrad.divi(batchSize);
        }

        if (config.useRegularization && config.L2 > 0)
        {
        	if (config.useAdaGrad)
        	{
        		wGrad.subi(weights.mul(config.L2).mul(wAdaGradLR));
        	}
        	else
        	{
        		wGrad.subi(weights.mul(config.L2 * learnRate));
        	}
        }

        wGradient = wGrad;
        vGradient = vBiasGrad;
        hGradient = hBiasGrad;
	}

}


text:
package org.apache.any23.vocab;

import org.openrdf.model.URI;

/**
 *
An implementation of the lkif-core
 * vocabulary which is a library of ontologies relevant for the legal domain.
 * The library consists of 15 modules, each of which describes a set of closely
 * related concepts from both legal and commonsense domains.

 *
 *
The norm module is an extension primarily on the expression
 * module where norms are defined as qualifications. Please
 * refer to Deliverable 1.1 for a more in-depth description
 * of the underlying theory. It furthermore defines a number of
 * legal sources, e.g. legal documents, customary law etc., and a
 * typology of rights and powers, cf. Sartor (2006), Rubino et al. (2006)

 *
 * @author lewismc
 *
 */
public class LKIFCoreNorm extends Vocabulary {

    /**
     * The namespace of the vocabulary as a string.
     */
    public static final String NS = "http://www.estrellaproject.org/lkif-core/norm.owl#";

    private static LKIFCoreNorm instance;

    public static LKIFCoreNorm getInstance() {
      if(instance == null) {
          instance = new LKIFCoreNorm();
      }
      return instance;
  }
    ///////////////////////////////////////////////////////
    /* http://www.estrellaproject.org/lkif-core/norm.owl */
    ///////////////////////////////////////////////////////
    // CLASSES
    public final URI Hohfeldian_Power                        = createClass(NS, "Hohfeldian_Power");
    public final URI Normatively_Qualified                   = createClass(NS, "Normatively_Qualified");
    public final URI Code_of_Conduct                         = createClass(NS, "Code_of_Conduct");
    public final URI Regulation                              = createClass(NS, "Regulation");
    public final URI Soft_Law                                = createClass(NS, "Soft_Law");
    public final URI Strictly_Disallowed                     = createClass(NS, "Strictly_Disallowed");
    public final URI Permissive_Right                        = createClass(NS, "Permissive_Right");
    public final URI Proclamation                            = createClass(NS, "Proclamation");
    public final URI Legal_Expression                        = createClass(NS, "Legal_Expression");
    public final URI Qualificatory_Expression                = createClass(NS, "Qualificatory_Expression");
    public final URI Enabling_Power                          = createClass(NS, "Enabling_Power");
    public final URI Existential_Expression                  = createClass(NS, "Existential_Expression");
    public final URI Persuasive_Precedent                    = createClass(NS, "Persuasive_Precedent");
    public final URI Belief_In_Violation                     = createClass(NS, "Belief_In_Violation");
    public final URI Strictly_Allowed                        = createClass(NS, "Strictly_Allowed");
    public final URI Legal_Doctrine                          = createClass(NS, "Legal_Doctrine");
    public final URI Resolution                              = createClass(NS, "Resolution");
    public final URI Evaluative_Expression                   = createClass(NS, "Evaluative_Expression");
    public final URI Liberty_Right                           = createClass(NS, "Liberty_Right");
    public final URI Declarative_Power                       = createClass(NS, "Declarative_Power");
    public final URI Contract                                = createClass(NS, "Contract");
    public final URI Custom                                  = createClass(NS, "Custom");
    public final URI Exclusionary_Right                      = createClass(NS, "Exclusionary_Right");
    public final URI International_Agreement                 = createClass(NS, "International_Agreement");
    public final URI Customary_Law                           = createClass(NS, "Customary_Law");
    public final URI Action_Power                            = createClass(NS, "Action_Power");
    public final URI Legal_Source                            = createClass(NS, "Legal_Source");
    public final URI Statute                                 = createClass(NS, "Statute");
    public final URI International_Arbitration               = createClass(NS, "International_Arbitration");
    public final URI Immunity                                = createClass(NS, "Immunity");
    public final URI Treaty                                  = createClass(NS, "Treaty");
    public final URI Mandatory_Precedent                     = createClass(NS, "Mandatory_Precedent");
    public final URI Code                                    = createClass(NS, "Code");
    public final URI Allowed                                 = createClass(NS, "Allowed");
    public final URI Observation_of_Violation                = createClass(NS, "Observation_of_Violation");
    public final URI Legal_Document                          = createClass(NS, "Legal_Document");
    public final URI Potestative_Expression                  = createClass(NS, "Potestative_Expression");
    public final URI Norm                                    = createClass(NS, "Norm");
    public final URI Potestative_Right                       = createClass(NS, "Potestative_Right");
    public final URI Allowed_And_Disallowed                  = createClass(NS, "Allowed_And_Disallowed");
    public final URI Obligation                              = createClass(NS, "Obligation");
    public final URI Disallowed_Intention                    = createClass(NS, "Disallowed_Intention");
    public final URI Permission                              = createClass(NS, "Permission");
    public final URI Liability_Right                         = createClass(NS, "Liability_Right");
    public final URI Right                                   = createClass(NS, "Right");
    public final URI Obliged                                 = createClass(NS, "Obliged");
    public final URI Non_binding_International_Agreement     = createClass(NS, "Non-binding_International_Agreement");
    public final URI Directive                               = createClass(NS, "Directive");
    public final URI Disallowed                              = createClass(NS, "Disallowed");
    public final URI Definitional_Expression                 = createClass(NS, "Definitional_Expression");
    public final URI Prohibition                             = createClass(NS, "Prohibition");
    public final URI Precedent                               = createClass(NS, "Precedent");
    public final URI Obligative_Right                        = createClass(NS, "Obligative_Right");

    // RESOURCES

    // PROPERTIES
    public final URI normatively_comparable                  = createProperty(NS, "normatively_comparable");
    public final URI normatively_equivalent_or_better        = createProperty(NS, "normatively_equivalent_or_better");
    public final URI disallows                               = createProperty(NS, "disallows");
    public final URI normatively_strictly_worse              = createProperty(NS, "normatively_strictly_worse");
    public final URI normatively_not_equivalent              = createProperty(NS, "normatively_not_equivalent");
    public final URI normatively_strictly_better             = createProperty(NS, "normatively_strictly_better");
    public final URI allowed_by                              = createProperty(NS, "allowed_by");
    public final URI disallowed_by                           = createProperty(NS, "disallowed_by");
    public final URI allows                                  = createProperty(NS, "allows");
    public final URI normatively_equivalent_or_worse         = createProperty(NS, "normatively_equivalent_or_worse");
    public final URI commands                                = createProperty(NS, "commands");
    public final URI commanded_by                            = createProperty(NS, "commanded_by");
    public final URI strictly_equivalent                     = createProperty(NS, "strictly_equivalent");

    private LKIFCoreNorm() {
      super(NS);
    }

}


text:
package tv.savageboy74.savagetech.blocks.solargenerator;

//public class BlockSolarGenerator extends STBlock implements ITileEntityProvider
//{
//    protected final int maxEnergyGeneration;
//    protected final int maxEnergyTransfer;
//    protected final int maxEnergyCapacity;
//
//    public BlockSolarGenerator(int energyGeneration, int energyCapacity) {
//        super(Material.rock);
//        this.maxEnergyGeneration = energyGeneration;
//        this.maxEnergyCapacity = energyCapacity;
//        this.maxEnergyTransfer = maxEnergyGeneration * 4;
//        this.isBlockContainer = true;
//        this.setSoundType(SoundType.STONE);
//        this.setHardness(3.0F);
//        this.setResistance(5.0F);
//        this.setUnlocalizedName(Names.Blocks.generator);
//    }
//
//    public int getMaxEnergyGeneration() {
//        return maxEnergyGeneration;
//    }
//
//    public int getMaxEnergyTransfer() {
//        return maxEnergyTransfer;
//    }
//
//    public int getMaxEnergyCapacity() {
//        return maxEnergyCapacity;
//    }
//
//    @Override
//    public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
//        if (stack.hasTagCompound()) {
//            TileEntitySolarGenerator tileGenerator = (TileEntitySolarGenerator) worldIn.getTileEntity(pos);
//            tileGenerator.setEnergyStored(stack.getTagCompound().getInteger(Names.NBT.ENERGY));
//        }
//
//        super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
//    }
//
//    @Override
//    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
//        if(WorldHelper.isServer(worldIn)) {
//            if(!playerIn.isSneaking() && worldIn.getTileEntity(pos) instanceof TileEntitySolarGenerator) {
//                playerIn.openGui(SavageTech.instance, Names.Gui.SOLAR_GENERATOR_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ());
//                return true;
//            }
//        }
//
//        return false;
//    }
//
//    @Override
//    public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) {
//        return super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
//    }
//
//    @Override
//    public TileEntity createNewTileEntity(World worldIn, int meta) {
//        return new TileEntitySolarGenerator(maxEnergyGeneration, maxEnergyTransfer, maxEnergyCapacity);
//    }
//}


text:
In order to easily switch between multiple clusters, a kubeconfig file was defined.  This file contains a series of authentication mechanisms and cluster connection information associated with nicknames.  It also introduces the concept of a tuple of authentication information (user) and cluster connection information called a context that is also associated with a nickname.

Multiple files are kubeconfig files are allowed.  At runtime they are loaded and merged together along with override options specified from the command line (see rules below).

## Related discussion
https://github.com/GoogleCloudPlatform/kubernetes/issues/1755

## Example kubeconfig file
```
apiVersion: v1
clusters:
- cluster:
    api-version: v1beta1
    server: http://cow.org:8080
  name: cow-cluster
- cluster:
    certificate-authority: path/to/my/cafile
    server: https://horse.org:4443
  name: horse-cluster
- cluster:
    insecure-skip-tls-verify: true
    server: https://pig.org:443
  name: pig-cluster
contexts:
- context:
    cluster: horse-cluster
    namespace: chisel-ns
    user: green-user
  name: federal-context
- context:
    cluster: pig-cluster
    namespace: saw-ns
    user: black-user
  name: queen-anne-context
current-context: federal-context
kind: Config
preferences:
  colors: true
users:
- name: blue-user
  user:
    token: blue-token
- name: green-user
  user:
    username: admin
    password: secret
    client-certificate: path/to/my/client/cert
    client-key: path/to/my/client/key
```

## .kubernetes_auth files

**WARNING**: merging auth from a mixture of kubernetes_auth file entries and kubeconfig user entries is hard to debug and should be avoided. kubernetes_auth file support exists mostly for tests and is being deprecated.

The kubernetes_auth file is a legacy config file that can contain a mix of server and client auth info. It is supported in kubeconfig via `auth-path` for a user:
```
users:
- name: black-user
  user:
    auth-path: path/to/my/existing/.kubernetes_auth_file
```

The entries in a file loaded via auth-path will be applied to both the user and cluster of the current context.

### Example .kubernetes_auth file
```
{
  "User": "admin",
  "Password": "secret",
  "CertFile": "/path/to/my/client/cert",
  "KeyFile": "/path/to/my/client/key",
  "CAFile": "/path/to/my/server/cafile",
  "BearerToken": "secrettoken",
  "Insecure": false
}
```
All entries are optional. `User`, `Password`, `CertFile`, `KeyFile`, and `BearerToken` are applied to the kubectl user. `CAFile` and `Insecure` apply to the cluster. Note that it is invalid to set both `CAFile` and `Insecure`, or both `BearerToken` and `User,Password` (see loading and merging rules below).

If the contents of the kubernetes_auth file conflict with entries in kubeconfig, they are ignored. E.g, if the kubeconfig cluster specifies a `certificate-authority`, and the user specifies an `auth-path` to a kubernetes_file that contains a `CAFile` entry, the former will be used and the latter ignored.

## Loading and merging rules
The rules for loading and merging the kubeconfig files are straightforward, but there are a lot of them.  The final config is built in this order:
  1.  Get the kubeconfig  from disk.  This is done with the following hierarchy and merge rules:

      If the CommandLineLocation (the value of the `kubeconfig` command line option) is set, use this file only.  No merging.  Only one instance of this flag is allowed.

      Else, if EnvVarLocation (the value of $KUBECONFIG) is available, use it as a list of files that should be merged.
      Merge files together based on the following rules.
      Empty filenames are ignored.  Files with non-deserializable content produced errors.
      The first file to set a particular value or map key wins and the value or map key is never changed.
      This means that the first file to set CurrentContext will have its context preserved.  It also means that if two files specify a "red-user", only values from the first file's red-user are used.  Even non-conflicting entries from the second file's "red-user" are discarded.

      Otherwise, use HomeDirectoryLocation (~/.kube/config) with no merging.
  1.  Determine the context to use based on the first hit in this chain
      1.  command line argument - the value of the `context` command line option
      1.  current-context from the merged kubeconfig file
      1.  Empty is allowed at this stage
  1.  Determine the cluster info and user to use.  At this point, we may or may not have a context.  They are built based on the first hit in this chain.  (run it twice, once for user, once for cluster)
      1.  command line argument - `user` for user name and `cluster` for cluster name
      1.  If context is present, then use the context's value
      1.  Empty is allowed
  1.  Determine the actual cluster info to use.  At this point, we may or may not have a cluster info.  Build each piece of the cluster info based on the chain (first hit wins):
      1.  command line arguments - `server`, `api-version`, `certificate-authority`, and `insecure-skip-tls-verify`
      1.  If cluster info is present and a value for the attribute is present, use it.
      1.  If you don't have a server location, error.
  1.  Determine the actual user info to use. User is built using the same rules as cluster info, EXCEPT that you can only have one authentication technique per user.
      1. Load precedence is 1) command line flag, 2) user fields from kubeconfig, 3) kubernetes_auth file fields (if user has a `auth-path` or the `--auth-path` was provided)
      1. The command line flags are: `auth-path`, `client-certificate`, `client-key`, `username`, `password`, and `token`.
      1. If there are two conflicting techniques, fail.
  1.  For any information still missing, use default values and potentially prompt for authentication information

## Manipulation of kubeconfig via `kubectl config <subcommand>`
In order to more easily manipulate kubeconfig files, there are a series of subcommands to `kubectl config` to help.
See [docs/kubectl_config.md](kubectl_config.md) for help.

### Example
```
$kubectl config set-credentials myself --username=admin --password=secret
$kubectl config set-cluster local-server --server=http://localhost:8080
$kubectl config set-context default-context --cluster=local-server --user=myself
$kubectl config use-context default-context
$kubectl config set contexts.default-context.namespace the-right-prefix
$kubectl config view
```
produces this output
```
clusters:
  local-server:
    server: http://localhost:8080
contexts:
  default-context:
    cluster: local-server
    namespace: the-right-prefix
    user: myself
current-context: default-context
preferences: {}
users:
  myself:
    username: admin
    password: secret

```
and a kubeconfig file that looks like this
```
apiVersion: v1
clusters:
- cluster:
    server: http://localhost:8080
  name: local-server
contexts:
- context:
    cluster: local-server
    namespace: the-right-prefix
    user: myself
  name: default-context
current-context: default-context
kind: Config
preferences: {}
users:
- name: myself
  user:
    username: admin
    password: secret
```

#### Commands for the example file
```
$kubectl config set preferences.colors true
$kubectl config set-cluster cow-cluster --server=http://cow.org:8080 --api-version=v1beta1
$kubectl config set-cluster horse-cluster --server=https://horse.org:4443 --certificate-authority=path/to/my/cafile
$kubectl config set-cluster pig-cluster --server=https://pig.org:443 --insecure-skip-tls-verify=true
$kubectl config set-credentials blue-user --token=blue-token
$kubectl config set-credentials green-user --client-certificate=path/to/my/client/cert --client-key=path/to/my/client/key
$kubectl config set-context queen-anne-context --cluster=pig-cluster --user=black-user --namespace=saw-ns
$kubectl config set-context federal-context --cluster=horse-cluster --user=green-user --namespace=chisel-ns
$kubectl config use-context federal-context
```


text:
package in.zapr.druid.druidry.extensions.datasketches.postAggregator;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.Arrays;

import in.zapr.druid.druidry.extensions.datasketches.aggregator.TargetHllType;
import in.zapr.druid.druidry.postAggregator.FieldAccessPostAggregator;

public class HllSketchUnionPostAggregatorTest {

    private static ObjectMapper objectMapper;

    private FieldAccessPostAggregator milkyWayStarsHll;
    private FieldAccessPostAggregator andromedaStarsHll;

    @BeforeClass
    public void init() {
        objectMapper = new ObjectMapper();
        milkyWayStarsHll = new FieldAccessPostAggregator("milky_way_stars_hll");
        andromedaStarsHll = new FieldAccessPostAggregator("andromeda_stars_hll");
    }

    private JSONObject getHllSketchUnionPostAggregatorJSON() throws JSONException {

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("type", "HLLSketchUnion");
        jsonObject.put("name", "andro_way_hll");
        return jsonObject;
    }

    private JSONObject getFieldAccessPostAggregatorJSON(String fieldName) throws JSONException {
        JSONObject fieldAccess = new JSONObject();
        fieldAccess.put("type", "fieldAccess");
        fieldAccess.put("fieldName", fieldName);

        return fieldAccess;
    }

    @Test
    public void testAllFields() throws JsonProcessingException, JSONException {

        HllSketchUnionPostAggregator hllSketchUnionPostAggregator =
                HllSketchUnionPostAggregator.builder()
                        .name("andro_way_hll")
                        .fields(Arrays.asList(milkyWayStarsHll, andromedaStarsHll))
                        .lgK(4)
                        .targetHllType(TargetHllType.HLL_4)
                        .build();

        JSONObject jsonObject = getHllSketchUnionPostAggregatorJSON();
        jsonObject.put("fields", new JSONArray(
                Arrays.asList(
                        getFieldAccessPostAggregatorJSON("milky_way_stars_hll"),
                        getFieldAccessPostAggregatorJSON("andromeda_stars_hll")
                ))
        );
        jsonObject.put("lgK", 4);
        jsonObject.put("tgtHllType", "HLL_4");

        String actualJSON = objectMapper.writeValueAsString(hllSketchUnionPostAggregator);
        String expectedJSON = jsonObject.toString();
        JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
    }

    @Test
    public void testRequiredFields() throws JsonProcessingException, JSONException {

        HllSketchUnionPostAggregator hllSketchUnionPostAggregator =
                HllSketchUnionPostAggregator.builder()
                        .name("andro_way_hll")
                        .fields(Arrays.asList(milkyWayStarsHll, andromedaStarsHll))
                        .build();

        JSONObject jsonObject = getHllSketchUnionPostAggregatorJSON();
        jsonObject.put("fields", new JSONArray(
                Arrays.asList(
                        getFieldAccessPostAggregatorJSON("milky_way_stars_hll"),
                        getFieldAccessPostAggregatorJSON("andromeda_stars_hll")
                ))
        );

        String actualJSON = objectMapper.writeValueAsString(hllSketchUnionPostAggregator);
        String expectedJSON = jsonObject.toString();
        JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
    }

    @Test(expectedExceptions = NullPointerException.class)
    public void testNullName() {

        HllSketchUnionPostAggregator hllSketchUnionPostAggregator =
                HllSketchUnionPostAggregator.builder()
                        .fields(Arrays.asList(milkyWayStarsHll, andromedaStarsHll))
                        .build();
    }

    @Test(expectedExceptions = NullPointerException.class)
    public void testNullFields() {

        HllSketchUnionPostAggregator hllSketchUnionPostAggregator =
                HllSketchUnionPostAggregator.builder()
                        .name("andro_way_hll")
                        .build();
    }
}


text:
<?php

namespace Symfony\Component\Routing\Generator;

use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Exception\InvalidParameterException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;

/**
 * UrlGenerator generates URL based on a set of routes.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class UrlGenerator implements UrlGeneratorInterface
{
    protected $context;

    private $routes;
    private $cache;

    /**
     * Constructor.
     *
     * @param RouteCollection $routes  A RouteCollection instance
     * @param RequestContext  $context The context
     */
    public function __construct(RouteCollection $routes, RequestContext $context)
    {
        $this->routes = $routes;
        $this->context = $context;
        $this->cache = array();
    }

    /**
     * Sets the request context.
     *
     * @param RequestContext $context The context
     */
    public function setContext(RequestContext $context)
    {
        $this->context = $context;
    }

    /**
     * Gets the request context.
     *
     * @return RequestContext The context
     */
    public function getContext()
    {
        return $this->context;
    }

    /**
     * Generates a URL from the given parameters.
     *
     * @param  string  $name       The name of the route
     * @param  array   $parameters An array of parameters
     * @param  Boolean $absolute   Whether to generate an absolute URL
     *
     * @return string The generated URL
     *
     * @throws Symfony\Component\Routing\Exception\RouteNotFoundException When route doesn't exist
     */
    public function generate($name, array $parameters = array(), $absolute = false)
    {
        if (null === $route = $this->routes->get($name)) {
            throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
        }

        if (!isset($this->cache[$name])) {
            $this->cache[$name] = $route->compile();
        }

        return $this->doGenerate($this->cache[$name]->getVariables(), $route->getDefaults(), $route->getRequirements(), $this->cache[$name]->getTokens(), $parameters, $name, $absolute);
    }

    /**
     * @throws Symfony\Component\Routing\Exception\MissingMandatoryParametersException When route has some missing mandatory parameters
     * @throws Symfony\Component\Routing\Exception\InvalidParameterException When a parameter value is not correct
     */
    protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute)
    {
        $variables = array_flip($variables);

        $originParameters = $parameters;
        $parameters = array_replace($this->context->getParameters(), $parameters);
        $tparams = array_replace($defaults, $parameters);

        // all params must be given
        if ($diff = array_diff_key($variables, $tparams)) {
            throw new MissingMandatoryParametersException(sprintf('The "%s" route has some missing mandatory parameters (%s).', $name, implode(', ', $diff)));
        }

        $url = '';
        $optional = true;
        foreach ($tokens as $token) {
            if ('variable' === $token[0]) {
                if (false === $optional || !isset($defaults[$token[3]]) || (isset($parameters[$token[3]]) && $parameters[$token[3]] != $defaults[$token[3]])) {
                    if (!$isEmpty = in_array($tparams[$token[3]], array(null, '', false), true)) {
                        // check requirement
                        if ($tparams[$token[3]] && !preg_match('#^'.$token[2].'$#', $tparams[$token[3]])) {
                            throw new InvalidParameterException(sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given).', $token[3], $name, $token[2], $tparams[$token[3]]));
                        }
                    }

                    if (!$isEmpty || !$optional) {
                        // %2F is not valid in a URL, so we don't encode it (which is fine as the requirements explicitly allowed it)
                        $url = $token[1].str_replace('%2F', '/', rawurlencode($tparams[$token[3]])).$url;
                    }

                    $optional = false;
                }
            } elseif ('text' === $token[0]) {
                $url = $token[1].$url;
                $optional = false;
            }
        }

        if (!$url) {
            $url = '/';
        }

        // add a query string if needed
        if ($extra = array_diff_key($originParameters, $variables, $defaults)) {
            $url .= '?'.http_build_query($extra);
        }

        $url = $this->context->getBaseUrl().$url;

        if ($this->context->getHost()) {
            $scheme = $this->context->getScheme();
            if (isset($requirements['_scheme']) && ($req = strtolower($requirements['_scheme'])) && $scheme != $req) {
                $absolute = true;
                $scheme = $req;
            }

            if ($absolute) {
                $port = '';
                if ('http' === $scheme && 80 != $this->context->getHttpPort()) {
                    $port = ':'.$this->context->getHttpPort();
                } elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) {
                    $port = ':'.$this->context->getHttpsPort();
                }

                $url = $scheme.'://'.$this->context->getHost().$port.$url;
            }
        }

        return $url;
    }
}