text:
---
title: no-underscore-dangle - Rules
layout: doc
edit_link: https://github.com/eslint/eslint/edit/master/docs/rules/no-underscore-dangle.md
rule_type: suggestion
---
<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->

# disallow dangling underscores in identifiers (no-underscore-dangle)

As far as naming conventions for identifiers go, dangling underscores may be the most polarizing in JavaScript. Dangling underscores are underscores at either the beginning or end of an identifier, such as:

```js
var _foo;
```

There is actually a long history of using dangling underscores to indicate "private" members of objects in JavaScript (though JavaScript doesn't have truly private members, this convention served as a warning). This began with SpiderMonkey adding nonstandard methods such as `__defineGetter__()`. The intent with the underscores was to make it obvious that this method was special in some way. Since that time, using a single underscore prefix has become popular as a way to indicate "private" members of objects.

Whether or not you choose to allow dangling underscores in identifiers is purely a convention and has no effect on performance, readability, or complexity. It's purely a preference.

## Rule Details

This rule disallows dangling underscores in identifiers.

Examples of **incorrect** code for this rule:

```js
/*eslint no-underscore-dangle: "error"*/

var foo_;
var __proto__ = {};
foo._bar();
```

Examples of **correct** code for this rule:

```js
/*eslint no-underscore-dangle: "error"*/

var _ = require('underscore');
var obj = _.contains(items, item);
obj.__proto__ = {};
var file = __filename;
```

## Options

This rule has an object option:

* `"allow"` allows specified identifiers to have dangling underscores
* `"allowAfterThis": false` (default) disallows dangling underscores in members of the `this` object
* `"allowAfterSuper": false` (default) disallows dangling underscores in members of the `super` object
* `"allowAfterThisConstructor": false` (default) disallows dangling underscores in members of the `this.constructor` object
* `"enforceInMethodNames": false` (default) allows dangling underscores in method names

### allow

Examples of additional **correct** code for this rule with the `{ "allow": ["foo_", "_bar"] }` option:

```js
/*eslint no-underscore-dangle: ["error", { "allow": ["foo_", "_bar"] }]*/

var foo_;
foo._bar();
```

### allowAfterThis

Examples of **correct** code for this rule with the `{ "allowAfterThis": true }` option:

```js
/*eslint no-underscore-dangle: ["error", { "allowAfterThis": true }]*/

var a = this.foo_;
this._bar();
```

### allowAfterSuper

Examples of **correct** code for this rule with the `{ "allowAfterSuper": true }` option:

```js
/*eslint no-underscore-dangle: ["error", { "allowAfterSuper": true }]*/

var a = super.foo_;
super._bar();
```

### allowAfterThisConstructor

Examples of **correct** code for this rule with the `{ "allowAfterThisConstructor": true }` option:

```js
/*eslint no-underscore-dangle: ["error", { "allowAfterThisConstructor": true }]*/

var a = this.constructor.foo_;
this.constructor._bar();
```

### enforceInMethodNames

Examples of **incorrect** code for this rule with the `{ "enforceInMethodNames": true }` option:

```js
/*eslint no-underscore-dangle: ["error", { "enforceInMethodNames": true }]*/

class Foo {
  _bar() {}
}

class Foo {
  bar_() {}
}

const o = {
  _bar() {}
};

const o = {
  bar_() = {}
};
```

## When Not To Use It

If you want to allow dangling underscores in identifiers, then you can safely turn this rule off.

## Version

This rule was introduced in ESLint 0.0.9.

## Resources

* [Rule source](https://github.com/eslint/eslint/tree/master/lib/rules/no-underscore-dangle.js)
* [Documentation source](https://github.com/eslint/eslint/tree/master/docs/rules/no-underscore-dangle.md)

redpajama_set_name: RedPajamaGithub


text:
name             'vo_nimsoft'
maintainer       'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license          'All rights reserved'
description      'Installs/Configures vo_nimsoft'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.0'

depends "rightscale"

recipe "vo_nimsoft::install_nimsoft","Dummy placeholder for nimsoft installation."


text:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// This file is a part of the 'esoco-lib' project.
// Copyright 2018 Elmar Sonnenschein, esoco GmbH, Flensburg, Germany
//
// 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.
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package de.esoco.lib.reflect;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

/********************************************************************
 * Base class that invokes an arbitrary method on a target object. Even
 * non-public methods can be used, the implementation will try to invoke
 * setAccessible() on them. In environments where this is not allowed an
 * exception will be thrown. Therefore applications that are built for
 * environments that have limited accessibility (like applets) should only use
 * public methods to dispatch to.
 *
 *
The availability of the referenced method will be tested directly on
 * construction (and if missing, an IllegalArgumentException will be thrown).
 * Therefore any problems arising from missing dispatch methods should be
 * detectable during development time as long as the method dispatchers are
 * created during application startup or in unit tests. If not, the developer
 * should expect the exception and handle it according to his needs.

 *
 *
This class is not abstract so that instances from it can be created and
 * used directly. It also implements the ResultRunner interface so that
 * dispatchers for no-argument methods can be used in threads and under other
 * conditions where a Runnable interface is required. If a runnable instance is
 * needed for a parameterized method the subclass {@link MethodArgDispatcher}
 * can be used instead.

 *
 *
This class may also be subclassed for implementations that need a
 * reflection-based dispatch mechanism (e.g. like generic event listeners).
 * Subclasses only need to forward (or generate) the constructor arguments and
 * invoke the {@link #dispatch(Object[]) dispatch()} method to perform the
 * method call.

 *
 *
The generic parameter, as in ResultRunner, defines the type of result
 * returned by the dispatch() and execute() methods. If different result types
 * are possible, this parameter must be a common base class of all possible
 * results.

 *
 * @author eso
 */
public class MethodDispatcher<T>
{
	//~ Instance fields --------------------------------------------------------

	private final Object rTarget;
	private final Method rMethod;
	private boolean		 bUseArgs = true;

	//~ Constructors -----------------------------------------------------------

	/***************************************
	 * Creates a new method dispatcher for a method without parameters.
	 *
	 * @param rTarget The target on which the method shall be invoked
	 * @param sMethod The name of the method to invoke
	 */
	public MethodDispatcher(Object rTarget, String sMethod)
	{
		this(rTarget, sMethod, (Class[]) null);
	}

	/***************************************
	 * Creates a new method dispatcher for a certain method.
	 *
	 * @param rTarget The target on which the method shall be invoked
	 * @param rMethod The method to invoke
	 */
	public MethodDispatcher(Object rTarget, Method rMethod)
	{
		this.rTarget = rTarget;
		this.rMethod = rMethod;
	}

	/***************************************
	 * Creates a new method dispatcher that will invoke a certain method on the
	 * target object when one of the dispatch methods is invoked. It will look
	 * for a method with the given name and parameter types that allow it to be
	 * invoked with the given parameter types. If no such method exists an
	 * IllegalArgumentException will be thrown.
	 *
	 *
The given method may be non-public. It will then be tried to invoke
	 * setAccessible() on it. In environments where that is not possible an
	 * exception will be thrown. Therefore applications that are built for
	 * environments that have limited accessibility (like applets) should only
	 * use public methods to dispatch to.

	 *
	 * @param  rTarget     The target on which the method shall be invoked
	 * @param  sMethod     The name of the method to invoke
	 * @param  rParamTypes An array containing the method parameter types; may
	 *                     be empty or NULL for no-parameter methods
	 *
	 * @throws IllegalArgumentException If no matching method could be found
	 */
	public MethodDispatcher(Object		rTarget,
							String		sMethod,
							Class<?>... rParamTypes)
	{
		this(rTarget, sMethod, false, rParamTypes);
	}

	/***************************************
	 * Constructor for subclassing that creates a new method dispatcher which
	 * will invoke a certain method on the target object when one of the
	 * dispatch methods is invoked. It will first look for a method with the
	 * given name and parameter types that would allow it to be invoked with the
	 * given parameter types. If such is not found but the bNoParamsOptional
	 * parameter is TRUE it will look for a method with no parameters. If that
	 * also doesn't exist an IllegalArgumentException will be thrown.
	 *
	 *
This constructor is non-public because it is intended to be used
	 * internally or by subclasses. Subclasses may allow to optionally use a
	 * non-parameter variant of the method by setting the bNoParamsOptional
	 * parameter to TRUE. In such a case the {@link #dispatch(Object[])} method
	 * will ignore any arguments and invoke the no-argument method.

	 *
	 *
The method to be used may be non-public. It will then be tried to
	 * invoke setAccessible() on it. In environments where that is not possible
	 * an exception will be thrown. Therefore applications that are built for
	 * environments that have limited accessibility (like applets) should only
	 * use public methods to dispatch to.

	 *
	 * @param  rTarget           The target on which the method shall be invoked
	 * @param  sMethod           The name of the method to invoke
	 * @param  bNoParamsOptional If TRUE a method with no parameters will be
	 *                           tried if no method with matching parameter
	 *                           types could be found
	 * @param  rParamTypes       The method parameter types; may either be empty
	 *                           or NULL for no-parameter methods
	 *
	 * @throws IllegalArgumentException If no matching method could be found
	 */
	protected MethodDispatcher(Object	   rTarget,
							   String	   sMethod,
							   boolean	   bNoParamsOptional,
							   Class<?>... rParamTypes)
	{
		this.rTarget = rTarget;
		this.rMethod =
			getMethod(rTarget.getClass(),
					  sMethod,
					  bNoParamsOptional,
					  rParamTypes);
	}

	//~ Methods ----------------------------------------------------------------

	/***************************************
	 * Convenience method for the invocation of no-argument methods.
	 *
	 * @return The value returned by the invoked method (NULL for void methods)
	 */
	public T dispatch()
	{
		return dispatch((Object[]) null);
	}

	/***************************************
	 * Dispatches a call to the actual method this dispatcher is registered for.
	 *
	 * @param  rArgs The argument values to be used for the method call
	 *
	 * @return The value returned by the invoked method (NULL for void methods)
	 */
	@SuppressWarnings("unchecked")
	public T dispatch(Object... rArgs)
	{
		return (T) ReflectUtil.invoke(rTarget,
									  rMethod,
									  bUseArgs ? rArgs : null);
	}

	/***************************************
	 * Gets a certain method from a class. This method first looks for a method
	 * with the given name and parameters of the given types. If such is not
	 * found but the argument bNoParamsOptional is TRUE it will look for a
	 * method with no parameters. If that also doesn't exist an
	 * IllegalArgumentException will be thrown.
	 *
	 *
This method will also search for non-public methods and tries to set
	 * them as accessible for the purpose of dispatching.

	 *
	 * @param  rClass            The class to search
	 * @param  sMethod           The name of the method
	 * @param  bNoParamsOptional If TRUE a method with no parameters will be
	 *                           tried if no method with matching parameter
	 *                           types could be found
	 * @param  rParamTypes       An array containing the method parameter types;
	 *                           may be empty or NULL for no-parameter methods
	 *
	 * @return The method according to the arguments
	 *
	 * @throws IllegalArgumentException If no matching method could be found
	 */
	private Method getMethod(Class<?>    rClass,
							 String		 sMethod,
							 boolean	 bNoParamsOptional,
							 Class<?>... rParamTypes)
	{
		boolean bHasParams = (rParamTypes != null) && (rParamTypes.length > 0);
		Method  m		   =
			ReflectUtil.findMethod(rClass, sMethod, rParamTypes);

		if (m == null && bNoParamsOptional && bHasParams)
		{
			bUseArgs = false;

			// if not found search a variant without argument
			m = ReflectUtil.findMethod(rClass, sMethod, (Class[]) null);
		}

		if (m == null)
		{
			throw new IllegalArgumentException("INIT: no dispatch method or wrong event handler class: " +
											   sMethod);
		}

		if (!Modifier.isPublic(m.getModifiers()))
		{
			m.setAccessible(true);
		}

		return m;
	}
}


text:
Project Manager is a sample REST service implemented using Domain-Driven Design technique.
Its primary goal is to help me to conduct a Domain-Driven Design workshops.
During the workshop developers implement the application on their own, following the steps in right order.

> :bulb:
> Currently I organize the source code someway different. See the [hexagonal_architecture](https://github.com/mkopylec/project-manager/tree/hexagonal_architecture) and/or [hexagonal_architecture_unit_of_work](https://github.com/mkopylec/project-manager/tree/hexagonal_architecture_unit_of_work) and/or [denormalized_model](https://github.com/mkopylec/project-manager/tree/denormalized_model) and/or [api_implementation_achitecture](https://github.com/mkopylec/project-manager/tree/api_implementation_achitecture) branch and also [my blog post](https://allegro.tech/2019/12/grouping-and-organizing-classes.html) for more details. Neverless the following workshop is still a valueable way to get familiar with DDD.

## Application summary
The Project Manager is a simple application for managing business projects at IT company.
The application is directed to project managers.
Using the application they can add projects, monitor their progress and assign teams to work on the projects.

## Working with application
To run the application execute:
```bash
./gradlew bootRun
```
To run tests execute:
```bash
./gradlew test
```

## Steps to implement
Each branch of the repository represents a subsequent step of the overall task.
The task is to implement each step using Domain-Driven Design rules, so the unit tests can successfully pass.
Checkout the _master_ branch.
Get known with the starting code, it contains the parts that are not focused on Domain-Driven Design modelling but are necessary for application to work properly.

The following describes steps to implement using an ubiquitous language.
The description contains hints on how to design a model from the business requirements.
A hint is a bold part of the text with a suggestion on what domain building block or block part should be used:
 - _(E)_ - entity
 - _(EP)_ - entity property
 - _(VO)_ - value object
 - _(VOP)_ - value object property
 - _(DS)_ - domain service
 - _(?)_ - try to guess :-)

The [layers](src/main/java/layers) package contains examples on how to properly implement and organize Domain-Driven Design building blocks and other component types.

### Step 1 - Create a team
The user can create a new **team**_(E)_.
Every team must be **named**_(EP)_.
To manage teams more efficient the user will need an information on how busy a team currently is.
To fulfil this requirement the application must display **how many projects a team is currently implementing**_(EP)_.
A team cannot be created if it already exists.

##### To do
Checkout the _step-1-start_ branch.
Implement the `TeamController.createTeam(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-1-finish_ branch.

### Step 2 - Add a member to a team
The user can add a member to a team.
Every team consists of **members**_(EP)_ that are company's **employees**_(VO)_.
It is important for an employee that, besides of having a **first**_(VOP)_ and **last name**_(VOP)_, he has a known **job position**_(VOP)_.
Job position can be one of: developer, scrum master or product owner.

##### To do
Checkout the _step-2-start_ branch.
Implement the `TeamController.addMemberToTeam(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-2-finish_ branch.

### Step 3 - Show teams
The user can browse teams.
He can see their members and on how many projects teams are working right now.
If a team is working on more than 3 projects the user sees it as a busy team.

##### To do
Checkout the _step-3-start_ branch.
Implement the `TeamController.getTeams(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-3-finish_ branch.

### Step 4 - Create a project draft
The user can create **project**_(E)_ drafts.
A project draft includes minimum information about the project.
It requires a project **name**_(EP)_ and an automatically **generated unique project identifier**_(DS)_.
A newly created project has a "to do" **status**_(EP)_.
No **team**_(EP)_ is assigned to work on a newly created project.

##### To do
Checkout the _step-4-start_ branch.
Implement the `ProjectController.createProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-4-finish_ branch.

### Step 5 - Create a full project
The user can also create a full project.
A full project is a project draft with extra information.
It must contain a list of **features**_(EP)_ that are required to implement within the project.
Every **feature**_(VO)_ has to be **named**_(VOP)_ and it must have **status**_(VOP)_ and **requirement**_(VOP)_ defined.
For the newly created feature a "to do" status has to be set.
Requirement can be one of: optional, recommended or necessary.

##### To do
Checkout the _step-5-start_ branch.
Implement the `ProjectController.createProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-5-finish_ branch.

### Step 6 - Show projects
The user can browse projects.
He can see their list.
Every item on the list contains a project identifier and name.

##### To do
Checkout the _step-6-start_ branch.
Implement the `ProjectController.getProjects(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-6-finish_ branch.

### Step 7 - Show a specific project
The user can also browse a specific project when he clicks on it in the projects list.
He can see all information about the clicked project.

##### To do
Checkout the _step-7-start_ branch.
Implement the `ProjectController.getProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-7-finish_ branch.

### Step 8 - Edit a project
The user can edit created projects.
He can update its name, features and he can **assign a team**_(DS)_ to work on a project.
Feature status can be change to one of: to do, in progress or done.
If a team is assigned to a project then the project counts as a project implemented by the team.

##### To do
Checkout the _step-8-start_ branch.
Implement the `ProjectController.updateProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-8-finish_ branch.

### Step 9 - Start a project
The user can start a project only if the project is assigned to a team.
When the project starts its status is changed to "in progress".

##### To do
Checkout the _step-9-start_ branch.
Implement the `ProjectController.startProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-9-finish_ branch.

### Step 10 - End a project
The user can end a started project when **all of the features in the project are done**_(?)_.
Sometimes the users supervisor can give him a permission to end a project when **only the necessary features are done**_(?)_.
Ended projects don't count as projects implemented by a team.
Ended projects needs to be reported in the company's end year review.
To do that the application needs to inform a Reporting Service about the **ended project**_(?)_ by sending its **identifier**_(?)_.

##### To do
Checkout the _step-10-start_ branch.
Implement the `ProjectController.endProject(...)` method, so the unit tests can successfully pass.
Compare your solution with the _step-10-finish_ branch.

## Hexagonal architecture
Following the workshop's steps creates an application designed in classic layered architecture.
The [hexagonal_architecture](https://github.com/mkopylec/project-manager/tree/hexagonal_architecture) branch shows the fully implemented application in hexagonal architecture.


text:
layout: post
title: 'TSM Invalid file handle passed'
permalink: tsm-fails-invalid-file-handle-passed-error
redirect_from: "2012-01-30-tsm-fails-invalid-file-handle-passed-error/"
support: true
comments: true
tags:
- windows
- tsm
---

If TSM client job failed with and error of **"Invalid file handle passed"**. Here is a quick solution.

Stop the TSM Client Scheduler service.

    net stop "TSM Client Scheduler"

Delete (or rename) the `adsm.sys` directory. The directory will be recreated by TSM.

![adsm-sys](/assets/img/adsm-sys.png)

Restart the TSM Client Scheduler service.

    net start "TSM Client Scheduler"

Rerun the backup job.


text:
package sexy

type SxyBool bool

func (b SxyBool) Answers     () SxyBool {}
func (b SxyBool) Autos       () SxyPair {}
func (b SxyBool) Default     () SxyProc {}
func (b SxyBool) Messages    () SxyPair {}
func (b SxyBool) Resends     () SxyPair {}
func (b SxyBool) Send        () SxyObj  {}
func (b SxyBool) ToBool      () SxyBool {}
func (b SxyBool) ToText      () SxyText {}
func (b SxyBool) ToLiteral   () SxyText {}

func (b SxyBool) Type () SxySymbol {
    return "bool"
}

func (b SxyBool) View () SxyText {

}


text:
$(document).ready(function() { repod.custom_boardlist.init(); });
try { repod; } catch(a) { repod = {}; }
repod.custom_boardlist = {
	init: function() {
		this.config = {
			enabled: repod.suite_settings && !!repod_jsuite_getCookie("custom_boardlist_enabled") ? repod_jsuite_getCookie("custom_boardlist_enabled") === "true" : false,
			original: $("span.boardlist:first").html()
		}
		repod.suite_settings && repod.suite_settings.info.push({menu:{category:'Navigation',read:this.config.enabled,variable:'custom_boardlist_enabled',label:'Custom board list',hover:'Only show selected boards in top and bottom board lists'},popup:{label:'[Edit]',title:'Custom Board List',type:'text',variable:'custom_boardlist_defined',placeholder:'Example: a b c http://u.rl|Display'}});
		this.update();
	},
	update: function() {
		if (this.config.enabled && !!repod_jsuite_getCookie("custom_boardlist_defined")) {
			$(".boardlist").html(this.format());
			$(".custom_boardlist_all").on("click", function() { $(".boardlist").html(repod.custom_boardlist.config.original); });
		}
	},
	format: function(a) {
		var c_bl_a = repod_jsuite_getCookie("custom_boardlist_defined").split(" ");
		$.each(c_bl_a,function(i,v) {
			var r = /([a-z0-9]+:\/\/\S+\.[a-z]{2,}\/?\S*?)\|(.+)/i;
			if (r.test(v)) {
				r = r.exec(v); c_bl_a[i] = ""+r[2]+"";
			} else {
				c_bl_a[i] = ""+v+"";
			}
		});
		c_bl_a = "["+c_bl_a.join(" / ")+"] [...]";
		return c_bl_a;
	}
}


text:
require 'donation_system/data_structs_for_tests'
require 'donation_system/payment_gateway'
require 'spec_helper'

module DonationSystem
  RSpec.describe PaymentGateway do
    let(:data) { VALID_REQUEST_DATA.dup }

    it 'has errors if validation fails' do
      data.type = 'invalid type'
      expect(described_class.charge(data).item).to be_nil
      expect(described_class.charge(data)).not_to be_okay
    end

    describe 'when donation is one-off' do
      before { data.type = InputDataValidator::VALID_TYPES[:oneoff] }

      it 'uses a one-off gateway' do
        result = Result.new(VALID_STRIPE_CHARGE, [])
        expect(StripeWrapper::OneOff).to receive(:charge).and_return(result)
        described_class.charge(data)
      end

      it 'returns no errors when payment is OK' do
        result = Result.new('irrelevant', [])
        expect(StripeWrapper::OneOff).to receive(:charge).and_return(result)
        expect(described_class.charge(data)).to be_okay
      end

      it 'has errors if payment fails' do
        bad_result = Result.new(nil, [:error])
        allow(StripeWrapper::OneOff).to receive(:charge).and_return(bad_result)
        expect(described_class.charge(data).errors).to include(:error)
      end
    end

    describe 'when donation is recurring' do
      before { data.type = InputDataValidator::VALID_TYPES[:recurring] }

      it 'uses a recurring gateway' do
        result = Result.new(VALID_STRIPE_SUBSCRIPTION, [])
        expect(StripeWrapper::Recurring).to receive(:charge).and_return(result)
        described_class.charge(data)
      end

      it 'returns no errors when payment is OK' do
        result = Result.new('irrelevant', [])
        expect(StripeWrapper::Recurring).to receive(:charge).and_return(result)
        expect(described_class.charge(data)).to be_okay
      end

      it 'has errors if payment fails' do
        bad_result = Result.new(nil, [:error])
        allow(StripeWrapper::Recurring).to receive(:charge).and_return(bad_result)
        expect(described_class.charge(data).errors).to include(:error)
      end
    end

    describe 'when selecting other gateways' do
      it 'selects the Paypal one off gateway' do
        result = Result.new(VALID_PAYPAL_PAYMENT, [])
        expect(PaypalWrapper::OneOff).to receive(:charge).and_return(result)
        described_class.charge(VALID_REQUEST_DATA_PAYPAL)
      end
    end
  end
end


text: We have moved! http://inkcoin.org


text:
set(${PROJECT_NAME_STR}_LINKER_LIBS "")
set(${PROJECT_NAME_STR}_TEST_LINKER_LIBS "")

# --[ Threads
# find_package(Threads REQUIRED)

# ---[ Google-gflags
include("cmake/External/gflags.cmake")
include_directories(SYSTEM ${GFLAGS_INCLUDE_DIRS})
list(APPEND ${PROJECT_NAME_STR}_LINKER_LIBS ${GFLAGS_LIBRARIES})

# ---[ Google-gtest
include("cmake/External/gtest.cmake")
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
list(APPEND ${PROJECT_NAME_STR}_TEST_LINKER_LIBS ${GTEST_LIBRARIES})
list(APPEND ${PROJECT_NAME_STR}_TEST_LINKER_LIBS ${GTEST_MAIN_LIBRARIES})

# ---[ Eigen3
include("cmake/External/eigen3.cmake")
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
# list(APPEND ${PROJECT_NAME_STR}_LINKER_LIBS ${EIGEN3_LIBRARIES})

# ---[ Doxygen
include("cmake/External/doxygen.cmake")

# ---[ Boost
include("cmake/External/boost.cmake")
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
list(APPEND ${PROJECT_NAME_STR}_LINKER_LIBS ${Boost_LIBRARIES})


text:
module Twilio
  module REST
    class Chat < Domain
      class V2 < Version
        class ServiceContext < InstanceContext
          class ChannelContext < InstanceContext
            class WebhookList < ListResource
              ##
              # Initialize the WebhookList
              # @param [Version] version Version that contains the resource
              # @param [String] service_sid The SID of the
              #   {Service}[https://www.twilio.com/docs/chat/rest/service-resource] the Channel
              #   Webhook resource is associated with.
              # @param [String] channel_sid The SID of the
              #   {Channel}[https://www.twilio.com/docs/chat/channels] the Channel Webhook
              #   resource belongs to.
              # @return [WebhookList] WebhookList
              def initialize(version, service_sid: nil, channel_sid: nil)
                super(version)

                # Path Solution
                @solution = {service_sid: service_sid, channel_sid: channel_sid}
                @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Webhooks"
              end

              ##
              # Lists WebhookInstance records from the API as a list.
              # Unlike stream(), this operation is eager and will load `limit` records into
              # memory before returning.
              # @param [Integer] limit Upper limit for the number of records to return. stream()
              #    guarantees to never return more than limit.  Default is no limit
              # @param [Integer] page_size Number of records to fetch per request, when
              #    not set will use the default value of 50 records.  If no page_size is defined
              #    but a limit is defined, stream() will attempt to read the limit with the most
              #    efficient page size, i.e. min(limit, 1000)
              # @return [Array] Array of up to limit results
              def list(limit: nil, page_size: nil)
                self.stream(limit: limit, page_size: page_size).entries
              end

              ##
              # Streams WebhookInstance records from the API as an Enumerable.
              # This operation lazily loads records as efficiently as possible until the limit
              # is reached.
              # @param [Integer] limit Upper limit for the number of records to return. stream()
              #    guarantees to never return more than limit. Default is no limit.
              # @param [Integer] page_size Number of records to fetch per request, when
              #    not set will use the default value of 50 records. If no page_size is defined
              #    but a limit is defined, stream() will attempt to read the limit with the most
              #    efficient page size, i.e. min(limit, 1000)
              # @return [Enumerable] Enumerable that will yield up to limit results
              def stream(limit: nil, page_size: nil)
                limits = @version.read_limits(limit, page_size)

                page = self.page(page_size: limits[:page_size], )

                @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
              end

              ##
              # When passed a block, yields WebhookInstance records from the API.
              # This operation lazily loads records as efficiently as possible until the limit
              # is reached.
              def each
                limits = @version.read_limits

                page = self.page(page_size: limits[:page_size], )

                @version.stream(page,
                                limit: limits[:limit],
                                page_limit: limits[:page_limit]).each {|x| yield x}
              end

              ##
              # Retrieve a single page of WebhookInstance records from the API.
              # Request is executed immediately.
              # @param [String] page_token PageToken provided by the API
              # @param [Integer] page_number Page Number, this value is simply for client state
              # @param [Integer] page_size Number of records to return, defaults to 50
              # @return [Page] Page of WebhookInstance
              def page(page_token: :unset, page_number: :unset, page_size: :unset)
                params = Twilio::Values.of({
                    'PageToken' => page_token,
                    'Page' => page_number,
                    'PageSize' => page_size,
                })

                response = @version.page('GET', @uri, params: params)

                WebhookPage.new(@version, response, @solution)
              end

              ##
              # Retrieve a single page of WebhookInstance records from the API.
              # Request is executed immediately.
              # @param [String] target_url API-generated URL for the requested results page
              # @return [Page] Page of WebhookInstance
              def get_page(target_url)
                response = @version.domain.request(
                    'GET',
                    target_url
                )
                WebhookPage.new(@version, response, @solution)
              end

              ##
              # Create the WebhookInstance
              # @param [webhook.Type] type The type of webhook. Can be: `webhook`, `studio`, or
              #   `trigger`.
              # @param [String] configuration_url The URL of the webhook to call using the
              #   `configuration.method`.
              # @param [webhook.Method] configuration_method The HTTP method used to call
              #   `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
              # @param [Array[String]] configuration_filters The events that cause us to call
              #   the Channel Webhook. Used when `type` is `webhook`. This parameter takes only
              #   one event. To specify more than one event, repeat this parameter for each event.
              #   For the list of possible events, see {Webhook Event
              #   Triggers}[https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger].
              # @param [Array[String]] configuration_triggers A string that will cause us to
              #   call the webhook when it is present in a message body. This parameter takes only
              #   one trigger string. To specify more than one, repeat this parameter for each
              #   trigger string up to a total of 5 trigger strings. Used only when `type` =
              #   `trigger`.
              # @param [String] configuration_flow_sid The SID of the Studio
              #   {Flow}[https://www.twilio.com/docs/studio/rest-api/flow] to call when an event
              #   in `configuration.filters` occurs. Used only when `type` is `studio`.
              # @param [String] configuration_retry_count The number of times to retry the
              #   webhook if the first attempt fails. Can be an integer between 0 and 3,
              #   inclusive, and the default is 0.
              # @return [WebhookInstance] Created WebhookInstance
              def create(type: nil, configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
                data = Twilio::Values.of({
                    'Type' => type,
                    'Configuration.Url' => configuration_url,
                    'Configuration.Method' => configuration_method,
                    'Configuration.Filters' => Twilio.serialize_list(configuration_filters) { |e| e },
                    'Configuration.Triggers' => Twilio.serialize_list(configuration_triggers) { |e| e },
                    'Configuration.FlowSid' => configuration_flow_sid,
                    'Configuration.RetryCount' => configuration_retry_count,
                })

                payload = @version.create('POST', @uri, data: data)

                WebhookInstance.new(
                    @version,
                    payload,
                    service_sid: @solution[:service_sid],
                    channel_sid: @solution[:channel_sid],
                )
              end

              ##
              # Provide a user friendly representation
              def to_s
                '#<Twilio.Chat.V2.WebhookList>'
              end
            end

            class WebhookPage < Page
              ##
              # Initialize the WebhookPage
              # @param [Version] version Version that contains the resource
              # @param [Response] response Response from the API
              # @param [Hash] solution Path solution for the resource
              # @return [WebhookPage] WebhookPage
              def initialize(version, response, solution)
                super(version, response)

                # Path Solution
                @solution = solution
              end

              ##
              # Build an instance of WebhookInstance
              # @param [Hash] payload Payload response from the API
              # @return [WebhookInstance] WebhookInstance
              def get_instance(payload)
                WebhookInstance.new(
                    @version,
                    payload,
                    service_sid: @solution[:service_sid],
                    channel_sid: @solution[:channel_sid],
                )
              end

              ##
              # Provide a user friendly representation
              def to_s
                '<Twilio.Chat.V2.WebhookPage>'
              end
            end

            class WebhookContext < InstanceContext
              ##
              # Initialize the WebhookContext
              # @param [Version] version Version that contains the resource
              # @param [String] service_sid The SID of the
              #   {Service}[https://www.twilio.com/docs/chat/rest/service-resource] with the
              #   Channel to fetch the Webhook resource from.
              # @param [String] channel_sid The SID of the
              #   {Channel}[https://www.twilio.com/docs/chat/channels] the Channel Webhook
              #   resource to fetch belongs to. This value can be the Channel resource's `sid` or
              #   `unique_name`.
              # @param [String] sid The SID of the Channel Webhook resource to fetch.
              # @return [WebhookContext] WebhookContext
              def initialize(version, service_sid, channel_sid, sid)
                super(version)

                # Path Solution
                @solution = {service_sid: service_sid, channel_sid: channel_sid, sid: sid, }
                @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Webhooks/#{@solution[:sid]}"
              end

              ##
              # Fetch the WebhookInstance
              # @return [WebhookInstance] Fetched WebhookInstance
              def fetch
                payload = @version.fetch('GET', @uri)

                WebhookInstance.new(
                    @version,
                    payload,
                    service_sid: @solution[:service_sid],
                    channel_sid: @solution[:channel_sid],
                    sid: @solution[:sid],
                )
              end

              ##
              # Update the WebhookInstance
              # @param [String] configuration_url The URL of the webhook to call using the
              #   `configuration.method`.
              # @param [webhook.Method] configuration_method The HTTP method used to call
              #   `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
              # @param [Array[String]] configuration_filters The events that cause us to call
              #   the Channel Webhook. Used when `type` is `webhook`. This parameter takes only
              #   one event. To specify more than one event, repeat this parameter for each event.
              #   For the list of possible events, see {Webhook Event
              #   Triggers}[https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger].
              # @param [Array[String]] configuration_triggers A string that will cause us to
              #   call the webhook when it is present in a message body. This parameter takes only
              #   one trigger string. To specify more than one, repeat this parameter for each
              #   trigger string up to a total of 5 trigger strings. Used only when `type` =
              #   `trigger`.
              # @param [String] configuration_flow_sid The SID of the Studio
              #   {Flow}[https://www.twilio.com/docs/studio/rest-api/flow] to call when an event
              #   in `configuration.filters` occurs. Used only when `type` = `studio`.
              # @param [String] configuration_retry_count The number of times to retry the
              #   webhook if the first attempt fails. Can be an integer between 0 and 3,
              #   inclusive, and the default is 0.
              # @return [WebhookInstance] Updated WebhookInstance
              def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
                data = Twilio::Values.of({
                    'Configuration.Url' => configuration_url,
                    'Configuration.Method' => configuration_method,
                    'Configuration.Filters' => Twilio.serialize_list(configuration_filters) { |e| e },
                    'Configuration.Triggers' => Twilio.serialize_list(configuration_triggers) { |e| e },
                    'Configuration.FlowSid' => configuration_flow_sid,
                    'Configuration.RetryCount' => configuration_retry_count,
                })

                payload = @version.update('POST', @uri, data: data)

                WebhookInstance.new(
                    @version,
                    payload,
                    service_sid: @solution[:service_sid],
                    channel_sid: @solution[:channel_sid],
                    sid: @solution[:sid],
                )
              end

              ##
              # Delete the WebhookInstance
              # @return [Boolean] true if delete succeeds, false otherwise
              def delete
                 @version.delete('DELETE', @uri)
              end

              ##
              # Provide a user friendly representation
              def to_s
                context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
                "#<Twilio.Chat.V2.WebhookContext #{context}>"
              end

              ##
              # Provide a detailed, user friendly representation
              def inspect
                context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
                "#<Twilio.Chat.V2.WebhookContext #{context}>"
              end
            end

            class WebhookInstance < InstanceResource
              ##
              # Initialize the WebhookInstance
              # @param [Version] version Version that contains the resource
              # @param [Hash] payload payload that contains response from Twilio
              # @param [String] service_sid The SID of the
              #   {Service}[https://www.twilio.com/docs/chat/rest/service-resource] the Channel
              #   Webhook resource is associated with.
              # @param [String] channel_sid The SID of the
              #   {Channel}[https://www.twilio.com/docs/chat/channels] the Channel Webhook
              #   resource belongs to.
              # @param [String] sid The SID of the Channel Webhook resource to fetch.
              # @return [WebhookInstance] WebhookInstance
              def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
                super(version)

                # Marshaled Properties
                @properties = {
                    'sid' => payload['sid'],
                    'account_sid' => payload['account_sid'],
                    'service_sid' => payload['service_sid'],
                    'channel_sid' => payload['channel_sid'],
                    'type' => payload['type'],
                    'url' => payload['url'],
                    'configuration' => payload['configuration'],
                    'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
                    'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
                }

                # Context
                @instance_context = nil
                @params = {
                    'service_sid' => service_sid,
                    'channel_sid' => channel_sid,
                    'sid' => sid || @properties['sid'],
                }
              end

              ##
              # Generate an instance context for the instance, the context is capable of
              # performing various actions.  All instance actions are proxied to the context
              # @return [WebhookContext] WebhookContext for this WebhookInstance
              def context
                unless @instance_context
                  @instance_context = WebhookContext.new(
                      @version,
                      @params['service_sid'],
                      @params['channel_sid'],
                      @params['sid'],
                  )
                end
                @instance_context
              end

              ##
              # @return [String] The unique string that identifies the resource
              def sid
                @properties['sid']
              end

              ##
              # @return [String] The SID of the Account that created the resource
              def account_sid
                @properties['account_sid']
              end

              ##
              # @return [String] The SID of the Service that the Channel Webhook resource is associated with
              def service_sid
                @properties['service_sid']
              end

              ##
              # @return [String] The SID of the Channel the Channel Webhook resource belongs to
              def channel_sid
                @properties['channel_sid']
              end

              ##
              # @return [String] The type of webhook
              def type
                @properties['type']
              end

              ##
              # @return [String] The absolute URL of the Channel Webhook resource
              def url
                @properties['url']
              end

              ##
              # @return [Hash] The JSON string that describes the configuration object for the channel webhook
              def configuration
                @properties['configuration']
              end

              ##
              # @return [Time] The ISO 8601 date and time in GMT when the resource was created
              def date_created
                @properties['date_created']
              end

              ##
              # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
              def date_updated
                @properties['date_updated']
              end

              ##
              # Fetch the WebhookInstance
              # @return [WebhookInstance] Fetched WebhookInstance
              def fetch
                context.fetch
              end

              ##
              # Update the WebhookInstance
              # @param [String] configuration_url The URL of the webhook to call using the
              #   `configuration.method`.
              # @param [webhook.Method] configuration_method The HTTP method used to call
              #   `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
              # @param [Array[String]] configuration_filters The events that cause us to call
              #   the Channel Webhook. Used when `type` is `webhook`. This parameter takes only
              #   one event. To specify more than one event, repeat this parameter for each event.
              #   For the list of possible events, see {Webhook Event
              #   Triggers}[https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger].
              # @param [Array[String]] configuration_triggers A string that will cause us to
              #   call the webhook when it is present in a message body. This parameter takes only
              #   one trigger string. To specify more than one, repeat this parameter for each
              #   trigger string up to a total of 5 trigger strings. Used only when `type` =
              #   `trigger`.
              # @param [String] configuration_flow_sid The SID of the Studio
              #   {Flow}[https://www.twilio.com/docs/studio/rest-api/flow] to call when an event
              #   in `configuration.filters` occurs. Used only when `type` = `studio`.
              # @param [String] configuration_retry_count The number of times to retry the
              #   webhook if the first attempt fails. Can be an integer between 0 and 3,
              #   inclusive, and the default is 0.
              # @return [WebhookInstance] Updated WebhookInstance
              def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
                context.update(
                    configuration_url: configuration_url,
                    configuration_method: configuration_method,
                    configuration_filters: configuration_filters,
                    configuration_triggers: configuration_triggers,
                    configuration_flow_sid: configuration_flow_sid,
                    configuration_retry_count: configuration_retry_count,
                )
              end

              ##
              # Delete the WebhookInstance
              # @return [Boolean] true if delete succeeds, false otherwise
              def delete
                context.delete
              end

              ##
              # Provide a user friendly representation
              def to_s
                values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
                "<Twilio.Chat.V2.WebhookInstance #{values}>"
              end

              ##
              # Provide a detailed, user friendly representation
              def inspect
                values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
                "<Twilio.Chat.V2.WebhookInstance #{values}>"
              end
            end
          end
        end
      end
    end
  end
end


text:
set -e

mkdir -p bin
javac src/EasyCryptoConsole/*.java -classpath "../EasyCryptoLib.jar:." -d bin


text:
module Picker
  VERSION = '0.0.1'
end

module Sass::Script
  module Functions
    def base_color
      Sass::Script.parse($PICKER_BASE_COLOR, 1, 1, "PICKER_BASE_COLOR")
    end
  end
end


text:
#include <aws/ivs/model/DeletePlaybackKeyPairRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

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

DeletePlaybackKeyPairRequest::DeletePlaybackKeyPairRequest() :
    m_arnHasBeenSet(false)
{
}

Aws::String DeletePlaybackKeyPairRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_arnHasBeenSet)
  {
   payload.WithString("arn", m_arn);

  }

  return payload.View().WriteReadable();
}


text:
require 'minitest/autorun'
require 'cerulean'

class Controller
  include Cerulean

  def self.before_action; end

  get :index do
  end
end

class CeruleanTest < Minitest::Test
  def setup
    @controller = Controller.new
  end

  def test_valid_integer_param
    assert_equal 1, @controller.validate_param_type('1', Integer)
  end

  def test_invalid_integer_param
    assert_equal nil, @controller.validate_param_type('xxx', Integer)
  end

  def test_valid_float_param
    assert_equal 3.14, @controller.validate_param_type('3.14', Float)
  end

  def test_invalid_float_param
    assert_equal nil, @controller.validate_param_type('xxx', Float)
  end

  def test_valid_boolean_param
    assert_equal true, @controller.validate_param_type('true', Boolean)
  end

  def test_invalid_boolean_param
    assert_equal nil, @controller.validate_param_type('xxx', Float)
  end

  def test_valid_date_param
    assert_equal true, @controller.validate_param_type('2017-01-01', Date)
  end

  def test_invalid_date_param
    assert_equal nil, @controller.validate_param_type('xxx', Date)
  end

  def test_valid_datetime_param
    assert_equal true, @controller.validate_param_type('2017-01-01 12:00:00', DateTime)
  end

  def test_invalid_datetime_param
    assert_equal nil, @controller.validate_param_type('xxx', DateTime)
  end

  def test_parse_valid_array_of_integers
    assert_equal [1, 2, 3], @controller.validate_param_type(['1', '2', '3'], Array[Integer])
  end

  def test_parse_invalid_array_of_integers
    assert_equal nil, @controller.validate_param_type(['1', 'xxx', '3'], Array[Integer])
  end

  def test_parse_valid_array_of_floats
    assert_equal [1.0, 2.0, 3.0], @controller.validate_param_type(['1.0', '2.0', '3.0'], Array[Float])
  end

  def test_parse_invalid_array_of_integers
    assert_equal nil, @controller.validate_param_type(['1.0', 'xxx', '3.0'], Array[Float])
  end

  def test_parse_valid_array_of_booleans
    assert_equal [true, false, true], @controller.validate_param_type(['true', 'false', 'true'], Array[Boolean])
  end

  def test_parse_invalid_array_of_booleans
    assert_equal nil, @controller.validate_param_type(['true', 'xxx', 'true'], Array[Boolean])
  end
end


text:
package org.kuali.coeus.propdev.impl.attachment;

import org.kuali.coeus.propdev.impl.core.ProposalDevelopmentControllerBase;
import org.kuali.coeus.propdev.impl.core.ProposalDevelopmentDocumentForm;
import org.kuali.coeus.propdev.impl.person.ProposalPerson;
import org.kuali.rice.krad.uif.UifParameters;
import org.kuali.rice.krad.web.form.DocumentFormBase;
import org.kuali.rice.krad.web.form.UifFormBase;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

@Controller
public class ProposalDevelopmentAttachmentController extends ProposalDevelopmentControllerBase {

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=editAttachment")
    public ModelAndView editAttachment(@ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form, BindingResult result,
                                  HttpServletRequest request, HttpServletResponse response) throws Exception {
        final String selectedCollectionPath = form.getActionParamaterValue(UifParameters.SELECTED_COLLECTION_PATH);
        String selectedLine = form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX);

        if(form.getEditableAttachments().containsKey(selectedCollectionPath)) {
            form.getEditableAttachments().get(selectedCollectionPath).add(selectedLine);
        } else {
            List<String> newKeyList = new ArrayList<String>();
            newKeyList.add(selectedLine);
            form.getEditableAttachments().put(selectedCollectionPath,newKeyList);
        }

        return getTransactionalDocumentControllerService().refresh(form, result, request, response);
    }

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=cancelAttachment")
    public ModelAndView cancelAttachment(@ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form, BindingResult result,
                                  HttpServletRequest request, HttpServletResponse response) throws Exception {
        final String selectedCollectionPath = form.getActionParamaterValue(UifParameters.SELECTED_COLLECTION_PATH);
        String selectedLine = form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX);

        if(form.getEditableAttachments().containsKey(selectedCollectionPath)){
            form.getEditableAttachments().get(selectedCollectionPath).remove(selectedLine);
        }

        return getTransactionalDocumentControllerService().refresh(form, result, request, response);
    }

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=saveAttachment")
    public ModelAndView saveAttachment(@ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form, BindingResult result,
                                         HttpServletRequest request, HttpServletResponse response) throws Exception {
        final String selectedCollectionPath = form.getActionParamaterValue(UifParameters.SELECTED_COLLECTION_PATH);
        String selectedLine = form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX);

        if(form.getEditableAttachments().containsKey(selectedCollectionPath)){
            form.getEditableAttachments().get(selectedCollectionPath).remove(selectedLine);
        }

        return getTransactionalDocumentControllerService().saveLine(form, result, request, response);
    }

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=addAttachment")
    public ModelAndView addAttachment(@ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form, BindingResult result,
                                       HttpServletRequest request, HttpServletResponse response) throws Exception {
        final String selectedCollectionPath = form.getActionParamaterValue(UifParameters.SELECTED_COLLECTION_PATH);

        if(form.getEditableAttachments().containsKey(selectedCollectionPath)) {
            List<String> indexes = new ArrayList<String>();
            for (String index : form.getEditableAttachments().get(selectedCollectionPath)) {
                Integer newIndex= Integer.parseInt(index) + 1;
                indexes.add(newIndex.toString());
            }
            form.getEditableAttachments().get(selectedCollectionPath).clear();
            form.getEditableAttachments().get(selectedCollectionPath).addAll(indexes);
        }
        return getTransactionalDocumentControllerService().addLine(form, result, request, response);
    }
    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=addFileUploadLine")
    public ModelAndView addFileUploadLine(@ModelAttribute("KualiForm") ProposalDevelopmentDocumentForm form, BindingResult result,
                                          MultipartHttpServletRequest request, HttpServletResponse response) throws Exception {
        final String selectedCollectionPath = request.getParameter("bindingPath");

        if(form.getEditableAttachments().containsKey(selectedCollectionPath)) {
            List<String> indexes = new ArrayList<String>();
            indexes.add("0");
            for (String index : form.getEditableAttachments().get(selectedCollectionPath)) {
                Integer newIndex= Integer.parseInt(index) + 1;
                indexes.add(newIndex.toString());
            }
            form.getEditableAttachments().get(selectedCollectionPath).clear();
            form.getEditableAttachments().get(selectedCollectionPath).addAll(indexes);
        } else {
            List<String> newKeyList = new ArrayList<String>();
            newKeyList.add("0");
            form.getEditableAttachments().put(selectedCollectionPath,newKeyList);
        }

        return getTransactionalDocumentControllerService().addFileUploadLine(form,result,request,response);
    }

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=deleteFileUploadLine")
    public ModelAndView deleteFileUploadLine(@ModelAttribute("KualiForm") final UifFormBase uifForm,
                                             BindingResult result, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return getTransactionalDocumentControllerService().deleteFileUploadLine(uifForm,result,request,response);
    }

    @RequestMapping(value = "/proposalDevelopment", params="methodToCall=getFileFromLine")
    public void getFileFromLine(@ModelAttribute("KualiForm") final UifFormBase uifForm, BindingResult result,
                                HttpServletRequest request, HttpServletResponse response) throws Exception {
        getTransactionalDocumentControllerService().getFileFromLine(uifForm,result,request,response);
    }

    @RequestMapping(value = "/proposalDevelopment", params={"methodToCall=navigate", "actionParameters[navigateToPageId]=PropDev-AttachmentsPage"})
    public ModelAndView navigateToAttachment(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) {
        ProposalDevelopmentDocumentForm propDevForm = (ProposalDevelopmentDocumentForm) form;
        List<Narrative> filteredInstituteAttachments = new ArrayList<Narrative>();
        List<Narrative> filteredNarratives = new ArrayList<Narrative>();
        for (Narrative narrative : propDevForm.getDevelopmentProposal().getNarratives()){
            if(narrative.getNarrativeType().getNarrativeTypeGroup().equals("P")) {
                filteredNarratives.add(narrative);
            } else {
                filteredInstituteAttachments.add(narrative);
            }
        }
        propDevForm.getDevelopmentProposal().setInstituteAttachments(filteredInstituteAttachments);
        propDevForm.getDevelopmentProposal().setNarratives(filteredNarratives);
        return getTransactionalDocumentControllerService().navigate(form, result, request, response);
    }
}


text:
package org.jpat.scuba.analysisprovider.dynamic.asm.foundation;

import org.jpat.scuba.core.model.FANChallenge;
import org.jpat.scuba.core.model.stats.BytecodeStats;
import org.jpat.scuba.foundation.report.Counter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public final class InterfaceMethodInvokInstrumentor extends AbstractTargetedInstrumentation
{
    private static final String VOID_METHOD_KEY = "()V";
    private static final String TYPE_TO_INST_KEY = "phd/fanchallenge/analyser/FANChallengeAnalyser";
    private static final String INC_COUNT_KEY = "incrementCount";
    private static final String MAIN = "main";
    private static final String INIT_KEY = "init";

    public InterfaceMethodInvokInstrumentor(final FANChallenge benchmark)
    {
        super(benchmark);
    }

    @Override
    protected MethodVisitor analyseInternal(final MethodVisitor mv, final int opcode)
    {
        if (opcode == Opcodes.INVOKEINTERFACE)
        {
            mv.visitMethodInsn(Opcodes.INVOKESTATIC, TYPE_TO_INST_KEY, INC_COUNT_KEY, VOID_METHOD_KEY, false);
            Counter.INSTANCE.incrementTargetedInvokationCounter();
        }
        ((BytecodeStats) this.scubaAnalysisOutcome).incrementAnalysedBytecodeInst();
        Counter.INSTANCE.incrementByteCodeInstructionsCounter();
        ((BytecodeStats) this.scubaAnalysisOutcome).incrementTargetedArtifact(opcode);
        return mv;
    }

    @Override
    protected void visitMainMethod(final MethodVisitor mv, final String methodName)
    {
        if (MAIN.equals(methodName))
        {
            mv.visitMethodInsn(Opcodes.INVOKESTATIC, TYPE_TO_INST_KEY, INIT_KEY, VOID_METHOD_KEY, false);
        }
    }
}


text:
set -e

FLAVOR=""
VERSION=`cat ../XCConfig/Shared.xcconfig | grep "YAJL_VERSION =" | cut -d '=' -f 2 | tr -d " "`

NAME=libYAJLiOS
OUTPUT_DIR=${BUILD_DIR}/Combined${BUILD_STYLE}${FLAVOR}
OUTPUT_FILE=${NAME}${FLAVOR}.a
ZIP_DIR=${BUILD_DIR}/Zip

if [ ! -d ${OUTPUT_DIR} ]; then
	mkdir ${OUTPUT_DIR}
fi

# Combine lib files
lipo -create "${BUILD_DIR}/${BUILD_STYLE}-iphoneos/${NAME}Device${FLAVOR}.a" "${BUILD_DIR}/${BUILD_STYLE}-iphonesimulator/${NAME}Simulator${FLAVOR}.a" -output ${OUTPUT_DIR}/${OUTPUT_FILE}

# Copy to direcory for zipping
if [ ! -d ${ZIP_DIR} ]; then
  mkdir ${ZIP_DIR}
fi
cp ${OUTPUT_DIR}/${OUTPUT_FILE} ${ZIP_DIR}
cp ${BUILD_DIR}/${BUILD_STYLE}-iphonesimulator/*.h ${ZIP_DIR}

cd ${ZIP_DIR}
zip -m ${NAME}${FLAVOR}-${VERSION}.zip *
mv ${NAME}${FLAVOR}-${VERSION}.zip ..
rm -rf ${ZIP_DIR}


text:
package org.carobotics.hardware;

/**
 * @author CaRobotics
 */
public class Servo {
    edu.wpi.first.wpilibj.Servo servo;

    public Servo(int channel/*slot in digital sidecar*/) {
        servo = new edu.wpi.first.wpilibj.Servo(channel);
//        servo.setBounds(255, 130, 127, 125, 0); // TODO: Not working yet
//        servo.setBounds(245, 0, 0, 0, 11);
    }

    public Servo(int slot/*slot of digital sidecar module*/, int channel/*slot in digital sidecar*/) {
         servo = new edu.wpi.first.wpilibj.Servo(slot, channel);
//        servo.setBounds(255, 130, 127, 125, 0); // TODO: Not working yet
//        servo.setBounds(245, 0, 0, 0, 11);
    }

    /**
     *
     * @param value Range from 0 to 1
     */
    public void set(double value) {
        servo.setRaw((int) ((value*254)+1));
    }

    public void setRaw(int rawValue) {
        servo.setRaw(rawValue);
    }

    public double getSpeed() {
        return servo.getSpeed();
    }
}


text:
import React from 'react'
import ReactDOM from 'react-dom'

let UiMenu = React.createClass({
    componentDidMount: function(){
        $(ReactDOM.findDOMNode(this)).menu();
    },
    render: function () {
        return this.props.children
    }
});

export default UiMenu


text:
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):

    def forwards(self, orm):
        "Write your forwards methods here."
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        if not db.dry_run:
            orm['gnotty.IRCMessage'].objects.filter(message="joins").update(join_or_leave=True)
            orm['gnotty.IRCMessage'].objects.filter(message="leaves").update(join_or_leave=True)

    def backwards(self, orm):
        "Write your backwards methods here."

    models = {
        'gnotty.ircmessage': {
            'Meta': {'ordering': "('message_time',)", 'object_name': 'IRCMessage'},
            'channel': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'join_or_leave': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'message': ('django.db.models.fields.TextField', [], {}),
            'message_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'nickname': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'server': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        }
    }

    complete_apps = ['gnotty']
    symmetrical = True


text:
App.SelectorView = Ember.View.extend({
	didInsertElement: function() {

		console.log('the selectorviews controller is now ' + this.controller + '**********')
	},

	controller: App.SelectorController,

})


text:
#include "redis.h"

/*-----------------------------------------------------------------------------
 * Pubsub low level API
 *----------------------------------------------------------------------------*/

void freePubsubPattern(void *p) {
    pubsubPattern *pat = p;

    decrRefCount(pat->pattern);
    zfree(pat);
}

int listMatchPubsubPattern(void *a, void *b) {
    pubsubPattern *pa = a, *pb = b;

    return (pa->client == pb->client) &&
           (equalStringObjects(pa->pattern,pb->pattern));
}

/* Subscribe a client to a channel. Returns 1 if the operation succeeded, or
 * 0 if the client was already subscribed to that channel. */
int pubsubSubscribeChannel(redisClient *c, robj *channel) {
    dictEntry *de;
    list *clients = NULL;
    int retval = 0;

    /* Add the channel to the client -> channels hash table */
    if (dictAdd(c->pubsub_channels,channel,NULL) == DICT_OK) {
        retval = 1;
        incrRefCount(channel);
        /* Add the client to the channel -> list of clients hash table */
        de = dictFind(server.pubsub_channels,channel);
        if (de == NULL) {
            clients = listCreate();
            dictAdd(server.pubsub_channels,channel,clients);
            incrRefCount(channel);
        } else {
            clients = dictGetVal(de);
        }
        listAddNodeTail(clients,c);
    }
    /* Notify the client */
    addReply(c,shared.mbulkhdr[3]);
    addReply(c,shared.subscribebulk);
    addReplyBulk(c,channel);
    addReplyLongLong(c,dictSize(c->pubsub_channels)+listLength(c->pubsub_patterns));
    return retval;
}

/* Unsubscribe a client from a channel. Returns 1 if the operation succeeded, or
 * 0 if the client was not subscribed to the specified channel. */
int pubsubUnsubscribeChannel(redisClient *c, robj *channel, int notify) {
    dictEntry *de;
    list *clients;
    listNode *ln;
    int retval = 0;

    /* Remove the channel from the client -> channels hash table */
    incrRefCount(channel); /* channel may be just a pointer to the same object
                            we have in the hash tables. Protect it... */
    if (dictDelete(c->pubsub_channels,channel) == DICT_OK) {
        retval = 1;
        /* Remove the client from the channel -> clients list hash table */
        de = dictFind(server.pubsub_channels,channel);
        redisAssertWithInfo(c,NULL,de != NULL);
        clients = dictGetVal(de);
        ln = listSearchKey(clients,c);
        redisAssertWithInfo(c,NULL,ln != NULL);
        listDelNode(clients,ln);
        if (listLength(clients) == 0) {
            /* Free the list and associated hash entry at all if this was
             * the latest client, so that it will be possible to abuse
             * Redis PUBSUB creating millions of channels. */
            dictDelete(server.pubsub_channels,channel);
        }
    }
    /* Notify the client */
    if (notify) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.unsubscribebulk);
        addReplyBulk(c,channel);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));

    }
    decrRefCount(channel); /* it is finally safe to release it */
    return retval;
}

/* Subscribe a client to a pattern. Returns 1 if the operation succeeded, or 0 if the client was already subscribed to that pattern. */
int pubsubSubscribePattern(redisClient *c, robj *pattern) {
    int retval = 0;

    if (listSearchKey(c->pubsub_patterns,pattern) == NULL) {
        retval = 1;
        pubsubPattern *pat;
        listAddNodeTail(c->pubsub_patterns,pattern);
        incrRefCount(pattern);
        pat = zmalloc(sizeof(*pat));
        pat->pattern = getDecodedObject(pattern);
        pat->client = c;
        listAddNodeTail(server.pubsub_patterns,pat);
    }
    /* Notify the client */
    addReply(c,shared.mbulkhdr[3]);
    addReply(c,shared.psubscribebulk);
    addReplyBulk(c,pattern);
    addReplyLongLong(c,dictSize(c->pubsub_channels)+listLength(c->pubsub_patterns));
    return retval;
}

/* Unsubscribe a client from a channel. Returns 1 if the operation succeeded, or
 * 0 if the client was not subscribed to the specified channel. */
int pubsubUnsubscribePattern(redisClient *c, robj *pattern, int notify) {
    listNode *ln;
    pubsubPattern pat;
    int retval = 0;

    incrRefCount(pattern); /* Protect the object. May be the same we remove */
    if ((ln = listSearchKey(c->pubsub_patterns,pattern)) != NULL) {
        retval = 1;
        listDelNode(c->pubsub_patterns,ln);
        pat.client = c;
        pat.pattern = pattern;
        ln = listSearchKey(server.pubsub_patterns,&pat);
        listDelNode(server.pubsub_patterns,ln);
    }
    /* Notify the client */
    if (notify) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.punsubscribebulk);
        addReplyBulk(c,pattern);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }
    decrRefCount(pattern);
    return retval;
}

/* Unsubscribe from all the channels. Return the number of channels the
 * client was subscribed from. */
int pubsubUnsubscribeAllChannels(redisClient *c, int notify) {
    dictIterator *di = dictGetSafeIterator(c->pubsub_channels);
    dictEntry *de;
    int count = 0;

    while((de = dictNext(di)) != NULL) {
        robj *channel = dictGetKey(de);

        count += pubsubUnsubscribeChannel(c,channel,notify);
    }
    /* We were subscribed to nothing? Still reply to the client. */
    if (notify && count == 0) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.unsubscribebulk);
        addReply(c,shared.nullbulk);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }
    dictReleaseIterator(di);
    return count;
}

/* Unsubscribe from all the patterns. Return the number of patterns the
 * client was subscribed from. */
int pubsubUnsubscribeAllPatterns(redisClient *c, int notify) {
    listNode *ln;
    listIter li;
    int count = 0;

    listRewind(c->pubsub_patterns,&li);
    while ((ln = listNext(&li)) != NULL) {
        robj *pattern = ln->value;

        count += pubsubUnsubscribePattern(c,pattern,notify);
    }
    if (notify && count == 0) {
        /* We were subscribed to nothing? Still reply to the client. */
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.punsubscribebulk);
        addReply(c,shared.nullbulk);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }
    return count;
}

/* Publish a message */
int pubsubPublishMessage(robj *channel, robj *message) {
    int receivers = 0;
    dictEntry *de;
    listNode *ln;
    listIter li;

    /* Send to clients listening for that channel */
    de = dictFind(server.pubsub_channels,channel);
    if (de) {
        list *list = dictGetVal(de);
        listNode *ln;
        listIter li;

        listRewind(list,&li);
        while ((ln = listNext(&li)) != NULL) {
            redisClient *c = ln->value;

            addReply(c,shared.mbulkhdr[3]);
            addReply(c,shared.messagebulk);
            addReplyBulk(c,channel);
            addReplyBulk(c,message);
            receivers++;
        }
    }
    /* Send to clients listening to matching channels */
    if (listLength(server.pubsub_patterns)) {
        listRewind(server.pubsub_patterns,&li);
        channel = getDecodedObject(channel);
        while ((ln = listNext(&li)) != NULL) {
            pubsubPattern *pat = ln->value;

            if (stringmatchlen((char*)pat->pattern->ptr,
                                sdslen(pat->pattern->ptr),
                                (char*)channel->ptr,
                                sdslen(channel->ptr),0)) {
                addReply(pat->client,shared.mbulkhdr[4]);
                addReply(pat->client,shared.pmessagebulk);
                addReplyBulk(pat->client,pat->pattern);
                addReplyBulk(pat->client,channel);
                addReplyBulk(pat->client,message);
                receivers++;
            }
        }
        decrRefCount(channel);
    }
    return receivers;
}

/*-----------------------------------------------------------------------------
 * Pubsub commands implementation
 *----------------------------------------------------------------------------*/

void subscribeCommand(redisClient *c) {
    int j;

    for (j = 1; j < c->argc; j++)
        pubsubSubscribeChannel(c,c->argv[j]);
}

void unsubscribeCommand(redisClient *c) {
    if (c->argc == 1) {
        pubsubUnsubscribeAllChannels(c,1);
    } else {
        int j;

        for (j = 1; j < c->argc; j++)
            pubsubUnsubscribeChannel(c,c->argv[j],1);
    }
}

void psubscribeCommand(redisClient *c) {
    int j;

    for (j = 1; j < c->argc; j++)
        pubsubSubscribePattern(c,c->argv[j]);
}

void punsubscribeCommand(redisClient *c) {
    if (c->argc == 1) {
        pubsubUnsubscribeAllPatterns(c,1);
    } else {
        int j;

        for (j = 1; j < c->argc; j++)
            pubsubUnsubscribePattern(c,c->argv[j],1);
    }
}

void publishCommand(redisClient *c) {
    int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]);
    if (server.cluster_enabled)
        clusterPropagatePublish(c->argv[1],c->argv[2]);
    else
        forceCommandPropagation(c,REDIS_PROPAGATE_REPL);
    addReplyLongLong(c,receivers);
}

/* PUBSUB command for Pub/Sub introspection. */
void pubsubCommand(redisClient *c) {
    if (!strcasecmp(c->argv[1]->ptr,"channels") &&
        (c->argc == 2 || c->argc ==3))
    {
        /* PUBSUB CHANNELS [<pattern>] */
        sds pat = (c->argc == 2) ? NULL : c->argv[2]->ptr;
        dictIterator *di = dictGetIterator(server.pubsub_channels);
        dictEntry *de;
        long mblen = 0;
        void *replylen;

        replylen = addDeferredMultiBulkLength(c);
        while((de = dictNext(di)) != NULL) {
            robj *cobj = dictGetKey(de);
            sds channel = cobj->ptr;

            if (!pat || stringmatchlen(pat, sdslen(pat),
                                       channel, sdslen(channel),0))
            {
                addReplyBulk(c,cobj);
                mblen++;
            }
        }
        dictReleaseIterator(di);
        setDeferredMultiBulkLength(c,replylen,mblen);
    } else if (!strcasecmp(c->argv[1]->ptr,"numsub") && c->argc >= 2) {
        /* PUBSUB NUMSUB [Channel_1 ... Channel_N] */
        int j;

        addReplyMultiBulkLen(c,(c->argc-2)*2);
        for (j = 2; j < c->argc; j++) {
            list *l = dictFetchValue(server.pubsub_channels,c->argv[j]);

            addReplyBulk(c,c->argv[j]);
            addReplyBulkLongLong(c,l ? listLength(l) : 0);
        }
    } else if (!strcasecmp(c->argv[1]->ptr,"numpat") && c->argc == 2) {
        /* PUBSUB NUMPAT */
        addReplyLongLong(c,listLength(server.pubsub_patterns));
    } else {
        addReplyErrorFormat(c,
            "Unknown PUBSUB subcommand or wrong number of arguments for '%s'",
            (char*)c->argv[1]->ptr);
    }
}


text:
class Agent;

class SeekBehaviour : public IBehaviour
{
public:
	void Update(float deltaTime, Agent& a_agent);
};


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.curso.brokerwsmvn;

import com.curso.serviciodosmvn.ServicioDosMvn_Service;
import com.curso.serviciounomvn.ServicioUnoMvn_Service;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceRef;

/**
 *
 * @author usuario
 */
@WebService(serviceName = "BrokerWebServiceMvn")
public class BrokerWebServiceMvn {

    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/ServicioDosMvn/ServicioDosMvn.wsdl")
    private ServicioDosMvn_Service service_1;

    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/ServicioUnoMvn/ServicioUnoMvn.wsdl")
    private ServicioUnoMvn_Service service;

    @WebMethod(operationName = "broker")
    public String broker(@WebParam(name = "servicio") String servicio, @WebParam(name = "contenido") String contenido) {
        switch (servicio) {
            case "uno":
                return mensajeConServicioWebUno(contenido);
            case "dos":
                return mensajeConServicioWebDos(contenido);
            default:
                throw new WebServiceException("Servicio web desconocido");
        }
    }
    private String mensajeConServicioWebUno(String texto) {
        try { // Call Web Service Operation
            com.curso.serviciounomvn.ServicioUnoMvn port = service.getServicioUnoMvnPort();
            return port.servicioUnoMensaje(texto);
        } catch (Exception ex) {
            return "No se ha podido acceder al servicio uno " + ex;
        }
    }

    private String mensajeConServicioWebDos(String texto) {
        try { // Call Web Service Operation
            com.curso.serviciodosmvn.ServicioDosMvn port = service_1.getServicioDosMvnPort();
            return port.servicioDosMensaje(texto);
        } catch (Exception ex) {
            return "No se ha podido acceder al servicio dos " + ex;
        }
    }
}


text:
#ifndef SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_IMPL_H_
#define SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_IMPL_H_

/**@file
Private implementation of Constraint::PointOnPlaneContact. **/

#include "SimTKmath.h"
#include "simbody/internal/common.h"
#include "simbody/internal/Constraint.h"

#include "ConstraintImpl.h"

class SimbodyMatterSubsystemRep;

namespace SimTK {

class SimbodyMatterSubsystem;
class SimbodyMatterSubtree;
class MobilizedBody;

//==============================================================================
//                      POINT ON PLANE CONTACT IMPL
//==============================================================================
class Constraint::PointOnPlaneContactImpl : public ConstraintImpl {
public:
PointOnPlaneContactImpl()
:   ConstraintImpl(1,2,0), m_X_SP(), m_p_BF(0),
    m_planeHalfWidth(1), m_pointRadius(Real(0.05))
{ }
PointOnPlaneContactImpl* clone() const override
{   return new PointOnPlaneContactImpl(*this); }

void calcDecorativeGeometryAndAppendVirtual
   (const State& s, Stage stage, Array_<DecorativeGeometry>& geom) const
    override;

void setPlaneDisplayHalfWidth(Real h) {
    // h <= 0 means don't display plane
    invalidateTopologyCache();
    m_planeHalfWidth = h > 0 ? h : 0;
}
Real getPlaneDisplayHalfWidth() const {return m_planeHalfWidth;}

void setPointDisplayRadius(Real r) {
    // r <= 0 means don't display point
    invalidateTopologyCache();
    m_pointRadius= r > 0 ? r : 0;
}
Real getPointDisplayRadius() const {return m_pointRadius;}

// Implementation of virtuals required for the holonomic constraint.
// Here C is the station of S that is instantaneously coincident with F on B.

//    --------------------------------
//    perr = ~p_SF*Pz - h
//    --------------------------------
void calcPositionErrorsVirtual
   (const State&                                    s,      // Stage::Time
    const Array_<Transform,ConstrainedBodyIndex>&   allX_AB,
    const Array_<Real,     ConstrainedQIndex>&      constrainedQ,
    Array_<Real>&                                   perr)   // mp of these
    const override
{
    assert(allX_AB.size()==2 && constrainedQ.size()==0 && perr.size() == 1);

    const Transform& X_AS = getBodyTransform(allX_AB, m_surfaceBody_S);
    const Vec3 p_AF =
        findStationLocation(allX_AB, m_followerBody_B, m_p_BF); // 18 flops
    const Vec3 p_SC = ~X_AS * p_AF; // shift to So, reexpress in S (18 flops)

    // Calculate this scalar using S-frame vectors; any frame would have done.
    const Vec3& Po = m_X_SP.p(); // Plane origin in S
    perr[0] = dot(p_SC-Po, m_X_SP.z()); // 8 flops
}

//    -----------------------------------
//    verr = ~v_SF*Pz = ~(v_AF-v_AC)*Pz_A
//    -----------------------------------
void calcPositionDotErrorsVirtual
   (const State&                                    s,      // Stage::Position
    const Array_<SpatialVec,ConstrainedBodyIndex>&  allV_AB,
    const Array_<Real,      ConstrainedQIndex>&     constrainedQDot,
    Array_<Real>&                                   pverr)  // mp of these
    const override
{
    assert(allV_AB.size()==2 && constrainedQDot.size()==0 && pverr.size() == 1);

    const Transform&  X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const SpatialVec& V_AS = allV_AB[m_surfaceBody_S];

    const Transform&  X_AB = getBodyTransformFromState(s, m_followerBody_B);
    const SpatialVec& V_AB = allV_AB[m_followerBody_B];

    const Vec3 p_BF_A = X_AB.R() * m_p_BF; // re-express in A (15 flops)
    Vec3 p_AF, v_AF;
    findStationInALocationVelocity(X_AB, V_AB, p_BF_A, p_AF, v_AF); // 15 flops

    const Vec3 p_SC_A = p_AF - X_AS.p(); // measure C from So, in A (3 flops)
    Vec3 p_AC, v_AC;
    findStationInALocationVelocity(X_AS, V_AS, p_SC_A, p_AC, v_AC); // 15 flops

    const UnitVec3 Pz_A  = X_AS.R() * m_X_SP.z();                // 15 flops

    // Calculate this scalar using A-frame vectors.
    pverr[0] = dot( v_AF-v_AC, Pz_A );                           // 8 flops
}

//    --------------------------------------------------------------
//    aerr = ~a_SF*Pz = ~((a_AF-a_AC) - 2 w_AS X (v_AF-v_AC)) * Pz_A
//    --------------------------------------------------------------
void calcPositionDotDotErrorsVirtual
   (const State&                                    s,      // Stage::Velocity
    const Array_<SpatialVec,ConstrainedBodyIndex>&  allA_AB,
    const Array_<Real,      ConstrainedQIndex>&     constrainedQDotDot,
    Array_<Real>&                                   paerr)  // mp of these
    const override
{
    assert(allA_AB.size()==2 && constrainedQDotDot.size()==0 && paerr.size()==1);

    const Transform&  X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const SpatialVec& V_AS = getBodyVelocityFromState(s, m_surfaceBody_S);
    const SpatialVec& A_AS = allA_AB[m_surfaceBody_S];

    const Transform&  X_AB = getBodyTransformFromState(s, m_followerBody_B);
    const SpatialVec& V_AB = getBodyVelocityFromState(s, m_followerBody_B);
    const SpatialVec& A_AB = allA_AB[m_followerBody_B];

    const Vec3 p_BF_A = X_AB.R() * m_p_BF; // re-express in A (15 flops)
    Vec3 p_AF, v_AF, a_AF;
    findStationInALocationVelocityAcceleration(X_AB, V_AB, A_AB, p_BF_A,
                                               p_AF, v_AF, a_AF); // 39 flops

    const Vec3 p_SC_A = p_AF - X_AS.p(); // measure C from So, in A  (3 flops)
    Vec3 p_AC, v_AC, a_AC;
    findStationInALocationVelocityAcceleration(X_AS, V_AS, A_AS, p_SC_A,
                                               p_AC, v_AC, a_AC); // 39 flops

    const UnitVec3 Pz_A  = X_AS.R() * m_X_SP.z();                 // 15 flops

    const Vec3& w_AS = V_AS[0];
    const Vec3 v_CF_A = v_AF-v_AC;          // 3 flops
    const Vec3 wXv2 = (2.*w_AS) % v_CF_A;   // 12 flops
    const Vec3 a_CF_A = a_AF-a_AC;          // 3 flops
    const Vec3 aRel_A = a_CF_A - wXv2; // relative accel of F and C  (3 flops)

    // Calculate this scalars using A-frame vectors, but the result is the
    // measure number along Pz.
    paerr[0] = ~Pz_A*aRel_A;                // 5 flops
}

// apply f=lambda*Pz to the follower point F of body B,
//      -f           to point C (coincident point) of body S
void addInPositionConstraintForcesVirtual
   (const State&                                    s,      // Stage::Position
    const Array_<Real>&                             multipliers, // mp of these
    Array_<SpatialVec,ConstrainedBodyIndex>&        bodyForcesInA,
    Array_<Real,      ConstrainedQIndex>&           qForces)
    const override
{
    assert(multipliers.size()==1 && bodyForcesInA.size()==2
           && qForces.size()==0);
    const Real lambda = multipliers[0];

    const Transform& X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const Transform& X_AB = getBodyTransformFromState(s, m_followerBody_B);

    const Vec3 p_BF_A = X_AB.R() * m_p_BF; // re-express in A (15 flops)
    const Vec3 p_AF   = X_AB.p() + p_BF_A; // shift to Ao     ( 3 flops)
    const Vec3 p_SC_A = p_AF - X_AS.p();   // measure C from So, in A (3 flops)

    const UnitVec3 Pz_A  = X_AS.R() * m_X_SP.z();                  // 15 flops

    const Vec3 force_A = lambda * Pz_A;

    addInStationInAForce(p_BF_A, force_A, bodyForcesInA[m_followerBody_B]);
    subInStationInAForce(p_SC_A, force_A, bodyForcesInA[m_surfaceBody_S]);
}

// Implementation of virtuals required for nonholonomic constraints.

//    -----------------------------------------
//    verr = [~Px] * v_SF = [~Px_A] * (v_AF-v_AC)
//           [~Py]          [~Py_A]
//    -----------------------------------------
// TODO: rework this using the more efficient API (see next method).
void calcVelocityErrorsVirtual
   (const State&                                    s,      // Stage::Position
    const Array_<SpatialVec,ConstrainedBodyIndex>&  allV_AB,
    const Array_<Real,      ConstrainedUIndex>&     constrainedU,
    Array_<Real>&                                   verr)   // mv of these
    const override
{
    assert(allV_AB.size()==2 && constrainedU.size()==0 && verr.size()==2);

    const Transform& X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const Vec3 p_AF =
        findStationLocationFromState(s, m_followerBody_B, m_p_BF); // 18 flops
    const Vec3 p_SC = ~X_AS * p_AF; // shift to So, reexpress in S (18 flops)
    const UnitVec3 Px_A  = X_AS.R() * m_X_SP.x();                  // 15 flops
    const UnitVec3 Py_A  = X_AS.R() * m_X_SP.y();                  // 15 flops

    // 54 flops for the two of these
    const Vec3 v_AF = findStationVelocity(s, allV_AB, m_followerBody_B, m_p_BF);
    const Vec3 v_AC = findStationVelocity(s, allV_AB, m_surfaceBody_S, p_SC);
    const Vec3 v_CF_A = v_AF-v_AC; // 3 flops

    // Calculate these scalars using A-frame vectors, but the results are
    // measure numbers in [Px Py].
    verr[0] = ~Px_A*v_CF_A; // 5 flops
    verr[1] = ~Py_A*v_CF_A; // 5 flops
}

//    ------------------------------------------------------------------
//    aerr = [~Px] * a_SF = [~Px_A] * ((a_AF-a_AC) - 2 w_AS X (v_AF-v_AC))
//           [~Py]          [~Py_A]
//    ------------------------------------------------------------------

void calcVelocityDotErrorsVirtual
   (const State&                                    s,      // Stage::Velocity
    const Array_<SpatialVec,ConstrainedBodyIndex>&  allA_AB,
    const Array_<Real,      ConstrainedUIndex>&     constrainedUDot,
    Array_<Real>&                                   vaerr)  // mv of these
    const override
{
    assert(allA_AB.size()==2 && constrainedUDot.size()==0 && vaerr.size()==2);

    const Transform&  X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const SpatialVec& V_AS = getBodyVelocityFromState(s, m_surfaceBody_S);
    const SpatialVec& A_AS = allA_AB[m_surfaceBody_S];

    const Transform&  X_AB = getBodyTransformFromState(s, m_followerBody_B);
    const SpatialVec& V_AB = getBodyVelocityFromState(s, m_followerBody_B);
    const SpatialVec& A_AB = allA_AB[m_followerBody_B];

    const Vec3 p_BF_A = X_AB.R() * m_p_BF; // re-express in A (15 flops)
    Vec3 p_AF, v_AF, a_AF;
    findStationInALocationVelocityAcceleration(X_AB, V_AB, A_AB, p_BF_A,
                                               p_AF, v_AF, a_AF); // 39 flops

    const Vec3 p_SC_A = p_AF - X_AS.p(); // measure C from So, in A (3 flops)
    Vec3 p_AC, v_AC, a_AC;
    findStationInALocationVelocityAcceleration(X_AS, V_AS, A_AS, p_SC_A,
                                               p_AC, v_AC, a_AC); // 39 flops

    const UnitVec3 Px_A  = X_AS.R() * m_X_SP.x();                  // 15 flops
    const UnitVec3 Py_A  = X_AS.R() * m_X_SP.y();                  // 15 flops

    const Vec3& w_AS = V_AS[0];
    const Vec3 v_CF_A = v_AF-v_AC;          // 3 flops
    const Vec3 wXv2 = (2.*w_AS) % v_CF_A;   // 12 flops

    const Vec3 a_CF_A = a_AF-a_AC; // 3 flops
    const Vec3 aRel_A = a_CF_A - wXv2; // relative accel of F and C (3 flops)

    // Calculate these scalars using A-frame vectors, but the results are
    // measure numbers in [Px Py].
    vaerr[0] = ~Px_A*aRel_A; // 5 flops
    vaerr[1] = ~Py_A*aRel_A; // 5 flops
}

// apply f=lambda0*Px + lambda1*Py to the follower point F on B
//      -f           to point C (coincident point) of body S
void addInVelocityConstraintForcesVirtual
   (const State&                                    s,      // Stage::Velocity
    const Array_<Real>&                             multipliers, // mv of these
    Array_<SpatialVec,ConstrainedBodyIndex>&        bodyForcesInA,
    Array_<Real,      ConstrainedUIndex>&           mobilityForces)
    const override
{
    assert(multipliers.size()==2 && mobilityForces.size()==0
           && bodyForcesInA.size()==2);

    const Real lambda0 = multipliers[0], lambda1 = multipliers[1];

    const Transform& X_AS = getBodyTransformFromState(s, m_surfaceBody_S);
    const Transform& X_AB = getBodyTransformFromState(s, m_followerBody_B);

    const Vec3 p_BF_A = X_AB.R() * m_p_BF; // re-express in A (15 flops)
    const Vec3 p_AF   = X_AB.p() + p_BF_A; // shift to Ao     ( 3 flops)
    const Vec3 p_SC_A = p_AF - X_AS.p();   // measure C from So, in A (3 flops)

    const UnitVec3 Px_A  = X_AS.R() * m_X_SP.x();                  // 15 flops
    const UnitVec3 Py_A  = X_AS.R() * m_X_SP.y();                  // 15 flops

    const Vec3 force_A = lambda0*Px_A + lambda1*Py_A; // 9 flops

    addInStationInAForce(p_BF_A, force_A, bodyForcesInA[m_followerBody_B]);
    subInStationInAForce(p_SC_A, force_A, bodyForcesInA[m_surfaceBody_S]);
}

SimTK_DOWNCAST(PointOnPlaneContactImpl, ConstraintImpl);
//------------------------------------------------------------------------------
                                    private:
friend class Constraint::PointOnPlaneContact;

ConstrainedBodyIndex    m_surfaceBody_S;    // S (B1)
ConstrainedBodyIndex    m_followerBody_B;   // B (B2)

Transform               m_X_SP; // default plane frame fixed in S
Vec3                    m_p_BF; // default follower point fixed in B

// These are just for visualization
Real                    m_planeHalfWidth;
Real                    m_pointRadius;
};

} // namespace SimTK

#endif // SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_IMPL_H_


text:
creating a plastic-tableware shop online with user friendly interface and various options for both customers and seller.
![Logo](https://github.com/reutnagar/plastic-tableware/blob/master/docs/images/logo.jpg)

## Tools & Practices
We're trying to use the best tools and practices in order to produce a quality enginneered product.
(replace 'jce-il/project-template' with your 'username/repo' and register to the relevant services)

|Category|Status|
|---|---|
| Version Control System| git & github |
| Recommended IDE | [VSCode](https://code.visualstudio.com) |
| Group Chat | [Group chat](https://gitter.im/plastic-table_ware/Lobby#) |
| Build Status (CI) |  [![Build Status](https://travis-ci.org/jce-il/project-template.svg?branch=master)](https://travis-ci.org/jce-il/plastic-tableware) |
| Dependencies | [![David](https://img.shields.io/david/dev/idleberg/vscode-badges.svg?style=flat-square)](https://david-dm.org/jce-il/project-template?type=dev) |
| License | [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) |
| Test Coverege | [![codecov.io](https://codecov.io/github/jce-il/plastic-tableware/coverage.svg?branch=master)](https://codecov.io/github/reutnagar/plastic-tableware?branch=master) |
| Code Quality | [![Code Climate](https://codeclimate.com/github/reutnagar/plastic-tableware.svg)](https://codeclimate.com/github/reutnagar/plastic-tableware) |
| Code Style | [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/reutnagar/plastic-tableware) |
| Current Release | [![Current Version](https://img.shields.io/github/release/reutnagar/plastic-tableware.svg?style=flat)](https://github.com/reutnagar/plastic-tableware/releases) |
| Github Issues | [![GitHub issues](https://img.shields.io/github/issues/reutnagar/plastic-tableware.svg?style=flat)](https://github.com/reutnagar/plastic-tableware/issues) |
| Project Management Board| [here](https://github.com/reutnagar/plastic-tableware/projects/1) |
| Deployment | [![Heroku](http://heroku-badge.herokuapp.com/?app=plastic-tableware&style=flat&svg=1&root=index.html)] |
| Project Course Status | Inception |

## Please visit our [live application](https://plastic-tableware.herokuapp.com/)

## Disclaimer
This project is developed as part of the requirements for a [software engineering course](https://github.com/jce-il/se-class/wiki) at the software engineering department - [Azrieli College of Engineering](http://www.jce.ac.il/), Jerusalem, Israel.

Please visit our wiki for furthur project info:

### [User Manual](https://github.com/reutnagar/plastic-tableware/wiki/user-manual)
###[Developer Manual](https://github.com/reutnagar/plastic-tableware/wiki/Developer-Manual)
### [Team Page](../../wiki/team)

### Project Documents
- [Project Idea](docs/idea.pdf) ([Presentation](docs/plastic-tableware.pptx))
- [Project Inception](../../wiki/inception)
- [Software Requirements Specification](../../wiki/srs)
- [Software Design Specification](../../wiki/sds)

### Iteration Pages
- [Iteration 0 - ZFR](../../wiki/iter0-zfr)
- [Iteration 1 - MVP](https://github.com/reutnagar/plastic-tableware/wiki/Iter-1)
- [Iteration 2 - Basic Features](https://github.com/reutnagar/plastic-tableware/wiki/Iter-2)
- [Iteration 3 - Running App](https://github.com/reutnagar/plastic-tableware/wiki/Iter-3)
- [Iteration 4 - Final Product](https://github.com/reutnagar/plastic-tableware/wiki/Iter-4)


text:
package expo.modules.core.interfaces;

import android.app.Activity;
import com.facebook.react.ReactRootView;

import androidx.annotation.Nullable;

/**
 * A handler API for modules to override default ReactActivity behaviors.
 * Used by {@link ReactActivityDelegateWrapper}
 */
public interface ReactActivityHandler {
  /**
   * Given modules a chance to override the default {@link ReactRootView}
   * @return the override ReactRootView instance or null if not to override
   */
  @Nullable
  default ReactRootView createReactRootView(Activity activity) {
    return null;
  }
}