text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Opegrapha signata var. beta Ach.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package kikaha.urouting.it.params;

import javax.inject.Singleton;
import kikaha.urouting.api.*;

/**
 * @author: miere.teixeira
 */
@Path( "it/parameters/header" )
@Singleton
public class HeaderParametersResource {

	@GET
	public long pathParameterEchoWithGETMethod( @HeaderParam( "id" ) long id ) {
		return id;
	}

	@POST
	public long pathParameterEchoWithPOSTMethod( @HeaderParam( "id" ) long id ) {
		return id;
	}

	@PUT
	public long pathParameterEchoWithPUTMethod( @HeaderParam( "id" ) long id ) {
		return id;
	}

	@DELETE
	public long pathParameterEchoWithDELETEMethod( @HeaderParam( "id" ) long id ) {
		return id;
	}

	@PATCH
	public long pathParameterEchoWithPATCHMethod( @HeaderParam( "id" ) long id ) {
		return id;
	}
}


text:
package org.apache.taverna.activities.externaltool.ssh;

import java.util.ArrayList;
import java.util.List;

import org.jdom.Element;
import org.jdom.Text;
import org.apache.taverna.activities.externaltool.manager.InvocationMechanism;

/**
 * @author alanrw
 *
 */
public class ExternalToolSshInvocationMechanism extends InvocationMechanism {

	private List<SshNode> nodes = new ArrayList<SshNode>();

	/* (non-Javadoc)
	 * @see net.sf.taverna.t2.activities.externaltool.manager.InvocationMechanism#getType()
	 */
	@Override
	public String getType() {
		return SshToolInvocation.SSH_USE_CASE_INVOCATION_TYPE;
	}

	/**
	 * @param list the nodes to set
	 */
	public void setNodes(List<SshNode> list) {
		this.nodes = list;
	}

	public List<SshNode> getNodes() {
		if (this.nodes.isEmpty()) {
			this.nodes.add(SshNodeFactory.getInstance().getDefaultNode());
		}
		return this.nodes;
	}

	@Override
	public Element getXMLElement() {
		Element top = new Element("sshInvocation");
		for (SshNode node : nodes) {
			Element nodeElement = new Element("sshNode");
			String host = node.getHost();
			if (host != null) {
				Element hostElement = new Element("host");
				hostElement.addContent(new Text(host));
				nodeElement.addContent(hostElement);
			}
			int port = node.getPort();
			Element portElement = new Element("port");
			portElement.addContent(new Text(Integer.toString(port)));
			nodeElement.addContent(portElement);

			String directory = node.getDirectory();
			if (directory != null) {
				Element directoryElement = new Element("directory");
				directoryElement.addContent(new Text(directory));
				nodeElement.addContent(directoryElement);
			}

			String linkCommand = node.getLinkCommand();
			if (linkCommand != null) {
				Element linkCommandElement = new Element("linkCommand");
				linkCommandElement.addContent(new Text(linkCommand));
				nodeElement.addContent(linkCommandElement);
			}

			String copyCommand = node.getCopyCommand();
			if (copyCommand != null) {
				Element copyCommandElement = new Element("copyCommand");
				copyCommandElement.addContent(new Text(copyCommand));
				nodeElement.addContent(copyCommandElement);
			}
			if (node.isRetrieveData()) {
				Element retrieveDataElement = new Element("retrieveData");
				nodeElement.addContent(retrieveDataElement);
			}

			top.addContent(nodeElement);
		}
		return top;
	}

}


text:
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-

#include <zxing/common/BitMatrix.h>
#include <zxing/common/IllegalArgumentException.h>

#include <iostream>
#include <sstream>
#include <string>

using std::ostream;
using std::ostringstream;

using zxing::BitMatrix;
using zxing::BitArray;
using zxing::ArrayRef;
using zxing::Ref;

void BitMatrix::init(int width, int height) {
	if (width < 1 || height < 1) {
		throw IllegalArgumentException(
				"Both dimensions must be greater than 0");
	}
	this->width = width;
	this->height = height;
	this->rowSize = (width + bitsPerWord - 1) >> logBits;
	bits = ArrayRef<int>(rowSize * height);
}

BitMatrix::BitMatrix(int dimension) {
	init(dimension, dimension);
}

BitMatrix::BitMatrix(int width, int height) {
	init(width, height);
}

BitMatrix::~BitMatrix() {
}

void BitMatrix::setBits(int *x) {
	for (int i = 0; i < (rowSize * height); i++) {
		bits[i] = x[i];
	}

}

void BitMatrix::flip(int x, int y) {
	int offset = y * rowSize + (x >> logBits);
	bits[offset] ^= 1 << (x & bitsMask);
}

void BitMatrix::setRegion(int left, int top, int width, int height) {
	if (top < 0 || left < 0) {
		throw IllegalArgumentException("Left and top must be nonnegative");
	}
	if (height < 1 || width < 1) {
		throw IllegalArgumentException("Height and width must be at least 1");
	}
	int right = left + width;
	int bottom = top + height;
	if (bottom > this->height || right > this->width) {
		throw IllegalArgumentException("The region must fit inside the matrix");
	}
	for (int y = top; y < bottom; y++) {
		int offset = y * rowSize;
		for (int x = left; x < right; x++) {
			bits[offset + (x >> logBits)] |= 1 << (x & bitsMask);
		}
	}
}

Ref<BitArray> BitMatrix::getRow(int y, Ref<BitArray> row) {
	if (row.empty() || row->getSize() < width) {
		row = new BitArray(width);
	}
	int offset = y * rowSize;
	for (int x = 0; x < rowSize; x++) {
		row->setBulk(x << logBits, bits[offset + x]);
	}
	return row;
}

int BitMatrix::getWidth() const {
	return width;
}

int BitMatrix::getHeight() const {
	return height;
}

ArrayRef<int> BitMatrix::getTopLeftOnBit() const {
	int bitsOffset = 0;
	while (bitsOffset < bits->size() && bits[bitsOffset] == 0) {
		bitsOffset++;
	}
	if (bitsOffset == bits->size()) {
		return ArrayRef<int>();
	}
	int y = bitsOffset / rowSize;
	int x = (bitsOffset % rowSize) << 5;

	int theBits = bits[bitsOffset];
	int bit = 0;
	while ((theBits << (31 - bit)) == 0) {
		bit++;
	}
	x += bit;
	ArrayRef<int> res(2);
	res[0] = x;
	res[1] = y;
	return res;
}

ArrayRef<int> BitMatrix::getBottomRightOnBit() const {
	int bitsOffset = bits->size() - 1;
	while (bitsOffset >= 0 && bits[bitsOffset] == 0) {
		bitsOffset--;
	}
	if (bitsOffset < 0) {
		return ArrayRef<int>();
	}

	int y = bitsOffset / rowSize;
	int x = (bitsOffset % rowSize) << 5;

	int theBits = bits[bitsOffset];
	int bit = 31;
	while ((theBits >> bit) == 0) {
		bit--;
	}
	x += bit;

	ArrayRef<int> res(2);
	res[0] = x;
	res[1] = y;
	return res;
}


text:
#import "KinemeGLColorMaskPatch.h"
#import <OpenGL/CGLMacro.h>

@implementation KinemeGLColorMaskPatch : QCPatch

+ (QCPatchExecutionMode)executionModeWithIdentifier:(id)fp8
{
	return 1;
}

+ (BOOL)allowsSubpatchesWithIdentifier:(id)fp8
{
	return YES;
}

+ (BOOL)isSafe
{
	return YES;
}

- (id)initWithIdentifier:(id)fp8
{
	if(self=[super initWithIdentifier:fp8])
	{
		[inputRed setBooleanValue: YES];
		[inputGreen setBooleanValue: YES];
		[inputBlue setBooleanValue: YES];
		[inputAlpha setBooleanValue: YES];
		[[self userInfo] setObject:@"Kineme GL Color Mask" forKey:@"name"];
	}

	return self;
}

- (BOOL)execute:(QCOpenGLContext *)context time:(double)time arguments:(NSDictionary *)arguments
{
	CGLContextObj cgl_ctx = [context CGLContextObj];

	GLboolean mask[4];
	glGetBooleanv(GL_COLOR_WRITEMASK, mask);

	glColorMask([inputRed booleanValue],
				[inputGreen booleanValue],
				[inputBlue booleanValue],
				[inputAlpha booleanValue]);
	[self executeSubpatches:time arguments:arguments];
	glColorMask(mask[0], mask[1], mask[2], mask[3]);

	return YES;
}

@end


text:
package org.apache.slide.projector.processor.core;

import java.text.DateFormat;
import java.util.Locale;
import java.util.Map;

import org.apache.slide.projector.ContentType;
import org.apache.slide.projector.Context;
import org.apache.slide.projector.Processor;
import org.apache.slide.projector.Result;
import org.apache.slide.projector.Store;
import org.apache.slide.projector.descriptor.DateValueDescriptor;
import org.apache.slide.projector.descriptor.LocaleValueDescriptor;
import org.apache.slide.projector.descriptor.ParameterDescriptor;
import org.apache.slide.projector.descriptor.RequiredEnvironmentDescriptor;
import org.apache.slide.projector.descriptor.ResultDescriptor;
import org.apache.slide.projector.descriptor.ResultEntryDescriptor;
import org.apache.slide.projector.descriptor.StateDescriptor;
import org.apache.slide.projector.descriptor.StringValueDescriptor;
import org.apache.slide.projector.i18n.DefaultMessage;
import org.apache.slide.projector.i18n.LocalizedMessage;
import org.apache.slide.projector.i18n.ParameterMessage;
import org.apache.slide.projector.processor.SimpleProcessor;
import org.apache.slide.projector.value.DateValue;
import org.apache.slide.projector.value.LocaleValue;
import org.apache.slide.projector.value.StringValue;

public class DateFormatter implements Processor {
	private final static String DATE_FORMAT = "dateFormat";
	private final static String TIME_FORMAT = "timeFormat";
    private final static String DATE = "date";
    private final static String LOCALE = "locale";
    private final static String HIDE = "hide";
    private final static String SHORT = "short";
    private final static String MEDIUM = "medium";
    private final static String LONG = "long";
    private final static String FULL = "full";
    private final static String[] STYLES = new String[] { HIDE, SHORT, MEDIUM, LONG, FULL };

    private final static ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[]{
    		new ParameterDescriptor(DATE, new ParameterMessage("dateFormatter/parameter/date"), new DateValueDescriptor()),
    		new ParameterDescriptor(DATE_FORMAT, new ParameterMessage("dateFormatter/parameter/dateFormat"), new StringValueDescriptor(STYLES), new StringValue(SHORT)),
    		new ParameterDescriptor(TIME_FORMAT, new ParameterMessage("dateFormatter/parameter/timeFormat"), new StringValueDescriptor(STYLES), new StringValue(SHORT)),
    };

    private final static ResultDescriptor resultDescriptor = new ResultDescriptor(
            new StateDescriptor[]{ StateDescriptor.OK_DESCRIPTOR },
            new ResultEntryDescriptor[]{new ResultEntryDescriptor(
                    SimpleProcessor.OUTPUT, new LocalizedMessage("dateFormatter/result/output"),
                    ContentType.PLAIN_TEXT, true)});

    private final static RequiredEnvironmentDescriptor[] requiredEnvironmentDescriptors = new RequiredEnvironmentDescriptor[] {
    		new RequiredEnvironmentDescriptor(LOCALE, Store.SESSION, new DefaultMessage("message/requiredEnvironment/locale"), new LocaleValueDescriptor(), new LocaleValue(Locale.getDefault()))
    };

	public Result process(Map parameters, Context context) throws Exception {
		DateValue date = (DateValue)parameters.get(DATE);
		String dateFormat = parameters.get(DATE_FORMAT).toString();
		String timeFormat = parameters.get(TIME_FORMAT).toString();
		Locale locale = ((LocaleValue)context.getStore(Store.SESSION).get(LOCALE)).getLocale();
		String formattedDate = getDateFormatter(dateFormat, timeFormat, locale).format(date.getDate());
		return new Result(StateDescriptor.OK, SimpleProcessor.OUTPUT, new StringValue(formattedDate));
	}

	public ParameterDescriptor[] getParameterDescriptors() {
		return parameterDescriptors;
	}

	public ResultDescriptor getResultDescriptor() {
		return resultDescriptor;
	}

	private DateFormat getDateFormatter(String dateFormat, String timeFormat, Locale locale) {
		if ( dateFormat.equals(HIDE) ) {
			return DateFormat.getTimeInstance(getStyleByName(timeFormat), locale);
		} else if ( timeFormat.equals(HIDE) ) {
			return DateFormat.getDateInstance(getStyleByName(dateFormat), locale);
		} else {
			return DateFormat.getDateTimeInstance(getStyleByName(dateFormat), getStyleByName(timeFormat), locale);
		}
	}

	private int getStyleByName(String styleName) {
		if ( styleName.equals(SHORT) ) {
			return DateFormat.SHORT;
		} else if ( styleName.equals(MEDIUM) ) {
			return DateFormat.MEDIUM;
		} else if ( styleName.equals(LONG) ) {
			return DateFormat.LONG;
		}
		return DateFormat.FULL;
	}
}


text:
module WWW
  class Mechanize
    class Chain
      class PreConnectHook
        include WWW::Handler

        attr_accessor :hooks
        def initialize
          @hooks = []
        end

        def handle(ctx, params)
          @hooks.each { |hook| hook.call(params) }
          super
        end
      end

      class PostConnectHook < PreConnectHook
      end
    end
  end
end


text:
package org.uberfire.client.common;

import com.google.gwt.user.client.ui.Widget;

public interface LoadContentCommand {
    public Widget load();
}


text:
#ifndef XNCOREGLOBALS_H
#define XNCOREGLOBALS_H

//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <XnCore.h>

//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
/** The Xiron I/O INI section name. */
#define XN_CORE_INI_SECTION "Core"

//---------------------------------------------------------------------------
// Global Variables
//---------------------------------------------------------------------------
/** Was the Xiron Core subsystem successfully initialized? */
extern XnBool g_bXnCoreWasInit;

//---------------------------------------------------------------------------
// Macros
//---------------------------------------------------------------------------
/** Make sure the core subsystem was initialized. */
#define XN_VALIDATE_CORE_INIT()		\
	if (g_bXnCoreWasInit != TRUE)	\
	{									\
		return (XN_STATUS_NOT_INIT);	\
	}

/** Make sure the core subsystem was not initialized already. */
#define XN_VALIDATE_CORE_NOT_INIT()		\
	if (g_bXnCoreWasInit == TRUE)		\
	{										\
		return (XN_STATUS_ALREADY_INIT);	\
	}

#endif // XNCOREGLOBALS_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <groupId>io.hawt.example.services</groupId>
    <artifactId>example-services</artifactId>
    <version>1.4.60</version>
    <relativePath>..</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>example-dozer-models</artifactId>
  <name>${project.artifactId}</name>
  <description>hawtio :: example services :: dozer models</description>

  <properties>
  </properties>

  <dependencies>
    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.1</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j-version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Bidr. Känn. Finl. Nat. Folk 48: 411 (1889)

#### Original name
Corticium confluens subsp. padineum P. Karst.

### Remarks
null


text:
layout: post
date: '2015-05-31'
title: "Bill Levkoff 1150 Chiffon V-Neck Short Bridesmaid Dress"
category: Bill Levkoff
tags: [Bill Levkoff]
---
### Bill Levkoff 1150 Chiffon V-Neck Short Bridesmaid Dress
Just **$194.99**
###

Chiffon V-neck short dress with a surplice top and criss-cross ruching. Soft gathers surround the skirt.

Buy it: [https://www.eudances.com/en/bill-levkoff/3265-bill-levkoff-1150-chiffon-v-neck-short-bridesmaid-dress.html](https://www.eudances.com/en/bill-levkoff/3265-bill-levkoff-1150-chiffon-v-neck-short-bridesmaid-dress.html)


text:
layout: post
microblog: true
audio:
photo:
date: 2011-09-14 21:48:21 -0600
guid: http://craigmcclellan.micro.blog/2011/09/15/t114183747313737728.html
---
Thank goodness for Tivo. It means I can see @NEEDTOBREATHE on Leno without having to sit through Leno himself. #TeamCoco


text:
package com.esri.hadoop.examples.trip;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;

public class TripCellWritable implements Writable {

	private Text startDate;
	private Text startTime;
	private Text startLon;
	private Text startLat;
	private Text startSpeed;
	private DoubleWritable startLhs;
	private DoubleWritable startBot;
	private DoubleWritable startRhs;
	private DoubleWritable startTop;
	private Text endDate;
	private Text endTime;
	private Text endLon;
	private Text endLat;
	private Text endSpeed;
	private DoubleWritable endLhs;
	private DoubleWritable endBot;
	private DoubleWritable endRhs;
	private DoubleWritable endTop;

    public TripCellWritable(String startDate, String startTime, String startLon, String startLat, String startSpeed,
							double startLhs, double startBot, double startRhs, double startTop,
							String endDate, String endTime, String endLon, String endLat, String endSpeed,
							double endLhs, double endBot, double endRhs, double endTop) {
	    set(new Text(startDate),
			new Text(startTime),
			new Text(startLon),
			new Text(startLat),
			new Text(startSpeed),
			new DoubleWritable(startLhs),
			new DoubleWritable(startBot),
			new DoubleWritable(startRhs),
			new DoubleWritable(startTop),
			new Text(endDate),
			new Text(endTime),
			new Text(endLon),
			new Text(endLat),
			new Text(endSpeed),
			new DoubleWritable(endLhs),
			new DoubleWritable(endBot),
			new DoubleWritable(endRhs),
			new DoubleWritable(endTop)
			);
	}

	public String getDate1() { return startDate.toString(); }  // start/origin
	public String getTime1() { return startTime.toString(); }
	public String getLon1() { return startLon.toString(); }
	public String getLat1() { return startLat.toString(); }
	public String getSpd1() { return startSpeed.toString(); }
	public double getLhs1() { return startLhs.get(); }
	public double getBot1() { return startBot.get(); }
	public double getRhs1() { return startRhs.get(); }
	public double getTop1() { return startTop.get(); }
	public String getDate2() { return endDate.toString(); }  // end/destination
	public String getTime2() { return endTime.toString(); }
	public String getLon2() { return endLon.toString(); }
	public String getLat2() { return endLat.toString(); }
	public String getSpd2() { return endSpeed.toString(); }
	public double getLhs2() { return endLhs.get(); }
	public double getBot2() { return endBot.get(); }
	public double getRhs2() { return endRhs.get(); }
	public double getTop2() { return endTop.get(); }

	@Override
	public void readFields(DataInput inp) throws IOException {
		startDate.readFields(inp);
		startTime.readFields(inp);
		startLon.readFields(inp);
		startLat.readFields(inp);
		startSpeed.readFields(inp);
		startLhs.readFields(inp);
		startBot.readFields(inp);
		startRhs.readFields(inp);
		startTop.readFields(inp);
		endDate.readFields(inp);
		endTime.readFields(inp);
		endLon.readFields(inp);
		endLat.readFields(inp);
		endSpeed.readFields(inp);
		endLhs.readFields(inp);
		endBot.readFields(inp);
		endRhs.readFields(inp);
		endTop.readFields(inp);
	}

	public void set(Text pStDate, Text pStTime, Text pStLon, Text pStLat, Text pStSpeed,
					DoubleWritable lhs1, DoubleWritable bot1, DoubleWritable rhs1, DoubleWritable top1,
					Text pEndDate, Text pEndTime, Text pEndLon, Text pEndLat, Text pEndSpeed,
					DoubleWritable lhs2, DoubleWritable bot2, DoubleWritable rhs2, DoubleWritable top2) {
		startDate = pStDate;
		startTime = pStTime;
		startLon = pStLon;
		startLat = pStLat;
		startSpeed = pStSpeed;
		startLhs = lhs1;
		startBot = bot1;
		startRhs = rhs1;
		startTop = top1;
		endDate = pEndDate;
		endTime = pEndTime;
		endLon = pEndLon;
		endLat = pEndLat;
		endSpeed = pEndSpeed;
		endLhs = lhs2;
		endBot = bot2;
		endRhs = rhs2;
		endTop = top2;
	}

	/**
	 * This is one record of output of our MapReduce job.
	 */
	@Override
	public String toString()
	{
		return String.format("%s\t%s\t%s\t%s\t%s\t%f\t%f\t%f\t%f\t%s\t%s\t%s\t%s\t%s\t%f\t%f\t%f\t%f",
							 getDate1(), getTime1(), getLon1(), getLat1(), getSpd1(),
							 getLhs1(), getBot1(), getRhs1(), getTop1(),
							 getDate2(), getTime2(), getLon2(), getLat2(), getSpd2(),
							 getLhs2(), getBot2(), getRhs2(), getTop2());
	}

	@Override
	public void write(DataOutput out) throws IOException {
		startDate.write(out);
		startTime.write(out);
		startLon.write(out);
		startLat.write(out);
		startSpeed.write(out);
		startLhs.write(out);
		startBot.write(out);
		startRhs.write(out);
		startTop.write(out);
		endDate.write(out);
		endTime.write(out);
		endLon.write(out);
		endLat.write(out);
		endSpeed.write(out);
		endLhs.write(out);
		endBot.write(out);
		endRhs.write(out);
		endTop.write(out);
	}

}


text:
Clone the repo
Edit the docker-compose.yml and change: Virtualhost, Ports, Volumes. -> only if needed
Edit the requirements.txt file and write the whole list of your app requirements
run docker-compose up -d
Now you'll have a ready-to-deploy Docker container infrastructure with all you need: Mysql, Django, Apache, Mod-Pagespeed...
Deploy your app via sftp
Go into django-apache-pagespeed container and edit the file django_app.conf (under: /etc/apache2/sites-enabled/) with the specific path/name of your app
Reload the apache configuration via the command: service apache2 reload
Open the browser and enjoy your app!


text:
package pi.tools.processexecutor;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Helper class for the java ProcessBuilder class to simplify calling external processes.
 * - redirect output streams to current process with an user defined prefix for each line.
 * - use FileTools.getJavaBinaryFile() to get the path to your java executable -> if you
 * want to start a new java process.
 * - use MiscTools.getClasspath() to get the classpath of the current vm -> if you want to clone it
 * in the new vm
 *
 * @author Werner Klieber
 */
public class ProcessExecutor {
    public ProcessExecutor() {
    }

    /**
     * start a new external process. Read the doc in the header of this class to get additional
     * information e.g. how to get the path to the java executable or retrieve the classpath.
     *
     * @return a result containing the started process. e.g. use process.waitFor() to block until the process is done.
     */
    public ProcessExecutorResult start(ProcessExecutorSettings settings) {
        if (settings == null) {
            throw new IllegalArgumentException("settings may not be null");
        }

        List<String> args = settings.getArgs();

        Process process;
        Thread threadOut = null;
        Thread threadErr = null;
        try {
            List<String> call = new ArrayList<String>();
            call.add(settings.getCommand());
            call.addAll(args);

            /*System.out.println("---------------------------");
            for (String s:call) {
                assert s != null;  // when an argument is null, processBuilder.start() will throw an nullpointerexception
                System.out.println("\"" + s + "\"");
            }
            System.out.println("---------------------------");*/

            ProcessBuilder processBuilder = new ProcessBuilder(call);
            processBuilder.redirectErrorStream(false); // do not split error and out stream
            Map<String, String> env = settings.getEnv();
            if (env == null) {
                env = System.getenv();
            }
            processBuilder.environment().clear();
            processBuilder.environment().putAll(env);

            String workDir = settings.getWorkDir();
            if (workDir != null) {
                File dir = new File(workDir);
                if (!dir.exists() || !dir.isDirectory()) {
                    throw new IllegalArgumentException("workdir does not exist: '" + workDir + "'");
                }
                processBuilder.directory(new File(workDir));
            }

            /* System.out.println("Start Process: \"" + command + "\"");
            for (int i = 0; i < args.size(); i++) {
                String arg = args.get(i);
                System.out.println("ARG " + (i+1) + ": <" + arg + ">");
            }*/

            process = processBuilder.start();

            String prf = settings.getOutputPrefix();
            String prefix;
            String errPrefix;
            if (prf == null) {
                prefix = "";
                errPrefix = "";
            } else {
                prefix = prf;
                errPrefix = prefix + "[ERR] ";
            }

            OutputStream out = settings.getOutputStream();
            OutputStream tOut;
            OutputStream tErrorOut;
            if (out == null) {
                tOut = System.out;
                tErrorOut = System.err;
            } else {
                tOut = out;
                tErrorOut = out;
            }

            threadOut = new Thread(new StreamWriterThread(process.getInputStream(), tOut, prefix));
            threadOut.setDaemon(true);
            threadOut.start();

            threadErr = new Thread(new StreamWriterThread(process.getErrorStream(), tErrorOut, errPrefix));
            threadErr.setDaemon(true);
            threadErr.start();
        } catch (Exception e) {
            throw new UnsupportedOperationException("error starting the new process: "  + e.toString(), e);
        }

        ProcessExecutorResult returnValue = new ProcessExecutorResult(process, threadOut, threadErr);
        return returnValue;
    }

    /**
     * simple invoke method: start the process, wait until finished and return any output in the return String.
     * the return value of the process is ignored
     *
     * @return a string containing all console output (including error output) from the external process
     */
    public String startSimple(ProcessExecutorSettings settings) throws InterruptedException {
        if (settings == null) {
            throw new IllegalArgumentException("settings may not be null");
        }

        if (settings.getOutputStream() != null) {
            throw new IllegalArgumentException("outputstream must be null. This method instantiate it's own one to redirect the output");
        }

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        settings.setOutputStream(out);

        ProcessExecutorResult result = start(settings);
        Process process = result.getProcess();
        int ret = result.waitFor();

        String returnValue = out.toString();
        return returnValue.trim();
    }
}


text:
/**
 * Template C++ file.
 * Function with references to pointers: func(int *&ptr);
 */
/********************* Header Files ***********************/
/* C++ Headers */
#include <iostream> /* Input/output objects. */
//#include <fstream> /* File operations. */
//#include <sstream> /* String stream. */
#include <string> /* C++ String class. */
//#include <exception> /* Top level exception header. */
//#include <stdexcept> /* Some useful common exceptions */
//#include <new> /* Defines bad_malloc exception, new functions. */
//#include <memory> /* std smart pointers like unique_ptr */
//#include <typeinfo> /* Casting header. */
//#include <limits> /* Inspect properties, numeric_limits<int> iLimit; */
//#include <numeric> /* Math accumulators & other ops*/
//#include <functional> /* Function declarations & std::bind */

/* C++11 Only*/
//#include <chrono> /* std::chrono contains timing for threads */
//#include <initializer_list> /* Allows class to take list like {1,2} */
//#include <random> /* Random c++ version */
//#include <thread>
//#include <atomic>
//#include <condition_variable>
//#include <mutex>

/* STL Headers */
//#include <vector>
//#include <list>
//#include <deque>
//#include <stack>
//#include <queue>
//#include <priority_queue>
//#include <set> // multiset for multiple keys allowed.
//#include <map> // multimap for multiple keys allowed.
//#include <bitset>
#include <utility> // Has pair for map, std::swap
#include <algorithm>
//#include <iterator> // Contains back_inserter function and like.

/* C Headers */
//#include <cstdio>
//#include <cstring>
//#include <cstdlib> /* atof, rand, malloc... */
//#include <cstddef> /* size_t, NULL */
//#include <cstdarg> /* Variable argument functions */
//#include <cctype> /* Character check functions */
//#include <climits>
//#include <cassert>
//$include <cmath>
//$include <cstdint> /* C++11 only, standard u_int16 & such */

#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <gtest/gtest.h>

/**************** Namespace Declarations ******************/
using std::cin;
using std::cout;
using std::endl;
using std::string;
namespace bg = boost::graph;

/******************* Type Definitions *********************/
/* For enums: Try to namesapce the common elements.
 * typedef enum {
 *	VAL_,
 * } name_e;
 */

/* For structs:
 * typedef struct name_s {
 *	int index;
 * } name_t;
 */

/***************** Constants & Macros *********************/

/****************** Class Definitions *********************/

/************** Global Vars & Functions *******************/
TEST(DISABLED_BoostGraph, CreateAdjList) {
    typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS> Graph;

    enum { A, B, C, D, E, N };
    const int num_vertices = N;
    const char * name = "ABCDE";

    typedef std::pair<int, int> Edge;
    Edge edge_array[] = {
        Edge(A, B), Edge(A, D), Edge(C, A), Edge(D, C),
        Edge(C, E), Edge(B, D), Edge(D, E)
    };
    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);

    Graph g(edge_array, edge_array + num_edges, num_vertices);

    typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
    typedef boost::property_map<Graph, boost::vertex_index_t>::type IndexMap;
}

/* Notes:
 * Force call to use another version of virtual function: baseP->Item_base::net_price(42);
 *
 */


text:
namespace chrome {

void ShowExtensionInstallBlockedByParentDialog(
    ExtensionInstalledBlockedByParentDialogAction action,
    const extensions::Extension* extension,
    content::WebContents* web_contents,
    base::OnceClosure done_callback) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  auto dialog = std::make_unique<ExtensionInstallBlockedByParentDialogView>(
      action, extension, web_contents->GetTopLevelNativeWindow(),
      std::move(done_callback));
  constrained_window::ShowWebModalDialogViews(dialog.release(), web_contents)
      ->Show();
}

}  // namespace chrome

ExtensionInstallBlockedByParentDialogView::
    ExtensionInstallBlockedByParentDialogView(
        chrome::ExtensionInstalledBlockedByParentDialogAction action,
        const extensions::Extension* extension,
        gfx::NativeWindow window,
        base::OnceClosure done_callback)
    : extension_(extension),
      action_(action),
      done_callback_(std::move(done_callback)) {
  SetButtons(ui::DIALOG_BUTTON_CANCEL);
  SetDefaultButton(ui::DIALOG_BUTTON_CANCEL);
  SetButtonLabel(ui::DIALOG_BUTTON_CANCEL, l10n_util::GetStringUTF16(IDS_OK));
  set_draggable(true);

  SetIcon(gfx::CreateVectorIcon(ash::kNotificationSupervisedUserIcon,
                                SK_ColorDKGRAY));
  SetShowIcon(true);
  ConfigureTitle();
  CreateContents();
}

ExtensionInstallBlockedByParentDialogView::
    ~ExtensionInstallBlockedByParentDialogView() {
  if (done_callback_)
    std::move(done_callback_).Run();
}

gfx::Size ExtensionInstallBlockedByParentDialogView::CalculatePreferredSize()
    const {
  const int width = ChromeLayoutProvider::Get()->GetDistanceMetric(
                        DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH) -
                    margins().width();
  return gfx::Size(width, GetHeightForWidth(width));
}

ui::ModalType ExtensionInstallBlockedByParentDialogView::GetModalType() const {
  return ui::MODAL_TYPE_CHILD;
}

void ExtensionInstallBlockedByParentDialogView::ConfigureTitle() {
  base::string16 title_string;
  switch (action_) {
    case chrome::ExtensionInstalledBlockedByParentDialogAction::kAdd:
      // The user is trying to add/install the extension/app
      title_string = l10n_util::GetStringFUTF16(
          IDS_EXTENSION_INSTALL_BLOCKED_BY_PARENT_PROMPT_TITLE,
          GetExtensionTypeString());
      break;
    case chrome::ExtensionInstalledBlockedByParentDialogAction::kEnable:
      // The user is trying to enable the extension/app
      title_string = l10n_util::GetStringFUTF16(
          IDS_EXTENSION_ENABLE_BLOCKED_BY_PARENT_PROMPT_TITLE,
          GetExtensionTypeString());
      break;
  }
  SetTitle(title_string);
}

void ExtensionInstallBlockedByParentDialogView::CreateContents() {
  SetLayoutManager(std::make_unique<views::FillLayout>());

  base::string16 body_string;
  switch (action_) {
    case chrome::ExtensionInstalledBlockedByParentDialogAction::kAdd:
      // The user is trying to add/install the extension/app
      body_string = l10n_util::GetStringFUTF16(
          IDS_EXTENSION_INSTALL_BLOCKED_BY_PARENT_PROMPT_MESSAGE,
          GetExtensionTypeString());
      break;
    case chrome::ExtensionInstalledBlockedByParentDialogAction::kEnable:
      // The user is trying to enable the extension/app
      body_string = l10n_util::GetStringFUTF16(
          IDS_EXTENSION_ENABLE_BLOCKED_BY_PARENT_PROMPT_MESSAGE,
          GetExtensionTypeString());
      break;
  }

  icon_ = gfx::CreateVectorIcon(ash::kNotificationSupervisedUserIcon,
                                SK_ColorDKGRAY);

  const ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
  const gfx::Insets content_insets =
      provider->GetDialogInsetsForContentType(views::TEXT, views::TEXT);

  set_margins(gfx::Insets(content_insets.top(), content_insets.left(),
                          content_insets.bottom(), content_insets.right()));

  auto* message_body_label = AddChildView(
      std::make_unique<views::Label>(body_string, CONTEXT_BODY_TEXT_LARGE));
  message_body_label->SetMultiLine(true);
  message_body_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
}

base::string16
ExtensionInstallBlockedByParentDialogView::GetExtensionTypeString() {
  return l10n_util::GetStringUTF16(
      extension_->is_app()
          ? IDS_PARENT_PERMISSION_PROMPT_EXTENSION_TYPE_APP
          : IDS_PARENT_PERMISSION_PROMPT_EXTENSION_TYPE_EXTENSION);
}


text:
module ProgressMeter

using Compat

export Progress, next!, cancel

type Progress
    n::Int
    dt::Float64
    counter::Int
    tfirst::Float64
    tlast::Float64
    printed::Bool    # true if we have issued at least one status update
    desc::String     # prefix to the percentage, e.g.  "Computing..."
    barlen::Int      # progress bar size (default is available terminal width)
    color::Symbol    # default to green

    function Progress(n::Integer, dt::Real = 1.0, desc::String = "Progress: ", barlen::Int = 0, color::Symbol = :green)
        this = new(convert(Int, n), convert(Float64, dt), 0)
        this.tfirst = time()
        this.tlast = this.tfirst
        this.printed = false
        this.desc = desc
        this.barlen = barlen
        this.color = color
        this
    end

    function Progress(n::Integer, desc::String = "Progress: ")
        this = new(convert(Int, n), convert(Float64, 0.01), 0)
        this.tfirst = time()
        this.tlast = this.tfirst
        this.printed = false
        this.desc = desc
        #...length of percentage and ETA string with days is 29 characters
        this.barlen = max(0, Base.tty_size()[2] - (length(desc)+29))
        this.color = :green
        this
    end
end

function next!(p::Progress)
    t = time()
    p.counter += 1
    if p.counter >= p.n
        if p.printed
            percentage_complete = 100.0 * p.counter / p.n
            bar = barstring(p.barlen, percentage_complete)
            dur = durationstring(t-p.tfirst)
            msg = @sprintf "%s%3u%%%s Time: %s" p.desc round(Int, percentage_complete) bar dur
            printover(msg, p.color)
            println()
        end
        return
    end

    if t > p.tlast+p.dt
        percentage_complete = 100.0 * p.counter / p.n
        bar = barstring(p.barlen, percentage_complete)
        elapsed_time = t - p.tfirst
        est_total_time = 100 * elapsed_time / percentage_complete
        eta_sec = round(Int, est_total_time - elapsed_time )
        eta = durationstring(eta_sec)
        msg = @sprintf "%s%3u%%%s  ETA: %s" p.desc round(Int, percentage_complete) bar eta
        printover(msg, p.color)
        # Compensate for any overhead of printing. This can be especially important
        # if you're running over a slow network connection.
        p.tlast = t + 2*(time()-t)
        p.printed = true
    end
end

function next!(p::Progress, color::Symbol)
  p.color = color
  next!(p)
end

function cancel(p::Progress, msg::String = "Aborted before all tasks were completed", color = :red)
    if p.printed
        printover(msg, color)
        println()
    end
    return
end

function printover(io::IO, s::String, color::Symbol = :color_normal)
    if isdefined(Main, :IJulia)
        print(io, "\r" * s)
    else
        print(io, "\u1b[1G")   # go to first column
        print_with_color(color, io, s)
        print(io, "\u1b[K")    # clear the rest of the line
    end
end

printover(s::String, color::Symbol = :color_normal) = printover(STDOUT, s, color)

function barstring(barlen, percentage_complete)
    bar = ""
    if barlen>0
        nsolid = round(Int, barlen * percentage_complete / 100)
        nempty = barlen - nsolid
        bar = string("|", repeat("#",nsolid), repeat(" ",nempty), "|")
    end
    bar
end

function durationstring(nsec)
    days = div(nsec, 60*60*24)
    r = nsec - 60*60*24*days
    hours = div(r,60*60)
    r = r - 60*60*hours
    minutes = div(r, 60)
    seconds = r - 60*minutes

    hhmmss = @sprintf "%u:%02u:%02u" hours minutes seconds
    if days>0
       return @sprintf "%u days, %s" days hhmmss
    end
    hhmmss
end

end


text:
#pragma once

#include <string>
#include "graphics.h"

#ifndef VERSION
#define VERSION "unknown version"
#endif

namespace librender {
namespace config {

int InitFromMainArgs(int argc, char* argv[],
                     std::vector<RenderParams>& all_params);
void InitFromFile(const std::string& filename, RenderParams& params);
}
}


text:
<?php
/**
 * VK.COM groups management helper
 * @author Maslov Ivan
 * @version 2.0
 */
class VKPublic
{
    protected $groupId, $appId, $secretKey, $accessToken, $accessSecret;

    /**
     * @param int $groupId
     * @param int $appId
     * @param string $secretKey
     */
    public function __construct($groupId, $appId, $secretKey)
    {
        $this->groupId = $groupId;
        $this->appId = $appId;
        $this->secretKey = $secretKey;
    }

    /**
     * @param string $accessToken
     * @param string $accessSecret
     */
    public function setAccessData($accessToken, $accessSecret)
    {
        $this->accessToken = $accessToken;
        $this->accessSecret = $accessSecret;
    }

    /**
     * Hack
     */
    public function getAccessData()
    {
        echo "<!doctype html><meta charset='utf-8'>
            appId}&scope=offline,wall,groups,pages," .
            "photos,docs,audio,video,notes,stats,messages,notify,notifications,nohttps&" .
            "redirect_uri=blank.html&response_type=code'
                target='_blank'>Получить CODE
Ссылка для получения токена:

                https://api.vkontakte.ru/oauth/access_token?client_id={$this->appId}" .
            "&client_secret={$this->secretKey}&code=CODE";

        exit;
    }

    /**
     * @param string $method
     * @param mixed $parameters
     * @return mixed
     */
    public function callMethod($method, $parameters)
    {
        if (!$this->accessToken) return false;
        if (is_array($parameters)) $parameters = http_build_query($parameters);
        $queryString = "/method/$method?$parameters&access_token={$this->accessToken}";
        $querySig = md5($queryString . $this->accessSecret);
        return json_decode(file_get_contents(
            "http://api.vk.com{$queryString}&sig=$querySig"
        ));
    }

    /**
     * @param string $message
     * @param bool $fromGroup
     * @param bool $signed
     * @return mixed
     */
    public function wallPostMsg($message, $fromGroup = true, $signed = false)
    {
        return $this->callMethod('wall.post', array(
            'owner_id' => -1 * $this->groupId,
            'message' => $message,
            'from_group' => $fromGroup ? 1 : 0,
            'signed' => $signed ? 1 : 0,
        ));
    }

    /**
     * @param string $attachment
     * @param null|string $message
     * @param bool $fromGroup
     * @param bool $signed
     * @return mixed
     */
    public function wallPostAttachment($attachment, $message = null, $fromGroup = true, $signed = false)
    {
        return $this->callMethod('wall.post', array(
            'owner_id' => -1 * $this->groupId,
            'attachment' => strval($attachment),
            'message' => $message,
            'from_group' => $fromGroup ? 1 : 0,
            'signed' => $signed ? 1 : 0,
        ));
    }

    /**
     * @param string $file relative file path
     * @return mixed
     */
    public function createPhotoAttachment($file)
    {
        $result = $this->callMethod('photos.getWallUploadServer', array(
            'gid' => $this->groupId
        ));

        $ch = curl_init($result->response->upload_url);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, array(
            'photo' => '@' . getcwd() . '/' . $file
        ));

        if (($upload = curl_exec($ch)) === false) {
            throw new Exception(curl_error($ch));
        }

        curl_close($ch);
        $upload = json_decode($upload);
        $result = $this->callMethod('photos.saveWallPhoto', array(
            'server' => $upload->server,
            'photo' => $upload->photo,
            'hash' => $upload->hash,
            'gid' => $this->groupId,
        ));

        return $result->response[0]->id;
    }

    public function combineAttachments()
    {
        $result = '';
        if (func_num_args() == 0) return '';
        foreach (func_get_args() as $arg) {
            $result .= strval($arg) . ',';
        }
        return substr($result, 0, strlen($result) - 1);
    }
}


text:
<?php

/** */
namespace Jobs\Form;

use Core\Form\MetaDataFieldset;
use Core\Form\ViewPartialProviderInterface;
use Core\Form\ViewPartialProviderTrait;

/**
 * ${CARET}
 *
 * @author Mathias Gelhausen <gelhausen@cross-solution.de>
 * @todo write test
 */
class CustomerNoteFieldset extends MetaDataFieldset implements ViewPartialProviderInterface
{
    use ViewPartialProviderTrait;

    protected $defaultPartial = 'jobs/form/customer-note';

    public function init()
    {
        $this->setAttribute('id', 'customerNoteFieldset');
        $this->setName('customerNote');
        $this->add([
                'type' => 'Textarea',
                'name' => 'note',
            ]);
    }
}


text:
'use strict';

var preprocessor = require('karma/lib/preprocessor');
var os = require('os-shim');
var path = require('path');

function getPreprocessorFactory() {
  var factory = preprocessor.createPriorityPreprocessor;

  if (factory.$inject[0] !== 'config.preprocessors') {
    console.log('incompatible karma preprocessor: the first parametr should be config.preprocessors but', factory.$inject[0]);
    throw new Error('incompatible karma preprocessor');
  }

  return factory;
}

/**
 * Monkey patch preprocessors to preprocess *.browserify.js
 */

var originalFactory = getPreprocessorFactory();

var createPreprocessor = function(config, ...args) {
  // add our preprocessor for .browserify.js files
  config[path.resolve(os.tmpdir(), '*.browserify.js')] = ['browserify-bundle'];

  return originalFactory.apply(null, [config, ...args]);
};

createPreprocessor.$inject = originalFactory.$inject;

// publish patched preprocessor
module.exports.createPreprocessor = createPreprocessor;


text:
#ifndef SOURCEMUD_MUD_PORTAL_H
#define SOURCEMUD_MUD_PORTAL_H

#include "mud/entity.h"

// Direction object
class PortalDir
{
public:
	// the directions
	typedef enum {
		NONE = 0,
		NORTH,
		EAST,
		SOUTH,
		WEST,
		NORTHWEST,
		NORTHEAST,
		SOUTHEAST,
		SOUTHWEST,
		UP,
		DOWN,
		COUNT
	} dir_t;

private:
	dir_t value;

	static const std::string names[];
	static const std::string abbreviations[];
	static dir_t opposites[];

public:
	PortalDir(int s_value) : value((dir_t)s_value) {}
	PortalDir() : value(NONE) {}

	std::string getName() const { return names[value]; }
	std::string getAbbr() const { return abbreviations[value]; }
	PortalDir getOpposite() const { return opposites[value]; }
	bool valid() const { return value != NONE; }

	dir_t getValue() const { return value; }

	static PortalDir lookup(const std::string& name);

	bool operator < (const PortalDir& dir) const { return value < dir.value; }
	bool operator == (const PortalDir& dir) const { return dir.value == value; }
	bool operator != (const PortalDir& dir) const { return dir.value != value; }
	operator bool() const { return valid(); }
};

// Portal usage object
class PortalUsage
{
public:
	typedef enum {
		WALK = 0,
		CLIMB,
		CRAWL,
		COUNT
	} type_t;

private:
	type_t value;

	static const std::string names[];

public:
	PortalUsage(int s_value) : value((type_t)s_value) {}
	PortalUsage() : value(WALK) {}

	std::string getName() const { return names[value]; }

	type_t getValue() const { return value; }

	static PortalUsage lookup(const std::string& name);

	bool operator == (const PortalUsage& dir) const { return dir.value == value; }
	bool operator != (const PortalUsage& dir) const { return dir.value != value; }
};

// Portal flavour detail
class PortalDetail
{
public:
	typedef enum {
		NONE = 0,
		IN,
		ON,
		OVER,
		UNDER,
		ACROSS,
		OUT,
		UP,
		DOWN,
		THROUGH,
		COUNT
	} type_t;

private:
	type_t value;

	static const std::string names[];

public:
	PortalDetail(int s_value) : value((type_t)s_value) {}
	PortalDetail() : value(NONE) {}

	std::string getName() const { return names[value]; }

	type_t getValue() const { return value; }

	static PortalDetail lookup(const std::string& name);

	bool operator == (const PortalDetail& dir) const { return dir.value == value; }
	bool operator != (const PortalDetail& dir) const { return dir.value != value; }
};

// Room portals.  These define things like doors, general directions (west,
// east), and so on
class Portal : public Entity
{
public:
	Portal();

	virtual const char* factoryType() const { return "portal"; }

	// name information
	virtual EntityName getName() const;
	bool setName(const std::string& s_name) { return name.setFull(s_name); }
	void addKeyword(const std::string& keyword);

	// description information
	virtual std::string getDesc() const { return desc; }
	virtual void setDesc(const std::string& s_desc) { desc = s_desc; }

	// 'standard' portals have no custom name
	bool isStandard() const { return name.empty(); }

	// the taget room and portal (target portal is the portal you come out of)
	std::string getTarget() const { return target; }
	void setTarget(const std::string& t) { target = t; }

	// movement messages based on usage/detail
	std::string getGo() const;
	std::string getLeaves() const;
	std::string getEnters() const;

	// ownership - see entity.h
	virtual void setOwner(Entity*);
	virtual Entity* getOwner() const;
	virtual void ownerRelease(Entity*);
	class Room* getRoom() const { return parent_room; }

	// events
	virtual void handleEvent(const Event& event);
	virtual void broadcastEvent(const Event& event);

	// activate/deactivtee
	virtual void activate();
	virtual void deactivate();

	// portal usage (climb, etc.)
	PortalUsage getUsage() const { return usage; }
	void setUsage(PortalUsage t) { usage = t; }

	// portal detail (on, over, etc.)
	PortalDetail getDetail() const { return detail; }
	void setDetail(PortalDetail t) { detail = t; }

	// direction (east, west, etc.)
	PortalDir getDir() const { return dir; }
	void setDir(PortalDir d) { dir = d; }

	// get relative dir and target
	Room* getRelativeTarget(Room* base) const;
	PortalDir getRelativeDir(Room* base) const;
	Portal* getRelativePortal(Room* base) const;
	bool hasRoom(Room* base) const;

	// flags
	bool isValid() const;
	bool isHidden() const { return flags.hidden; }
	bool isClosed() const { return flags.closed; }
	bool isOneway() const { return flags.oneway; }
	bool isLocked() const { return flags.locked; }
	bool isDoor() const { return flags.door; }
	bool isNolook() const { return flags.nolook; }
	bool isDisabled() const { return flags.disabled; }

	// color of portal
	virtual const char* ncolor() const { return CEXIT; }

	// manage state
	void lock(Room* base, class Creature* actor);
	void unlock(Room* base, class Creature* actor);
	void close(Room* base, class Creature* actor);
	void open(Room* base, class Creature* actor);

	// heartbeat
	void heartbeat();

	virtual bool nameMatch(const std::string& name) const;

	// set flags
	void setDoor(bool v) { flags.door = v; }
	void setHidden(bool v) { flags.hidden = v; }
	void setClosed(bool v) { flags.closed = v; }
	void setOneway(bool v) { flags.oneway = v; }
	void setLocked(bool v) { flags.locked = v; }
	void setNolook(bool v) { flags.nolook = v; }
	void setDisabled(bool v) { flags.disabled = v; }

	// IO
	virtual void saveData(File::Writer& writer);
	virtual void saveHook(File::Writer& writer);
	virtual int loadNode(File::Reader& reader, File::Node& node);
	virtual int loadFinish();

protected:
	// data members
	EntityName name;
	std::string desc;
	std::string target;
	PortalDir dir;
	PortalUsage usage;
	PortalDetail detail;
	class Room* parent_room;
	std::vector<std::string> keywords;

	// flags
	struct Flags {
char hidden:
1, closed:
1, locked:
1, door:
1, nolook:
		1,
disabled:
1, oneway:
		1;

		Flags() : hidden(false), closed(false), locked(false),
				door(false), nolook(false), disabled(false), oneway(false) {}
	} flags;

protected:
	~Portal() {}

	// extra
	friend class Room;
};

#define PORTAL(ent) E_CAST(ent,Portal)

#endif


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>G-Index</title>
<meta name="date" content="2016-06-29">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

C D E F G I M O P S T U V

G

getAddress() - Method in class com.imie.component.entity.Customer

Get the Customer Address

getCity() - Method in class com.imie.component.entity.Customer

Get the Customer City

getCustomer() - Method in class com.imie.component.entity.Order

Get the Order Customer

getDateDelivery() - Method in class com.imie.component.entity.Delivery

Get the Date Delivery

getDateGreated() - Method in class com.imie.component.entity.Order

Get the Order Date Greated

getDateInvoice() - Method in class com.imie.component.entity.Invoice

Get the Date Invoice

getDeliveries() - Method in class com.imie.component.entity.Invoice

Get Deliveries

getDeliveries() - Method in class com.imie.component.entity.Order

Get the Order Deliveries

getDescription() - Method in class com.imie.component.entity.Product

Get the Product Description

getEmail() - Method in class com.imie.component.entity.Customer

Get the Customer Email

getId() - Method in class com.imie.component.entity.Customer

Get the Customer Id

getId() - Method in class com.imie.component.entity.Delivery

Get the Delivery Id

getId() - Method in class com.imie.component.entity.Invoice

Get the Invoice Id

getId() - Method in class com.imie.component.entity.Order

Get the Order Id

getId() - Method in class com.imie.component.entity.OrderDetail

Get the OrderDetail Id

getId() - Method in class com.imie.component.entity.Product

Get the Product Id

getInvoice() - Method in class com.imie.component.entity.Delivery

Get the Delivery Invoice

getItems() - Method in class com.imie.component.tool.EntityList

getName() - Method in class com.imie.component.entity.Customer

Get the Customer Name

getName() - Method in class com.imie.component.entity.Product

Get the Product Name

getOrder() - Method in class com.imie.component.entity.Delivery

Get the Delivery Order

getOrder() - Method in class com.imie.component.entity.OrderDetail

Get the OrderDetail Order

getOrderDetails() - Method in class com.imie.component.entity.Product

Get the Product OrderDetails

getOrders() - Method in class com.imie.component.controller.OrderController

Function to enable to retrieve all orders.

getOrders() - Method in class com.imie.component.entity.Customer

Get the Customer Orders

getOrdersById(int) - Method in class com.imie.component.controller.OrderController

Function to enable to retrieve one order by its id.

getPhone() - Method in class com.imie.component.entity.Customer

Get the Customer Phone

getPrice() - Method in class com.imie.component.entity.Product

Get the Product Price

getProduct() - Method in class com.imie.component.entity.OrderDetail

Get the OrderDetail Product

getQte() - Method in class com.imie.component.entity.OrderDetail

Get the OrderDetail Quantity

getRef() - Method in class com.imie.component.entity.Customer

Get the Customer Reference

getRef() - Method in class com.imie.component.entity.Delivery

Get the Delivery Reference

getRef() - Method in class com.imie.component.entity.Invoice

Get the Invoice Reference

getRef() - Method in class com.imie.component.entity.Order

Get the Order Reference

getZip() - Method in class com.imie.component.entity.Customer

Get the Customer Zip

C D E F G I M O P S T U V

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
class VectorLayer : public Layer {

protected:
#ifdef C_CODE
  const std::vector<const LayerTilesRenderParameters*> _parametersVector;
#else
  std::vector<const LayerTilesRenderParameters*> _parametersVector;
#endif
  int _selectedLayerTilesRenderParametersIndex;

#ifdef C_CODE
  VectorLayer(const std::vector<const LayerTilesRenderParameters*>& parametersVector,
              const float                                           transparency,
              const LayerCondition*                                 condition,
              std::vector<const Info*>*                             layerInfo) :
  Layer(transparency, condition, layerInfo),
  _parametersVector(parametersVector),
  _selectedLayerTilesRenderParametersIndex(0)
  {
  }
#endif
#ifdef JAVA_CODE
  protected VectorLayer(final java.util.ArrayList<LayerTilesRenderParameters> parametersVector,
                        final float transparency,
                        final LayerCondition condition,
                        final java.util.ArrayList<Info> layerInfo) {
    super(transparency, condition, layerInfo);
    _parametersVector.addAll(parametersVector);
    _selectedLayerTilesRenderParametersIndex = 0;
  }
#endif

  ~VectorLayer();

public:
  const std::vector<const LayerTilesRenderParameters*> getLayerTilesRenderParametersVector() const {
    return _parametersVector;
  }

  void selectLayerTilesRenderParameters(int index) {
    _selectedLayerTilesRenderParametersIndex = index;
  }

};

#endif


text:
class CreateImages < ActiveRecord::Migration
  def change
    create_table :images do |t|
     	t.string :url
		t.timestamps
    end
  end
end


text:
<?php

namespace spec\Sylius\Bundle\VariationBundle\DependencyInjection;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Prophecy\Argument;

/**
 * @author Adam Elsodaney <adam.elso@gmail.com>
 * @author Gonzalo Vilaseca <gvilaseca@reiss.co.uk>
 */
class SyliusVariationExtensionSpec extends ObjectBehavior
{
    function it_processes_the_configuration_and_registers_services_per_variable(ContainerBuilder $container)
    {
        $container->hasParameter('sylius.translation.mapping')->willReturn(false);
        $container->hasParameter('sylius.translation.default_mapping')->willReturn(true);
        $container->getParameter('sylius.translation.default_mapping')->willReturn(
            array(
                array('mapping' => array(
                    'translatable' => array(
                        'translations'    => 'translations',
                        'current_locale'  => 'currentLocale',
                        'fallback_locale' => 'fallbackLocale'
                    ),
                    'translation'  => array(
                        'translatable' => 'translatable',
                        'locale'       => 'locale'
                    )
                ))
            )
        );

        $variantFormType = new Definition('Some\App\Product\Form\ProductVariantType');
        $variantFormType
            ->setArguments(array('Some\App\Product\Entity\ProductVariant', '%sylius.validation_group.product_variant%', 'product'))
            ->addTag('form.type', array('alias' => 'sylius_product_variant'))
        ;

        $container->setDefinition('sylius.form.type.product_variant', $variantFormType)->shouldBeCalled();

        $variantChoiceFormType = new Definition('Sylius\Bundle\VariationBundle\Form\Type\VariantChoiceType');
        $variantChoiceFormType
            ->setArguments(array('product'))
            ->addTag('form.type', array('alias' => 'sylius_product_variant_choice'))
        ;

        $container->setDefinition('sylius.form.type.product_variant_choice', $variantChoiceFormType)->shouldBeCalled();

        $variantMatchFormType = new Definition('Sylius\Bundle\VariationBundle\Form\Type\VariantMatchType');
        $variantMatchFormType
            ->setArguments(array('product'))
            ->addTag('form.type', array('alias' => 'sylius_product_variant_match'))
        ;

        $container->setDefinition('sylius.form.type.product_variant_match', $variantMatchFormType)->shouldBeCalled();

        $optionFormType = new Definition('Some\App\Product\Form\OptionType');
        $optionFormType
            ->setArguments(array('Some\App\Product\Entity\Option',
                '%sylius.validation_group.product_option%',
                'product'
            ))
            ->addTag('form.type', array('alias' => 'sylius_product_option'))
        ;

        $container->setDefinition('sylius.form.type.product_option', $optionFormType)->shouldBeCalled();

        $optionTranslationFormType = new Definition('Some\App\Product\Form\OptionTranslationType');
        $optionTranslationFormType
            ->setArguments(array('Some\App\Product\Entity\OptionTranslation',
                '%sylius.validation_group.product_option_translation%',
                'product'
            ))
            ->addTag('form.type', array('alias' => 'sylius_product_option_translation'))
        ;

        $container->setDefinition('sylius.form.type.product_option_translation', $optionTranslationFormType)->shouldBeCalled();

        $optionChoiceFormType = new Definition('Sylius\Bundle\VariationBundle\Form\Type\OptionEntityChoiceType');
        $optionChoiceFormType
            ->setArguments(array('product', 'Some\App\Product\Entity\Option'))
            ->addTag('form.type', array('alias' => 'sylius_product_option_choice'));
        ;

        $container->setDefinition('sylius.form.type.product_option_choice', $optionChoiceFormType)->shouldBeCalled();

        $optionValueFormType = new Definition('Some\App\Product\Form\OptionValueType');
        $optionValueFormType
            ->setArguments(array(
                'Some\App\Product\Entity\OptionValue',
                '%sylius.validation_group.product_option_value%',
                'product'
            ))
            ->addTag('form.type', array('alias' => 'sylius_product_option_value'))
        ;

        $container->setDefinition('sylius.form.type.product_option_value', $optionValueFormType)->shouldBeCalled();

        $optionValueChoiceFormType = new Definition('Sylius\Bundle\VariationBundle\Form\Type\OptionValueChoiceType');
        $optionValueChoiceFormType
            ->setArguments(array('product'))
            ->addTag('form.type', array('alias' => 'sylius_product_option_value_choice'))
        ;

        $container->setDefinition('sylius.form.type.product_option_value_choice', $optionValueChoiceFormType)->shouldBeCalled();

        $optionValueCollectionFormType = new Definition('Sylius\Bundle\VariationBundle\Form\Type\OptionValueCollectionType');
        $optionValueCollectionFormType
            ->setArguments(array('product'))
            ->addTag('form.type', array('alias' => 'sylius_product_option_value_collection'))
        ;

        $container->setDefinition('sylius.form.type.product_option_value_collection', $optionValueCollectionFormType)->shouldBeCalled();

        $variables = array(
            'product' => array(
                'variable' => 'Some\App\Product\Entity\Product',
                'option' => array(
                    'model' => 'Some\App\Product\Entity\Option',
                    'form' => 'Some\App\Product\Form\OptionType',
                    'translation' => array(
                        'model' => 'Some\App\Product\Entity\OptionTranslation',
                        'form'  => array(
                            'default' => 'Some\App\Product\Form\OptionTranslationType',
                        )
                    )
                ),
                'option_value' => array(
                    'model' => 'Some\App\Product\Entity\OptionValue',
                    'form' => 'Some\App\Product\Form\OptionValueType',
                ),
                'variant' => array(
                    'model' => 'Some\App\Product\Entity\ProductVariant',
                    'form' => 'Some\App\Product\Form\ProductVariantType',
                ),
            ),
        );

        $container->setParameter('sylius.variation.variables', $variables)->shouldBeCalled();

        $userConfig = array(
            'driver' => SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
            'classes' => array(
                'product' => array(
                    'variable' => 'Some\App\Product\Entity\Product',
                    'option'   => array(
                        'model' => 'Some\App\Product\Entity\Option',
                        'form'  => 'Some\App\Product\Form\OptionType',
                        'translation' => array(
                            'model' => 'Some\App\Product\Entity\OptionTranslation',
                            'form'  => array(
                                'default' => 'Some\App\Product\Form\OptionTranslationType',
                            )
                        ),
                    ),
                    'option_value' => array(
                        'model' => 'Some\App\Product\Entity\OptionValue',
                        'form'  => 'Some\App\Product\Form\OptionValueType',
                    ),
                    'variant' => array(
                        'model' => 'Some\App\Product\Entity\ProductVariant',
                        'form'  => 'Some\App\Product\Form\ProductVariantType',
                    ),
                ),
            ),
        );

        $processedConfig = array(
            'driver' => SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
            'classes' => array(
                'product_option' => array(
                    'model' => 'Some\App\Product\Entity\Option',
                    'form'  => 'Some\App\Product\Form\OptionType',
                    'translation' => array(
                        'model' => 'Some\App\Product\Entity\OptionTranslation',
                        'form'  => array(
                            'default' => 'Some\App\Product\Form\OptionTranslationType',
                        )
                    ),
                ),
                'product_option_value' => array(
                    'model' => 'Some\App\Product\Entity\OptionValue',
                    'form'  => 'Some\App\Product\Form\OptionValueType',
                ),
                'product_variant' => array(
                    'model' => 'Some\App\Product\Entity\ProductVariant',
                    'form'  => 'Some\App\Product\Form\ProductVariantType',
                ),
            ),
            'validation_groups' => array(
                'product_variant'            => array('sylius'),
                'product_option'             => array('sylius'),
                'product_option_translation' => array('sylius'),
                'product_option_value'       => array('sylius'),
            ),
        );

        $this->process($userConfig, $container)->shouldReturn($processedConfig);
    }
}


text:
package com.ctrip.xpipe.redis.keeper.impl;

import com.ctrip.xpipe.redis.core.meta.KeeperState;
import com.ctrip.xpipe.redis.core.protocal.error.NoMasterlinkRedisError;
import com.ctrip.xpipe.redis.keeper.RedisClient;
import com.ctrip.xpipe.redis.keeper.RedisKeeperServer;
import com.ctrip.xpipe.redis.keeper.RedisKeeperServer.PROMOTION_STATE;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * @author wenchao.meng
 *
 * Aug 22, 2016
 */
public class RedisKeeperServerStatePreBackup extends AbstractRedisKeeperServerState{

	//do not set master address
	public RedisKeeperServerStatePreBackup(RedisKeeperServer redisKeeperServer) {
		super(redisKeeperServer);
	}

	@Override
	public void becomeActive(InetSocketAddress masterAddress){
		doBecomeActive(masterAddress);
	}

	@Override
	public void becomeBackup(InetSocketAddress masterAddress) {
		logger.info("[becomeBackup]{}",  masterAddress);
		doBecomeBackup(masterAddress);
	}

	@Override
	public void setPromotionState(PROMOTION_STATE promotionState, Object promitionInfo) throws IOException {
		throw new UnsupportedOperationException();

	}

	@Override
	public boolean psync(RedisClient redisClient, String[] args) throws Exception {
		throw new NoMasterlinkRedisError("keeper state :" + keeperState());
	}

	@Override
	public KeeperState keeperState() {
		return KeeperState.PRE_BACKUP;
	}

	@Override
	protected void keeperMasterChanged() {
		reconnectMaster();
	}

}


text:
    <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="hideHistory();">×</button>

          {{ histitem.date }} :
           ( {{ histitem.score }})
           "{{ histitem.name }}"
           {{ histitem.lang }},
           {{ histitem.length }}

    <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="hideHistory();" ng-i18next="close"></button>


text:
package com.binaryheart.common.security;

import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.util.Base64;
import java.util.Random;
import java.util.stream.IntStream;

import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;

import com.binaryheart.common.exception.InvalidHashException;

/**
 * PasswordUtils is a fast, simple, and lightweight utility class containing
 * series of methods for creating, comparing, hashing and random generating
 * secure passwords to be stored on database or used for other purposes. It
 * uses Java's latest built-in hashing algorithms and is independent of any
 * other libraries.
 *
 *

 * For hashing, all passwords are salted and hashed using a selectable hash
 * algorithm. The secure salted and hashed passwords are generated in the
 * below format to be used in the applications as desired:
 *

 *
 * {@code algorithm:salt:hash}
 *
 *

 * The first part is the name of the algorithm, second section is the salt
 * value and third section is the hashed value of the raw password and salt
 * combined. The separator character is a ':' (colon character). The salt
 * and hash are Base64 encoded at the end when generating the final hash string.
 *

 *
 * {@code PBKDF2WITHHMACSHA512:Gbf2cL/XUqItqaXr4P5//A==:tn2M44bFJBAGrMbvqlZB88KwtywIsRlGx8c5o25PdQ2RbOlum/1Oqz8jL3Rr31HW56Jv81HnhScpcCNZuF8AFA==}
 *
 *
See documentation for random password generation and other utility methods.

 *
 * @author Farbod Safaei - farbod@binaryheart.com
 *
 */
public final class PasswordUtils {

    private static final int HASH_SECTION_SIZE = 3;
    private static final int HASH_SECTION_ALGORITHM_INDEX = 0;
    private static final int HASH_SECTION_SALT_INDEX = 1;
    private static final int DEFAULT_SALT_SEED_SIZE = 16;
    private static final int DEFAULT_RANDOM_PASSWORD_LENGTH = 10;
    private static final int DEFAULT_HASH_ITERATION_COUNT = 99999;
    private static final int DEFAULT_HASH_KEY_LENGTH = 512;
    private static final String SECTION_SEPARATOR = ":";
    private static final String ERROR_NULL_PASSWORD = "Password is null or empty!";
    private static final SeedAlgorithm DEFAULT_RANDOM_SEED_ALGORITHM = SeedAlgorithm.SHA1PRNG;
    private static final HashAlgorithm DEFAULT_HASH_ALGORITHM = HashAlgorithm.PBKDF2WITHHMACSHA256;
    private static final int LOWER_CASE_LETTER_UTF_CODE_START = 97;
    private static final int LOWER_CASE_LETTER_UTF_CODE_END = 122;
    private static final int UPPER_CASE_LETTER_UTF_CODE_START = 65;
    private static final int UPPER_CASE_LETTER_UTF_CODE_END = 90;
    private static final int DIGIT_UTF_CODE_START = 48;
    private static final int DIGIT_UTF_CODE_END = 57;
    private static final char[] SPECIAL_CHARACTER_UTF_CODE_ARRAY = { 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
            0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x003A, 0x003B, 0x003C, 0x003F,
            0x0040, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x007B, 0x007C, 0x007D, 0x007E };

    /**
     * Generates a random password of default length
     *
     *
To make the generated password readable, 'space' character
     * is excluded.

     *
     * @return randomly generated password with default length
     */
    public static String generateRandomPassword() {
        return generateRandomPassword(DEFAULT_RANDOM_PASSWORD_LENGTH);
    }

    /**
     * Generates a random password with a given length
     *
     *
Random passwords are created from a combination of
     * alphabet letters, numbers and special characters. To make the generated
     * password readable, 'space' character is excluded.

     *
     * @param length    Desired length of password
     *
     * @return  randomly generated password
     */
    public static String generateRandomPassword(int length) {

        // Simple order of character types for randomizing/shuffling
        final int lowerCaseLetter = 0;
        final int upperCaseLetter = 1;
        final int specialCharacter = 2;
        final int digit = 3;

        if (length <= 0) {
            length = DEFAULT_RANDOM_PASSWORD_LENGTH;
        }

        Random random = new Random();
        StringBuilder result = new StringBuilder();
        IntStream stream = random.ints(length, lowerCaseLetter, digit + 1);
        stream.forEach((IntStream) -> {
            switch (IntStream) {
            case lowerCaseLetter:
                result.append(getRandomSingleCharacterFromRange(random, LOWER_CASE_LETTER_UTF_CODE_START,
                        LOWER_CASE_LETTER_UTF_CODE_END));
                break;
            case upperCaseLetter:
                result.append(getRandomSingleCharacterFromRange(random, UPPER_CASE_LETTER_UTF_CODE_START,
                        UPPER_CASE_LETTER_UTF_CODE_END));
                break;
            case digit:
                result.append(getRandomSingleCharacterFromRange(random, DIGIT_UTF_CODE_START, DIGIT_UTF_CODE_END));
                break;
            case specialCharacter:
                result.append(getRandomSpecialCharacterFromArray(random));
                break;
            }
        });
        return result.toString();
    }

    /**
     * Generates a salt value using a seed algorithm and a seed size
     *
     * @param seedAlgorithm
     *          A value from {@code SeedAlgorithm}
     *
     * @param seedSize
     *          Size of seed
     *
     * @return  byte array of random generated salt
     *
     * @throws IllegalArgumentException
     *          If seed algorithm is not correct or does not exist
     */
    public static byte[] generateRandomSalt(SeedAlgorithm seedAlgorithm, final int seedSize)
            throws IllegalArgumentException {
        try {
            return SecureRandom.getInstance(seedAlgorithm.name()).generateSeed(seedSize);
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalArgumentException(e);
        }
    }

    /**
     * Hashes a given password string
     *
     * It uses the default HashAlgorithm which is "PBKDF2WITHHMACSHA256".
     *
     * @param rawPassword
     *            raw password value in in {@code String} format
     *
     * @return String representation of a Base64 encoded hashed password and
     *            Base64 encoded salt with the format of {@code algorithm:salt:hash}
     *
     * @throws IllegalArgumentException
     *            if the parameter is null or empty string
     */
    public static String hashPassword(final String rawPassword) throws IllegalArgumentException {
        if (rawPassword == null || rawPassword.isEmpty()) {
            throw new IllegalArgumentException(ERROR_NULL_PASSWORD);
        }
        return hashPassword(rawPassword, DEFAULT_HASH_ALGORITHM);
    }

    /**
     * Hash a password string based on the given algorithm from
     * {@link HashAlgorithm}. A secure random seed will be generated each time
     * and is combined with the raw password to generate a secure hash.
     *
     *

     * Note: For better security, it recommended using one of PBKDF2 algorithms
     * over simple SHA ones. MD2 or MD5 is not recommended at all.
     *

     *
     * The output format will have 3 separated sections:
     * {@code algorithm:salt:hash}, salt and hash will be additionally Base64
     * encoded.
     *
     * @param rawPassword
     *            raw password value in {@code String} format
     *
     * @param algorithm
     *            A value from {@link HashAlgorithm}
     *
     * @return String representation of a hashed password and salt with the
     *         format of {@code algorithm:salt:hash}
     *
     * @throws IllegalArgumentException
     *             if rawPassword parameter is null or empty string
     *
     */
    public static String hashPassword(final String rawPassword, HashAlgorithm algorithm)
            throws IllegalArgumentException {
        if (rawPassword == null || rawPassword.isEmpty()) {
            throw new IllegalArgumentException(ERROR_NULL_PASSWORD);
        }
        byte[] salt = generateRandomSalt();
        String hash = createHashedPassword(rawPassword.toCharArray(), salt, algorithm);
        return generateFormattedHash(hash, Base64.getEncoder().encodeToString(salt), algorithm);
    }

    /**
     * Verifies a provided raw password (in plaintext, unsalted and not hashed)
     * by salting and hashing it and comparing it to a target value (usually
     * coming from database).
     *
     * @param rawPassword
     *            Raw password in plain text
     *
     * @param hashedPassword
     *            Fully formatted hashed password (target) to compare with,
     *            formatted as {@code algorithm:salt:hash}
     *
     * @return {@code true} if password matches the hashed value and
     *         {@code false} if the password does not match the hashed value
     *
     * @throws InvalidHashException
     *          if hashedPassword does not have the format of {@code algorithm:salt:hash}
     *
     * @throws IllegalArgumentException
     *            if any of parameters are null or empty string
     */
    public static boolean verifyPassword(final String rawPassword, final String hashedPassword)
            throws IllegalArgumentException, InvalidHashException {
        if (rawPassword == null || rawPassword.isEmpty() || hashedPassword == null || hashedPassword.isEmpty()) {
            throw new IllegalArgumentException(ERROR_NULL_PASSWORD);
        }
        boolean result = false;
        String[] suppliedPasswordArray = hashedPassword.split(SECTION_SEPARATOR);
        if (suppliedPasswordArray.length != HASH_SECTION_SIZE) {
            throw new InvalidHashException();
        }
        HashAlgorithm algorithm = HashAlgorithm.valueOf(suppliedPasswordArray[HASH_SECTION_ALGORITHM_INDEX]);
        byte[] salt = Base64.getDecoder().decode(suppliedPasswordArray[HASH_SECTION_SALT_INDEX]);
        String hash = createHashedPassword(rawPassword.toCharArray(), salt, algorithm);
        String tempHashedPassword = generateFormattedHash(hash, Base64.getEncoder().encodeToString(salt), algorithm);
        if (tempHashedPassword.equals(hashedPassword)) {
            result = true;
        }
        return result;
    }

    private static String createHashedPassword(final char[] rawPassword, final byte[] salt, HashAlgorithm algorithm) {
        try {
            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algorithm.getAlgorithm());
            KeySpec keySpec = new PBEKeySpec(rawPassword, salt, DEFAULT_HASH_ITERATION_COUNT, DEFAULT_HASH_KEY_LENGTH);
            Key secretKey = keyFactory.generateSecret(keySpec);
            return Base64.getEncoder().encodeToString(secretKey.getEncoded());
        } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
            throw new IllegalArgumentException(e);
        }
    }

    private static String generateFormattedHash(final String hash, final String salt, HashAlgorithm algorithm) {
        StringBuilder result = new StringBuilder(algorithm.name());
        result.append(SECTION_SEPARATOR).append(salt).append(SECTION_SEPARATOR).append(hash);
        return result.toString();
    }

    /**
     * Generates a salt value using the default seed size provided in this class.
     *
     *
Note: To preserve consistency seed size should not be changed.

     *
     * This method uses "SHA1PRNG" algorithm to generate the salt
     *
     * @return Base64 encoded salt value
     *
     * @throws IllegalArgumentException
     *          If seed algorithm does not exist
     */
    private static byte[] generateRandomSalt() throws IllegalArgumentException {
        return generateRandomSalt(DEFAULT_RANDOM_SEED_ALGORITHM, DEFAULT_SALT_SEED_SIZE);
    }

    /*
     * Character range:
     *
     * [A to Z]  Range:
     *           hex: [0x0041 to 0x005A]
     *           dec: [65 to 90]
     *
     * [a to z] Range:
     *          hex: [0x0061 to 0x007A]
     *          dec: [97 to 122]
     *
     * [0 to 9] Range:
     *          hex: [0x0030 to 0x0039]
     *          dec: [48 to 57]
     */
    private static char getRandomSingleCharacterFromRange(final Random random, final int startInclusive,
            final int endInclusive) {
        int randomValue = random.nextInt(endInclusive - startInclusive);
        // type casting is safe here, result is 100% within char range
        return (char) (randomValue + startInclusive);
    }

    private static char getRandomSpecialCharacterFromArray(final Random random) {
        int randomValue = random.nextInt(SPECIAL_CHARACTER_UTF_CODE_ARRAY.length);
        return SPECIAL_CHARACTER_UTF_CODE_ARRAY[randomValue];
    }

    // No reason to instantiate
    private PasswordUtils() {}

}


text:
package li.strolch.utils.helper;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * A helper class that contains mathematical computations that can be used throughout.
 *
 * @author Martin Smock <smock.martin@gmail.com>
 * @author Michael Gatto <michael@gatto.ch>
 */
public class MathHelper {

	public static final double PRECISION = 1.0E08;
	public static final int PRECISION_DIGITS = 3;

	/**
	 * Check if the two values are equal with respect to the precision
	 *
	 * @param firstValue
	 * 		the first value to compare
	 * @param secondValue
	 * 		the second value to compare to
	 *
	 * @return boolean True, if the two values are equal under the set precision. Fales, otherwise.
	 */
	public static boolean isEqualPrecision(double firstValue, double secondValue) {
		return (java.lang.Math.abs(firstValue - secondValue) < (1.0d / PRECISION));
	}

	/**
	 * Comparison between the two values. Given the precision, this function determines if the given value is smaller
	 * than the given bound.
 Note: this implementation tests if the value < bound, and if this is not so, checks if
	 * the values are equal under the precision. Thus, it's efficient whenever the value is expected to be smaller than
	 * the bound.
	 *
	 * @param value
	 * 		The value to check
	 * @param bound
	 * 		The bound given
	 *
	 * @return true, if value < bound under the given precision. False, otherwise.
	 */
	public static boolean isSmallerEqualPrecision(double value, double bound) {
		return value < bound || isEqualPrecision(value, bound);
	}

	/**
	 * Comparison between two values. Given the precision, this function determines if the given value is greater than
	 * the given bound.
 Note: This implementation tests if value > bound and, if it is so, if equality does NOT
	 * hold. Thus, it is efficient whenever the value is not expected to be greater than the bound.
	 *
	 * @param value
	 * 		The value to check
	 * @param bound
	 * 		The bound given.
	 *
	 * @return true, if value > bound and the values do not test equal under precision. False, otherwise.
	 */
	public static boolean isGreaterPrecision(double value, double bound) {
		return (value > bound) && !isEqualPrecision(value, bound);
	}

	/**
	 *
 Rounds the given double value to the number of decimals

	 *
	 *
 Warning: Do not use the returned value for further calculations. Always finish calculates and use one
	 * of the following methods:

{@link #isEqualPrecision(double, double)},

{@link
	 * #isGreaterPrecision(double, double)} or

{@link #isSmallerEqualPrecision(double, double)}

 to
	 * test on equality or greater than/ smaller than
	 *
	 * @param value
	 * 		the double value to round
	 * @param decimals
	 * 		number of decimals
	 *
	 * @return the rounded number
	 */
	public static double toPrecision(double value, int decimals) {
		if (value == 0.0)
			return 0.0;
		if (Double.isNaN(value))
			return Double.NaN;
		if (value == Double.NEGATIVE_INFINITY)
			return Double.NEGATIVE_INFINITY;
		if (value == Double.POSITIVE_INFINITY)
			return Double.POSITIVE_INFINITY;
		return BigDecimal.valueOf(value).setScale(decimals, RoundingMode.HALF_EVEN).doubleValue();
	}

	/**
	 * Returns the value with the precision where precision is set to {@link #PRECISION_DIGITS}
	 *
	 * @see #toPrecision(double, int)
	 */
	public static double toPrecision(double value) {
		return toPrecision(value, PRECISION_DIGITS);
	}

	public static String toPrecisionString(double value) {
		return toPrecisionString(value, PRECISION_DIGITS);
	}

	public static String toPrecisionString(double value, int decimals) {
		if (value == 0.0)
			return "0.0";
		if (Double.isNaN(value))
			return "" + Double.NaN;
		if (value == Double.NEGATIVE_INFINITY)
			return "" + Double.NEGATIVE_INFINITY;
		if (value == Double.POSITIVE_INFINITY)
			return "" + Double.POSITIVE_INFINITY;
		return String.valueOf(BigDecimal.valueOf(value).setScale(decimals, RoundingMode.HALF_EVEN).doubleValue());
	}

	public static int getNumberOfDecimalPlaces(double value) {
		return getNumberOfDecimalPlaces(BigDecimal.valueOf(value));
	}

	public static int getNumberOfDecimalPlaces(BigDecimal bigDecimal) {
		return Math.max(0, bigDecimal.stripTrailingZeros().scale());
	}

	/**
	 * Formatting a double to a string, without scientific notation
	 *
	 * @param d
	 * 		the double to format
	 *
	 * @return the formatted string
	 */
	public static String doubleToString(Double d) {
		if (d == null)
			return null;
		if (d.isNaN() || d.isInfinite())
			return d.toString();

		return new BigDecimal(d.toString()).stripTrailingZeros().toPlainString();
	}
}


text:
'use strict';

var UdpStream = require('../stream');

var UdpHeader = require('udp-header');

module.exports.expand = function(test) {
  test.expect(2);

  var ustream = new UdpStream();

  var input = {
    udp: new UdpHeader({
      srcPort: 123,
      dstPort: 456,
      dataLength: 50
    }),
    data: new Buffer(8*1024)
  }

  ustream.write(input);
  var out = ustream.read();

  test.equal(input.udp.length, out.offset);
  test.deepEqual(input.udp, new UdpHeader(out.data));

  test.done();
};


text:
Compile time `with` for strict mode JavaScript

[![build status](https://secure.travis-ci.org/pugjs/with.png)](http://travis-ci.org/pugjs/with)
[![Dependency Status](https://img.shields.io/david/pugjs/with.svg)](https://david-dm.org/pugjs/with)
[![NPM version](https://img.shields.io/npm/v/with.svg)](https://www.npmjs.com/package/with)

## Installation

    $ npm install with

## Usage

```js
var addWith = require('with')

addWith('obj', 'console.log(a)')
// => ';(function (console, a) {
//       console.log(a)
//     }("console" in obj ? obj.console :
//                          typeof console!=="undefined" ? console : undefined,
//       "a" in obj ? obj.a :
//                    typeof a !== "undefined" ? a : undefined));'

addWith('obj', 'console.log(a)', ['console'])
// => ';(function (console, a) {
//       console.log(a)
//     }("a" in obj ? obj.a :
//                    typeof a !== "undefined" ? a : undefined));'
```

## API

### addWith(obj, src[, exclude])

The idea is that this is roughly equivallent to:

```js
with (obj) {
  src
}
```

There are a few differences though.  For starters, assignments to variables will always remain contained within the with block.

e.g.

```js
var foo = 'foo'
with ({}) {
  foo = 'bar'
}
assert(foo === 'bar')// => This fails for compile time with but passes for native with

var obj = {foo: 'foo'}
with ({}) {
  foo = 'bar'
}
assert(obj.foo === 'bar')// => This fails for compile time with but passes for native with
```

It also makes everything be declared, so you can always do:

```js
if (foo === undefined)
```

instead of

```js
if (typeof foo === 'undefined')
```

This is not the case if foo is in `exclude`.  If a variable is excluded, we ignore it entirely.  This is useful if you know a variable will be global as it can lead to efficiency improvements.

It is also safe to use in strict mode (unlike `with`) and it minifies properly (`with` disables virtually all minification).

## License

  MIT


text:
package org.wso2.carbon.multitenancy.deployment.service.models;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * Deployment model.
 */
@SuppressWarnings("unused")
@XmlRootElement
public class Deployment {

    private String id;
    private String product;
    private String version;
    private int pattern;

    /**
     * Deployment constructor
     * @param id deployment identifier
     * @param product product name
     * @param version product version
     * @param pattern deployment pattern
     */
    public Deployment(String id, String product, String version, int pattern) {
        this.id = id;
        this.product = product;
        this.version = version;
        this.pattern = pattern;
    }

    /**
     * Default constructor is required for XML marshalling.
     */
    public Deployment() {
    }

    public String getId() {
        return id;
    }

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

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getPattern() {
        return pattern;
    }

    public void setPattern(int pattern) {
        this.pattern = pattern;
    }

    @Override
    public String toString() {
        return String.format("id: %s product: %s version: %s pattern: %d", getId(), getProduct(), getVersion(),
                getPattern());
    }
}


text:
2017-12-04 23:03:04

Run with arguments ./test/criticalpracticalreason.c2-3200

## Description


text:
require 'helper'
require 'mws/subscriptions/client'

class TestMWSSubscriptionsClient < MiniTest::Test
  def setup
    @client = MWS::Subscriptions::Client.new
    @client.primary_marketplace_id = '123'
  end

  def test_registers_destination
    operation = {
      'Action' => 'RegisterDestination',
      'MarketplaceId' => '123',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.register_destination('foo')
    end

    assert_equal operation, @client.operation
  end

  def test_registers_destination_with_alternate_marketplace
    operation = {
      'Action' => 'RegisterDestination',
      'MarketplaceId' => '321',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.register_destination('foo', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_deregisters_destination
    operation = {
      'Action' => 'DeregisterDestination',
      'MarketplaceId' => '123',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.deregister_destination('foo')
    end

    assert_equal operation, @client.operation
  end

  def test_deregisters_destination_with_alternate_marketplace
    operation = {
      'Action' => 'DeregisterDestination',
      'MarketplaceId' => '321',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.deregister_destination('foo', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_lists_registered_destinations
    operation = {
      'Action' => 'ListRegisteredDestinations',
      'MarketplaceId' => '123'
    }

    @client.stub(:run, nil) do
      @client.list_registered_destinations
    end

    assert_equal operation, @client.operation
  end

  def test_lists_registered_destinations_with_alternate_marketplace
    operation = {
      'Action' => 'ListRegisteredDestinations',
      'MarketplaceId' => '321'
    }

    @client.stub(:run, nil) do
      @client.list_registered_destinations('321')
    end

    assert_equal operation, @client.operation
  end

  def test_sends_test_notification_to_destination
    operation = {
      'Action' => 'SendTestNotificationToDestination',
      'MarketplaceId' => '123',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.send_test_notification_to_destination('foo')
    end

    assert_equal operation, @client.operation
  end

  def test_send_test_notification_to_destination_with_alternate_marketplace
    operation = {
      'Action' => 'SendTestNotificationToDestination',
      'MarketplaceId' => '321',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'foo'
    }

    @client.stub(:run, nil) do
      @client.send_test_notification_to_destination('foo', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_creates_subscription
    operation = {
      'Action' => 'CreateSubscription',
      'MarketplaceId' => '123',
      'Subscription.IsEnabled' => true,
      'Subscription.NotificationType' => 'foo',
      'Subscription.Destination.DeliveryChannel' => 'SQS',
      'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Subscription.Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.create_subscription('foo', 'bar')
    end

    assert_equal operation, @client.operation
  end

  def test_creates_subscription_with_alternate_marketplace
    operation = {
      'Action' => 'CreateSubscription',
      'MarketplaceId' => '321',
      'Subscription.IsEnabled' => true,
      'Subscription.NotificationType' => 'foo',
      'Subscription.Destination.DeliveryChannel' => 'SQS',
      'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Subscription.Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.create_subscription('foo', 'bar', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_gets_subscription
    operation = {
      'Action' => 'GetSubscription',
      'MarketplaceId' => '123',
      'NotificationType' => 'foo',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.get_subscription('foo', 'bar')
    end

    assert_equal operation, @client.operation
  end

  def test_gets_subscription_with_alternate_marketplace
    operation = {
      'Action' => 'GetSubscription',
      'MarketplaceId' => '321',
      'NotificationType' => 'foo',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.get_subscription('foo', 'bar', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_deletes_subscription
    operation = {
      'Action' => 'DeleteSubscription',
      'MarketplaceId' => '123',
      'NotificationType' => 'foo',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.delete_subscription('foo', 'bar')
    end

    assert_equal operation, @client.operation
  end

  def test_deletes_subscription_with_alternate_marketplace
    operation = {
      'Action' => 'DeleteSubscription',
      'MarketplaceId' => '321',
      'NotificationType' => 'foo',
      'Destination.DeliveryChannel' => 'SQS',
      'Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.delete_subscription('foo', 'bar', '321')
    end

    assert_equal operation, @client.operation
  end

  def test_lists_subscriptions
    operation = {
      'Action' => 'ListSubscriptions',
      'MarketplaceId' => '123'
    }

    @client.stub(:run, nil) do
      @client.list_subscriptions
    end

    assert_equal operation, @client.operation
  end

  def test_lists_subscriptions_with_alternate_marketplace
    operation = {
      'Action' => 'ListSubscriptions',
      'MarketplaceId' => '321'
    }

    @client.stub(:run, nil) do
      @client.list_subscriptions('321')
    end

    assert_equal operation, @client.operation
  end

  def test_updates_subscription
    operation = {
      'Action' => 'UpdateSubscription',
      'MarketplaceId' => '123',
      'Subscription.IsEnabled' => true,
      'Subscription.NotificationType' => 'foo',
      'Subscription.Destination.DeliveryChannel' => 'SQS',
      'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Subscription.Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.update_subscription('foo', 'bar', true)
    end

    assert_equal operation, @client.operation
  end

  def test_updates_subscription_with_alternate_marketplace
    operation = {
      'Action' => 'UpdateSubscription',
      'MarketplaceId' => '321',
      'Subscription.IsEnabled' => true,
      'Subscription.NotificationType' => 'foo',
      'Subscription.Destination.DeliveryChannel' => 'SQS',
      'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
      'Subscription.Destination.AttributeList.member.1.Value' => 'bar'
    }

    @client.stub(:run, nil) do
      @client.update_subscription('foo', 'bar', true, '321')
    end

    assert_equal operation, @client.operation
  end

  def test_gets_service_status
    operation = {
      'Action' => 'GetServiceStatus'
    }

    @client.stub(:run, nil) do
      @client.get_service_status
    end

    assert_equal operation, @client.operation
  end
end


text:
this.When(/^I do something$/, function (next) {
    next;
});

this.When(/^I do another thing$/, function (next) {
    next;
});

//Comments test
//this.When(/^I check one line commets doesn't affect steps$/, function (next) {next;});

/*
this.When(/^I check multi line commets doesn't affect steps$$/, function (next) {
    next;
});
*/

//Duplicates tests
this.When(/^I do something$/, function (next) {
    next;
});

//Or test
this.When(/^I say (a|b)$/, function (next) {
    next;
});

//Multi-lines test
this.When(
    /I do some multi-lines test/,
    function(next) {
        next;
    }
);

//Outlines test
this.When(/^I test outline using "[0-9]*" variable$/, function (next) {
    next;
});

//Lower Case step definition test
this.when(/I test lower case step definition/, function(next){})


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Trans. Mycol. Soc. Japan 21(1): 15 (1980)

#### Original name
Leptopeltis japonica Katum.

### Remarks
null


text: export { default } from 'ember-kendo-ui/components/k-timepicker';