text:
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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.

#ifndef _ESP32_HAL_LEDC_H_
#define _ESP32_HAL_LEDC_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>

typedef enum {
    NOTE_C, NOTE_Cs, NOTE_D, NOTE_Eb, NOTE_E, NOTE_F, NOTE_Fs, NOTE_G, NOTE_Gs, NOTE_A, NOTE_Bb, NOTE_B, NOTE_MAX
} note_t;

//channel 0-15 resolution 1-16bits freq limits depend on resolution
double      ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);
void        ledcWrite(uint8_t channel, uint32_t duty);
double      ledcWriteTone(uint8_t channel, double freq);
double      ledcWriteNote(uint8_t channel, note_t note, uint8_t octave);
uint32_t    ledcRead(uint8_t channel);
double      ledcReadFreq(uint8_t channel);
void        ledcAttachPin(uint8_t pin, uint8_t channel);
void        ledcDetachPin(uint8_t pin);

#ifdef __cplusplus
}
#endif

#endif /* _ESP32_HAL_LEDC_H_ */

redpajama_set_name: RedPajamaGithub


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGdprConsentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gdpr_consents', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->required();
            $table->string('name')->required();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('gdpr_consents');
    }
}


text:
package com.googlecode.gwtstreamer.test.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import com.googlecode.gwtstreamer.test.client.shared.Benchmark;

public class ClientBenchmark  extends GWTTestCase {
	@Override
	public String getModuleName() {
		return "com.googlecode.gwtstreamer.test.GWTStreamerJUnit";
	}

	@Override
	protected void gwtSetUp() throws Exception {
		// warm up VM
		Benchmark bench = new Benchmark( 5 );
		bench.serializeBenchmark();
		bench.deserializeBenchmark();
	}

	private void log( String s ) {
		GWT.log( s );
	}

	/**
	 * Simple serialization serialization
	 */
	public void testTask()
	{
		log( "Preparing test..." );
		Benchmark bench = new Benchmark( 10 );
		log( "    Tree depth: "+bench.getTreeDepth() );
		log( "    Node count: "+bench.getTreeCreator().getNodeCount() );
		log( "Executing serialization..." );
		long t = bench.serializeBenchmark();
		log( "Serialization time: "+t );
		log( "    Buffer length: "+bench.getBuffer().length() );
		log( "Executing deserialization..." );
		t = bench.deserializeBenchmark();
		log( "Deserialization time: "+t );
	}
}


text:
class CCreature;
class CAction;
class CInterfaceBase;
class CNavigationFinder;

struct _ActionCallback_KeyFrame;
struct _ActionCallback_Complete;

class CNode;

class CRoleBase
{
public:
	CRoleBase(void);
	virtual ~CRoleBase(void);

	virtual int	Init(int nRoleID, const char* strCharFile);
	virtual void	Update(float ifps);

	int		GetRoleID() { return m_nRoleID; }
	void		SetRoleID(int nID) { m_nRoleID = nID; }

	CAction*	PlayAction(const char* szName, int nLoop = 0, float fCorrectingTime = 1.0f);
	CAction*	OrceAction(const char* szName, int nLoop = 0, float fCorrectingTime = 1.0f);

	void		SetPosition(const vec3& vPosition, int nOrce = 0);
	void		SetDirection(const vec3& vDirection, int nOrce = 0);
	void		SetDirectionTo(const vec3& vDirection, int nOrce = 0);

	virtual int	MoveTo(const vec3& vPosition);
	virtual int	MoveToPath(const vec3& vPosition);
	virtual void	StopMove();
	virtual void	StopMove(const vec3& vPosition);

	int		IsMoveing() { return m_nMoveing; }

	vec3		GetDirection();
	vec3		GetPosition();

	float	GetRoleRadius();
	float	GetRoleHeight();
protected:
	void		UpdateMove(float ifps);
	vec3		TestRoleZ(vec3& vPosition);
	CNode*	GetAssemblyNode(const CUtilStr& strAssembly);
	CNode*	GetAssemblyNode(int nAssembly);

	CCreature*	m_pCreature;
	int			m_nRoleID;
	int			m_nOrceDirection;

	CAngleYaw	m_AngleYaw;
	CNavigationFinder* m_pPathFind;
	int				 m_nMoveing;
	int				 m_nMoveToType;
	float			 m_fMoveSpeed;
	int				 m_nNowPathPoint;
	vec3				 m_vNowPathPosition;
	vec3				 m_vStartPathPosition;
	vec3				 m_vDestPathPosition;

	int			     m_nUpdateMove;
protected:
	CInterfaceBase*	m_pActionComplete;
	int				OnActionMsg(void* pVoid);
	virtual void		OnKeyFrame(_ActionCallback_KeyFrame* pKeyInfo);
	virtual void		OnActionComplete(_ActionCallback_Complete* pActInfo);
};


text:
export function f() { }

export = f;


text:
<?php

class Posts_CategoryController extends BaseController {

	/**
	 * Display a listing of categories
	 *
	 * @return Response
	 */
	public function index()
	{
		$categories = Posts_category::all();

		return View::make('categories.index', compact('categories'));
	}

	/**
	 * Show the form for creating a new category
	 *
	 * @return Response
	 */
	public function create()
	{
		return View::make('categories.create');
	}

	/**
	 * Store a newly created category in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//$validator = Validator::make($data = Input::all(), Posts_category::$rules);
//
//		if ($validator->fails())
//		{
//			return Redirect::back()->withErrors($validator)->withInput();
//		}

//		Posts_category::create($data);

		$category = new Posts_category;
		$category->title = Input::get('title');
		$category->description = Input::get('description');
		$category->save();

		return Redirect::action('Posts_CategoryController@index');
	}

	/**
	 * Display the specified category.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		$category = Posts_category::findOrFail($id);

		return View::make('categories.show', compact('category'));
	}

	/**
	 * Show the form for editing the specified category.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		$category = Posts_category::find($id);

		return View::make('categories.edit', compact('category'));
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		$category = Posts_category::findOrFail($id);

/**		$validator = Validator::make($data = Input::all(), Posts_category::$rules);

		if ($validator->fails())
		{
			return Redirect::back()->withErrors($validator)->withInput();
		}
**/
	    $category->title = Input::get('title');
		$category->description = Input::get('description');
		$category->save();
		return Redirect::action('Posts_CategoryController@index');

	}

	/**
	 * Facilitate form submission by checking button submitted.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function VerifySubmitFormAction($id)
	{
		if(Input::get('updateButton'))
		 {
					//update($id);
		 }
		  elseif(Input::get('deleteButton'))
		  {
            	//destroy($id); //if register then use this method
		  		//handle delete or soft delete.
		  }
		return Redirect::action('Posts_CategoryController@index');

	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		Posts_category::destroy($id);

		return Redirect::action('Posts_CategoryController@index');
	}

}


text:
/**
 * Created by chief on 16/7/16.
 */

define('input',[],function(){
    var data = [
        {
            "showLabel": ko.observable(null),
            "feedback": ko.observable(null),
            "sizeClass": ko.observable("u-form-group"),
            "labelText": ko.observable(""),
            "index": ko.observable("0"),
            "sizeClass": ko.observable("u-form-group"),
            "value": ko.observable(""),
            "align": ko.observable("left"),
            "mustEnter": ko.observable(null)
        },{
            "showLabel": ko.observable(null),
            "feedback": ko.observable(true),
            "sizeClass": ko.observable("u-form-group"),
            "labelText": ko.observable(""),
            "index": ko.observable("1"),
            "sizeClass": ko.observable("u-form-group"),
            "value": ko.observable(""),
            "align": ko.observable("left"),
            "mustEnter": ko.observable(null)
        },{
            "showLabel": ko.observable(true),
            "feedback": ko.observable(null),
            "sizeClass": ko.observable("u-form-group"),
            "labelText": ko.observable("left"),
            "index": ko.observable("2"),
            "sizeClass": ko.observable("u-form-group"),
            "value": ko.observable(""),
            "align": ko.observable("left"),
            "mustEnter": ko.observable(null)
        },{
            "showLabel": ko.observable(true),
            "feedback": ko.observable(true),
            "sizeClass": ko.observable("u-form-group"),
            "labelText": ko.observable("left"),
            "index": ko.observable("3"),
            "sizeClass": ko.observable("u-form-group"),
            "value": ko.observable(""),
            "align": ko.observable("left"),
            "mustEnter": ko.observable(null)
        },{
            "showLabel": ko.observable(true),
            "feedback": ko.observable(null),
            "sizeClass": ko.observable("u-form-group"),
            "labelText": ko.observable("left"),
            "index": ko.observable("4"),
            "sizeClass": ko.observable("u-form-group"),
            "value": ko.observable(""),
            "align": ko.observable("left"),
            "mustEnter": ko.observable("inline-block")
        }];
    var inputModel = function(data) {
        this.inputData = ko.observableArray(data);
        console.log(this.inputData);
        this.changeSize = function(size){
            var index = $(event.target).parents("[index]").attr("index");
            this.inputData()[index].sizeClass(size);
            console.log(this.inputData()[index].sizeClass());
        }.bind(this);
        this.changeAlign = function(align){
            var index = $(event.target).parents("[index]").attr("index");
            this.inputData()[index].align(align);
        }.bind(this)

    };

    return new inputModel(data);

});


text:
import login from './login'
import participant from './participant'
import participantEdit from './participantEdit'
import participantPassword from './participantPassword'
import signup from './signup'
import teams from './teams'

export * from './participant'
export * from './teams'

export default [
  ...login,
  ...participant,
  ...participantEdit,
  ...participantPassword,
  ...signup,
  ...teams
]


text:
static NSNotificationCenter* mockDefaultCenter = nil;

@implementation NSNotificationCenter (UnitTests)

+ (NSNotificationCenter *)defaultCenter {
    if (mockDefaultCenter) {
        return mockDefaultCenter;
    }

    return invokeSupersequentNoParameters();
}

+ (id)createPartialMockObject {
    [NSNotificationCenter destroyMockObject];
    mockDefaultCenter = [OCMockObject partialMockForObject:[NSNotificationCenter defaultCenter]];
    return mockDefaultCenter;
}

+ (void)destroyMockObject {
    mockDefaultCenter = nil;
}

@end

#pragma clang diagnostic pop


text:
const crypto = require('crypto');
const thunkify = require('thunkify');

const jsonwebtoken = require('jsonwebtoken');
const SECRET = 's3cr3t';

const config = require('../config');
const db = config.db(require('cloudant'));

exports.link = function *() {

};

exports.authenticate = function *() {
  const credential = this.request.body; // {username,password}
  if (!credential.username || !credential.password) {
    this.status = 400;
    this.status = 'Missing credential';
    return;
  }

  const sha1 = crypto.createHash('sha1');
  const hashedPass = sha1.update(credential.password).digest('hex');

  const data = yield thunkify(db.view)('user', 'user-credential', {key: [credential.username, hashedPass]});
  if (data.length !== 2) {
    this.status = 403;
    this.status = 'Invalid username or password';
    return;
  }

  if (data[0].rows.length !== 1) {
    this.status = 403;
    this.body = 'Invalid username or password';
    return;
  }

  const roles = data[0].rows[0].value;
  const token = jsonwebtoken.sign(
    {
      sub: credential.username,
      exp: new Date().getTime() + 3600000
    }, SECRET);

  this.status = 200;
  this.body = {
    jwt: token,
    username: credential.username,
    roles: roles
  };
};

exports.middlewares = {
  deserializer: function *(next) {
    const authentication = this.headers['authorization'];
    if (!authentication) {
      return yield next;
    }

    if (!authentication.startsWith('jwt ')) {
      return yield next;
    }

    const jwt = authentication.substring(4);
    try {
      const payload = jsonwebtoken.verify(jwt, SECRET);

      this.request.currentUser = {
        id: payload.sub,
        roles: payload.roles
      };

      console.log(`[deserializer] Current user: %j`, this.request.currentUser);
      return yield next;
    }
    catch (e) {
      return yield next;
    }
  }
};


text:
OpenVPN CLI Wrapper
===================

A Javascript/Typescript wrapper to manage VPN connections using OpenVPN command-line instructions.

This minimal implementation library is used in a production software to open a VPN connection using Electron.

Thanks to [resin.io openvpn-client project](https://github.com/resin-io/openvpn-client) for the original coffeescript
implementation.

-------------------

Installation
------------
The [OpenVPN community binaries](https://openvpn.net/index.php/open-source/downloads.html) have to be pre-installed and
put in the PATH environment folder under Windows.

Install via npm.
```
$ npm install openvpn-cli-wrapper
```
or

Install via git clone
```
$ git clone https://github.com/masvis/openvpn-cli-wrapper
$ cd openvpn-cli-wrapper
$ npm install
```

Documentation
-------
Under `test/openvpn-client.test.ts` you can read a default implementation of a connection and disconnection test.

[Class: OpenVPN](#openvpn)
* [Method: Constructor(vpnOpts, [executablePath]='openvpn')](#openvpn_constructor)
* [Method: .connect()](#openvpn_connect)
* [Method: .disconnect()](#openvpn_disconnect)
* [Events](#openvpn_events)

### Class: OpenVPN
This class is the core of the library.

#### Method: Constructor(vpnOpts, [executablePath]='openvpn')
The constructor needs to be used sending
* **vpnOpts**: an array of CLI options.
* **executablePath** _(optional, default is **'openvpn'**)_: the path of the OpenVPN executable. This could be used to
avoid to change the PATH env variable under Windows or to use different versions of the executable.

#### Method: .connect()
Launch the OpenVPN process
> **Note:** If your configuration need a superuser operation in Linux (ex.: creating a TAP device), you need to run
the test or your parent application using `sudo`.

#### Method: .disconnect()
Close the OpenVPN process
> **Note:** Under a Linux environment you need to shutdown the process calling the disconnect before quitting you
application.

#### Events
Events are emitted by the `events` field of an `OpenVPN` class instance.
* **connected**: this event is emitted after `connect` method is called, only if connection is established without
errors.
* **disconnected**: this event is emitted after `connect` method is called if an error occurs or after `connected`
event if a disconnection or an error occurs.
* **data**: the process is writing a new line of info data. This event will emit the data as parameter.

Test
----

Using
```
$ npm test
```
you can check that all the dependencies are correctly installed.

LICENSE
-------

MIT license. See the LICENSE file for details.


text:
This file contains guidelines that should be followed when making any
changes to the repository. All text before the first level 1 (L1) header
will be ignored by the Pull request guidelines add-on.

# Process
1. Reviewer Checks out code
2. Reviewer builds & does a developer test
3. Reviewer checks if ReleaseNotes.md has been updated
3. Reviewer reviews actual Code
4. Reviewer adds comments & tasks
5. Implementer makes changes, if required
6. Reviewer repeats steps 1-4
7. Reviewer merges

# Coding Guidelines
* StyleCop rules are to be followed
* No abbreviations, if possible
* Test classes are suffixed with the word "Tests" (plural)
* Test method are named after the following schema:
 `MethodName_StateUnderTest_ExpectedBehavior`
* Warnings are treated as errors. No new Warnings allowed!

# Pull Request Decline Rules
These are the minimum requirements for a PR to even be reviewed:
* Project is not building
* Unit tests fail
* StyleCop warnings appear


text:
package org.nd4j.linalg.api.ops.impl.transforms.gradient;

import lombok.NonNull;
import org.nd4j.autodiff.samediff.SDVariable;
import org.nd4j.autodiff.samediff.SameDiff;
import org.nd4j.imports.NoOpNameFoundException;
import org.nd4j.linalg.api.buffer.DataType;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.DynamicCustomOp;

import java.util.Collections;
import java.util.List;

/**
 *
 */
public class SigmoidDerivative extends DynamicCustomOp {
    public SigmoidDerivative(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2) {
        super(sameDiff, new SDVariable[]{i_v1, i_v2});
    }

    public SigmoidDerivative(@NonNull INDArray x, @NonNull INDArray y) {
        this(x, y, null);
    }

    public SigmoidDerivative(INDArray x, INDArray y, INDArray z) {
        super(null, new INDArray[]{x,y}, new INDArray[]{z}, null,  (int[])null);
    }

    public SigmoidDerivative() {
    }

    @Override
    public int opNum() {
        return 0;
    }

    /**
     * The opName of this operation
     *
     * @return the opName of this operation
     */
    @Override
    public String opName() {
        return "sigmoid_bp";
    }

    @Override
    public String onnxName() {
        throw new NoOpNameFoundException("No onnx op opName found for " +  opName());
    }

    @Override
    public List<SDVariable> doDiff(List<SDVariable> i_v) {
        throw new UnsupportedOperationException();
    }

    @Override
    public List<DataType> calculateOutputDataTypes(List<DataType> inputDataTypes){
        return Collections.singletonList(inputDataTypes.get(0));
    }
}


text:
ACCEPTED

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

#### Published in
Mycologia 20(2): 57 (1928)

#### Original name
Podocrella Seaver

### Remarks
null


text:
set -e

cp /mnt/presto-admin/prestoadmin-*.tar.bz2 /opt
cd /opt
tar -jxf prestoadmin-*.tar.bz2
cd prestoadmin
./install-prestoadmin.sh


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

import com.facebook.presto.sql.planner.iterative.properties.LogicalPropertiesProviderImpl;
import com.facebook.presto.sql.planner.iterative.rule.test.BaseRuleTest;
import com.facebook.presto.sql.planner.iterative.rule.test.RuleTester;
import com.facebook.presto.sql.relational.FunctionResolution;
import com.facebook.presto.sql.tree.ExistsPredicate;
import com.facebook.presto.sql.tree.InPredicate;
import com.facebook.presto.sql.tree.LongLiteral;
import com.facebook.presto.sql.tree.SymbolReference;
import com.facebook.presto.tpch.TpchConnectorFactory;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.Optional;

import static com.facebook.presto.SystemSessionProperties.EXPLOIT_CONSTRAINTS;
import static com.facebook.presto.SystemSessionProperties.IN_PREDICATES_AS_INNER_JOINS_ENABLED;
import static com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY;
import static com.facebook.presto.spi.plan.AggregationNode.Step.SINGLE;
import static com.facebook.presto.sql.analyzer.FeaturesConfig.JoinReorderingStrategy.AUTOMATIC;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.aggregation;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.anyTree;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.assignUniqueId;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.equiJoinClause;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.join;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.output;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.project;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.tableScan;
import static com.facebook.presto.sql.planner.assertions.PlanMatchPattern.values;
import static com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder.assignment;
import static com.facebook.presto.sql.planner.plan.JoinNode.Type.INNER;
import static java.util.Collections.emptyList;

public class TestTransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin
        extends BaseRuleTest
{
    @BeforeClass
    public final void setUp()
    {
        tester = new RuleTester(emptyList(),
                ImmutableMap.of(IN_PREDICATES_AS_INNER_JOINS_ENABLED, Boolean.toString(true),
                        EXPLOIT_CONSTRAINTS, Boolean.toString(true),
                        JOIN_REORDERING_STRATEGY, AUTOMATIC.name()),
                Optional.of(1),
                new TpchConnectorFactory(1));
    }

    @Test
    public void testDoesNotFireOnCorrelation()
    {
        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        ImmutableList.of(p.variable("y")),
                        p.values(p.variable("y")),
                        p.values()))
                .doesNotFire();
    }

    @Test
    public void testDoesNotFireOnNonInPredicateSubquery()
    {
        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .on(p -> p.apply(
                        assignment(p.variable("x"), new ExistsPredicate(new LongLiteral("1"))),
                        emptyList(),
                        p.values(),
                        p.values()))
                .doesNotFire();
    }

    @Test
    public void testFiresForInPredicate()
    {
        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        emptyList(),
                        p.values(p.variable("y")),
                        p.values(p.variable("z"))))
                .matches(project(
                        aggregation(ImmutableMap.of(),
                                SINGLE,
                                join(INNER,
                                        ImmutableList.of(equiJoinClause("y", "z")),
                                        assignUniqueId("unique", values("y")),
                                        values("z")))));
    }

    @Test
    public void testDoesNotFiresForInPredicateThatMayParticipateInAntiJoin()
    {
        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        emptyList(),
                        p.values(p.variable("y")),
                        p.values(p.variable("z")),
                        true))
                .doesNotFire();
    }

    @Test
    public void testSimpleSemijoins()
    {
        tester().assertThat(ImmutableSet.of(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin()), new LogicalPropertiesProviderImpl(new FunctionResolution(getFunctionManager())))
                .on("SELECT * FROM nation WHERE regionkey IN (SELECT regionkey FROM region)")
                .matches(output(anyTree(
                        aggregation(
                                ImmutableMap.of(),
                                join(INNER,
                                        ImmutableList.of(equiJoinClause("regionkey", "regionkey_1")),
                                        assignUniqueId("unique",
                                                tableScan("nation", ImmutableMap.of("regionkey", "regionkey", "nationkey", "nationkey", "name", "name", "comment", "comment"))),
                                        tableScan("region", ImmutableMap.of("regionkey_1", "regionkey")))))));

        tester().assertThat(ImmutableSet.of(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin()), new LogicalPropertiesProviderImpl(new FunctionResolution(getFunctionManager())))
                .on("SELECT * FROM nation WHERE regionkey IN (SELECT regionkey FROM region) AND name IN (SELECT name FROM region)")
                .matches(output(anyTree(
                        aggregation(
                                ImmutableMap.of(),
                                join(INNER,
                                        ImmutableList.of(equiJoinClause("name", "name_12")),
                                        assignUniqueId("unique",
                                                (anyTree(
                                                        aggregation(
                                                                ImmutableMap.of(),
                                                                join(INNER,
                                                                        ImmutableList.of(equiJoinClause("regionkey", "regionkey_1")),
                                                                        assignUniqueId("unique_37",
                                                                                tableScan("nation", ImmutableMap.of("regionkey", "regionkey", "nationkey", "nationkey", "name", "name", "comment", "comment"))),
                                                                        tableScan("region", ImmutableMap.of("regionkey_1", "regionkey"))))))),
                                        tableScan("region", ImmutableMap.of("name_12", "name")))))));
    }

    @Test
    public void testFeatureDisabled()
    {
        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .setSystemProperty(IN_PREDICATES_AS_INNER_JOINS_ENABLED, "false")
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        emptyList(),
                        p.values(p.variable("y")),
                        p.values(p.variable("z"))))
                .doesNotFire();

        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .setSystemProperty(EXPLOIT_CONSTRAINTS, "false")
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        emptyList(),
                        p.values(p.variable("y")),
                        p.values(p.variable("z"))))
                .doesNotFire();

        tester().assertThat(new TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin())
                .setSystemProperty(JOIN_REORDERING_STRATEGY, "NONE")
                .on(p -> p.apply(
                        assignment(
                                p.variable("x"),
                                new InPredicate(
                                        new SymbolReference("y"),
                                        new SymbolReference("z"))),
                        emptyList(),
                        p.values(p.variable("y")),
                        p.values(p.variable("z"))))
                .doesNotFire();
    }
}


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 edu.wpi.first.wpilibj;

/**
 *
 * @author johnw_000
 */
public class Loader {
	private double motorSpeed;
	private Joystick drive;
	private Jaguar[] load = new Jaguar[2]; // an array of motors

	//constructor for the Loader
	public Loader(){
		//Joystick
		drive = new Joystick(2);

		//Pneu  matics
		load[0] = new Jaguar(3);//pwm port 3
		load[1] = new Jaguar(4);//pwm port 4

	}

	//returns the Loaderspeed
	public double getLoaderSpeed(){
		return motorSpeed;
	}
	//runs the motors for the loader
	public void runLoader(){
		if(drive.getRawButton(3)){
			load[0].set(varriableSpeed()/2);
			load[1].set(varriableSpeed()/2*-1);//inverted direction
		}
		if(drive.getRawButton(2)){
			load[0].set(0);
			load[1].set(0);
		}

	}
	//increses speed by incriments of .1 retruns a double
	private double varriableSpeed(){
		for (double i = .5; i < 1; i += .1) {
			motorSpeed = i;
		}
		return motorSpeed;
	}

}


text:
class CreateShows < ActiveRecord::Migration[5.0]
  def change
    create_table :shows do |t|
      t.string :venue
      t.datetime :date
      t.string :type
      t.string :url

      t.timestamps
    end
    add_index :shows, [:date]
  end
end


text:
SYNONYM

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Abh. Schweiz. Pal. Ges. , 29, Abt. 3, 11.

#### Original name
null

### Remarks
null


text:
require 'mongoid'
require 'stringex'
require 'mongoid/slug/criteria'
require 'mongoid/slug/index'
require 'mongoid/slug/paranoia'
require 'mongoid/slug/unique_slug'
require 'mongoid/slug/slug_id_strategy'

module Mongoid
  # Slugs your Mongoid model.
  module Slug
    extend ActiveSupport::Concern

    included do
      cattr_accessor :reserved_words,
                     :slug_scope,
                     :slugged_attributes,
                     :url_builder,
                     :history,
                     :by_model_type

      # field :_slugs, type: Array, default: [], localize: false
      # alias_attribute :slugs, :_slugs
    end

    module ClassMethods
      # @overload slug(*fields)
      #   Sets one ore more fields as source of slug.
      #   @param [Array] fields One or more fields the slug should be based on.
      #   @yield If given, the block is used to build a custom slug.
      #
      # @overload slug(*fields, options)
      #   Sets one ore more fields as source of slug.
      #   @param [Array] fields One or more fields the slug should be based on.
      #   @param [Hash] options
      #   @param options [Boolean] :history Whether a history of changes to
      #   the slug should be retained. When searched by slug, the document now
      #   matches both past and present slugs.
      #   @param options [Boolean] :permanent Whether the slug should be
      #   immutable. Defaults to `false`.
      #   @param options [Array] :reserve` A list of reserved slugs
      #   @param options :scope [Symbol] a reference association or field to
      #   scope the slug by. Embedded documents are, by default, scoped by
      #   their parent.
      #   @yield If given, a block is used to build a slug.
      #
      # @example A custom builder
      #   class Person
      #     include Mongoid::Document
      #     include Mongoid::Slug
      #
      #     field :names, :type => Array
      #     slug :names do |doc|
      #       doc.names.join(' ')
      #     end
      #   end
      #
      def slug(*fields, &block)
        options = fields.extract_options!

        self.slug_scope            = options[:scope]
        self.reserved_words        = options[:reserve] || Set.new(["new", "edit"])
        self.slugged_attributes    = fields.map &:to_s
        self.history               = options[:history]
        self.by_model_type         = options[:by_model_type]

        field :_slugs, type: Array, default: [], localize: options[:localize]
        alias_attribute :slugs, :_slugs

        # Set index
        unless embedded?
          index(*Mongoid::Slug::Index.build_index(self.slug_scope_key, self.by_model_type))
        end

        #-- Why is it necessary to customize the slug builder?
        default_url_builder = lambda do |cur_object|
          cur_object.slug_builder.to_url
        end

        self.url_builder = block_given? ? block : default_url_builder

        #-- always create slug on create
        #-- do not create new slug on update if the slug is permanent
        if options[:permanent]
          set_callback :create, :before, :build_slug
        else
          set_callback :save, :before, :build_slug, :if => :slug_should_be_rebuilt?
        end

        # If paranoid document:
        # - include shim to add callbacks for restore method
        # - unset the slugs on destroy
        # - recreate the slug on restore
        # - force reset the slug when saving a destroyed paranoid document, to ensure it stays unset in the database
        if is_paranoid_doc?
          self.send(:include, Mongoid::Slug::Paranoia) unless self.respond_to?(:before_restore)
          set_callback :destroy, :after,  :unset_slug!
          set_callback :restore, :before, :set_slug!
          set_callback :save,    :before, :reset_slug!, :if => :paranoid_deleted?
          set_callback :save,    :after,  :clear_slug!, :if => :paranoid_deleted?
        end
      end

      def look_like_slugs?(*args)
        with_default_scope.look_like_slugs?(*args)
      end

      # Returns the scope key for indexing, considering associations
      #
      # @return [ Array<Document>, Document ] Whether the document is paranoid
      def slug_scope_key
        return nil unless self.slug_scope
        self.reflect_on_association(self.slug_scope).try(:key) || self.slug_scope
      end

      # Find documents by slugs.
      #
      # A document matches if any of its slugs match one of the supplied params.
      #
      # A document matching multiple supplied params will be returned only once.
      #
      # If any supplied param does not match a document a Mongoid::Errors::DocumentNotFound will be raised.
      #
      # @example Find by a slug.
      #   Model.find_by_slug!('some-slug')
      #
      # @example Find by multiple slugs.
      #   Model.find_by_slug!('some-slug', 'some-other-slug')
      #
      # @param [ Array<Object> ] args The slugs to search for.
      #
      # @return [ Array<Document>, Document ] The matching document(s).
      def find_by_slug!(*args)
        with_default_scope.find_by_slug!(*args)
      end

      def queryable
        scope_stack.last || Criteria.new(self) # Use Mongoid::Slug::Criteria for slugged documents.
      end

      # Indicates whether or not the document includes Mongoid::Paranoia
      #
      # This can be replaced with .paranoid? method once the following PRs are merged:
      # - https://github.com/simi/mongoid-paranoia/pull/19
      # - https://github.com/haihappen/mongoid-paranoia/pull/3
      #
      # @return [ Array<Document>, Document ] Whether the document is paranoid
      def is_paranoid_doc?
        !!(defined?(::Mongoid::Paranoia) && self < ::Mongoid::Paranoia)
      end
    end

    # Builds a new slug.
    #
    # @return [true]
    def build_slug
      if localized?
        begin
          orig_locale = I18n.locale
          all_locales.each do |target_locale|
            I18n.locale = target_locale
            apply_slug
          end
        ensure
          I18n.locale = orig_locale
        end
      else
        apply_slug
      end
      true
    end

    def apply_slug
      _new_slug = find_unique_slug

      #skip slug generation and use Mongoid id
      #to find document instead
      return true if _new_slug.size == 0

      # avoid duplicate slugs
      self._slugs.delete(_new_slug) if self._slugs

      if !!self.history && self._slugs.is_a?(Array)
        append_slug(_new_slug)
      else
        self._slugs = [_new_slug]
      end
    end

    # Builds slug then atomically sets it in the database.
    # This is used when working with the Mongoid::Paranoia restore callback.
    #
    # This method is adapted to use the :set method variants from both
    # Mongoid 3 (two args) and Mongoid 4 (hash arg)
    def set_slug!
      build_slug
      self.method(:set).arity == 1 ? set({_slugs: self._slugs}) : set(:_slugs, self._slugs)
    end

    # Atomically unsets the slug field in the database. It is important to unset
    # the field for the sparse index on slugs.
    #
    # This also resets the in-memory value of the slug field to its default (empty array)
    def unset_slug!
      unset(:_slugs)
      clear_slug!
    end

    # Rolls back the slug value from the Mongoid changeset.
    def reset_slug!
      self.reset__slugs!
    end

    # Sets the slug to its default value.
    def clear_slug!
      self._slugs = []
    end

    # Finds a unique slug, were specified string used to generate a slug.
    #
    # Returned slug will the same as the specified string when there are no
    # duplicates.
    #
    # @return [String] A unique slug
    def find_unique_slug
      UniqueSlug.new(self).find_unique
    end

    # @return [Boolean] Whether the slug requires to be rebuilt
    def slug_should_be_rebuilt?
      (new_record? or _slugs_changed? or slugged_attributes_changed?) and !paranoid_deleted?
    end

    # Indicates whether or not the document has been deleted in paranoid fashion
    # Always returns false if the document is not paranoid
    #
    # @return [Boolean] Whether or not the document has been deleted in paranoid fashion
    def paranoid_deleted?
      !!(self.class.is_paranoid_doc? and self.deleted_at != nil)
    end

    def slugged_attributes_changed?
      slugged_attributes.any? { |f| attribute_changed? f.to_s }
    end

    # @return [String] A string which Action Pack uses for constructing an URL
    # to this record.
    def to_param
      slug || super
    end

    # @return [String] the slug, or nil if the document does not have a slug.
    def slug
      return _slugs.last if _slugs
      return _id.to_s
    end

    def slug_builder
      _cur_slug = nil
      if new_with_slugs? or persisted_with_slug_changes?
        #user defined slug
        _cur_slug = _slugs.last
      end
      #generate slug if the slug is not user defined or does not exist
      _cur_slug || pre_slug_string
    end

    def self.mongoid3?
      ::Mongoid.const_defined? :Observer
    end

    private

    def append_slug(_slug)
      if localized?
        # This is necessary for the scenario in which the slugged locale is not yet present
        # but the default locale is. In this situation, self._slugs falls back to the default
        # which is undesired
        current_slugs = self._slugs_translations.fetch(I18n.locale.to_s, [])
        current_slugs << _slug
        self._slugs_translations = self._slugs_translations.merge(I18n.locale.to_s => current_slugs)
      else
        self._slugs << _slug
      end
    end

    # Returns true if object is a new record and slugs are present
    def new_with_slugs?
      if localized?
        # We need to check if slugs are present for the locale without falling back
        # to a default
        new_record? and _slugs_translations.fetch(I18n.locale.to_s, []).any?
      else
        new_record? and _slugs.present?
      end
    end

    # Returns true if object has been persisted and has changes in the slug
    def persisted_with_slug_changes?
      if localized?
        changes = self._slugs_change
        return (persisted? and false) if changes.nil?

        # ensure we check for changes only between the same locale
        original = changes.first.try(:fetch, I18n.locale.to_s, nil)
        compare = changes.last.try(:fetch, I18n.locale.to_s, nil)
        persisted? and original != compare
      else
        persisted? and _slugs_changed?
      end
    end

    def localized?
      self.fields['_slugs'].options[:localize] rescue false
    end

    # Return all possible locales for model
    # Avoiding usage of I18n.available_locales in case the user hasn't set it properly, or is
    # doing something crazy, but at the same time we need a fallback in case the model doesn't
    # have any localized attributes at all (extreme edge case).
    def all_locales
      locales = self.slugged_attributes
                    .map{|attr| self.send("#{attr}_translations").keys if self.respond_to?("#{attr}_translations")}
                    .flatten.compact.uniq
      locales = I18n.available_locales if locales.empty?
      locales
    end

    def pre_slug_string
      self.slugged_attributes.map { |f| self.send f }.join ' '
    end
  end
end


text:
""" Dummy Classes to make it possible to import
Sublime plugins for sphinx docs"""

def packages_path():
    return '/tmp'

def load_settings(*args, **kwargs):
    return {}


text:
<title>
The Microsoft mob got away scot-free
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

The Microsoft mob got away scot-free

November 9, 2001 | Page 2

THE BEAST from Redmond, Wash., is back. Software giant Microsoft and the U.S. government ended their three-year legal battle with an agreement announced last week.

The Justice Department sued Microsoft in 1998 over antitrust violations, charging that Bill Gates and his boys had acted like a mafia crime family in building up an effective monopoly in the software industry.

The feds won two court decisions in the case--the last one, a 7-0 rejection of Microsoft's appeal by a federal appeals court. But last week's agreement gives up numerous concessions to the Microsoft mob.

The deal effectively allows Microsoft to continue its dominance in the market for Web browsers--even though the government proved that the Gates gang used extortion against rival Netscape.

Some of Microsoft's media minions justified the agreement as a patriotic response to the post-September 11 economic tailspin. But Norman Hawker, a research fellow at the American Antitrust Institute, says that the Bush administration wanted to lose.

"They expected to lose in the Court of Appeals," Hawker said. "When they won, they were put in the embarrassing position of winning a case that they were opposed to from the start…Microsoft, when they saw this settlement, must have thought it was raining pennies from heaven."

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
ACCEPTED

#### According to
GRIN Taxonomy for Plants

#### Published in
Verh. Bot. Vereins Prov. Brandenburg 26:163. 1885 (Monogr. <I>Clematis</I>)

#### Original name
null

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HFEA.BL.Contracts.Search;
using HFEA.BL.Contracts.Constants;
using HFEA.Connector.Contracts.ReferenceData;

namespace HFEA.BL.SearchProvider.DataSources
{
    public abstract class BaseLicenseSource : BaseSearchDataSource
    {
        public BaseLicenseSource(Search.SearchSource source) : base(source)
        {
        }

        protected SearchIndexItem GetResultItem(List<LicenceConditionsData> rawData,
            int searchId,
            string title)
        {
            SearchIndexItem result = null;

            if (rawData != null)
            {
                var flattened = rawData.FlattenBy(x => x.LicenceConditionsDataList).ToList();
                string body = string.Join(" ", flattened.Select(x => x.Description));
                result = new SearchIndexItem()
                {
                    Id = searchId,
                    Title = title,
                    Body = body,
                    SourceType = this.SourceType,
                    Tags = this.GetDistinctTags(flattened),
                    ProductTags = this.ProductTagStringFromSource,
                    IsKnowledgeBaseContent = this.IsKnowledgeBaseDataSourceType,
                    PublishDate = DateTime.MinValue // TODO
                };
            }

            return result;
        }

        private string GetDistinctTags(List<LicenceConditionsData> dataList)
        {
            string result = string.Empty;

            List<string> tagsList = new List<string>();

            foreach (var item in dataList)
            {
                if (!string.IsNullOrEmpty(item.CommaSeparatedSearchTags))
                {
                    tagsList.AddRange(
                        item.CommaSeparatedSearchTags.Split(
                            new char[] { ',' },
                            StringSplitOptions.RemoveEmptyEntries));
                }
            }

            if (tagsList.Any())
            {
                result = string.Join(",", tagsList.Distinct());
            }

            return result;
        }
    }
}


text:
package fixtures.lro.implementation;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines headers for deleteAsyncNoHeaderInRetry operation.
 */
public class LROsDeleteAsyncNoHeaderInRetryHeadersInner {
    /**
     * Location to poll for result status: will be set to
     * /lro/put/noheader/202/204/operationresults.
     */
    @JsonProperty(value = "Location")
    private String location;

    /**
     * Get the location value.
     *
     * @return the location value
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location value.
     *
     * @param location the location value to set
     * @return the LROsDeleteAsyncNoHeaderInRetryHeadersInner object itself.
     */
    public LROsDeleteAsyncNoHeaderInRetryHeadersInner withLocation(String location) {
        this.location = location;
        return this;
    }

}


text:
// ZAP: 2011/11/20 Support for extension factory
// ZAP: 2011/12/14 Support for extension dependencies
// ZAP: 2012/03/17 Issue 282 Added getAuthor() and getURL();
// ZAP: 2012/12/08 Issue 428: Added support for extension specific I18N bundles, to support the marketplace
// ZAP: 2013/01/16 Issue 453: Dynamic loading and unloading of add-ons
// ZAP: 2013/08/29 Issue 776: Allow add-ons to warn user if they're closing ZAP with unsaved resources open
// ZAP: 2014/02/28 Issue 1057: Add a Extension.postInstall() method for post install actions
// ZAP: 2015/01/04 Issue 1472: Allow extensions to specify a name for UI components
// ZAP: 2015/01/19 Issue 1510: New Extension.postInit() method to be called once all extensions loaded
// ZAP: 2015/02/09 Issue 1525: Introduce a database interface layer to allow for alternative implementations
// ZAP: 2015/02/10 Issue 1208: Search classes/resources in add-ons declared as dependencies
// ZAP: 2015/03/16 Issue 1525: Further database independence changes
// ZAP: 2015/03/30 Issue 1582: Enablers for low memory option
// ZAP: 2016/09/26 JavaDoc tweaks
// ZAP: 2017/02/17 Expose ExtensionHook to allow core code remove/unhook the extension.
// ZAP: 2017/05/22 Use Class<? extends Extension> for dependencies of the extension.
// ZAP: 2017/05/25 Add JavaDoc to isEnabled/setEnabled.
// ZAP: 2018/06/01 Add JavaDoc to getMessages/setMessages.
// ZAP: 2018/10/09 Remove getExtensionHook and add JavaDoc to hook.

package org.parosproxy.paros.extension;

import java.net.URL;
import java.util.List;
import java.util.ResourceBundle;

import org.parosproxy.paros.db.Database;
import org.parosproxy.paros.db.DatabaseException;
import org.parosproxy.paros.db.DatabaseUnsupportedException;
import org.parosproxy.paros.model.Model;
import org.parosproxy.paros.model.OptionsParam;
import org.parosproxy.paros.model.Session;
import org.zaproxy.zap.Version;
import org.zaproxy.zap.control.AddOn;

/**
 * Life cycle for an extension
 * .	init
 * .	initModel - the extension obtain the data model
 * .	initXML
 * .	getExtensionHook - workbench obtain the view of the plugin
 * .	start()
 * .	stop()
 * .	May go back to 5 depending on options or menu chosen.
 * .	destroy
 */
public interface Extension {

    /**
     * Returns the name of the extension, for configurations and access from other components (e.g. extensions).
     *
     * @return the name of the extension, never {@code null}
     * @see #getUIName()
     */
    String getName();

    /**
     * Returns a short descriptive name of the extension, to be shown in UI components. The name must be
     * internationalised.
     *
     * @return the UI name of the extension, never {@code null}
     * @since 2.4.0
     * @see #getName()
     * @see #getDescription()
     */
    String getUIName();

    /**
     * Returns the description of the extension, to be shown in UI components. The description must be
     * internationalised.
     *
     * @return the description of the extension, never {@code null}
     */
    String getDescription();

    /**
     * Returns the (semantic) version of this extension, {@code null} if not versioned
     *
     * @return the version of the extension, or {@code null} if not versioned
     * @since 2.4.0
     */
    Version getVersion();

    /**
     * Initialize plugin during startup.  This phase is carried out before all others.
     */
    void init();

    /**
     * Initialization of plugin after obtaining data model from core.  Method should not depend
     * on view.
     * @param model the model
     */
    void initModel(Model model);

    void initView(ViewDelegate view);

    Model getModel();

    ViewDelegate getView();

    /**
     * Start the plugin eg if there is a running server.
     *
     */
    void start();

    /**
     * stop the plugin eg if there is a running server.
     */
    void stop();

    /**
     * Plugin cleanup, finalize etc when program shutdown.  Stop() will be called before shutdown.
     */
    void destroy();

    /**
     * Initialize session and options parameter if required XML node not in either files.
     * @param session the current session
     * @param options the options
     */
    void initXML(Session session, OptionsParam options);

    /**
     * Called during extension's initialisation to allow to add new functionality to core components.
     *
     * @param hook the hook to add the components.
     */
    void hook(ExtensionHook hook);

    boolean isDepreciated ();

    int getOrder();

    void setOrder(int order);

	/**
	 * Tells whether or not this extension is enabled.
	 *

	 * Extensions might be disabled by the user (for example, through GUI), or, automatically during loading if all its
	 * dependencies are not fulfilled.
	 *
	 * @return {@code true} if the extension is enabled, {@code false} otherwise.
	 */
	boolean isEnabled();

	/**
	 * Sets whether or not this extension is enabled.
	 *

	 * Note: This method should be called only by bootstrap classes.
	 *
	 * @param enabled {@code true} if the extension should be enabled, {@code false} otherwise.
	 */
	void setEnabled(boolean enabled);

	/**
	 * Gets the list of {@code Extension}s that this extension depends on.
	 *
	 * @return the list of dependencies, empty (or {@code null}) if none.
	 */
	List<Class<? extends Extension>> getDependencies();

	boolean isCore ();

	String getAuthor ();

	URL getURL ();

	/**
	 * Gets the resource bundle of the extension.
	 *

	 * Set during start up based on the available resource bundles:
	 *

	 *
extension's resource bundle, located in the {@code resources} directory under the extension's package;

	 *
add-on's resource bundle;

	 *
core resource bundle;

	 *

	 *
	 * @return the resource bundle, never {@code null}.
	 * @since 2.0.0
	 */
	ResourceBundle getMessages();

	/**
	 * Sets the resource bundle of the extension.
	 *

	 * Note: This method should be called only by bootstrap classes.
	 *
	 * @param messages the resource bundle of the extension.
	 * @since 2.0.0
	 */
	void setMessages(ResourceBundle messages);

	String getI18nPrefix ();

	void setI18nPrefix(String prefix);

	/**
	 * Called after the options for this extension have been loaded, so that the extension can make use of them.
	 * Note that other add-ons may not have been loaded at this point - if you need them to be then implement postInit()
	 *
	 * @see #postInit()
	 */
	void optionsLoaded();

	boolean canUnload();

	/**
	 * Unloads any component manually added to ZAP or other extensions (that is, a component that was not added through the
	 * {@code ExtensionHook}).
	 *

	 * Should be called only by core functionality (e.g. during uninstallation of the extension).
	 *
	 * @see #hook(ExtensionHook)
	 */
	void unload();

	/**
	 * Extensions should return the user friendly names of any unsaved resources - if there are any the user will be given the
	 * option not to exit ZAP or, if the extension is bundled in an add-on that's being updated or uninstalled, not to continue
	 * with the changes.
	 *
	 * @return a {@code List} containing the unsaved resources or {@code null} if none
	 * @since 2.2.0
	 * @see #getActiveActions()
	 */
	List<String> getUnsavedResources();

	/**
	 * Returns the (internationalised) names of all active actions of the extension - if there are any the user will be given
	 * the option not to exit ZAP or, if the extension is bundled in an add-on that's being updated or uninstalled, not to
	 * continue with the changes.
	 *

	 * An active action is something that's started by the user, for example, a scan.
	 *
	 * @return a {@code List} containing the active actions or {@code null} if none
	 * @since 2.4.0
	 * @see #getUnsavedResources()
	 */
	List<String> getActiveActions();

	/**
	 * Implement this method to perform tasks after the add-on is installed.
	 * Note that this will only be called if the user adds the add-on via ZAP, eg file the File menu or the Marketplace.
	 * If the add-on is installed by copying the file to the plugins directory then it will not be called.
	 *
	 * @since 2.3.0
	 * @see #postInit()
	 */
    void postInstall();

	/**
	 * Implement this method to perform tasks after all extensions/add-ons have been initialised.
	 *
	 * @since 2.4.0
	 * @see #postInstall()
	 */
    void postInit();

    /**
     * Implement this method to register database tables to be used by the add-on
     * @param db the database opened
     * @throws DatabaseException if an error occurred while reading the database contents
     * @throws DatabaseUnsupportedException if the database is not supported by the extension
     */
    void databaseOpen(Database db) throws DatabaseException, DatabaseUnsupportedException;

    /**
     * Returns the add-on where this extension is bundled. Might be {@code null} if core extension.
     *
     * @return the add-on where this extension is bundled, or {@code null} if core extension.
     * @since 2.4.0
     */
    AddOn getAddOn();

    /**
     * Sets the add-on where this extension is bundled.
     *

     * Note: This method should be called only by bootstrap classes.
     *
     * @param addOn the add-on where this extension is bundled
     * @since 2.4.0
     */
    void setAddOn(AddOn addOn);

    /**
     * Return true if the specified db type is supported by the extension (or if it doesnt use any db)
     * If this method returns false (meaning the db in use is not supported) then the extension will not be loaded.
     * @param type the db type
     * @return true if the specified db type is supported by the extension (or if it doesnt use any db)
     * @see org.parosproxy.paros.db.Database#getType()
     */
    boolean supportsDb(String type);

    /**
     * Return true it the extension can run with the 'low memory' option.
     * If the low memory option is set (and the extension supports it) then code should minimize the data stored in memory,
     * using the db for all significant data.
     * Extensions that do not support the low memory option will not be run if the option is set.
     * @return {@code true} if the extension support the 'low memory' option, {@code false} otherwise
     */
    boolean supportsLowMemory();
}


text:
import abc
import os

import six

from openstack import exceptions
from openstack import proxy

class BaseImageProxy(six.with_metaclass(abc.ABCMeta, proxy.Proxy)):

    retriable_status_codes = [503]

    _IMAGE_MD5_KEY = 'owner_specified.openstack.md5'
    _IMAGE_SHA256_KEY = 'owner_specified.openstack.sha256'
    _IMAGE_OBJECT_KEY = 'owner_specified.openstack.object'

    # NOTE(shade) shade keys were owner_specified.shade.md5 - we need to add
    #             those to freshness checks so that a shade->sdk transition
    #             doesn't result in a re-upload
    _SHADE_IMAGE_MD5_KEY = 'owner_specified.shade.md5'
    _SHADE_IMAGE_SHA256_KEY = 'owner_specified.shade.sha256'
    _SHADE_IMAGE_OBJECT_KEY = 'owner_specified.shade.object'

    def create_image(
            self, name, filename=None,
            container=None,
            md5=None, sha256=None,
            disk_format=None, container_format=None,
            disable_vendor_agent=True,
            allow_duplicates=False, meta=None,
            wait=False, timeout=3600,
            data=None, validate_checksum=True,
            **kwargs):
        """Upload an image.

        :param str name: Name of the image to create. If it is a pathname
            of an image, the name will be constructed from the extensionless
            basename of the path.
        :param str filename: The path to the file to upload, if needed.
            (optional, defaults to None)
        :param data: Image data (string or file-like object). It is mutually
            exclusive with filename
        :param str container: Name of the container in swift where images
            should be uploaded for import if the cloud requires such a thing.
            (optional, defaults to 'images')
        :param str md5: md5 sum of the image file. If not given, an md5 will
            be calculated.
        :param str sha256: sha256 sum of the image file. If not given, an md5
            will be calculated.
        :param str disk_format: The disk format the image is in. (optional,
            defaults to the os-client-config config value for this cloud)
        :param str container_format: The container format the image is in.
            (optional, defaults to the os-client-config config value for this
            cloud)
        :param bool disable_vendor_agent: Whether or not to append metadata
            flags to the image to inform the cloud in question to not expect a
            vendor agent to be runing. (optional, defaults to True)
        :param allow_duplicates: If true, skips checks that enforce unique
            image name. (optional, defaults to False)
        :param meta: A dict of key/value pairs to use for metadata that
            bypasses automatic type conversion.
        :param bool wait: If true, waits for image to be created. Defaults to
            true - however, be aware that one of the upload methods is always
            synchronous.
        :param timeout: Seconds to wait for image creation. None is forever.
        :param bool validate_checksum: If true and cloud returns checksum,
            compares return value with the one calculated or passed into this
            call. If value does not match - raises exception. Default is
            'false'

        Additional kwargs will be passed to the image creation as additional
        metadata for the image and will have all values converted to string
        except for min_disk, min_ram, size and virtual_size which will be
        converted to int.

        If you are sure you have all of your data types correct or have an
        advanced need to be explicit, use meta. If you are just a normal
        consumer, using kwargs is likely the right choice.

        If a value is in meta and kwargs, meta wins.

        :returns: A ``munch.Munch`` of the Image object

        :raises: SDKException if there are problems uploading
        """
        if container is None:
            container = self._connection._OBJECT_AUTOCREATE_CONTAINER
        if not meta:
            meta = {}

        if not disk_format:
            disk_format = self._connection.config.config['image_format']
        if not container_format:
            # https://docs.openstack.org/image-guide/image-formats.html
            container_format = 'bare'

        if data and filename:
            raise exceptions.SDKException(
                'Passing filename and data simultaneously is not supported')
        # If there is no filename, see if name is actually the filename
        if not filename and not data:
            name, filename = self._get_name_and_filename(
                name, self._connection.config.config['image_format'])
        if validate_checksum and data and not isinstance(data, bytes):
            raise exceptions.SDKException(
                'Validating checksum is not possible when data is not a '
                'direct binary object')
        if not (md5 or sha256) and validate_checksum:
            if filename:
                (md5, sha256) = self._connection._get_file_hashes(filename)
            elif data and isinstance(data, bytes):
                (md5, sha256) = self._connection._calculate_data_hashes(data)
        if allow_duplicates:
            current_image = None
        else:
            current_image = self.find_image(name)
            if current_image:
                props = current_image.get('properties', {})
                md5_key = props.get(
                    self._IMAGE_MD5_KEY,
                    props.get(self._SHADE_IMAGE_MD5_KEY, ''))
                sha256_key = props.get(
                    self._IMAGE_SHA256_KEY,
                    props.get(self._SHADE_IMAGE_SHA256_KEY, ''))
                up_to_date = self._connection._hashes_up_to_date(
                    md5=md5, sha256=sha256,
                    md5_key=md5_key, sha256_key=sha256_key)
                if up_to_date:
                    self.log.debug(
                        "image %(name)s exists and is up to date",
                        {'name': name})
                    return current_image
                else:
                    self.log.debug(
                        "image %(name)s exists, but contains different "
                        "checksums. Updating.",
                        {'name': name})

        if disable_vendor_agent:
            kwargs.update(
                self._connection.config.config['disable_vendor_agent'])

        # If a user used the v1 calling format, they will have
        # passed a dict called properties along
        properties = kwargs.pop('properties', {})
        properties[self._IMAGE_MD5_KEY] = md5 or ''
        properties[self._IMAGE_SHA256_KEY] = sha256 or ''
        properties[self._IMAGE_OBJECT_KEY] = '/'.join(
            [container, name])
        kwargs.update(properties)
        image_kwargs = dict(properties=kwargs)
        if disk_format:
            image_kwargs['disk_format'] = disk_format
        if container_format:
            image_kwargs['container_format'] = container_format

        if filename or data:
            image = self._upload_image(
                name, filename=filename, data=data, meta=meta,
                wait=wait, timeout=timeout,
                validate_checksum=validate_checksum,
                **image_kwargs)
        else:
            image = self._create_image(**image_kwargs)
        self._connection._get_cache(None).invalidate()
        return image

    @abc.abstractmethod
    def _create_image(self, name, **image_kwargs):
        pass

    @abc.abstractmethod
    def _upload_image(self, name, filename, data, meta, wait, timeout,
                      validate_checksum=True,
                      **image_kwargs):
        pass

    @abc.abstractmethod
    def _update_image_properties(self, image, meta, properties):
        pass

    def update_image_properties(
            self, image=None, meta=None, **kwargs):
        """
        Update the properties of an existing image.

        :param image: Name or id of an image or an Image object.
        :param meta: A dict of key/value pairs to use for metadata that
                     bypasses automatic type conversion.

        Additional kwargs will be passed to the image creation as additional
        metadata for the image and will have all values converted to string
        except for min_disk, min_ram, size and virtual_size which will be
        converted to int.
        """

        if image is None:
            image = self._connection.get_image(image)

        if not meta:
            meta = {}

        img_props = {}
        for k, v in iter(kwargs.items()):
            if v and k in ['ramdisk', 'kernel']:
                v = self._connection.get_image_id(v)
                k = '{0}_id'.format(k)
            img_props[k] = v

        return self._update_image_properties(image, meta, img_props)

    def _get_name_and_filename(self, name, image_format):
        # See if name points to an existing file
        if os.path.exists(name):
            # Neat. Easy enough
            return (os.path.splitext(os.path.basename(name))[0], name)

        # Try appending the disk format
        name_with_ext = '.'.join((name, image_format))
        if os.path.exists(name_with_ext):
            return (os.path.basename(name), name_with_ext)

        return (name, None)


text:
import os

_basedir = os.path.abspath(os.path.dirname(__file__))

THREADS_PER_PAGE = 8

# General

# These will need to be set to `True` if you are developing locally
CORS = False
DEBUG = False

# Logging

LOG_LEVEL = "DEBUG"
LOG_FILE = "lemur.log"


text:
Scripts to aid in the attempt of securing glastonbury tickets

## Installation

pip install -r requirements.txt

## Usage

python tickets.py -h


text:
<?php
/**
 * @file
 * Contains BackupMigrate\Drupal\EntityPlugins\DestinationPluginBase
 */

namespace BackupMigrate\Drupal\EntityPlugins;

use BackupMigrate\Core\Main\BackupMigrateInterface;

/**
 * Class SourcePluginBase
 * @package BackupMigrate\Drupal\EntityPlugins
 */
abstract class SourcePluginBase extends WrapperPluginBase implements SourcePluginInterface {

  /**
   * {@inheritdoc}
   */
  public function alterBackupMigrate(BackupMigrateInterface $bam, $key, $options = []) {
    $bam->sources()->add($key, $this->getObject());
  }
}


text:
<?php

namespace Modules\SimpleWebsite\Controllers;

use Symbiose\Framework\Controller\Controller;

class HelloController
	extends Controller
{
	public function indexAction($name = null)
	{
		return $this->createResponse("Hello $name");
	}

	public function withTemplateAction($name = null)
	{
		$templateManager = $this->serviceContainer->get('template_manager');
		$template = $templateManager->loadTemplate('index.phtml');
		return $this->createResponse($template);
		//return $this->createResponse($template->render(array('name' => $name)));
	}
}


text:
package org.jgrades.logging.model;

import org.jgrades.logging.model.updater.PerLevelUpdater;
import org.jgrades.logging.model.updater.PerModuleAndLevelUpdater;
import org.jgrades.logging.model.updater.PerModuleUpdater;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class LoggingStrategyTest {
    @Test
    public void updaterForPerLevelStrategyShouldBelongToTheAppropriateUpdaterClass() throws Exception {
        // given
        LoggingStrategy strategy = LoggingStrategy.LOG_FILE_PER_LEVEL;

        // when
        XmlFileNameTagsUpdater updater = strategy.getUpdater();

        // then
        assertThat(updater).isInstanceOf(PerLevelUpdater.class);
    }

    @Test
    public void updaterForPerModuleStrategyShouldBelongToTheAppropriateUpdaterClass() throws Exception {
        // given
        LoggingStrategy strategy = LoggingStrategy.LOG_FILE_PER_MODULE;

        // when
        XmlFileNameTagsUpdater updater = strategy.getUpdater();

        // then
        assertThat(updater).isInstanceOf(PerModuleUpdater.class);
    }

    @Test
    public void updaterForPerModuleAndLevelStrategyShouldBelongToTheAppropriateUpdaterClass() throws Exception {
        // given
        LoggingStrategy strategy = LoggingStrategy.LOG_FILE_PER_MODULE_AND_LEVEL;

        // when
        XmlFileNameTagsUpdater updater = strategy.getUpdater();

        // then
        assertThat(updater).isInstanceOf(PerModuleAndLevelUpdater.class);
    }
}


text:
BuildrPlus::Roles.role(:sync_model, :requires => [:sync]) do

  if BuildrPlus::FeatureManager.activated?(:domgen)
    generators = [:sync_master_ejb_impl, :ejb_services, :sync_remote_sync_service]
    generators += project.additional_domgen_generators
    Domgen::Build.define_generate_task(generators, :buildr_project => project) do |t|
      t.filter = Proc.new do |artifact_type, artifact|
        Domgen::Filters.is_in_data_modules?([:Master], artifact_type, artifact) &&
          (artifact_type != :service || artifact.name == :SyncTempPopulationService)
      end
    end
  end

  project.publish = true

  compile.using :javac
  compile.with BuildrPlus::Libs.ee_provided

  compile.with artifacts([BuildrPlus::Appconfig.appconfig_server, BuildrPlus::Libs.field_filter])
  compile.with artifacts([BuildrPlus::Syncrecord.syncrecord_server, BuildrPlus::Syncrecord.syncrecord_rest_client])
  compile.with Buildr.artifacts([BuildrPlus::Libs.keycloak_authfilter]) if BuildrPlus::FeatureManager.activated?(:keycloak)

  BuildrPlus::Roles.merge_projects_with_role(project.compile, :model)

  package(:jar)
  package(:sources)

  if BuildrPlus::FeatureManager.activated?(:db)
    iml.add_jpa_facet
    iml.add_ejb_facet if BuildrPlus::FeatureManager.activated?(:ejb)
  end
end


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

%   http://www.apache.org/licenses/LICENSE-2.0

% Unless required by applicable law or agreed to in writing,
% software distributed under the License is distributed on an
% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
% KIND, either express or implied.  See the License for the
% specific language governing permissions and limitations
% under the License.

% When using TeXShop on the Mac, let it know the root document.
% The following must be one of the first 20 lines.
% !TEX root = ../design.tex

\chapter{Neural Network}

\begin{moduleinfo}
\item[Authors] {Xixuan Feng, Cooper Sloan}
\end{moduleinfo}

% Abstract. What is the problem we want to solve?
This module implements artificial neural network \cite{ann_wiki}.

\section{Multilayer Perceptron}
Multilayer perceptron is arguably the most popular model among many neural network models \cite{mlp_wiki}.
Here, we learn the coefficients by minimizing a least square objective function, or cross entropy (\cite{bertsekas1999nonlinear}, example 1.5.3).
The parallel architecture is based on the paper by Zhiheng Huang \cite{mlp_parallel}.

% Background. Why can we solve the problem with gradient-based methods?
\subsection{Solving as a Convex Program}
Although the objective function is not necessarily convex, gradient descent or incremental gradient descent are still commonly-used algorithms to learn the coefficients.
To clarify, gradient-based methods are not different from the famous backpropagation, which is essentially a way to compute the gradient value.

\subsection{Formal Description}
Having the convex programming framework, the main tasks of implementing a learner include:
(a) choose a subset of algorithms;
(b) implement the related computation logic for the objective function, e.g., gradient.

For multilayer perceptron, we choose incremental gradient descent (IGD).
In the remaining part of this section, we will give a formal description of the derivation of objective function and its gradient.

\paragraph{Objective function.}
We mostly follow the notations in example 1.5.3 from Bertsekas \cite{bertsekas1999nonlinear}, for a multilayer perceptron that has $N$ layers (stages), and the $k^{th}$ stage has $n_k$ activation units ($\phi : \mathbb{R} \to \mathbb{R}$), the objective function for regression is given as
\[f_{(x, y)}(u) = \frac{1}{2} \|h(u, x) - y\|_2^2,\]
and for classification the objective function is given as
\[f_{(x, y)}(u) = \sum_i (\log(h_i(u, x)) * z_i + (1-\log(h_i(u, x))) *( 1- z_i) ,\]
where $x \in \mathbb{R}^{n_0}$ is the input vector, $y \in \mathbb{R}^{n_N}$ is the output vector (one hot encoded for classification),~\footnote{Of course, the objective function can be defined over a set of input-output vector pairs, which is simply given as the addition of the above $f$.}
and the coefficients are given as
\[u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\},\]
And are initialized from a uniform distribution as follows:
\[u_{k}^{sj} = uniform(-r,r),\]
where r is defined as follows:
\[r = \sqrt{\frac{6}{n_k+n_{k+1}}}\]
With regularization, an additional term enters the objective function, given as
\[\sum_{u_k^{sj}} \frac{1}{2} \lambda u_k^{sj2} \]
This still leaves $h : \mathbb{R}^{n_0} \to \mathbb{R}^{n_N}$ as an open item.
Let $o_k \in \mathbb{R}^{n_k}, k = 1,...,N$ be the output vector of the $k^{th}$ layer. Then we define $h(u, x) = o_N$, based on setting $o_0 = x$ and the $j^{th}$ component of $o_k$ is given in an iterative fashion as~\footnote{$o_k^0 \equiv 1$ is used to simplified the notations, and $o_k^0$ is not a component of $o_k$, for any $k = 0,...,N$.}
\[\begin{alignedat}{5}
    o_k^j = \phi \left( \sum_{s=0}^{n_{k-1}} o_{k-1}^s u_{k-1}^{sj} \right), &\quad k = 1,...,N, \; j = 1,...,n_k
\end{alignedat}\]

\paragraph{Gradient of the End Layer.}
Let's first handle $u_{N-1}^{st}, s = 0,...,n_{N-1}, t = 1,...,n_N$.
Let $y^t$ denote the $t^{th}$ component of $y \in \mathbb{R}^{n_N}$, and $h^t$ the $t^{th}$ component of output of $h$.
\[\begin{aligned}
    \frac{\partial f}{\partial u_{N-1}^{st}}
    &= \left( h^t(u, x) - y^t \right) \cdot \frac{\partial h^t(u, x)}{\partial u_{N-1}^{st}} \\
    &= \left( o_N^t - y^t \right) \cdot \frac{\partial o_N^t}{\partial u_{N-1}^{st}} \\
    &= \left( o_N^t - y^t \right) \cdot \frac{\partial \phi \left( \sum_{s=0}^{n_{N-1}} o_{N-1}^s u_{N-1}^{st} \right)}{\partial u_{N-1}^{st}} \\
    &= \left( o_N^t - y^t \right) \cdot \phi' \left( \sum_{s=0}^{n_{N-1}} o_{N-1}^s u_{N-1}^{st} \right) \cdot o_{N-1}^s \\
\end{aligned}\]
To ease the notation, let the input vector of the $j^{th}$ activation unit of the $(k+1)^{th}$ layer be
\[\mathit{net}_k^j =\sum_{s=0}^{n_{k-1}} o_{k-1}^s u_{k-1}^{sj},\]
where $k = 1,...,N, \; j = 1,...,n_k$, and note that $o_k^j =\phi(\mathit{net}_k^j)$. Finally, the gradient
\[\frac{\partial f}{\partial u_{N-1}^{st}} = \left( o_N^t - y^t \right) \cdot \phi' ( \mathit{net}_N^t ) \cdot o_{N-1}^s\]
For any $s = 0,...,n_{N-1}, t =1,...,n_N$, we are given $y^t$, and $o_N^t, \mathit{net}_N^t, o_{N-1}^s$ can be computed by forward iterating the network layer by layer (also called the feed-forward pass). Therefore, we now know how to compute the coefficients for the end layer $u_{N-1}^{st}, s = 0,...,n_{N-1}, t =1,...,n_N$.

\subsubsection{Backpropagation}
For inner (hidden) layers, it is more difficult to compute the partial derivative over the input of activation units (i.e., $\mathit{net}_k, k = 1,...,N-1$).
That said, $\frac{\partial f}{\partial \mathit{net}_N^t} = (o_N^t - y^t) \phi'(\mathit{net}_N^t)$ is easy, where $t = 1,...,n_N$, but $\frac{\partial f}{\partial \mathit{net}_k^j}$ is hard, where $k = 1,...,N-1, j = 1,..,n_k$.
This hard-to-compute statistic is referred to as \textit{delta error}, and let $\delta_k^j = \frac{\partial f}{\partial \mathit{net}_k^j}$, where $k = 1,...,N-1, j = 1,..,n_k$.
If this is solved, the gradient can be easily computed as follow
\[\frac{\partial f}{\partial u_{k-1}^{sj}} = \boxed{\frac{\partial f}{\partial \mathit{net}_k^j}} \cdot \frac{\partial \mathit{net}_k^j}{\partial u_{k-1}^{sj}} = \boxed{\delta_k^j} o_{k-1}^s,\]
where $k = 1,...,N-1, s = 0,...,n_{k-1}, j = 1,..,n_k$.
To solve this, we introduce the popular backpropagation below.

\paragraph{Error Back Propagation.}
Since we know how to compute $\delta_N^t, t = 1,...,n_N$, we try to compute $\delta_{k}^j, j = 1,...,n_{k}$, given $\delta_{k+1}^t, t = 1,...,n_{k+1}$, for any $k = 1,...,N-1$.
First,
\[
    \delta_{k}^j
    = \frac{\partial f}{\partial \mathit{net}_{k}^j}
    = \frac{\partial f}{\partial o_{k}^j} \cdot \frac{\partial o_{k}^j}{\partial \mathit{net}_{k}^j}
    = \frac{\partial f}{\partial o_{k}^j} \cdot \phi'(\mathit{net}_{k}^j)
\]
And here comes the only equation that is needed but the author, I (Aaron), do not understand but it looks reasonable and repeats in different online notes \cite{mlp_gradient_wisc},
\[\begin{alignedat}{5}
    \frac{\partial f}{\partial o_{k}^j} = \sum_{t=1}^{n_{k+1}} \left( \frac{\partial f}{\partial \mathit{net}_{k+1}^t} \cdot \frac{\partial \mathit{net}_{k+1}^t}{\partial o_{k}^j} \right),
    &\quad k = 1,...,N-1, \: j = 1,...,n_{k}
\end{alignedat}\]
Assuming the above equation is true, we can solve delta error backward iteratively
\[\begin{aligned}
    \delta_{k}^j
    &= \frac{\partial f}{\partial o_{k}^j} \cdot \phi'(\mathit{net}_{k}^j) \\
    &= \sum_{t=1}^{n_{k+1}} \left( \frac{\partial f}{\partial \mathit{net}_{k+1}^t} \cdot \frac{\partial \mathit{net}_{k+1}^t}{\partial o_{k}^j} \right) \cdot \phi'(\mathit{net}_{k}^j) \\
    &= \sum_{t=1}^{n_{k+1}} \left( \delta_{k+1}^t \cdot \frac{\partial \left( \sum_{s=0}^{n_{k}} o_{k}^s u_{k}^{st} \right) }{\partial o_{k}^j} \right) \cdot \phi'(\mathit{net}_{k}^j) \\
    &= \sum_{t=1}^{n_{k+1}} \left( \delta_{k+1}^t \cdot u_{k}^{jt} \right) \cdot \phi'(\mathit{net}_{k}^j) \\
\end{aligned}\]
To sum up, we need the following equation for error back propagation
\[\boxed{\delta_{k}^j = \sum_{t=1}^{n_{k+1}} \left( \delta_{k+1}^t \cdot u_{k}^{jt} \right) \cdot \phi'(\mathit{net}_{k}^j)}\]
where $k = 1,...,N-1$, and $j = 1,...,n_{k}$.

\subsubsection{The $\mathit{Gradient}$ Function}
\begin{algorithm}[mlp-gradient$(u, x, y)$] \label{alg:mlp-gradient}
\alginput{Coefficients $u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\}$,\\
start vector $x \in \mathbb{R}^{n_0}$,\\
end vector $y \in \mathbb{R}^{n_N}$,\\
activation unit $\phi : \mathbb{R} \to \mathbb{R}$}
\algoutput{Gradient value $\nabla f(u)$ that consists of components $\nabla f(u)_{k-1}^{sj} = \frac{\partial f}{\partial u_{k-1}^{sj}}$}
\begin{algorithmic}[1]
    \State $(\mathit{net}, o) \set$ \texttt{feed-forward}$(u, x, \phi)$
    \State $\delta_N \set$ \texttt{end-layer-delta-error}$(\mathit{net}, o, y, \phi')$
    \State $\delta \set$ \texttt{error-back-propagation}$(\delta_N, \mathit{net}, u, \phi')$
    \For{$k = 1,...,N$}
        \For{$s = 0,...,n_{k-1}$}
            \For{$j = 1,...,n_k$}
                \State $\nabla f(u)_{k-1}^{sj} \set \delta_k^j o_{k-1}^s$
                \Comment{Can be put together with the computation of delta $\delta$}
            \EndFor
        \EndFor
    \EndFor
    \State \Return $\nabla f(u)$
\end{algorithmic}
\end{algorithm}

\paragraph{Activation Units $\phi$.}
Common examples of activation units are
\[\begin{alignedat}{3}
\phi(\xi) &= \frac{1}{1 + e^{-\xi}}, &\quad \text{ (logistic function),}\\
\phi(\xi) &= \frac{e^{\xi} - e^{-\xi}}{e^{\xi} + e^{-\xi}}, &\quad \text{ (hyperbolic tangent function)}\\
\phi(\xi) &= max(x,0), &\quad \text{ (rectified linear function)}\\
\end{alignedat}\]

\begin{algorithm}[feed-forward$(u, x, \phi)$] \label{alg:feed-forward}
\alginput{Coefficients $u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\}$,\\
input vector $x \in \mathbb{R}^{n_0}$,\\
activation unit $\phi : \mathbb{R} \to \mathbb{R}$}
\algoutput{Input vectors $\mathit{net} = \{\mathit{net}_k^j \; | \; k = 1,...,N, \: j = 1,...,n_k\}$,\\
output vectors $o = \{o_k^j \; | \; k = 0,...,N, \: j = 0,...,n_k\}$}
\begin{algorithmic}[1]
    \For{$k = 0,...,N$}
        \State $o_k^0 \set 1$
    \EndFor
    \State $o_0 \set x$ \Comment{For all components $o_0^j, x^j, \; j = 1,...,n_0$}
    \For{$k = 1,...,N$}
        \For{$j = 1,...,n_k$}
            \State $\mathit{net}_k^j \set 0$
            \For{$s = 0,...,n_{k-1}$}
                \State $\mathit{net}_k^j \set \mathit{net}_k^j + o_{k-1}^s u_{k-1}^{sj}$
            \EndFor
            \State $o_k^j = \phi(\mathit{net}_k^j)$ \Comment{Where the activation function for the final layer is identity for regression and softmax for classification.}
        \EndFor
    \EndFor
    \State \Return $(\mathit{net}, o)$
\end{algorithmic}
\end{algorithm}

\clearpage
\begin{algorithm}[end-layer-delta-error$(\mathit{net}, o, y, \phi')$] \label{alg:end-layer-delta-error}
\alginput{Input vectors $\mathit{net} = \{\mathit{net}_k^j \; | \; k = 1,...,N, \: j = 1,...,n_k\}$,\\
output vectors $o = \{o_k^j \; | \; k = 0,...,N, \: j = 0,...,n_k\}$,\\
end vector $y \in \mathbb{R}^{n_N}$,\\
derivative of activation unit $\phi' : \mathbb{R} \to \mathbb{R}$}
\algoutput{End layer delta $\delta_N = \{\delta_N^t \; | \; t = 1,...,n_N\}$}
\begin{algorithmic}[1]
    \For{$t = 1,...,n_N$}
            \State $\delta_N^t \set (o_N^t - y^t)$ \Comment{This applies for identity activation and mean square error loss and softmax activation with cross entropy loss}
    \EndFor
    \State \Return $\delta_N$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}[error-back-propagation$(\delta_N, \mathit{net}, u, \phi')$] \label{alg:error-back-propagation}
\alginput{End layer delta $\delta_N = \{\delta_N^t \; | \; t = 1,...,n_N\}$,\\
input vectors $\mathit{net} = \{\mathit{net}_k^j \; | \; k = 1,...,N, \: j = 1,...,n_k\}$,\\
coefficients $u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\}$,\\
derivative of activation unit $\phi' : \mathbb{R} \to \mathbb{R}$}
\algoutput{Delta $\delta = \{\delta_k^j \; | \; k = 1,...,N, \: j = 1,...,n_k\}$}
\begin{algorithmic}[1]
    \For{$k = N-1,...,1$}
        \For{$j = 0,...,n_k$}
            \State $\delta_k^j \set 0$
            \For{$t = 1,...,n_{k+1}$}
                \State $\delta_k^j \set \delta_k^j + \delta_{k+1}^t u_k^{jt}$
            \EndFor
            \State $\delta_k^j \set \delta_k^j \phi'(\mathit{net}_k^j)$
        \EndFor
    \EndFor
    \State \Return $\delta$
\end{algorithmic}
\end{algorithm}

\begin{algorithm}[mlp-train-iteration$(X, Y, \eta)$] \label{alg:mlp-train-iteration}
\alginput{
start vectors $X_{i...m} \in \mathbb{R}^{n_0}$,\\
end vectors $Y_{i...m} \in \mathbb{R}^{n_N}$,\\
learning rate $\eta$,\\}
\algoutput{Coefficients $u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\}$}
\begin{algorithmic}[1]
    \State \texttt{Randomnly initialize u}
    \For{$i = 1,...,m$}
        \State $\nabla f(u) \set \texttt{mlp-gradient}(u,X_i,Y_i)$
        \State $u \set u - (\eta \nabla f(u) u + \lambda u)$
    \EndFor
    \State \Return $u$
\end{algorithmic}
\end{algorithm}

\clearpage
\begin{algorithm}[mlp-train-parallel$(X, Y, \eta, s, t)$] \label{alg:mlp-train-parallel}
\alginput{
start vectors $X_{i...m} \in \mathbb{R}^{n_0}$,\\
end vectors $Y_{i...m} \in \mathbb{R}^{n_N}$,\\
learning rate $\eta$,\\
segments $s$,\\
iterations $t$,\\}
\algoutput{Coefficients $u = \{ u_{k-1}^{sj} \; | \; k = 1,...,N, \: s = 0,...,n_{k-1}, \: j = 1,...,n_k\}$}
\begin{algorithmic}[1]
    \State \texttt{Randomnly initialize u}
    \For{$j = 1,...,s$}
        \State $X_j \set \texttt{subset-of-X}$
        \State $Y_j \set \texttt{subset-of-Y}$
    \EndFor
    \For{$i = 1,...,t$}
        \For{$j = 1,...,s$}
            \State $u_j \set copy(u)$
            \State $u_j \set \texttt{mlp-train-iteration}(X_j, Y_j, \eta)$
        \EndFor
        \State $u \set \texttt{weighted-avg}(u_{1...s})$
    \EndFor
    \State \Return $u$
\end{algorithmic}
\end{algorithm}


text:
void
dddsp_decimator_mulaw_init(struct dddsp_decimator_s* decimator, float min, float max)
{
	decimator->offset = -(max+min)*0.5f;
	decimator->scale = (max-min)/65535.0f;
	decimator->error = 0;
}

uint8_t
dddsp_decimator_mulaw_feed(struct dddsp_decimator_s* decimator, float input)
{
	uint8_t ret;

	input = (input + decimator->offset) / decimator->scale;
	input = dddsp_clampf(input, decimator->nanvalue, -32768.0f, 32767.0f);
	ret = linear2ulaw(decimator->error + input + 0.5f);

	// Noise shaping only works for linear decimation.
	//decimator->error = input - (float)ulaw2linear(ret);
	//decimator->error = decimator->error/4;
	return ret;
}

void
dddsp_decimator_uint8_init(struct dddsp_decimator_s* decimator, float min, float max)
{
	decimator->offset = -min;
	decimator->scale = (max-min)/255.0f;
	decimator->nanvalue = 127.0f;
	decimator->error = 0;
}

uint8_t
dddsp_decimator_uint8_feed(struct dddsp_decimator_s* decimator, float input)
{
	uint8_t ret;

	input = (input + decimator->offset) / decimator->scale;
	input = dddsp_clampf(input, decimator->nanvalue, 0.0f, 255.0f);
	ret = (decimator->error + input + 0.5f);
	decimator->error = input - (float)ret;

	return ret;
}

void
dddsp_decimator_int8_init(struct dddsp_decimator_s* decimator, float min, float max)
{
	decimator->offset = -(max+min)*0.5f;
	decimator->scale = (max-min)/255.0f;
	decimator->nanvalue = 0;
	decimator->error = 0;
}

int8_t dddsp_decimator_int8_feed(struct dddsp_decimator_s* decimator, float input)
{
	int8_t ret;

	input = (input + decimator->offset) / decimator->scale;
	input = dddsp_clampf(input, decimator->nanvalue, -128.0f, 127.0f);
	ret = (decimator->error + input + 0.5f);
	decimator->error = input - (float)ret;

	return ret;
}

void
dddsp_decimator_uint16_init(struct dddsp_decimator_s* decimator, float min, float max)
{
	decimator->offset = -min;
	decimator->scale = (max-min)/65535.0f;
	decimator->error = 0;
}

uint16_t
dddsp_decimator_uint16_feed(struct dddsp_decimator_s* decimator, float input)
{
	uint16_t ret;

	input = (input + decimator->offset) / decimator->scale;
	input = dddsp_clampf(input, decimator->nanvalue, 0.0f, 65535.0f);
	ret = (decimator->error + input + 0.5f);
	decimator->error = input - (float)ret;

	return ret;
}

void
dddsp_decimator_int16_init(struct dddsp_decimator_s* decimator, float min, float max)
{
	decimator->offset = -(max+min)*0.5f;
	decimator->scale = (max-min)/65535.0f;
	decimator->error = 0;
}

int16_t
dddsp_decimator_int16_feed(struct dddsp_decimator_s* decimator, float input)
{
	int16_t ret;

	input = (input + decimator->offset) / decimator->scale;
	input = dddsp_clampf(input, decimator->nanvalue, -32768.0f, 32767.0f);
	ret = (decimator->error + input + 0.5f);
	decimator->error = input - (float)ret;

	return ret;
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Trichodiscula lesdaini Vouaux

### Remarks
null


text:
#include <aws/lambda/model/ListVersionsByFunctionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

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

ListVersionsByFunctionResult::ListVersionsByFunctionResult()
{
}

ListVersionsByFunctionResult::ListVersionsByFunctionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

ListVersionsByFunctionResult& ListVersionsByFunctionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("NextMarker"))
  {
    m_nextMarker = jsonValue.GetString("NextMarker");

  }

  if(jsonValue.ValueExists("Versions"))
  {
    Array<JsonView> versionsJsonList = jsonValue.GetArray("Versions");
    for(unsigned versionsIndex = 0; versionsIndex < versionsJsonList.GetLength(); ++versionsIndex)
    {
      m_versions.push_back(versionsJsonList[versionsIndex].AsObject());
    }
  }

  return *this;
}


text:
namespace Scheduler
{
	class ChainRunValidationAlgorithm : public RunValidationAlgorithm
	{
	public:
		virtual void validate(const Run& run, ViolationsConsumer& violations_consumer) const override;

		constexpr static const char* staticGetName( )
		{
			return "Chain";
		}
		virtual const char* getName( ) const override
		{
			return staticGetName( );
		}

		virtual void addAlgorithm(const RunValidationAlgorithm& algorithm);

	private:
		std::list<ReferenceWrapper<const RunValidationAlgorithm>> algorithms;
	};
}


text:
'use strict';

// Declare app level module which depends on filters, and services
angular.module('hardDriveApp', [
  'restangular',
  'ngRoute',
  'ngAnimate',
  'myApp.filters',
  'myApp.services',
  'myApp.directives',
  'myApp.controllers'
]).
config(['$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) {
  $routeProvider.when('/', {
      templateUrl: 'partials/hard-drive-table-partial.html',
      controller: 'TableCtrl'
    }
  );
  $routeProvider.when('/log', {
    templateUrl: 'partials/event-log-partial.html',
    controller: 'EventLogCtrl'
    }
  );
  $routeProvider.otherwise({redirectTo: '/'});

  //Enable cross domain calls
  // $httpProvider.defaults.useXDomain = true;
}]);


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Title</title>

' +
    '
'


text:
package com.jayantkrish.jklol.training;

import java.util.List;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.jayantkrish.jklol.evaluation.Example;
import com.jayantkrish.jklol.models.dynamic.DynamicAssignment;
import com.jayantkrish.jklol.models.parametric.SufficientStatistics;
import com.jayantkrish.jklol.util.Assignment;

/**
 * Adapts a {@code Trainer} that takes examples of {@code DynamicAssignment}s to
 * accept other inputs, using a conversion from the other inputs to
 * {@code DynamicAssignment}s.
 *
 * @author jayantk
 */
public class TrainerAdapter<T, E> implements Trainer<T, E> {

  private final Trainer<T, Example<DynamicAssignment, DynamicAssignment>> trainer;
  private final Function<E, Example<DynamicAssignment, DynamicAssignment>> converter;

  public TrainerAdapter(Trainer<T, Example<DynamicAssignment, DynamicAssignment>> trainer,
      Function<E, Example<DynamicAssignment, DynamicAssignment>> converter) {
    this.trainer = Preconditions.checkNotNull(trainer);
    this.converter = Preconditions.checkNotNull(converter);
  }

  /**
   * Gets a {@code TrainerAdapter} that transforms
   * {@code Example<Assignment, Assignment>} examples to
   * {@code Example<DynamicAssignment, DynamicAssignment>}.
   *
   * @param trainer
   * @return
   */
  public static <T> TrainerAdapter<T, Example<Assignment, Assignment>> createAssignmentAdapter(
      Trainer<T, Example<DynamicAssignment, DynamicAssignment>> trainer) {
    return new TrainerAdapter<T, Example<Assignment, Assignment>>(trainer, new ExampleConverter());
  }

  public SufficientStatistics train(T modelFamily,
      SufficientStatistics initialParameters, Iterable<E> trainingData) {

    // This code performs the conversion once up front, which is presumably more
    // efficient. However, it is also possible to simply pass the transformed
    // iterable to the underlying trainer.
    List<Example<DynamicAssignment, DynamicAssignment>> dynamicData =
        Lists.newArrayList(Iterables.transform(trainingData, converter));

    return trainer.train(modelFamily, initialParameters, dynamicData);
  }

  /**
   * Class for converting {@code Example}s containing {@code DynamicAssignment}s
   * to {@code Example}s containing {@code Assignment}s. This is a very common
   * operation.
   *
   * @author jayantk
   */
  private static class ExampleConverter implements Function<Example<Assignment, Assignment>,
      Example<DynamicAssignment, DynamicAssignment>> {

    @Override
    public Example<DynamicAssignment, DynamicAssignment> apply(
        Example<Assignment, Assignment> example) {
      return Example.create(DynamicAssignment.fromAssignment(example.getInput()),
          DynamicAssignment.fromAssignment(example.getOutput()));
    }
  }
}