text:
import superagent from 'superagent';
import { normalize } from 'normalizr';
import { isUrl } from 'utils/validation';
import { changeHttpToHttpsIfBrowserLocationIsHttps } from 'utils/transformUrl';
import config from '../config';
import { apiPath, apiPort, apiHost } from '../constants/defaults';
import Cookies from 'cookies-js';

const methods = ['get', 'post', 'put', 'patch', 'del'];

function formatUrl(path) {
  if (isUrl(path)) return path;
  const adjustedPath = path[0] !== '/' ? '/' + path : path;
  if (__SERVER__) {
    // Prepend host and port of the API server to the path.
    return 'http://localhost:' + config.apiPort + apiPath + adjustedPath;
  }
  if (process.env.APIHOST === 'localhost') {
    return 'http://localhost:' + apiPort + apiPath + adjustedPath;
  }
  return 'http://' + process.env.APIHOST + apiPath + adjustedPath;
}

function addMethodQuery(path, method) {
  if (method === 'patch') return path + '?_method=PATCH';
  if (method === 'put') return path + '?_method=PUT';
  if (method === 'del') return path + '?_method=DELETE';
  return path;
}

// Extracts the next page URL from response API response.
function getNextPageUrl(response) {
  const link = changeHttpToHttpsIfBrowserLocationIsHttps(response.next);
  if (!link) {
    return null;
  }
  delete response.next;
  return link;
}

function getPrevPageUrl(response) {
  const link = changeHttpToHttpsIfBrowserLocationIsHttps(response.previous);
  if (!link) {
    return null;
  }
  delete response.previous;
  return link;
}

/*
 * This silly underscore is here to avoid a mysterious "ReferenceError: ApiClient is not defined" error.
 * See Issue #14. https://github.com/erikras/react-redux-universal-hot-example/issues/14
 *
 * Remove it at your own risk.
 */
class _ApiClient {
  constructor(req) {
    methods.forEach((method) =>
      this[method] = (path, { params, data, schema } = {}) => new Promise((resolve, reject) => {
        const request = superagent[method](formatUrl(path));
        request.withCredentials();

        if (params) {
          request.query(params);
          if (params.language) {
            request.set({ 'Accept-Language': params.language });
          }
        }
        request.set({
          'accept': 'application/json',
          'Content-Type': 'application/json',
          //'X-Requested-With': 'XMLHttpRequest',
          //'X-HTTP-Method-Override': method
        });

        let csrftoken = null;
        if (__SERVER__ && req.get('cookie')) {
          request.set('cookie', req.get('cookie'));
          // TODO : csrf token get for Server-side Redndering
          // It's not working. Also couldn't call api server in SERVER Environment.
          csrftoken = req.get('cookie').get('csrftoken');
        }
        if (__CLIENT__) {
          csrftoken = Cookies.get('csrftoken');
        }

        if (csrftoken) {
          request.set({
            'X-CSRFToken': csrftoken,
          });
        }

        if (data) {
          request.send(data);
        }

        request.end((err, { body } = {}) => {
          if (err) {
            reject(body || err);
          } else {
            if (!body) {
              resolve(null);
            } else {
              const response = {};
              if (body.next) {
                const nextPageUrl = getNextPageUrl(body);
                Object.assign(response, { nextPageUrl });
              }
              if (body.previous) {
                const prevPageUrl = getPrevPageUrl(body);
                Object.assign(response, { prevPageUrl });
              }
              if (schema) {
                if (body.results) {
                  Object.assign(response, normalize(body.results, schema));
                } else {
                  Object.assign(response, normalize(body, schema));
                }
              } else {
                Object.assign(response, body);
              }
              resolve(response);
            }
          }
        });
      }));
  }
}

const ApiClient = _ApiClient;

export default ApiClient;


text:
FROM alpine:3.5

RUN apk add --no-cache redis

COPY redis.conf /etc/redis.conf

EXPOSE 6379
VOLUME /data

CMD ["redis-server", "/etc/redis.conf"]

redpajama_set_name: RedPajamaGithub


text:
namespace capnp_python {
namespace test {

namespace {

class ThrowingDtorValue {
 public:
  static int numCtor;
  static int numCopy;
  static int numMove;
  static int numDtor;

  ThrowingDtorValue() : moved(false) { numCtor++; }

  ThrowingDtorValue(const ThrowingDtorValue& other) : moved(false) {
    numCopy++;
    KJ_REQUIRE(!other.moved, "Copy from moved value");
  }
  ThrowingDtorValue& operator=(const ThrowingDtorValue& other) {
    numCopy++;
    KJ_REQUIRE(!other.moved, "Copy from moved value");
    return *this;
  }

  ThrowingDtorValue(ThrowingDtorValue&& other) : moved(false) {
    other.moved = true;
    numMove++;
  }

  ~ThrowingDtorValue() noexcept(false) {
    numDtor++;
    KJ_REQUIRE(moved, "Test dtor throw");
  }

  bool moved;
};

int ThrowingDtorValue::numCtor = 0;
int ThrowingDtorValue::numCopy = 0;
int ThrowingDtorValue::numMove = 0;
int ThrowingDtorValue::numDtor = 0;

}  // namespace

void defineValueTypesForTesting(void) {
  boost::python::class_<ThrowingDtorValue, ValueHolder<ThrowingDtorValue>>("ThrowingDtorValue")
      .def_readonly("numCtor", &ThrowingDtorValue::numCtor)
      .def_readonly("numCopy", &ThrowingDtorValue::numCopy)
      .def_readonly("numMove", &ThrowingDtorValue::numMove)
      .def_readonly("numDtor", &ThrowingDtorValue::numDtor);
}

}  // namespace test
}  // namespace capnp_python


text:
#include <aws/AWSMigrationHub/model/ProgressUpdateStreamSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace MigrationHub
{
namespace Model
{

ProgressUpdateStreamSummary::ProgressUpdateStreamSummary() :
    m_progressUpdateStreamNameHasBeenSet(false)
{
}

ProgressUpdateStreamSummary::ProgressUpdateStreamSummary(JsonView jsonValue) :
    m_progressUpdateStreamNameHasBeenSet(false)
{
  *this = jsonValue;
}

ProgressUpdateStreamSummary& ProgressUpdateStreamSummary::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("ProgressUpdateStreamName"))
  {
    m_progressUpdateStreamName = jsonValue.GetString("ProgressUpdateStreamName");

    m_progressUpdateStreamNameHasBeenSet = true;
  }

  return *this;
}

JsonValue ProgressUpdateStreamSummary::Jsonize() const
{
  JsonValue payload;

  if(m_progressUpdateStreamNameHasBeenSet)
  {
   payload.WithString("ProgressUpdateStreamName", m_progressUpdateStreamName);

  }

  return payload;
}

} // namespace Model
} // namespace MigrationHub
} // namespace Aws


text:
'''
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.

For example:

Given "aacecaaa", return "aaacecaaa".

Given "abcd", return "dcbabcd".

Credits:
Special thanks to @ifanchu for adding this problem and creating all test cases. Thanks to @Freezen for additional test cases.
'''

class Solution:
    # @param {string} s
    # @return {string}
    def shortestPalindrome(self, s):
        if not s: return s
        new_s = s + '#' + s[::-1]
        n = len(new_s)
        arr = [0 for i in xrange(n)]

        for i in xrange(1, n):
            index = arr[i-1]
            while index > 0 and new_s[index] != new_s[i]:
                index = arr[index-1]
            arr[i] = index + (1 if new_s[index] == new_s[i] else 0)

        return s[arr[n-1]:][::-1] + s

# Reference: https://leetcode.com/discuss/36807/c-8-ms-kmp-based-o-n-time-%26-o-n-memory-solution


text:
/**
 * use .prop
 *
 * use .prop('selected', true) or .prop('selected', false) instate of
 * .attr('selected', 'selected') or .removeAttr('selected') and also
 * for readonly, if you do use .attr / .removeAttr the browser won`t
 * update the select box proper and the javascript won`t get the right value
 */

$(document).ready(function(){
    // onchange Cronjob-job, show or hide the optgroup
    $('.Cronjob-job').on('change', function() {
        CronjobJobShowHideJobId();
    });

    // show or hide on loading page
    CronjobJobShowHideJobId();

    // hide or show the Cronjob-job_id optiongroups.
    // use the index to now witch row it is, and show or
    // hide the optgroup, and select the first option
    // from the optgroup that is visible

    // use .prop
    function CronjobJobShowHideJobId(){
        var job_val = $("select[name='Cronjob[job]']").val();
        var job_id_val = $("select[name='Cronjob[job_id]']").val();
        var job_id_optgroup_label = $("select[name='Cronjob[job_id]'] option:selected").parent().attr('label');

        $("select[name='Cronjob[job_id]'] option").prop('selected', false);  // unselect all
        $("select[name='Cronjob[job_id]'] optgroup").each(function() {

            if(job_val == $(this).attr('label')){

                $(this).show();
                //$(this).children().first().prop('selected', true);

                // check if this optgroup is not the same as the last condition_value_optgroup
                // if not select first option
                var element = $(this);

                if(job_id_optgroup_label != $(element).attr('label')){
                    $(element).children().first().prop('selected', true);

                }else {
                    // loop trough the options, and check if the condition_value exists
                    // in the one of the options
                    // only the options under the correct optgroup
                    var job_id_val_exists = false;
                    $(element).children("option").each(function() {
                        if(job_id_val == $(this).val()){
                            job_id_val_exists = true;
                            $(this).prop('selected', true);
                        }
                    });

                    if(!job_id_val_exists){
                        $(element).children().first().prop('selected', true);
                    }
                }
            }else {
                $(this).hide();
            }
        });
    }
});


text:
<?php

namespace Fwk\Di\Exceptions;

use Fwk\Di\Exception;

/**
 * InvalidArgumentException
 *
 * @category Exceptions
 * @package  Fwk\Di
 * @author   Julien Ballestracci <julien@nitronet.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @link     http://www.nitronet.org/fwk
 */
class InvalidArgumentException extends Exception
{
    /**
     * Constructor
     *
     * @param integer         $index      Idx of the Argument
     * @param null|string     $definition Name of the current definition (if any)
     * @param null|\Exception $prev       Previous Exception
     *
     * @return void
     */
    public function __construct($index, $definition = null,
        \Exception $prev = null
    ) {
        parent::__construct(
            "[$definition] Argument #$index is invalid",
            null,
            $prev
        );
    }
}


text:
#ifndef NANAIRO_PLANE_INL_HPP
#define NANAIRO_PLANE_INL_HPP

#include "plane.hpp"
// Standard C++ library
#include <array>
// Nanairo
#include "NanairoCore/nanairo_core_config.hpp"
#include "NanairoCore/Geometry/point.hpp"
#include "NanairoCore/Geometry/transformation.hpp"
#include "NanairoCore/Geometry/vector.hpp"

namespace nanairo {

/*!
  */
inline
const std::array<Vector3, 2>& Plane::edge() const noexcept
{
  return edge_;
}

/*!
  */
inline
const Vector3& Plane::normal() const noexcept
{
  return normal_;
}

/*!
  */
inline
const Point3& Plane::vertex0() const noexcept
{
  return vertex0_;
}

} // namespace nanairo

#endif // NANAIRO_PLANE_INL_HPP


text:
require "propay/command/base"

module ProPay
  module Command
    class GetPayers < Base
      # Note: ProPay does not support searching by e-mail!
      def initialize(params = {})
        super

        @request = Nokogiri::XML::Builder.new do |xml|
          xml["soapenv"].Envelope("xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/", "xmlns:con" => "http://propay.com/SPS/contracts", "xmlns:typ" => "http://propay.com/SPS/types") {
            xml["soapenv"].Header
            xml["soapenv"].Body {
              xml["con"].GetPayers {
                xml["con"].billerId {
                  xml["typ"].AuthenticationToken @params[:authentication_token]
                  xml["typ"].BillerAccountId @params[:biller_account_id]
                }
                xml["con"].criteria {
                  xml["typ"].EmailAddress @params[:email] if @params[:email]
                  xml["typ"].ExternalId1 @params[:external_id_1] if @params[:external_id_1]
                  xml["typ"].ExternalId2 @params[:external_id_2] if @params[:external_id_2]
                  xml["typ"].Name @params[:name] if @params[:name]
                }
              }
            }
          }
        end
      end

      def payers
        path = "/s:Envelope/s:Body/xmlns:#{response_name}Response/xmlns:#{response_name}Result/a:Payers/a:PayerInfo"
        response.xpath(path, response.collect_namespaces).map do |payer|
          { :external_id_1 => payer.at("./a:ExternalId1", response.collect_namespaces).text,
            :external_id_2 => payer.at("./a:ExternalId2", response.collect_namespaces).text,
            :name => payer.at("./a:Name", response.collect_namespaces).text,
            :payer_id => payer.at("./a:payerAccountId", response.collect_namespaces).text }
            .reject {|_, v| v.empty? }
        end
      rescue NoMethodError
        raise ProPay::InvalidDataError, "cannot locate PayerInfo attributes"
      end

      private

      def required_params
        [:authentication_token, :biller_account_id]
      end
    end
  end
end


text:
package org.joverseer.tools.ordercheckerIntegration;

/**
 * Order Result Type enumeration
 *
 * @author Marios Skounakis
 */
public enum OrderResultTypeEnum {
    Okay(-1),
    Info(0),
    Help(1),
    Warning(2),
    Error(3);

    int value;

    private OrderResultTypeEnum(int value) {
        this.value = value;
    }

    public int getValue() {
        return this.value;
    }

}


text:
module.exports = {
    path: 'profile',

    getComponent(nextState, cb) {
        require.ensure([], require => cb(null, require('./profile/profile.jsx')), 'profile.min')
    }
}


text:
require 'spec_helper'

describe ConcertSong do

  describe "associations" do
    it { should belong_to(:concert) }
    it { should belong_to(:song) }
  end

  it "has a valid factory" do
    FactoryGirl.build(:concert_song).should be_valid
  end

  it "is invalid without a concert_id" do
    FactoryGirl.build(:concert_song, concert_id: nil).should_not be_valid
  end

  it "is invalid without a song_id" do
    FactoryGirl.build(:concert_song, song_id: nil).should_not be_valid
  end
end


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * \class document::CollectionFieldValue
 * \ingroup fieldvalue
 *
 * \brief A field value containing a collection of other equally typed values.
 *
 * This class is the superclass of array and weighted set field values. It
 * contains some common functionality.
 */
#pragma once

#include "fieldvalue.h"
#include <vespa/document/datatype/collectiondatatype.h>

namespace document {

class CollectionFieldValue : public FieldValue {
protected:
    const DataType *_type;

        // As overloading doesn't work with polymorphy, have protected functions
        // doing the functionality, such that we can make utility functions here
    virtual bool addValue(const FieldValue&) = 0;
    virtual bool containsValue(const FieldValue&) const = 0;
    virtual bool removeValue(const FieldValue&) = 0;
    void verifyType(const CollectionFieldValue& other) const;

public:
    CollectionFieldValue(Type type, const DataType &dataType)
        : FieldValue(type),
          _type(&dataType)
    {}

    CollectionFieldValue(const CollectionFieldValue& other);
    CollectionFieldValue& operator=(const CollectionFieldValue& other) {
        verifyType(other);
        return *this;
    }

    const DataType *getDataType() const override { return _type; }

    FieldValue::UP createNested() const {
        return getNestedType().createFieldValue();
    }

    const DataType &getNestedType() const {
        return static_cast<const CollectionDataType&>(*_type).getNestedType();
    }

    /**
     * @return True if element was added. False if element was overwritten.
     * @throws InvalidDataTypeException If fieldvalue of wrong type is attempted
     *                                  added.
     */
    bool add(const FieldValue& val) { return addValue(val); }
    bool contains(const FieldValue& val) const { return containsValue(val); }
    /** @return True if element was found and removed. False if not found. */
    bool remove(const FieldValue& val) { return removeValue(val); }

    virtual bool isEmpty() const = 0;
    virtual size_t size() const = 0;
    virtual void clear() = 0;
};

}


text:
var express = require('express'),
    _ = require('lodash'),
    cache = require('./cache');

module.exports = function doneCallback(app, options, done) {
    return function (err) {
        if (err && done) return done(err);

        var router = new express.Router();

        cache.routes = _.sortBy(cache.routes, 'order');

        cache.routes.forEach(function (route) {
            if (route.permissionMiddleware) {
                router[route.method](route.routeString, route.permissionMiddleware, route.controller);
            } else {
                router[route.method](route.routeString, route.controller);
            }
        });

        app.use(router);

        if (cache.menu.length) cache.otter.menu = cache.menu;
        if (cache.routes.length) cache.otter.routes = cache.routes;

        if (options.diagnostics) {
            require('./diagnostics')(app, done);
        } else {
            if (done) done(null, cache.otter);
        }
    };
};


text:
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
	<identity>
		<version number="$Revision: 1.22 $"/>
		<generation date="$Date: 2009/06/15 03:46:26 $"/>
		<language type="sr"/>
		<script type="Latn"/>
		<territory type="ME"/>
	</identity>
	<dates>
		<calendars>
			<calendar type="gregorian">
				<dateFormats>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern>d.MM.yyyy.</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<dateTimeFormats>
					<intervalFormats>
						<intervalFormatItem id="MMMd">
							<greatestDifference id="d">d.MM - d.MM</greatestDifference>
							<greatestDifference id="M">d.MM - d.MM</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="MMMEd">
							<greatestDifference id="d">E, d.MM - E, d.MM</greatestDifference>
							<greatestDifference id="M">E, d.MM - E, d.MM</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMMM">
							<greatestDifference id="M">MM.yyyy - MM.yyyy</greatestDifference>
							<greatestDifference id="y">MM.yyyy - MM.yyyy</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMMMd">
							<greatestDifference id="d">d.MM.yyyy. - d.MM.yyyy.</greatestDifference>
							<greatestDifference id="M">d.MM.yyyy. - d.MM.yyyy.</greatestDifference>
							<greatestDifference id="y">d.MM.yyyy. - d.MM.yyyy.</greatestDifference>
						</intervalFormatItem>
					</intervalFormats>
				</dateTimeFormats>
			</calendar>
		</calendars>
	</dates>
	<numbers>
		<currencyFormats>
			<currencyFormatLength>
				<currencyFormat>
					<pattern>¤ #,##0.00</pattern>
				</currencyFormat>
			</currencyFormatLength>
		</currencyFormats>
	</numbers>
</ldml>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Apereo under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Apereo licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:

      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.

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

    <!-- CAS 2.0 Response Protocol Views -->

    <!-- Validation Response Protocol Views: /proxyValidate, /serviceValidate -->

    <bean id="cas2JstlSuccessView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/2.0/casServiceValidationSuccess.jsp" />

    <!-- Failure Validation Views -->
    <bean id="cas2ServiceFailureView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/2.0/casServiceValidationFailure.jsp" />

    <!-- Proxy Response Protocol Views: /proxy -->

    <!-- Failure Proxy Views -->
    <bean id="cas2ProxyFailureView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/2.0/casProxyFailureView.jsp" />

    <!-- Successful Proxy Views -->
    <bean id="cas2ProxySuccessView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/2.0/casProxySuccessView.jsp" />

    <!-- CAS 3.0 Response Protocol Views -->

    <!-- Validation Response Protocol Views: /proxyValidate, /serviceValidate -->

    <!-- Successful Validation Views -->

    <bean id="cas3JstlSuccessView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/3.0/casServiceValidationSuccess.jsp" />

    <!-- Failure Validation Views -->
    <bean id="cas3ServiceFailureView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/3.0/casServiceValidationFailure.jsp" />

    <!-- Post View -->
    <bean id="postResponseView" class="org.springframework.web.servlet.view.JstlView"
          c:url="/WEB-INF/view/jsp/protocol/casPostResponseView.jsp" />

</beans>


text:
<?php

namespace Chat\View;

use Blueprint\View\PageView;

/**
 * Index class.
 *
 * @extends PageView
 */
class Index extends PageView {

}


text: GreedThread Git Pages


text:
@interface UIImage (NFAllocInit)

@property (nonatomic, readonly) CGFloat aspect;

- (UIImage *)blurredImage;

@end


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * PHP Version 5
 *
 * Copyright (c) 2002-2006, Sebastian Bergmann <sb@sebastian-bergmann.de>.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   * Neither the name of Sebastian Bergmann nor the names of his
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @category   Testing
 * @package    PHPUnit2
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    CVS: $Id: HTML.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $
 * @link       http://pear.php.net/package/PHPUnit2
 * @since      File available since Release 2.3.0
 */

require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php';

/**
 * Prints TestDox documentation in HTML format.
 *
 * @category   Testing
 * @package    PHPUnit2
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 2.3.6
 * @link       http://pear.php.net/package/PHPUnit2
 * @since      Class available since Release 2.1.0
 */
class PHPUnit2_Util_TestDox_ResultPrinter_HTML extends PHPUnit2_Util_TestDox_ResultPrinter {
    /**
     * Handler for 'start run' event.
     *
     * @access protected
     */
    protected function startRun() {
        $this->write('');
    }

    /**
     * Handler for 'start class' event.
     *
     * @param  string $name
     * @access protected
     */
    protected function startClass($name) {
        $this->write('
' . $name . '

');
    }

    /**
     * Handler for 'on test' event.
     *
     * @param  string $name
     * @access protected
     */
    protected function onTest($name) {
        $this->write('
' . $name . '
');
    }

    /**
     * Handler for 'end class' event.
     *
     * @param  string $name
     * @access protected
     */
    protected function endClass($name) {
        $this->write('
');
    }

    /**
     * Handler for 'end run' event.
     *
     * @access protected
     */
    protected function endRun() {
        $this->write('');
    }
}

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
?>


text:
- [Terminology](terminology.md)
- [Target support](target_support.md)
- [Configuration](configuration.md)
- [User scripts](user_scripts.md)
- [Remote probe access](remote_probe_access.md)
- [Configuring logging](configuring_logging.md)
- [Debugging multicore devices](multicore_debug.md)
- [Target security features](security.md)

#### Reference

- [Session options reference](options.md)
- [Command reference](command_reference.md)

#### Python API

- [Introduction to the pyOCD Python API](python_api.md)
- [Python API examples](api_examples.md)

#### Miscellaneous

- [Installing on non-x86 platforms](installing_on_non_x86.md)

### Developer documentation

#### How-tos

- [Developers' guide](developers_guide.md)
- [How to add new targets](adding_new_targets.md)
- [Building a standalone gdb server executable](how_to_build.md)
- [Running the automated tests](automated_tests.md)

#### Architecture and Design

- [Architecture overview](architecture.md)
- [Remote probe protocol](remote_probe_protocol.md)


text:
/* @override http://localhost/~pepe/Narradar/narradar.css */
body {
-x-system-font:none;
background-color:white;
font-family:verdana,arial,helvetica,sans-serif;
font-size:x-small;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
z-index:1;
}

.TRS_TITLE {
	font-weight: bold;
	color: #000;
}

td.DPS {
	font-weight: bold;
	color: #000;
}

.TRS {
	color: #3439fd;
	font: xx-small "Lucida Grande", Lucida, Verdana, sans-serif;
	text-align: left;
}

.DP {
	color: #fa2b44;
	font: xx-small "Lucida Grande", Lucida, Verdana, sans-serif;
}

.NDP {
	color: #db35fd;
	font: xx-small "Lucida Grande", Lucida, Verdana, sans-serif;
}

.BNDP {
	font: xx-small "Lucida Grande", Lucida, Verdana, sans-serif;
}

.GNDP {
	font: xx-small "Lucida Grande", Lucida, Verdana, sans-serif;
}

span.rhs {
	text-align: right;
    float: right;
}

span.arrow {

}

td.rhs {
	text-align: left;
}


text:
package org.springframework.boot.loader;

import org.springframework.boot.loader.archive.Archive;
import org.springframework.boot.loader.archive.Archive.Entry;

/**
 * {@link Launcher} for WAR based archives. This launcher for standard WAR archives.
 * Supports dependencies in {@code WEB-INF/lib} as well as {@code WEB-INF/lib-provided},
 * classes are loaded from {@code WEB-INF/classes}.
 *
 * @author Phillip Webb
 * @author Andy Wilkinson
 * @since 1.0.0
 */
public class WarLauncher extends ExecutableArchiveLauncher {

	public WarLauncher() {
	}

	protected WarLauncher(Archive archive) {
		super(archive);
	}

	@Override
	protected boolean isPostProcessingClassPathArchives() {
		return false;
	}

	@Override
	protected boolean isSearchCandidate(Entry entry) {
		return entry.getName().startsWith("WEB-INF/");
	}

	@Override
	public boolean isNestedArchive(Archive.Entry entry) {
		if (entry.isDirectory()) {
			return entry.getName().equals("WEB-INF/classes/");
		}
		return entry.getName().startsWith("WEB-INF/lib/") || entry.getName().startsWith("WEB-INF/lib-provided/");
	}

	public static void main(String[] args) throws Exception {
		new WarLauncher().launch(args);
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Drake: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>

     Home

     Installation

     Gallery

API Documentation

      C++
      Python

Resources

      Getting Help
      Tutorials
      Python Bindings
      For Developers
      Credits

     GitHub

Drake

  Drake C++ Documentation

  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search C++ API only…">
   <input type="hidden" name="sites" value="drake.mit.edu/doxygen_cxx">
  </form>
  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search all of Drake…">
   <input type="hidden" name="sites" value="drake.mit.edu">
  </form>

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

SurfaceTriangle Member List

This is the complete list of members for SurfaceTriangle, including all inherited members.

num_vertices() const	SurfaceTriangle

operator=(const SurfaceTriangle &)=default	SurfaceTriangle

operator=(SurfaceTriangle &&)=default	SurfaceTriangle

ReverseWinding()	SurfaceTriangle

SurfaceTriangle(const SurfaceTriangle &)=default	SurfaceTriangle

SurfaceTriangle(SurfaceTriangle &&)=default	SurfaceTriangle

SurfaceTriangle(int v0, int v1, int v2)	SurfaceTriangle

SurfaceTriangle(const int v[3])	SurfaceTriangle	explicit

vertex(int i) const	SurfaceTriangle

          C++

          Python

          GitHub


text:
"""Copyright 2012 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""

__author__ = 'Adam Stelmack'
__version__ = '2.1.8'
__date__ = 'May 17 2010'

import threading
from ctypes import *
from Phidgets.PhidgetLibrary import PhidgetLibrary
from Phidgets.Phidget import Phidget
from Phidgets.PhidgetException import PhidgetException
from Phidgets.Events.Events import CurrentChangeEventArgs, InputChangeEventArgs, VelocityChangeEventArgs
from Phidgets.Events.Events import EncoderPositionChangeEventArgs, BackEMFEventArgs, CurrentUpdateEventArgs
from Phidgets.Events.Events import EncoderPositionUpdateEventArgs, SensorUpdateEventArgs
import sys

class MotorControl(Phidget):
    """This class represents a Phidget Motor Controller. All methods to to control a motor controller and read back motor data are implemented in this class.

    The Motor Control Phidget is able to control 1 or more DC motors and has 0 or more digital inputs.
	Both speed and acceleration are controllable. Speed is controlled via PWM.
    The size of the motors that can be driven depends on the motor controller.
	See your device's User Guide for more specific API details, technical information, and revision details.
	The User Guide, along with other resources, can be found on the product page for your device.

    Extends:
        Phidget
    """
    def __init__(self):
        """The Constructor Method for the MotorControl Class

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
        """
        Phidget.__init__(self)

        self.__inputChange = None
        self.__velocityChange = None
        self.__currentChange = None
        self.__currentUpdate = None
        self.__positionChange = None
        self.__positionUpdate = None
        self.__sensorUpdate = None
        self.__backEMFUpdate = None

        self.__onInputChange = None
        self.__onVelocityChange = None
        self.__onCurrentChange = None
        self.__onCurrentUpdate = None
        self.__onPositionChange = None
        self.__onPositionUpdate = None
        self.__onSensorUpdate = None
        self.__onBackEMFUpdate = None

        try:
            PhidgetLibrary.getDll().CPhidgetMotorControl_create(byref(self.handle))
        except RuntimeError:
            raise

        if sys.platform == 'win32':
            self.__INPUTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__VELOCITYCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__CURRENTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__CURRENTUPDATEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__POSITIONCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int, c_int)
            self.__POSITIONUPDATEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__SENSORUPDATEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__BACKEMFUPDATEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
        elif sys.platform == 'darwin' or sys.platform == 'linux2':
            self.__INPUTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__VELOCITYCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__CURRENTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__CURRENTUPDATEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
            self.__POSITIONCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int, c_int)
            self.__POSITIONUPDATEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__SENSORUPDATEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
            self.__BACKEMFUPDATEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)

    def __del__(self):
        """The Destructor Method for the MotorControl Class
        """
        Phidget.dispose(self)

    def getMotorCount(self):
        """Returns the number of motors supported by this Phidget.

        This does not neccesarily correspond to the number of motors actually attached to the board.

        Returns:
            The number of supported motors <int>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached.
        """
        motorCount = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getMotorCount(self.handle, byref(motorCount))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return motorCount.value

    def getVelocity(self, index):
        """Returns a motor's velocity.

        The valid range is -100 - 100, with 0 being stopped.

        Parameters:
            index<int>: index of the motor.

        Returns:
            The current velocity of the motor <double>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
        """
        veloctiy = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getVelocity(self.handle, c_int(index), byref(veloctiy))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return veloctiy.value

    def setVelocity(self, index, value):
        """Sets a motor's velocity.

        The valid range is from -100 to 100, with 0 being stopped. -100 and 100 both corespond to full voltage,
        with the value in between corresponding to different widths of PWM.

        Parameters:
            index<int>: index of the motor.
            value<double>: requested velocity for the motor.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index or velocity value are invalid.
        """
        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setVelocity(self.handle, c_int(index), c_double(value))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def __nativeVelocityChangeEvent(self, handle, usrptr, index, value):
        if self.__velocityChange != None:
            self.__velocityChange(VelocityChangeEventArgs(self, index, value))
        return 0

    def setOnVelocityChangeHandler(self, velocityChangeHandler):
        """Sets the VelocityChange Event Handler.

        The velocity change handler is a method that will be called when the velocity of a motor changes.
        These velocity changes are reported back from the Motor Controller and so correspond to actual motor velocity over time.

        Parameters:
            velocityChangeHandler: hook to the velocityChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if velocityChangeHandler == None:
            self.__velocityChange = None
            self.__onVelocityChange = None
        else:
            self.__velocityChange = velocityChangeHandler
            self.__onVelocityChange = self.__VELOCITYCHANGEHANDLER(self.__nativeVelocityChangeEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnVelocityChange_Handler(self.handle, self.__onVelocityChange, None)
        except RuntimeError:
            self.__velocityChange = None
            self.__onVelocityChange = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def getAcceleration(self, index):
        """Returns a motor's acceleration.

        The valid range is between getAccelerationMin and getAccelerationMax,
        and refers to how fast the Motor Controller will change the speed of a motor.

        Parameters:
            index<int>: index of motor.

        Returns:
            The acceleration of the motor <double>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
        """
        accel = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getAcceleration(self.handle, c_int(index), byref(accel))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return accel.value

    def setAcceleration(self, index, value):
        """Sets a motor's acceleration.

        The valid range is between getAccelerationMin and getAccelerationMax.
        This controls how fast the motor changes speed.

        Parameters:
            index<int>: index of the motor.
            value<double>: requested acceleration for that motor.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index or acceleration value are invalid.
        """
        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setAcceleration(self.handle, c_int(index), c_double(value))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def getAccelerationMax(self, index):
        """Returns the maximum acceleration that a motor will accept, or return.

        Parameters:
            index<int>: Index of the motor.

        Returns:
            Maximum acceleration of the motor <double>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached.
        """
        accelMax = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getAccelerationMax(self.handle, c_int(index), byref(accelMax))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return accelMax.value

    def getAccelerationMin(self, index):
        """Returns the minimum acceleration that a motor will accept, or return.

        Parameters:
            index<int>: Index of the motor.

        Returns:
            Minimum acceleration of the motor <double>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached.
        """
        accelMin = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getAccelerationMin(self.handle, c_int(index), byref(accelMin))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return accelMin.value

    def getCurrent(self, index):
        """Returns a motor's current usage.

        The valid range is 0 - 255. Note that this is not supported on all motor controllers.

        Parameters:
            index<int>: index of the motor.

        Returns:
            The current usage of the motor <double>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
        """
        current = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getCurrent(self.handle, c_int(index), byref(current))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return current.value

    def __nativeCurrentChangeEvent(self, handle, usrptr, index, value):
        if self.__currentChange != None:
            self.__currentChange(CurrentChangeEventArgs(self, index, value))
        return 0

    def setOnCurrentChangeHandler(self, currentChangeHandler):
        """Sets the CurrentCHange Event Handler.

        The current change handler is a method that will be called when the current consumed by a motor changes.
        Note that this event is not supported with the current motor controller, but will be supported in the future

        Parameters:
            currentChangeHandler: hook to the currentChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if currentChangeHandler == None:
            self.__currentChange = None
            self.__onCurrentChange = None
        else:
            self.__currentChange = currentChangeHandler
            self.__onCurrentChange = self.__CURRENTCHANGEHANDLER(self.__nativeCurrentChangeEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnCurrentChange_Handler(self.handle, self.__onCurrentChange, None)
        except RuntimeError:
            self.__currentChange = None
            self.__onCurrentChange = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def __nativeCurrentUpdateEvent(self, handle, usrptr, index, current):
        if self.__currentUpdate != None:
            self.__currentUpdate(CurrentUpdateEventArgs(self, index, current))
        return 0

    def setOnCurrentUpdateHandler(self, currentUpdateHandler):
        """Sets the CurrentCHange Event Handler.

        The current change handler is a method that will be called when the current consumed by a motor changes.
        Note that this event is not supported with the current motor controller, but will be supported in the future

        Parameters:
            currentChangeHandler: hook to the currentChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if currentUpdateHandler == None:
            self.__currentUpdate = None
            self.__onCurrentUpdate = None
        else:
            self.__currentUpdate = currentUpdateHandler
            self.__onCurrentUpdate = self.__CURRENTUPDATEHANDLER(self.__nativeCurrentUpdateEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnCurrentUpdate_Handler(self.handle, self.__onCurrentUpdate, None)
        except RuntimeError:
            self.__currentUpdate = None
            self.__onCurrentUpdate = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def getInputCount(self):
        """Returns the number of digital inputs.

        Not all Motor Controllers have digital inputs.

        Returns:
            The number of digital Inputs <int>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached.
        """
        inputCount = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getInputCount(self.handle, byref(inputCount))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return inputCount.value

    def getInputState(self, index):
        """Returns the state of a digital input.

        True means that the input is activated, and False indicated the default state.

        Parameters:
            index<int> index of the input.

        Returns:
            The state of the input <boolean>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
        """
        inputState = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getInputState(self.handle, c_int(index), byref(inputState))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            if inputState.value == 1:
                return True
            else:
                return False

    def __nativeInputChangeEvent(self, handle, usrptr, index, value):
        if self.__inputChange != None:
            if value == 1:
                state = True
            else:
                state = False
            self.__inputChange(InputChangeEventArgs(self, index, state))
        return 0

    def setOnInputChangeHandler(self, inputChangeHandler):
        """Sets the InputChange Event Handler.

        The input change handler is a method that will be called when an input on this Motor Controller board has changed.

        Parameters:
            inputChangeHandler: hook to the inputChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if inputChangeHandler == None:
            self.__inputChange = None
            self.__onInputChange = None
        else:
            self.__inputChange = inputChangeHandler
            self.__onInputChange = self.__INPUTCHANGEHANDLER(self.__nativeInputChangeEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnInputChange_Handler(self.handle, self.__onInputChange, None)
        except RuntimeError:
            self.__inputChange = None
            self.__onInputChange = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def getEncoderCount(self):
        """

        """
        encoderCount = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getEncoderCount(self.handle, byref(encoderCount))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return encoderCount.value

    def getEncoderPosition(self, index):
        """

        """
        encoderPosition = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getEncoderPosition(self.handle, c_int(index), byref(encoderPosition))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return encoderPosition.value

    def setEncoderPosition(self, index, encoderPosition):
        """

        """
        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setEncoderPosition(self.handle, c_int(index), c_int(encoderPosition))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def __nativePositionChangeEvent(self, handle, usrptr, index, time, positionChange):
        if self.__positionChange != None:
            self.__positionChange(EncoderPositionChangeEventArgs(self, index, time, positionChange))
        return 0

    def setOnPositionChangeHandler(self, positionChangeHandler):
        """Sets the position change event handler.

        The position change handler is a method that will be called when the position of an encoder changes.
        The position change event provides data about how many ticks have occured, and how much time has passed since the last position change event,
        but does not contain an absolute position.
        This can be obtained from getEncoderPosition.

        Parameters:
            positionChangeHandler: hook to the positionChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if positionChangeHandler == None:
            self.__positionChange = None
            self.__onPositionChange = None
        else:
            self.__positionChange = positionChangeHandler
            self.__onPositionChange = self.__POSITIONCHANGEHANDLER(self.__nativePositionChangeEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnEncoderPositionChange_Handler(self.handle, self.__onPositionChange, None)
        except RuntimeError:
            self.__positionChange = None
            self.__onPositionChange = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def __nativePositionUpdateEvent(self, handle, usrptr, index, positionChange):
        if self.__positionUpdate != None:
            self.__positionUpdate(EncoderPositionUpdateEventArgs(self, index, positionChange))
        return 0

    def setOnPositionUpdateHandler(self, positionUpdateHandler):
        """Sets the position change event handler.

        The position change handler is a method that will be called when the position of an encoder changes.
        The position change event provides data about how many ticks have occured, and how much time has passed since the last position change event,
        but does not contain an absolute position.
        This can be obtained from getEncoderPosition.

        Parameters:
            positionChangeHandler: hook to the positionChangeHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if positionUpdateHandler == None:
            self.__positionUpdate = None
            self.__onPositionUpdate = None
        else:
            self.__positionUpdate = positionUpdateHandler
            self.__onPositionUpdate = self.__POSITIONUPDATEHANDLER(self.__nativePositionUpdateEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnEncoderPositionUpdate_Handler(self.handle, self.__onPositionUpdate, None)
        except RuntimeError:
            self.__positionUpdate = None
            self.__onPositionUpdate = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def getSensorCount(self):
        """Returns the number of analog inputs on the Motor Control.

        Returns:
            Number of analog inputs <int>.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached.
        """
        sensorCount = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getSensorCount(self.handle, byref(sensorCount))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return sensorCount.value

    def getSensorValue(self, index):
        """Returns the value of a analog input.

        The analog inputs are where analog sensors are attached on the Motor Control.

        The valid range is 0-1000. In the case of a sensor, this value can be converted to an actual sensor
        value using the formulas provided in the sensor product manual.

        Parameters:
            index<int>: Index of the sensor.

        Returns:
            The Sensor value <int>

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
        """
        sensorValue = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getSensorValue(self.handle, c_int(index), byref(sensorValue))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return sensorValue.value

    def getSensorRawValue(self, index):
        """Returns the raw value of a analog input.

        This is a more accurate version of getSensorValue. The valid range is 0-4095.
        Note however that the analog outputs on the Motor Control are only 10-bit values and this value represents an oversampling to 12-bit.

        Parameters:
            index<int>: Index of the sensor.

        Returns:
            The Raw Sensor value <int>

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
        """
        sensorValue = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getSensorRawValue(self.handle, c_int(index), byref(sensorValue))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return sensorValue.value

    def __nativeSensorUpdateEvent(self, handle, usrptr, index, value):
        if self.__sensorUpdate != None:
            self.__sensorUpdate(SensorUpdateEventArgs(self, index, value))
        return 0

    def setOnSensorUpdateHandler(self, sensorUpdateHandler):
        """Set the SensorChange Event Handler.

        The sensor change handler is a method that will be called when a sensor on
        this Motor Controller has changed by at least the Trigger that has been set for this sensor.

        Parameters:
            sensorUpdateHandler: hook to the sensorUpdateHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if sensorUpdateHandler == None:
            self.__sensorUpdate = None
            self.__onSensorUpdate = None
        else:
            self.__sensorUpdate = sensorUpdateHandler
            self.__onSensorUpdate = self.__SENSORUPDATEHANDLER(self.__nativeSensorUpdateEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnSensorUpdate_Handler(self.handle, self.__onSensorUpdate, None)
        except RuntimeError:
            self.__sensorUpdate = None
            self.__onSensorUpdate = None
            raise

        if result > 0:
            raise PhidgetException(result)

    def getRatiometric(self):
        """Gets the ratiometric state for the analog sensors

        Returns:
            State of the Ratiometric setting.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if this phidget does not support ratiometric.
        """
        ratiometricState = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getRatiometric(self.handle, byref(ratiometricState))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            if ratiometricState.value == 1:
                return True
            else:
                return False

    def setRatiometric(self, state):
        """Sets the ratiometric state for the analog inputs.

        The default is for ratiometric to be set on and this is appropriate for most sensors.

        False - off
        True - on

        Parameters:
            state<boolean>: State of the ratiometric setting.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if this Phidget does not support ratiometric.
        """
        if state == True:
            value = 1
        else:
            value = 0

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setRatiometric(self.handle, c_int(value))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def getBraking(self, index):
        """

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, the supplied index is out of range, or if this motor controller does not support braking.
        """
        braking = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getBraking(self.handle, c_int(index), byref(braking))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return braking.value

    def setBraking(self, index, braking):
        """

        Parameters:
            braking<double>:

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, the supplied index is out of range, or if this Motor Controller does not support braking.
        """
        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setBraking(self.handle, c_int(index), c_double(braking))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def getSupplyVoltage(self):
        """

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if this Phidget does not support this feature.
        """
        supplyVoltage = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getSupplyVoltage(self.handle, byref(supplyVoltage))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return supplyVoltage.value

    def getBackEMFSensingState(self, index):
        """

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, the supplied index is out of range, or if this motor controller does not support braking.
        """
        state = c_int()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getBackEMFSensingState(self.handle, c_int(index), byref(state))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            if state.value == 1:
                return True
            else:
                return False

    def setBackEMFSensingState(self, index, state):
        """

        Parameters:
            state<boolean>:

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, the supplied index is out of range, or if this Motor Controller does not support braking.
        """
        if state == True:
            value = 1
        else:
            value = 0

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_setBackEMFSensingState(self.handle, c_int(index), c_int(value))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)

    def getBackEMF(self, index):
        """

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException: If this Phidget is not opened and attached, or if this Phidget does not support this feature.
        """
        voltage = c_double()

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_getBackEMF(self.handle, c_int(index), byref(voltage))
        except RuntimeError:
            raise

        if result > 0:
            raise PhidgetException(result)
        else:
            return voltage.value

    def __nativeBackEMFUpdateEvent(self, handle, usrptr, index, voltage):
        if self.__backEMFUpdate != None:
            self.__backEMFUpdate(BackEMFEventArgs(self, index, voltage))
        return 0

    def setOnBackEMFUpdateHandler(self, backEMFUpdateHandler):
        """Set the BackEMF Update Event Handler.

        Parameters:
            sensorUpdateHandler: hook to the sensorUpdateHandler callback function.

        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
            PhidgetException
        """
        if backEMFUpdateHandler == None:
            self.__backEMFUpdate = None
            self.__onBackEMFUpdate = None
        else:
            self.__backEMFUpdate = backEMFUpdateHandler
            self.__onBackEMFUpdate = self.__SENSORUPDATEHANDLER(self.__nativeBackEMFUpdateEvent)

        try:
            result = PhidgetLibrary.getDll().CPhidgetMotorControl_set_OnBackEMFUpdate_Handler(self.handle, self.__onBackEMFUpdate, None)
        except RuntimeError:
            self.__backEMFUpdate = None
            self.__onBackEMFUpdate = None
            raise

        if result > 0:
            raise PhidgetException(result)


text:
var mongoose = require('mongoose'),
	userModel = require('../models/User'),
	courseModel = require('../models/Course');

module.exports = function(config) {
	mongoose.connect(config.db);
	var db = mongoose.connection;
	db.on('error', console.error.bind(console, 'connection error...'));
	db.once('open', function callback () {
		console.log('multivison db opened');
	});

	userModel.createDefaultUsers();
	courseModel.createDefaultCourses();
};


text:
package utils

import java.sql.Connection
import cz.kamenitxan.jakon.core.database.DBHelper
import cz.kamenitxan.jakon.utils.PageContext
import cz.kamenitxan.jakon.utils.security.AesEncryptor
import cz.kamenitxan.jakon.utils.security.oauth.Google.createAuthUrl
import cz.kamenitxan.jakon.utils.security.oauth.{OauthInfo, OauthProvider}
import cz.kamenitxan.jakon.webui.entity.{Message, MessageSeverity}
import org.scalatest.DoNotDiscover

import javax.servlet.http.HttpServletRequest
import spark.Request
import test.{TestBase, TestHttpServletRequest}

@DoNotDiscover
class SecurityTest extends TestBase {

	class TestOauthProvider(email: String) extends OauthProvider {
		override val isEnabled: Boolean = true

		override def authInfo(req: Request, redirectTo: String): OauthInfo = OauthInfo("test", createAuthUrl(req, redirectTo))

		override def handleAuthResponse(req: Request)(implicit conn: Connection): Boolean = {
			logIn(req, email)
		}
	}

	val fakeReq = {
		val constructor = classOf[Request].getDeclaredConstructor(Array(classOf[HttpServletRequest]): _*)
		constructor.setAccessible(true)
		val req = constructor.newInstance(new TestHttpServletRequest)

		req.session(true)
		req
	}

	test("encrypt&decrypt") { _ =>
		val toenc = "slaninaabucek534534345354345345345345432543254432543254325"
		val enc = AesEncryptor.encrypt(toenc)
		val dec = AesEncryptor.decrypt(enc)
		assert(toenc == dec)
	}

	test("OauthProvider") { _ =>
	    assert("redirectTo" == OauthProvider.REDIRECT_TO)
	}

	test("Google") { f =>
		implicit val driver = f.driver
		f.driver.get(adminHost + "login/oauth?provider=Google$")
		checkPageLoad(".card-title")
	}

	test("test provider bob") { _ =>
		PageContext.init(fakeReq, null)
		PageContext.getInstance().messages += new Message(MessageSeverity.ERROR, "")
		val provider = new TestOauthProvider("bob@test.test")
		provider.authInfo(fakeReq, "")
		provider.handleAuthResponse(fakeReq)(DBHelper.getConnection)
		PageContext.destroy()
	}

	test("test provider admin") { _ =>
		PageContext.init(fakeReq, null)
		PageContext.getInstance().messages += new Message(MessageSeverity.ERROR, "")
		val provider = new TestOauthProvider("admin@admin.cz")
		provider.authInfo(fakeReq, "")
		provider.handleAuthResponse(fakeReq)(DBHelper.getConnection)
		PageContext.destroy()
	}

}


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

<title>Uses of Class racoon.rationality.sequential.SGStrategy.DeviationType</title>
<meta name="date" content="2017-05-22">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
racoon.rationality.sequential.SGStrategy.DeviationType

Packages that use SGStrategy.DeviationType

Package
Description

racoon.rationality.evolutionary

racoon.rationality.sequential

Uses of SGStrategy.DeviationType in racoon.rationality.evolutionary

Methods in racoon.rationality.evolutionary that return SGStrategy.DeviationType

Modifier and Type
Method and Description

SGStrategy.DeviationType
SubPopulation.getBehaviour(java.lang.String transitionId)

Return the CorrectnessType of a PATransition contained in this strategy.

Uses of SGStrategy.DeviationType in racoon.rationality.sequential

Methods in racoon.rationality.sequential that return SGStrategy.DeviationType

Modifier and Type
Method and Description

static SGStrategy.DeviationType
SGStrategy.DeviationType.valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.

static SGStrategy.DeviationType[]
SGStrategy.DeviationType.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class KernelTypeStrArgsEntry(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsKernelTypeStrArgsEntry(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = KernelTypeStrArgsEntry()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def KernelTypeStrArgsEntryBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x4F\x52\x54\x4D", size_prefixed=size_prefixed)

    # KernelTypeStrArgsEntry
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # KernelTypeStrArgsEntry
    def KernelTypeStr(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # KernelTypeStrArgsEntry
    def Args(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from ort_flatbuffers_py.fbs.ArgTypeAndIndex import ArgTypeAndIndex
            obj = ArgTypeAndIndex()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # KernelTypeStrArgsEntry
    def ArgsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # KernelTypeStrArgsEntry
    def ArgsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

def KernelTypeStrArgsEntryStart(builder): builder.StartObject(2)
def KernelTypeStrArgsEntryAddKernelTypeStr(builder, kernelTypeStr): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(kernelTypeStr), 0)
def KernelTypeStrArgsEntryAddArgs(builder, args): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(args), 0)
def KernelTypeStrArgsEntryStartArgsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def KernelTypeStrArgsEntryEnd(builder): return builder.EndObject()


text:
@interface VSMVVMViewController ()

PP_STRONG(VSMVVMView, mvvmView)
PP_STRONG(VSMVVMModel, mvvmModel)
PP_STRONG(VSMVVMViewModel, mvvmViewModel)

@end

@implementation VSMVVMViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"MVVM DEMO";

    self.mvvmModel = [VSMVVMModel new];
    self.mvvmModel.userName = @"cheney";

    self.mvvmViewModel = [VSMVVMViewModel new];
    [self.mvvmViewModel setModel:self.mvvmModel];

    self.mvvmView = [[VSMVVMView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 300)];
    self.mvvmView.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:self.mvvmView];

    [self.mvvmView setViewModel:self.mvvmViewModel];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc
{
    NSLog(@"VSMVVMViewController dealloc");
}

@end


text:
<Alloy>
	<Window id="win">
		<View id="btnBar" class="hBar">
			<Button id="btnBack" onClick="closeWindow" />
			<Label class="title" />
			<Button id="btnOk" onClick="choosePath" />
		</View>
		<Label id="path" />
		<TableView id="table" />
	</Window>
</Alloy>


text:
// KNVProtoEngine/src/knv_net.h

// Encapsulation for socket

#ifndef BUBBLEFS_UTILS_KNV_NET_H_
#define BUBBLEFS_UTILS_KNV_NET_H_

#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>

namespace bubblefs {
namespace myknv {

namespace KnvNet
{
        // mask the difference between IPv4/IPv6
        class KnvSockAddr
        {
        public:
                KnvSockAddr(bool use_ipv6 = false):a6() { addr_len = use_ipv6? sizeof(sockaddr_in6) : sizeof(sockaddr_in); }
                KnvSockAddr(const char *ipstr, int port);
                KnvSockAddr(const struct sockaddr_in &a): a4(a), addr_len(sizeof(a4)) {}
                KnvSockAddr(const struct sockaddr_in6 &a): a6(a), addr_len(sizeof(a6)) {}
                KnvSockAddr(const struct sockaddr *a, socklen_t l): addr_len(l) {memcpy(&addr, a, l);}
                KnvSockAddr(const KnvSockAddr &a): a6(a.a6), addr_len(a.addr_len) {}

                const char *to_str();
                const char *to_str_with_port();
                bool IsIpv4() const { return addr_len==sizeof(a4); }
                bool IsIpv6() const { return !IsIpv4(); }
                KnvSockAddr &operator= (const KnvSockAddr &a) { a6 = a.a6; addr_len = a.addr_len; return *this; }

                union
                {
                        struct sockaddr     addr;
                        struct sockaddr_in  a4;
                        struct sockaddr_in6 a6;
                };
                socklen_t addr_len;
        };

        int SetSocketNonblock(int sockfd, bool nonblock);
        int SetSocketRecvTimeout(int sockfd, uint64_t iTimeoutMs);
        int CreateUdpListenSocket(int port, bool reuse = true, bool use_ipv6 = false, bool nblock = true);
};

} // namespace myknv
} // namespace bubblefs

#endif // BUBBLEFS_UTILS_KNV_NET_H_


text:
package org.bioconductor.rserviceJms.services.caLinearModel;

import java.io.BufferedInputStream;
import junit.framework.JUnit4TestAdapter;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
import static org.junit.Assert.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.rmi.RemoteException;

import org.omegahat.R.Java.RException;
import org.omegahat.R.Java.ROmegahatInterpreter;

import org.bioconductor.packages.caCommonClasses.*;
import org.bioconductor.packages.caLinearModel.*;

public class caLinearModelTest {
	private static caLinearModel binding;

	/**
	 * Used for backward compatibility (IDEs, Ant and JUnit 3.x text runner)
	 */
	public static junit.framework.Test suite() {
		 return new JUnit4TestAdapter(caLinearModelTest.class);
	}

	/**
	 * Sets up the test fixture; Called before all the tests; Called only once.
	 */
	@BeforeClass
	public static void oneTimeSetUp() throws Exception {
		binding=new caLinearModel();
	}

	/**
	 * we put this test here to let caLinearModelTest work right out of box.
	 */
	@Test
	public void testcaLinearModelService() {
		assertNotNull(binding);
	}

	/**
	 * Tests caLinearModel.caLinearModel
	 */
	//@Ignore("please initialize function parameters")
	@Test
	public void TestCaLinearModel() throws RemoteException {
    }

    /**
     * Executes test using a TTest Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void TTestTest() throws RemoteException {

        // Initialize the TTest model.
        String[] sampleAnnotationCollectionTestColumnName = {"handedness"};
        int[] numberOfTopReporters = {10};

        TTest model = new TTest(sampleAnnotationCollectionTestColumnName, numberOfTopReporters);

        // Initialize the expressionData.
        OneChannelExpressionData oneChannelExpressionData = this.getOneChannelExpressionData();

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection =
                this.getOneChannelSampleAnnotationCollection();

        // Execute the test.

        TopTableCollection topTableCollection =
                binding.fit( model,
                             oneChannelExpressionData,
                             sampleAnnotationCollection );
    }

    /**
     * Executes test using a PairedTTest Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void PairedTTestTest() throws RemoteException {

        // Initialize the PairedTTest model.
        String[] sampleAnnotationCollectionTestColumnName = {"handedness"};
        String[] sampleAnnotationCollectionPairingColumnName = {"pairing"};
        int[] numberOfTopReporters = {10};

        PairedTTest model = new PairedTTest(
                          sampleAnnotationCollectionTestColumnName,
                          sampleAnnotationCollectionPairingColumnName,
                          numberOfTopReporters);

        // Initialize the expressionData.
        OneChannelExpressionData oneChannelExpressionData = this.getOneChannelExpressionData();

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection =
                this.getOneChannelSampleAnnotationCollection();

        // Execute the test.
        TopTableCollection topTableCollection =
                binding.fit( model,
                             oneChannelExpressionData,
                             sampleAnnotationCollection );
    }

    /**
     * Executes test using a OneFactorANOVA Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void OneFactorANOVATest() throws RemoteException {

        // Initialize the OneFactorANOVA model.
        String[] sampleAnnotationCollectionTestColumnName = {"ageCohort"};
        int[] numberOfTopReporters = {10};

        OneFactorANOVA model = new OneFactorANOVA(
                sampleAnnotationCollectionTestColumnName, numberOfTopReporters);

        // Initialize the expressionData.
        OneChannelExpressionData oneChannelExpressionData = this.getOneChannelExpressionData();

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection =
                this.getOneChannelSampleAnnotationCollection();

        // Execute the test.
        TopTableCollection topTableCollection =
                binding.fit( model,
                             oneChannelExpressionData,
                             sampleAnnotationCollection );
    }

    /**
     * Executes test using a TwoFactorANOVA Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void TwoFactorANOVATest() throws RemoteException {

        // Initialize the TwoFactorANOVA model.
        String[] sampleAnnotationCollectionFactorOneColumnName = {"handedness"};
        String[] sampleAnnotationCollectionFactorTwoColumnName = {"ageCohort"};
        int[] numberOfTopReporters = {10};

        TwoFactorANOVA model =
                new TwoFactorANOVA(
                          sampleAnnotationCollectionFactorOneColumnName,
                          sampleAnnotationCollectionFactorTwoColumnName,
                          numberOfTopReporters);

        // Initialize the expressionData.
        OneChannelExpressionData oneChannelExpressionData =
                this.getOneChannelExpressionData();

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection =
                this.getOneChannelSampleAnnotationCollection();

        // Execute the test.
        TopTableCollection topTableCollection =
                binding.fit( model,
                             oneChannelExpressionData,
                             sampleAnnotationCollection );
    }

    /**
     * Executes test using a DyeSwapTTest Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void DyeSwapTTestTest() throws RemoteException {

        // Initialize the DyeSwapTTest model.
        String[] sampleAnnotationCollectionTestColumnName = {"handedness"};
        String[] testReferenceLevel                       = {"R"};
        int[] numberOfTopReporters                        = {10};

		// Initialize.
		DyeSwapTTest model =
			new DyeSwapTTest( sampleAnnotationCollectionTestColumnName,
						      testReferenceLevel,
							  numberOfTopReporters );

        TwoChannelExpressionData twoChannelExpressionData =
                                this.getTwoChannelExpressionData();
        SampleAnnotationCollection sampleAnnotationCollection =
                                this.getTwoChannelSampleAnnotationCollection();

        // Execute test.
        TopTableCollection topTableCollection =
			binding.twoChannelFit( model,
                                   twoChannelExpressionData,
								   sampleAnnotationCollection );
    }

    /**
     * Executes test using a CommonReferenceANOVA Model.
     */
    //@Ignore("please initialize function parameters")
    @Test
    public void CommonReferenceANOVATest() throws RemoteException {

        int nContrasts = 6;
        int nReporters = 10;

        // Initialize the CommonReferenceANOVA model.
        String[] sampleAnnotationCollectionTestColumnName = {"ageCohort"};
        String[] testReferenceLevel                       = {"Mix"};
        int[] numberOfTopReporters                        = {nReporters};

		// Initialize.
		CommonReferenceANOVA model =
			new CommonReferenceANOVA( sampleAnnotationCollectionTestColumnName,
									  testReferenceLevel,
									  numberOfTopReporters );

        TwoChannelExpressionData twoChannelExpressionData =
                                this.getTwoChannelExpressionData();
        SampleAnnotationCollection sampleAnnotationCollection =
                                this.getTwoChannelSampleAnnotationCollection();

        // Execute test
        TopTableCollection topTableCollection =
			binding.twoChannelFit( model,
                                   twoChannelExpressionData,
								   sampleAnnotationCollection );

		// Compare.
		Object[] ttCollection = topTableCollection.getTopTableCollection();
		assertEquals(nContrasts, ttCollection.length);
		for (int i = 0; i < nContrasts; ++i) {
			assertEquals( nReporters,
						  ((TopTable) ttCollection[i]).getReporterName().length );
        }
    }

    /**
     * Returns the test OneChannelExpressionData.
     */
    private OneChannelExpressionData getOneChannelExpressionData() {

        InputStream inputStream = null;
        ObjectInput objectInput = null;

        OneChannelExpressionData oneChannelExpressionData = null;
        try {
            inputStream = this.getClass().getResourceAsStream("../../worker/Data/OneChannelTest.oneChannelExpressionData.rda_java.Data");
            objectInput = new ObjectInputStream (new BufferedInputStream( inputStream ));
            oneChannelExpressionData = (OneChannelExpressionData)objectInput.readObject();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
          try {
            if (objectInput != null) objectInput.close();
          } catch (IOException ioex) {
            ioex.printStackTrace();
          }
        }

        return oneChannelExpressionData;
    }

    /**
     * Returns the test SampleAnnotationCollection for OneChannelModels.
     */
    private SampleAnnotationCollection getOneChannelSampleAnnotationCollection() {

        InputStream inputStream = null;
        ObjectInput objectInput = null;

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection = null;
        try {
            inputStream = this.getClass().getResourceAsStream("../../worker/Data/OneChannelTest.sampleAnnotationCollection.rda_java.Data");
            objectInput = new ObjectInputStream (new BufferedInputStream( inputStream ));
            sampleAnnotationCollection = (SampleAnnotationCollection)objectInput.readObject();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
          try {
            if (objectInput != null) objectInput.close();
          } catch (IOException ioex) {
            ioex.printStackTrace();
          }
        }

        return sampleAnnotationCollection;
    }

    /**
     * Returns the test TwoChannelExpressionData.
     */
    private TwoChannelExpressionData getTwoChannelExpressionData() {

        InputStream inputStream = null;
        ObjectInput objectInput = null;

        TwoChannelExpressionData twoChannelExpressionData = null;
        try {
            inputStream = this.getClass().getResourceAsStream("../../worker/Data/TwoChannelTest.twoChannelExpressionData.rda_java.Data");
            objectInput = new ObjectInputStream (new BufferedInputStream( inputStream ));
            twoChannelExpressionData = (TwoChannelExpressionData)objectInput.readObject();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
          try {
            if (objectInput != null) objectInput.close();
          } catch (IOException ioex) {
            ioex.printStackTrace();
          }
        }

        return twoChannelExpressionData;
    }

    /**
     * Returns the test SampleAnnotationCollection for TwoChannelModels.
     */
    private SampleAnnotationCollection getTwoChannelSampleAnnotationCollection() {

        InputStream inputStream = null;
        ObjectInput objectInput = null;

        // Initialize the sampleAnnotationCollection.
        SampleAnnotationCollection sampleAnnotationCollection = null;
        try {
            inputStream = this.getClass().getResourceAsStream("../../worker/Data/TwoChannelTest.sampleAnnotationCollection.rda_java.Data");
            objectInput = new ObjectInputStream (new BufferedInputStream( inputStream ));
            sampleAnnotationCollection = (SampleAnnotationCollection)objectInput.readObject();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
          try {
            if (objectInput != null) objectInput.close();
          } catch (IOException ioex) {
            ioex.printStackTrace();
          }
        }

        return sampleAnnotationCollection;
    }
}


text:
#ifndef GGADGET_IMAGE_CACHE_H__
#define GGADGET_IMAGE_CACHE_H__

#include <ggadget/graphics_interface.h>
#include <ggadget/image_interface.h>
#include <ggadget/file_manager_interface.h>

namespace ggadget {

/**
 * @ingroup Utilities
 *
 * A class to manipulate shared images.
 *
 * When loading two images with the same tag, they will be treated as identical
 * and share the same underlying object, to save memory usage.
 *
 * From the caller point of view, image objects created by ImageCache can be
 * used as normal image without any difference.
 *
 * Each View shall have its own ImageCache object.
 */
class ImageCache {
 public:
  ImageCache();
  ~ImageCache();

  /**
   * Loads an image from specified Graphics and FileManager objects..
   *
   * It supports loading both per-gadget images and global resource images.
   *
   * @param gfx Graphics object used to create the image.
   * @param fm FileManager object used to load the image data.
   * @param filename File name of the image.
   * @param is_mask If the image is a mask or not.
   */
  ImageInterface *LoadImage(GraphicsInterface *gfx, FileManagerInterface *fm,
                            const std::string &filename, bool is_mask);

 private:
  class Impl;
  Impl *impl_;
  DISALLOW_EVIL_CONSTRUCTORS(ImageCache);
};

} // namespace ggadget

#endif // GGADGET_IMAGE_CACHE_H__


text:
import { schema } from 'normalizr';

export const listingSchema = new schema.Entity(
  'listings',
  {},
  { idAttribute: 'listingId' }
);

export const listingsSchema = [listingSchema];


text:
package com.nuclearthinking.game.app.controller;

import com.nuclearthinking.game.DAO.Account;
import com.nuclearthinking.game.app.StartApp;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;

/**
 * Created by kuksin-mv on 26.01.2016.
 */
public class LoginController
{
    private ObservableList<Account> accountsData = FXCollections.observableArrayList();

    private StartApp startApp = new StartApp();

    @FXML
    private TableView<Account> accountTable;

    @FXML
    private TableColumn<Account, String> loginColumn, passwordColumn;

    @FXML
    private Button login, exit;

    @FXML
    private TextField loginTxt;

    @FXML
    private Label msgLogin;

    @FXML
    private PasswordField passwordTxt;

    @FXML
    private Label msgPassword;

    @FXML
    private void initialize()
    {
        accountTable.setPlaceholder(new Text(startApp.getBundle().getString("table")));
        login.setOnAction((event -> {
            String loginTextTmp = loginTxt.getText();
            String passwordTextTmp = passwordTxt.getText();
            if (isValid(loginTextTmp) && isValid(passwordTextTmp))
            {
                accountsData.add(new Account(loginTextTmp, passwordTextTmp));
                accountTable.setItems(accountsData);

                loginColumn.setCellValueFactory(cellData -> cellData.getValue().getLoginProperty());
                passwordColumn.setCellValueFactory(cellData -> cellData.getValue().getPasswordProperty());

                loginTxt.clear();
                passwordTxt.clear();

                msgLogin.setTextFill(null);
                msgPassword.setTextFill(null);

                startApp.loadOverview(startApp.getBundle(), "fxml\\create.fxml");
            }
            else if(!isValid(loginTextTmp) && isValid(passwordTextTmp))
            {
                msgLogin.setText(startApp.getBundle().getString("msg.login"));
                msgLogin.setTextFill(Color.RED);

                msgPassword.setTextFill(null);
            }
            else if(isValid(loginTextTmp) && !isValid(passwordTextTmp))
            {
                msgPassword.setText(startApp.getBundle().getString("msg.password"));
                msgPassword.setTextFill(Color.RED);

                msgLogin.setTextFill(null);
            }
            else
            {
                msgLogin.setText(startApp.getBundle().getString("msg.login"));
                msgLogin.setTextFill(Color.RED);
                msgPassword.setText(startApp.getBundle().getString("msg.password"));
                msgPassword.setTextFill(Color.RED);
            }
        }));

        exit.setOnAction((event -> System.exit(0)));

    }

    private boolean isValid(String value)
    {
        if (value.isEmpty() || value.length() <= 0 || value == null )
        {
            return false;
        }
        return true;
    }

    public ObservableList<Account> getAccountsData()
    {
        return accountsData;
    }
}


text:
require File.dirname(__FILE__) + '/../../spec_helper'

module Spec
  module Distributed
    describe JobRunnerOptionParser do
      REQUIRED_OPTIONS = ['--transport-type', 'rinda']
      before(:each) do
        @out = StringIO.new
        @err = StringIO.new
        @parser = JobRunnerOptionParser.new(@err, @out)
      end

      def parse(args)
        @parser.parse(args)
        @parser.options
      end

      it "should parse transport manager" do
        options = parse(['--transport-type', 'rinda'])
        options.transport_type.should == "rinda"
        options.should be_valid
      end

      it "should have forked mode as the default" do
        option = parse(REQUIRED_OPTIONS)
        option.fork.should == true
      end

      it "should parse forked mode" do
        options = parse(['--fork'])
        options.fork.should == true
        options = parse(['--no-fork'])
        options.fork.should == false
      end

      it "should print help to stdout" do
        options = parse(['--help'])
        @out.rewind
        @out.read.should match(/Usage: remote_job_runner \[options\]/m)
      end

      it "should print help when invalid options are given" do
        options = parse([])
        @out.rewind
        @out.read.should match(/Usage: remote_job_runner \[options\]/m)
      end

    end

    describe Options do
      attr_reader :options
      before do
        @out = StringIO.new
        @err = StringIO.new
        @options = Options.new(@out, @err)
      end

      it "should return an instance of the transport_manager" do
        options.transport_type = "rinda"
        options.transport_manager.should be_instance_of(RindaTransportManager)
      end

      it "should parse options to the transport_manager" do
        options.transport_type = "rinda:1,2:3"
        RindaTransportManager.should_receive(:new).with("1,2:3")
        options.transport_manager
      end
    end

  end
end


text:
<?xml version="1.0" encoding="utf-8"?>

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="ChessTheme">
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:buttonStyle">@style/button</item>
        <item name="android:imageButtonStyle">@style/imageButton</item>
        <item name="android:textViewStyle">@style/ChessTextViewStyle</item>
        <item name="android:textAppearance">@style/ChessTextAppearance</item>
    </style>

</resources>