text:
import { fromLonLat, toLonLat, transform as baseTransform, transformExtent as baseTransformExtent } from 'ol/proj'
import { GeometryType } from './enums'
import { calcDistance, COORD_PRECISION, roundCoords, roundExtent } from './coord'

export const EPSG_4326 = 'EPSG:4326'
export const EPSG_3857 = 'EPSG:3857'

/**
 * @param {number[]} coordinate
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Coordinate|number[]}
 */
export function pointToLonLat (
  coordinate,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinate) return

  return roundCoords(GeometryType.POINT, toLonLat(coordinate, projection), precision)
}

/**
 * @param {number[]} coordinate
 * @param {module:ol/proj.ProjectionLike} [projection]
 * @param {number} [precision=COORD_PRECISION]
 * @return {number[]}
 */
export function pointFromLonLat (
  coordinate,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinate) return

  return roundCoords(GeometryType.POINT, fromLonLat(coordinate, projection), precision)
}

/**
 * @param {number[]} coordinate
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @returns {number[]}
 */
export function transformPoint (
  coordinate,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinate) return

  return transform(coordinate, sourceProjection, destProjection, precision)
}

/**
 * @param {number[]} coordinate
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @returns {number[]}
 */
export function transform (
  coordinate,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinate) return
  let coord = baseTransform(coordinate, sourceProjection, destProjection)
  if (coord.some(x => isNaN(x))) {
    coord = baseTransform(baseTransform(coordinate, sourceProjection, EPSG_4326), EPSG_4326, destProjection)
  }
  return roundCoords(GeometryType.POINT, coord, precision)
}

/**
 * @param {Array<number[]>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<number[]>}
 */
export function lineToLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => pointToLonLat(point, projection, precision))
}

/**
 * @param {Array<number[]>} coordinates
 * @param {ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<number[]>}
 */
export function lineFromLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => pointFromLonLat(point, projection, precision))
}

/**
 * @param {Array<number[]>} coordinates
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @returns {number[]}
 */
export function transformLine (
  coordinates,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => transformPoint(point, sourceProjection, destProjection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<number[]>>}
 */
export function polygonToLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => lineToLonLat(line, projection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<number[]>>}
 */
export function polygonFromLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => lineFromLonLat(line, projection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @returns {*}
 */
export function transformPolygon (
  coordinates,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => transformLine(line, sourceProjection, destProjection, precision))
}

/**
 * @param {Array<number[]>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<number[]>}
 */
export function multiPointToLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => pointToLonLat(point, projection, precision))
}

/**
 * @param {Array<number[]>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<number[]>}
 */
export function multiPointFromLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => pointFromLonLat(point, projection, precision))
}

/**
 * @param {Array<number[]>} coordinates
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<number[]>}
 */
export function transformMultiPoint (
  coordinates,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(point => transformPoint(point, sourceProjection, destProjection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<number[]>>}
 */
export function multiLineToLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => lineToLonLat(line, projection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<number[]>>}
 */
export function multiLineFromLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => lineFromLonLat(line, projection, precision))
}

/**
 * @param {Array<Array<number[]>>} coordinates
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<number[]>>}
 */
export function transformMultiLine (
  coordinates,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(line => transformLine(line, sourceProjection, destProjection, precision))
}

/**
 * @param {Array<Array<Array<number[]>>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<Array<number[]>>>}
 */
export function multiPolygonToLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(polygon => polygonToLonLat(polygon, projection, precision))
}

/**
 * @param {Array<Array<Array<number[]>>>} coordinates
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG_3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<Array<number[]>>>}
 */
export function multiPolygonFromLonLat (
  coordinates,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(polygon => polygonFromLonLat(polygon, projection, precision))
}

/**
 * @param {Array<Array<Array<number[]>>>} coordinates
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @return {Array<Array<Array<number[]>>>}
 */
export function transformMultiPolygon (
  coordinates,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!coordinates) return

  return coordinates.map(polygon => transformPolygon(polygon, sourceProjection, destProjection, precision))
}

/**
 * Transforms by geom type
 * @type {Object<string, function>}
 */
export const transforms = /*#__PURE__*/{
  [GeometryType.POINT]: {
    toLonLat: pointToLonLat,
    fromLonLat: pointFromLonLat,
    transform: transformPoint,
  },
  [GeometryType.LINE_STRING]: {
    toLonLat: lineToLonLat,
    fromLonLat: lineFromLonLat,
    transform: transformLine,
  },
  [GeometryType.POLYGON]: {
    toLonLat: polygonToLonLat,
    fromLonLat: polygonFromLonLat,
    transform: transformPolygon,
  },
  [GeometryType.MULTI_POINT]: {
    toLonLat: multiPointToLonLat,
    fromLonLat: multiPointFromLonLat,
    transform: transformMultiPoint,
  },
  [GeometryType.MULTI_LINE_STRING]: {
    toLonLat: multiLineToLonLat,
    fromLonLat: multiLineFromLonLat,
    transform: transformMultiLine,
  },
  [GeometryType.MULTI_POLYGON]: {
    toLonLat: multiPolygonToLonLat,
    fromLonLat: multiPolygonFromLonLat,
    transform: transformMultiPolygon,
  },
  [GeometryType.CIRCLE]: {
    toLonLat: pointToLonLat,
    fromLonLat: pointFromLonLat,
    transform: transformPoint,
  },
}

/**
 * @param {number[]} extent
 * @param {module:ol/proj.ProjectionLike} sourceProjection
 * @param {module:ol/proj.ProjectionLike} destProjection
 * @param {number} [precision=COORD_PRECISION]
 * @return {number[]}
 */
export function transformExtent (
  extent,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!extent) return
  if (extent.every(x => !isFinite(x))) return extent
  let ext = baseTransformExtent(extent, sourceProjection, destProjection)
  if (ext.some(x => isNaN(x))) {
    ext = baseTransformExtent(baseTransformExtent(extent, sourceProjection, EPSG_4326), EPSG_4326, destProjection)
  }
  return roundExtent(ext, precision)
}

/**
 * @param {number[]} extent
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG:3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {number[]}
 */
export function extentFromLonLat (
  extent,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!extent) return

  return transformExtent(extent, EPSG_4326, projection, precision)
}

/**
 * @param {number[]} extent
 * @param {module:ol/proj.ProjectionLike} [projection=EPSG:3857]
 * @param {number} [precision=COORD_PRECISION]
 * @return {number[]}
 */
export function extentToLonLat (
  extent,
  projection = EPSG_3857,
  precision = COORD_PRECISION,
) {
  if (!extent) return

  return transformExtent(extent, projection, EPSG_4326, precision)
}

export function transformDistance (
  distance,
  sourceProjection,
  destProjection,
  precision = COORD_PRECISION,
) {
  if (!distance) return

  const line = transformLine(
    [[0, 0], [distance, 0]],
    sourceProjection,
    destProjection,
    precision,
  )

  return calcDistance(line[0], line[1], precision)
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- *************************GO-LICENSE-START******************************
 * Copyright 2014 ThoughtWorks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *************************GO-LICENSE-END******************************* -->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:p="http://www.springframework.org/schema/p"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <context:annotation-config/>

    <import resource="velocity-config.xml"/>

    <context:component-scan base-package="com.thoughtworks.go.util"/>
    <context:component-scan base-package="com.thoughtworks.go.server.controller">
        <context:exclude-filter type="regex" expression=".*TabController"/>
    </context:component-scan>
    <context:component-scan base-package="com.thoughtworks.go.server.web"/>
    <context:component-scan base-package="com.thoughtworks.go.server.ui"/>

    <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
        <property name="interceptors">
            <list>
                <ref bean="authorizationInterceptor"/>
            </list>
        </property>
    </bean>

    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize" value="-1"/> <!-- i.e. unlimited -->
    </bean>

    <bean id="fileView" class="com.thoughtworks.go.server.web.FileView"/>

    <bean id="systemEnvironment" class="com.thoughtworks.go.util.SystemEnvironment"/>
</beans>

redpajama_set_name: RedPajamaGithub


text:
A bunch more minor tweaks!

    Tutorial is now excluded from the school end time because it's effectively
    optional.

    Period 8 is now disabled by default to reduce confusion. If you have a
    period 8, turn it back on in Options.

PSAs won't be marked as read when UGWA auto-updates.

    The alternate schedules stored offline has been reset, so last year's
    alternate schedules don't prop up this year and show school on Saturday.

    The normal schedule will show as a placeholder while alternate schedules
    load.

    Notifications at the start of a period will open the period's associated
    link when clicked.

Empty assignments are editable now.

    Fixed colours not showing properly in the assignment editor's period
    dropdown.

There's now a hint on how to stop viewing a barcode just in case.

  Also, check out the latest video by the Ovine Office of Propaganda and
  Service:


text:
"use strict"

let mockResults = {}

export const resolveModuleExports = (
  input: unknown
): Array<string> | undefined => {
  // return a mocked result
  if (typeof input === `string`) {
    return mockResults[input]
  }

  // return default result
  if (typeof input !== `object`) {
    return []
  }

  // set mock results
  mockResults = Object.assign({}, input)
  return undefined
}


text:
class CreateShops < ActiveRecord::Migration
  def self.up
    create_table :shops do |t|
      t.string :name
      t.string :address
      t.string :postal_code
      t.time :opening_time
      t.time :closing_time
      t.string :holiday
      t.text :description
      t.timestamps
    end
  end

  def self.down
    drop_table :shops
  end
end


text:
CautionClass::CautionClass() {

	int	i;

	for (i = 0; i < NumVectors; i++) {
		mpBitVector[i]	= 0x0;
	}
}

//-------------------------------------------------
// CautionClass::IsFlagSet
//-------------------------------------------------

BOOL CautionClass::IsFlagSet() {

	int i;
	unsigned int flag = 0;

	for(i = 0; i < NumVectors; i++) {
		flag 	|= mpBitVector[i];
	}

	return (flag != 0);
}

//-------------------------------------------------
// CautionClass::ClearFlag
//-------------------------------------------------

void CautionClass::ClearFlag() {
MonoPrint("remove call\n");
}

//-------------------------------------------------
// CautionClass::SetCaution
//-------------------------------------------------

void CautionClass::SetCaution(type_CSubSystem subsystem) {

	SetCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::SetCaution
//-------------------------------------------------

void CautionClass::SetCaution(type_TWSubSystem subsystem) {

	SetCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::ClearCaution
//-------------------------------------------------

void CautionClass::ClearCaution(type_CSubSystem subsystem) {

	ClearCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::ClearCaution
//-------------------------------------------------

void CautionClass::ClearCaution(type_TWSubSystem subsystem) {

	ClearCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::GetCaution
//-------------------------------------------------

BOOL CautionClass::GetCaution(type_CSubSystem subsystem) {
	return GetCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::GetCaution
//-------------------------------------------------

BOOL CautionClass::GetCaution(type_TWSubSystem subsystem) {
	return GetCaution((int) subsystem);
}

//-------------------------------------------------
// CautionClass::SetCaution
//-------------------------------------------------

void CautionClass::SetCaution(int subsystem) {

	int		vectorNum	= 0;
	int		bitNum;

	vectorNum	= subsystem / BITS_PER_VECTOR;
	bitNum		= subsystem - vectorNum * BITS_PER_VECTOR;

	mpBitVector[vectorNum] |= 0x01 << bitNum;

}

//-------------------------------------------------
// CautionClass::ClearCaution
//-------------------------------------------------

void CautionClass::ClearCaution(int subsystem) {

	int		vectorNum	= 0;
	int		bitNum;

	vectorNum	= subsystem / BITS_PER_VECTOR;
	bitNum		= subsystem - vectorNum * BITS_PER_VECTOR;

	mpBitVector[vectorNum] &= ~(0x01 << bitNum);

}

//-------------------------------------------------
// CautionClass::GetCaution
//-------------------------------------------------

BOOL CautionClass::GetCaution(int subsystem) {

	int		vectorNum	= 0;
	int		bitNum;

	vectorNum	= subsystem / BITS_PER_VECTOR;
	bitNum		= subsystem - vectorNum * BITS_PER_VECTOR;

	return ((mpBitVector[vectorNum] & (0x01 << bitNum)) != 0);
}


text:
// -----------------------------------------------------------------------
// <copyright file="KeyEventArgs.cs" company="Steven Kirk">
// Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

namespace Perspex.Input
{
    using System;
    using Perspex.Interactivity;

    public class KeyEventArgs : RoutedEventArgs
    {
        public IKeyboardDevice Device { get; set; }

        public Key Key { get; set; }

        public string Text { get; set; }
    }
}


text:
Sections
~~~~~~~~

-  `Introduction <#Introduction>`__
-  `Description of the Overall
   Process <#Description%20of%20the%20Overall%20Process>`__
-  `How to Do It in Code? <#How%20to%20Do%20It%20in%20Code?>`__
-  `Summary <#Summary>`__

Logistic Regression using TensorFlow
------------------------------------

This tutorial is about training a logistic regression by TensorFlow for
binary classification.

Introduction
------------

In `Linear Regression using
TensorFlow <http://www.machinelearninguru.com/deep_learning/tensorflow/machine_learning_basics/linear_regresstion/linear_regression.html>`__
post we described how to predict continuous-valued parameters by
linearly modeling the system. What if the objective is to decide between
two choices? The answer is simple: we are dealing with a classification
problem. In this tutorial, the objective to decide whether the input
image is digit "0" or digit "1" using Logistic Regression. In another
word, whether it is digit "1" or not! The full source code is available
in the associated `GitHub
repository <https://github.com/Machinelearninguru/Deep_Learning/tree/master/TensorFlow/machine_learning_basics/logistic_regression>`__.

Dataset
-------

The dataset that we work on that in this tutorial is the
`MNIST <http://yann.lecun.com/exdb/mnist/>`__ dataset. The main dataset
consists of 55000 training and 10000 test images. The images are 28x28x1
which each of them represent a hand-written digit from 0 to 9. We create
feature vectors of size 784 of each image. We only use 0 and 1 images
for our setting.

Logistic Regression
-------------------

In linear regression the effort is to predict the outcome continuous
value using the linear function of $y=W^{T}x$. On the other hand, in
logistic regression we are determined to predict a binary label as
$y\\in\\{0,1\\}$ in which we use a different prediction process as
opposed to linear regression. In logistic regression, the predicted
output is the probability that the input sample belongs to a targeted
class which is digit "1" in our case. In a binary-classification
problem, obviously if the $P(x\\in\\{target\\\_class\\})$ = M, then
$P(x\\in\\{non\\\_target\\\_class\\}) = 1 - M$. So the hypothesis can be
created as follows:

$$P(y=1\|x)=h\_{W}(x)={{1}\\over{1+exp(-W^{T}x)}}=Sigmoid(W^{T}x) \\ \\
\\ (1)$$ $$P(y=0\|x)=1 - P(y=1\|x) = 1 - h\_{W}(x) \\ \\ \\ (2)$$

In the above equations, Sigmoid function maps the predicted output into
probability space in which the values are in the range of $[0,1]$. The main
objective is to find the model using which when the input sample is "1"
the output becomes a high probability and becomes small otherwise. The
important objective is to design the appropriate cost function to
minimize the loss when the output is desired and vice versa. The cost
function for a set of data such as $(x^{i},y^{i})$ can be defined as
below:

$$Loss(W) =
\\sum\_{i}{y^{(i)}log{1\\over{h\_{W}(x^{i})}}+(1-y^{(i)})log{1\\over{1-h\_{W}(x^{i})}}}$$

As it can be seen from the above equation, the loss function consists of
two term and in each sample only one of them is non-zero considering the
binary labels.

Up to now, we defined the formulation and optimization function of the
logistic regression. In the next part, we show how to do it in code using
mini-batch optimization.

Description of the Overall Process
----------------------------------

At first, we process the dataset and extract only "0" and "1" digits. The
code implemented for logistic regression is heavily inspired by our
`Train a Convolutional Neural Network as a
Classifier <http://www.machinelearninguru.com/deep_learning/tensorflow/neural_networks/cnn_classifier/cnn_classifier.html>`__
post. We refer to the aforementioned post for having a better
understanding of the implementation details. In this tutorial, we only
explain how we process dataset and how to implement logistic regression
and the rest is clear from the CNN classifier post that we referred
earlier.

How to Do It in Code?
---------------------

In this part, we explain how to extract desired samples from dataset and
to implement logistic regression using Softmax.

Process Dataset
~~~~~~~~~~~~~~~

At first, we need to extract "0" and "1" digits from MNIST dataset:

.. code:: python

    from tensorflow.examples.tutorials.mnist import input_data
    mnist = input_data.read_data_sets("MNIST_data/", reshape=True, one_hot=False)

    ########################
    ### Data Processing ####
    ########################
    # Organize the data and feed it to associated dictionaries.
    data={}

    data['train/image'] = mnist.train.images
    data['train/label'] = mnist.train.labels
    data['test/image'] = mnist.test.images
    data['test/label'] = mnist.test.labels

    # Get only the samples with zero and one label for training.
    index_list_train = []
    for sample_index in range(data['train/label'].shape[0]):
        label = data['train/label'][sample_index]
        if label == 1 or label == 0:
            index_list_train.append(sample_index)

    # Reform the train data structure.
    data['train/image'] = mnist.train.images[index_list_train]
    data['train/label'] = mnist.train.labels[index_list_train]

    # Get only the samples with zero and one label for test set.
    index_list_test = []
    for sample_index in range(data['test/label'].shape[0]):
        label = data['test/label'][sample_index]
        if label == 1 or label == 0:
            index_list_test.append(sample_index)

    # Reform the test data structure.
    data['test/image'] = mnist.test.images[index_list_test]
    data['test/label'] = mnist.test.labels[index_list_test]

The code looks to be verbose but it's very simple actually. All we want
is implemented in lines 28-32 in which the desired data samples are
extracted. Next, we have to dig into logistic regression architecture.

Logistic Regression Implementation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The logistic regression structure is simply feeding-forwarding the input
features through a fully-connected layer in which the last layer only
has two classes. The fully-connected architecture can be defined as
below:

.. code:: python

        ###############################################
        ########### Defining place holders ############
        ###############################################
        image_place = tf.placeholder(tf.float32, shape=([None, num_features]), name='image')
        label_place = tf.placeholder(tf.int32, shape=([None,]), name='gt')
        label_one_hot = tf.one_hot(label_place, depth=FLAGS.num_classes, axis=-1)
        dropout_param = tf.placeholder(tf.float32)

        ##################################################
        ########### Model + Loss + Accuracy ##############
        ##################################################
        # A simple fully connected with two class and a Softmax is equivalent to Logistic Regression.
        logits = tf.contrib.layers.fully_connected(inputs=image_place, num_outputs = FLAGS.num_classes, scope='fc')

The first few lines are defining place-holders in order to put the
desired values on the graph. Please refer to `this
post <http://www.machinelearninguru.com/deep_learning/tensorflow/neural_networks/cnn_classifier/cnn_classifier.html>`__
for further details. The desired loss function can easily be implemented
using TensorFlow using the following script:

.. code:: python

        # Define loss
        with tf.name_scope('loss'):
            loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=label_one_hot))

        # Accuracy
        with tf.name_scope('accuracy'):
            # Evaluate the model
            correct_pred = tf.equal(tf.argmax(logits, 1), tf.argmax(label_one_hot, 1))

            # Accuracy calculation
            accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))

The tf.nn.softmax\_cross\_entropy\_with\_logits function does the work.
It optimizes the previously defined cost function with a subtle
difference. It generates two inputs in which even if the sample is digit
"0", the correspondent probability will be high. So
tf.nn.softmax\_cross\_entropy\_with\_logits function, for each class
predict a probability and inherently on its own, makes the decision.

Summary
-------

In this tutorial, we described logistic regression and represented how to
implement it in code. Instead of making a decision based on the output
probability based on a targeted class, we extended the problem to a two
class problem in which for each class we predict the probability. In the future posts, we will extend this problem to multi-class problem and we
show it can be done with the similar approach.


text:
layout: docs
title: Build phase
---

# Build phase

After cloning the repository, AppVeyor runs **MSBuild** to build project sources and package artifacts.

The following command is used:

    msbuild <project> /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

Custom logger is required to push MSBuild warning and errors in real-time to build console.
You may use this logger in your own build scripts.

`<project>` is a Visual Studio project (`*.*proj`) or solution (`*.sln`) file. If a project or solution file is not specified on project settings, AppVeyor recursively searches for the first occurence of `*.sln` or `*.*proj` file in the build clone directory.

## Adding additional parameters to msbuild with a response file

If you commit a file named msbuild.rsp, the contents of that file will be treated as if they were parameters passed to the msbuild command line. Parameters can be placed once per line, and the file supports comments.

**Note** that this is a feature of msbuild itself. While this file will not alter the behavior of builds triggered by Visual Studio, it will alter the behavior of calls to msbuild outside of AppVeyor. This behavior can be altered by the `/noautoresponse` or `/noautorsp` switches.

**Also Note** that rsp files are often in `.gitignore` for .NET solutions. Be sure that your response file actually gets commited if you add one locally.

```text
#Appveyor msbuild response file

# No Banner
/nologo
# We just want errors displayed
/ConsoleLoggerParameters:NoSummary;Verbosity=quiet
# Log to a file and set options
/filelogger
/fileloggerparameters:Verbosity=detailed
/bl
# uncomment below to also include paramaters from @additionalswitches.rsp
# @additionalswitches.rsp
```

## Automatic packaging of build artifacts

Before running MSBuild, AppVeyor analyzes the supplied project or solution file to determine the type and "flavor" of all projects.

### Packaging Web Application projects (WAP)

To package Visual Studio WAP, AppVeyor runs the following command:

    msbuild <wap_project> /t:Package /p:PackageLocation=<web-deploy-package.zip>

This command performs compilation and publishing of WAP into a Web Deploy package. The produced package is pushed to artifacts and can be deployed using [Web Deploy](/docs/deployment/web-deploy/) or [Agent](/docs/deployment/agent/) providers.

By default, Web application project artifact deployment name is the same as project name. However, in some cases it can be useful to customize deployment name. This especially makes sense when multiple Web application projects use the same [Agent deployment](/docs/deployment/agent/#deploying-artifact-package-as-iis-web-site) Environment. For Agent deployment, artifact deployment name is a key setting and it would be convenient to have the same deployment name for all projects using certain Agent deployment Environment. To achieve this, provide custom value for `APPVEYOR_WAP_ARTIFACT_NAME` environment variable.

When creating the package, you can declare that ACLs will not be updated during package deployment. For that set `APPVEYOR_WAP_SKIP_ACLS` environment variable to `true` (this will create `<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>` record in temporary publishing profile AppVeyor creates on the fly.

### Packaging NuGet libraries

If the project folder contains a `*.nuspec` file (and `publish_nuget: true` (YAML) / `Package NuGet projects` (UI) is set) AppVeyor will try to package the project as a NuGet library by calling the following command:

    nuget pack <project_file> -OutputDirectory <temp_path>

For example, given the following project structure:

![nuget-pack-project](/assets/img/docs/nuget-pack-project.png)

AppVeyor will call:

    nuget pack SimpleConsole.Tests.csproj -OutputDirectory <temp_path>

to generate a `.nuspec` file for your project use the `nuget spec` command.

**Note** that this feature works will with [AssemblyInfo patching](/docs/build-configuration/#assemblyinfo-patching)

### Packaging .NET Core NuGet libraries

If .NET Core (or .NET Standard) project's `.csproj` file contains any of the following attributes

    AssemblyName
    PackageVersion
    PackageVersionPrefix
    PackageVersionSuffix
    Authors
    Title
    Description
    Copyright
    PackageRequireLicenseAcceptance
    PackageLicenseUrl
    PackageProjectUrl
    PackageIconUrl
    PackageTags
    PackageReleaseNotes
    RepositoryUrl
    RepositoryType
    Version

(and `publish_nuget: true` (YAML) / `Package NuGet projects` (UI) is set) AppVeyor will try to package the project as a NuGet library by calling the following command:

    dotnet pack <project_file> --output <temp_path>

**Note** that this feature works well with [.NET Core `.csproj` files patching](/docs/build-configuration/#net-core-csproj-files-patching)

#### Excluding .NET Core projects from NuGet packaging

.NET Core nuget packaging is skipped if `IsPackable` is set to `false` in the `.csproj` file. It is set by default to `false` for .NET Core test projects created with Visual Studio template or with the `dotnet new` command. So by default, .NET Core test projects are excluded from NuGet packaging.

If .NET Core test project should be packaged, please set `IsPackable=true`:

```xml
  <PropertyGroup>
    ...
    <IsPackable>true</IsPackable>
  </PropertyGroup>
```

Or if some If .NET Core project should be excluded from NuGet packaging, please set `IsPackable=false`:

```xml
  <PropertyGroup>
    ...
    <IsPackable>false</IsPackable>
  </PropertyGroup>
```

#### Packaging symbols

* Use `publish_nuget_symbols: true` (YAML) / `Include NuGet symbol packages` (UI) to package symbols in classic `.symbols.nupkg` format.
* Use `publish_nuget_symbols: true` **and** `use_snupkg_format: true` (YAML) / `Include NuGet symbol packages` **and** `Use .snupkg package format` (UI) to package symbols in new `.snupkg` format.

### Packaging Azure Cloud Service projects

If Azure Cloud Service project (`.ccproj`) is found with the solution AppVeyor will create Azure Cloud Service package (`.cspkg`) using the following command:

    msbuild <ccproj_file> /t:Publish /p:PublishDir=<temp_path>

Created Cloud Service package (`<project-name>.cspkg`) and default "Cloud" configuration (`<project-name>.cscfg`) will be published to build artifacts. In addition to that **all** `.cscfg` files found in Cloud Service project folder are pushed to artifacts with names `<project-name>.<config>.cscfg`.

#### Selecting cloud service configuration

By default, MSBuild uses `<project>.Cloud.cscfg` cloud service configuration, but you can specify which configuration to use by adding a `TargetProfile` environment variable, for example:

        TargetProfile
        Staging

#### Caveats

While trying to build an Azure Cloud Service project, you may get the following (or similar related) error:

    The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\vX.X\Windows Azure Tools\2.X\Microsoft.WindowsAzure.targets" was not found.

To fix this error, add the following environment variable on the **Environment** tab of project settings:

        VisualStudioVersion
        12.0

where 12.0 is your version of Visual Studio (VS 2013 - 12.0, VS 2012 - 11.0, VS 2010 - 10.0).

See also:

* [appveyor.yml reference](/docs/appveyor-yml/)
* [Pushing real-time compilation messages to build console](/docs/build-worker-api#add-compilation-message)


text:
class AddDepictsYearToLayer < ActiveRecord::Migration[4.2]
  def self.up
     add_column :layers, :depicts_year, :string, :limit => 4, :default => ""
  end

  def self.down
    remove_column :layers, :depicts_year
  end
end


text:
.class public interface abstract Lo/sz;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/os/IInterface;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lo/sz$if;
    }
.end annotation

# virtual methods
.method public abstract ˊ()V
.end method

.method public abstract ˊ(Lo/sS;)V
.end method


text:
'use strict';
app.controller('index_controller', function ($scope, $rootScope, $window, $mdSidenav, $state) {

    $scope.date = new Date();

    $scope.main_menu_items = [
        { name: 'Sensors', path: 'sensors', icon: 'memory'},
				{ name: 'Servers', path: 'servers', icon: 'computer'},
				{ name: 'Bluetooth', path: 'bluetooth', icon: 'computer'}
    ];

	$scope.admin_menu_items = [
        { name: 'Settings', path: 'settings', icon: 'settings'}
    ];

    $rootScope.title = 'Login';

    $scope.go = function (path, title) {
        $state.go(path);
        $rootScope.title = title;
    }

    $scope.toggleLeft = function () {
        $mdSidenav('left')
              .toggle();
    }

    $scope.menuIcon = 'menu';
    $scope.menuToggle = function () {
        if ($scope.menuIcon == 'menu') {
            $mdSidenav('left')
              .open();
            $scope.menuIcon = 'arrow_back';
        }
        else {
            $mdSidenav('left')
              .close();
            $scope.menuIcon = 'menu';
        }
    }

    //Initialize settings, keep synced with settings_controller
    $scope.settings = { units:'metric'
    				  };
    //Persist
	localStorage.setItem("settings",JSON.stringify($scope.settings));

	//Logout
   $scope.logout = function () {
				//Clear everything
		 		$rootScope.member_loggedin = {}; //Nullify
				$rootScope.member_id = null;

		 		$rootScope.title = '';

		 		$window.location.replace($window.location.toString().split('#')[0]);

				//var url = "http://" + $window.location.host + '/#/member_login';
		 		//console.log(url);
        //$window.location.href = url;
    };

});


text:
package com.buffalokiwi.aerodrome.jet.reports;

import com.buffalokiwi.aerodrome.jet.IJetDate;
import com.buffalokiwi.aerodrome.jet.JetDate;
import com.buffalokiwi.aerodrome.jet.Utils;
import com.buffalokiwi.utils.Money;
import javax.json.JsonObject;

/**
 * Jet has "offer" records within the SalesData report.
 * This represents a best offer, or a best marketplace offer.
 *
 * @author John Quinn
 */
public class OfferRec
{
  /**
   * The shipping method specified for your best price. For the time being,
   * this will always be null.
   */
  private final String shippingMethod;

  /**
   * The item price for one unit of the SKU based on your best retail price
   * (item and shipping price)
   */
  private final Money itemPrice;

  /**
   * The shipping price for one unit of the SKU based on your best retail
   * price (item and shipping price)
   */
  private final Money shippingPrice;

  /**
   * The last time these prices were updated. The last_update time does not
   * necessarily change if the best price does not change, even if the price
   * is more up to date than this time.
   */
  private final IJetDate lastUpdate;

  /**
   * A date format
   */
  //private final DateFormat fmt = new SimpleDateFormat(
  //  "yyyy-MM-dd'T'HH:mm:ss'.0000000'Z", Locale.ENGLISH );

  /**
   * Create a new OfferRec instance from Jet Json.
   * @param json Json
   * @return object
   */
  public static OfferRec fromJSON( final JsonObject json )
  {
    Utils.checkNull( json, "json" );

    return new OfferRec(
      json.getString( "shipping_method", "" ),
      Utils.jsonNumberToMoney( json, "item_price" ),
      Utils.jsonNumberToMoney( json, "shipping_price" ),
      JetDate.fromJetValueOrNull( json.getString( "last_update", "" ))
    );
  }

  /**
   * Create a new OfferRec instance
   * @param shippingMethod null
   * @param itemPrice item price
   * @param shippingPrice ship price
   * @param lastUpdate last update
   */
  public OfferRec(
    final String shippingMethod,
    final Money itemPrice,
    final Money shippingPrice,
    final IJetDate lastUpdate
  )
  {
    if ( shippingMethod == null )
      this.shippingMethod = "";
    else
      this.shippingMethod = shippingMethod;

    Utils.checkNull( itemPrice, "itemPrice" );
    Utils.checkNull( shippingPrice, "shippingPrice" );
    Utils.checkNull( lastUpdate, "lastUpdate" );

    this.lastUpdate = lastUpdate;//fmt.parse( lastUpdate );

    this.itemPrice = itemPrice;
    this.shippingPrice = shippingPrice;
  }

  /**
   * The shipping method specified for your best price. For the time being,
   * this will always be an empty string. (Jet API will return null).
   * @return empty string
   */
  public String getShippingMethod()
  {
    return shippingMethod;
  }

  /**
   * The item price for one unit of the SKU based on your best retail price
   * (item and shipping price)
   * @return price
   */
  public Money getItemPrice()
  {
    return itemPrice;
  }

  /**
   * The shipping price for one unit of the SKU based on your best retail price
   * (item and shipping price)
   * @return price
   */
  public Money getShippingPrice()
  {
    return shippingPrice;
  }

  /**
   * The last time these prices were updated. The last_update time does not
   * necessarily change if the best price does not change, even if the price
   * is more up to date than this time.
   *
   * This may return null.
   *
   * @return date
   */
  public IJetDate getLastUpdate()
  {
    return lastUpdate;
  }
}


text:
import java.net.UnknownHostException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;

import javafx.application.Platform;

@SuppressWarnings("deprecation")
public class MyBacheca extends Thread {
	tabBachecaController controller;
	secondSceneController secondContr;
	Bacheca myBacheca;
	NuoveAmicizie myNuoviAmici;

	public MyBacheca(tabBachecaController tabBachecaContr,
			secondSceneController secondContr) throws Exception{
		this.controller = tabBachecaContr;
		this.secondContr = secondContr;
	}

	public void run (){

        while(true) {
        	try {
        		// se il server è online
				if (checkIfOnline(myBacheca)){
					System.out.println("IL server è online");
					// carico i post dal db_locale a quello del server
					controller.caricaPost();
					controller.caricaCommenti();
					secondContr.refresh();
					// controllo che ci siano nuovi post da visualizzare in Bacheca
					myBacheca = (Bacheca)Naming.lookup(Main.service_BACHECA);
					if (myBacheca.thereIsNewPost(controller.lastDate)){
						Platform.runLater(new Runnable() {
			                @Override
			                public void run() {
			                    try {
									controller.refresh();
								} catch (Exception e) {
									System.out.println("NON VA");
								}
			                }
			            });
					}
				}				// 10 minuti = 600000 millisec
				sleep(600000);
			} catch (Exception e1) {
				e1.printStackTrace();
			}

        }
    }

	/*
	 * Controlla se il server è online
	 */
	public boolean checkIfOnline(Bacheca myBacheca) throws Exception
	{
		System.setProperty("java.security.policy",Main.PATH_SECURITY);
		System.setSecurityManager(new RMISecurityManager());
		myBacheca = (Bacheca)Naming.lookup(Main.service_BACHECA);
	    boolean online = false;
	    try {
	    	online = myBacheca.isOnline();
	    } catch (RemoteException e) {
	        System.out.println(e.getMessage());
	        return false;
	    } catch (NotBoundException e) {
	        System.out.println(e.getMessage());
	        return false;
	    } catch (UnknownHostException e) {
	        e.printStackTrace();
	    }
	    return online;

	}

	/*
	 * Controlla se il server è online
	 */
	public boolean checkIfOnline(NuoveAmicizie myNuoviAmici) throws Exception
	{
		System.setProperty("java.security.policy",Main.PATH_SECURITY);
		System.setSecurityManager(new RMISecurityManager());
		myNuoviAmici = (NuoveAmicizie)Naming.lookup(Main.service_NUOVI_AMICI);
	    boolean online = false;
	    try {
	    	online = myNuoviAmici.isOnline();
	    } catch (RemoteException e) {
	        System.out.println(e.getMessage());
	        return false;
	    } catch (NotBoundException e) {
	        System.out.println(e.getMessage());
	        return false;
	    } catch (UnknownHostException e) {
	        e.printStackTrace();
	    }
	    return online;

	}
}


text:
#pragma once
#include "PHCharacter.h"
#include "Physics.h"
#include "MathUtils.h"
#include "ElevatorState.h"
#include "IColisiondamageInfo.h"
#include "GameMtlLib.h"
namespace ALife {
	enum EHitType;
};
#ifdef DEBUG
#include "PHDebug.h"
#endif

class CPHSimpleCharacter :
	public CPHCharacter,
	ICollisionDamageInfo
{

	friend class CScriptActor;
private:
	collide::rq_results		RQR;

protected:
	CElevatorState			m_elevator_state;
	////////////////////////////damage////////////////////////////////////////
	struct SCollisionDamageInfo
	{
										SCollisionDamageInfo		()										;
				void					Construct					()										;
				float					ContactVelocity				()				const					;
				void					HitDir						(Fvector &dir)	const					;
			IC	const Fvector&			HitPos						()				const					{return cast_fv(m_damege_contact.geom.pos);}
				void					Reinit						()										;
				dContact				m_damege_contact;
				SCollisionHitCallback	*m_hit_callback;
				u16						m_obj_id;
				float					m_dmc_signum;
				enum{ctStatic,ctObject}	m_dmc_type;
		mutable	float					m_contact_velocity;
	};
	SCollisionDamageInfo		m_collision_damage_info;
	/////////////////////////// callback
	ObjectContactCallbackFun*	m_object_contact_callback;
	////////////////////////// geometry
	Fvector m_last_move;
	dGeomID m_geom_shell;
	dGeomID m_wheel;
	dGeomID m_hat;
	dGeomID	m_cap;

	dGeomID m_hat_transform;
	dGeomID m_wheel_transform;
	dGeomID m_shell_transform;
	dGeomID m_cap_transform;

	dSpaceID m_space;

	dReal m_radius;
	dReal m_cyl_hight;
	///////////////////////////////////
	dJointID m_capture_joint;
	dJointFeedback m_capture_joint_feedback;
	////////////////////////// movement
	dVector3 m_control_force;
	Fvector	 m_acceleration;
	Fvector  m_cam_dir;
	dVector3 m_wall_contact_normal;
	dVector3 m_ground_contact_normal;
	dVector3 m_clamb_depart_position;
	dVector3 m_depart_position;
	dVector3 m_wall_contact_position;
	dVector3 m_ground_contact_position;
	dReal	 jump_up_velocity;//=6.0f;//5.6f;
	dReal	 m_collision_damage_factor;
	dReal	 m_max_velocity;

	float   m_air_control_factor;

	dVector3 m_jump_depart_position;
	dVector3 m_death_position;
	Fvector  m_jump_accel;

	//movement state
	bool is_contact					;
	bool was_contact				;
	bool b_depart					;
	bool b_meet						;
	bool b_side_contact				;
	bool b_was_side_contact			;
	bool b_any_contacts				;
	bool b_air_contact_state		;

	bool b_valide_ground_contact	;
	bool b_valide_wall_contact		;
	bool b_on_object				;
	bool b_was_on_object			;
	bool b_on_ground				;
	bool b_lose_ground				;
	bool b_collision_restrictor_touch;
	u32  m_contact_count			;

	bool	is_control					;
	bool	b_meet_control				;
	bool	b_lose_control				;
	bool	was_control				;
	bool	b_stop_control				;
	bool	b_depart_control			;
	bool	b_jump						;
	bool	b_jumping					;
	bool	b_clamb_jump				;
	bool	b_external_impulse			;
	u64		m_ext_impuls_stop_step		;
	Fvector m_ext_imulse				;
	bool	b_death_pos					;
	bool	b_foot_mtl_check			;
	dReal	m_friction_factor;

public:
							CPHSimpleCharacter					()									;
	virtual					~CPHSimpleCharacter					()						{Destroy();}

	/////////////////CPHObject//////////////////////////////////////////////
	virtual		void		PhDataUpdate						(dReal step)						;
	virtual		void		PhTune								(dReal step)						;
	virtual		void		InitContact							(dContact* c,bool &do_collide,u16 /*material_idx_1*/,u16 /*material_idx_2*/)		;
	virtual		dSpaceID	dSpace								()									{return m_space;}
	virtual		dGeomID		dSpacedGeom							()									{return (dGeomID)m_space;}
	virtual		void		get_spatial_params					()									;
	IC			dReal		get_jump_up_velocity				()									{ return jump_up_velocity; }
	/////////////////CPHCharacter////////////////////////////////////////////
public:
	//update

	//Check state
	virtual		bool			 		ContactWas						()					{if(b_meet_control) {b_meet_control=false;return true;} else return false;}
	virtual		EEnvironment	 		CheckInvironment				()					;
	virtual		void			 		GroundNormal					(Fvector &norm)		;
	virtual		const ICollisionDamageInfo	*CollisionDamageInfo ()const {return this;}
private:
	virtual		float			 	ContactVelocity				()const				{return m_collision_damage_info.ContactVelocity();}
	virtual		void			 	HitDir							(Fvector& dir)const	{return m_collision_damage_info.HitDir(dir);}
	virtual		const Fvector&	 	HitPos							()const				{return m_collision_damage_info.HitPos();}
	virtual		u16				 	DamageInitiatorID				()const				;
	virtual		CObject			 	*DamageInitiator				()const				;
	virtual		ALife::EHitType	 	HitType							()const				;
	virtual SCollisionHitCallback	*HitCallback					()const				;
	virtual		void				Reinit							()					{m_collision_damage_info.Reinit();};
public:
	//Creating
	virtual		void		Create								(dVector3 sizes)	;
	virtual		void		Destroy								(void)				;
	virtual		void		Disable								()					;
	virtual		void 		EnableObject						(CPHObject* obj)	;
	virtual		void		Enable								()					;
	virtual		void		SetBox								(const dVector3 &sizes);
	virtual		bool		UpdateRestrictionType				(CPHCharacter* ach);
	//get-set
	virtual		void		SetObjectContactCallback			(ObjectContactCallbackFun* callback);
	virtual		void		SetWheelContactCallback				(ObjectContactCallbackFun* callback);
private:
				void		RemoveObjectContactCallback			(ObjectContactCallbackFun* callback);
				void		AddObjectContactCallback			(ObjectContactCallbackFun* callback);
static			void		TestRestrictorContactCallbackFun	(bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2);
public:
	virtual		ObjectContactCallbackFun* ObjectContactCallBack	();
	void					SetStaticContactCallBack			(ContactCallbackFun* calback);
	virtual		void		SwitchOFFInitContact				()					;
	virtual		void		SwitchInInitContact					()					;
	virtual		void		SetAcceleration						(Fvector accel)		;
	virtual		Fvector		GetAcceleration						()					{ return m_acceleration; };
	virtual     void		SetCamDir							(const Fvector& cam_dir);
	virtual	const Fvector&	CamDir								()const				{return m_cam_dir;}
	virtual		void		SetMaterial							(u16 material)		;
	virtual		void		SetPosition							(Fvector pos)		;
	virtual		void		GetVelocity							(Fvector& vvel)		;
	virtual		void		GetSmothedVelocity					(Fvector& vvel)		;
	virtual		void		SetVelocity							(Fvector vel)		;
	virtual		void		SetAirControlFactor					(float factor)		{m_air_control_factor=factor;}
	virtual		void		SetElevator							(CClimableObject* climable){m_elevator_state.SetElevator(climable);};
	virtual	CElevatorState	*ElevatorState						()					;
	virtual		void		SetCollisionDamageFactor			(float f)			{m_collision_damage_factor=f;}
	virtual		void		GetPosition							(Fvector& vpos)		;
	virtual		void		GetPreviousPosition					(Fvector& pos)		;
	virtual		float		FootRadius							()					;
	virtual		void		DeathPosition						(Fvector& deathPos)	;
	virtual		void		IPosition							(Fvector& pos)		;
	virtual		u16			ContactBone							();
	virtual		void		ApplyImpulse						(const Fvector& dir, const dReal P);
	virtual		void		ApplyForce							(const Fvector& force);
	virtual		void		ApplyForce							(const Fvector& dir,float force);
	virtual		void		ApplyForce							(float x,float y, float z);
	virtual		void		AddControlVel						(const Fvector& vel);
	virtual		void		SetMaximumVelocity					(dReal vel)			{m_max_velocity=vel;}
	virtual		dReal		GetMaximumVelocity					()					{ return m_max_velocity;}
	virtual		void		SetJupmUpVelocity					(dReal velocity)	{jump_up_velocity=velocity;}
	virtual		bool		JumpState							()					{
																				return b_jumping||b_jump;
																					};
	virtual	const Fvector&  ControlAccel						()const				{return m_acceleration;}
	virtual		bool		TouchRestrictor						(ERestrictionType rttype);
	virtual		float		&FrictionFactor						()					{return m_friction_factor;}
	virtual		void		SetMas								(dReal mass)		;
	virtual		float		Mass								()					{return m_mass;};
	virtual		void		SetPhysicsRefObject					(CPhysicsShellHolder* ref_object);

	virtual		void		CaptureObject						(dBodyID body,const dReal* anchor);
	virtual		void		CapturedSetPosition					(const dReal* position);
	virtual		void		doCaptureExist						(bool&	do_exist);

	virtual		void		get_State							(		SPHNetState&	state)								;
	virtual		void		set_State							(const	SPHNetState&	state)								;
	virtual		void		ValidateWalkOn						();
	bool		ValidateWalkOnMesh					()			;
	bool		ValidateWalkOnObject				()			;
private:
	void		CheckCaptureJoint					()			;
	void		ApplyAcceleration					()			;

	u16			RetriveContactBone					()			;
	void		SafeAndLimitVelocity				()			;
	void		UpdateStaticDamage					(dContact* c,SGameMtl* tri_material,bool bo1);
	void		UpdateDynamicDamage					(dContact* c,u16 obj_material_idx,dBodyID b,bool bo1);
IC	void 		FootProcess							(dContact* c,bool &do_collide ,bool bo);
IC	void		foot_material_update				(u16	tri_material,u16	foot_material_idx);
	static void	TestPathCallback(bool& do_colide,bool bo1,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/);
public:
#ifdef DEBUG
	virtual		void		OnRender							()					;
#endif
};

const dReal def_spring_rate=0.5f;
const dReal def_dumping_rate=20.1f;


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

namespace inbox_net
{
    public static class Utilities
    {
        public static string Url_Concat(string url, Dictionary<string, object> args, string fragments = null)
        {
            if (args == null && fragments == null)
            {
                return url;
            }

            // Strip off hashes
            char[] trimChars = {'#'};
            url = url.TrimEnd(trimChars);

            string fragment_tail = "";
            if (fragments != null)
            {
                fragment_tail = "#" + WebUtility.UrlEncode(fragments);
            }

            string args_tail = "";
            if (args != null)
            {
                foreach (var item in args)
                {
                    if (url[url.Length - 1] != '?' || url[url.Length - 1] != '&')
                    {
                        args_tail += url.Contains("?") ? "&" : "?";
                    }
                    args_tail += string.Format("{0}={1}", item.Key, WebUtility.UrlEncode(item.Value.ToString()));
                }
            }

            return url + args_tail + fragment_tail;
        }

        public static string generate_id(int length)
        {
            string guidResult = string.Empty;

            while (guidResult.Length < length)
            {
                // Get the GUID.
                guidResult += Guid.NewGuid().ToString().GetHashCode().ToString("x");
            }

            // Make sure length is valid.
            if (length <= 0 || length > guidResult.Length)
                throw new ArgumentException("Length must be between 1 and " + guidResult.Length);

            // Return the first length bytes.
            return guidResult.Substring(0, length);
        }

        public static byte[] GetBytes(string str)
        {
            byte[] bytes = new byte[str.Length * sizeof(char)];
            System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
            return bytes;
        }

        public static string GetString(byte[] bytes)
        {
            char[] chars = new char[bytes.Length / sizeof(char)];
            System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
            return new string(chars);
        }
    }
}


text:
package org.asteriskjava.manager.event;

/**
 * An AgentConnectEvent is triggered when a caller is connected to an agent.
 *

 * It is implemented in apps/app_queue.c.
 *

 * Available since Asterisk 1.2
 *
 * @author srt
 * @version $Id$
 * @since 0.2
 */
public class AgentConnectEvent extends AbstractAgentEvent {
    /**
     * Serial version identifier.
     */
    private static final long serialVersionUID = 0L;

    private Long holdTime;
    private String bridgedChannel;
    private Long ringtime;

    private String destExten;
    private String destChannelStateDesc;
    private String destUniqueId;
    private String destConnectedLineNum;
    private String destConnectedLineName;
    private String destCallerIdName;
    private String destCallerIdNum;
    private String destContext;
    private String destPriority;
    private String destChannel;
    private String destChannelState;
    private String iface;
    private String destAccountCode;
    private String linkedId;
    private String destLinkedId;
    private String destLanguage;
    private String language;

    private String accountcode;

    public AgentConnectEvent(Object source) {
        super(source);
    }

    /**
     * Returns the amount of time the caller was on hold.
     *
     * @return the amount of time the caller was on hold in seconds.
     */
    public Long getHoldTime() {
        return holdTime;
    }

    /**
     * Sets the amount of time the caller was on hold.
     *
     * @param holdtime the amount of time the caller was on hold in seconds.
     */
    public void setHoldTime(Long holdtime) {
        this.holdTime = holdtime;
    }

    /**
     * Returns the unique ID of the queue member channel that is taking the
     * call. This is useful when trying to link recording filenames back to a
     * particular call from the queue.
     *

     * Available since Asterisk 1.4.
     *
     * @return the unique ID of the queue member channel that is taking the
     * call.
     */
    public String getBridgedChannel() {
        return bridgedChannel;
    }

    /**
     * Sets the unique ID of the queue member channel that is taking the call.
     *
     * @param bridgedChannel the unique ID of the queue member channel that is
     *                       taking the call.
     */
    public void setBridgedChannel(String bridgedChannel) {
        this.bridgedChannel = bridgedChannel;
    }

    /**
     * Returns the amount of time the agent's channel was ringing before
     * answered.
     *

     * Available since Asterisk 1.6.
     *
     * @return the amount of time the agent's channel was ringing before
     * answered in seconds.
     * @since 1.0.0
     */
    public Long getRingtime() {
        return ringtime;
    }

    public void setRingtime(Long ringtime) {
        this.ringtime = ringtime;
    }

    /**
     * @return the destExten
     */
    public String getDestExten() {
        return destExten;
    }

    /**
     * @param destExten the destExten to set
     */
    public void setDestExten(String destExten) {
        this.destExten = destExten;
    }

    /**
     * @return the destChannelStateDesc
     */
    public String getDestChannelStateDesc() {
        return destChannelStateDesc;
    }

    /**
     * @param destChannelStateDesc the destChannelStateDesc to set
     */
    public void setDestChannelStateDesc(String destChannelStateDesc) {
        this.destChannelStateDesc = destChannelStateDesc;
    }

    /**
     * @return the destUniqueId
     */
    public String getDestUniqueId() {
        return destUniqueId;
    }

    /**
     * @param destUniqueId the destUniqueId to set
     */
    public void setDestUniqueId(String destUniqueId) {
        this.destUniqueId = destUniqueId;
    }

    /**
     * @return the destConnectedLineNum
     */
    public String getDestConnectedLineNum() {
        return destConnectedLineNum;
    }

    /**
     * @param destConnectedLineNum the destConnectedLineNum to set
     */
    public void setDestConnectedLineNum(String destConnectedLineNum) {
        this.destConnectedLineNum = destConnectedLineNum;
    }

    /**
     * @return the destConnectedLineName
     */
    public String getDestConnectedLineName() {
        return destConnectedLineName;
    }

    /**
     * @param destConnectedLineName the destConnectedLineName to set
     */
    public void setDestConnectedLineName(String destConnectedLineName) {
        this.destConnectedLineName = destConnectedLineName;
    }

    /**
     * @return the destCallerIdName
     */
    public String getDestCallerIdName() {
        return destCallerIdName;
    }

    /**
     * @param destCallerIdName the destCallerIdName to set
     */
    public void setDestCallerIdName(String destCallerIdName) {
        this.destCallerIdName = destCallerIdName;
    }

    /**
     * @return the destCallerIdNum
     */
    public String getDestCallerIdNum() {
        return destCallerIdNum;
    }

    /**
     * @param destCallerIdNum the destCallerIdNum to set
     */
    public void setDestCallerIdNum(String destCallerIdNum) {
        this.destCallerIdNum = destCallerIdNum;
    }

    /**
     * @return the destContext
     */
    public String getDestContext() {
        return destContext;
    }

    /**
     * @param destContext the destContext to set
     */
    public void setDestContext(String destContext) {
        this.destContext = destContext;
    }

    /**
     * @return the destPriority
     */
    public String getDestPriority() {
        return destPriority;
    }

    /**
     * @param destPriority the destPriority to set
     */
    public void setDestPriority(String destPriority) {
        this.destPriority = destPriority;
    }

    /**
     * @return the destChannel
     */
    public String getDestChannel() {
        return destChannel;
    }

    /**
     * @param destChannel the destChannel to set
     */
    public void setDestChannel(String destChannel) {
        this.destChannel = destChannel;
    }

    /**
     * @return the destChannelState
     */
    public String getDestChannelState() {
        return destChannelState;
    }

    /**
     * @param destChannelState the destChannelState to set
     */
    public void setDestChannelState(String destChannelState) {
        this.destChannelState = destChannelState;
    }

    /**
     * @return the iface
     */
    public String getInterface() {
        return iface;
    }

    /**
     * @param iface the iface to set
     */
    public void setInterface(String iface) {
        this.iface = iface;
    }

    public String getDestAccountCode() {
        return destAccountCode;
    }

    public void setDestAccountCode(String destAccountCode) {
        this.destAccountCode = destAccountCode;
    }

    public String getLinkedId() {
        return linkedId;
    }

    public void setLinkedId(String linkedId) {
        this.linkedId = linkedId;
    }

    public String getDestLinkedId() {
        return destLinkedId;
    }

    public void setDestLinkedId(String destLinkedId) {
        this.destLinkedId = destLinkedId;
    }

    public String getDestLanguage() {
        return destLanguage;
    }

    public void setDestLanguage(String destLanguage) {
        this.destLanguage = destLanguage;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getAccountcode() {
        return accountcode;
    }

    public void setAccountcode(String accountcode) {
        this.accountcode = accountcode;
    }
}


text:
using System;

namespace Zirpl.Stats.EloRating
{
    public class EloRatingEngine
    {
        public EloRatingEngine()
        {
            this.KValue = 120;
            this.PowerOfTenFactor = 400;
            this.ChangeDigits = 0;
        }

        public double KValue { get; set; }
        public double PowerOfTenFactor { get; set; }
        public int ChangeDigits { get; set; }

        public EloMatchResult Calculate(EloMatch match)
        {
            EloMatchResult result = new EloMatchResult();

            // http://en.wikipedia.org/wiki/Elo_rating_system

            // Ea = 1 / (1 + 10 ^ ((Rb - Ra) / Pf))     // Expected Score
            // Pa = K * (Sa - Ea)                       // Point change
            // R'a = Ra + Pa                            // New Rating

            // Eb = 1 / (1 + 10 ^ ((Ra - Rb) / Pf))     // Expected Score
            // Pb = K * (Sb - Eb)                       // Point change
            // R'b = Rb + Pb                            // New Rating

            double E1 = 1 / (1 + Math.Pow(10, (match.Team2CurrentRating - match.Team1CurrentRating) / this.PowerOfTenFactor));
            //double E2 = 1 / (1 + Math.Pow(10, (match.Team1CurrentRating - match.Team2CurrentRating) / this.PowerOfTenFactor));
            double E2 = (double)1 - E1;

            // Win gets 1, tie gets .5, loss gets 0
            double S1 = match.Team1MatchScore.Equals(match.Team2MatchScore)
                            ? .5
                            : (match.Team1MatchScore > match.Team2MatchScore ? 1 : 0);
            double S2 = match.Team1MatchScore.Equals(match.Team2MatchScore)
                            ? .5
                            : (match.Team2MatchScore > match.Team1MatchScore ? 1 : 0);

            double P1 = Math.Round(this.KValue*(S1 - E1), this.ChangeDigits);
            //double P2 = this.KValue*(S2 - E2);
            double P2 = (double) -1*P1;

            double R1New = match.Team1CurrentRating + P1;
            double R2New = match.Team2CurrentRating + P2;

            result.Team1NewRating = R1New;
            result.Team2NewRating = R2New;
            result.Team1MatchPoints = P1;
            result.Team2MatchPoints = P2;

            // HOW TO USE: (but this test actually fails)
            //    EloRating1 eloRating = new EloRating1(1500, 100, 0, 1);
            //    EloRatingEngine rating = new EloRatingEngine();
            //    rating.KValue = 120;
            //    rating.PowerOfTenFactor = 400;
            //    EloMatch match = new EloMatch()
            //                         {
            //                             Team1CurrentRating = 1500,
            //                             Team2CurrentRating = 100,
            //                             Team1MatchScore = 0,
            //                             Team2MatchScore = 1
            //                         };
            //    EloMatchResult result = rating.Calculate(match);
            //    Assert.AreEqual(1560, result.Team1NewRating);
            //    Assert.AreEqual(1440, result.Team2NewRating);
            //    Assert.AreEqual(60, result.Team1MatchPoints);
            //    Assert.AreEqual(-60, result.Team2MatchPoints);

            return result;
        }
    }
}


text: Todos os direitos reservados a Xulipa SoftWorks.


text:
/**
 *  @file      camera.hpp
 *  @brief     Camera class definition
 *  @details   Definition of the ROS Camera support methods.
 *  @author    Patrick Nolan (patnolan33)
 *  @copyright BSD
 */

#include <string>
#include <vector>
#include <stdlib.h>
#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <enpm808_final/takeImageService.h>

/**
 * @brief Camera class handles viewing onboard imagery and taking images
 */
class Camera {
 public:
  /**
   * @brief Camera constructor
   */
  Camera();

  /**
   * @brief Set the image flag so that the next time a camera topic is seen, we take a picture
   */
  bool takeImage(enpm808_final::takeImageService::Request &req,
                 enpm808_final::takeImageService::Response &resp);

  /**
   * @brief Camera topic callback takes a picture if flag has been set
   */
  void cameraCallback(const sensor_msgs::ImageConstPtr& msg);

  std::vector<std::string> getSavedImageFilenames() {
    return savedImages;
  }
  ;

 private:
  /**
   * @brief container for the filenames of each saved image
   */
  std::vector<std::string> savedImages;

  /**
   * @brief Flag denoting whether or not to take an image on next receipt of camera topic
   */
  bool takeImageFlag;

  /**
   * @brief Container for takeImage service
   */
  ros::ServiceClient cameraClient;

  /**
   * @brief Node handler for subscribing to service and topics
   */
  ros::NodeHandle nh;
};


text:
class Admin < ApplicationRecord
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :invitable, :database_authenticatable,
         :recoverable, :rememberable, :trackable, :validatable

  VALID_PHONE_REGEX = /\A[0]\d{10}\Z/i
  validates :phone, presence: true, format: { with: VALID_PHONE_REGEX }
  validates :firstname, presence: true, length: {maximum: 255}
  validates :lastname, presence: true, length: {maximum: 255}
  validates :dob, presence:true
  validates :gender, presence: true

  enum gender: {
    male: 0,
    female: 1
  }
end


text: !function(a){return void 0}()


text:
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet">
    <title>Famous Stories</title>

Let's hear some stories!

    {{ story | stringify }}

    {{ story | stringify }}

  <button class="btn btn-default" v-on:click="reverseOrder">Reverse Order</button>

  {{ $data }}


text:
package com.eftimoff.androidplayer.actions.property;

import android.view.View;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;

import com.eftimoff.androidplayer.actions.BaseAction;
import com.nineoldandroids.view.ViewHelper;
import com.nineoldandroids.view.ViewPropertyAnimator;

/**
 * Action that animates the properties of the view.
 * <p/>
 * Created by georgi.eftimov on 4/15/2015.
 */
public class PropertyAction extends BaseAction {

    private float fromTranslationX = 0;
    private float toTranslationX = 0;
    private float fromTranslationY = 0;
    private float toTranslationY = 0;
    private float fromScaleY = 1f;
    private float toScaleY = 1f;
    private float fromScaleX = 1f;
    private float toScaleX = 1f;
    private float fromAlpha = 1f;
    private float toAlpha = 1f;
    private float fromRotation;
    private float toRotation;

    @Override
    public void init(View view) {
        setToTranslationX(ViewHelper.getTranslationX(view));
        ViewHelper.setTranslationX(view, getTranslationX());
        setToTranslationY(ViewHelper.getTranslationY(view));
        ViewHelper.setTranslationY(view, getTranslationY());
        setToScaleX(ViewHelper.getScaleX(view));
        ViewHelper.setScaleX(view, getScaleX());
        setToScaleY(ViewHelper.getScaleY(view));
        ViewHelper.setScaleY(view, getScaleY());
        setToAlpha(ViewHelper.getAlpha(view));
        ViewHelper.setAlpha(view, getAlpha());
        setToRotation(ViewHelper.getRotation(view));
        ViewHelper.setRotation(view, getRotation());
    }

    @Override
    public void animate(View view) {
        ViewPropertyAnimator
                .animate(view)
                .translationX(toTranslationX).
                translationY(toTranslationY).
                scaleY(toScaleY).
                scaleX(toScaleX).
                alpha(toAlpha).
                rotation(toRotation).
                setDuration(getDuration()).
                setStartDelay(getDelay()).
                setInterpolator(getInterpolator()).
                start();
    }

    private PropertyAction(Builder builder) {
        super(builder.view);
        setDuration(builder.duration);
        setDelay(builder.delay);
        setAnimateAlone(builder.animateAlone);
        setInterpolator(builder.interpolator);
        this.fromTranslationX = builder.fromTranslationX;
        this.toTranslationX = builder.toTranslationX;
        this.fromTranslationY = builder.fromTranslationY;
        this.toTranslationY = builder.toTranslationY;
        this.fromScaleY = builder.fromScaleY;
        this.toScaleY = builder.toScaleY;
        this.fromScaleX = builder.fromScaleX;
        this.toScaleX = builder.toScaleX;
        this.fromAlpha = builder.fromAlpha;
        this.toAlpha = builder.toAlpha;
        this.fromRotation = builder.rotation;
    }

    public static Builder newPropertyAction(final View view) {
        return new Builder(view);
    }

    public float getTranslationX() {
        return fromTranslationX;
    }

    private void setFromTranslationX(float fromTranslationX) {
        this.fromTranslationX = fromTranslationX;
    }

    private void setToTranslationX(float toTranslationX) {
        this.toTranslationX = toTranslationX;
    }

    public float getTranslationY() {
        return fromTranslationY;
    }

    private void setFromTranslationY(float fromTranslationY) {
        this.fromTranslationY = fromTranslationY;
    }

    private void setToTranslationY(float toTranslationY) {
        this.toTranslationY = toTranslationY;
    }

    public float getScaleY() {
        return fromScaleY;
    }

    private void setFromScaleY(float fromScaleY) {
        this.fromScaleY = fromScaleY;
    }

    private void setToScaleY(float toScaleY) {
        this.toScaleY = toScaleY;
    }

    public float getScaleX() {
        return fromScaleX;
    }

    private void setFromScaleX(float fromScaleX) {
        this.fromScaleX = fromScaleX;
    }

    private void setToScaleX(float toScaleX) {
        this.toScaleX = toScaleX;
    }

    public float getAlpha() {
        return fromAlpha;
    }

    private void setFromAlpha(float fromAlpha) {
        this.fromAlpha = fromAlpha;
    }

    private void setToAlpha(float toAlpha) {
        this.toAlpha = toAlpha;
    }

    private void setToRotation(float toRotation) {
        this.toRotation = toRotation;
    }

    public float getRotation() {
        return fromRotation;
    }

    private void setFromRotation(float fromRotation) {
        this.fromRotation = fromRotation;
    }

    public static final class Builder {
        private View view;
        private boolean animateAlone;
        private int duration = 300;
        private int delay = 0;
        private Interpolator interpolator = new LinearInterpolator();
        private float fromTranslationX = 0;
        private float toTranslationX = 0;
        private float fromTranslationY = 0;
        private float toTranslationY = 0;
        private float fromScaleY = 1f;
        private float toScaleY = 1f;
        private float fromScaleX = 1f;
        private float toScaleX = 1f;
        private float fromAlpha = 1f;
        private float toAlpha = 1f;
        private float rotation;

        private Builder(final View view) {
            this.view = view;
        }

        public PropertyAction build() {
            return new PropertyAction(this);
        }

        public Builder duration(int duration) {
            this.duration = duration;
            return this;
        }

        public Builder delay(int delay) {
            this.delay = delay;
            return this;
        }

        public Builder translationX(float fromTranslationX) {
            this.fromTranslationX = fromTranslationX;
            return this;
        }

        public Builder translationY(float fromTranslationY) {
            this.fromTranslationY = fromTranslationY;
            return this;
        }

        public Builder scaleY(float fromScaleY) {
            this.fromScaleY = fromScaleY;
            return this;
        }

        public Builder scaleX(float fromScaleX) {
            this.fromScaleX = fromScaleX;
            return this;
        }

        public Builder alpha(float fromAlpha) {
            this.fromAlpha = fromAlpha;
            return this;
        }

        public Builder interpolator(Interpolator interpolator) {
            this.interpolator = interpolator;
            return this;
        }

        public Builder animateAlone(final boolean shouldWait) {
            this.animateAlone = shouldWait;
            return this;
        }

        public Builder rotation(final float rotation) {
            this.rotation = rotation;
            return this;
        }
    }
}


text:
/**
 * \file
 * \brief OCV Star feature detector wrapper
 */

#ifndef MAPTK_DETECT_FEATURES_STAR_H_
#define MAPTK_DETECT_FEATURES_STAR_H_

#include <opencv2/opencv_modules.hpp>
#if ! defined(MAPTK_HAS_OPENCV_VER_3) || defined(HAVE_OPENCV_XFEATURES2D)

#include <memory>
#include <string>

#include <maptk/plugins/ocv/detect_features.h>
#include <maptk/plugins/ocv/maptk_ocv_export.h>

namespace kwiver {
namespace maptk {
namespace ocv {

class MAPTK_OCV_EXPORT detect_features_STAR
  : public vital::algorithm_impl< detect_features_STAR,
                                  ocv::detect_features,
                                  vital::algo::detect_features >
{
public:
  /// Constructor
  detect_features_STAR();

  /// Copy Constructor
  detect_features_STAR(detect_features_STAR const &other);

  /// Destructor
  virtual ~detect_features_STAR();

  /// Return the name of this implementation
  virtual std::string impl_name() const { return "ocv_STAR"; }
  /// Returns a descriptive string for this implementation
  virtual std::string description() const {
    return "OpenCV feature-point detection via the Star algorithm";
  }

  /// Get this algorithm's \link kwiver::vital::config_block configuration block \endlink
  virtual vital::config_block_sptr get_configuration() const;
  /// Set this algorithm's properties via a config block
  virtual void set_configuration(vital::config_block_sptr config);
  /// Check that the algorithm's configuration config_block is valid
  virtual bool check_configuration(vital::config_block_sptr config) const;

private:
  class priv;
  std::unique_ptr<priv> p_;
};

#define MAPTK_OCV_HAS_STAR

} // end namespace ocv
} // end namespace maptk
} // end namespace kwiver

#endif //has OCV support

#endif //MAPTK_DETECT_FEATURES_STAR_H_


text:
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.facade;

import ${package}.entity.Account;
import ${package}.service.AccountService;
import com.google.common.collect.ImmutableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * User: baiqw
 * Date: 14-12-9
 * Time: 下午3:45
 */
public class AccountRestServiceImpl implements AccountRestService {

  private static final Logger logger = LoggerFactory.getLogger(AccountRestServiceImpl.class);

  private AccountService accountService;

  public AccountService getAccountService() {
      return accountService;
  }

  public void setAccountService(AccountService accountService) {
      this.accountService = accountService;
  }

  @Override
  public RestResult signIn(SignInVO signIn) {
      Account account = new Account();
      account.setName(signIn.getName());
      account.setPassword(signIn.getPassword());

      logger.debug("username:{}", signIn.getName());
      Account admin = accountService.signIn(account);

      logger.debug("admin:{}", admin);

      RestResult result = RestResult.OK(ImmutableMap.of("id", 4026, "enterprise", ImmutableMap.of("id", 2, "name", "锐捷网络"),"name","白群伟"));

      return result;
  }

  @Override
  public RestResult signUp(SignUpVO signUp) {
      return null;
  }

}


text:
=============
General FAQs
=============

.. toctree::
   :maxdepth: 1

   can-evs-disks-be-used-alone.md
   can-i-change-the-az-of-my-disk.md
   what-should-i-do-if-an-error-occurs-on-my-evs-disk.md
   why-some-of-my-evs-disks-do-not-have-wwn-information.md
   what-should-i-do-if-my-evs-replication-quotas-are-insufficient-(deprecated).md


text:
"""Google Analytics Admin API sample application which deletes the data
stream from the Google Analytics 4 property.

See https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/properties.dataStreams/delete
for more information.
"""
# [START analyticsadmin_properties_data_streams_delete]
from google.analytics.admin import AnalyticsAdminServiceClient

def run_sample():
    """Runs the sample."""

    # !!! ATTENTION !!!
    #  Running this sample may change/delete your Google Analytics account
    #  configuration. Make sure to not use the Google Analytics property ID from
    #  your production environment below.

    # TODO(developer): Replace this variable with your Google Analytics 4
    #  property ID (e.g. "123456") before running the sample.
    property_id = "YOUR-GA4-PROPERTY-ID"

    # TODO(developer): Replace this variable with your data stream ID
    #  (e.g. "123456") before running the sample.
    stream_id = "YOUR-DATA-STREAM-ID"

    delete_data_stream(property_id, stream_id)

def delete_data_stream(property_id: str, stream_id: str, transport: str = None):
    """
    Deletes the data stream from the Google Analytics 4 property.

    Args:
        property_id(str): The Google Analytics Property ID.
        stream_id(str): The data stream ID.
        transport(str): The transport to use. For example, "grpc"
            or "rest". If set to None, a transport is chosen automatically.
    """
    client = AnalyticsAdminServiceClient(transport=transport)
    client.delete_data_stream(name=f"properties/{property_id}/dataStreams/{stream_id}")
    print("Data stream deleted")

# [END analyticsadmin_properties_data_streams_delete]

if __name__ == "__main__":
    run_sample()


text:
require 'rails_helper'

RSpec.describe FloatSetting do
  before(:each){
    @setting = create :float_setting
  }
  let(:form_field){ :string }
  let(:value){ 8 }
  let(:default){ 1.1 }

  it_behaves_like 'setting'

  it "has a float as value" do
    @setting.value = default
    expect(@setting.value).to eq 1.1
  end

  describe "validation" do
    ['abc', -10.0].each do |value|
      it "is not valid with a value of #{value}" do
        @setting.value = value
        expect(@setting).not_to be_valid
      end

    end

    [0, 1, 2.34].each do |value|
      it "is valid with a value of #{value}" do
        @setting.value = value
        expect(@setting).to be_valid
      end
    end
  end

  describe "form_field_partial" do
    it "is string_with_unit_field if the unit is set" do
      @setting.unit = 'foo'
      expect(@setting.form_field_partial).to eq 'settings/string_with_unit_field'
    end
  end
end


text:
package com.anji.nn.test;

import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import junit.framework.TestCase;

import com.anji.floatingeye.EyeMovementParms;
import com.anji.floatingeye.EyePixelConnection;
import com.anji.floatingeye.FloatingEye;
import com.anji.floatingeye.LocationXConnection;
import com.anji.floatingeye.LocationYConnection;
import com.anji.floatingeye.LocationZConnection;
import com.anji.floatingeye.ThetaConnection;
import com.anji.floatingeye.test.TestNeuron;
import com.anji.imaging.Java2DSurface;
import com.anji.nn.ActivationFunction;
import com.anji.nn.ActivationFunctionFactory;
import com.anji.nn.BiasConnection;
import com.anji.nn.CacheNeuronConnection;
import com.anji.nn.Connection;
import com.anji.nn.Neuron;
import com.anji.nn.NeuronConnection;
import com.anji.nn.Pattern;
import com.anji.nn.RandomConnection;
import com.anji.nn.StepHourglassConnection;

/**
 * @author Philip Tucker
 */
public class MeasureNetTimingTest extends TestCase {

private final static Random rand = new Random();

private static final int CYCLES = 100000000;

private class TestConnection implements Connection {

private double value;

/**
 * @param aValue
 */
public TestConnection( double aValue ) {
	value = aValue;
}

/**
 * @see com.anji.nn.Connection#read()
 */
public double read() {
	return value;
}

/**
 * @see com.anji.nn.Connection#toXml()
 */
public String toXml() {
	return "<TestConnection/>";
}

/**
 * @see com.anji.nn.Connection#cost()
 */
public long cost() {
	return 41;
}

}

/**
 *
 */
public MeasureNetTimingTest() {
	super();
}

/**
 * @param arg0
 */
public MeasureNetTimingTest( String arg0 ) {
	super( arg0 );
}

/**
 * @param func
 * @return ratio of neuron (w/ 1 conn) time to conn time
 */
private double doTestNeuronTimes( ActivationFunction func ) {
	Neuron uut = new Neuron( func );

	// time for neuron w/ single connection
	TestConnection c = new TestConnection( rand.nextDouble() );
	uut.addIncomingConnection( c );

	// 315 for neuron, 115 for neuron cost per conn
	double neuronSingleConnTime = doTestNeuronTime( uut, 315 + 115 + c.cost() + func.cost() );
	System.out.println( "time for " + func.toString() + " neuron w/ single conn == "
			+ neuronSingleConnTime );

	// time added to neuron for each additional connection
	double totalTime = 0.0d;
	int totalExtraConns = 0;
	int maxConns = 100;
	for ( int numConns = 2; numConns < maxConns; ++numConns ) {
		c = new TestConnection( rand.nextDouble() );
		uut.addIncomingConnection( c );
		// 315 for neuron, 115 for neuron cost per conn
		totalTime += doTestNeuronTime( uut, 315 + ( numConns * ( 115 + c.cost() ) ) + func.cost() );
		totalExtraConns += ( numConns - 1 );
	}
	double neuronExtraConnTime = ( totalTime - neuronSingleConnTime ) / totalExtraConns;
	System.out.println( "time for each additonal " + func.toString() + " conn == "
			+ neuronExtraConnTime );

	TestNeuron testNeuron = new TestNeuron();
	testNeuron.setValue( rand.nextDouble() );
	Connection testConnection = new NeuronConnection( testNeuron );
	double connTime = doTestConnectionTime( testConnection, 57, false ) + neuronExtraConnTime;

	double result = neuronSingleConnTime / connTime;
	System.out.println( func.toString() + " ratio neuron:conn == " + result );
	return result;
}

private double doTestFuncTime( ActivationFunction func, long expectedCost ) {
	assertEquals( "wrong cost for " + func.toString(), expectedCost, func.cost() );

	double val = new Random().nextDouble();
	long startTime = System.currentTimeMillis();
	for ( int i = 0; i < CYCLES; ++i ) {
		func.apply( val );
	}
	double duration = (double) ( System.currentTimeMillis() - startTime ) / CYCLES;
	System.out.println( func.toString() + " took " + duration + " millis" );
	return duration;
}

/**
 *
 */
public void testNeuronTimes() {
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getEvSailSigmoid() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getInverseAbs() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getLinear() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getSigmoid() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getTanh() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getTanhCubic() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getStep() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getSignedStep() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getClampedLinear() );
	doTestNeuronTimes( ActivationFunctionFactory.getInstance().getSignedClampedLinear() );
}

/**
 *
 */
public void testFuncTimes() {
	doTestFuncTime( ActivationFunctionFactory.getInstance().getEvSailSigmoid(), 166 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getInverseAbs(), 75 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getLinear(), 42 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getTanh(), 385 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getTanhCubic(), 1231 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getSigmoid(), 497 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getStep(), 40 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getSignedStep(), 40 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getClampedLinear(), 42 );
	doTestFuncTime( ActivationFunctionFactory.getInstance().getSignedClampedLinear(), 42 );
}

/**
 * test connection costs and times
 */
public void testConnectionTimes() {
	doTestConnectionTime( BiasConnection.getInstance(), 41, true );

	List controlNeurons = new ArrayList();
	for ( int i = 0; i < 5; ++i )
		controlNeurons.add( new TestNeuron() );

	// create surface
	BufferedImage bi = new BufferedImage( 10, 10, BufferedImage.TYPE_INT_ARGB );
	Java2DSurface surface = new Java2DSurface();
	surface.setImage( bi );
	for ( int x = 0; x < surface.getWidth(); ++x )
		for ( int y = 0; y < surface.getHeight(); ++y )
			bi.setRGB( x, y, rand.nextInt() | ( 255 << 24 ) );
	surface.setImage( bi );
	FloatingEye eye = new FloatingEye( "test", controlNeurons, surface, 3, new EyeMovementParms(
			0.5d, 0.5d, true, 1.0d, 1.0d, 1.0d, 1.0d ) );

	doTestConnectionTime( new EyePixelConnection( 1, 1, eye ), 821, true );

	doTestConnectionTime( new LocationXConnection( eye ), 41, true );
	doTestConnectionTime( new LocationYConnection( eye ), 41, true );
	doTestConnectionTime( new LocationZConnection( eye ), 41, true );
	doTestConnectionTime( new ThetaConnection( eye ), 41, true );

	TestNeuron n = new TestNeuron();
	n.setValue( rand.nextDouble() );
	doTestConnectionTime( new NeuronConnection( n ), 57, true );

	Pattern p = new Pattern( 1 );
	p.setValue( 0, rand.nextDouble() );
	doTestConnectionTime( p.getConnection( 0 ), 41, true );

	doTestConnectionTime( RandomConnection.getInstance(), 222, true );

	StepHourglassConnection shc = new StepHourglassConnection();
	shc.reset( (int) ( CYCLES * 0.95 ) );
	doTestConnectionTime( shc, 74, true );

	doTestCacheNeuronConnectionTime();
}

private static double doTestConnectionTime( Connection c, long expectedCost, boolean doPrint ) {
	assertEquals( "wrong cost for " + c.getClass().toString(), expectedCost, c.cost() );

	long startTime = System.currentTimeMillis();
	for ( int i = 0; i < CYCLES; ++i )
		c.read();
	double duration = (double) ( System.currentTimeMillis() - startTime ) / CYCLES;
	if ( doPrint )
		System.out.println( c.getClass().toString() + " connection took " + duration + " millis" );
	return duration;
}

private static double doTestCacheNeuronConnectionTime() {
	TestNeuron n = new TestNeuron();
	n.setValue( rand.nextDouble() );
	CacheNeuronConnection c = new CacheNeuronConnection( n );

	assertEquals( "wrong cost for " + c.getClass().toString(), 159, c.cost() );

	long startTime = System.currentTimeMillis();
	for ( int i = 0; i < CYCLES; ++i ) {
		c.read();
		c.step();
	}
	double duration = (double) ( System.currentTimeMillis() - startTime ) / CYCLES;
	System.out.println( c.getClass().toString() + " connection took " + duration + " millis" );
	return duration;
}

private static double doTestNeuronTime( Neuron n, long expectedCost ) {
	assertEquals( "wrong cost for " + n.getClass().toString(), expectedCost, n.cost() );

	long startTime = System.currentTimeMillis();
	for ( int i = 0; i < CYCLES; ++i ) {
		n.getValue();
		n.step();
	}
	double duration = (double) ( System.currentTimeMillis() - startTime ) / CYCLES;
	return duration;
}
}


text:
<?php

// Include the http provider classes
require_once "osapiCurlProvider.php";
require_once "osapiLocalHttpProvider.php";

/**
 * The osapiHttpProvider class is used to define the HTTP layer that will relay
 * your requests to the remote server.
 *
 * @author Dan Holevoet
 */
abstract class osapiHttpProvider {
  const USER_AGENT = 'osapi 1.0';
}


text:
from Kamaelia.UI.Pygame.Ticker import Ticker
from Kamaelia.Util.PureTransformer import PureTransformer
from Kamaelia.Chassis.Pipeline import Pipeline

def NiceTickerPrefab(**other_ticker_args):
    """Ticker that displays black text on a white background, and transforms
    any non-string arguments passed to it into strings.
    Do not pass in keywords text_height, line_spacing, background_colour,
    outline_colour, or text_colour."""
    return Pipeline(PureTransformer(lambda x: str(x)),
             Ticker(text_height=16, line_spacing=2,
                    background_colour=(255, 255, 245), text_colour=(10,10,10),
                    outline_colour = (0,0,0),
                    **other_ticker_args)
             )


text:
@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!perl
#line 15

use strict;

my $VERSION = sprintf("1.%06d", q$Revision: 13336 $ =~ /(\d+)/o);

use Data::Dumper;
use DBI::ProfileData;
use Getopt::Long;

# default options
my $number         = 10;
my $sort           = 'total';
my $filename       = 'dbi.prof';
my $reverse        = 0;
my $case_sensitive = 0;
my (%match, %exclude);

# get options from command line
GetOptions(
           'version'        => sub { die "dbiprof $VERSION\n" },
           'help'           => sub { exit usage() },
           'number=i'       => \$number,
           'sort=s'         => \$sort,
           'dumpnodes!'     => \my $dumpnodes,
           'reverse'        => \$reverse,
           'match=s'        => \%match,
           'exclude=s'      => \%exclude,
           'case-sensitive' => \$case_sensitive,
           'delete!'        => \my $opt_delete,
) or exit usage();

sub usage {
    print <<EOS;
dbiprof [options] [files]

Reads and merges DBI profile data from files and prints a summary.

files: defaults to $filename

options:

    -number=N        show top N, defaults to $number
    -sort=S          sort by S, defaults to $sort
    -reverse         reverse the sort
    -match=K=V       for filtering, see docs
    -exclude=K=V     for filtering, see docs
    -case_sensitive  for -match and -exclude
    -delete          rename files before reading then delete afterwards
    -version         print version number and exit
    -help            print this help

EOS
    return 1;
}

# list of files defaults to dbi.prof
my @files = @ARGV ? @ARGV : ('dbi.prof');

# instantiate ProfileData object
my $prof = eval {
    DBI::ProfileData->new(
        Files => \@files,
        DeleteFiles => $opt_delete,
    );
};
die "Unable to load profile data: $@\n" if $@;

if (%match) { # handle matches
    while (my ($key, $val) = each %match) {
        if ($val =~ m!^/(.+)/$!) {
            $val = $case_sensitive ? qr/$1/ : qr/$1/i;
        }
        $prof->match($key, $val, case_sensitive => $case_sensitive);
    }
}

if (%exclude) { # handle excludes
    while (my ($key, $val) = each %exclude) {
        if ($val =~ m!^/(.+)/$!) {
            $val = $case_sensitive ? qr/$1/ : qr/$1/i;
        }
        $prof->exclude($key, $val, case_sensitive => $case_sensitive);
    }
}

# sort the data
$prof->sort(field => $sort, reverse => $reverse);

# all done, print it out
if ($dumpnodes) {
    $Data::Dumper::Indent    = 1;
    $Data::Dumper::Terse     = 1;
    $Data::Dumper::Useqq     = 1;
    $Data::Dumper::Deparse   = 0;
    print Dumper($prof->nodes);
}
else {
    print $prof->report(number => $number);
}
exit 0;

__END__

=head1 NAME

dbiprof - command-line client for DBI::ProfileData

=head1 SYNOPSIS

See a report of the ten queries with the longest total runtime in the
profile dump file F<prof1.out>:

 dbiprof prof1.out

See the top 10 most frequently run queries in the profile file
F<dbi.prof> (the default):

  dbiprof --sort count

See the same report with 15 entries:

  dbiprof --sort count --number 15

=head1 DESCRIPTION

This tool is a command-line client for the DBI::ProfileData.  It
allows you to analyze the profile data file produced by
DBI::ProfileDumper and produce various useful reports.

=head1 OPTIONS

This program accepts the following options:

=over 4

=item --number N

Produce this many items in the report.  Defaults to 10.  If set to
"all" then all results are shown.

=item --sort field

Sort results by the given field. Sorting by multiple fields isn't currently
supported (patches welcome).  The available sort fields are:

=over 4

=item total

Sorts by total time run time across all runs.  This is the default
sort.

=item longest

Sorts by the longest single run.

=item count

Sorts by total number of runs.

=item first

Sorts by the time taken in the first run.

=item shortest

Sorts by the shortest single run.

=item key1

Sorts by the value of the first element in the Path, which should be numeric.
You can also sort by C<key2> and C<key3>.

=back

=item --reverse

Reverses the selected sort.  For example, to see a report of the
shortest overall time:

  dbiprof --sort total --reverse

=item --match keyN=value

Consider only items where the specified key matches the given value.
Keys are numbered from 1.  For example, let's say you used a
DBI::Profile Path of:

  [ DBIprofile_Statement, DBIprofile_Methodname ]

And called dbiprof as in:

  dbiprof --match key2=execute

Your report would only show execute queries, leaving out prepares,
fetches, etc.

If the value given starts and ends with slashes (C</>) then it will be
treated as a regular expression.  For example, to only include SELECT
queries where key1 is the statement:

  dbiprof --match key1=/^SELECT/

By default the match expression is matched case-insensitively, but
this can be changed with the --case-sensitive option.

=item --exclude keyN=value

Remove items for where the specified key matches the given value.  For
example, to exclude all prepare entries where key2 is the method name:

  dbiprof --exclude key2=prepare

Like C<--match>, If the value given starts and ends with slashes
(C</>) then it will be treated as a regular expression.  For example,
to exclude UPDATE queries where key1 is the statement:

  dbiprof --match key1=/^UPDATE/

By default the exclude expression is matched case-insensitively, but
this can be changed with the --case-sensitive option.

=item --case-sensitive

Using this option causes --match and --exclude to work
case-sensitively.  Defaults to off.

=item --delete

Sets the C<DeleteFiles> option to L<DBI::ProfileData> which causes the
files to be deleted after reading. See L<DBI::ProfileData> for more details.

=item --dumpnodes

Print the list of nodes in the form of a perl data structure.
Use the C<-sort> option if you want the list sorted.

=item --version

Print the dbiprof version number and exit.

=back

=head1 AUTHOR

Sam Tregar <sam@tregar.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2002 Sam Tregar

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl 5 itself.

=head1 SEE ALSO

L<DBI::ProfileDumper|DBI::ProfileDumper>,
L<DBI::Profile|DBI::Profile>, L<DBI|DBI>.

=cut

__END__
:endofperl