text:
These files provide basic standalone testing for LaxarJS widgets.
**Note**: Your widget needs to specify all it's dependencies in a `bower.json` file.
Also, the name you specify in the JSON file has to match the widget's AngularJS module name.

## Usage

Copy the `package.json` file into your widget directory.

You can now use `npm` for testing and dependency-management:

```console
$ npm install
...
$ npm test
...
```

redpajama_set_name: RedPajamaGithub


text:
@interface SimpleConstraintTests : XCTestCase

@end

@implementation SimpleConstraintTests {
	UIView *_parentView;
	UIView *_sibling1;
	UIView *_sibling2;
}

- (void)setUp {
	[super setUp];
	_parentView = [[UIView alloc] init];
	_sibling1 = [[UIView alloc] init];
	[_parentView addSubview:_sibling1];
	_sibling2 = [[UIView alloc] init];
	[_parentView addSubview:_sibling2];
}

- (void)tearDown {
	[super tearDown];
}

- (void)testConstantConstraint {
	NSLayoutConstraint *constraint = AddConstraint(_sibling1.width = 50);
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_sibling1 attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:0 constant:50];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testMultiplierConstraint {
	NSLayoutConstraint *constraint = AddConstraint(_sibling1.width = _sibling2.width * 2);
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_sibling1 attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:_sibling2 attribute:NSLayoutAttributeWidth multiplier:2 constant:0];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testBoth {
	NSLayoutConstraint *constraint = AddConstraint(_sibling1.width = _sibling2.width * 2 + 10);
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_sibling1 attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:_sibling2 attribute:NSLayoutAttributeWidth multiplier:2 constant:10];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testEqualityConstraint {
	NSLayoutConstraint *constraint = AddConstraint(_parentView.left = _sibling1.left);
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_parentView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:_sibling1 attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testGTE {
	NSLayoutConstraint *constraint = AddConstraint(_parentView.left = _sibling1.left + flex());
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_parentView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:_sibling1 attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testLTE {
	NSLayoutConstraint *constraint = AddConstraint(_sibling1.left = _parentView.left - flex());
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_sibling1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationLessThanOrEqual toItem:_parentView attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

- (void)testComplex {
	NSLayoutConstraint *constraint = AddConstraint(_sibling1.left = _sibling2.right * 2 + 5 - flex());
	NSLayoutConstraint *comparisonConstraint = [NSLayoutConstraint constraintWithItem:_sibling1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationLessThanOrEqual toItem:_sibling2 attribute:NSLayoutAttributeRight multiplier:2 constant:5];
	[self assertConstraint:constraint isEqualToConstraint:comparisonConstraint];
}

#pragma mark -

- (void)assertConstraint:(NSLayoutConstraint *)constraint1 isEqualToConstraint:(NSLayoutConstraint *)constraint2 {
	XCTAssertEqual(constraint1.firstItem, constraint2.firstItem);
	XCTAssertEqual(constraint1.firstAttribute, constraint2.firstAttribute);
	XCTAssertEqual(constraint1.secondItem, constraint2.secondItem);
	XCTAssertEqual(constraint1.secondAttribute, constraint2.secondAttribute);
	XCTAssertEqual(constraint1.constant, constraint2.constant);
	XCTAssertEqual(constraint1.priority, constraint2.priority);
	if (constraint1.firstItem != nil && constraint1.firstAttribute != NSLayoutAttributeNotAnAttribute) {
		XCTAssertEqual(constraint1.multiplier, constraint2.multiplier);
	}
}

@end


text:
Enigma machine written in clojure

## How to run the tests

I had to add `[lein-midje "3.1.3"]` to my ~/.lein/profiles.clj

```clojure
{:user {:plugins [[cider/cider-nrepl "0.8.1"]
                  [lein-midje "3.1.3"]]}}
```

`lein midje` will run all tests.

`lein midje namespace.*` will run only tests beginning with "namespace.".

`lein midje :autotest` will run all the tests indefinitely. It sets up a
watcher on the code files. If they change, only the relevant tests will be
run again.

## List of resources consulted

- http://enigma.louisedade.co.uk/enigma.html
- Enigma Machine Mechanism (feat. a 'Double Step')  https://www.youtube.com/watch?v=hcVhQeZ5gI4
- http://users.telenet.be/d.rijmenants/en/enigmatech.htm#reflector
- https://www.scienceabc.com/innovation/the-imitation-game-how-did-the-enigma-machine-work.html
- https://en.wikipedia.org/wiki/Enigma_machine
- https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma
- https://en.wikipedia.org/wiki/Enigma_rotor_details
- http://practicalcryptography.com/ciphers/enigma-cipher/


text:
<!---
  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. See accompanying LICENSE file.
--->
<img style="width:100%;" src="datacollector_splash.png">

What is StreamSets Data Collector?
-----------

StreamSets Data Collector is an enterprise grade, open source, continuous big data ingestion infrastructure.
It has an advanced and easy to use User Interface that lets data scientists, developers and data infrastructure
teams easily create data pipelines in a fraction of the time typically required to create complex ingest scenarios.
Out of the box, StreamSets Data Collector reads from and writes to a
large number of end-points, including S3, JDBC, Hadoop, Kafka,
Cassandra and many others. You can use Python, Javascript and Java Expression Language in addition to a large number
of pre-built stages to transform and process the data on the fly. For fault tolerance
and scale out, you can setup data pipelines in cluster mode and perform fine grained monitoring at every stage of
the pipeline.

To learn more, check out [http://streamsets.com](http://streamsets.com)

License
------
StreamSets Data Collector is built on open source technologies, our code is licensed with the
[Apache License 2.0](LICENSE.txt).

Getting Help
----------

A good place to start is to check out [http://streamsets.com/community](http://streamsets.com/community). On that page
you will find all the ways you can reach us and channels our team monitors. You can post questions on
[Google Groups sdc-user](https://groups.google.com/a/streamsets.com/forum/#!forum/sdc-user) or on [StackExchange](http://stackexchange.com) using the
tag #StreamSets. Post bugs at [http://issues.streamsets.com](http://issues.streamsets.com) or tweet at us with #StreamSets.

If you need help with production systems, you can check out the variety of support options offered on our
[support page](http://streamsets.com/support).

Contributing code
-----------
We welcome contributors, please check out our [guidelines](CONTRIBUTING.md) to get started.

Changelog
----------
See the latest [changelog](https://github.com/StreamSets/datacollector/blob/master/CHANGES.txt)


text:
package org.apache.spark.resource

import java.util.{Map => JMap}
import java.util.concurrent.ConcurrentHashMap

import scala.collection.JavaConverters._

import org.apache.spark.annotation.{Evolving, Since}

/**
 * Resource profile builder to build a [[ResourceProfile]] to associate with an RDD.
 * A [[ResourceProfile]] allows the user to specify executor and task resource requirements
 * for an RDD that will get applied during a stage. This allows the user to change the resource
 * requirements between stages.
 *
 */
@Evolving
@Since("3.1.0")
class ResourceProfileBuilder() {

  // Task resource requests specified by users, mapped from resource name to the request.
  private val _taskResources = new ConcurrentHashMap[String, TaskResourceRequest]()
  // Executor resource requests specified by users, mapped from resource name to the request.
  private val _executorResources = new ConcurrentHashMap[String, ExecutorResourceRequest]()

  def taskResources: Map[String, TaskResourceRequest] = _taskResources.asScala.toMap
  def executorResources: Map[String, ExecutorResourceRequest] = _executorResources.asScala.toMap

  /**
   * (Java-specific) gets a Java Map of resources to TaskResourceRequest
   */
  def taskResourcesJMap: JMap[String, TaskResourceRequest] = _taskResources.asScala.asJava

  /**
   * (Java-specific) gets a Java Map of resources to ExecutorResourceRequest
   */
  def executorResourcesJMap: JMap[String, ExecutorResourceRequest] = {
    _executorResources.asScala.asJava
  }

  /**
   * Add executor resource requests
   * @param requests The detailed executor resource requests, see [[ExecutorResourceRequests]]
   * @return This ResourceProfileBuilder
   */
  def require(requests: ExecutorResourceRequests): this.type = {
    _executorResources.putAll(requests.requests.asJava)
    this
  }

  /**
   * Add task resource requests
   * @param requests The detailed task resource requests, see [[TaskResourceRequest]]
   * @return This ResourceProfileBuilder
   */
  def require(requests: TaskResourceRequests): this.type = {
    _taskResources.putAll(requests.requests.asJava)
    this
  }

  def clearExecutorResourceRequests(): this.type = {
    _executorResources.clear()
    this
  }

  def clearTaskResourceRequests(): this.type = {
    _taskResources.clear()
    this
  }

  override def toString(): String = {
    "Profile executor resources: " +
      s"${_executorResources.asScala.map(pair => s"${pair._1}=${pair._2.toString()}")}, " +
      s"task resources: ${_taskResources.asScala.map(pair => s"${pair._1}=${pair._2.toString()}")}"
  }

  def build(): ResourceProfile = {
    new ResourceProfile(executorResources, taskResources)
  }
}


text:
import abc
import collections

from oslo_concurrency import lockutils
from oslo_log import log as logging
import six

from neutron.agent.l2 import agent_extension
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import exceptions
from neutron.i18n import _LW, _LI
from neutron import manager

LOG = logging.getLogger(__name__)

@six.add_metaclass(abc.ABCMeta)
class QosAgentDriver(object):
    """Defines stable abstract interface for QoS Agent Driver.

    QoS Agent driver defines the interface to be implemented by Agent
    for applying QoS Rules on a port.
    """

    # Each QoS driver should define the set of rule types that it supports, and
    # corresponding handlers that has the following names:
    #
    # create_<type>
    # update_<type>
    # delete_<type>
    #
    # where <type> is one of VALID_RULE_TYPES
    SUPPORTED_RULES = set()

    @abc.abstractmethod
    def initialize(self):
        """Perform QoS agent driver initialization.
        """

    def create(self, port, qos_policy):
        """Apply QoS rules on port for the first time.

        :param port: port object.
        :param qos_policy: the QoS policy to be applied on port.
        """
        self._handle_update_create_rules('create', port, qos_policy)

    def update(self, port, qos_policy):
        """Apply QoS rules on port.

        :param port: port object.
        :param qos_policy: the QoS policy to be applied on port.
        """
        self._handle_update_create_rules('update', port, qos_policy)

    def delete(self, port, qos_policy=None):
        """Remove QoS rules from port.

        :param port: port object.
        :param qos_policy: the QoS policy to be removed from port.
        """
        if qos_policy is None:
            rule_types = self.SUPPORTED_RULES
        else:
            rule_types = set(
                [rule.rule_type
                 for rule in self._iterate_rules(qos_policy.rules)])

        for rule_type in rule_types:
            self._handle_rule_delete(port, rule_type)

    def _iterate_rules(self, rules):
        for rule in rules:
            rule_type = rule.rule_type
            if rule_type in self.SUPPORTED_RULES:
                yield rule
            else:
                LOG.warning(_LW('Unsupported QoS rule type for %(rule_id)s: '
                                '%(rule_type)s; skipping'),
                            {'rule_id': rule.id, 'rule_type': rule_type})

    def _handle_rule_delete(self, port, rule_type):
        handler_name = "".join(("delete_", rule_type))
        handler = getattr(self, handler_name)
        handler(port)

    def _handle_update_create_rules(self, action, port, qos_policy):
        for rule in self._iterate_rules(qos_policy.rules):
            if rule.should_apply_to_port(port):
                handler_name = "".join((action, "_", rule.rule_type))
                handler = getattr(self, handler_name)
                handler(port, rule)
            else:
                LOG.debug("Port %(port)s excluded from QoS rule %(rule)s",
                          {'port': port, 'rule': rule.id})

class PortPolicyMap(object):
    def __init__(self):
        # we cannot use a dict of sets here because port dicts are not hashable
        self.qos_policy_ports = collections.defaultdict(dict)
        self.known_policies = {}
        self.port_policies = {}

    def get_ports(self, policy):
        return self.qos_policy_ports[policy.id].values()

    def get_policy(self, policy_id):
        return self.known_policies.get(policy_id)

    def update_policy(self, policy):
        self.known_policies[policy.id] = policy

    def has_policy_changed(self, port, policy_id):
        return self.port_policies.get(port['port_id']) != policy_id

    def get_port_policy(self, port):
        policy_id = self.port_policies.get(port['port_id'])
        if policy_id:
            return self.get_policy(policy_id)

    def set_port_policy(self, port, policy):
        """Attach a port to policy and return any previous policy on port."""
        port_id = port['port_id']
        old_policy = self.get_port_policy(port)
        self.known_policies[policy.id] = policy
        self.port_policies[port_id] = policy.id
        self.qos_policy_ports[policy.id][port_id] = port
        if old_policy and old_policy.id != policy.id:
            del self.qos_policy_ports[old_policy.id][port_id]
        return old_policy

    def clean_by_port(self, port):
        """Detach port from policy and cleanup data we don't need anymore."""
        port_id = port['port_id']
        if port_id in self.port_policies:
            del self.port_policies[port_id]
            for qos_policy_id, port_dict in self.qos_policy_ports.items():
                if port_id in port_dict:
                    del port_dict[port_id]
                    if not port_dict:
                        self._clean_policy_info(qos_policy_id)
                    return
        raise exceptions.PortNotFound(port_id=port['port_id'])

    def _clean_policy_info(self, qos_policy_id):
        del self.qos_policy_ports[qos_policy_id]
        del self.known_policies[qos_policy_id]

class QosAgentExtension(agent_extension.AgentCoreResourceExtension):
    SUPPORTED_RESOURCES = [resources.QOS_POLICY]

    def initialize(self, connection, driver_type):
        """Perform Agent Extension initialization.

        """
        self.resource_rpc = resources_rpc.ResourcesPullRpcApi()
        self.qos_driver = manager.NeutronManager.load_class_for_provider(
            'neutron.qos.agent_drivers', driver_type)()
        self.qos_driver.initialize()

        self.policy_map = PortPolicyMap()

        registry.subscribe(self._handle_notification, resources.QOS_POLICY)
        self._register_rpc_consumers(connection)

    def _register_rpc_consumers(self, connection):
        endpoints = [resources_rpc.ResourcesPushRpcCallback()]
        for resource_type in self.SUPPORTED_RESOURCES:
            # we assume that neutron-server always broadcasts the latest
            # version known to the agent
            topic = resources_rpc.resource_type_versioned_topic(resource_type)
            connection.create_consumer(topic, endpoints, fanout=True)

    @lockutils.synchronized('qos-port')
    def _handle_notification(self, qos_policy, event_type):
        # server does not allow to remove a policy that is attached to any
        # port, so we ignore DELETED events. Also, if we receive a CREATED
        # event for a policy, it means that there are no ports so far that are
        # attached to it. That's why we are interested in UPDATED events only
        if event_type == events.UPDATED:
            self._process_update_policy(qos_policy)

    @lockutils.synchronized('qos-port')
    def handle_port(self, context, port):
        """Handle agent QoS extension for port.

        This method applies a new policy to a port using the QoS driver.
        Update events are handled in _handle_notification.
        """
        port_id = port['port_id']
        port_qos_policy_id = port.get('qos_policy_id')
        network_qos_policy_id = port.get('network_qos_policy_id')
        qos_policy_id = port_qos_policy_id or network_qos_policy_id
        if qos_policy_id is None:
            self._process_reset_port(port)
            return

        if not self.policy_map.has_policy_changed(port, qos_policy_id):
            return

        qos_policy = self.resource_rpc.pull(
            context, resources.QOS_POLICY, qos_policy_id)
        if qos_policy is None:
            LOG.info(_LI("QoS policy %(qos_policy_id)s applied to port "
                         "%(port_id)s is not available on server, "
                         "it has been deleted. Skipping."),
                     {'qos_policy_id': qos_policy_id, 'port_id': port_id})
            self._process_reset_port(port)
        else:
            old_qos_policy = self.policy_map.set_port_policy(port, qos_policy)
            if old_qos_policy:
                self.qos_driver.delete(port, old_qos_policy)
                self.qos_driver.update(port, qos_policy)
            else:
                self.qos_driver.create(port, qos_policy)

    def delete_port(self, context, port):
        self._process_reset_port(port)

    def _process_update_policy(self, qos_policy):
        old_qos_policy = self.policy_map.get_policy(qos_policy.id)
        for port in self.policy_map.get_ports(qos_policy):
            #NOTE(QoS): for now, just reflush the rules on the port. Later, we
            #           may want to apply the difference between the old and
            #           new rule lists.
            self.qos_driver.delete(port, old_qos_policy)
            self.qos_driver.update(port, qos_policy)
            self.policy_map.update_policy(qos_policy)

    def _process_reset_port(self, port):
        try:
            self.policy_map.clean_by_port(port)
            self.qos_driver.delete(port)
        except exceptions.PortNotFound:
            LOG.info(_LI("QoS extension did have no information about the "
                         "port %s that we were trying to reset"),
                     port['port_id'])


text:
package org.keycloak.exportimport;

import org.keycloak.provider.Provider;
import org.keycloak.provider.ProviderFactory;
import org.keycloak.provider.Spi;

/**
 * @author Marek Posolda
 */
public class ExportSpi implements Spi {

    @Override
    public boolean isInternal() {
        return true;
    }

    @Override
    public String getName() {
        return "export";
    }

    @Override
    public Class<? extends Provider> getProviderClass() {
        return ExportProvider.class;
    }

    @Override
    public Class<? extends ProviderFactory> getProviderFactoryClass() {
        return ExportProviderFactory.class;
    }
}


text:
package com.mg.maven.minifier.plugin;

/**
 *
 * @author Martin
 */
public class ReplacementTarget {

    public static enum LinkType {

        JS,
        CSS;
    }

    String name;
    String path;
    LinkType linkType;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public LinkType getLinkType() {
        return linkType;
    }

    public void setLinkType(LinkType linkType) {
        this.linkType = linkType;
    }

}


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.
#
-->
# Release Notes

### 0.2.3 (Sept 25, 2013)
* CB-4889 bumping&resetting version
* [CB-4752] Incremented plugin version on dev branch.
* CB-4889 renaming org.apache.cordova.core.battery-status to org.apache.cordova.battery-status

### 0.2.4 (Oct 25, 2013)
* CB-5128: added repo + issue tag to plugin.xml for battery status plugin
* [CB-4915] Incremented plugin version on dev branch.

### 0.2.5 (Dec 4, 2013)
* Merged WP8 support for level, but #def'd it out so the same code runs on wp7.  Updated docs to reflect WP8 support for battery level, and low+critical events
* wp8 add support in level
* add ubuntu platform
* 1. Updated platform name amazon->amazon-fireos. Deleted src files. 2. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'

### 0.2.6 (Jan 02, 2014)
* CB-5658 Add doc/index.md for Battery Status.

### 0.2.7 (Feb 05, 2014)
* Add Tizen plugin.

### 0.2.8 (Apr 17, 2014)
* CB-6465: Add license headers to Tizen code
* CB-6460: Update license headers
* Add NOTICE file

### 0.2.9 (Jun 05, 2014)
* CB-6721 Test for batterycritical change before batterylow change
* CB-5611 firefoxos: battery-status plugin support added
* CB-4519, CB-4520 low+critical weren't firing when level went from 21->19, and were when level went 19->20
* CB-6491 add CONTRIBUTING.md

### 0.2.10 (Aug 06, 2014)
* CB-6957 Ported Battery-status manual & automated
* CB-6127 Updated translations for docs

### 0.2.11 (Sep 17, 2014)
* CB-7249 cordova-plugin-battery-status documentation translation: cordova-plugin-battery-status
* CB-6724 re-add accidental removed of var keyword
* CB-6957 renamed folder to tests + added nested plugin.xml
* added documentation for manual tests
* CB-6957 Style improvements on Manual tests


text:
// Copyright 2005-2009 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include "./config.hpp"

#ifdef BOOST_HASH_TEST_EXTENSIONS
#  ifdef BOOST_HASH_TEST_STD_INCLUDES
#    include <functional>
#  else
#    include <boost/functional/hash.hpp>
#  endif
#endif

#include <boost/detail/lightweight_test.hpp>

#ifdef BOOST_HASH_TEST_EXTENSIONS

#include <set>

using std::set;
#define CONTAINER_TYPE set
#include "./hash_set_test.hpp"

using std::multiset;
#define CONTAINER_TYPE multiset
#include "./hash_set_test.hpp"

#endif

int main()
{
#ifdef BOOST_HASH_TEST_EXTENSIONS
    set_tests::set_hash_integer_tests();
    multiset_tests::multiset_hash_integer_tests();
#endif

    return boost::report_errors();
}


text:
@interface UIImage (TPThumbnail)
-(UIImage *)getThumbnail:(CGSize) size;
@end


text:
#!/usr/bin/env node

var allowedExtensions = ['less'];
var sys = require('util')
  , fs = require('fs')
  , path = require('path')
  , events = require('events')
  , exec = require('child_process').exec;

// Check to see if we have the correct number of arguments
var argvs = process.argv.slice(2);
if (!argvs[0] || !argvs[1]){
  console.log('Missing arguments. Example:');
    console.log('\tnode less-watch-compiler.js FOLDER_TO_WATCH FOLDER_TO_OUTPUT');
  process.exit(1);
}

// Walk the directory tree
function walk (dir, options, callback, initCallback) {
  if (!callback) {callback = options; options = {}}
  if (!callback.files) callback.files = {};
  if (!callback.pending) callback.pending = 0;
  callback.pending += 1;
  fs.stat(dir, function (err, stat) {
    if (err) return callback(err);
    callback.files[dir] = stat;
    fs.readdir(dir, function (err, files) {
      if (err) return callback(err);
      callback.pending -= 1;
      files.forEach(function (f, index) {
        f = path.join(dir, f);
        callback.pending += 1;
        fs.stat(f, function (err, stat) {
          var enoent = false
            , done = false;

          if (err) {
            if (err.code !== 'ENOENT') {
              return callback(err);
            } else {
              enoent = true;
            }
          }
          callback.pending -= 1;
          done = callback.pending === 0;
          if (!enoent) {
            if (options.ignoreDotFiles && path.basename(f)[0] === '.') return done && callback(null, callback.files);
            if (options.filter && options.filter(f, stat)) return done && callback(null, callback.files);
            callback.files[f] = stat;
            if (stat.isDirectory()) {
              walk(f, options, callback);
            }else{
              initCallback&&initCallback(f);
            }

            if (done) callback(null, callback.files);
          }
        })
      })
      if (callback.pending === 0) callback(null, callback.files);
    })
    if (callback.pending === 0) callback(null, callback.files);
  })

}

//Setup fs.watchFile() for each file.
var watchTree = function ( root, options, watchCallback, initCallback ) {
  if (!watchCallback) {watchCallback = options; options = {}}
  walk(root, options, function (err, files) {
    if (err) throw err;
    var fileWatcher = function (f) {
      fs.watchFile(f, options, function (c, p) {
        // Check if anything actually changed in stat
        if (files[f] && !files[f].isDirectory() && c.nlink !== 0 && files[f].mtime.getTime() == c.mtime.getTime()) return;
        files[f] = c;
        if (!files[f].isDirectory()) {
          if(options.ignoreDotFiles && (path.basename(f)[0] === '.')) return;
          if(options.filter&& options.filter(f, files[f])) return;
          watchCallback(f, c, p);
        }else {
          fs.readdir(f, function (err, nfiles) {
            if (err) return;
            nfiles.forEach(function (b) {
              var file = path.join(f, b);
              if (!files[file]) {
                fs.stat(file, function (err, stat) {
                  if(options.ignoreDotFiles && (path.basename(b)[0] === '.')) return;
                  if(options.filter&& options.filter(b, files[b])) return;
                  watchCallback(file, stat, null);
                  files[file] = stat;
                  fileWatcher(file);
                })
              }
            })
          })
        }
        if (c.nlink === 0) {
          // unwatch removed files.
          delete files[f]
          fs.unwatchFile(f);
        }
      })
    }

    fileWatcher(root);
    for (var i in files) {
      fileWatcher(i);
    }
    watchCallback(files, null, null);
  },
  initCallback);
}

// String function to retrieve the filename without the extension
function getFilenameWithoutExtention(string){
  //extract filename (xxx.less)
  //strip out the extension
  var filename = string.replace(/^.*[\\\/]/, '').split('.')[0];
  return filename
}

// String function to retrieve the file's extension
function getFileExtension(string){
  var extension = string.split('.').pop();
  if (extension == string) return ''
  else
  return extension;
}

// Here's where we run the less compiler
function compileCSS(file){
    var filename = getFilenameWithoutExtention(file);
    var command = 'lessc --yui-compress '+file.replace(/\s+/g,'\\ ')+' '+argvs[1]+'/'+filename.replace(/\s+/g,'\\ ')+'.css';
    // Run the command
    exec(command, function (error, stdout, stderr){
      if (error !== null)
        console.log(error);
      if(stdout)
          console.error(stdout);
  });
}

// This is the function we use to filter the files to watch.
function filterFiles(f, stat){
  var filename = getFilenameWithoutExtention(f);
  var extension = getFileExtension(f);
  if (filename.substr(0,1) == '_' ||
      filename.substr(0,1) == '.' ||
      filename == '' ||
      allowedExtensions.indexOf(extension) == -1
      )
    return true;
  else{
    return false;
  }
}

function getDateTime() {

    var date = new Date();
    var hour = date.getHours();
    hour = (hour < 10 ? "0" : "") + hour;
    var min  = date.getMinutes();
    min = (min < 10 ? "0" : "") + min;
    var sec  = date.getSeconds();
    sec = (sec < 10 ? "0" : "") + sec;
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    month = (month < 10 ? "0" : "") + month;
    var day  = date.getDate();
    day = (day < 10 ? "0" : "") + day;
    return hour + ":" + min + ":" + sec + " on " + day + '/' + month + "/" + year;

}

// Here's where we setup the watch function
console.log('Watching directory for file changes.');
console.log('');
watchTree(
  argvs[0],
  {interval: 200, ignoreDotFiles: true, filter:filterFiles},
  function (f, curr, prev) {
    if (typeof f == 'object' && prev === null && curr === null) {
      // Finished walking the tree
      return;
    } else if (curr.nlink === 0) {
      // f was removed
      console.log(f +' was removed.')
    } else {
      // f is a new file or changed
      console.log('The file: ' + f + ' was changed. Recompiling CSS at ' + getDateTime());
      compileCSS(f);
    }
  },
  function(f){
     compileCSS(f);
  }
);


text:
package com.tectonica.jonix.onix3;

import com.tectonica.jonix.common.JPU;
import com.tectonica.jonix.common.OnixElement;
import com.tectonica.jonix.common.codelist.RecordSourceTypes;

import java.io.Serializable;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
 */

/**
 *
Quantity reserved

 *

 * The quantity of stock on hand but unavailable to fulfil new orders for any reason – for example because the stock is
 * reserved to fulfill existing orders or frozen to prevent dispatch. Optional and non-repeating.
 *

 *

 *

 * Format
 * Positive integer or zero, suggested maximum length 7 digits.
 *

 *

 * Reference name
 * <tt><Reserved></tt>
 *

 *

 * Short tag
 * <tt><x536></tt>
 *

 *

 * Cardinality
 * 0…1
 *

 *

 * Example
 * <tt><Reserved>500</Reserved></tt>
 *

 *

 *

 * This tag may be included in the following composites:
 *

 *
<{@link Stock}>

 *

 *

 * Possible placements within ONIX message:
 *

 *
{@link ONIXMessage} ⯈ {@link Product} ⯈ {@link ProductSupply} ⯈ {@link SupplyDetail} ⯈ {@link Stock} ⯈
 * {@link Reserved}

 *

 *
 * @since Onix-3.04
 */
public class Reserved implements OnixElement<Integer>, Serializable {
    private static final long serialVersionUID = 1L;

    public static final String refname = "Reserved";
    public static final String shortname = "x536";

    /////////////////////////////////////////////////////////////////////////////////
    // ATTRIBUTES
    /////////////////////////////////////////////////////////////////////////////////

    /**
     * (type: dt.DateOrDateTime)
     */
    public String datestamp;

    /**
     * (type: dt.NonEmptyString)
     */
    public String sourcename;

    public RecordSourceTypes sourcetype;

    /////////////////////////////////////////////////////////////////////////////////
    // VALUE MEMBER
    /////////////////////////////////////////////////////////////////////////////////

    /**
     * This is the raw content of Reserved. Could be null if {@code exists() == false}. Use {@link #value()} instead if
     * you want to get this as an {@link java.util.Optional}.
     *

     * Raw Format: Positive integer or zero, suggested maximum length 7 digits.
     *

     * (type: dt.PositiveInteger)
     */
    public Integer value;

    /**
     * Internal API, use the {@link #value()} method or the {@link #value} field instead
     */
    @Override
    public Integer _value() {
        return value;
    }

    /////////////////////////////////////////////////////////////////////////////////
    // SERVICES
    /////////////////////////////////////////////////////////////////////////////////

    private final boolean exists;
    public static final Reserved EMPTY = new Reserved();

    public Reserved() {
        exists = false;
    }

    public Reserved(org.w3c.dom.Element element) {
        exists = true;
        datestamp = JPU.getAttribute(element, "datestamp");
        sourcename = JPU.getAttribute(element, "sourcename");
        sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype"));

        value = JPU.getContentAsInteger(element);
    }

    /**
     * @return whether this tag (<Reserved> or <x536>) is explicitly provided in the ONIX XML
     */
    @Override
    public boolean exists() {
        return exists;
    }
}


text:
<component name="libraryTable">
  <library name="support-core-utils-24.2.0">
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/classes.jar!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://D:/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/24.2.0/support-core-utils-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */

namespace Piwik\Updates;

use Piwik\Updates;

/**
 */
class Updates_1_9_3_b10 extends Updates
{
    static function isMajorUpdate()
    {
        return false;
    }

    static function update()
    {
        try {
            \Piwik\Plugin\Manager::getInstance()->activatePlugin('Annotations');
        } catch (\Exception $e) {
            // pass
        }
    }
}


text:
<?php

class Google_Service_ShoppingContent_ProductsCustomBatchRequestEntry extends Google_Model
{
  public $batchId;
  public $feedId;
  public $merchantId;
  public $method;
  protected $productType = 'Google_Service_ShoppingContent_Product';
  protected $productDataType = '';
  public $productId;

  public function setBatchId($batchId)
  {
    $this->batchId = $batchId;
  }
  public function getBatchId()
  {
    return $this->batchId;
  }
  public function setFeedId($feedId)
  {
    $this->feedId = $feedId;
  }
  public function getFeedId()
  {
    return $this->feedId;
  }
  public function setMerchantId($merchantId)
  {
    $this->merchantId = $merchantId;
  }
  public function getMerchantId()
  {
    return $this->merchantId;
  }
  public function setMethod($method)
  {
    $this->method = $method;
  }
  public function getMethod()
  {
    return $this->method;
  }
  /**
   * @param Google_Service_ShoppingContent_Product
   */
  public function setProduct(Google_Service_ShoppingContent_Product $product)
  {
    $this->product = $product;
  }
  /**
   * @return Google_Service_ShoppingContent_Product
   */
  public function getProduct()
  {
    return $this->product;
  }
  public function setProductId($productId)
  {
    $this->productId = $productId;
  }
  public function getProductId()
  {
    return $this->productId;
  }
}


text:
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Xml.Serialization;

namespace Versionizer.Server
{
    public class Serializer<T>
    {
        public static Serializer<T> Current { get { return new Serializer<T>(); } }

        private Serializer() { }

        public string Serialize(T o)
        {
            string result = string.Empty;

            try
            {
                if (o is Exception)
                {
                    BinaryFormatter bin = new BinaryFormatter();

                    using (MemoryStream stream = new MemoryStream())
                    {
                        bin.Serialize(stream, o);

                        result = Convert.ToBase64String(stream.ToArray());
                    }
                }
                else
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(T));

                    using (MemoryStream stream = new MemoryStream())
                    {
                        if (stream.CanWrite)
                        {
                            using (StreamWriter writer = new StreamWriter(stream))
                            {
                                serializer.Serialize(writer.BaseStream, o);

                                if (stream.CanSeek)
                                    stream.Position = 0;

                                if (stream.CanRead)
                                {
                                    using (StreamReader reader = new StreamReader(stream))
                                        result = reader.ReadToEnd();
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                result = string.Empty;
            }

            return result;
        }

        public T Deserialize(string s, Encoding e)
        {
            T result = default(T);

            try
            {
                XmlSerializer o = new XmlSerializer(typeof(T));

                using (MemoryStream stream = new MemoryStream(e.GetBytes(s)))
                    result = (T)o.Deserialize(stream);
            }
            catch
            {
                result = default(T);
            }

            return result;
        }

        public T Deserialize(string s)
        {
            T result = default(T);

            try
            {
                if (typeof(T) == typeof(Exception))
                {
                    BinaryFormatter bin = new BinaryFormatter();

                    using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(s)))
                        result = (T)bin.Deserialize(stream);
                }
                else
                {
                    XmlSerializer o = new XmlSerializer(typeof(T));

                    using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(s)))
                        result = (T)o.Deserialize(stream);
                }
            }
            catch
            {
                result = default(T);
            }

            return result;
        }

        public T Deserialize(byte[] data)
        {
            T result = default(T);

            try
            {
                XmlSerializer o = new XmlSerializer(typeof(T));

                using (MemoryStream stream = new MemoryStream(data))
                    result = (T)o.Deserialize(stream);
            }
            catch
            {
                result = default(T);
            }

            return result;
        }
    }
}


text:
package net.sourceforge.stripes.auth;

import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.config.ConfigurableComponent;
import net.sourceforge.stripes.config.Configuration;
import net.sourceforge.stripes.controller.ExecutionContext;
import net.sourceforge.stripes.controller.Intercepts;
import net.sourceforge.stripes.controller.LifecycleStage;
import net.sourceforge.stripes.controller.Interceptor;
import net.sourceforge.stripes.util.Log;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Interceptor class for authentication. Intercepts incoming requests (event handling stage) and
 * handles the login process transparently for protected action events.
 *
 * @see LoginActionBean
 */
@Intercepts(LifecycleStage.EventHandling)
public abstract class AuthenticationInterceptor implements Interceptor, AuthConstants, ConfigurableComponent {

    private String loginUrl = "/login";

    /** Log instance used to log information from this class. */
    private static final Log log = Log.getInstance(AuthenticationInterceptor.class);

    private Configuration configuration;

    public void init(Configuration configuration) throws Exception {
        this.configuration = configuration;
    }

    public Configuration getConfiguration() {
        return configuration;
    }

    public Resolution intercept(ExecutionContext executionContext) throws Exception {
        if (requiresAuthentication(executionContext)) {
            log.debug("Authentication is required...");
            if (!authenticated(executionContext)) {
                log.debug("Nobody's logged in, forward to login page");
                // forward to login page, passing the requested URI as an argument
                HttpServletRequest request = executionContext.getActionBeanContext().getRequest();
                String requestedPage = request.getRequestURI();
                // strip context path if needed
                String contextPath = request.getContextPath();
                if (requestedPage.startsWith(contextPath)) {
                    requestedPage = requestedPage.substring(contextPath.length());
                }
                String queryString = request.getQueryString();
                if (queryString!=null) {
                    requestedPage += queryString;
                }
                return new ForwardResolution(loginUrl).addParameter(REQ_PARAM_TARGET_URL, requestedPage);
            }
        }
        return executionContext.proceed();
    }

    /**
     * Return true if passed executionContext corresponds to an authenticated user, false otherwise.
     * This implementation checks if there is a user in the current session.
     *
     * @param executionContext the execution context
     * @return true if passed executionContext corresponds to an authenticated user, false otherwise
     */
    protected boolean authenticated(ExecutionContext executionContext) {
        ActionBeanContext abc = executionContext.getActionBeanContext();
        if (abc==null) {
            log.warn("No action bean context available ! Is the interceptor annotated with LifecycleStage.EventHandling ?");
            return false;
        }
        HttpServletRequest request = abc.getRequest();
        if (request==null) {
            log.warn("No http request available !");
            return false;
        }
        HttpSession session = request.getSession();
        Object user = session.getAttribute(SESSION_ATTR_CURRENT_USER);
        if (user!=null) {
            log.debug("Found user in session");
            return true;
        } else {
            log.debug("nobody is authenticated for the current session");
            return false;
        }
    }

    /**
     * Return true if passed executionContext requires authentication, false otherwise. Typically uses urls or bean classes
     * to determine it. This implementation checks if the bean class (if any) is annotated with @RequiresAuthentication.
     * @param executionContext the execution context
     * @return true if passed authentication requires authentication
     */
    protected abstract boolean requiresAuthentication(ExecutionContext executionContext);

}


text:
<?php
/**
 * The Footer widget areas.
 *
 * @package WordPress
 * @subpackage staydry-wp-theme
 */

	/* If none of the sidebars have widgets, then let's bail early. */
	if (   ! is_active_sidebar( 'first-footer-widget-area'  )
		&& ! is_active_sidebar( 'second-footer-widget-area' )
		&& ! is_active_sidebar( 'third-footer-widget-area'  )
		&& ! is_active_sidebar( 'fourth-footer-widget-area' )
	)
		return;
	// If we get this far, we have widgets. Let do this.

// set up labels for the names of the possible widget areas
$column_labels = array('first', 'second', 'third', 'fourth');
$label_suffix = '-footer-widget-area';

// loop through the 4 possible widget areas and test to see if they are active if they are not active then unset the label
foreach ($column_labels as $key => $label)
{
	if ( ! is_active_sidebar( $label . $label_suffix ) ){
		unset( $column_labels[$key] );
	}
}

// based on the number of columns set the column width we'll use for the class to apply the correct css code to the divs
$num_columns = count($column_labels);
switch ($num_columns)
{
	case 4:
		$col_width = 'one-quarter';
		break;
	case 3:
		$col_width = 'one-third';
		break;
	case 2:
		$col_width = 'one-half';
		break;
	default:
		$col_width = 'single';
		break;
}

// we've only gotten this far because there is at least one footer widget area. do while it is
do {
$label = array_shift($column_labels);
$div_id = $label . '-footer-menu';
$div_class = $col_width . ' column';
if ( count($column_labels) == 0 )
	$div_class .= ' last';
$ul_class = 'footer-menu';

?>

				<div id="<?php echo $div_id; ?>" class="<?php echo $div_class; ?>">
						<?php dynamic_sidebar( $label . $label_suffix ); ?>
				</div><!-- #<?php echo $div_id; ?> .<?php echo $div_class; ?> -->

<?php
} while ( count($column_labels) > 0 );
?>


text:
class Admin::BanksController < Admin::AdminController
  before_action :set_admin_bank, only: [:show, :edit, :update, :destroy]

  def initialize(*params)
    super(*params)

    @category = t(:menu_etc_board,scope:[:admin_menu])
    @controller_name = t('activerecord.models.bank')
  end

  # GET /admin/models
  # GET /admin/models.json
  def index
    params[:per_page] = 10 unless params[:per_page].present?

    @admin_banks = Bank.order('id desc').page(params[:page]).per(params[:per_page])

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @admin_banks }
    end
  end

  # GET /admin/models/1
  # GET /admin/models/1.json
  def show
    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @admin_bank }
    end
  end

  # GET /admin/models/new
  # GET /admin/models/new.json
  def new
    @admin_bank = Bank.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @admin_bank }
    end
  end

  # GET /admin/models/1/edit
  def edit
  end

  # POST /admin/models
  # POST /admin/models.json
  def create
    @admin_bank = Bank.new(admin_bank_params)

    respond_to do |format|
      if @admin_bank.save
        format.html { redirect_to admin_bank_path(@admin_bank), notice: @controller_name + t(:message_success_create)}
        format.json { render json: @admin_bank, status: :created, location: @admin_bank }
      else
        format.html { render action: "new" }
        format.json { render json: @admin_bank.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /admin/models/1
  # PUT /admin/models/1.json
  def update
    respond_to do |format|
      if @admin_bank.update_attributes(admin_bank_params)
        format.html { redirect_to admin_bank_path(@admin_bank), notice: @controller_name + t(:message_success_update)}
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @admin_bank.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /admin/models/1
  # DELETE /admin/models/1.json
  def destroy
    @admin_bank.destroy

    respond_to do |format|
      format.html { redirect_to admin_banks_path }
      format.json { head :no_content }
    end
  end

  private
  # Use callbacks to share common setup or constraints between actions.
  def set_admin_bank
    @admin_bank = Bank.find(params[:id])
  end

  # Never trust parameters from the scary internet, only allow the white list through.
  def admin_bank_params
    params.require(:bank).permit(:title, :enable)
  end
end


text:
package is.jcdav.darkseer;

import java.util.Arrays;
import java.util.List;

public class DarkSeer {
  public static native void start();
  /**
   * 0 print nothing, just return the # of bytes allocated
   * 1 print the objects, but not their contents
   * 2 print contents of primitives and arrays only (default)
   * 3 print contents of every object
   *
   * These are not stable and may change
   */
  public static native int end(int level);
  public static int end() {
    return end(2);
  }

  private static final List<Class<?>> primitives = Arrays.asList(new Class<?>[]{
    Boolean.class,
    Byte.class,
    Short.class,
    Character.class,
    Integer.class,
    Float.class,
    Long.class,
    Double.class
  });
  //Used to jailbreak out of JNI for printing logic.
  private static void printValue(Object object, int level) {
    Class clazz = object.getClass();
    if ((primitives.contains(clazz) || clazz.isArray()) && level > 1) {
      if (object instanceof boolean[]) {
        System.out.println(Arrays.toString((boolean[]) object));
      } else if (object instanceof byte[]) {
        System.out.println(Arrays.toString((byte[]) object));
      } else if (object instanceof short[]) {
        System.out.println(Arrays.toString((short[]) object));
      } else if (object instanceof char[]) {
        System.out.println(Arrays.toString((char[]) object));
      } else if (object instanceof int[]) {
        System.out.println(Arrays.toString((int[]) object));
      } else if (object instanceof float[]) {
        System.out.println(Arrays.toString((float[]) object));
      } else if (object instanceof long[]) {
        System.out.println(Arrays.toString((long[]) object));
      } else if (object instanceof double[]) {
        System.out.println(Arrays.toString((double[]) object));
      } else if (object instanceof Object[]) {
        System.out.println(Arrays.deepToString((Object[]) object));
      } else {
        System.out.println(object.toString());
      }
    } else if (level >= 3) {
      System.out.println(object.toString());
    }
  }

  // Warmup to clear out initializaion allocations
  static {
    start();
    end(0);
  }
}


text:
<?php
namespace Neat\Test\Loader\Fixture\Plugin;

class Plugin3 {}


text:
Through command line

* `grunt verify` check for js error
* `grunt build` build release version


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title></title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="author" content="Xpectare Interactive Media" />

        <meta name="description" content="" />

        <meta name="author" content="" />
        <meta name="copyright" content="" />
        <meta name="application-name" content="" />

        <meta property="og:title" content="" />
        <meta property="og:type" content="article" />
        <meta property="og:image" content="" />
        <meta property="og:url" content="" />
        <meta property="og:description" content="" />

        <meta name="twitter:card" content="summary" />
        <meta name="twitter:title" content="" />
        <meta name="twitter:description" content="" />
        <meta name="twitter:image" content="" />

        <link rel="shortcut icon" href="img/favicon.ico">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/font-awesome.min.css">
        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">

                    Inicio

                    Pagina

                    Contacto


text:
package org.apache.airavata.registry.core.entities.airavataworkflowcatalog;

import java.io.Serializable;
import java.util.Objects;

public class WorkflowApplicationPK implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String workflowId;

    public WorkflowApplicationPK() {
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setWorkflowId(String workflowId) {
        this.workflowId = workflowId;
    }

    public String getId() {
        return id;
    }

    public String getWorkflowId() {
        return workflowId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WorkflowApplicationPK that = (WorkflowApplicationPK) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(workflowId, that.workflowId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, workflowId);
    }
}


text:
package com.ma.bears.Valkyrie.commands.Auton;

/**
 *
 * @author Blevenson
 */
import edu.wpi.first.wpilibj.command.Command;

public class WaitCommand extends Command {
  private double timeout;

  public WaitCommand(double seconds) {
    timeout = seconds;
  }
  protected void initialize() {
    setTimeout(timeout);
  }

  protected void execute() {}

  protected boolean isFinished() {
    return isTimedOut();
  }

  protected void end() {}

  protected void interrupted() {
	  end();
  }
}


text:
package org.robolectric.shadows;

import android.content.res.*;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.ParcelFileDescriptor;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.LongSparseArray;
import android.util.TypedValue;
import android.view.Display;
import org.jetbrains.annotations.NotNull;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import org.robolectric.annotation.Resetter;
import org.robolectric.annotation.HiddenApi;
import org.robolectric.res.Attribute;
import org.robolectric.res.Plural;
import org.robolectric.res.ResName;
import org.robolectric.res.ResType;
import org.robolectric.res.ResourceIndex;
import org.robolectric.res.ResourceLoader;
import org.robolectric.res.StringResources;
import org.robolectric.res.Style;
import org.robolectric.res.TypedResource;
import org.robolectric.util.ReflectionHelpers;
import org.robolectric.res.builder.XmlFileBuilder;
import org.robolectric.util.ReflectionHelpers.ClassParameter;
import org.robolectric.util.Util;
import org.w3c.dom.Document;

import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import static org.robolectric.internal.Shadow.directlyOn;
import static org.robolectric.Shadows.shadowOf;

/**
 * Shadow of {@code Resources} that simulates the loading of resources
 */
@SuppressWarnings({"UnusedDeclaration"})
@Implements(Resources.class)
public class ShadowResources {
  private static Resources system = null;

  private float density = 1.0f;
  private DisplayMetrics displayMetrics;
  private Display display;
  @RealObject Resources realResources;
  private ResourceLoader resourceLoader;

  @Resetter
  public static void reset() {
    for (Field field : Resources.class.getDeclaredFields()) {
      if (Modifier.isStatic(field.getModifiers()) && field.getType().equals(LongSparseArray.class)) {
        try {
          field.setAccessible(true);
          LongSparseArray longSparseArray = (LongSparseArray) field.get(null);
          if (longSparseArray != null) {
            longSparseArray.clear();
          }
        } catch (IllegalAccessException e) {
          throw new RuntimeException(e);
        }
      }
    }
  }

  public static void setSystemResources(ResourceLoader systemResourceLoader) {
    AssetManager assetManager = ReflectionHelpers.callConstructor(AssetManager.class);
    ShadowAssetManager.bind(assetManager, null, systemResourceLoader);
    DisplayMetrics metrics = new DisplayMetrics();
    Configuration config = new Configuration();
    system = ShadowResources.bind(new Resources(assetManager, metrics, config), systemResourceLoader);
  }

  static Resources bind(Resources resources, ResourceLoader resourceLoader) {
    ShadowResources shadowResources = shadowOf(resources);
    if (shadowResources.resourceLoader != null) throw new RuntimeException("ResourceLoader already set!");
    shadowResources.resourceLoader = resourceLoader;
    return resources;
  }

  @Implementation
  public static Resources getSystem() {
    return system;
  }

  public static Resources createFor(ResourceLoader resourceLoader) {
    AssetManager assetManager = ShadowAssetManager.bind(ReflectionHelpers.callConstructor(AssetManager.class), null, resourceLoader);
    return bind(new Resources(assetManager, new DisplayMetrics(), new Configuration()), resourceLoader);
  }

  private TypedArray attrsToTypedArray(AttributeSet set, int[] attrs, int defStyleAttr, int themeResourceId, int defStyleRes) {
    /*
     * When determining the final value of a particular attribute, there are four inputs that come into play:
     *
     * 1. Any attribute values in the given AttributeSet.
     * 2. The style resource specified in the AttributeSet (named "style").
     * 3. The default style specified by defStyleAttr and defStyleRes
     * 4. The base values in this theme.
     */
    ResourceLoader resourceLoader = getResourceLoader();
    ShadowAssetManager shadowAssetManager = shadowOf(realResources.getAssets());
    String qualifiers = shadowAssetManager.getQualifiers();

    if (set == null) {
      set = new RoboAttributeSet(new ArrayList<Attribute>(), ShadowApplication.getInstance().getResourceLoader());
    }
    Style defStyleFromAttr = null;
    Style defStyleFromRes = null;
    Style styleAttrStyle = null;
    Style theme = null;

    List<ShadowAssetManager.OverlayedStyle> overlayedStyles = ShadowAssetManager.getOverlayThemeStyles(themeResourceId);
    if (themeResourceId != 0) {
      // Load the style for the theme we represent. E.g. "@style/Theme.Robolectric"
      ResName themeStyleName = getResName(themeResourceId);
      theme = ShadowAssetManager.resolveStyle(resourceLoader, null, themeStyleName, shadowAssetManager.getQualifiers());

      if (defStyleAttr != 0) {
        // Load the theme attribute for the default style attributes. E.g., attr/buttonStyle
        ResName defStyleName = getResName(defStyleAttr);

        // Load the style for the default style attribute. E.g. "@style/Widget.Robolectric.Button";
        Attribute defStyleAttribute = getOverlayedThemeValue(defStyleName, theme, overlayedStyles);
        if (defStyleAttribute != null) {
          while (defStyleAttribute.isStyleReference()) {
            Attribute other = getOverlayedThemeValue(defStyleAttribute.getStyleReference(), theme, overlayedStyles);
            if (other == null) {
              throw new RuntimeException("couldn't dereference " + defStyleAttribute);
            }
            defStyleAttribute = other;
          }

          if (defStyleAttribute.isResourceReference()) {
            ResName defStyleResName = defStyleAttribute.getResourceReference();
            defStyleFromAttr = ShadowAssetManager.resolveStyle(resourceLoader, theme, defStyleResName, shadowAssetManager.getQualifiers());
          }
        }
      }
    }

    int styleAttrResId = set.getStyleAttribute();
    if (styleAttrResId != 0) {
      ResName styleAttributeResName = getResName(styleAttrResId);
      while (styleAttributeResName.type.equals("attr")) {
        Attribute attrValue = getOverlayedThemeValue(styleAttributeResName, theme, overlayedStyles);
        if (attrValue.isResourceReference()) {
          styleAttributeResName = attrValue.getResourceReference();
        } else if (attrValue.isStyleReference()) {
          styleAttributeResName = attrValue.getStyleReference();
        }
      }
      styleAttrStyle = ShadowAssetManager.resolveStyle(resourceLoader, theme, styleAttributeResName, shadowAssetManager.getQualifiers());
    }

    if (defStyleRes != 0) {
      ResName resName = getResName(defStyleRes);
      if (resName.type.equals("attr")) {
        Attribute attributeValue = findAttributeValue(getResName(defStyleRes), set, styleAttrStyle, defStyleFromAttr, defStyleFromAttr, theme, overlayedStyles);
        if (attributeValue != null) {
          if (attributeValue.isStyleReference()) {
            resName = getOverlayedThemeValue(attributeValue.getStyleReference(), theme, overlayedStyles).getResourceReference();
          } else if (attributeValue.isResourceReference()) {
            resName = attributeValue.getResourceReference();
          }
        }
      }
      defStyleFromRes = ShadowAssetManager.resolveStyle(resourceLoader, theme, resName, shadowAssetManager.getQualifiers());
    }

    List<Attribute> attributes = new ArrayList<Attribute>();
    if (attrs == null) attrs = new int[0];
    for (int attr : attrs) {
      ResName attrName = tryResName(attr); // todo probably getResName instead here?
      if (attrName == null) continue;

      Attribute attribute = findAttributeValue(attrName, set, styleAttrStyle, defStyleFromAttr, defStyleFromRes, theme, overlayedStyles);
      while (attribute != null && attribute.isStyleReference()) {
        ResName otherAttrName = attribute.getStyleReference();

        // TODO: this is just a debugging hack to avoid the problem of Resources.loadDrawableForCookie not working.
        // TODO: We need to address the real problem instead, but are putting it off for a day or two -AV, ED 2014-12-03
        if (theme == null) break;

        attribute = getOverlayedThemeValue(otherAttrName, theme, overlayedStyles);
        if (attribute != null) {
          attribute = new Attribute(attrName, attribute.value, attribute.contextPackageName);
        }
      }

      if (attribute != null) {
        Attribute.put(attributes, attribute);
      }
    }

    TypedArray typedArray = createTypedArray(attributes, attrs);
    shadowOf(typedArray).positionDescription = set.getPositionDescription();
    return typedArray;
  }

  public TypedArray createTypedArray(List<Attribute> set, int[] attrs) {
    ResourceLoader resourceLoader = getResourceLoader();
    ResourceIndex resourceIndex = resourceLoader.getResourceIndex();
    String qualifiers = shadowOf(realResources.getAssets()).getQualifiers();

    CharSequence[] stringData = new CharSequence[attrs.length];
    int[] data = new int[attrs.length * ShadowAssetManager.STYLE_NUM_ENTRIES];
    int[] indices = new int[attrs.length + 1];
    int nextIndex = 0;

    List<Integer> wantedAttrsList = Util.intArrayToList(attrs);

    for (int i = 0; i < attrs.length; i++) {
      int offset = i * ShadowAssetManager.STYLE_NUM_ENTRIES;

      int attr = attrs[i];
      ResName attrName = resourceIndex.getResName(attr);
      if (attrName != null) {
        Attribute attribute = Attribute.find(set, attrName);
        TypedValue typedValue = new TypedValue();
        Converter.convertAndFill(attribute, typedValue, resourceLoader, qualifiers, true);

        if (attribute != null && !attribute.isNull()) {
          //noinspection PointlessArithmeticExpression
          data[offset + ShadowAssetManager.STYLE_TYPE] = typedValue.type;
          data[offset + ShadowAssetManager.STYLE_DATA] = typedValue.type == TypedValue.TYPE_STRING ? i : typedValue.data;
          data[offset + ShadowAssetManager.STYLE_ASSET_COOKIE] = typedValue.assetCookie;
          data[offset + ShadowAssetManager.STYLE_RESOURCE_ID] = typedValue.resourceId;
          data[offset + ShadowAssetManager.STYLE_CHANGING_CONFIGURATIONS] = typedValue.changingConfigurations;
          data[offset + ShadowAssetManager.STYLE_DENSITY] = typedValue.density;
          stringData[i] = typedValue.string;

          indices[nextIndex + 1] = i;
          nextIndex++;
        }
      }
    }

    indices[0] = nextIndex;

    return ShadowTypedArray.create(realResources, attrs, data, indices, nextIndex, stringData);
  }

  private Attribute findAttributeValue(ResName attrName, AttributeSet attributeSet, Style styleAttrStyle, Style defStyleFromAttr, Style defStyleFromRes, Style theme, List<ShadowAssetManager.OverlayedStyle> overlayedStyles) {
    String attrValue = attributeSet.getAttributeValue(attrName.getNamespaceUri(), attrName.name);
    if (attrValue != null) {
      return new Attribute(attrName, attrValue, "fixme!!!");
    }

    if (styleAttrStyle != null) {
      Attribute attribute = styleAttrStyle.getAttrValue(attrName);
      if (attribute != null) {
        return attribute;
      }
    }

    // else if attr in defStyleFromAttr, use its value
    if (defStyleFromAttr != null) {
      Attribute attribute = defStyleFromAttr.getAttrValue(attrName);
      if (attribute != null) {
        return attribute;
      }
    }

    if (defStyleFromRes != null) {
      Attribute attribute = defStyleFromRes.getAttrValue(attrName);
      if (attribute != null) {
        return attribute;
      }
    }

    // else if attr in theme, use its value
    if (theme != null) {
      return getOverlayedThemeValue(attrName, theme, overlayedStyles);
    }

    return null;
  }

  static Attribute getOverlayedThemeValue(ResName attrName, Style theme, List<ShadowAssetManager.OverlayedStyle> overlayedStyles) {
    Attribute attribute = theme.getAttrValue(attrName);

    if (overlayedStyles != null) {
      for (ShadowAssetManager.OverlayedStyle overlayedStyle : overlayedStyles) {
        Attribute overlayedAttribute = overlayedStyle.style.getAttrValue(attrName);
        if (overlayedAttribute != null && (attribute == null || overlayedStyle.force)) {
          attribute = overlayedAttribute;
        }
      }
    }

    return attribute;
  }

  @Implementation
  public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
    return attrsToTypedArray(set, attrs, 0, 0, 0);
  }

  @Implementation
  public int getIdentifier(String name, String defType, String defPackage) {
    ResourceIndex resourceIndex = getResourceLoader().getResourceIndex();
    ResName resName = ResName.qualifyResName(name, defPackage, defType);
    Integer resourceId = resourceIndex.getResourceId(resName);
    if (resourceId == null) return 0;
    return resourceId;
  }

  @Implementation
  public String getResourceName(int resId) throws Resources.NotFoundException {
    return getResName(resId).getFullyQualifiedName();
  }

  @Implementation
  public String getResourcePackageName(int resId) throws Resources.NotFoundException {
    return getResName(resId).packageName;
  }

  @Implementation
  public String getResourceTypeName(int resId) throws Resources.NotFoundException {
    return getResName(resId).type;
  }

  @Implementation
  public String getResourceEntryName(int resId) throws Resources.NotFoundException {
    return getResName(resId).name;
  }

  private boolean isEmpty(String s) {
    return s == null || s.length() == 0;
  }

  private @NotNull ResName getResName(int id) {
    ResName resName = getResourceLoader().getResourceIndex().getResName(id);
    if (resName == null) {
      throw new Resources.NotFoundException("Unable to find resource ID #0x" + Integer.toHexString(id));
    }
    return resName;
  }

  private ResName tryResName(int id) {
    return getResourceLoader().getResourceIndex().getResName(id);
  }

  private String getQualifiers() {
    return shadowOf(realResources.getAssets()).getQualifiers();
  }

  @Implementation
  public CharSequence getText(int id) throws Resources.NotFoundException {
    CharSequence text = directlyOn(realResources, Resources.class).getText(id);
    return StringResources.escape(text.toString());
  }

  @Implementation
  public String getQuantityString(int id, int quantity, Object... formatArgs) throws Resources.NotFoundException {
    String raw = getQuantityString(id, quantity);
    return String.format(Locale.ENGLISH, raw, formatArgs);
  }

  @Implementation
  public String getQuantityString(int id, int quantity) throws Resources.NotFoundException {
    ResName resName = getResName(id);
    Plural plural = getResourceLoader().getPlural(resName, quantity, getQualifiers());
    String string = plural.getString();
    ShadowAssetManager shadowAssetManager = shadowOf(realResources.getAssets());
    TypedResource typedResource = shadowAssetManager.resolve(
        new TypedResource<>(string, ResType.CHAR_SEQUENCE), getQualifiers(),
        new ResName(resName.packageName, "string", resName.name));
    return typedResource == null ? null : typedResource.asString();
  }

  @Implementation
  public InputStream openRawResource(int id) throws Resources.NotFoundException {
    return getResourceLoader().getRawValue(getResName(id));
  }

  @Implementation
  public AssetFileDescriptor openRawResourceFd(int id) throws Resources.NotFoundException {
    try {
      FileInputStream fis = (FileInputStream)openRawResource(id);
      return new AssetFileDescriptor(ParcelFileDescriptor.dup(fis.getFD()), 0, fis.getChannel().size());
    } catch (Exception e) {
      return null;
    }
  }

  public void setDensity(float density) {
    this.density = density;
    if (displayMetrics != null) {
      displayMetrics.density = density;
    }
  }

  public void setScaledDensity(float scaledDensity) {
    if (displayMetrics != null) {
      displayMetrics.scaledDensity = scaledDensity;
    }
  }

  public void setDisplay(Display display) {
    this.display = display;
    displayMetrics = null;
  }

  @Implementation
  public DisplayMetrics getDisplayMetrics() {
    if (displayMetrics == null) {
      if (display == null) {
        display = ReflectionHelpers.callConstructor(Display.class);
      }

      displayMetrics = new DisplayMetrics();
      display.getMetrics(displayMetrics);
    }
    displayMetrics.density = this.density;
    return displayMetrics;
  }

  @Implementation
  public XmlResourceParser getXml(int id) throws Resources.NotFoundException {
    ResName resName = getResName(id);
    Document document = getResourceLoader().getXml(resName, getQualifiers());
    if (document == null) {
      throw new Resources.NotFoundException();
    }
    return new XmlFileBuilder().getXml(document, resName.getFullyQualifiedName(), resName.packageName, getResourceLoader().getResourceIndex());
  }

  @HiddenApi @Implementation
  public XmlResourceParser loadXmlResourceParser(String file, int id, int assetCookie, String type) throws Resources.NotFoundException {
    String packageName = getResName(id).packageName;
    return XmlFileBuilder.getXmlResourceParser(file, packageName, getResourceLoader().getResourceIndex());
  }

  public ResourceLoader getResourceLoader() {
    if (resourceLoader == null) {
      resourceLoader = shadowOf(RuntimeEnvironment.application).getResourceLoader();
    }
    return resourceLoader;
  }

  @Implements(Resources.Theme.class)
  public static class ShadowTheme {
    @RealObject Resources.Theme realTheme;
    protected Resources resources;
    private int styleResourceId;

    @Implementation
    public void applyStyle(int resid, boolean force) {
      if (styleResourceId == 0) {
        this.styleResourceId = resid;
      }

      ShadowAssetManager.applyThemeStyle(styleResourceId, resid, force);
    }

    @Implementation
    public void setTo(Resources.Theme other) {
      this.styleResourceId = shadowOf(other).styleResourceId;
    }

    public int getStyleResourceId() {
      return styleResourceId;
    }

    @Implementation
    public TypedArray obtainStyledAttributes(int[] attrs) {
      return obtainStyledAttributes(0, attrs);
    }

    @Implementation
    public TypedArray obtainStyledAttributes(int resid, int[] attrs) throws android.content.res.Resources.NotFoundException {
      return obtainStyledAttributes(null, attrs, 0, resid);
    }

    @Implementation
    public TypedArray obtainStyledAttributes(AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
      return shadowOf(getResources()).attrsToTypedArray(set, attrs, defStyleAttr, styleResourceId, defStyleRes);
    }

    @Implementation
    public Resources getResources() {
      return ReflectionHelpers.getField(realTheme, "this$0");
    }
  }

  @Implementation
  public final Resources.Theme newTheme() {
    Resources.Theme theme = directlyOn(realResources, Resources.class).newTheme();
    int themeId = Integer.valueOf(ReflectionHelpers.getField(theme, "mTheme").toString()); // TODO: in Lollipop, these can be longs, which will overflow int
    shadowOf(realResources.getAssets()).setTheme(themeId, theme);
    return theme;
  }

  @HiddenApi @Implementation
  public Drawable loadDrawable(TypedValue value, int id) {
    ResName resName = tryResName(id);
    Drawable drawable = directlyOn(realResources, Resources.class, "loadDrawable",
        ClassParameter.from(TypedValue.class, value), ClassParameter.from(int.class, id));

    // todo: this kinda sucks, find some better way...
    if (drawable != null) {
      shadowOf(drawable).createdFromResId = id;
      if (drawable instanceof BitmapDrawable) {
        Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
        if (bitmap != null) {
          ShadowBitmap shadowBitmap = shadowOf(bitmap);
          if (shadowBitmap.createdFromResId == -1) {
            shadowBitmap.setCreatedFromResId(id, resName);
          }
        }
      }
    }
    return drawable;
  }

  @Implementation
  public Drawable loadDrawable(TypedValue value, int id, Resources.Theme theme) throws Resources.NotFoundException {
    ResName resName = tryResName(id);
    Drawable drawable = directlyOn(realResources, Resources.class, "loadDrawable",
        ClassParameter.from(TypedValue.class, value), ClassParameter.from(int.class, id), ClassParameter.from(Resources.Theme.class, theme));

    // todo: this kinda sucks, find some better way...
    if (drawable != null) {
      shadowOf(drawable).createdFromResId = id;
      if (drawable instanceof BitmapDrawable) {
        Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
        if (bitmap != null) {
          ShadowBitmap shadowBitmap = shadowOf(bitmap);
          if (shadowBitmap.createdFromResId == -1) {
            shadowBitmap.setCreatedFromResId(id, resName);
          }
        }
      }
    }
    return drawable;
  }

  @Implements(Resources.NotFoundException.class)
  public static class ShadowNotFoundException {
    @RealObject Resources.NotFoundException realObject;

    private String message;

    public void __constructor__() {
    }

    public void __constructor__(String name) {
      this.message = name;
    }

    @Implementation
    public String toString() {
      return realObject.getClass().getName() + ": " + message;
    }
  }
}


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

public class YoumuSlashTarget : MonoBehaviour
{
    [SerializeField]
    private YoumuSlashTimingData timingData;
    [SerializeField]
    private YoumuSlashTargetBody body;
    [SerializeField]
    private YoumuSlashSoundEffect launchSoundEffect;
    [SerializeField]
    private float leftPitch = 1f;
    [SerializeField]
    private float rightPitch = 1f;
    [SerializeField]
    private float hitOffsetMult = 2f;

    private YoumuSlashBeatMap.TargetBeat mapInstance;
    public YoumuSlashBeatMap.TargetBeat MapInstance => mapInstance;

    private bool isRight;
    private float slashAngle;
    private float slashTimeOffset;

    public class SlashData
    {
        public YoumuSlashBeatMap.TargetBeat target;
        public float angle;
        public float timeOffset;
    }

    public void initiate(YoumuSlashBeatMap.TargetBeat mapInstance)
    {
        this.mapInstance = mapInstance;
        mapInstance.launchInstance = this;
        importTargetTypeTraits(mapInstance);
        isRight = mapInstance.HitDirection == YoumuSlashBeatMap.TargetBeat.Direction.Right;
        if (isRight)
            transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);

        BroadcastMessage("onLaunch", MapInstance, SendMessageOptions.DontRequireReceiver);
    }

    void importTargetTypeTraits(YoumuSlashBeatMap.TargetBeat target)
    {
        body.RigAnimator.runtimeAnimatorController = target.TypeData.Animator;
        body.BaseImage.sprite = target.TypeData.Image;
        launchSoundEffect = target.TypeData.LaunchSoundEffect;
    }

    public void slash(float angle, float effectActivationTime, float timeOffset)
    {
        mapInstance.slashed = true;
        slashAngle = angle;
        Invoke("activateSlashEffect", effectActivationTime);

        var timeUntilNextBeat = timingData.BeatDuration - timeOffset;
        var slashSpeed = 1f / (timeUntilNextBeat / timingData.BeatDuration);    //Speed slash animation should go to compensate for time offset (for yuyuko food)
        slashSpeed = Mathf.Pow(slashSpeed, .5f);
        body.onSlashActivate(slashSpeed);

        slashTimeOffset = timeOffset;

        var slashData = new SlashData
        {
            angle = angle,
            timeOffset = timeOffset,
            target = mapInstance
        };
        BroadcastMessage("onSlash", slashData, SendMessageOptions.DontRequireReceiver);
    }

    public void activateSlashEffect()
    {
        var distanceOffset = Vector3.down * slashTimeOffset * hitOffsetMult;
        body.onSlashDelay(slashAngle, distanceOffset);
    }
}


text:
namespace oless {
	namespace excel {
		namespace structures {
			namespace formulas {

				// see: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/52863fc5-3d3c-4874-90e6-a7961902849f
				// ptg=0x05
				// The PtgMul structure specifies a binary-value-operator that multiplies the first and second expressions in a binary-value-expression.
				class PtgMul : public PtgBasic {
				private:

				public:
					PtgMul(unsigned char* buffer, size_t max, unsigned int offset): PtgBasic() { this->Parse(buffer, max, offset); }

					std::string to_string() const override {
						return "PtgMul";
					}
				};
			}
        }
    }
}


text:
from ....testing import assert_equal
from ..registration import MPRtoMNI305

def test_MPRtoMNI305_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    in_file=dict(argstr='%s',
    usedefault=True,
    ),
    reference_dir=dict(mandatory=True,
    usedefault=True,
    ),
    subjects_dir=dict(),
    target=dict(mandatory=True,
    usedefault=True,
    ),
    terminal_output=dict(nohash=True,
    ),
    )
    inputs = MPRtoMNI305.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(inputs.traits()[key], metakey), value

def test_MPRtoMNI305_outputs():
    output_map = dict(log_file=dict(usedefault=True,
    ),
    out_file=dict(),
    )
    outputs = MPRtoMNI305.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(outputs.traits()[key], metakey), value


text:
__author__ = "Satish Palaniappan"

'''
Copyright 2015 Satish Palaniappan

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.
'''

### Insert Current Path
import os, sys, inspect
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.path:
	sys.path.insert(0, cmd_folder)

import sys
# your gen-py dir
sys.path.append(cmd_folder +'/gen-py')
sys.path.append("../")

from Topics import *
from Topics.ttypes import *
from Topics.constants import *

from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol

# Make socket
transport = TSocket.TSocket('localhost', 9092)

# Buffering is critical. Raw sockets are very slow
transport = TTransport.TBufferedTransport(transport)

# Wrap in a protocol
protocol = TBinaryProtocol.TBinaryProtocol(transport)

# Create a client to use the protocol encoder
client = Topics.Client(protocol)

# Connect!
transport.open()

trend = client.getTrending("the noodles was spicy|the vodka was awesome|the fish tastes better")

print(trend)

transport.close()


text:
#ifndef ANT_SDM_PAGE_1_H__
#define ANT_SDM_PAGE_1_H__

/** @file
 *
 * @defgroup ant_sdk_profiles_sdm_page1 Stride Based Speed and Distance Monitor profile page 1
 * @{
 * @ingroup ant_sdk_profiles_sdm_pages
 */

#include <stdint.h>
#include "ant_sdm_common_data.h"

#ifdef __cplusplus
extern "C" {
#endif

/**@brief Data structure for SDM data page 1.
 */
typedef struct
{
    uint8_t  update_latency; ///< Update latency.
    uint8_t  strides;        ///< Strides (writing to this field has no effect).
    uint16_t time;           ///< Time.
} ant_sdm_page1_data_t;

/**@brief Initialize page 1.
 */
#define DEFAULT_ANT_SDM_PAGE1() \
    (ant_sdm_page1_data_t)      \
    {                           \
        .update_latency = 0,    \
        .time           = 0,    \
    }

/**@brief Function for encoding page 1.
 *
 * @param[in]  p_page_data      Pointer to the page data.
 * @param[in]  p_common_data    Pointer to the common data.
 * @param[out] p_page_buffer    Pointer to the data buffer.
 */
void ant_sdm_page_1_encode(uint8_t                     * p_page_buffer,
                           ant_sdm_page1_data_t const  * p_page_data,
                           ant_sdm_common_data_t const * p_common_data);

/**@brief Function for decoding page 1.
 *
 * @param[in]  p_page_buffer    Pointer to the data buffer.
 * @param[out] p_page_data      Pointer to the page data.
 * @param[out] p_common_data    Pointer to the common data.
 */
void ant_sdm_page_1_decode(uint8_t const         * p_page_buffer,
                           ant_sdm_page1_data_t  * p_page_data,
                           ant_sdm_common_data_t * p_common_data);

#ifdef __cplusplus
}
#endif

#endif // ANT_SDM_PAGE_1_H__
/** @} */


text:
from openstack.compute import compute_service
from openstack import resource2

class Extension(resource2.Resource):
    resource_key = 'extension'
    resources_key = 'extensions'
    base_path = '/extensions'
    service = compute_service.ComputeService()
    id_attribute = "alias"

    # capabilities
    allow_get = True
    allow_list = True

    # Properties
    #: A short name by which this extension is also known.
    alias = resource2.Body('alias', alternate_id=True)
    #: Text describing this extension's purpose.
    description = resource2.Body('description')
    #: Links pertaining to this extension. This is a list of dictionaries,
    #: each including keys ``href`` and ``rel``.
    links = resource2.Body('links')
    #: The name of the extension.
    name = resource2.Body('name')
    #: A URL pointing to the namespace for this extension.
    namespace = resource2.Body('namespace')
    #: Timestamp when this extension was last updated.
    updated_at = resource2.Body('updated')