text:
/*
 * DataSample.h
 *
 * Author: Samuel Schulter, Paul Wohlhart, Christian Leistner, Amir Saffari, Peter M. Roth, Horst Bischof
 * Institution: Graz, University of Technology, Austria
 *
 */

#ifndef LABELLEDSAMPLE_H_
#define LABELLEDSAMPLE_H_

#include <fstream>

//namespace
//{

template<typename Sample, typename Label>
class LabelledSample
{
public:

	/**
	 * Constructor for a LabelledSample. It should take a Sample, a Label, a weight and a global index.
	 * CAUTION: the given weight here is irrelevant as the weight for a sample has moved to the Label class.
	 *
	 * @param[in] insample features
	 * @param[in] inlabel label
	 * @param[in] inweight for the sample [depricated???]
	 * @param[in] inglobalindex an index of that sample in a global context, e.g., a complete data set
	 */
    explicit LabelledSample(Sample insample, Label inlabel, double inweight, int inglobalindex) :
    		m_sample(insample), m_label(inlabel), m_weight(inweight), m_global_index(inglobalindex)
    {
    }

    ~LabelledSample() { }

    void Save(std::ofstream& out);
    void Load(std::ifstream& in);

    // =======================================================
    // members
    Sample m_sample;
    Label m_label;
    double m_weight;
    int m_global_index;
};

//}

#include "LabelledSample.cpp"

#endif /* LABELLEDSAMPLE_H_ */


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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.apache.felix</groupId>
        <artifactId>felix-parent</artifactId>
        <version>2.1</version>
        <relativePath>../../../pom/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.apache.felix.ipojo.handler.event-admin-handler-project</artifactId>
    <version>1.9.0-SNAPSHOT</version>
    <name>Apache Felix iPOJO Event Admin Handler Project</name>
    <packaging>pom</packaging>

    <modules>
        <module>eventadmin-handler</module>
        <module>eventadmin-handler-it</module>
    </modules>

</project>

redpajama_set_name: RedPajamaGithub


text:
package java.beans;

/**
 * The PropertyEditorManager can be used to locate a property editor for
 * any given type name.  This property editor must support the
 * java.beans.PropertyEditor interface for editing a given object.
 *

 * The PropertyEditorManager uses three techniques for locating an editor
 * for a given type.  First, it provides a registerEditor method to allow
 * an editor to be specifically registered for a given type.  Second it
 * tries to locate a suitable class by adding "Editor" to the full
 * qualified classname of the given type (e.g. "foo.bah.FozEditor").
 * Finally it takes the simple classname (without the package name) adds
 * "Editor" to it and looks in a search-path of packages for a matching
 * class.
 *

 * So for an input class foo.bah.Fred, the PropertyEditorManager would
 * first look in its tables to see if an editor had been registered for
 * foo.bah.Fred and if so use that.  Then it will look for a
 * foo.bah.FredEditor class.  Then it will look for (say)
 * standardEditorsPackage.FredEditor class.
 *

 * Default PropertyEditors will be provided for the Java primitive types
 * "boolean", "byte", "short", "int", "long", "float", and "double"; and
 * for the classes java.lang.String. java.awt.Color, and java.awt.Font.
 */

public class PropertyEditorManager {

    /**
     * Registers an editor class to edit values of the given target class.
     * If the editor class is {@code null},
     * then any existing definition will be removed.
     * Thus this method can be used to cancel the registration.
     * The registration is canceled automatically
     * if either the target or editor class is unloaded.
     *

     * If there is a security manager, its {@code checkPropertiesAccess}
     * method is called. This could result in a {@linkplain SecurityException}.
     *
     * @param targetType   the class object of the type to be edited
     * @param editorClass  the class object of the editor class
     * @throws SecurityException  if a security manager exists and
     *                            its {@code checkPropertiesAccess} method
     *                            doesn't allow setting of system properties
     *
     * @see SecurityManager#checkPropertiesAccess
     */
    public static void registerEditor(Class<?> targetType, Class<?> editorClass) {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPropertiesAccess();
        }
        ThreadGroupContext.getContext().getPropertyEditorFinder().register(targetType, editorClass);
    }

    /**
     * Locate a value editor for a given target type.
     *
     * @param targetType  The Class object for the type to be edited
     * @return An editor object for the given target class.
     * The result is null if no suitable editor can be found.
     */
    public static PropertyEditor findEditor(Class<?> targetType) {
        return ThreadGroupContext.getContext().getPropertyEditorFinder().find(targetType);
    }

    /**
     * Gets the package names that will be searched for property editors.
     *
     * @return  The array of package names that will be searched in
     *          order to find property editors.
     *
     The default value for this array is implementation-dependent,
     *         e.g. Sun implementation initially sets to  {"sun.beans.editors"}.
     */
    public static String[] getEditorSearchPath() {
        return ThreadGroupContext.getContext().getPropertyEditorFinder().getPackages();
    }

    /**
     * Change the list of package names that will be used for
     *          finding property editors.
     *
     *
First, if there is a security manager, its checkPropertiesAccess
     * method is called. This could result in a SecurityException.
     *
     * @param path  Array of package names.
     * @exception  SecurityException  if a security manager exists and its
     *             checkPropertiesAccess method doesn't allow setting
     *              of system properties.
     * @see SecurityManager#checkPropertiesAccess
     */
    public static void setEditorSearchPath(String[] path) {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPropertiesAccess();
        }
        ThreadGroupContext.getContext().getPropertyEditorFinder().setPackages(path);
    }
}


text:
package api

import (
	"github.com/crockeo/power-ranker/schema"
	"github.com/crockeo/power-ranker/util"
	"github.com/crockeo/spider"
	"github.com/jinzhu/gorm"
	"net/http"
)

// postPlayersAddRequest represents the input the client ought to send.
type postPlayersAddRequest struct {
	Username string `json:"username"`
}

// postPlayersAddResponse represents the possible responses from this function.
type postPlayersAddResponse struct {
	Error   bool   `json:"error"`
	Success bool   `json:"success"`
	Message string `json:"message"`
}

// postPlayersAdd handles the /api/protected/players/add route. If given the
// proper data (with the proper authorization) it will register a new player.
func postPlayersAdd(ctx *spider.Ctx, w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json")

	req := postPlayersAddRequest{}
	err := util.ReadJSON(r.Body, &req)
	if err != nil {
		w.WriteHeader(400)
		util.UWriteJSON(w, postPlayersAddResponse{
			Error:   true,
			Success: false,
			Message: "Malformed request.",
		})

		return
	}

	db, _ := (*ctx)["db"].(*gorm.DB)

	players := []schema.Player{}
	db.Find(&players, schema.Player{
		Username: req.Username,
	})

	if len(players) != 0 {
		w.WriteHeader(200)
		util.UWriteJSON(w, postPlayersAddResponse{
			Error:   false,
			Success: false,
			Message: "That user already exists.",
		})

		return
	}

	db.Create(&schema.Player{
		Username: req.Username,
		Score:    0,
		Wins:     0,
		Losses:   0,
	})

	w.WriteHeader(200)
	util.UWriteJSON(w, postPlayersAddResponse{
		Error:   false,
		Success: true,
		Message: "Registered a new player",
	})
}


text:
package stroom.dashboard.expression.v1;

import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;

import java.util.function.Supplier;

abstract class AbstractAggregateFunction extends AbstractManyChildFunction implements AggregateFunction {

    private final Calculator calculator;

    AbstractAggregateFunction(final String name, final Calculator calculator) {
        super(name, 1, Integer.MAX_VALUE);
        this.calculator = calculator;
    }

    @Override
    public Generator createGenerator() {
        // If we only have a single param then we are operating in aggregate
        // mode.
        if (isAggregate()) {
            final Generator childGenerator = functions[0].createGenerator();
            return new AggregateGen(childGenerator, calculator);
        }

        return super.createGenerator();
    }

    @Override
    protected Generator createGenerator(final Generator[] childGenerators) {
        return new Gen(childGenerators, calculator);
    }

    @Override
    public boolean isAggregate() {
        return functions.length == 1;
    }

    private static final class AggregateGen extends AbstractSingleChildGenerator {

        private final Calculator calculator;

        private Val current = ValNull.INSTANCE;

        AggregateGen(final Generator childGenerator, final Calculator calculator) {
            super(childGenerator);
            this.calculator = calculator;
        }

        @Override
        public void set(final Val[] values) {
            childGenerator.set(values);
            current = calculator.calc(current, childGenerator.eval(null));
        }

        @Override
        public Val eval(final Supplier<ChildData> childDataSupplier) {
            return current;
        }

        @Override
        public void merge(final Generator generator) {
            final AggregateGen aggregateGen = (AggregateGen) generator;
            current = calculator.calc(current, aggregateGen.current);
            super.merge(generator);
        }

        @Override
        public void read(final Input input) {
            super.read(input);
            current = ValSerialiser.read(input);
        }

        @Override
        public void write(final Output output) {
            super.write(output);
            ValSerialiser.write(output, current);
        }
    }

    private static final class Gen extends AbstractManyChildGenerator {

        private final Calculator calculator;

        Gen(final Generator[] childGenerators, final Calculator calculator) {
            super(childGenerators);
            this.calculator = calculator;
        }

        @Override
        public void set(final Val[] values) {
            for (final Generator gen : childGenerators) {
                gen.set(values);
            }
        }

        @Override
        public Val eval(final Supplier<ChildData> childDataSupplier) {
            Val value = ValNull.INSTANCE;
            for (final Generator gen : childGenerators) {
                final Val val = gen.eval(childDataSupplier);
                if (!val.type().isValue()) {
                    return val;
                }
                value = calculator.calc(value, val);
            }
            return value;
        }
    }
}


text: To be updated


text:
package com.soteradefense.datawake.trails.sql

/**
 * Case class that defines basic jdbc credentials
 * @param jdbc jdbc string
 * @param username username to use
 * @param password password to use
 */
case class SqlCredentials(jdbc: String, username: String, password: String)


text:
using Augustus.Domain.Objects;
using System.Collections.Generic;
using System;
using Augustus.Web.Portal.Interfaces;

namespace Augustus.Web.Portal.ViewModels
{
    public class InvoiceWriteViewModel : ISharedLayoutViewModel, IWriteModelView<Invoice>, IOpportunityDropDown
    {
        public Breadcrumb Breadcrumb { get; set; }
        public string Title { get; set; }
        public FormButtons FormButtons { get; set; }
        public Invoice Invoice { get; set; }
        public Invoice DomainModel
        {
            get { return Invoice; }
            set { Invoice = value; }
        }

        public Guid OpportunityId { get; set; }
        public IEnumerable<Opportunity> OpportunityLookup { get; set; }
    }
}


text:
package net.jnickg.acamedia.strg;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Files;
import java.util.*;

import net.jnickg.acamedia.fil.*;

public abstract class Storage
		extends File
{
	// For implementation of Serializable interface
	private static final long serialVersionUID = 1L;

	/* Variable Members */
	private	Set<Item>				contents; // Items held directly inside the storage
	private	Set<Folder>				folders; // All labels must be unique

	private Map<String, Set<Item>>	titleMap;
	private Map<String, Set<Item>>	metadataMap;

	/* Constructors */
	public Storage(File parent, String fldr)
	{
		// Make the file and
		super(parent, fldr);
		if(!this.exists()) this.mkdir();

		// Initialize guts
		contents = new TreeSet<>();
		folders = new TreeSet<>();

		// Initialize maps
		titleMap = new HashMap<>();
		metadataMap = new HashMap<>();
	}

	/* General methods */
	protected void saveAll(PrintStream out)
	{
		// Save own-level contents
		for(Item i: contents)
		{
			i.saveFile(out);
		}
	}

	protected void saveAllSubs(PrintStream out)
	{
		this.saveAll(out);

		// invoke save method for each folder
		for(Folder f: folders)
		{
			f.saveAllSubs(out);
		}
	}

	public void autoDetect(PrintStream out)
	{
		File[] guts = this.listFiles();
		for(File f: guts)
		{
			if(f.isDirectory()) addSubfolder(f.getName());
			else if(f.isFile()) addItem(f, out);
		}
	}

	public void autoDetectSubs(PrintStream out)
	{
		this.autoDetect(out);
		for(Folder f: folders)
		{
			f.autoDetectSubs(out);
		}
	}

	public int compareTo(Storage other)
	{
		return this.getName().compareTo(other.getName());
	}

	private void addToSetMap(Map<String, Set<Item>> disMap, Item disValue, String... disKey)
	{
		for(String k: disKey)
		{
			if(!(disMap.containsKey(k)))
			{
				Set<Item> temp = new TreeSet<>();
				temp.add(disValue);
				disMap.put(k, temp);
			}
			else
			{
				Set<Item> temp = disMap.get(k);
				temp.add(disValue);
				disMap.put(k, temp);
			}
		}
	}

	private void addToSetMap(Map<String, Set<Item>> disMap, Item disValue, Map<String, String> disKey)
	{
		for(String k: disKey.values())
		{
			if(!(disMap.containsKey(k)))
			{
				Set<Item> temp = new TreeSet<>();
				temp.add(disValue);
				disMap.put(k, temp);
			}
			else
			{
				Set<Item> temp = disMap.get(k);
				temp.add(disValue);
				disMap.put(k, temp);
			}
		}
	}

	public void printAll(PrintStream out)
	{
		printAll(out, "");
	}

	protected void printAll(PrintStream out, String indent)
	{
		out.println(indent + this.getName() + "\\");
		if (this.hasContents())
		{
			out.println(indent + "  [Contents:]");
			for(Item i: this.getContents())
				out.println(indent + "    " + i.print(indent + "    "));
		}
		if (this.hasSubfolders())
		{
			out.println(indent + "  [Directories:]");
			for(Folder f: this.getSubfolders())
			{
				//out.println(indent + "    " + f.toString() + "\\");
				f.printAll(out, indent + "    ");
			}
		}
	}

	/* Contents methods */
	//TODO Revamp the contents methods
	public Collection<Item> contentsForKeyword(String keyword)
	{
		// TODO return items in this level only, which fit the kw
		return null;
	}

	public Collection<Item> allContentsForKeyword(String keyword)
	{
		// TODO return all items in Cabinet which fit the kw
		return null;
	}

	public Collection<Item> contentsForTitle(String title)
	{
		return titleMap.get(title);
//		if(titleMap.containsKey(title)) return titleMap.get(title);
//		else return null;
	}

	public Collection<Item> allContentsForTitle(String title)
	{
		List<Item> rtn = new ArrayList<>();

		// Add all for title on this level
		Collection<Item> toadd = contentsForTitle(title);
		if (!(toadd==null)) rtn.addAll(toadd);

		// If there are deeper levels, add all for those levels
		if (this.hasSubfolders())
		{
			for(Folder f: this.getSubfolders())
			{
				rtn.addAll(f.allContentsForTitle(title));
			}
		}

		return rtn;
	}

	public Boolean hasContents()
	{
		if (contents.isEmpty()) return false;
		else return true;
	}

	public Set<Item> getContents()
	{
		return contents;
	}

	public Collection<Item> getAllContents()
	{
		List<Item> allContents = new ArrayList<>(contents);
		if (this.hasSubfolders())
			for (Folder f: folders)
			{
				Collection<Item> subcontents = f.getAllContents();
				for(Item i: subcontents)
				{
					allContents.add(i);
				}
			}
		return allContents;
	}

	/* Folders methods */
	public Boolean hasSubfolders()
	{
		if (folders.isEmpty()) return false;
		else return true;
	}

	public Collection<Folder> getSubfolders()
	{
		return folders;
	}

	public Folder addSubfolder(String lbl)
	{
		// Create new folder with given properties
		Folder nf = new Folder(this, lbl);

		// Add new folder to appropriate maps
		folders.add(nf);

		return nf;
	}

	/* New Item Methods */
	public Item addItem(File f, PrintStream out)
	{
		out.println("\nAttempting to add new item: " + f.getName());
		Item new1;
		try
		{
			String ext = Files.probeContentType(f.toPath());
			ItemType it = ItemType.matchType(ext);
			out.println("filetype of " + f.getName() + ":\n\t\"" + ext + "\" aka \"" + it + "\"");
			new1 = it.makeInstance(f);
			contents.add(new1);

			//TODO use new1 to employ addToSetMap method, to add new1 to maps
			addToSetMap(titleMap, new1, new1.getName());
			addToSetMap(metadataMap, new1, new1.getMetadata());
		}
		// Files.probeContentType failed due to
		// an I/O error
		catch(IOException e)
		{
			out.println(e.getMessage());
			out.println(e.getStackTrace());
			new1 = null;
		}
		// The ItemType.matchType failed because
		// the filetype is not yet supported.
		catch(IllegalArgumentException e)
		{
			out.println(e.getMessage());
			out.println(e.getStackTrace());
			new1 = null;
		}
		return new1;
	}

	public void initContents(PrintStream out)
	{
		for(Item i: contents)
		{
			i.pullMetadata(out);
		}
	}
}


text:
from flask import Flask, jsonify, g
from flask.ext.httpauth import HTTPBasicAuth
from app.server.Models.User import User
from app import app, db

auth = HTTPBasicAuth()

@app.route('/auth/token')
@auth.login_required
def get_auth_token():
    token = g.user.generate_auth_token(secret=app.config['SECRET_KEY'])
    return jsonify({ 'token': token.decode('ascii') })

@auth.verify_password
def verify_password(username_or_token, password):
    # first try to authenticate by token
    user = User.verify_auth_token(username_or_token, db.users, secret=app.config['SECRET_KEY'])
    if not user:
        # try to authenticate with username/password
        user = db.users.get_by_email(username_or_token)
        if not user or not user.verify_password(password):
            return False
    g.user = user
    return True


text:
package com.intellij.lang.documentation;

import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public interface ExternalDocumentationProvider {
  @Nullable
  String fetchExternalDocumentation(final Project project, PsiElement element, final List<String> docUrls);

  /**
   * Quick check for existence of external documentation for specified element. Called from action update, so must be fast.
   * If not implemented, update check is performed by calling {@link DocumentationProvider#getUrlFor(com.intellij.psi.PsiElement, com.intellij.psi.PsiElement)}.
   *
   * @param element the element to check for existence of documentation
   * @param originalElement the element at caret (on which the action was invoked)
   * @return true if the external documentation action should be enabled, false otherwise.
   */
  boolean hasDocumentationFor(PsiElement element, PsiElement originalElement);

  /**
   * Checks if the provider is capable of asking the user to configure external documentation for an element.
   *
   * @param element the element for which no documentation was found
   * @return true if the element is applicable to this provider and the provider has a UI to configure the documentation location, false otherwise
   */
  boolean canPromptToConfigureDocumentation(PsiElement element);

  /**
   * Prompts the user to configure the external documentation for an element if none was found.
   *
   * @param element the element for which no documentation was found
   */
  void promptToConfigureDocumentation(PsiElement element);
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.massfords.test</groupId>
    <artifactId>jaxb-basic-codehaus</artifactId>
    <version>1.0</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <extension>true</extension>
                    <arguments>
                        <argument>-Xvisitor</argument>
                        <argument>-Xvisitor-package:org.example.visitor</argument>
                    </arguments>
                    <sources>
                        <source>
                            src/main/resources
                        </source>
                    </sources>
                    <outputDirectory>
                        ${project.build.directory}/generated-sources/xjc
                    </outputDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.massfords</groupId>
                        <artifactId>jaxb-visitor</artifactId>
                        <version>@project.version@</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>3.0.2</version>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>2.1.1</version>
        </dependency>
    </dependencies>
</project>


text:
using System;

namespace SiteCore
{
    /// <summary>
	/// Provides the friendly name of the app domain as the prefix in formatting a
	/// particular instance of a performance counter.
	/// </summary>
    public class AppDomainNameFormatter : IPerformanceCounterNameFormatter
    {
        /// <summary>
		/// Creates the formatted instance name for a performance counter, providing the Application
		/// Domain friendly name for the prefix for the instance.
		/// </summary>
		/// <param name="nameSuffix">Performance counter name, as defined during installation of the counter</param>
		/// <returns>Formatted instance name in form of "appDomainFriendlyName - nameSuffix"</returns>
		public string CreateName(string nameSuffix)
        {
			string appDomainFriendlyName = AppDomain.CurrentDomain.FriendlyName;
			PerformanceCounterInstanceName instanceName = new PerformanceCounterInstanceName(appDomainFriendlyName, nameSuffix);
			return instanceName.ToString();
        }
    }
}


text:
package org.objenesis;

/**
 * Exception thrown by Objenesis. It wraps any instantiation exceptions. Note that this exception is
 * runtime to prevent having to catch it.
 *
 * @author Henri Tremblay
 */
public class ObjenesisException extends RuntimeException {

   private static final long serialVersionUID = -2677230016262426968L;

   /**
    * @param msg Error message
    */
   public ObjenesisException(String msg) {
      super(msg);
   }

   /**
    * @param cause Wrapped exception. The message will be the one of the cause.
    */
   public ObjenesisException(Throwable cause) {
      super(cause);
   }

   /**
    * @param msg Error message
    * @param cause Wrapped exception
    */
   public ObjenesisException(String msg, Throwable cause) {
      super(msg, cause);
   }
}


text:
using System;
using DNX.Helpers.Console.Exceptions;
using NUnit.Framework;
using Shouldly;

namespace Test.DNX.Helpers.Console.Exceptions
{
    [TestFixture]
    public class ReturnCodeExceptionTests
    {
        [Test]
        public void Constructor_with_return_code_can_retain_values()
        {
            // Arrange
            const int returnCode = 42;

            // Act
            var ex = new ReturnCodeException(returnCode);

            // Assert
            ex.ShouldNotBeNull();
            ex.ReturnCode.ShouldBe(returnCode);
        }

        [Test]
        public void Constructor_with_return_code_and_message_can_retain_values()
        {
            // Arrange
            const int returnCode = 42;
            const string message = "Something went wrong";

            // Act
            var ex = new ReturnCodeException(returnCode, message);

            // Assert
            ex.ShouldNotBeNull();
            ex.ReturnCode.ShouldBe(returnCode);
            ex.Message.ShouldBe(message);
        }

        [Test]
        public void Constructor_with_return_code_and_message_and_inner_exception_can_retain_values()
        {
            // Arrange
            const int returnCode = 42;
            const string message = "Something went wrong";
            var innerException = new Exception();

            // Act
            var ex = new ReturnCodeException(returnCode, message, innerException);

            // Assert
            ex.ShouldNotBeNull();
            ex.ReturnCode.ShouldBe(returnCode);
            ex.Message.ShouldBe(message);
            ex.InnerException.ShouldBe(innerException);
        }
    }
}


text:
#ifndef __VIRT_CONVERT__
#define __VIRT_CONVERT__

/*
 * Macros used for converting between virtual and physical mappings.
 */

#ifdef __KERNEL__

#include <linux/config.h>
#include <linux/compiler.h>
#include <asm/setup.h>
#include <asm/page.h>

#ifdef CONFIG_AMIGA
#include <asm/amigahw.h>
#endif

/*
 * Change virtual addresses to physical addresses and vv.
 */
#ifndef CONFIG_SUN3
extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
#else
static inline unsigned long mm_vtop(unsigned long vaddr)
{
	return __pa(vaddr);
}

static inline unsigned long mm_ptov(unsigned long paddr)
{
	return (unsigned long)__va(paddr);
}
#endif

#ifdef CONFIG_SINGLE_MEMORY_CHUNK
static inline unsigned long virt_to_phys(void *vaddr)
{
	return (unsigned long)vaddr - PAGE_OFFSET + m68k_memory[0].addr;
}

static inline void * phys_to_virt(unsigned long paddr)
{
	return (void *)(paddr - m68k_memory[0].addr + PAGE_OFFSET);
}
#else
static inline unsigned long virt_to_phys(void *address)
{
	return mm_vtop((unsigned long)address);
}

static inline void *phys_to_virt(unsigned long address)
{
	return (void *) mm_ptov(address);
}
#endif

/* Permanent address of a page. */
#define __page_address(page)	(PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT))
#define page_to_phys(page)	virt_to_phys((void *)__page_address(page))

/*
 * IO bus memory addresses are 1:1 with the physical address,
 * except on the PCI bus of the Hades.
 */
#ifdef CONFIG_HADES
#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
#else
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
#endif

#endif
#endif


text:
package de.bastiankrol.startexplorer.handlers.delegates;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import de.bastiankrol.startexplorer.ResourceType;
import de.bastiankrol.startexplorer.crossplatform.Capabilities;
import de.bastiankrol.startexplorer.customcommands.CommandConfig;

/**
 * @author Bastian Krol
 */
public class CustomCommandForEditorHandlerDelegate extends
    AbstractStartFromEditorHandlerDelegate
{

  private CommandConfig commandConfig;

  /**
   * Creates a CustomCommandForResourceHandler for the given CommandConfig
   *
   * @param commandConfig the command configuration which, among other things,
   *          contains the command line string to execute by this handler
   */
  public CustomCommandForEditorHandlerDelegate(CommandConfig commandConfig)
  {
    this.commandConfig = commandConfig;
  }

  /**
   * Returns the Command Config for this handler
   *
   * @return the Command Config for this handler
   */
  protected CommandConfig getCommandConfig()
  {
    return this.commandConfig;
  }

  /**
   * {@inheritDoc}
   *
   * @see de.bastiankrol.startexplorer.handlers.AbstractStartFromEditorHandler#getResourceType()
   */
  protected ResourceType getResourceType()
  {
    return this.getCommandConfig().getResourceType();
  }

  /**
   * {@inheritDoc}
   *
   * @see de.bastiankrol.startexplorer.handlers.AbstractStartFromEditorHandler#doActionForFile(java.io.File)
   */
  @Override
  protected void doActionForFile(File file)
  {
    // TODO Maybe we need make it possible to define custom commands as an array
    // of Strings instead of one String?
    this.getRuntimeExecCalls().startCustomCommandForFile(
        new String[] { this.getCommandConfig().getCommand() }, file);
  }

  /**
   * {@inheritDoc}
   *
   * @see de.bastiankrol.startexplorer.handlers.AbstractStartFromEditorHandler#shouldInterpretTextSelectionAsFileName()
   */
  @Override
  protected boolean shouldInterpretTextSelectionAsFileName()
  {
    return !this.getCommandConfig().isPassSelectedText();
  }

  /**
   * {@inheritDoc}
   *
   * @see de.bastiankrol.startexplorer.handlers.AbstractStartFromEditorHandler#doActionForSelectedText(java.lang.String)
   */
  @Override
  protected void doActionForSelectedText(String selectedText)
      throws IOException
  {
    File tempFile = File.createTempFile("startexplorer_", null);
    FileWriter writer = new FileWriter(tempFile);
    writer.write(selectedText);
    writer.close();
    this.doActionForFile(tempFile);
  }

  @Override
  protected boolean areUrlsSupported(Capabilities capabilities)
  {
    // TODO Support URLs for custom commands

    // Regardless of the platform's capabilities, a custom command might be able
    // to cope with URLs or not, we do not know. For now we do not support URLs
    // for custom commands - until a user asks for it. Reason: Replacing
    // variables in custom commands needs to be implemented slightly different
    // when we want to support URLs in custom commands.

    // We could make this configurable in the custom command configuration
    // dialog and store it in preferences like in
    // #shouldInterpretTextSelectionAsFileName. OTOH, this makes the dialog more
    // complicated. We could also always return true and let the custom command
    // call break if it does not support URLs.

    return false;
  }

  /**
   * {@inheritDoc}
   *
   * @see de.bastiankrol.startexplorer.handlers.delegates.AbstractStartFromEditorHandlerDelegate#getAppropriateStartFromResourceHandlerDelegate()
   */
  @Override
  protected CustomCommandForResourceHandlerDelegate getAppropriateStartFromResourceHandlerDelegate()
  {
    return new CustomCommandForResourceHandlerDelegate(this.getCommandConfig());
  }
}


text:
$successPath = "./success/"
$failurePath = "./failure/"

rm *.txt
rm "${failurePath}*"
rm "${successPath}*"

gci ../ -Recurse -Filter "*.sln" | % {

  $solutionFilePath = $_.FullName
  $solutionFileName = $_.Name

  $containingDirectoryPath = [System.IO.Path]::GetDirectoryName($solutionFilePath)
  $parentDirectoryPath = (get-item $containingDirectoryPath).Parent.FullName

  Write-Host "ContainingDirectory: $containingDirectoryPath"
  Write-Host "ParentDirectory: $parentDirectoryPath"

  $containingDirectoryName = [System.IO.Path]::GetFileName($containingDirectoryPath)
  $parentDirectoryName = [System.IO.Path]::GetFileName($parentDirectoryPath)

  $buildOutputFile = "${parentDirectoryName}-${containingDirectoryName}-${solutionFileName}.build.txt"

  Write-Host "OutputFile: $buildOutputFile"

  nuget.exe restore $solutionFilePath

  If (! $?)
  {
    throw "Could not restore NuGet packages for $solutionFilePath"
  }

  msbuild $solutionFilePath > $buildOutputFile

  If ($?)
  {
    mv $buildOutputFile $successPath
  }
  Else
  {
    mv $buildOutputFile $failurePath
  }
}

$failureCount = (gci $failurePath).Count
$successCount = (gci $successPath).Count

Write-Host -BackgroundColor Red -ForegroundColor White "Failed: $failureCount"
Write-Host -ForegroundColor Green "Succeeded: $successCount"


text:
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using BotOnBot.Backend.Core;
using BotOnBot.Backend.DataModel;

namespace BotOnBot.Backend.Networking
{
    internal abstract class NetworkListener
    {
        private readonly int _port;
        protected readonly List<NetworkClient> _clients = new List<NetworkClient>();

        private TcpListener _listener;
        private bool _isListening;

        protected NetworkListener(int port)
        {
            _port = port;
            _isListening = false;
        }

        internal async Task StartListening()
        {
            _listener = new TcpListener(IPAddress.Any, _port);
            _listener.Start();
            _isListening = true;

            ConsoleLogger.LogGameEvent($"Starting listening on port {_port}");

            while (_isListening)
            {
                var client = await _listener.AcceptTcpClientAsync();
                await AddClient(client);
            }
        }

        internal void StopListening()
        {
            _listener.Stop();
            _isListening = false;
        }

        protected void ClientDisconnected(NetworkClient client)
        {
            client.Closed -= ClientDisconnected;
            _clients.Remove(client);
        }

        protected virtual async Task AddClient(TcpClient client) { }

        internal static string ResponseStatusToString(ResponseStatusType status)
            => status.ToString().ToUpperInvariant();
    }
}


text:
<?php
/**
 * TActiveFileUpload.php
 *
 * @author Bradley Booms <Bradley.Booms@nsighttel.com>
 * @author Christophe Boulain <Christophe.Boulain@gmail.com>
 * @author Gabor Berczi <gabor.berczi@devworx.hu> (issue 349 remote vulnerability fix)
 * @package System.Web.UI.ActiveControls
 */

/**
 * Load TActiveControlAdapter and TFileUpload.
 */
Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
Prado::using('System.Web.UI.WebControls.TFileUpload');

/**
 * TActiveFileUpload
 *
 * TActiveFileUpload displays a file upload field on a page. Upon postback,
 * the text entered into the field will be treated as the name of the file
 * that will be uploaded to the server. The property {@link getHasFile HasFile}
 * indicates whether the file upload is successful. If successful, the file
 * may be obtained by calling {@link saveAs} to save it at a specified place.
 * You can use {@link getFileName FileName}, {@link getFileType FileType},
 * {@link getFileSize FileSize} to get the original client-side file name,
 * the file mime type, and the file size information. If the upload is not
 * successful, {@link getErrorCode ErrorCode} contains the error code
 * describing the cause of failure.
 *
 * TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded
 * (whether it succeeds or not).
 *
 * TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback.
 * This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback
 * a status icon is displayed; either a green checkmark if the upload is successful,
 * or a red x if there was an error.
 *
 * @author Bradley Booms <Bradley.Booms@nsighttel.com>
 * @author Christophe Boulain <Christophe.Boulain@gmail.com>
 * @package System.Web.UI.ActiveControls
 */
class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
{

	const SCRIPT_PATH = 'prado/activefileupload';

	/**
	 * @var THiddenField a flag to tell which component is doing the callback.
	 */
	private $_flag;
	/**
	 * @var TImage that spins to show that the file is being uploaded.
	 */
	private $_busy;
	/**
	 * @var TImage that shows a green check mark for completed upload.
	 */
	private $_success;
	/**
	 * @var TImage that shows a red X for incomplete upload.
	 */
	private $_error;
	/**
	 * @var TInlineFrame used to submit the data in an "asynchronous" fashion.
	 */
	private $_target;

	/**
	 * Creates a new callback control, sets the adapter to
	 * TActiveControlAdapter. If you override this class, be sure to set the
	 * adapter appropriately by, for example, by calling this constructor.
	 */
	public function __construct(){
		parent::__construct();
		$this->setAdapter(new TActiveControlAdapter($this));
	}

	/**
	 * @param string asset file in the self::SCRIPT_PATH directory.
	 * @return string asset file url.
	 */
	protected function getAssetUrl($file='')
	{
		$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
		return $base.'/'.self::SCRIPT_PATH.'/'.$file;
	}

	/**
	 * This method is invoked when a file is uploaded.
	 * If you override this method, be sure to call the parent implementation to ensure
	 * the invocation of the attached event handlers.
	 * @param TEventParameter event parameter to be passed to the event handlers
	 */
	public function onFileUpload($param)
	{
		if ($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param == $this->_target->getUniqueID()){
			// save the file so that it will persist past the end of this return.
			$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
			parent::saveAs($localName);

			$params = new TActiveFileUploadCallbackParams;
			$params->localName = $localName;
			$params->fileName = addslashes($this->getFileName());
			$params->fileSize = $this->getFileSize();
			$params->fileType = $this->getFileType();
			$params->errorCode = $this->getErrorCode();

			// return some javascript to display a completion status.
			echo <<<EOS
<script language="Javascript">
	Options = new Object();
	Options.clientID = '{$this->getClientID()}';
	Options.targetID = '{$this->_target->getUniqueID()}';
	Options.fileName = '{$params->fileName}';
	Options.fileSize = '{$params->fileSize}';
	Options.fileType = '{$params->fileType}';
	Options.errorCode = '{$params->errorCode}';
	Options.callbackToken = '{$this->pushParamsAndGetToken($params)}';
	parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;

			exit();
		}
	}

	/**
	 * @return string the path where the uploaded file will be stored temporarily, in namespace format
	 * default "Application.runtime.*"
	 */
	public function getTempPath(){
		return $this->getViewState('TempPath', 'Application.runtime.*');
	}

	/**
	 * @param string the path where the uploaded file will be stored temporarily in namespace format
	 * default "Application.runtime.*"
	 */
	public function setTempPath($value){
		$this->setViewState('TempPath',$value,'Application.runtime.*');
	}

	/**
	 * @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
	 * Note: When set to false, you will need to trigger the callback yourself.
	 */
	public function getAutoPostBack(){
		return $this->getViewState('AutoPostBack', true);
	}

	/**
	 * @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
	 * Note: When set to false, you will need to trigger the callback yourself.
	 */
	public function setAutoPostBack($value){
		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
	}

	/**
	 * @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}
	 */
	public function getCallbackJavascript(){
		return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")";
	}

	/**
	 * @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable.
	 */
	public function onInit($sender){
		parent::onInit($sender);

		if (!Prado::getApplication()->getCache())
		  if (!Prado::getApplication()->getSecurityManager())
			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');

		if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){
			throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath());
		}
	}

	/**
	 * Raises <b>OnFileUpload</b> event.
	 *
	 * This method is required by {@link ICallbackEventHandler} interface.
	 * This method is mainly used by framework and control developers.
	 * @param TCallbackEventParameter the event parameter
	 */
 	public function raiseCallbackEvent($param){
 		$cp = $param->getCallbackParameter();
		if ($key = $cp->targetID == $this->_target->getUniqueID()){

			$params = $this->popParamsByToken($cp->callbackToken);

			$_FILES[$key]['name'] = stripslashes($params->fileName);
			$_FILES[$key]['size'] = intval($params->fileSize);
			$_FILES[$key]['type'] = $params->fileType;
			$_FILES[$key]['error'] = intval($params->errorCode);
			$_FILES[$key]['tmp_name'] = $params->localName;
			$this->loadPostData($key, null);

			$this->raiseEvent('OnFileUpload', $this, $param);
		}
	}

	/**
	 * Raises postdata changed event.
	 * This method calls {@link onFileUpload} method
	 * This method is primarily used by framework developers.
	 */
	public function raisePostDataChangedEvent()
	{
		$this->onFileUpload($this->getPage()->getRequest()->itemAt('TActiveFileUpload_TargetId'));
	}

	protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params)
	{
		if ($cache = Prado::getApplication()->getCache())
			{
				// this is the most secure method, file info can't be forged from client side, no matter what
				$token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000));
				$cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually
			}
		else
		if ($mgr = Prado::getApplication()->getSecurityManager())
			{
				// this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key
				$token = urlencode(base64_encode($mgr->encrypt(serialize($params))));
			}
		else
			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');

		return $token;
	}

	protected function popParamsByToken($token)
	{
		if ($cache = Prado::getApplication()->getCache())
			{
				$v = $cache->get($token);
				assert($v!='');
				$cache->delete($token); // remove it from cache so it can't be used again and won't take up space either
				$params = unserialize($v);
			}
		else
		if ($mgr = Prado::getApplication()->getSecurityManager())
			{
				$v = $mgr->decrypt(base64_decode(urldecode($token)));
				$params = unserialize($v);
			}
		else
			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');

		assert($params instanceof TActiveFileUploadCallbackParams);

		return $params;
	}

	/**
	 * Publish the javascript
	 */
	public function onPreRender($param)
	{
		parent::onPreRender($param);

		if(!$this->getPage()->getIsPostBack() && isset($_GET['TActiveFileUpload_InputId']) && isset($_GET['TActiveFileUpload_TargetId']) && $_GET['TActiveFileUpload_InputId'] == $this->getClientID())
		{
			// tricky workaround to intercept "uploaded file too big" error: real uploads happens in onFileUpload instead
			$this->_errorCode = UPLOAD_ERR_FORM_SIZE;
			$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
			$fileName = addslashes($this->getFileName());

			$params = new TActiveFileUploadCallbackParams;
			$params->localName = $localName;
			$params->fileName = $fileName;
			$params->fileSize = $this->getFileSize();
			$params->fileType = $this->getFileType();
			$params->errorCode = $this->getErrorCode();

			echo <<<EOS
<script language="Javascript">
	Options = new Object();
	Options.clientID = '{$_GET['TActiveFileUpload_InputId']}';
	Options.targetID = '{$_GET['TActiveFileUpload_TargetId']}';
	Options.fileName = '{$params->fileName}';
	Options.fileSize = '{$params->fileSize}';
	Options.fileType = '{$params->fileType}';
	Options.errorCode = '{$params->errorCode}';
	Options.callbackToken = '{$this->pushParamsAndGetToken($params)}';
	parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;
		}
	}

	public function createChildControls(){
		$this->_flag = Prado::createComponent('THiddenField');
		$this->_flag->setID('Flag');
		$this->getControls()->add($this->_flag);

		$this->_busy = Prado::createComponent('TImage');
		$this->_busy->setID('Busy');
		$this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif'));
		$this->_busy->setStyle("display:none");
		$this->getControls()->add($this->_busy);

		$this->_success = Prado::createComponent('TImage');
		$this->_success->setID('Success');
		$this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png'));
		$this->_success->setStyle("display:none");
		$this->getControls()->add($this->_success);

		$this->_error = Prado::createComponent('TImage');
		$this->_error->setID('Error');
		$this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png'));
		$this->_error->setStyle("display:none");
		$this->getControls()->add($this->_error);

		$this->_target = Prado::createComponent('TInlineFrame');
		$this->_target->setID('Target');
		$this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html'));
		$this->_target->setStyle("width:0px; height:0px;");
		$this->_target->setShowBorder(false);
		$this->getControls()->add($this->_target);
	}

	/**
	 * Removes localfile on ending of the callback.
	 */
	public function onUnload($param){
		if ($this->getPage()->getIsCallback() &&
			$this->getHasFile() &&
			file_exists($this->getLocalName())){
				unlink($this->getLocalName());
		}
		parent::onUnload($param);
	}

	/**
	 * @return TBaseActiveCallbackControl standard callback control options.
	 */
	public function getActiveControl(){
		return $this->getAdapter()->getBaseActiveControl();
	}

	/**
	 * @return TCallbackClientSide client side request options.
	 */
	public function getClientSide()
	{
		return $this->getAdapter()->getBaseActiveControl()->getClientSide();
	}

	/**
	 * Adds ID attribute, and renders the javascript for active component.
	 * @param THtmlWriter the writer used for the rendering purpose
	 */
	public function addAttributesToRender($writer){
		parent::addAttributesToRender($writer);
		$writer->addAttribute('id',$this->getClientID());

		$this->getPage()->getClientScript()->registerPradoScript('activefileupload');
		$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions());
	}

	/**
	 * @return string corresponding javascript class name for this control.
	 */
	protected function getClientClassName(){
		return 'Prado.WebUI.TActiveFileUpload';
	}

	/**
	 * Gets the client side options for this control.
	 * @return array (	inputID => input client ID,
	 * 					flagID => flag client ID,
	 * 					targetName => target unique ID,
	 * 					formID => form client ID,
	 * 					indicatorID => upload indicator client ID,
	 * 					completeID => complete client ID,
	 * 					errorID => error client ID)
	 */
	protected function getClientOptions(){
		$options['ID'] = $this->getClientID();
		$options['EventTarget'] = $this->getUniqueID();

		$options['inputID'] = $this->getClientID();
		$options['flagID'] = $this->_flag->getClientID();
		$options['targetID'] = $this->_target->getUniqueID();
		$options['formID'] = $this->getPage()->getForm()->getClientID();
		$options['indicatorID'] = $this->_busy->getClientID();
		$options['completeID'] = $this->_success->getClientID();
		$options['errorID'] = $this->_error->getClientID();
		$options['autoPostBack'] = $this->getAutoPostBack();
		return $options;
	}

	/**
	 * Saves the uploaded file.
	 * @param string the file name used to save the uploaded file
	 * @param boolean whether to delete the temporary file after saving.
	 * If true, you will not be able to save the uploaded file again.
	 * @return boolean true if the file saving is successful
	 */
	public function saveAs($fileName,$deleteTempFile=true){
		if (($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))){
			if ($deleteTempFile)
				return rename($this->getLocalName(),$fileName);
			else
				return copy($this->getLocalName(),$fileName);
		} else
			return false;
	}

	/**
	 * @return TImage the image displayed when an upload
	 * 		completes successfully.
	 */
	public function getSuccessImage(){
		$this->ensureChildControls();
		return $this->_success;
	}

	/**
	 * @return TImage the image displayed when an upload
	 * 		does not complete successfully.
	 */
	public function getErrorImage(){
		$this->ensureChildControls();
		return $this->_error;
	}

	/**
	 * @return TImage the image displayed when an upload
	 * 		is in progress.
	 */
	public function getBusyImage(){
		$this->ensureChildControls();
		return $this->_busy;
	}
}

/**
 * TActiveFileUploadCallbackParams is an internal class used by {@link TActiveFileUpload}.
 *
 * @author Bradley Booms <Bradley.Booms@nsighttel.com>
 * @author Christophe Boulain <Christophe.Boulain@gmail.com>
 * @package System.Web.UI.ActiveControls
 */
class TActiveFileUploadCallbackParams
{
	public $localName;
	public $fileName;
	public $fileSize;
	public $fileType;
	public $errorCode;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 7(1-4): 38 (1953)

#### Original name
Phyllosticta goebeliae Petr.

### Remarks
null


text:
<!doctype html>

      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
      <title>Heladería</title>
      <meta name="description" content="">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="apple-touch-icon" href="apple-touch-icon.png">

      <link rel="stylesheet" href="css/bootstrap.css">
      <link rel="stylesheet" href="css/main.css">

      <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

Bienvenido a la heladería

A continuación encontrará los pasos a seguir para realizar su pedido de un helado.

Pide tu helado »

Helados

Seleccione un helado a su gusto. Elija la cantidad de bolas, los sabores, cucurucho o tarrina.

Heladeros

Seleccione un heladero. El más cercano o el que lleve la marca de helados que más le apetezca.

Pago y valoración

Díganos qué le ha parecido su experiencia y si el helado estaba bueno.


text:
package com.jetbrains.python.validation;

import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.jetbrains.python.psi.PythonVisitorFilter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * Custom filter that allows to selectively suppress warnings and errors produced by pycodestyle.py (former pep8.py).
 * Note that by using {@link PythonVisitorFilter} you can disable PEP 8 inspection for concrete files
 * altogether.
 *
 * @author Mikhail Golubev
 * @see Pep8ExternalAnnotator
 * @see PythonVisitorFilter
 */
public interface Pep8ProblemSuppressor {
  ExtensionPointName<Pep8ProblemSuppressor> EP_NAME = ExtensionPointName.create("Pythonid.pep8ProblemSuppressor");

  /**
   * @param problem       a single problem returned by the script and extracted from its output
   * @param file          PSI file where the inspection operates
   * @param targetElement PSI element found in the place of a problem on which annotation is going be attached in the editor
   * @return whether notification about this problem should be hidden in the editor
   */
  boolean isProblemSuppressed(@NotNull Pep8ExternalAnnotator.Problem problem,
                              @NotNull PsiFile file,
                              @Nullable PsiElement targetElement);
}


text:
using namespace BeeeOn;

ControlDao::~ControlDao()
{
}


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.aperigeek.jlad.web.detector;

import com.aperigeek.jlad.detector.Detector;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Vivien Barousse
 */
@Stateless
public class DetectorService {

    @EJB
    private DetectorProvider provider;

    public String detectLanguage(String text) {
        Detector detector = provider.getDetector();
        return detector.detect(text);
    }

}


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

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/background_gray"
        android:orientation="vertical" >
        <include layout="@layout/include_titlebar"/>
        <ScrollView
		    android:layout_width="match_parent"
		    android:layout_height="wrap_content"
		    >
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                >
        <!-- 图书的信息 -->
    <LinearLayout
        android:id="@+id/ll_bookstatues"
        android:layout_width="match_parent"
        android:layout_height="112dp"
        android:layout_marginLeft="12dp"
	    android:layout_marginRight="12dp"
	    android:layout_marginBottom="4dp"
	    android:layout_marginTop="4dp"
	    android:background="@drawable/item_shape"
	    android:orientation="horizontal"
        >
        <FrameLayout
            android:layout_width="100dp"
            android:layout_height="112dp"
            android:layout_marginLeft="8dp"
            >

    <com.loopj.android.image.SmartImageView
        android:id="@+id/iv_bookpicture"
        android:layout_width="80dp"
        android:layout_height="104dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="4dp"
        android:scaleType="centerCrop"
        android:src="@drawable/bookpic"
        />
    <TextView
           android:id="@+id/tv_showstates"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_marginLeft="4dp"
           android:layout_marginTop="4dp"
           android:background="@drawable/shape_yellow_corner"
           android:paddingTop="2dp"
           android:paddingBottom="2dp"
           android:paddingLeft="6dp"
           android:paddingRight="6dp"
           android:textSize="10sp"
           android:textColor="@color/item_white"
           android:text="已预约"
           android:visibility="gone"
           />
    </FrameLayout>
    <LinearLayout
        android:id="@+id/rl_conent"
        android:layout_width="match_parent"
        android:layout_height="112dp"
        android:layout_marginLeft="16dp"
        android:orientation="vertical"
        >

        <TextView
            android:id="@+id/tv_booktitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Android应用开发案例教程"
            android:singleLine="true"
			android:ellipsize="end"
            android:textSize="16sp">
        </TextView>

        <TextView
            android:id="@+id/tv_bookauthor"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="毋建军"/>

        <TextView
            android:id="@+id/tv_publish"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="清华大学出版社"
            />

        <TextView
            android:id="@+id/tv_booknumber"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="索书号:"
            />

    </LinearLayout>
	</LinearLayout>
        <!-- 四个图片按钮 -->
	<LinearLayout
            android:id="@+id/ll_fourimagebutton"
	        android:layout_width="match_parent"
	        android:layout_height="40dp"
	        android:layout_marginRight="12dp"
	        android:layout_marginLeft="12dp"
	        android:layout_marginBottom="4dp"
	        android:background="@color/txt_gray"
	        android:orientation="horizontal"
	        >

	        <ImageButton
	            android:id="@+id/ib_borrowed"
	            style="@style/ImageButton"
	            android:clickable="false"
	            android:background="@drawable/borrowbuttom_shape"
	            />

	        <ImageButton
	            android:id="@+id/ib_return"
	            style="@style/ImageButton"
	            android:clickable="false"
	            android:background="@drawable/returnbutton_shape"
	            />

	        <ImageButton
	            android:id="@+id/ib_order"
	            style="@style/ImageButton"
	            android:clickable="false"
	            android:background="@drawable/orderbutton_shape"
	            />

	        <ImageButton
	            android:id="@+id/ib_favorite2"
	            style="@style/ImageButton"
	            android:clickable="false"
	            android:background="@drawable/detail_shape"
	            />

	        <ImageButton
	            android:id="@+id/ib_cancelfavorate"
	            style="@style/ImageButton"
	            android:clickable="false"
	            android:background="@drawable/cancel_favorite_shape"
	            android:visibility="gone"

	            />
	    </LinearLayout>
	    <include layout="@layout/include_returnrecords"/>

	    <include layout="@layout/include_collectioninfo"/>
	    </LinearLayout>
        </ScrollView>
    </LinearLayout>


text: export declare const basic: void;


text:
%  MbedTarget Simulink target
%  Copyright (c) 2014-2017 Dr.O.Hagendorf , HS Wismar
%
%  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.

function mbed_make_rtw_hook(hookMethod, modelName, rtwroot, templateMakefile, buildOpts, buildArgs)
% MBED_MAKE_RTW_HOOK

%   Copyright 1996-2014 The MathWorks, Inc.
%             2014-2017 Dr. Olaf Hagendorf, HS Wismar

switch hookMethod
    case 'error'
        % Called if an error occurs anywhere during the build.  If no error occurs
        % during the build, then this hook will not be called.  Valid arguments
        % at this stage are hookMethod and modelName. This enables cleaning up
        % any static or global data used by this hook file.
        disp(['### Build procedure for model: ''' modelName ''' aborted due to an error.(' hookMethod ')']);

    case 'entry'
        % Called at start of code generation process (before anything happens.)
        % Valid arguments at this stage are hookMethod, modelName, and buildArgs.
        %disp('entry');
        i_mbed_setup(modelName);
        %disp('entry out');

    case 'before_tlc'
        % Called just prior to invoking TLC Compiler (actual code generation.)
        % Valid arguments at this stage are hookMethod, modelName, and
        % buildArgs
        %disp('before_tlc');

    case 'after_tlc'
        % Called just after to invoking TLC Compiler (actual code generation.)
        % Valid arguments at this stage are hookMethod, modelName, and
        % buildArgs
        %disp('after_tlc');

        % Safely check if model contains property 'UseRTOS'
        param = get_param(modelName, 'ObjectParameters');
        if isfield(param,'UseRTOS')
            rtos = strcmp(get_param(gcs,'UseRTOS'),'off');
        else
            rtos = false;
        end

        if ~rtos    % Multitasking is possible with RTOS only
            % This check must be done after the model has been compiled otherwise
            % sample time may not be valid
            i_check_tasking_mode(modelName)
        end

    case 'before_make'
        % Called after code generation is complete, and just prior to kicking
        % off make process (assuming code generation only is not selected.)  All
        % arguments are valid at this stage.
        %disp('before_make');
        i_write_mbed_files();
        disp(sprintf(['\n### Code Format : %s'],buildOpts.codeFormat));%#ok
        %disp('before_make out');

    case 'after_make'
        % Called after make process is complete. All arguments are valid at
        % this stage.
        %disp('after_make');
        if ( strcmp(get_param(gcs,'DownloadApplication'),'on') )
            downloadApplication = 1;
        else
            downloadApplication = 0;
        end
        downloadMethod = get_param(gcs,'DownloadMethod');

        if ~i_isPilSim && ~i_isModelReferenceBuild(modelName) && downloadApplication
            %disp('i_download');
            i_download(modelName, downloadApplication, downloadMethod)
        end
        %disp('after_make out');

    case 'exit'
        % Called at the end of the build process.  All arguments are valid at this
        % stage.
        rtw = RTW.GetBuildDir(modelName);
        if i_isPilSim
            fileDis = fullfile(rtw.BuildDirectory, 'pil', 'disassembly.txt');
            fileMap = fullfile(rtw.BuildDirectory, 'pil', 'mapFile.map');
        else
            fileDis = fullfile(rtw.BuildDirectory, 'disassembly.txt');
            fileMap = fullfile(rtw.BuildDirectory, 'mapFile.map');
        end
        %fprintf('### Disassembling project code into disassembly.txt\n', fileDis);
        %fprintf('### Linker Map file mapFile.map\n', fileMap);

        disp(['### Successful completion of build procedure for model: ', modelName]);
end
end

function i_mbed_setup(modelName)

if ~i_isPilSim
    % Check that the main function will be generated using the correct .tlc file
    if bdIsLoaded(modelName) && ~i_isModelReferenceBuild(modelName)
        requiredSetting = 'mbed_file_process.tlc';
        assert(strcmp(get_param(modelName, 'ERTCustomFileTemplate'), requiredSetting),...
            'The model %s must have ERTCustomFileTemplate set to %s.', modelName, requiredSetting);
    end
end

mbedautodetect = get_param(bdroot,'MbedlsAutodetect');
if isequal(mbedautodetect, 'on')
    [MbedDrive, ComPort, MbedTarget5] = mbed_mbedls();
    if strlength(MbedDrive) > 1
        set_param(bdroot,'MbedDrive', MbedDrive);
        set_param(bdroot,'ComPort', ComPort);
        set_param(bdroot,'MbedTarget5', MbedTarget5);
    else
        error('mbedls did not detect a target or more than one target is connected');
    end
end

mbedtarget = get_param(bdroot,'MbedTarget5');
disp(['### Starting mbed build procedure for ', 'model: ',modelName, ' Target: ', mbedtarget]);

if ~isempty(strfind(pwd,' ')) || ~isempty(strfind(pwd,'&'))
    error('RTW:mbed:pwdHasSpaces',...
        ['The current working folder, %s, contains either a space or ' ...
        'ampersand character. This is '...
        'not supported. You must change the current working folder to '...
        'a path that does not contain either of these characters.'], pwd);
end

libraryversion='';
try
    fid=fopen(fullfile(mbed_getTargetRootPath(), 'targets', 'mbed-os', 'mbed.h'), 'r');
    text = textscan(fid,'%s','Delimiter','','endofline','');
    text = text{1}{1};
    fclose(fid);
    libraryversion = regexp(text,'MBED_LIBRARY_VERSION[\s\.=]+(\d+)','tokens');
    libraryversion=string(libraryversion);
catch ME
end

% Display current settings in build log
disp('###')
disp('### mbed environment settings:')
disp('###')
fprintf('###     Name:            %s\n', mbedtarget);
fprintf('###     Version:         %s, library version %s\n', 'Mbed-OS 5', libraryversion);
fprintf('###     RTOS:            %s\n', get_param(bdroot,'UseMbedRTOS'));
fprintf('###     Fixed step size: %ss\n', get_param(bdroot,'FixedStep'));
fprintf('###     # of Make jobs:  %s\n', get_param(bdroot,'MakeJobs'));
fprintf('###     mbed Drive:      %s\n', get_param(bdroot,'MbedDrive'));
fprintf('###     Com Port:        %s\n', get_param(bdroot,'ComPort'));
fprintf('###     Programmer:      %s\n', mbed.Prefs.getMbedProgrammer()); %get_param(bdroot,'MbedProgrammer'))
additionalProjectFiles = get_param(bdroot,'MbedAddProjectFiles');
if ~isequal(additionalProjectFiles,'none')
    [buildAreaDstFolder, folder] = mbed_getTargetDestFolder();
fprintf('###     add. project file: %s\n', fullfile(buildAreaDstFolder, [folder '.xxx']));
end
disp('###')
end

function i_check_tasking_mode(modelName)
% No support for multi tasking mode
if ~i_isModelReferenceBuild(modelName)  &&  ~i_isPilSim
    solverMode = get_param(modelName,'SolverMode');
    st = get_param(modelName,'SampleTimes');
    if length(st)>1 && ~strcmp(solverMode,'SingleTasking')
        error('RTW:mbed:noMultiTaskingSupport',...
            ['The multi-tasking solver mode is not supported for the real-time '...
            'mbed target. '...
            'In Simulation > Configuration Parameters > Solver you must select '...
            '"SingleTasking" from the pulldown "Tasking mode for periodic sample '...
            'times".']);
    end
end
end

function i_write_mbed_files()

    [~,modelName,~] = fileparts( which (bdroot));

    target = get_param(bdroot,'MbedTarget5');

    %    pathstr = mbed_getTargetRootPath();
    %    buildAreaDstFolder = fullfile(pathstr,'targets',[modelName '_slprj']);
    [buildAreaDstFolder, folder] = mbed_getTargetDestFolder();
    additionalProjectFiles = fullfile(buildAreaDstFolder, [folder '.*']);
    if exist(buildAreaDstFolder, 'dir')
        try
            delete(fullfile(buildAreaDstFolder,'BUILD','*.*'));
        catch
        end
        try
            rmdir(fullfile(buildAreaDstFolder,'BUILD'), 's');
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.c'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.cpp'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.h'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.mk'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.bat'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'*.json'));
        catch
        end
        try
            delete(fullfile(buildAreaDstFolder,'.mbedignore'));
        catch
        end
        try
            delete(additionalProjectFiles);
        catch
        end
    else
        mkdir (buildAreaDstFolder);
    end
    mkdir(fullfile(buildAreaDstFolder,'BUILD'));

    % copy generated code/header/makefile into the build area under
    % mbed_target/targets/modelName+'_slprj'
    lCodeGenFolder = Simulink.fileGenControl('getConfig').CodeGenFolder;
    path = fullfile(lCodeGenFolder, [modelName '_slprj']);
    try
        srcFile = fullfile(path, '*.c');
        copyfile(srcFile, buildAreaDstFolder);
    catch
    end
    try
        srcFile = fullfile(path, '*.cpp');
        copyfile(srcFile, buildAreaDstFolder);
    catch
    end
    try
        srcFile = fullfile(path, '*.h');
        copyfile(srcFile, buildAreaDstFolder);
    catch
    end
    try
        srcFile = fullfile(path, '*.mk');
        copyfile(srcFile, buildAreaDstFolder);
    catch
    end
    try
        srcFile = fullfile(path, 'Makefile');
        copyfile(srcFile, buildAreaDstFolder);
    catch
    end

    targetconfig = get_param(bdroot,'MbedAppConfig');
    if ~isempty(targetconfig)
        path = fullfile(mbed_getTargetRootPath(), 'targets', 'appconfig', targetconfig);
        try
            srcFile = fullfile(path, '*.*');
            copyfile(srcFile, buildAreaDstFolder);
        catch
        end
    end

    % generate make file with mbed tools
    oldpath=cd(buildAreaDstFolder);

    destFile = fullfile(buildAreaDstFolder,'.mbedignore');
    ret = exist(destFile,'file');
    srcFile = fullfile(mbed_getTargetRootPath(), 'targets', 'appconfig', '.mbedignore');
    if ret == 0
        copyfile(srcFile, buildAreaDstFolder);
    elseif ret == 2
        system(['copy ' srcFile '+' fullfile(buildAreaDstFolder,'.mbedignore') ' ' fullfile(buildAreaDstFolder,'.mbedignore.tmp')]);
        try
            delete(fullfile(buildAreaDstFolder,'.mbedignore'));
        catch
        end
        try
            movefile(fullfile(buildAreaDstFolder,'.mbedignore.tmp'), fullfile(buildAreaDstFolder,'.mbedignore'));
        catch
        end
    end

    [~,cmdout]=system(['python ..\mbed-os\tools\project.py -m ' target ' -i simulink --source . --source ..\mbed-os --source ..\libraries']);

    % generate additional project config files for µVision, IAR, ...
    additionalProjectFiles = get_param(bdroot,'MbedAddProjectFiles');
    if ~isequal(additionalProjectFiles,'none')
      [~,cmdout]=system(['python ..\mbed-os\tools\project.py -m ' target ' -i ' additionalProjectFiles ' --source . --source ..\mbed-os --source ..\libraries']);
    end
    cd(oldpath);
    disp(cmdout);

end

function i_download(modelName, bFlash, flashMethod)
    pathstr = mbed_getTargetDestFolder();
    srcname = fullfile(pathstr, 'BUILD', [modelName '.bin']);

if bFlash && strcmp(flashMethod,'mbed')
    destname = get_param(modelName,'MbedDrive');
    try
        disp(['copy ' srcname ' to ' destname]);
        [status,message,~] = copyfile(srcname,destname,'f');
        if status==0
            disp(message);
        end
    catch err
        disp(err);
    end
elseif bFlash
    cmd = [fullfile(mbed_getTargetRootPath(), 'targets_flash', [flashMethod '.bat'])];
    cmd = [cmd ' ' '"' srcname '"'];
    cmd = [cmd ' ' '"' mbed_getTargetRootPath() '"'];
    cmd = [cmd ' ' '"' get_param(modelName,'MbedDrive') '"'];
    cmd = [cmd ' ' '"' get_param(modelName,'ComPort') '"'];
    system(cmd,'-echo')
end
end

function isPilSim = i_isPilSim
s = dbstack;
isPilSim = false;
for i=1:length(s)
    if strfind(s(i).name,'build_pil_target')
        isPilSim=true;
        break;
    end
end
end

function isMdlRefBuild = i_isModelReferenceBuild(modelName)
mdlRefTargetType = get_param(modelName, 'ModelReferenceTargetType');
isMdlRefBuild = ~strcmp(mdlRefTargetType, 'NONE');
end


text:
package com.sevenbridges.apiclient.impl.ds;

import java.io.InputStream;
import java.util.Map;

public interface MapMarshaller {

  String marshal(Map map);

  Map unmarshal(String marshalled);

  Map<String, Object> unmarshall(InputStream inputStream);

}


text:
<?php

namespace DvsaEntities\Entity;

use Doctrine\ORM\Mapping as ORM;
use DvsaEntities\EntityTrait\CommonIdentityTrait;

/**
 * ApplicationForAuthorisationTestingMot.
 *
 * @ORM\Table(name="app_for_auth_testing_mot", uniqueConstraints={@ORM\UniqueConstraint(name="id_UNIQUE", columns={"id"})}, indexes={@ORM\Index(name="fk_app_for_auth_testing_mot_2_idx", columns={"auth_for_testing_mot_id"}), @ORM\Index(name="fk_app_for_auth_testing_mot_3_idx", columns={"status_id"}), @ORM\Index(name="fk_app_for_auth_testing_mot_4_idx", columns={"created_by"}), @ORM\Index(name="fk_app_for_auth_testing_mot_5_idx", columns={"last_updated_by"}), @ORM\Index(name="fk_app_for_auth_testing_mot_1_idx", columns={"application_id"})})
 * @ORM\Entity
 */
class ApplicationForAuthorisationTestingMot extends Entity
{
    use CommonIdentityTrait;

    /**
     * @var \DvsaEntities\Entity\Application
     *
     * @ORM\ManyToOne(targetEntity="DvsaEntities\Entity\Application")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="application_id", referencedColumnName="id")
     * })
     */
    private $application;

    /**
     * @var \DvsaEntities\Entity\AuthorisationForTestingMot
     *
     * @ORM\ManyToOne(targetEntity="DvsaEntities\Entity\AuthorisationForTestingMot")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="auth_for_testing_mot_id", referencedColumnName="id")
     * })
     */
    private $authorisationForTestingMot;

    /**
     * @var \DvsaEntities\Entity\AuthorisationForTestingMotStatus
     *
     * @ORM\ManyToOne(targetEntity="DvsaEntities\Entity\AuthorisationForTestingMotStatus")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="status_id", referencedColumnName="id")
     * })
     */
    private $status;

    /**
     * Set application.
     *
     * @param \DvsaEntities\Entity\Application $application
     *
     * @return ApplicationForAuthorisationTestingMot
     */
    public function setApplication(\DvsaEntities\Entity\Application $application = null)
    {
        $this->application = $application;

        return $this;
    }

    /**
     * Get application.
     *
     * @return \DvsaEntities\Entity\Application
     */
    public function getApplication()
    {
        return $this->application;
    }

    /**
     * Set authorisationForTestingMot.
     *
     * @param \DvsaEntities\Entity\AuthorisationForTestingMot $authorisationForTestingMot
     *
     * @return ApplicationForAuthorisationTestingMot
     */
    public function setAuthorisationForTestingMot(
        \DvsaEntities\Entity\AuthorisationForTestingMot $authorisationForTestingMot = null
    ) {
        $this->authorisationForTestingMot = $authorisationForTestingMot;

        return $this;
    }

    /**
     * Get authorisationForTestingMot.
     *
     * @return \DvsaEntities\Entity\AuthorisationForTestingMot
     */
    public function getAuthorisationForTestingMot()
    {
        return $this->authorisationForTestingMot;
    }

    /**
     * @param AuthorisationForTestingMotStatus $status
     *
     * @return $this
     */
    public function setStatus(AuthorisationForTestingMotStatus $status = null)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status.
     *
     * @return AuthorisationForTestingMotStatus
     */
    public function getStatus()
    {
        return $this->status;
    }
}


text:
package com.gsvic.csmr;

import org.apache.hadoop.io.ArrayWritable;
import org.apache.hadoop.io.Writable;
import org.apache.mahout.math.VectorWritable;

public class VectorArrayWritable extends ArrayWritable {

    public VectorArrayWritable(){
        super(VectorWritable.class);
    }
    public VectorArrayWritable(VectorWritable[] values) {
        super(VectorWritable.class,values);
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<site-template>
  <display-name>Bluman Site Template</display-name>
  <description>Demo site template for portals</description>
  <url>http://enonic.net</url>
  <vendor>
    <name>Enonic AS</name>
    <url>http://www.enonic.com</url>
  </vendor>
  <modules>
    <module>bluman.trampoline-1.0.0</module>
    <module>xslt-1.0.0</module>
    <module>com.enonic.comments-0.9.1</module>
    <module>com.enonic.image-1.0.0</module>
  </modules>
  <content-filter/>
  <root-content-type>trampoline</root-content-type>
</site-template>


text:
package pflag

import (
	"fmt"
	"net"
	"strconv"
)

// -- net.IPMask value
type ipMaskValue net.IPMask

func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
	*p = val
	return (*ipMaskValue)(p)
}

func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
func (i *ipMaskValue) Set(s string) error {
	ip := ParseIPv4Mask(s)
	if ip == nil {
		return fmt.Errorf("failed to parse IP mask: %q", s)
	}
	*i = ipMaskValue(ip)
	return nil
}

func (i *ipMaskValue) Type() string {
	return "ipMask"
}

// ParseIPv4Mask written in IP form (e.g. 255.255.255.0).
// This function should really belong to the net package.
func ParseIPv4Mask(s string) net.IPMask {
	mask := net.ParseIP(s)
	if mask == nil {
		if len(s) != 8 {
			return nil
		}
		// net.IPMask.String() actually outputs things like ffffff00
		// so write a horrible parser for that as well  :-(
		m := []int{}
		for i := 0; i < 4; i++ {
			b := "0x" + s[2*i:2*i+2]
			d, err := strconv.ParseInt(b, 0, 0)
			if err != nil {
				return nil
			}
			m = append(m, int(d))
		}
		s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3])
		mask = net.ParseIP(s)
		if mask == nil {
			return nil
		}
	}
	return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])
}

func parseIPv4Mask(sval string) (interface{}, error) {
	mask := ParseIPv4Mask(sval)
	if mask == nil {
		return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval)
	}
	return mask, nil
}

// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name
func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
	val, err := f.getFlagType(name, "ipMask", parseIPv4Mask)
	if err != nil {
		return nil, err
	}
	return val.(net.IPMask), nil
}

// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
// The argument p points to an net.IPMask variable in which to store the value of the flag.
func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
	f.VarP(newIPMaskValue(value, p), name, "", usage)
}

// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
	f.VarP(newIPMaskValue(value, p), name, shorthand, usage)
}

// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
// The argument p points to an net.IPMask variable in which to store the value of the flag.
func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
	CommandLine.VarP(newIPMaskValue(value, p), name, "", usage)
}

// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
	CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)
}

// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
// The return value is the address of an net.IPMask variable that stores the value of the flag.
func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {
	p := new(net.IPMask)
	f.IPMaskVarP(p, name, "", value, usage)
	return p
}

// IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
	p := new(net.IPMask)
	f.IPMaskVarP(p, name, shorthand, value, usage)
	return p
}

// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
// The return value is the address of an net.IPMask variable that stores the value of the flag.
func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
	return CommandLine.IPMaskP(name, "", value, usage)
}

// IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash.
func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
	return CommandLine.IPMaskP(name, shorthand, value, usage)
}


text:
package cn.edu.hdu.infosys.util;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import com.google.gson.Gson;

import cn.edu.hdu.infosys.model.netease.ag.FiveDayAGData;

/**
 * 测试,待完善
 *
 * @ClassName: HttpRequestUtil
 * @Description: TODO
 * @author Pi Chen
 * @date 2016年8月11日 下午8:02:07
 */
public class HttpRequestUtil
{

    private Gson gson = new Gson();

    public static void main(String[] args)
    {
        new HttpRequestUtil().requestByGetMethod();
    }

    /**
     * GET方式
     */

    public void requestByGetMethod()
    {

        CloseableHttpClient httpClient = getHttpClient();
        try
        {

            HttpGet get = new HttpGet(
                "http://fa.163.com/interfaces/ngxcache/priceinfo/min/getDay5PriceList.do?partnerId=njs&goodsId=AG&"
                    + "v=" + System.currentTimeMillis());
            System.out.println("执行get请求:...." + get.getURI());
            CloseableHttpResponse httpResponse = null;

            httpResponse = httpClient.execute(get);
            try
            {

                HttpEntity entity = httpResponse.getEntity();
                if (null != entity)
                {
                    System.out.println("响应状态码:" + httpResponse.getStatusLine());

                    // System.out.println("响应内容:" +
                    // EntityUtils.toString(entity));
                    FiveDayAGData data = gson.fromJson(EntityUtils.toString(entity),
                        FiveDayAGData.class);
                    System.out.println(data.getVersion());

                }
            }
            finally
            {
                httpResponse.close();
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        finally
        {
            try
            {
                closeHttpClient(httpClient);
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }

    }

    /**
     * POST
     */

    public void requestByPostMethod()
    {
        CloseableHttpClient httpClient = getHttpClient();
        try
        {
            HttpPost post = new HttpPost("http://localhost/....");

            List<NameValuePair> list = new ArrayList<NameValuePair>();
            list.add(new BasicNameValuePair("j_username", "admin"));
            list.add(new BasicNameValuePair("j_password", "admin"));

            UrlEncodedFormEntity uefEntity = new UrlEncodedFormEntity(list, "UTF-8");
            post.setEntity(uefEntity);
            System.out.println("POST 请求...." + post.getURI());

            CloseableHttpResponse httpResponse = httpClient.execute(post);
            try
            {
                HttpEntity entity = httpResponse.getEntity();
                if (null != entity)
                {

                    System.out.println(EntityUtils.toString(uefEntity));

                }
            }
            finally
            {
                httpResponse.close();
            }

        }
        catch (UnsupportedEncodingException e)
        {
            e.printStackTrace();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        finally
        {
            try
            {
                closeHttpClient(httpClient);
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }

    }

    private CloseableHttpClient getHttpClient()
    {
        return HttpClients.createDefault();
    }

    private void closeHttpClient(CloseableHttpClient client) throws IOException
    {
        if (client != null)
        {
            client.close();
        }
    }
}


text:
package org.yatech.sqlitedb.codegen.impl;

import java.util.List;
import java.util.Map;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.yatech.sqlitedb.codegen.model.Column;
import org.yatech.sqlitedb.codegen.model.ColumnConstraint;
import org.yatech.sqlitedb.codegen.model.DataType;
import org.yatech.sqlitedb.codegen.model.Database;
import org.yatech.sqlitedb.codegen.model.DefaultValueColumnConstraint;
import org.yatech.sqlitedb.codegen.model.ForeignKeyColumnConstraint;
import org.yatech.sqlitedb.codegen.model.ForeignKeyTableConstraint;
import org.yatech.sqlitedb.codegen.model.IndexedColumn;
import org.yatech.sqlitedb.codegen.model.NotNullColumnConstraint;
import org.yatech.sqlitedb.codegen.model.OrderDirection;
import org.yatech.sqlitedb.codegen.model.PrimaryKeyColumnConstraint;
import org.yatech.sqlitedb.codegen.model.PrimaryKeyTableConstraint;
import org.yatech.sqlitedb.codegen.model.Table;
import org.yatech.sqlitedb.codegen.model.TableConstraint;
import org.yatech.sqlitedb.codegen.model.UniqueColumnConstraint;
import org.yatech.sqlitedb.codegen.model.UniqueTableConstraint;
import org.yatech.sqlitedb.codegen.model.Visitor;

class DatabaseToJsonObjectConverter implements Visitor {

	private Object result;

	public Object getResult() {
		return result;
	}

	@SuppressWarnings("unchecked")
	public void visit(Database database) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Database.DATABASE_NAME, database.getName());
		jsonObject.put(JsonModelConstants.Database.TABLES, tableListToJsonArray(database.getTables()));
		putIfValueNotNull(jsonObject, JsonModelConstants.Database.GENERATION_SETTINGS, generationSettingsToJsonObject(database.getGenerationSettings()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	private JSONObject generationSettingsToJsonObject(Map<String, Object> generationSettings) {
		JSONObject jsonObject = new JSONObject();
		if (generationSettings != null) {
			jsonObject.putAll(generationSettings);
		}
		return jsonObject.isEmpty() ? null : jsonObject;
	}

	@SuppressWarnings("unchecked")
	private JSONArray tableListToJsonArray(List<Table> tables) {
		JSONArray jsonArray = new JSONArray();
		if (tables != null) {
			for (Table table : tables) {
				table.accept(this);
				jsonArray.add(result);
			}
		}
		return jsonArray;
	}

	@SuppressWarnings("unchecked")
	public void visit(Table table) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Table.TABLE_NAME, table.getName());
		jsonObject.put(JsonModelConstants.Table.COLUMNS, columnListToJsonArray(table.getColumns()));
		putIfValueNotNull(jsonObject, JsonModelConstants.Table.CONSTRAINTS, tableConstraintListToJsonArray(table.getConstraints()));
		putIfValueNotNull(jsonObject, JsonModelConstants.Table.GENERATION_SETTINGS, generationSettingsToJsonObject(table.getGenerationSettings()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	private JSONArray columnListToJsonArray(List<Column> columns) {
		JSONArray jsonArray = new JSONArray();
		if (columns != null) {
			for (Column column : columns) {
				column.accept(this);
				jsonArray.add(result);
			}
		}
		return jsonArray;
	}

	@SuppressWarnings("unchecked")
	private JSONArray tableConstraintListToJsonArray(List<TableConstraint> constraints) {
		JSONArray jsonArray = new JSONArray();
		if (constraints != null) {
			for (TableConstraint constraint : constraints) {
				constraint.accept(this);
				jsonArray.add(result);
			}
		}
		return jsonArray.isEmpty() ? null : jsonArray;
	}

	@SuppressWarnings("unchecked")
	public void visit(PrimaryKeyTableConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_PRIMARY_KEY);
		jsonObject.put(JsonModelConstants.Constraint.COLUMNS, indexedColumnListToJsonArray(constraint.getColumns()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(ForeignKeyTableConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_FOREIGN_KEY);
		jsonObject.put(JsonModelConstants.Constraint.COLUMNS, stringListToJsonArray(constraint.getColumnNames()));
		jsonObject.put(JsonModelConstants.Constraint.FOREIGN_TABLE, constraint.getForeignTableName());
		jsonObject.put(JsonModelConstants.Constraint.FOREIGN_COLUMNS, stringListToJsonArray(constraint.getForeignColumnNames()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	private Object stringListToJsonArray(List<String> strings) {
		JSONArray jsonArray = new JSONArray();
		if (strings != null) {
			jsonArray.addAll(strings);
		}
		return jsonArray;
	}

	@SuppressWarnings("unchecked")
	public void visit(UniqueTableConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_UNIQUE);
		jsonObject.put(JsonModelConstants.Constraint.COLUMNS, indexedColumnListToJsonArray(constraint.getColumns()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	private Object indexedColumnListToJsonArray(List<IndexedColumn> columns) {
		JSONArray jsonArray = new JSONArray();
		if (columns != null) {
			for (IndexedColumn column : columns) {
				column.accept(this);
				jsonArray.add(result);
			}
		}
		return jsonArray;
	}

	@SuppressWarnings("unchecked")
	public void visit(IndexedColumn indexedColumn) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.INDEXED_COLUMN_NAME, indexedColumn.getColumnName());
		OrderDirection orderDirection = indexedColumn.getOrderDirection();
		if (orderDirection != null) {
			jsonObject.put(JsonModelConstants.Constraint.ORDER_DIRECTION, orderDirection.toString());
		}
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(Column column) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Column.COLUMN_NAME, column.getName());
		DataType type = column.getType();
		if (type != null) {
			jsonObject.put(JsonModelConstants.Column.DATA_TYPE, type.toString());
		}
		putIfValueNotNull(jsonObject, JsonModelConstants.Column.CONSTRAINTS, columnConstraintListToJsonArray(column.getConstraints()));
		putIfValueNotNull(jsonObject, JsonModelConstants.Column.GENERATION_SETTINGS, generationSettingsToJsonObject(column.getGenerationSettings()));
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	private Object columnConstraintListToJsonArray(List<ColumnConstraint> constraints) {
		JSONArray jsonArray = new JSONArray();
		if (constraints != null) {
			for (ColumnConstraint constraint : constraints) {
				constraint.accept(this);
				jsonArray.add(result);
			}
		}
		return jsonArray.isEmpty() ? null : jsonArray;
	}

	@SuppressWarnings("unchecked")
	public void visit(PrimaryKeyColumnConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_PRIMARY_KEY);
		boolean autoIncrement = constraint.isAutoIncrement();
		if (autoIncrement) {
			jsonObject.put(JsonModelConstants.Constraint.AUTO_INCREMENT, autoIncrement);
		}
		OrderDirection orderDirection = constraint.getOrderDirection();
		if (orderDirection != null) {
			jsonObject.put(JsonModelConstants.Constraint.ORDER_DIRECTION, orderDirection.toString());
		}
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(ForeignKeyColumnConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_FOREIGN_KEY);
		jsonObject.put(JsonModelConstants.Constraint.FOREIGN_TABLE, constraint.getForeignTableName());
		jsonObject.put(JsonModelConstants.Constraint.FOREIGN_COLUMN, constraint.getForeignColumnName());
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(UniqueColumnConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_UNIQUE);
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(NotNullColumnConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_NOT_NULL);
		result = jsonObject;
	}

	@SuppressWarnings("unchecked")
	public void visit(DefaultValueColumnConstraint constraint) {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put(JsonModelConstants.Constraint.CONSTRAINT_TYPE, JsonModelConstants.Constraint.TYPE_DEFAULT_VALUE);
		jsonObject.put(JsonModelConstants.Constraint.VALUE, constraint.getValue());
		result = jsonObject;
	}

	private static <K,V> void putIfValueNotNull(Map<K,V> map, K key, V value) {
		if (value != null) {
			map.put(key, value);
		}
	}

}


text:
#ifndef INCLUDES_TARANTOOL_LUA_H
#define INCLUDES_TARANTOOL_LUA_H

#include <stddef.h>
#include <inttypes.h>

struct lua_State;
struct luaL_Reg;
struct tbuf;

/**
 * This is a callback used by tarantool_lua_init() to open
 * module-specific libraries into given Lua state.
 *
 * No return value, panics if error.
 */
extern void
box_lua_init(struct lua_State *L);

/**
 * Create an instance of Lua interpreter and load it with
 * Tarantool modules.  Creates a Lua state, imports global
 * Tarantool modules, then calls box_lua_init(), which performs
 * module-specific imports. The created state can be freed as any
 * other, with lua_close().
 *
 * @return  L on success, 0 if out of memory
 */
void
tarantool_lua_init(const char *tarantool_bin, int argc, char **argv);

/** Free Lua subsystem resources. */
void
tarantool_lua_free();

/**
 * This function exists because lua_tostring does not use
 * __tostring metamethod, and this metamethod has to be used
 * if we want to print Lua userdata correctly.
 */
const char *
tarantool_lua_tostring(struct lua_State *L, int index);

/**
 * Load and execute start-up file
 *
 * @param L is a Lua State.
 */
void
tarantool_lua_run_script(char *path, int argc, char **argv);

void
tarantool_lua(struct lua_State *L,
	      struct tbuf *out, const char *str);

extern char *history;

/**
 * Return last exception text
 */
extern "C" const char *
tarantool_error_message(void);

#endif /* INCLUDES_TARANTOOL_LUA_H */


text:
from core.pricing.exceptions import *
import core.util.debug as debug

import config
import core.storage as storage

class DataEngine:

	def __init__(self, prices):
		try:
			self.data = self.validate(prices)
		except DataEngineException as e:
			debug.error('%s'%e)
			self.data = {}
		except Exception as e:
			self.data = {}

	def getPrices(self, progress):
		debug.error('DataEngine function not implemented')

	@staticmethod
	def validate(prices):
		debug.error('DataEngine function not implemented')

	@staticmethod
	def getData(prices):
		if prices['data'] and len(prices['data'])>1:
			return prices['data']

		store = storage.getStorage(config.PricingStorage)

		return store.load(prices['path'])