text:
package modification

import (
	"github.com/geordanr/go_xwing/attack"
	"github.com/geordanr/go_xwing/dice"
	"github.com/geordanr/go_xwing/gamestate"
	"github.com/geordanr/go_xwing/ship"
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestAccuracyCorrector(t *testing.T) {
	assert := assert.New(t)

	attacker := ship.New("Attacker", 0, 0, 0, 0, 0)
	defender := ship.New("Defender", 0, 0, 0, 0, 0)
	state := gamestate.GameState{}
	mod := AccuracyCorrector{}

	for i := 0; i < 100; i++ {
		attackResults := dice.RollAttackDice(10)
		state.SetAttackResults(&attackResults)

		state.EnqueueAttack(attack.New(attacker, defender, nil))
		mod.ModifyState(&state, attacker)

		attackResults = *state.AttackResults()
		if attackResults.Hits()+attackResults.Crits() < 2 {
			assert.EqualValues(0, attackResults.Blanks())
			assert.EqualValues(0, attackResults.Focuses())
			assert.EqualValues(2, attackResults.Hits())
			assert.EqualValues(0, attackResults.Crits())
		}
	}
}


text:
//========= Copyright 2016, HTC Corporation. All rights reserved. ===========

using HTC.UnityPlugin.PoseTracker;
using UnityEngine;
using Valve.VR;

namespace HTC.UnityPlugin.Vive
{
    /// <summary>
    /// To provide static APIs to retrieve devices' tracking status
    /// </summary>
    public static partial class VivePose
    {
        /// <summary>
        /// Returns true if input focus captured by current process
        /// Usually the process losses focus when player switch to deshboard by clicking Steam button
        /// </summary>
        public static bool HasFocus() { return hasFocus; }

        /// <summary>
        /// Returns true if the process has focus and the device identified by role is connected / has tracking
        /// </summary>
        public static bool IsValid(HandRole role) { return IsValid(role.ToDeviceRole()); }

        /// <summary>
        /// Returns true if the process has focus and the device identified by role is connected / has tracking
        /// </summary>
        public static bool IsValid(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && rawPoses[index].bDeviceIsConnected && rawPoses[index].bPoseIsValid && hasFocus;
        }

        /// <summary>
        /// Returns true if the device identified by role is connected.
        /// </summary>
        public static bool IsConnected(HandRole role) { return IsConnected(role.ToDeviceRole()); }

        /// <summary>
        /// Returns true if the device identified by role is connected.
        /// </summary>
        public static bool IsConnected(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && rawPoses[index].bDeviceIsConnected;
        }

        /// <summary>
        /// Returns true if tracking data of the device identified by role has valid value.
        /// </summary>
        public static bool HasTracking(HandRole role) { return HasTracking(role.ToDeviceRole()); }

        /// <summary>
        /// Returns true if tracking data of the device identified by role has valid value.
        /// </summary>
        public static bool HasTracking(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && rawPoses[index].bPoseIsValid;
        }

        public static bool IsOutOfRange(HandRole role) { return IsOutOfRange(role.ToDeviceRole()); }

        public static bool IsOutOfRange(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && (rawPoses[index].eTrackingResult == ETrackingResult.Running_OutOfRange || rawPoses[index].eTrackingResult == ETrackingResult.Calibrating_OutOfRange);
        }

        public static bool IsCalibrating(HandRole role) { return IsCalibrating(role.ToDeviceRole()); }

        public static bool IsCalibrating(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && (rawPoses[index].eTrackingResult == ETrackingResult.Calibrating_InProgress || rawPoses[index].eTrackingResult == ETrackingResult.Calibrating_OutOfRange);
        }

        public static bool IsUninitialized(HandRole role) { return IsUninitialized(role.ToDeviceRole()); }

        public static bool IsUninitialized(DeviceRole role)
        {
            var index = ViveRole.GetDeviceIndex(role);
            return index < rawPoses.Length && rawPoses[index].eTrackingResult == ETrackingResult.Uninitialized;
        }

        public static Vector3 GetVelocity(HandRole role, Transform origin = null) { return GetVelocity(role.ToDeviceRole(), origin); }

        public static Vector3 GetVelocity(DeviceRole role, Transform origin = null)
        {
            var index = ViveRole.GetDeviceIndex(role);
            var rawValue = Vector3.zero;

            if (index < rawPoses.Length)
            {
                rawValue = new Vector3(rawPoses[index].vVelocity.v0, rawPoses[index].vVelocity.v1, -rawPoses[index].vVelocity.v2);
            }

            return origin == null ? rawValue : origin.TransformVector(rawValue);
        }

        public static Vector3 GetAngularVelocity(HandRole role, Transform origin = null) { return GetAngularVelocity(role.ToDeviceRole(), origin); }

        public static Vector3 GetAngularVelocity(DeviceRole role, Transform origin = null)
        {
            var index = ViveRole.GetDeviceIndex(role);
            var rawValue = Vector3.zero;

            if (index < rawPoses.Length)
            {
                rawValue = new Vector3(-rawPoses[index].vAngularVelocity.v0, -rawPoses[index].vAngularVelocity.v1, rawPoses[index].vAngularVelocity.v2);
            }

            return origin == null ? rawValue : origin.TransformVector(rawValue);
        }

        /// <summary>
        /// Returns tracking pose of the device identified by role
        /// </summary>
        public static Pose GetPose(HandRole role, Transform origin = null) { return GetPose(role.ToDeviceRole(), origin); }

        /// <summary>
        /// Returns tracking pose of the device identified by role
        /// </summary>
        public static Pose GetPose(DeviceRole role, Transform origin = null)
        {
            var index = ViveRole.GetDeviceIndex(role);
            var rawPose = new Pose();

            if (index < poses.Length) { rawPose = poses[index]; }

            if (origin != null)
            {
                rawPose = new Pose(origin) * rawPose;
                rawPose.pos.Scale(origin.localScale);
            }

            return rawPose;
        }

        /// <summary>
        /// Set target pose to tracking pose of the device identified by role relative to the origin
        /// </summary>
        public static void SetPose(Transform target, HandRole role, Transform origin = null) { SetPose(target, role.ToDeviceRole(), origin); }

        /// <summary>
        /// Set target pose to tracking pose of the device identified by role relative to the origin
        /// </summary>
        public static void SetPose(Transform target, DeviceRole role, Transform origin = null) { Pose.SetPose(target, GetPose(role), origin); }
    }
}

redpajama_set_name: RedPajamaGithub


text:
php artisan optimize

php artisan migrate --force

php artisan route:clear

php artisan route:cache

php artisan config:clear

php artisan config:cache


text:
Markup Content Type For Feincms
------------------------------------

1. Install
====================================

2. Configure
====================================


text:
/**
 * Created by kunnisser on 2017/1/19.
 * 配置生成器
 */

import Game from '../combine/GameInit';
import Config from './Config';
import detect from '../assets/src/detect.min';

class GameConfigCreator {
    constructor() {};

    static createConfig() {
        Game.isDeskTop = GameConfigCreator.checkDesktop();
        let destTopFlag = Game.isDeskTop,
            w = Config.SOURCE_GAME_WIDTH,
            h = Config.SOURCE_GAME_HEIGHT;
        return {
            width: w,
            height: h,
            renderer: Phaser.AUTO,
            antialias: !1,
            enableDebug: Game.development
        }
    };

    static checkDesktop() {
        let valve = !1
            , agent = detect.parse(window.navigator.userAgent);
        return "Desktop" === agent.device.type && (valve = !0,
                agent.device.family.indexOf("Nexus") > -1 && (valve = !1)),
                valve
    }

}

export default GameConfigCreator;


text:
import { ConcreteWidget } from "./widget";
/**
 * Properties for a Text widget
 */
export interface TextWidgetProps {
    /**
     * The text to display, in MarkDown format
     */
    markdown: string;
    /**
     * Width of the widget, in a grid of 24 units wide
     *
     * @default 6
     */
    width?: number;
    /**
     * Height of the widget
     *
     * @default 2
     */
    height?: number;
}
/**
 * A dashboard widget that displays MarkDown
 */
export declare class TextWidget extends ConcreteWidget {
    private readonly markdown;
    constructor(props: TextWidgetProps);
    position(x: number, y: number): void;
    toJson(): any[];
}


text:
<?php require_once('includes/config.php'); ?>
<?php require_once('includes/db-connect.php'); ?>
<?php global $TITLE, $SITE_ROOT, $conn; ?>
<?php $TITLE = "Save Attendance Records"; ?>
    <!DOCTYPE html>
    <html>
    <?php require_once('includes/_head.php'); ?>
    <body class="skin-black">
    <div class='wrapper'>
        <?php require_once('includes/_header.php'); ?>
        <?php require_once('includes/attendance_records/_save.php'); ?>
        <?php require_once('includes/_footer.php'); ?>
    </div>
    </body>
    </html>
<?php require_once('includes/db-close.php'); ?>


text:
package com.docuware.dev.schema._public.services.platform;

import com.docuware.dev.Extensions.Extension;
import com.docuware.dev.Extensions.HttpClientProxy;
import com.docuware.dev.Extensions.IHttpClientProxy;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExportQuery", propOrder = {
"proxy",
    "settings",
    "source"
})
public class ExportQuery  implements IHttpClientProxy {
private HttpClientProxy proxy;//test

    @XmlElement(name = "Settings", required = true)
    protected ExportSettings settings;
    @XmlElement(name = "Source", required = true)
    protected DocumentsQuery source;

    /**The id of the dialog to be used to update fields which are hidden inside the store dialog.*/
    public ExportSettings getSettings() {
        return settings;
    }

    /**The id of the dialog to be used to update fields which are hidden inside the store dialog.*/
    public void setSettings(ExportSettings value) {
        this.settings = value;
    }

    /**The documents query that is executed.*/
    public DocumentsQuery getSource() {
        return source;
    }

    /**The documents query that is executed.*/
    public void setSource(DocumentsQuery value) {
        this.source = value;
    }

	/**
	* Gets the proxy.
	*
	* @return	The proxy
	*/
    @Extension
    public HttpClientProxy getProxy() {
	return this.proxy;
    }

	/**
	* Sets the HTTP Communication Proxy which is used in futher HTTP communication.
	*
	* @param proxy	The new proxy
	*/
    @Extension
    public void setProxy(HttpClientProxy proxy) {
	this.proxy = proxy;
    if(source != null){
		source.setProxy(proxy);
    }
    }

}


text:
package io.reflectoring.liquibase.adapter.api;

import io.reflectoring.liquibase.adapter.datastore.UserRepository;
import io.reflectoring.liquibase.domain.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UserController {

  private final UserRepository userRepository;

  public UserController(UserRepository userRepository) {
    this.userRepository = userRepository;
  }

  @PostMapping
  public User addUser(@RequestBody User user) {
    return userRepository.save(user);
  }

  @GetMapping("/{id}")
  public ResponseEntity<User> getUser(@PathVariable("id") Long userId) {
    return ResponseEntity.of(userRepository.findById(userId));
  }

}


text:
template <typename T> class matrix;

template<typename ValueType>
class matrix_column_iterator : public std::iterator<std::forward_iterator_tag, std::vector<ValueType>, ptrdiff_t,
                                                 const std::vector<ValueType>*, const std::vector<ValueType>&>
{
public:
    matrix_column_iterator() : matrix_(NULL), current_column_index_(0)
    {
    }

    explicit matrix_column_iterator(const matrix<ValueType>* matrix) : matrix_(matrix), current_column_index_(0)
    {
    }

    std::vector<ValueType> operator*() const
    {
        std::vector<ValueType> column;
        for (size_t i = 0; i < matrix_->rows_; ++i)
        {
            column.push_back(matrix_->data_[i][current_column_index_]);
        }

        return column;
    }

    const std::vector<ValueType>* operator->() const
    {
        return &(*this);
    }

    matrix_column_iterator& operator++()
    {
        ++current_column_index_;
        if (current_column_index_ > matrix_->columns_ - 1)
        {
            // Signal the end iterator
            matrix_ = NULL;
            current_column_index_ = 0;
        }

        return *this;
    }

    matrix_column_iterator operator++(int)
    {
        matrix_column_iterator previous = *this;
        ++(*this);

        return previous;
    }

    bool equal(const matrix_column_iterator& other) const
    {
        return matrix_ == other.matrix_ && current_column_index_ == other.current_column_index_;
    }

    bool operator==(const matrix_column_iterator& other) const
    {
        return equal(other);
    }

    bool operator!=(const matrix_column_iterator& other) const
    {
        return !equal(other);
    }

private:
    const matrix<ValueType>* matrix_;
    size_t current_column_index_;
};

#endif // __MATRIX_COLUMN_ITERATOR_H


text:
package com.netflix.curator.framework.recipes.cache;

interface Operation
{
    public void     invoke() throws Exception;
}


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

/**
 * @author bjorncs
 */
class BouncyCastleProviderHolder {

    private static final BouncyCastleProvider bcProvider = new BouncyCastleProvider();

    static BouncyCastleProvider getInstance() { return bcProvider; }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DotNetNuke.Web.InternalServices
{
    using DotNetNuke.Web.Api;

    public class ServiceRouteMapper : IServiceRouteMapper
    {
        public void RegisterRoutes(IMapRoute mapRouteManager)
        {
            mapRouteManager.MapHttpRoute(
                "InternalServices",
                "default",
                "{controller}/{action}",
                new[] { "DotNetNuke.Web.InternalServices" });
        }
    }
}


text:
<?php

namespace Pum\Bundle\ProjectAdminBundle\Extension\Widget\Widgets;

use Pum\Bundle\ProjectAdminBundle\Extension\Widget\Widget;

class Vars extends Widget
{
    const ICON   = 'settings';
    const COLOR  = 'asbestos';
    const WEIGHT = 15;

    public function __construct($name = 'pum_vars', $icon = self::ICON, $color= self::COLOR, $weight= self::WEIGHT)
    {
        parent::__construct($name, $icon, $color, $weight);

        $this
            ->setLabel('common.vars.leftnav')
            ->setRoute('pa_vars_index')
            ->setPermission('ROLE_PA_VARS')
        ;
    }
}


text:
package org.killbill.billing.plugin.adyen.client.model;

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

public class PaymentModificationResponse {

    private Map<Object, Object> additionalData;
    private String pspReference;
    private String response;

    public PaymentModificationResponse(final String response, final String pspReference, final Map<Object, Object> additionalData) {
        this.additionalData = additionalData;
        this.pspReference = pspReference;
        this.response = response;
    }

    public PaymentModificationResponse(final String response, final String pspReference) {
        this(response, pspReference, new HashMap<Object, Object>());
    }

    public PaymentModificationResponse() {
    }

    public Map<Object, Object> getAdditionalData() {
        return additionalData;
    }

    public void setAdditionalData(final Map<Object, Object> additionalData) {
        this.additionalData = additionalData;
    }

    public String getPspReference() {
        return pspReference;
    }

    public void setPspReference(final String pspReference) {
        this.pspReference = pspReference;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(final String response) {
        this.response = response;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("PaymentModificationResponse{");
        sb.append("additionalData=").append(additionalData);
        sb.append(", pspReference='").append(pspReference).append('\'');
        sb.append(", response='").append(response).append('\'');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final PaymentModificationResponse that = (PaymentModificationResponse) o;

        if (additionalData != null ? !additionalData.equals(that.additionalData) : that.additionalData != null) {
            return false;
        }
        if (pspReference != null ? !pspReference.equals(that.pspReference) : that.pspReference != null) {
            return false;
        }
        if (response != null ? !response.equals(that.response) : that.response != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = additionalData != null ? additionalData.hashCode() : 0;
        result = 31 * result + (pspReference != null ? pspReference.hashCode() : 0);
        result = 31 * result + (response != null ? response.hashCode() : 0);
        return result;
    }
}


text:
'use strict';
var util = require('util');
var path = require('path');
var events = require('events');
var chalk = require('chalk');
var _ = require('lodash');
var GroupedQueue = require('grouped-queue');

var debug = require('debug')('generators:environment');

var Store = require('./store');
var resolver = require('./resolver');
var TerminalAdapter = require('./adapter');

/**
 * `Environment` object is responsible of handling the lifecyle and bootstrap
 * of generators in a specific environment (your app).
 *
 * It provides a high-level API to create and run generators, as well as further
 * tuning where and how a generator is resolved.
 *
 * An environment is created using a list of `arguments` and a Hash of
 * `options`. Usually, this is the list of arguments you get back from your CLI
 * options parser.
 *
 * An optional adapter can be passed to provide interaction in non-CLI environment
 * (e.g. IDE plugins), otherwise a `TerminalAdapter` is instantiated by default
 *
 * @constructor
 * @mixes env/resolver
 * @param {String|Array} args
 * @param {Object} opts
 * @param {TerminalAdapter} [adaper] - A TerminalAdapter instance or another object
 *                                     implementing this adapter interface. This is how
 *                                     you'd interface Yeoman with a GUI or an editor.
 */

var Environment = module.exports = function Environment(args, opts, adapter) {
  events.EventEmitter.call(this);

  args = args || [];
  this.arguments = Array.isArray(args) ? args : args.split(' ');
  this.options = opts || {};
  this.adapter = adapter || new TerminalAdapter();
  this.cwd = this.options.cwd || process.cwd();
  this.store = new Store();

  this.runLoop = new GroupedQueue(['initializing', 'prompting', 'configuring', 'default',
  'writing', 'conflicts', 'install', 'end']);

  this.lookups = ['.', 'generators', 'lib/generators'];
  this.aliases = [];

  this.alias(/^([^:]+)$/, '$1:app');
};

util.inherits(Environment, events.EventEmitter);
_.extend(Environment.prototype, resolver);

/**
 * Error handler taking `err` instance of Error.
 *
 * The `error` event is emitted with the error object, if no `error` listener
 * is registered, then we throw the error.
 *
 * @param  {Object} err
 * @return {Error}  err
 */

Environment.prototype.error = function error(err) {
  err = err instanceof Error ? err : new Error(err);
  if (!this.emit('error', err)) {
    throw err;
  }

  return err;
};

/**
 * Outputs the general help and usage. Optionally, if generators have been
 * registered, the list of available generators is also displayed.
 *
 * @param {String} name
 */

Environment.prototype.help = function help(name) {
  name = name || 'init';

  var out = [
    'Usage: :binary: GENERATOR [args] [options]',
    '',
    'General options:',
    '  -h, --help     # Print generator\'s options and usage',
    '  -f, --force    # Overwrite files that already exist',
    '',
    'Please choose a generator below.',
    ''
  ];

  var ns = this.namespaces();

  var groups = {};
  ns.forEach(function (namespace) {
    var base = namespace.split(':')[0];

    if (!groups[base]) {
      groups[base] = [];
    }

    groups[base].push(namespace);
  });

  Object.keys(groups).sort().forEach(function (key) {
    var group = groups[key];

    if (group.length >= 1) {
      out.push('', key.charAt(0).toUpperCase() + key.slice(1));
    }

    groups[key].forEach(function (ns) {
      out.push('  ' + ns);
    });
  });

  return out.join('\n').replace(/:binary:/g, name);
};

/**
 * Registers a specific `generator` to this environment. This generator is stored under
 * provided namespace, or a default namespace format if none if available.
 *
 * @param  {String} name      - Filepath to the a generator or a NPM module name
 * @param  {String} namespace - Namespace under which register the generator (optional)
 * @return {this}
 */

Environment.prototype.register = function register(name, namespace) {
  if (!_.isString(name)) {
    return this.error(new Error('You must provide a generator name to register.'));
  }

  var modulePath = this.resolveModulePath(name);
  namespace = namespace || this.namespace(modulePath);

  if (!namespace) {
    return this.error(new Error('Unable to determine namespace.'));
  }

  this.store.add(namespace, modulePath);

  debug('Registered %s (%s)', namespace, modulePath);
  return this;
};

/**
 * Register a stubbed generator to this environment. This method allow to register raw
 * functions under the provided namespace. `registerStub` will enforce the function passed
 * to extend the Base generator automatically.
 *
 * @param  {Function} Generator - A Generator constructor or a simple function
 * @param  {String}   namespace - Namespace under which register the generator
 * @return {this}
 */

Environment.prototype.registerStub = function registerStub(Generator, namespace) {
  if (!_.isFunction(Generator)) {
    return this.error(new Error('You must provide a stub function to register.'));
  }
  if (!_.isString(namespace)) {
    return this.error(new Error('You must provide a namespace to register.'));
  }

  this.store.add(namespace, Generator);

  return this;
};

/**
 * Returns the list of registered namespace.
 * @return {Array}
 */

Environment.prototype.namespaces = function namespaces() {
  return this.store.namespaces();
};

/**
 * Returns stored generators meta
 * @return {Object}
 */

Environment.prototype.getGeneratorsMeta = function getGeneratorsMeta() {
  return this.store.getGeneratorsMeta();
};

/**
 * Get a single generator from the registered list of generators. The lookup is
 * based on generator's namespace, "walking up" the namespaces until a matching
 * is found. Eg. if an `angular:common` namespace is registered, and we try to
 * get `angular:common:all` then we get `angular:common` as a fallback (unless
 * an `angular:common:all` generator is registered).
 *
 * @param  {String} namespace
 * @return {Generator} - the generator registered under the namespace
 */

Environment.prototype.get = function get(namespace) {
  // Stop the recursive search if nothing is left
  if (!namespace) return;

  return this.store.get(namespace) ||
    this.store.get(this.alias(namespace)) ||
    this.get(namespace.split(':').slice(0, -1).join(':'));
};

/**
 * Create is the Generator factory. It takes a namespace to lookup and optional
 * hash of options, that lets you define `arguments` and `options` to
 * instantiate the generator with.
 *
 * An error is raised on invalid namespace.
 *
 * @param {String} namespace
 * @param {Object} options
 */

Environment.prototype.create = function create(namespace, options) {
  options = options || {};

  var names = namespace.split(':');
  var name = names.slice(-1)[0];

  var Generator = this.get(namespace);

  if (!Generator) {
    return this.error(
      new Error(
        'You don\'t seem to have a generator with the name ' + namespace + ' installed.\n' +
        chalk.bold('You can see available generators with ' + 'npm search yeoman-generator') +
        chalk.bold(' and then install them with ' + 'npm install [name]') + '.\n' +
        'To see the ' + this.namespaces().length + ' registered generators run yo with the `--help` option.'
      )
    );
  }

  return this.instantiate(Generator, options);
};

/**
 * Instantiate a Generator with metadatas
 *
 * @param {String}       namespace
 * @param {Object}       options
 * @param {Array|String} options.arguments  Arguments to pass the instance
 * @param {Object}       options.options    Options to pass the instance
 */

Environment.prototype.instantiate = function instantiate(Generator, options) {
  options = options || {};

  var args = options.arguments || options.args || _.clone(this.arguments);
  args = Array.isArray(args) ? args : args.split(' ');

  var opts = options.options || _.clone(this.options);

  opts.env = this;
  opts.resolved = Generator.resolved || 'unknown';
  opts.namespace = Generator.namespace;
  return new Generator(args, opts);
};

/**
 * Tries to locate and run a specific generator. The lookup is done depending
 * on the provided arguments, options and the list of registered generators.
 *
 * When the environment was unable to resolve a generator, an error is raised.
 *
 * @param {String|Array} args
 * @param {Object}       options
 * @param {Function}     done
 */

Environment.prototype.run = function run(args, options, done) {
  args = args || this.arguments;

  if (typeof options === 'function') {
    done = options;
    options = this.options;
  }

  if (typeof args === 'function') {
    done = args;
    options = this.options;
    args = this.arguments;
  }

  args = Array.isArray(args) ? args : args.split(' ');
  options = options || this.options;

  var name = args.shift();
  if (!name) {
    return this.error(new Error('Must provide at least one argument, the generator namespace to invoke.'));
  }

  var generator = this.create(name, {
    args: args,
    options: options
  });

  if (generator instanceof Error) {
    return generator;
  }

  if (options.help) {
    return console.log(generator.help());
  }

  generator.on('start', this.emit.bind(this, 'generators:start'));
  generator.on('start', this.emit.bind(this, name + ':start'));

  generator.on('method', function (method) {
    this.emit(name + ':' + method);
  }.bind(this));

  generator.on('end', this.emit.bind(this, name + ':end'));
  generator.on('end', this.emit.bind(this, 'generators:end'));

  return generator.run(done);
};

/**
 * Given a String `filepath`, tries to figure out the relative namespace.
 *
 * ### Examples:
 *
 *     this.namespace('backbone/all/index.js');
 *     // => backbone:all
 *
 *     this.namespace('generator-backbone/model');
 *     // => backbone:model
 *
 *     this.namespace('backbone.js');
 *     // => backbone
 *
 *     this.namespace('generator-mocha/backbone/model/index.js');
 *     // => mocha:backbone:model
 *
 * @param {String} filepath
 */

Environment.prototype.namespace = function namespace(filepath) {
  if (!filepath) {
    throw new Error('Missing namespace');
  }

  // cleanup extension and normalize path for differents OS
  var ns = path.normalize(filepath.replace(path.extname(filepath), ''));

  // Sort lookups by length so biggest are removed first
  var lookups = _(this.lookups).map(path.normalize).sortBy('length').value().reverse();

  // if `ns` contain a lookup dir in it's path, remove it.
  ns = lookups.reduce(function (ns, lookup) {
    return ns.replace(lookup, '');
  }, ns);

  // cleanup `ns` from unwanted parts and then normalize slashes to `:`
  ns = ns
    .replace(/(.*generator-)/, '') // remove before `generator-`
    .replace(/[\/\\](index|main)$/, '') // remove `/index` or `/main`
    .replace(/\.+/g, '') // remove `.`
    .replace(/^[\/\\]+/, '') // remove leading `/`
    .replace(/[\/\\]+/g, ':'); // replace slashes by `:`

  debug('Resolve namespaces for %s: %s', filepath, ns);

  return ns;
};

/**
 * Resolve a module path
 * @param  {String} moduleId - Filepath or module name
 * @return {String}          - The resolved path leading to the module
 */

Environment.prototype.resolveModulePath = function resolveModulePath(moduleId) {
  if (moduleId[0] === '.') {
    moduleId = path.resolve(moduleId);
  }

  if (moduleId[0] === '~') {
    moduleId = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'] + moduleId.slice(1);
  }

  return require.resolve(moduleId);
};

/**
 * Make sure the Environment present expected methods if an old version is
 * passed to a Generator.
 * @param  {Environment} env
 * @return {Environment} The updated env
 */

Environment.enforceUpdate = function (env) {
  if (!env.adapter) {
    env.adapter = new TerminalAdapter();
  }
  if (!env.runLoop) {
    env.runLoop = new GroupedQueue(['initializing', 'prompting', 'configuring', 'default',
    'writing', 'conflicts', 'install', 'end']);
  }
  return env;
};


text:
var fs = require('fs');
var scoper = require('../');

var src = fs.readFileSync(__dirname + '/source/nested.js', 'utf8');
var c = Function('return ' + scoper(src))();
console.dir(c);


text:
package com.lexicalscope.jewel.cli.examples;

import com.lexicalscope.jewel.cli.Option;

public interface MultipleOptionNames {
    @Option(longName = { "count", "cardinality" }) int getCount();
}


text:
/// <reference path='../../lib/excalibur.d.ts' />

var game = new ex.Engine({ width: 800, height: 600, canvasElementId: 'game' });
var label = new ex.Label({text: '', x: 400, y: 300, font: new ex.Font({size: 48, family: 'Arial'})});
label.color = ex.Color.Chartreuse;
label.font.textAlign = ex.TextAlign.Center;

game.add(label);

game.on('postupdate', (ue: ex.PostUpdateEvent) => {
  var keys = game.input.keyboard
    .getKeys()
    .map((k) => {
      return (ex.Input.Keys[k] || 'Unknown') + '(' + k.toString() + ')';
    })
    .join(', ');

  label.text = keys;

  if (game.input.keyboard.wasPressed(ex.Input.Keys.Enter)) {
    console.log("Enter Pressed");
  }
});

game.start();


text:
Stalker is a utility to watch a directory tree for incoming files. When if finds
one, it will fire off a callback function __OF YOUR CHOICE!__.

It should be smart enough to handle multiple files/folders being dropped into the
directory being stalked.

## Installation

    $ npm install stalker

## How to use

    var stalker = require('stalker');

    stalker.watch('some_directory', function (err, file) {
      console.log('I saw a file. It was going like this: ' + file);
    });

Optionally, you can pass in a buffer time in milliseconds to make stalker batch up
the files and send them back in an array. The timer only starts when a new file
drops.

    stalker.watch('./example', {buffer: 5000}, function(err, f) {
      f.forEach(function _forEach(_f) {
        console.log('I see ' + _f);
      });
    });

Stalker will also take a second callback that will be fired when files are removed:

  stalker.watch('./example', function(err, f) {
    console.log('Added: ' + f);
  }, function(err, f) {
    console.log('Removed: ' + f);
  });

The removal callback also works in batch mode.

## Running tests

    npm install vows
    vows spec/*

You can also run example/*.js and play around adding and removing files from the
example directory:

    node example/test.js

## License

(The MIT License)

Copyright (c) 2011 Justin Slattery (Justin.Slattery@fzysqr.com)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Gir
                              :/::-.`
                            .o-```.:+o++//-
                           ++`````--------/o++:`
                         .o.````.-------------:++/:---------.`
                        ++````.-------------------+oo+++++//+oso/:.
              ://o:   `s-````-----------------------:oo-       `-:+o+.--`
            -+/::shy:-s````.-------:++++/:-------------+o:           +/:/o`
           /+::::hhhhy````-----:+++/:::::+++:------------/s-          .::/`
          o/::::ohhhh+``.----/o+::::::::::::+o:------------+o`
         o/::::+dhhhd.`.---:o+::::::::::::::::s:------------:s/
        +/::::/hhhhhs`----/o::::::::::::::::::/y-------------:ss`
       -+::::/hhhhhh.----/o::::::::::::::::::::m+-----------/oooh-
       o::::+hhhhhy.-----s::::::::::::::::::::sho---------:/oooooy/
      .o:::shhhhho`-----:o:::::::::::::::::::odd/--------:+oooooooy/
      .o/ohhhhhy:`.-----:s:::::::::::::::::/yhho--------/oooooooooy/
       `------y-``-------o+::::::::::::::/shhh+-------:+ooooooooy+`
              y``.:oo+:---/o/:::::::::/oyhhhs:-------/ooooooooys.
              y``-y.o.+o----/ossooosyhhhhyo:-------:+ooooooosy-
              y``++-/`-Nh------/+osssoo/:--------:/ooooooooy:
              o-`-sNmhNMMo----------------------/+oooooooy+
              `y`.-NMMMMMm--------------------/+oooooooyo`
               :+`/MMMMMMh------------------/+oooooooyo`
                :o.smNNds:---------------:/+oooooooyo.
                 .o/-------------------:/+oooooooy+`
                   .+o:-------------:/+oooooooss/`
                      :+o+:-----://+oooooooys+.
                         `:/+osyssoossyysohdo/`
                               `.----.`    ./sds/.
                                             .:oymho/:///`
                                         `-`+-:sh:-o-:::/s
                                        .o+ooos:/s/s:++:+s
                                        +h/:yho+/:s/sooyd`
                                            .s.:/ooss+yoy
                                            /+-////o+soh`
                                      `://o+.s/:--:/oyo`
                                   .+++:s/.   .//+y/:`
                                  /+.-/y-      :o+h
                                  y`-:oy+     //--os/`
                                  //+oysy`    //.-:+oys+-
                                               /+/++oyso:
                                                  `.`


text:
SYNONYM

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

#### Published in
Bull. Jard. Bot. Nat. Belg. 54(1-2): 176 (1984)

#### Original name
Hymenagaricus rubescens Heinem. & Little Flower, 1984

### Remarks
null


text:
Litmus
======

A simple wrapper around the Litmus *customer* API using httparty. This does not use the reseller API and should not be used to reset Litmus services. See the [API documentation](http://docs.litmus.com/w/page/18056603/Customer-API-documentation) for details

Currently Implmented
--------------------
* Litmus::EmailTest.list
* Litmus::EmailTest.show(id)
* Litmus::EmailTest.find_by_name(name)
* Litmus::EmailTest.create({:subject => '', :body => ''}, name = nil)
* Litmus::EmailTest.rename(id, new_name)
* Litmus::EmailTest.destroy(id)
* Litmus::PageTest.list
* Litmus::PageTest.show(id)
* Litmus::PageTest.find_by_name(name)
* Litmus::PageTest.create(url, name = nil)
* Litmus::PageTest.rename(id, new_name)
* Litmus::PageTest.destroy(id)
* Litmus::TestVersion.list(test_id)
* Litmus::TestVersion.show(test_id, test_version_id)
* Litmus::TestVersion.poll(test_id, test_version_id)
* Litmus::TestVersion.create(test_id)
* Litmus::Result.list(test_id, test_version_id)
* Litmus::Result.show(test_id, test_version_id, result_id)
* Litmus::Result.retest(test_id, test_version_id, result_id)
* Litmus::Result.update(test_id, test_version_id, result_id, new_state)
* Litmus::Report.list
* Litmus::Report.create(new_name)
* Litmus::Report.show(id)

Install
-------
`gem install litmus`

Example Usage
-------------

    # Setup the authentication details
    use_ssl = true # You must turn on SSL here if you have SSL enabled in Litmus
    Litmus::Base.configure("your_company_subdomain", "username", "password", use_ssl)

    # Lets create an email test
    email_test = Litmus::EmailTest.create
    send_test_to = email_test["test_set_versions"].first["url_or_guid"] #=> "f1b17db@emailtests.com"
    test_id = email_test["id"] #=> 1716534
    version = email_test["test_set_versions"].first["version"] #=> 1

    # If we query our new version we can see Litmus have not had the email yet
    Litmus::TestVersion.show(test_id, version)["received"] #=> false

    # Lets send them the email
    Pony.mail(:to => send_test_to, :from => 'mail@matthewfawcett.co.uk', :subject => 'hi', :body => 'Hello there, this is a test')

    # Alternatively, we could have included the email when the test was created
    alternative_test = Litmus::EmailTest.create({:subject => 'Hello', :body => 'Hello, world'})

    # Now they have it
    Litmus::TestVersion.show(test_id, version)["received"] #=> "true"

    # Lets poll the results and look at the first client
    Litmus::TestVersion.poll(test_id, version)["results"].first.inspect #=> {"id"=>33539350, "test_code"=>"hotmail", "state"=>"pending"}

    # The hotmail test is still pending, lets wait for a while
    sleep 10

    # Lets poll the results again and see that its complete
    Litmus::TestVersion.poll(test_id, version).first.inspect #=> {"id"=>33539350, "test_code"=>"hotmail", "state"=>"complete"}

    # Now let's show the result for this test version
    image_url = Litmus::Result.show(test_id, version, 33539350)["result_images"].first["full_image"] #=> "s3.amazonaws.com/resultcaptures/2f21fc9c-08f6-4429-b53d-2e224189526b.fullpageon.png"

    # And we can retest the results
    Litmus::Result.retest(test_id, version, 33539350)
    # poll again until you have results

    # And update the the state to ticked
    Litmust::Result.update(test_id, version, 33539350, :ticked)

    # Let's rename this test to something more intuitive
    Litmus::Test.rename(test_id, 'My email test')

    # We can later look up the test by this name...
    Litmus::Test.find_by_name('My email test')

    system("open http://#{image_url}")

    # Looks good! Let's clean up...
    Litmus::Test.destroy(test_id)

    # Next, let's try a report of email views
    report = Litmus::Report.create("Newsletter")
    report_id = report["id"]
    html_to_include_in_email = report["bug_html"] # bug as in listening device, I assume

    # Get the report later after the send
    report = Litmus::Report.show(report_id)

    # View a list of last 1000 reports
    reports = Litmus::Report.list


text:
using DragonSpark.Compose;
using DragonSpark.Model.Commands;
using JetBrains.Annotations;
using LightInject;
using System;

namespace DragonSpark.Composition;

sealed class ConfigureDefaultActivation : ICommand<IServiceContainer>
{
	[UsedImplicitly]
	public static ConfigureDefaultActivation Default { get; } = new();

	ConfigureDefaultActivation() : this(IsFallbackCandidate.Default.Get, Start.A.Selection<ServiceRequest>()
	                                                                          .By.Calling(x => x.ServiceType)
	                                                                          .Then()
	                                                                          .Activate()) {}

	readonly Func<Type, string, bool>     _condition;
	readonly Func<ServiceRequest, object> _select;

	public ConfigureDefaultActivation(Func<Type, string, bool> condition, Func<ServiceRequest, object> select)
	{
		_condition = condition;
		_select    = select;
	}

	public void Execute(IServiceContainer parameter)
	{
		parameter.RegisterInstance(parameter)
		         .RegisterFallback(_condition, _select);
	}
}


text:
<!doctype html>

  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>cccbutton.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <meta charset="utf8">

      Closure Library API Documentation

        Go to class or file:
        <input type="text" id="ac">

cccbutton.js

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Copyright 2006 Google Inc. All Rights Reserved.

/**
 * @fileoverview This class is now deprecated.  Use {@link goog.ui.Button} and
 * {@link goog.ui.CustomButtonRenderer} to create CCC-style buttons.  See
 * closure/demos/button.html for an example.
 *
 */

goog.provide('goog.ui.CccButton');

goog.require('goog.dom');
goog.require('goog.dom.classes');
goog.require('goog.events');
goog.require('goog.events.Event');
goog.require('goog.events.EventTarget');
goog.require('goog.ui.DeprecatedButton');
goog.require('goog.userAgent');

/**
 * CCC-style implementation of a button.
 * The Html structure of the button is:
 * <pre>
 *  Element
 * ------------------------
 * - a
 *     - b
 *         - b
 *             - b
 *                 - text
 * </pre>
 *
 * @param {string} opt_class Optional class for component.
 *     Default: 'goog-cccbutton'.
 * @param {boolean} opt_noPoundSignInHref An optional argument that, when true,
 *     instructs the button to not use the href="#" to create the link. The
 *     side effect of this option being true is that clicking the button
 *     triggers the window's onunload or onbeforeunload handler in IE. The
 *     upside of setting this to true is that the page will not scroll when
 *     clicking this button in IE.
 *
 * @constructor
 * @extends {goog.ui.DeprecatedButton}
 * @deprecated Use {@link goog.ui.Button} instead.
 */
goog.ui.CccButton = function(opt_class, opt_noPoundSignInHref) {
  var className = opt_class ? opt_class : 'goog-cccbutton';
  goog.ui.DeprecatedButton.call(this, className);

  /**
   * Whether the 'a' element used for the button will use href='#' or instead
   * use href='javascript:;'.
   * @type {boolean}
   * @private
   */
  this.noPoundSignInHref_ = opt_noPoundSignInHref || false;
};
goog.inherits(goog.ui.CccButton, goog.ui.DeprecatedButton);

/**
 * Prefix for all ID's of this component.
 * @type {string}
 * @private
 */
goog.ui.CccButton.BASE_ID_ = 'goog.ui.CccButton.';

/**
 * Next unique instance ID for this component.
 * @type {number}
 * @private
 */
goog.ui.CccButton.nextId_ = 0;

/**
 * Gets the next unique ID for the component.
 * @return {string} The next unique ID for the component.
 */
goog.ui.CccButton.getNextUniqueId = function() {
  return goog.ui.CccButton.BASE_ID_ + String(goog.ui.CccButton.nextId_++);
};

/**
 * Gets the next unique ID for the component. This method is used in the
 * constructor to generate the unique ID for the component.
 *
 * NOTE: This method is placed on the prototype so that classes that inherit
 * this class can override this method and have the ID automatically set by
 * calling the parent class's constructor.
 *
 * @return {string} The next unique ID for the component.
 * @private
 */
goog.ui.CccButton.prototype.getNextUniqueId_ = function() {
  return goog.ui.CccButton.getNextUniqueId();
};

/**
 * Element that directly contains the caption for the component.
 * @type {Element?}
 * @private
 */
goog.ui.DeprecatedButton.prototype.captionEl_ = null;

/**
 * Addition to base CSS class name to add when component is enabled.
 * @type {string}
 * @private
 */
goog.ui.CccButton.ENABLED_CLASS_ADDITION_ = '-enabled';

/**
 * Addition to base CSS class name to add when component is disabled.
 * @type {string}
 * @private
 */
goog.ui.CccButton.DISABLED_CLASS_ADDITION_ = '-disabled';

/**
 * Gets the CSS class to use for when enabled.
 * @return {string} The CSS class name.
 */
goog.ui.CccButton.prototype.getEnabledClass = function() {
  return this.class_ + goog.ui.CccButton.ENABLED_CLASS_ADDITION_;
};

/**
 * Gets the CSS class to use for when disabled.
 * @return {string} The CSS class name.
 */
goog.ui.CccButton.prototype.getDisabledClass = function() {
  return this.class_ + goog.ui.CccButton.DISABLED_CLASS_ADDITION_;
};

/**
 * Sets the caption for the component.
 * @param {string} caption The caption.
 */
goog.ui.CccButton.prototype.setCaption = function(caption) {
  this.caption_ = caption;
  if (this.isRendered()) {
    var element = this.captionEl_;
    element.innerHTML = '';
    var domHelper = goog.dom.getDomHelper(element);
    domHelper.appendChild(element, domHelper.createTextNode(caption));
  }
};

/**
 * Sets the enabled status of the component.
 * @param {boolean} enable TRUE iff enable the button. Otherwise, disable.
 */
goog.ui.CccButton.prototype.setEnabled = function(enable) {
  if (this.getEnabled() != enable &&
      this.dispatchEvent(goog.ui.DeprecatedButton.EventType.ENABLE)) {
    if (this.isRendered()) {
      // Swap the CSS class for enabled/disabled.
      var element = this.getElement();
      var fromClass = !enable ? this.getEnabledClass() :
          this.getDisabledClass();
      var toClass = enable ? this.getEnabledClass() : this.getDisabledClass();
      goog.dom.classes.swap(element, fromClass, toClass);
    }
    this.enabled_ = enable;
  }
};

/**
 * Renders the component. Throws an Error if the component is already rendered.
 * @param {Element} opt_element Element to render the compponent into.
 *                              If omitted, then the componenet is appended to
 *                              the document.
 */
goog.ui.CccButton.prototype.render = function(opt_element) {
  if (this.isRendered()) {
    throw Error('Compenent already rendered');
  }

  // Get the DOM helper.
  var domHelper = goog.dom.getDomHelper(opt_element);

  // Adding # was problematic in non-IE, cause of bug 572520.
  var hrefString = goog.userAgent.IE ? '#' : 'javascript:;';
  hrefString = this.noPoundSignInHref_ ? 'javascript:;' : hrefString;

  // Create element.
  var element = domHelper.createDom('a',
      {title: this.tooltip_, className: this.class_ + ' ' +
          (this.enabled_ ? this.getEnabledClass() : this.getDisabledClass()),
          href: hrefString },
              domHelper.createDom('b', {},
                  domHelper.createDom('b', {},
                      this.captionEl_ =
                          domHelper.createDom('b', {}, this.caption_))));

  // Append to parent.
  var parentElement = opt_element || domHelper.getDocument().body;
  domHelper.appendChild(parentElement, element);

  // Setup event handlers.
  goog.events.listen(element, goog.events.EventType.CLICK,
      this.onClick_, true, this);

  this.element_ = element;
  this.rendered_ = true;
};

/**
 * Helper for checking if the structure of an element is valid for this
 * component.
 * @param {Element} element The element to check.
 * @param {string} tag The tag name to check for.
 * @return {boolean} Whether there is only one child and the child is of the
 *     given tag.
 * @private
 */
goog.ui.CccButton.prototype.isValidButtonChildHelper_ = function(element, tag) {
  var domHelper = goog.dom.getDomHelper(element);
  var firstChild = element ? domHelper.getFirstElementChild(element) : null;
  if (firstChild && firstChild.tagName.toLowerCase() == tag &&
      element.childNodes.length == 1) {
    return true;
  }
  return false;
};

/**
 * Decorates the element for the UI component.
 * @param {Element} element Element to decorate.
 */
goog.ui.CccButton.prototype.decorate = function(element) {
  if (this.isRendered()) {
    throw Error('Component already rendered');
  } else {
    var domHelper = goog.dom.getDomHelper(element);
    var firstElement = element ? domHelper.getFirstElementChild(element) : null;
    var secondElement = firstElement ?
        domHelper.getFirstElementChild(firstElement) : null;
    // Check if the structure of the element is valid for this component.
    if (element && element.tagName.toLowerCase() == 'a' &&
        this.isValidButtonChildHelper_(element, 'b') &&
        this.isValidButtonChildHelper_(firstElement, 'b') &&
        this.isValidButtonChildHelper_(secondElement, 'b')) {
      // Setup properties.
      this.element_ = element;
      this.setCaption(secondElement.firstChild.innerHTML);
      this.setTooltip(element.title);
      this.class_ = element.className;
      this.rendered_ = true;
    } else {
      throw Error('Invalid element to decorate');
    }
  }
};


text:
namespace gpnaucrates
{
//---------------------------------------------------------------------------
//	@class:
//		CDatumOidGPDB
//
//	@doc:
//		GPDB-specific oid representation
//
//---------------------------------------------------------------------------
class CDatumOidGPDB : public IDatumOid
{
private:
	// type information
	IMDId *m_mdid;

	// oid value
	OID m_val;

	// is null
	BOOL m_is_null;

	// private copy ctor
	CDatumOidGPDB(const CDatumOidGPDB &);

public:
	// ctors
	CDatumOidGPDB(CSystemId sysid, OID oid_val, BOOL is_null = false);
	CDatumOidGPDB(IMDId *mdid, OID oid_val, BOOL is_null = false);

	// dtor
	virtual ~CDatumOidGPDB();

	// accessor of metadata type id
	virtual IMDId *MDId() const;

	// accessor of size
	virtual ULONG Size() const;

	// accessor of oid value
	virtual OID OidValue() const;

	// accessor of is null
	virtual BOOL IsNull() const;

	// return string representation
	virtual const CWStringConst *GetStrRepr(CMemoryPool *mp) const;

	// hash function
	virtual ULONG HashValue() const;

	// match function for datums
	virtual BOOL Matches(const IDatum *) const;

	// copy datum
	virtual IDatum *MakeCopy(CMemoryPool *mp) const;

	// print function
	virtual IOstream &OsPrint(IOstream &os) const;

};	// class CDatumOidGPDB
}  // namespace gpnaucrates

#endif	// !GPNAUCRATES_CDatumOidGPDB_H

// EOF


text:
class Client < ActiveRecord::Base
  has_many :services
  belongs_to :region
end

class Service < ActiveRecord::Base
end

class Region < ActiveRecord::Base
end

class Contact < ActiveRecord::Base
end

class ClientContactAssignment < ActiveRecord::Base
  belongs_to :client
  belongs_to :contact
end

class MaterializedClient < ActiveRecord::Base
end


text:
  #ifdef LIB_STATIC
    #define WIDGET_ACCESSOR_DEMO_DECL
  #else
    #ifdef WIDGET_ACCESSOR_DEMO_EXPORT
#define WIDGET_ACCESSOR_DEMO_DECL __declspec(dllexport)
    #else
#define WIDGET_ACCESSOR_DEMO_DECL __declspec(dllimport)
    #endif
  #endif
#else
#define WIDGET_ACCESSOR_DEMO_DECL
#endif

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

    <title>Open LDAP Public License v2.6</title>

    <link rel="shortcut icon" href="sites/all/themes/spdx/favicon.ico" type="image/x-icon" />

    <link type="text/css" rel="stylesheet" href="screen.css" media="screen" type="text/css" />
    <link type="text/css" rel="stylesheet" media="all" href="sites/all/themes/spdx/universe_nav.css?a" />
    <link type="text/css" rel="stylesheet" media="all" href="sites/all/themes/spdx/style.css?a" />
    <link type="text/css" rel="stylesheet" media="all" href="sites/all/themes/spdx/zen.css?a" />

LINUXFOUNDATION.ORG

EVENTS

Software Package Data Exchange®

Home » Licenses

Open LDAP Public License v2.6

Full name

Open LDAP Public License v2.6

Short identifier

OLDAP-2.6

Other web pages for this license

http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=LICENSE;hb=1cae062821881f41b73012ba816434897abf4205

false

Notes

This license was released 14 June 2001.

Text

The OpenLDAP Public License

Version 2.6, 14 June 2001

Redistribution and use of this software and associated documentation ("Software"), with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain copyright statements and notices.

2. Redistributions in binary form must reproduce applicable copyright statements and notices, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Redistributions must contain a verbatim copy of this document.

4. The names and trademarks of the authors and copyright holders must not be used in advertising or otherwise to promote the sale, use or other dealing in this Software without specific, written prior permission.

5. The OpenLDAP Foundation may revise this license from time to time. Each revision is distinguished by a version number. You may use the Software under terms of this license revision or under the terms of any subsequent revision of the license.

THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED 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 OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S) OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

OpenLDAP is a trademark of the OpenLDAP Foundation.

Copyright 1999-2001 The OpenLDAP Foundation, Redwood City, California, USA. All Rights Reserved. Permission to copy and distributed verbatim copies of this document is granted.

Standard License Header

There is no standard license header for the license

Who are we?

The Linux Foundation is a non-profit consortium dedicated to fostering the growth of Linux.

More on the Foundation...

Explore

        Search or Browse

        Home / News / Announcements

        Blogs / Publications

        Events / Workgroups

        Membership / Members

Stay Current

        Linux Foundation Events

        Linux Foundation Public Calendar

        Linux Training

        Linux.com

        Linux Foundation Monthly Newsletter

About

        Frequently Asked Questions

        How do I get Involved?

        About / Contact Us / Careers

        Staff / Board Members

        Privacy Policy / Terms of Use / Trademarks / Workgroups FAQ

Copyright © 2013 The Linux Foundation. All rights
reserved.

Linux Foundation, Linux Standard Base, LSB, LSB Certified, IAccessible2, MeeGo are registered trademarks of the Linux Foundation.

Linux is a registered trademark of Linus Torvalds. Please see our privacy policy.


text:
<?php

namespace Storage\Uploader;

use Gaufrette\Filesystem;
use Storage\Model\FileAwareInterface;

class Uploader
{
    protected $filesystem;

    public function __construct(Filesystem $filesystem)
    {
        $this->filesystem = $filesystem;
    }

    public function upload(FileAwareInterface $object)
    {
        if (!$object->hasFile()) {
            return;
        }

        if (null !== $object->getPath()) {
            $this->remove($object->getPath());
        }

        do {
            $hash = md5(uniqid(mt_rand(), true));
            $path = $this->expandPath($hash.'.'.$object->getFile()->guessExtension());
        } while ($this->filesystem->has($path));

        $object->setPath($path);

        $this->filesystem->write(
            $object->getPath(),
            file_get_contents($object->getFile()->getPathname())
        );
    }

    public function remove($path)
    {
        return $this->filesystem->delete($path);
    }

    private function expandPath($path)
    {
        return sprintf(
            '%s/%s/%s',
            substr($path, 0, 2),
            substr($path, 2, 2),
            substr($path, 4)
        );
    }
}


text:
ACCEPTED

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

#### Published in
M. M. Willkomm & J. M. C. Lange, Prodr. fl. hispan. 1:141. 1861

#### Original name
null

### Remarks
null


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

namespace Denvelope
{
    class Program
    {
        static void Main(string[] args)
        {
            string file = args[0];
            List<TaskID> taskList = new List<TaskID>();
            Preset preset = Preset.none;
            if (args.Length > 1)
            {
                for (int i = 1; i < args.Length; i++)
                {
                    string arg = args[i];
                    if (arg == "-min")
                        preset = Preset.min;
                    else if (arg == "-mid")
                        preset = Preset.mid;
                    else if (arg == "-max")
                        preset = Preset.max;
                    else
                    {
                        if (arg == "-invalidMd")
                            taskList.Add(TaskID.InvalidMD);
                        if (arg == "-ren")
                            taskList.Add(TaskID.Ren);
                        if (arg == "-antiDbg")
                            taskList.Add(TaskID.AntiDebug);
                        if (arg == "-stringEnc")
                            taskList.Add(TaskID.StringEnc);
                        if (arg == "-ctrlFlow")
                            taskList.Add(TaskID.CtrlFlow);
                    }
                }
            }
            else
                preset = Preset.max;
            Context ctx;
            if (preset == Preset.none)
                ctx = new Context(file, taskList);
            else
                ctx = new Context(file, preset);
            Processor.LogInfo l = LogInfo;
            Processor.LogWarn w = LogWarn;
            Processor.LogErr e = LogErr;
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("                       Denvelope obfuscator 2014 - 2015" + Environment.NewLine);
            Console.ResetColor();
            Console.WriteLine("File: " + file + Environment.NewLine);
            Processor.Process(ctx, l, w, e);
            Console.WriteLine("Finished.");
            Console.Read();
        }

        public static void LogInfo(string s)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("[Info] "+s);
            Console.ResetColor();
        }

        public static void LogWarn(string s)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("[Warning] " + s);
            Console.ResetColor();
        }

        public static void LogErr(string s)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("[Error] " + s);
            Console.ResetColor();
        }
    }
}


text:
/*=============================================================================
# Filename: GET-example.cpp
# Author: suxunbin
# Last Modified: 2021-07-20 20:51
# Description: a simple GET-example of C++ API
=============================================================================*/

#include <stdio.h>
#include <iostream>
#include <string>
#include <fstream>
#include "GstoreConnector.h"

using namespace std;

// before you run this example, make sure that you have started up ghttp service (using bin/ghttp [port])
// "GET" is a default parameter that can be omitted
int main(int argc, char* argv[])
{
	std::string IP = "127.0.0.1";
	int Port = 9000;
	std::string username = "root";
	std::string password = "123456";
	std::string sparql = "select ?x where \
                         { \
                         ?x    <rdf:type>    <ub:UndergraduateStudent>. \
                         ?y    <ub:name> <Course1>. \
                         ?x    <ub:takesCourse>  ?y. \
                         ?z    <ub:teacherOf>    ?y. \
                         ?z    <ub:name> <FullProfessor1>. \
                         ?z    <ub:worksFor>    ?w. \
                         ?w    <ub:name>    <Department0>. \
                         }";
	std::string filename = "res.txt";

	// start a gc with given IP, Port, username and password
	GstoreConnector gc(IP, Port, username, password);

	// build a database with a RDF graph
	std::string res = gc.build("lubm", "data/lubm/lubm.nt");
	cout << res << endl;

	// load the database
	res = gc.load("lubm");
	cout << res << endl;

	// show all users
	res = gc.showuser();
	cout << res << endl;

	// query
	res = gc.query("lubm", "json", sparql);
	cout << res << endl;

	// query and save the result in a file
	gc.fquery("lubm", "json", sparql, filename);

	// save the database if you have changed the database
	res = gc.checkpoint("lubm");
	cout << res << endl;

	// show information of the database
	res = gc.monitor("lubm");
	cout << res << endl;

	// show all databases
	res = gc.show();
	cout << res << endl;

	// export the database
	res = gc.exportDB("lubm", "export/lubm/get");
	cout << res << endl;

	// unload the database
	res = gc.unload("lubm");
	cout << res << endl;

	// drop the database
	res = gc.drop("lubm", false); //delete the database directly
	//res = gc.drop("lubm", true); //leave a backup
	cout << res << endl;

	return 0;
}


text:
<!doctype html>

    <meta charset="utf-8">

    <title>ReactJS Tutorial with Firebase</title>


text:
function MetamerDiffs = MetamerTestFosterHyperspectralImages()

FunctionPath = mfilename('fullpath');
DataSetFolder = 'data/dataset/ColourConstancyDataset/hyperspectral/';
DataSetMatPath = [DataSetFolder, 'HyperspectralImageList.mat'];
FunctionRelativePath = 'src/algorithms/colouranalysis/MetamerTestFosterHyperspectralImages';
MatFilePath = strrep(FunctionPath, ['matlab/', FunctionRelativePath], DataSetMatPath);
DataSetPath = strrep(FunctionPath, ['matlab/', FunctionRelativePath], DataSetFolder);
HyperspectralImageListMat = load(MatFilePath);

IlluminantstPath = strrep(FunctionPath, FunctionRelativePath, 'data/mats/hsi/illuminants.mat');
illuminants = load(IlluminantstPath);

% 400 - 720 nm
inds = find(illuminants.wavelength == 400):10:find(illuminants.wavelength == 720);

HyperspectralImageNames = HyperspectralImageListMat.HyperspectralImageNames;
nimages = numel(HyperspectralImageNames);

MetamerDiffs = cell(nimages, 1);

FundamentalsPath = strrep(FunctionPath, FunctionRelativePath, 'data/mats/hsi/');
ColourReceptorsMat = load([FundamentalsPath, 'Xyz1931SpectralSensitivity.mat']);
% spectral sensitivities of 1931 observers
ColourReceptors = ColourReceptorsMat.Xyz1931SpectralSensitivity;

IlluminantsMat = load([FundamentalsPath, 'illuminants.mat']);
illuminant = IlluminantsMat.d65;
illuminant = illuminant(inds);

wp = whitepoint('d65');
plotme = true;

nPixels = 2000;

for i = 1:nimages
  DebugImagePath = [DataSetPath, HyperspectralImageNames{i}(1:end-3), 'mat'];
  CurrentMat = load(DebugImagePath);

  hsi = CurrentMat.hsi;

  hsi = reshape(hsi, size(hsi, 1) * size(hsi, 2), 1, size(hsi, 3));
  InputSignal = hsi(randi(size(hsi, 1), [nPixels, 1]), :, :);
  lab = hsi2lab(InputSignal, illuminant, ColourReceptors, wp);
  MetamerDiffs{i} = MetamerAnalysisColourDifferences(lab);
  if plotme
    SignalLength = size(InputSignal, 3);
    MetamerPlot = MetamerDiffs{i};
    MetamerPlot.SgnlDiffs = 1 ./ MetamerPlot.CompMat2000;
    nSignals = size(lab, 1);
    PlotTopMetamers(MetamerPlot, reshape(InputSignal, nSignals, SignalLength)', 25);
  end
end

end


text:
/**
 * Test ControlQuality.
 * Created by istolbov on 26.02.2017.
 */
package ru.istolbov.lsp;


text:
local Maxout, parent = torch.class('nn.Maxout', 'nn.Sequential')

function Maxout:__init(inputSize, outputSize, maxoutNumber, preprocess)
   parent.__init(self)
   self:add(nn.Linear(inputSize, outputSize * maxoutNumber))
   self:add(nn.View(maxoutNumber, outputSize):setNumInputDims(1))
   if preprocess then
      self:add(preprocess)
   end
   self:add(nn.Max(1, 2))
end


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

package org.corehunter.data.simple;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Set;

import org.corehunter.data.DistanceMatrixData;
import org.jamesframework.core.subset.SubsetSolution;

import uno.informatics.common.io.IOUtilities;
import uno.informatics.common.io.RowReader;
import uno.informatics.common.io.RowWriter;
import uno.informatics.common.io.text.TextFileRowReader;
import uno.informatics.common.io.text.TextFileRowWriter;
import uno.informatics.data.SimpleEntity;
import uno.informatics.data.io.FileType;
import uno.informatics.data.pojo.DataPojo;
import uno.informatics.data.pojo.SimpleEntityPojo;

/**
 * Simple implementation of a distance matrix that stores all values in a
 * two-dimensional double array.
 *
 * @author Guy Davenport, Herman De Beukelaer
 */
public class SimpleDistanceMatrixData extends DataPojo implements DistanceMatrixData {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private static final double DELTA = 1e-10;
    private static final String ID_HEADER = "X";
    private static final String IDENTIFIERS_HEADER = "ID";
    private static final String NAMES_HEADER = "NAME";
    private static final String SELECTED_HEADER = "SELECTED";

    // distance matrix
    private final double[][] distances;

    /**
     * Create distance matrix data given the item headers and distances. Item
     * headers and distances are copied to internal data structures. The dataset
     * name is set to "Precomputed distance matrix".
     *

     * All values should be positive and the diagonal values equal to zero. The
     * distance matrix should be symmetric with all rows of equal length.
     * Violating any of these requirements will produce an exception.
     *

     * Item headers are required. Each item should at least have a unique
     * identifier (names are optional).
     *
     * @param headers
     *            item headers; its length should be the same as the dimension
     *            of the given distance matrix and each item should at least
     *            have a unique identifier (names are optional)
     * @param distances
     *            distance matrix (symmetric)
     * @throws IllegalArgumentException
     *             if an illegal distance matrix is given or the number of
     *             headers does not match the dimension of the distance matrix
     */
    public SimpleDistanceMatrixData(SimpleEntity[] headers, double[][] distances) {
        this("Precomputed distance matrix", headers, distances);
    }

    /**
     * Create distance matrix data given the dataset name, item headers and
     * distances. Item headers and distances are copied to internal data
     * structures.
     *

     * All values should be positive and the diagonal values equal to zero. The
     * distance matrix should be symmetric with all rows of equal length.
     * Violating any of these requirements will produce an exception.
     *

     * Item headers are required. Each item should at least have a unique
     * identifier (names are optional).
     *
     * @param name
     *            dataset name
     * @param headers
     *            item headers; its length should be the same as the dimension
     *            of the given distance matrix and each item should at least
     *            have a unique identifier (names are optional)
     * @param distances
     *            distance matrix (symmetric)
     * @throws IllegalArgumentException
     *             if an illegal distance matrix is given, if the number of
     *             headers does not match the dimension of the distance matrix,
     *             or if unique identifiers are missing in one or more headers
     */
    public SimpleDistanceMatrixData(String name, SimpleEntity[] headers, double[][] distances) {

        // pass dataset name, size and item headers to parent
        super(name, headers);

        // validate distances and copy to internal array
        int n = distances.length;
        this.distances = new double[n][n];

        for (int r = 0; r < n; r++) {
            // check row length
            if (distances[r].length != n) {
                throw new IllegalArgumentException(
                    String.format("Number of distances in row %d does not match number of rows.", r));
            }
            // validate and copy row values
            for (int c = 0; c < n; c++) {
                // check positive
                if (distances[r][c] < 0.0) {
                    throw new IllegalArgumentException("All distances should be positive.");
                }
                // check symmetric
                if (Math.abs(distances[r][c] - distances[c][r]) > DELTA) {
                    throw new IllegalArgumentException("Distance matrix should be symmetric.");
                }
                // check diagonal zero
                if (r == c && distances[r][c] > DELTA) {
                    throw new IllegalArgumentException("Diagonal values should be zero.");
                }
                // copy
                this.distances[r][c] = distances[r][c];
            }
        }

    }

    @Override
    public double getDistance(int idX, int idY) {
        return distances[idX][idY];
    }

    /**
     * Read distance matrix data from file. Only file types {@link FileType#TXT}
     * and {@link FileType#CSV} are allowed. Values are separated with a single
     * tab (txt) or comma (csv) character and should all be positive. Matrix
     * entries are included row-wise and rows can be truncated at or after the
     * diagonal. If included, diagonal values should always be zero. Any
     * provided values after the diagonal (upper triangular part) are validated
     * based on the compulsory lower triangular part, verifying that the
     * distance matrix is symmetric.
     *

     * The file includes one required and one optional header column specifying
     * unique identifiers and item names, respectively. The first, required
     * header column is identified with column header "ID". The second, optional
     * header column is identified with column header "NAME", when included. If
     * no explicit names are provided, the unique identifiers are used as names
     * as well. Optionally, the same item identifiers from the first header
     * column may also be included on the first row (in the same order).
     *

     * Leading and trailing whitespace is removed from names and unique
     * identifiers and they are unquoted if wrapped in single or double quotes
     * after whitespace removal. If it is intended to start or end a
     * name/identifier with whitespace this whitespace should be contained
     * within the quotes, as it will then not be removed.
     *

     * The dataset name is set to the name of the file from which the data is
     * read.
     *
     * @param filePath
     *            path to file that contains the data
     * @param type
     *            {@link FileType#TXT} or {@link FileType#CSV}
     * @return distance matrix data
     * @throws IOException
     *             if the file can not be read or is not correctly formatted
     */
    public static SimpleDistanceMatrixData readData(Path filePath, FileType type) throws IOException {

        // validate arguments

        if (filePath == null) {
            throw new IllegalArgumentException("File path not defined.");
        }

        if (!filePath.toFile().exists()) {
            throw new IOException("File does not exist : " + filePath + ".");
        }

        if (type == null) {
            throw new IllegalArgumentException("File type not defined.");
        }

        if (type != FileType.TXT && type != FileType.CSV) {
            throw new IllegalArgumentException(
                String.format("Only file types TXT and CSV are supported. Got: %s.", type));
        }

        // read data from file
        try (RowReader reader = IOUtilities.createRowReader(
                filePath, type,
                TextFileRowReader.REMOVE_WHITE_SPACE,
                TextFileRowReader.REMOVE_QUOTES
        )) {

            if (reader == null || !reader.ready()) {
                throw new IOException("Can not create reader for file " + filePath + ". File may be empty.");
            }

            if (!reader.hasNextRow()) {
                throw new IOException("File is empty.");
            }

            // read all lines
            List<String[]> rows = new ArrayList<>();
            while (reader.nextRow()) {
                rows.add(reader.getRowCellsAsStringArray());
            }

            // infer dataset size
            int n = rows.size() - 1;
            if (n <= 0) {
                throw new IOException("No data.");
            }

            // check presence of ID column
            String[] firstRow = rows.get(0);
            if (firstRow.length == 0 || !Objects.equals(IDENTIFIERS_HEADER, firstRow[0])) {
                throw new IOException("Missing ID column.");
            }

            // check for presence of item names
            int numHeaderCols = 1;
            boolean withNames = false;
            if (firstRow.length > 1 && Objects.equals(NAMES_HEADER, firstRow[1])) {
                withNames = true;
                numHeaderCols++;
            }

            // extract ids and names
            String[] ids = new String[n];
            String[] names = new String[n];

            for(int i = 0; i < n; i++){
                ids[i] = rows.get(i+1)[0];
                names[i] = withNames ? rows.get(i+1)[1] : ids[i];

            }

            // verify ids on header row, if provided
            if(firstRow.length > numHeaderCols){
                for(int i = 0; i < n; i++){
                    if(numHeaderCols + i >= firstRow.length
                            || !Objects.equals(ids[i], firstRow[numHeaderCols+i])){
                        throw new IOException("Row and column identifiers differ.");
                    }
                }
            }

            // read matrix entries
            double[][] dist = new double[n][n];
            for(double[] row : dist){
                Arrays.fill(row, Double.NaN);
            }
            for (int i = 0; i < n; i++) {
                String[] row = rows.get(i + 1);
                if (row.length - numHeaderCols  n) {
                    throw new IOException("Too many values at row " + (i + 1) + ".");
                }
                for (int j = 0; j < row.length - numHeaderCols; j++) {
                    String entry = row[numHeaderCols + j];
                    double d = (entry == null ? Double.NaN : Double.parseDouble(entry));
                    dist[i][j] = d;
                }
            }

            // check and complete matrix
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    Double d = dist[i][j];
                    if (i > j) {
                        // lower triangular
                        if (Double.isNaN(d)) {
                            throw new IOException(
                                String.format("Missing value at row %d, col %d.", i + 1, numHeaderCols + j));
                        }
                    } else if (i == j) {
                        // diagonal
                        if (!Double.isNaN(d)) {
                            if (d > DELTA) {
                                throw new IOException("Non-zero diagonal value at row " + (i + 1) + ".");
                            }
                        } else {
                            dist[i][j] = 0.0;
                        }
                    } else {
                        // upper triangular
                        if (Double.isNaN(dist[j][i])) {
                            throw new IOException(
                                String.format("Missing value at row %d, col %d.", j + 1, numHeaderCols + i));
                        }
                        if (!Double.isNaN(d)) {
                            if (Math.abs(d - dist[j][i]) > DELTA) {
                                throw new IOException("Matrix is not symmetric.");
                            }
                        } else {
                            dist[i][j] = dist[j][i];
                        }
                    }
                }
            }

            // combine names and identifiers in headers
            SimpleEntity[] headers = new SimpleEntity[n];
            for (int i = 0; i < n; i++) {
                if (names[i] != null) {
                    headers[i] = new SimpleEntityPojo(ids[i], names[i]);
                } else {
                    headers[i] = new SimpleEntityPojo(ids[i]);
                }
            }

            return new SimpleDistanceMatrixData(filePath.getFileName().toString(), headers, dist);
        }
    }

    /**
     * Write distance matrix to file.
     *
     * @param filePath
     *            path to file
     * @param fileType
     *            {@link FileType#TXT} or {@link FileType#CSV}
     * @throws IOException
     *             if the file can not be written
     */
    public void writeData(Path filePath, FileType fileType) throws IOException {

        // create auxiliary solution in which all IDs are selected
        SubsetSolution all = new SubsetSolution(getIDs());
        all.selectAll();
        // write selected (all)
        writeData(filePath, fileType, all, false, true, false);

    }

    /**
     * Write subset of the distance matrix to file and in the order of ids in
     * the solution. If both selected and unselected are included then an extra
     * 'SELECTED' column will be added.
     *
     * @param filePath
     *            path to file
     * @param fileType
     *            {@link FileType#TXT} or {@link FileType#CSV}
     * @param solution
     *            the solution to subset the data
     * @param includeId
     *            includes the integer id used by the solution
     * @param includeSelected
     *            includes selected accessions
     * @param includeUnselected
     *            includes unselected accessions
     * @throws IOException
     *             if the file can not be written
     */
    public void writeData(Path filePath, FileType fileType, SubsetSolution solution, boolean includeId,
        boolean includeSelected, boolean includeUnselected) throws IOException {

        if (filePath.toFile().exists()) {
            throw new IOException("File already exists: " + filePath + ".");
        }

        if (fileType == null) {
            throw new IllegalArgumentException("File type not defined.");
        }

        if (fileType != FileType.TXT && fileType != FileType.CSV) {
            throw new IllegalArgumentException(
                String.format("Only file types TXT and CSV are supported. Got: %s.", fileType)
            );
        }

        if (solution == null) {
            throw new NullPointerException("Solution must be defined");
        }

        if (!(solution.getAllIDs().equals(getIDs()))) {
            throw new IllegalArgumentException("Solution ids must match data.");
        }

        if(!includeSelected && !includeUnselected){
            throw new IllegalArgumentException(
                    "One of 'includeSelected' or 'includeUnselected' must be used."
            );
        }

        Files.createDirectories(filePath.getParent());

        // write data to file
        boolean markSelection = includeSelected && includeUnselected;
        try (RowWriter writer = IOUtilities.createRowWriter(
                filePath, fileType, TextFileRowWriter.ADD_QUOTES
        )) {

            if (writer == null || !writer.ready()) {
                throw new IOException("Can not create writer for file " + filePath + ".");
            }

            // write internal integer id column header
            if (includeId) {
                writer.writeCell(ID_HEADER);
                writer.newColumn();
            }

            // write string id and name column headers
            writer.writeCell(IDENTIFIERS_HEADER);
            writer.newColumn();
            writer.writeCell(NAMES_HEADER);

            // write selection column header if both selected and unselected are included
            if (markSelection) {
                writer.newColumn();
                writer.writeCell(SELECTED_HEADER);
            }

            // write string ids as column headers
            for (int i = 0; i < getSize(); i++) {
                writer.newColumn();
                writer.writeCell(getHeader(i).getUniqueIdentifier());
            }

            // obtain sorted list of IDs included in output
            Set<Integer> includedIDs;
            if (markSelection) {
                includedIDs = getIDs();
            } else if (includeSelected) {
                includedIDs = solution.getSelectedIDs();
            } else if (includeUnselected) {
                includedIDs = solution.getUnselectedIDs();
            } else {
                throw new IllegalArgumentException(
                        "One of 'includeSelected' or 'includeUnselected' must be used."
                );
            }
            List<Integer> sortedIDs = new ArrayList<>(includedIDs);
            sortedIDs.sort(null);

            // write data rows
            Set<Integer> selected = solution.getSelectedIDs();
            for (int id : sortedIDs) {

                writer.newRow();

                // write integer ID if included
                if (includeId) {
                    writer.writeCell(id);
                    writer.newColumn();
                }

                // write string id and name
                SimpleEntity header = getHeader(id);
                writer.writeCell(header.getUniqueIdentifier());
                writer.newColumn();
                writer.writeCell(header.getName());

                // mark selection if needed
                if(markSelection){
                    writer.newColumn();
                    writer.writeCell(selected.contains(id));
                }

                // write matrix entries
                for (int j = 0; j < getSize(); j++) {
                    writer.newColumn();
                    writer.writeCell(distances[id][j]);
                }

            }

            writer.close();
        }
    }

}


text:
package com.nilhcem.droidconae.utils;

import org.junit.Test;

public class PreconditionsTest {

    @Test
    public void should_do_nothing_when_argument_is_valid() {
        // Given
        boolean argument = true;

        // When
        Preconditions.checkArgument(argument);
    }

    @Test(expected = IllegalArgumentException.class)
    public void should_throw_IllegalArgumentException_when_argument_is_invalid() {
        // Given
        boolean argument = false;

        // When
        Preconditions.checkArgument(argument);
    }
}


text:
using System.Windows;
using System.Windows.Controls;

namespace Drumble.UserControls
{
    public partial class Modes : UserControl
    {
        public Modes()
        {
            InitializeComponent();
        }

        private bool showFooter;
        public bool ShowFooter
        {
            get
            {
                return showFooter;
            }
            set
            {
                showFooter = value;

                if (!value)
                    Footer.Visibility = Visibility.Collapsed;
            }
        }
    }
}


text:
package ch.blinkenlights.android.vanilla;

import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup;
import android.preference.CheckBoxPreference;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewFragment;
import java.util.List;

/**
 * The preferences activity in which one can change application preferences.
 */
public class PreferencesActivity extends PreferenceActivity {
	/**
	 * Initialize the activity, loading the preference specifications.
	 */
	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
	}

	@Override
	public void onBuildHeaders(List<Header> target)
	{
		loadHeadersFromResource(R.xml.preference_headers, target);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		if (item.getItemId() == android.R.id.home) {
			finish();
			return true;
		} else {
			return super.onOptionsItemSelected(item);
		}
	}

	public static class AudioActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_audio);
		}
	}

	public static class AudioFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_audio);
		}
	}

	public static class ReplayGainActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")

		CheckBoxPreference cbTrackReplayGain;
		CheckBoxPreference cbAlbumReplayGain;
		SeekBarPreference sbGainBump;
		SeekBarPreference sbUntaggedDebump;

		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			setTitle(R.string.replaygain);
			addPreferencesFromResource(R.xml.preference_replaygain);

			cbTrackReplayGain = (CheckBoxPreference)findPreference(PrefKeys.ENABLE_TRACK_REPLAYGAIN);
			cbAlbumReplayGain = (CheckBoxPreference)findPreference(PrefKeys.ENABLE_ALBUM_REPLAYGAIN);
			sbGainBump = (SeekBarPreference)findPreference(PrefKeys.REPLAYGAIN_BUMP);
			sbUntaggedDebump = (SeekBarPreference)findPreference(PrefKeys.REPLAYGAIN_UNTAGGED_DEBUMP);

			Preference.OnPreferenceClickListener pcListener = new Preference.OnPreferenceClickListener() {
				public boolean onPreferenceClick(Preference preference) {
					updateConfigWidgets();
					return false;
				}
			};

			cbTrackReplayGain.setOnPreferenceClickListener(pcListener);
			cbAlbumReplayGain.setOnPreferenceClickListener(pcListener);
			updateConfigWidgets();
		}

		@Override
		public boolean onOptionsItemSelected(MenuItem item)
		{
			finish();
			return true;
		}

		private void updateConfigWidgets() {
			boolean rgOn = (cbTrackReplayGain.isChecked() || cbAlbumReplayGain.isChecked());
			sbGainBump.setEnabled(rgOn);
			sbUntaggedDebump.setEnabled(rgOn);
		}
	}

	public static class ReplayGainFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_replaygain);
		}
	}

	public static class PlaybackActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_playback);
		}
	}

	public static class PlaybackFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_playback);
		}
	}

	public static class LibraryActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_library);
		}
	}

	public static class LibraryFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_library);
			PreferenceGroup group = getPreferenceScreen();
			group.removePreference(group.findPreference("controls_in_selector"));
		}
	}

	public static class NotificationsActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_notifications);
		}
	}

	public static class NotificationsFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_notifications);
		}
	}

	public static class ShakeActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_shake);
		}
	}

	public static class ShakeFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_shake);
		}
	}

	public static class CoverArtActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_coverart);
		}
	}

	public static class CoverArtFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_coverart);
		}
	}

	public static class MiscActivity extends PreferenceActivity {
		@SuppressWarnings("deprecation")
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_misc);
		}
	}

	public static class MiscFragment extends PreferenceFragment {
		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			super.onCreate(savedInstanceState);
			addPreferencesFromResource(R.xml.preference_misc);
		}
	}

	public static class AboutActivity extends Activity {
		@Override
		public void onCreate(Bundle state)
		{
			super.onCreate(state);

			WebView view = new WebView(this);
			view.getSettings().setJavaScriptEnabled(true);
			view.loadUrl("file:///android_asset/about.html");
			view.setBackgroundColor(Color.TRANSPARENT);
			setContentView(view);
		}
	}

	public static class AboutFragment extends WebViewFragment {
		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			WebView view = (WebView)super.onCreateView(inflater, container, savedInstanceState);
			view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
			view.getSettings().setJavaScriptEnabled(true);
			view.loadUrl("file:///android_asset/about.html");
			view.setBackgroundColor(Color.TRANSPARENT);
			return view;
		}
	}
}


text:
console.log('Running spec(s):', process.env.npm_package_config_specs);
exports.config = {
  allScriptsTimeout: 11000,

  specs: [process.env.npm_package_config_specs],

  capabilities: {
    'browserName': 'firefox'
  },

  directConnect: true,

  framework: 'jasmine',

  jasmineNodeOpts: {
    isVerbose: true
  }
};


text:
body {
    color: #444444;
}

 #map{
  width: 100%;
  height: 400px;
}

/* OpenLayers */
.olControlLayerSwitcher .layersDiv {
  background-color: #333333 !important;
  -moz-border-radius: 15px;
  border-radius: 15px;
  max-height: 320px;
  overflow-y: auto;
}

.dataLbl{
    font-weight: bold;
    margin-bottom: 20px;
}

.dataLayersDiv input{
    margin: 0 10px 10px 0;
}

.dataLayersDiv span{
    margin: 0;
}

.olControlPanel{
	right: 0;
	top: 3px;
}

.olControlDrawFeatureItemInactive{
	width: 18px;
	height: 20px;
	cursor: pointer;
	background-image: url("../js/vendor/openlayers/img/spritesheet-white.png");
	background-repeat: no-repeat;
	background-position: -122px -2px;
	border-bottom: medium none;
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 0px;
	border-top-left-radius: 4px;
	border-top-right-radius: 0px;
	background-position: center;
	background-color: #444;
}

.olControlDrawFeatureItemActive{
	width: 18px;
	height: 20px;
	cursor: pointer;
	background-image: url("../js/vendor/openlayers/img/spritesheet-white.png");
	background-repeat: no-repeat;
	background-position: -122px -2px;
	border-bottom: medium none;
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 0px;
	border-top-left-radius: 4px;
	border-top-right-radius: 0px;
	background-position: center;
	background-color: lightgray;
}

.btn {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #f7f7f7;
    background-image: linear-gradient(to bottom, #ffffff, #eaeaea);
    background-repeat: repeat-x;
    border-color: #cccccc #cccccc #b3b3b3;
    border-image: none;
    border-radius: 4px;
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333333;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 0;
    padding: 4px 12px;
    text-align: center;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
    vertical-align: middle;
}

label {
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 5px;
    font-family: "Open Sans",Arial,sans-serif;
}
.btn, label {
    font-weight: bold;
}

label, input, button, select, textarea {
    font-size: 14px;
    line-height: 20px;
}

textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
    transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
}

select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
    border-radius: 3px;
    color: #555555;
    display: inline-block;
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    margin-bottom: 10px;
    padding: 4px 6px;
    vertical-align: middle;
}

button, html input[type="button"], input[type="reset"], input[type="submit"] {
    cursor: pointer;
}
input[type="file"], input[type="image"], input[type="submit"], input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] {
    width: auto;
}
input, button, select, textarea {
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}

input, textarea, .uneditable-input {
    width: 206px;
}

.miglioraDatoInputText{
	display: block;
}