text:
package org.sagebionetworks.repo.manager.dataaccess;

import java.util.Date;

import org.sagebionetworks.repo.model.AccessRequirement;
import org.sagebionetworks.repo.model.AccessRequirementDAO;
import org.sagebionetworks.repo.model.ConflictingUpdateException;
import org.sagebionetworks.repo.model.ManagedACTAccessRequirement;
import org.sagebionetworks.repo.model.UnauthorizedException;
import org.sagebionetworks.repo.model.UserInfo;
import org.sagebionetworks.repo.model.dataaccess.ResearchProject;
import org.sagebionetworks.repo.model.dbo.dao.dataaccess.ResearchProjectDAO;
import org.sagebionetworks.repo.transactions.WriteTransaction;
import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.util.ValidateArgument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ResearchProjectManagerImpl implements ResearchProjectManager {

	public static final int EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT = 0;

	private AccessRequirementDAO accessRequirementDao;

	private ResearchProjectDAO researchProjectDao;

	@Autowired
	public ResearchProjectManagerImpl(AccessRequirementDAO accessRequirementDao, ResearchProjectDAO researchProjectDao) {
		this.accessRequirementDao = accessRequirementDao;
		this.researchProjectDao = researchProjectDao;
	}

	@WriteTransaction
	@Override
	public ResearchProject create(UserInfo userInfo, ResearchProject toCreate) {
		ValidateArgument.required(userInfo, "The user");
		validateResearchProject(toCreate);
		toCreate = prepareCreationFields(toCreate, userInfo.getId().toString());
		return researchProjectDao.create(toCreate);
	}

	/**
	 * @param toValidate
	 */
	public void validateResearchProject(ResearchProject toValidate) {
		ValidateArgument.required(toValidate, "The research project");
		ValidateArgument.required(toValidate.getAccessRequirementId(), "The accessRequirementId");

		AccessRequirement ar = accessRequirementDao.get(toValidate.getAccessRequirementId());

		ValidateArgument.requirement(ar instanceof ManagedACTAccessRequirement, "A research project can only be associated with an ManagedACTAccessRequirement.");

		ValidateArgument.requirement(toValidate.getProjectLead() != null && toValidate.getProjectLead().length() > EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT,
				"The projectLead must contains more than "+EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT+" characters.");
		ValidateArgument.requirement(toValidate.getInstitution() != null && toValidate.getInstitution().length() > EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT,
				"The insitution must contains more than "+EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT+" characters.");

		if (((ManagedACTAccessRequirement) ar).getIsIDURequired()) {
			ValidateArgument.requirement(toValidate.getIntendedDataUseStatement() != null && toValidate.getIntendedDataUseStatement().length() > EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT,
					"The intended data use statement must contains more than "+EXCLUSIVE_LOWER_BOUND_CHAR_LIMIT+" characters.");
		}
	}

	public ResearchProject prepareCreationFields(ResearchProject toCreate, String createdBy) {
		toCreate.setCreatedBy(createdBy);
		toCreate.setCreatedOn(new Date());
		toCreate = prepareUpdateFields(toCreate, createdBy);
		return toCreate;
	}

	@Override
	public ResearchProject getUserOwnResearchProjectForUpdate(UserInfo userInfo, String accessRequirementId) throws NotFoundException {
		ValidateArgument.required(userInfo, "The user");
		ValidateArgument.required(accessRequirementId, "The accessRequirementId");
		try {
			return researchProjectDao.getUserOwnResearchProject(accessRequirementId, userInfo.getId().toString());
		} catch (NotFoundException e) {
			return createNewResearchProject(accessRequirementId);
		}
	}

	private ResearchProject createNewResearchProject(String accessRequirementId) {
		ResearchProject rp = new ResearchProject();
		rp.setAccessRequirementId(accessRequirementId);
		return rp;
	}

	@WriteTransaction
	@Override
	public ResearchProject update(UserInfo userInfo, ResearchProject toUpdate)
			throws NotFoundException, UnauthorizedException {
		ValidateArgument.required(userInfo, "The user");
		ValidateArgument.required(toUpdate, "The research project");

		ResearchProject original = researchProjectDao.getForUpdate(toUpdate.getId());

		toUpdate.setCreatedOn(original.getCreatedOn());
		toUpdate.setCreatedBy(original.getCreatedBy());
		toUpdate.setAccessRequirementId(original.getAccessRequirementId());

		validateResearchProject(toUpdate);

		if (!original.getEtag().equals(toUpdate.getEtag())) {
			throw new ConflictingUpdateException();
		}

		if (!original.getCreatedBy().equals(userInfo.getId().toString())) {
				throw new UnauthorizedException("Only the owner can perform this action.");
		}

		toUpdate = prepareUpdateFields(toUpdate, userInfo.getId().toString());
		return researchProjectDao.update(toUpdate);
	}

	public ResearchProject prepareUpdateFields(ResearchProject toUpdate, String modifiedBy) {
		toUpdate.setModifiedBy(modifiedBy);
		toUpdate.setModifiedOn(new Date());
		return toUpdate;
	}

	@WriteTransaction
	@Override
	public ResearchProject createOrUpdate(UserInfo userInfo, ResearchProject toCreateOrUpdate) {
		ValidateArgument.required(toCreateOrUpdate, "The research project");
		if (toCreateOrUpdate.getId() == null) {
			return create(userInfo, toCreateOrUpdate);
		} else {
			return update(userInfo, toCreateOrUpdate);
		}
	}

	@Override
	public void truncateAll() {
		researchProjectDao.truncateAll();
	}
}


text:
package org.apache.flink.client.testjar;

/**
 * Simulate a class that requires an external dependency.
 *
 */
public class JobWithExternalDependency {

	public static final String EXTERNAL_CLASS = "org.apache.hadoop.hive.ql.io.RCFileInputFormat";

	public static void main(String[] args) throws ClassNotFoundException {
		ClassLoader cl = Thread.currentThread().getContextClassLoader();
		Class.forName(EXTERNAL_CLASS, false, cl);
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="us-ascii"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">
	<Includes>
		<Include type="all" source="ART:FXBeam.xml" />
	</Includes>

	<ConnectionLineManager id="ConnectionLineManager">

		<!-- Shader technique that is used when rendering the phased objects. Passes in this technique determine how many phases there are-->
		<FXShader
		    ShaderName="ConnectionLine.fx"
		    TechniqueName="Default">
			<Constants>
				<Texture
					Name="LineTexture">
					<Value>FXBeam</Value>
				</Texture>
			</Constants>
        </FXShader>

	</ConnectionLineManager>
</AssetDeclaration>


text:
import React, { PropTypes } from 'react'
import Todo from './Todo'
import {List, ListItem} from 'material-ui/List';
import Divider from 'material-ui/Divider';

const TodoList = ({ todos, onTodoClick }) => (

	<List>
		{todos.map(todo =>
			<div key={todo.id}>
				<Todo
					{...todo}
					onClickHandler={() => onTodoClick(todo.id)}
					/>
				<Divider/>
			</div>
		)}
	</List>

)

TodoList.propTypes = {
	todos: PropTypes.arrayOf(PropTypes.shape({
		id: PropTypes.string.isRequired,
		completed: PropTypes.bool.isRequired,
		text: PropTypes.string.isRequired
	}).isRequired).isRequired,
	onTodoClick: PropTypes.func.isRequired
}

export default TodoList


text:
<?php

namespace Akuma\Bundle\BootswatchBundle\DependencyInjection;

use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class AkumaBootswatchExtension extends Extension implements PrependExtensionInterface
{
    protected function createConfigEntries(array $config, ContainerBuilder $container, $parent = null)
    {
        $isScalar = true;
        foreach ($config as $key => $value) {
            if (!is_numeric($key)) {
                $isScalar = false;
                break;
            }
        }
        if ($isScalar) {
            if (!is_null($parent)) {
                $container->setParameter($parent, $config);
            }
        } else {
            foreach ($config as $key => $value) {
                if (is_array($value)) {
                    //$keys = array_keys($value);
                    $this->createConfigEntries($value, $container, $parent ? $parent . '.' . $key : $key);
                } else {
                    $container->setParameter($parent ? $parent . '.' . $key : $key, $value);
                }
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $this->createConfigEntries($config, $container, $this->getAlias());

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('form.yml');
        $loader->load('twig.yml');
    }

    /**
     * Allow an extension to prepend the extension configurations.
     *
     * @param ContainerBuilder $container
     */
    public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');
        foreach ($bundles as $bundle => $class) {
            if (method_exists($this, 'prepend' . $bundle)) {
                call_user_func_array(array($this, 'prepend' . $bundle), array($container));
            }
        }
    }

    protected function getConfig(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig($this->getAlias());
        return $this->processConfiguration(new Configuration(), $configs);
    }

    protected function prependAsseticBundle(ContainerBuilder $container)
    {
        $config = $this->getConfig($container);
        if (isset($config['auto_configure']) && isset($config['auto_configure']['assetic']) && ($config['auto_configure']['assetic'])) {
            $asseticConfig = new Assetic\Configuration;
            $container->prependExtensionConfig(
                'assetic',
                array('assets' => $asseticConfig->build($config))
            );
            $container->prependExtensionConfig(
                'assetic',
                array('bundles' => array('AkumaBootswatchBundle'))
            );

            $container->prependExtensionConfig(
                'assetic',
                array('filters' =>
                    array('exposed' =>
                        array(
                            'resource' => dirname(__FILE__) . '/../Resources/config/assetic.xml',
                            //'apply_to' => array('\.less$', '\.scss$', '\.js$', '\.css$')
                        )
                    )
                )
            );
        }
    }

    /**
     * @param ContainerBuilder $container The service container
     *
     * @return void
     */
    protected function prependTwigBundle(ContainerBuilder $container)
    {
        $config = $this->getConfig($container);
        if (isset($config['auto_configure']) && isset($config['auto_configure']['twig']) && ($config['auto_configure']['twig'])) {
            foreach (array_keys($container->getExtensions()) as $name) {
                switch ($name) {
                    case 'twig':
                        $container->prependExtensionConfig(
                            $name,
                            array(
                                'form' => array('resources' => array('AkumaBootswatchBundle:Form:fields.html.twig')),
//                                'form_themes' => array('AkumaBootswatchBundle:Form:fields.html.twig')
                            )
                        );
                        break;
                }
            }
        }
    }

    /**
     * @param ContainerBuilder $container The service container
     *
     * @return void
     */
    protected function prependKnpMenuBundle(ContainerBuilder $container)
    {
        $config = $this->getConfig($container);
        if (isset($config['auto_configure']) && isset($config['auto_configure']['knp_menu']) && ($config['auto_configure']['knp_menu'])) {
            foreach (array_keys($container->getExtensions()) as $name) {
                switch ($name) {
                    case 'knp_menu':
                        $container->prependExtensionConfig(
                            $name,
                            array('twig' => array('template' => 'AkumaBootswatchBundle:Default:_menu.html.twig'))
                        );
                        break;
                }
            }
        }
    }

    /**
     * @param ContainerBuilder $container The service container
     *
     * @return void
     */
    protected function prependKnpPaginatorBundle(ContainerBuilder $container)
    {
        $config = $this->getConfig($container);
        if (isset($config['auto_configure']) && isset($config['auto_configure']['knp_paginator']) && ($config['auto_configure']['knp_paginator'])) {
            foreach (array_keys($container->getExtensions()) as $name) {
                switch ($name) {
                    case 'knp_paginator':
                        $container->prependExtensionConfig(
                            $name,
                            array('template' => array('pagination' => 'AkumaBootswatchBundle:Default:_pagination.html.twig'))
                        );
                        break;
                }
            }
        }
    }

    public function getXsdValidationBasePath()
    {
        return dirname(__FILE__) . '/../Resources/config/';
    }

    public function getNamespace()
    {
        return 'http://www.example.com/symfony/schema/';
    }
}


text:
package google

import (
	"net/url"

	"golang.org/x/oauth2"
)

const (
	ProviderID = 1
	Scheme     = "https"
	Host       = "www.googleapis.com"
	Opaque     = "//www.googleapis.com/plus/v1/people/me"
	AuthURL    = "https://accounts.google.com/o/oauth2/auth"
	TokenURL   = "https://accounts.google.com/o/oauth2/token"
)

type GoogleUser struct {
	Name         string
	Email        string
	AccessToken  string
	RefreshToken string
}

var RequestURL = &url.URL{
	Scheme: Scheme,
	Host:   Host,
	Opaque: Opaque,
}

var Endpoint = oauth2.Endpoint{
	AuthURL:  AuthURL,
	TokenURL: TokenURL,
}


text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008-2016. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

#include "ADXL362.h"
#include "DigitalInput.h"
#include "DigitalOutput.h"
#include "DriverStation.h"
#include "LiveWindow/LiveWindow.h"

static uint8_t kRegWrite = 0x0A;
static uint8_t kRegRead = 0x0B;

static uint8_t kPartIdRegister = 0x02;
static uint8_t kDataRegister = 0x0E;
static uint8_t kFilterCtlRegister = 0x2C;
static uint8_t kPowerCtlRegister = 0x2D;

//static uint8_t kFilterCtl_Range2G = 0x00;
//static uint8_t kFilterCtl_Range4G = 0x40;
//static uint8_t kFilterCtl_Range8G = 0x80;
static uint8_t kFilterCtl_ODR_100Hz = 0x03;

static uint8_t kPowerCtl_UltraLowNoise = 0x20;
//static uint8_t kPowerCtl_AutoSleep = 0x04;
static uint8_t kPowerCtl_Measure = 0x02;

/**
 * Constructor.  Uses the onboard CS1.
 *
 * @param range The range (+ or -) that the accelerometer will measure.
 */
ADXL362::ADXL362(Range range) : ADXL362(SPI::Port::kOnboardCS1, range) {}

/**
 * Constructor.
 *
 * @param port The SPI port the accelerometer is attached to
 * @param range The range (+ or -) that the accelerometer will measure.
 */
ADXL362::ADXL362(SPI::Port port, Range range) : m_spi(port) {
  m_spi.SetClockRate(3000000);
  m_spi.SetMSBFirst();
  m_spi.SetSampleDataOnFalling();
  m_spi.SetClockActiveLow();
  m_spi.SetChipSelectActiveLow();

  // Validate the part ID
  uint8_t commands[3];
  commands[0] = kRegRead;
  commands[1] = kPartIdRegister;
  commands[2] = 0;
  m_spi.Transaction(commands, commands, 3);
  if (commands[2] != 0xF2) {
    DriverStation::ReportError("could not find ADXL362");
    m_gsPerLSB = 0.0;
    return;
  }

  SetRange(range);

  // Turn on the measurements
  commands[0] = kRegWrite;
  commands[1] = kPowerCtlRegister;
  commands[2] = kPowerCtl_Measure | kPowerCtl_UltraLowNoise;
  m_spi.Write(commands, 3);

  HALReport(HALUsageReporting::kResourceType_ADXL362, port);

  LiveWindow::GetInstance()->AddSensor("ADXL362", port, this);
}

void ADXL362::SetRange(Range range) {
  if (m_gsPerLSB == 0.0) return;

  uint8_t commands[3];

  switch (range) {
    case kRange_2G:
      m_gsPerLSB = 0.001;
      break;
    case kRange_4G:
      m_gsPerLSB = 0.002;
      break;
    case kRange_8G:
    case kRange_16G:  // 16G not supported; treat as 8G
      m_gsPerLSB = 0.004;
      break;
  }

  // Specify the data format to read
  commands[0] = kRegWrite;
  commands[1] = kFilterCtlRegister;
  commands[2] = kFilterCtl_ODR_100Hz | (uint8_t)((range & 0x03) << 6);
  m_spi.Write(commands, 3);
}

double ADXL362::GetX() { return GetAcceleration(kAxis_X); }

double ADXL362::GetY() { return GetAcceleration(kAxis_Y); }

double ADXL362::GetZ() { return GetAcceleration(kAxis_Z); }

/**
 * Get the acceleration of one axis in Gs.
 *
 * @param axis The axis to read from.
 * @return Acceleration of the ADXL362 in Gs.
 */
double ADXL362::GetAcceleration(ADXL362::Axes axis) {
  if (m_gsPerLSB == 0.0) return 0.0;

  uint8_t buffer[4];
  uint8_t command[4] = {0, 0, 0, 0};
  command[0] = kRegRead;
  command[1] = kDataRegister + (uint8_t)axis;
  m_spi.Transaction(command, buffer, 4);

  // Sensor is little endian... swap bytes
  int16_t rawAccel = buffer[3] << 8 | buffer[2];
  return rawAccel * m_gsPerLSB;
}

/**
 * Get the acceleration of all axes in Gs.
 *
 * @return An object containing the acceleration measured on each axis of the
 * ADXL362 in Gs.
 */
ADXL362::AllAxes ADXL362::GetAccelerations() {
  AllAxes data = AllAxes();
  if (m_gsPerLSB == 0.0) {
    data.XAxis = data.YAxis = data.ZAxis = 0.0;
    return data;
  }

  uint8_t dataBuffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
  int16_t rawData[3];

  // Select the data address.
  dataBuffer[0] = kRegRead;
  dataBuffer[1] = kDataRegister;
  m_spi.Transaction(dataBuffer, dataBuffer, 8);

  for (int32_t i = 0; i < 3; i++) {
    // Sensor is little endian... swap bytes
    rawData[i] = dataBuffer[i * 2 + 3] << 8 | dataBuffer[i * 2 + 2];
  }

  data.XAxis = rawData[0] * m_gsPerLSB;
  data.YAxis = rawData[1] * m_gsPerLSB;
  data.ZAxis = rawData[2] * m_gsPerLSB;

  return data;
}

std::string ADXL362::GetSmartDashboardType() const {
  return "3AxisAccelerometer";
}

void ADXL362::InitTable(std::shared_ptr<ITable> subtable) {
  m_table = subtable;
  UpdateTable();
}

void ADXL362::UpdateTable() {
  if (m_table != nullptr) {
    m_table->PutNumber("X", GetX());
    m_table->PutNumber("Y", GetY());
    m_table->PutNumber("Z", GetZ());
  }
}

std::shared_ptr<ITable> ADXL362::GetTable() const { return m_table; }


text:
<?php
/**
 * Global Configuration Override
 *
 * You can use this file for overriding configuration values from modules, etc.
 * You would place values in here that are agnostic to the environment and not
 * sensitive to security.
 *
 * @NOTE: In practice, this file will typically be INCLUDED in your source
 * control, so do not include passwords or other sensitive information in this
 * file.
 */
return array(
	"db" => array(
	 	"driver"   => "Pdo_Mysql",
	 	"database" => "zend_auto",
	 	"charset"  => "utf8",
	 	"adapters" => array(
	 		"db_demo" => array(
	 			"driver"   => "Pdo_Mysql",
			 	"database" => "demo_user",
			 	"charset"  => "utf8"
	 		)
	 	)
	),
	"service_manager" => array(
	 	'abstract_factories' => array(
            'Zend\Db\Adapter\AdapterAbstractServiceFactory',
        ),
	 	"factories" => array(
	 		"Zend\Db\Adapter\Adapter" => "Zend\Db\Adapter\AdapterServiceFactory",
	 	),
	 	"aliases"   => array(
	 		"dbConfig" => "Zend\Db\Adapter\Adapter"
	 	)
	)
)
?>


text:
#ifndef GFX_BLUR_H
#define GFX_BLUR_H

#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "gfxTypes.h"
#include "gfxUtils.h"
#include "nsRect.h"

/**
 * Implementation of a triple box blur approximation of a Gaussian blur.
 *
 * A Gaussian blur is good for blurring because, when done independently
 * in the horizontal and vertical directions, it matches the result that
 * would be obtained using a different (rotated) set of axes.  A triple
 * box blur is a very close approximation of a Gaussian.
 *
 * Creates an 8-bit alpha channel context for callers to draw in,
 * spreads the contents of that context, blurs the contents, and applies
 * it as an alpha mask on a different existing context.
 *
 * A spread N makes each output pixel the maximum value of all source
 * pixels within a square of side length 2N+1 centered on the output pixel.
 *
 * A temporary surface is created in the Init function. The caller then draws
 * any desired content onto the context acquired through GetContext, and lastly
 * calls Paint to apply the blurred content as an alpha mask.
 */
class THEBES_API gfxAlphaBoxBlur
{
public:
    gfxAlphaBoxBlur();

    ~gfxAlphaBoxBlur();

    /**
     * Constructs a box blur and initializes the temporary surface.
     * @param aRect The coordinates of the surface to create in device units.
     *
     * @param aBlurRadius The blur radius in pixels.  This is the radius of
     *   the entire (triple) kernel function.  Each individual box blur has
     *   radius approximately 1/3 this value, or diameter approximately 2/3
     *   this value.  This parameter should nearly always be computed using
     *   CalculateBlurRadius, below.
     *
     * @param aDirtyRect A pointer to a dirty rect, measured in device units, if available.
     *  This will be used for optimizing the blur operation. It is safe to pass NULL here.
     *
     * @param aSkipRect A pointer to a rect, measured in device units, that represents an area
     *  where blurring is unnecessary and shouldn't be done for speed reasons. It is safe to
     *  pass NULL here.
     */
    gfxContext* Init(const gfxRect& aRect,
                     const gfxIntSize& aSpreadRadius,
                     const gfxIntSize& aBlurRadius,
                     const gfxRect* aDirtyRect,
                     const gfxRect* aSkipRect);

    /**
     * Returns the context that should be drawn to supply the alpha mask to be
     * blurred. If the returned surface is null, then there was an error in
     * its creation.
     */
    gfxContext* GetContext()
    {
        return mContext;
    }

    /**
     * Does the actual blurring/spreading and mask applying. Users of this
     * object must have drawn whatever they want to be blurred onto the internal
     * gfxContext returned by GetContext before calling this.
     *
     * @param aDestinationCtx The graphics context on which to apply the
     *  blurred mask.
     */
    void Paint(gfxContext* aDestinationCtx, const gfxPoint& offset = gfxPoint(0.0, 0.0));

    /**
     * Calculates a blur radius that, when used with box blur, approximates
     * a Gaussian blur with the given standard deviation.  The result of
     * this function should be used as the aBlurRadius parameter to Init,
     * above.
     */
    static gfxIntSize CalculateBlurRadius(const gfxPoint& aStandardDeviation);

protected:
    /**
     * The spread radius, in pixels.
     */
    gfxIntSize mSpreadRadius;
    /**
     * The blur radius, in pixels.
     */
    gfxIntSize mBlurRadius;

    /**
     * The context of the temporary alpha surface.
     */
    nsRefPtr<gfxContext> mContext;

    /**
     * The temporary alpha surface.
     */
    nsRefPtr<gfxImageSurface> mImageSurface;

    /**
     * A copy of the dirty rect passed to Init(). This will only be valid if
     * mHasDirtyRect is TRUE.
     */
    gfxRect mDirtyRect;
    /**
     * A rect indicating the area where blurring is unnecessary, and the blur
     * algorithm should skip over it.
     */
    nsIntRect mSkipRect;

    bool mHasDirtyRect;
};

#endif /* GFX_BLUR_H */


text:
***********************
Noise model diagnostics
***********************

.. module:: pints.residuals_diagnostics

Pints includes functionality to generate diagnostic plots of the residuals. These tools may be useful to evaluate the validity of a noise model.

Plotting functions:

- :func:`plot_residuals_autocorrelation`
- :func:`plot_residuals_binned_autocorrelation`
- :func:`plot_residuals_binned_std`
- :func:`plot_residuals_distance`
- :func:`plot_residuals_vs_output`

Diagnostics:

- :func:`acorr`
- :func:`calculate_residuals`

Plotting functions
------------------

.. autofunction:: plot_residuals_autocorrelation

.. autofunction:: plot_residuals_binned_autocorrelation

.. autofunction:: plot_residuals_binned_std

.. autofunction:: plot_residuals_distance

.. autofunction:: plot_residuals_vs_output

Diagnostics
-----------

.. autofunction:: acorr

.. autofunction:: calculate_residuals


text:
A simple extension (for both Safari and Chrome) to clean up the display and speed up the loading time of macrumors.com.

For more information visit [http://cornellcampbell.com/extensions/posts/2/macrumors-minimal/](http://cornellcampbell.com/extensions/posts/2/macrumors-minimal/).

## Downloads

[Safari Extension](http://cornellcampbell.com/extensions/download/MacRumorsMinimal-2.0.1.safariextz/)

[Chrome Extension](https://chrome.google.com/webstore/detail/macrumors-minimal/knlichnkddfegomdakjjbcgmnkenaack)


text:
package com.hufeiya.SignIn.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.transition.TransitionInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import com.hufeiya.SignIn.R;
import com.hufeiya.SignIn.fragment.CategorySelectionFragment;
import com.hufeiya.SignIn.helper.ApiLevelHelper;
import com.hufeiya.SignIn.helper.PreferencesHelper;
import com.hufeiya.SignIn.jsonObject.JsonUser;
import com.hufeiya.SignIn.model.User;
import com.hufeiya.SignIn.net.AsyncHttpHelper;
import com.hufeiya.SignIn.widget.AvatarView;

public class CategorySelectionActivity extends AppCompatActivity {

    private static final String EXTRA_PLAYER = "player";
    private User user;

    public static void start(Activity activity, User user, ActivityOptionsCompat options) {
        Intent starter = getStartIntent(activity, user);
        ActivityCompat.startActivity(activity, starter, options.toBundle());
    }

    public static void start(Context context, User user) {
        Intent starter = getStartIntent(context, user);
        context.startActivity(starter);
    }

    @NonNull
    static Intent getStartIntent(Context context, User user) {
        Intent starter = new Intent(context, CategorySelectionActivity.class);
        starter.putExtra(EXTRA_PLAYER, user);
        return starter;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_category_selection);
        user = getIntent().getParcelableExtra(EXTRA_PLAYER);
        if (!PreferencesHelper.isSignedIn(this) && user != null) {
            PreferencesHelper.writeToPreferences(this, user);
        }
        setUpToolbar(user);
        if (savedInstanceState == null) {
            attachCategoryGridFragment();
        } else {
            setProgressBarVisibility(View.GONE);
        }
        supportPostponeEnterTransition();

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    public void setUpToolbar(User user) {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_player);
        setSupportActionBar(toolbar);
        //noinspection ConstantConditions
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        final AvatarView avatarView = (AvatarView) toolbar.findViewById(R.id.avatar);
        avatarView.setAvatar(user.getAvatar().getDrawableId());
        //noinspection PrivateResource
        ((TextView) toolbar.findViewById(R.id.title)).setText(getDisplayName());
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_category, menu);
        return true;
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.category_container);
        if (fragment != null) {
            fragment.onActivityResult(requestCode, resultCode, data);
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.sign_out: {
                signOut();
                return true;
            }
        }
        return super.onOptionsItemSelected(item);
    }

    @SuppressLint("NewApi")
    private void signOut() {
        AsyncHttpHelper.clearAllCookies();

        PreferencesHelper.signOut(this);
        if (ApiLevelHelper.isAtLeast(Build.VERSION_CODES.LOLLIPOP)) {
            getWindow().setExitTransition(TransitionInflater.from(this)
                    .inflateTransition(R.transition.category_enter));
        }
        SignInActivity.start(this, false);
        ActivityCompat.finishAfterTransition(this);
    }

    private String getDisplayName() {
        JsonUser user = AsyncHttpHelper.user;
        if (user == null){
            return "登录中...";
        }
        String type;
        if (user.getUserType()){
            type = "同学";
        }else{
            type = "老师";
        }
        return  user.getUsername() + "  " + type;
    }

    private void attachCategoryGridFragment() {
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        Fragment fragment = supportFragmentManager.findFragmentById(R.id.category_container);
        if (!(fragment instanceof CategorySelectionFragment)) {
            fragment = CategorySelectionFragment.newInstance();
        }
        supportFragmentManager.beginTransaction()
                .replace(R.id.category_container, fragment)
                .commit();
        setProgressBarVisibility(View.GONE);
    }

    private void setProgressBarVisibility(int visibility) {
        findViewById(R.id.progress).setVisibility(visibility);
    }

    public User getUser(){
        return user;
    }
}


text:
(function() {
    'use strict';

    angular.module('journal.component.settings')
        .service('SettingsService', ['$http', 'AuthService', 'CONFIG', SettingsService]);

    function SettingsService($http, AuthService, CONFIG) {
        this.apiUrl = CONFIG.API_URL;

        this.getSettings = function(fields) {
            return $http.get(this.apiUrl + '/settings/get?fields=' + fields);
        };

        this.saveSettings = function(settings) {
            var requests = {},
                token = AuthService.getToken();

            for (var s in settings) {
                requests[s] = settings[s];
            }

            return $http.post(this.apiUrl + '/settings/save?token=' + token, requests);
        };

        this.themes = function() {
            return $http.get(this.apiUrl + '/settings/themes');
        };
    }
})();


text:
package com.adobe.aem.demo;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.log4j.Logger;

public class Hostname {

	static Logger logger = Logger.getLogger(Hostname.class);

	public static void main(String[] args) {

		String hostname = "localhost";
		try {
			hostname = InetAddress.getLocalHost().getHostName();
			logger.debug("Hostname resolved to: " + hostname);
		} catch (UnknownHostException e) {
			logger.error(e.getMessage());
		}

		System.out.println(hostname);

	}

}


text:
require "net/http"

module Appsignal
  class Hooks
    # @api private
    class NetHttpHook < Appsignal::Hooks::Hook
      register :net_http

      def dependencies_present?
        Appsignal.config && Appsignal.config[:instrument_net_http]
      end

      def install
        Net::HTTP.class_eval do
          alias request_without_appsignal request

          def request(request, body = nil, &block)
            Appsignal.instrument(
              "request.net_http",
              "#{request.method} #{use_ssl? ? "https" : "http"}://#{request["host"] || address}"
            ) do
              request_without_appsignal(request, body, &block)
            end
          end
        end
      end
    end
  end
end


text:
/* The following styles are for IE 8 only*/

/*** Start jQuery UI Theme Styles ***/

/* Button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
	margin-top: -9px;
}

/*** End jQuery UI Theme Styles ***/


text:
<?php

/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * admin area. This file also includes all of the dependencies used by the plugin,
 * registers the activation and deactivation functions, and defines a function
 * that starts the plugin.
 *
 * @link              <%= plugin.website %>
 * @since             1.0.0
 * @package           <%= plugin.name.className %>
 *
 * @wordpress-plugin
 * Plugin Name:       <%= plugin.name.human %>
 * Plugin URI:        <%= plugin.website %>
 * Description:       <%= plugin.description %>
 * Version:           1.0.0
 * Author:            <%= plugin.author.name %>
 * Author URI:        <%= plugin.author.website %>
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       <%= plugin.name.fileName %>
 * Domain Path:       /languages
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}<% if (plugin.featureList.includes('composer')) { %>

require_once __DIR__ . '/vendor/autoload.php';<% } %><% if (plugin.featureList.includes('activationHook')) { %>

/**
 * The code that runs during plugin activation.
 * This action is documented in includes/class-<%= plugin.name.fileName %>-activator.php
 */
function activate_<%= plugin.name.instanceName %>() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/class-<%= plugin.name.fileName %>-activator.php';
	<%= plugin.name.className %>_Activator::activate();
}<% } %><% if (plugin.featureList.includes('deactivationHook')) { %>

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-<%= plugin.name.fileName %>-deactivator.php
 */
function deactivate_<%= plugin.name.instanceName %>() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/class-<%= plugin.name.fileName %>-deactivator.php';
	<%= plugin.name.className %>_Deactivator::deactivate();
}<% } %><% if (plugin.featureList.includes('activationHook')) { %>

register_activation_hook( __FILE__, 'activate_<%= plugin.name.instanceName %>' );<% } %><% if (plugin.featureList.includes('deactivationHook')) { %>

register_deactivation_hook( __FILE__, 'deactivate_<%= plugin.name.instanceName %>' );<% } %>

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path( __FILE__ ) . 'includes/class-<%= plugin.name.fileName %>.php';

/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * @since    1.0.0
 */
function run_<%= plugin.name.instanceName %>() {

	$plugin = new <%= plugin.name.className %>();
	$plugin->run();

}
run_<%= plugin.name.instanceName %>();


text:
using Aspose.Email.Live.Demos.UI.Models.Common;
using Aspose.Email.Live.Demos.UI.Models;
using Aspose.Email.Live.Demos.UI.Services;
using System;
using System.Collections;
using System.Web;
using System.Web.Mvc;

namespace Aspose.Email.Live.Demos.UI.Controllers
{
	public class WatermarkController : BaseController
	{
		public override string Product => (string)RouteData.Values["product"];

		public ActionResult Watermark()
		{

			var model = new ViewModel(this, "Watermark")
			{
				ControlsView = "WatermarkControls",
				MaximumUploadFiles = 10,
				DropOrUploadFileLabel = Resources["DropOrUploadFiles"]
				//,
				//ShowViewerButton = false
			};
			if (model.RedirectToMainApp)
				return Redirect("/email/" + model.AppName.ToLower());
			return View(model);
		}

	}
}


text:
namespace nano
{
        ///
        /// \brief the line-search algorithm described here:
        ///     see "A view of line-searches", C. Lemarechal
        ///
        class lsearch_lemarechal_t final : public lsearch_strategy_t
        {
        public:

                lsearch_lemarechal_t() = default;
                bool get(const solver_state_t& state0, const scalar_t t0, solver_state_t& state) final;
        };
}


text:
extern zend_class_entry *hashable_ce;

void php_ds_register_hashable();

#endif


text:
package ca.stellardrift.permissionsex.util.glob;

import org.checkerframework.checker.nullness.qual.Nullable;

/**
 * This error is thrown when invalid glob syntax is presented
 */
public final class GlobParseException extends Exception {
    private static final long serialVersionUID = 1019525110836056128L;

    GlobParseException(final @Nullable String msg) {
        super(msg);
    }

    GlobParseException(final @Nullable String msg, final @Nullable Throwable cause) {
        super(msg, cause);
    }
}


text:
package org.openehealth.ipf.platform.camel.core.util;

import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Message;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.support.DefaultExchange;

/**
 * Utility related to Camel {@link Exchange}s.
 *
 * @author Martin Krasser
 */
public class Exchanges {

    /**
     * Creates a {@link ProducerTemplate} from the given {@link Exchange}
     *
     * @param exchange message exchange.
     * @return a producer template.
     */
    public static ProducerTemplate producerTemplate(Exchange exchange) {
        return exchange.getContext().createProducerTemplate();
    }

    /**
     * Returns the message where to write results.
     *
     * @param exchange message exchange.
     * @return result message.
     * @deprecated
     */
    public static Message resultMessage(Exchange exchange) {
        return exchange.getMessage();
    }

    /**
     * Returns the message where to write results. This method copies the
     * in-message to the out-message if the exchange is out-capable.
     *
     * @param exchange message exchange.
     * @return result message.
     */
    public static Message prepareResult(Exchange exchange) {
        var result = exchange.getMessage();
        if (exchange.getPattern().isOutCapable()) {
            result.copyFrom(exchange.getIn());
        }
        return result;
    }

    /**
     * Creates a new {@link Exchange} instance from the given
     * exchange. The resulting exchange's pattern is defined by
     * pattern.
     *
     * @param source
     *            exchange to copy from.
     * @param pattern
     *            exchange pattern to set.
     * @return created exchange.
     */
    public static Exchange createExchange(Exchange source, ExchangePattern pattern) {
        var target = new DefaultExchange(source.getContext());
        copyExchange(source, target);
        target.setPattern(pattern);
        return target;
    }

    /**
     * Creates a new {@link Exchange} instance using context.
     * The resulting exchange's pattern is defined by pattern.
     *
     * @param context
     *            Camel context.
     * @param pattern
     *            exchange pattern.
     * @return created exchange.
     */
    public static Exchange createExchange(CamelContext context, ExchangePattern pattern) {
        var target = new DefaultExchange(context);
        target.setPattern(pattern);
        return target;
    }

    /**
     * Copies the exchange's in-message to the out-message if the exchange
     * pattern is {@link ExchangePattern#InOut}.
     *
     * @param exchange
     *            message exchange.
     */
    public static void copyInput(Exchange exchange) {
        prepareResult(exchange);
    }

    /**
     * Copies the source exchange to target exchange
     * preserving the {@link ExchangePattern} of target.
     *
     * @param source source exchange.
     * @param target target exchange.
     *
     * @see #resultMessage(Exchange)
     */
    public static void copyExchange(Exchange source, Exchange target) {
        if (source == target) {
            // no need to copy
            return;
        }

        // copy message
        target.getMessage().copyFrom(source.getMessage());

        // copy exception
        target.setException(source.getException());

        // copy properties
        target.getProperties().putAll(source.getProperties());

    }

    /**
     * Extracts the exception handled while processing the given
     * exchange (if any), and optionally marks the exchange as non-failed.
     *
     * @param exchange
     *      Camel exchange, should be not null.
     * @param cleanup
     *      true iff the information about the occurred exception
     *      should be removed from the given exchange.
     * @return
     *      an {@link Exception} instance, or null when no exception was handled.
     */
    public static Exception extractException(Exchange exchange, boolean cleanup) {
        var exception = exchange.getException();
        if (exception != null) {
            if (cleanup) {
                exchange.setException(null);
            }
        }
        else if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) != null) {
            exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
            if (cleanup) {
                exchange.removeProperty(Exchange.EXCEPTION_CAUGHT);
                exchange.removeProperty(Exchange.ERRORHANDLER_HANDLED);
            }
        }
        return exception;
    }

    /**
     * Extracts the exception handled while processing the given
     * exchange (if any), and marks the exchange as non-failed.
     *

     * This method corresponds to {@link #extractException(org.apache.camel.Exchange, boolean)}
     * with the second parameter set to true.
     *

     *
     * @param exchange
     *      Camel exchange, should be not null.
     * @return
     *      an {@link Exception} instance, or null when no exception was handled.
     */
    public static Exception extractException(Exchange exchange) {
        return extractException(exchange, true);
    }

}


text:
package org.spongepowered.despector.ast.stmt;

import org.spongepowered.despector.ast.AstVisitor;
import org.spongepowered.despector.util.serialization.MessagePacker;

import java.io.IOException;

/**
 * Abstract type for a statement.
 */
public interface Statement {

    /**
     * Accepts the given visitor.
     */
    void accept(AstVisitor visitor);

    void writeTo(MessagePacker pack) throws IOException;

    @Override
    String toString();
}


text:
// SPDX-License-Identifier: Apache-2.0

#include <stddef.h>
#include <string.h>
#include "private/cache.h"
#include "private/config/wrapper/getpagesize.h"
#include "private/inthelper.h"
#include "private/memory.h"
#include "private/strbuilder.h"

static struct cache *strbuilder_cache = NULL;

static void
strbuilder_init( void *builder ) {
  struct strbuilder *b = ( struct strbuilder * ) builder;

  b->buffer = NULL;
}

static void
strbuilder_teardown( void *builder ) {
  const struct strbuilder *b = ( struct strbuilder * ) builder;

  free_mem( b->buffer );
}

static size_t
increase_size( struct strbuilder *builder ) {
  const char *old_buffer;
  char *new_buffer;
  size_t old_size;
  size_t new_size;

  old_buffer = builder->buffer;
  old_size = builder->buffer_end - old_buffer;
  new_size = old_size * 2;
  new_buffer = realloc_mem( old_buffer, new_size );
  if( !new_buffer ) {
    return 0;
  }

  builder->position = new_buffer + ( builder->position - old_buffer );
  builder->buffer = new_buffer;
  builder->buffer_end = new_buffer + new_size;

  return old_size;
}

struct strbuilder *
strbuilder_append_buffer( struct strbuilder *builder, const char *buffer,
                          size_t size ) {
  size_t size_added;
  size_t size_left;

  if( !builder || !buffer ) {
    return NULL;
  }

  size_left = builder->buffer_end - builder->position;
  while ( size_left < size ) {
    size_added = increase_size( builder );
    if( size_added == 0 ) {
      return NULL;
    } else {
      size_left += size_added;
    }
  }

  memcpy( builder->position, buffer, size );
  builder->position += size;

  return builder;
}

struct strbuilder *
strbuilder_append_char( struct strbuilder *builder, char c ) {
  size_t old_size;

  if( !builder ) {
    return NULL;
  }

  if( builder->position == builder->buffer_end ) {
    old_size = increase_size( builder );
    if( old_size == 0 ) {
      return NULL;
    }
  }

  *( builder->position ) = c;
  ( builder->position )++;

  return builder;
}

struct strbuilder *
strbuilder_append_positive_int( struct strbuilder *builder, int i ) {
  struct strbuilder *result = builder;
  char buffer[MAX_INT_SIZE];
  size_t digit_count = 0;

  if( i == 0 ) {
    return strbuilder_append_char( builder, '0' );
  }

  while( i != 0 ) {
    buffer[digit_count] = ( i % 10 ) + 48;
    i /= 10;
    digit_count++;
  }

  while( digit_count > 0 ) {
    digit_count--;
    result = strbuilder_append_char( result, buffer[digit_count] );
  }

  return result;
}

struct strbuilder *
strbuilder_append_string( struct strbuilder *builder, const char *str ) {
  const char *curr;
  size_t old_size;

  if( !builder ) {
    return NULL;
  }

  curr = str;
  while ( *curr != '\0' ) {
    if( builder->position == builder->buffer_end ) {
      old_size = increase_size( builder );
      if( old_size == 0 ) {
        return NULL;
      }
    }

    *( builder->position ) = *curr;
    builder->position++;

    curr++;
  }

  return builder;
}

void
strbuilder_free_all( void ) {
  cache_destroy( strbuilder_cache );
  strbuilder_cache = NULL;
}

char *
strbuilder_get_buffer( struct strbuilder *builder, size_t * length ) {
  *length = builder->position - builder->buffer;
  return builder->buffer;
}

void
strbuilder_destroy( const struct strbuilder *builder ) {
  cache_free( strbuilder_cache, builder );
}

struct strbuilder *
strbuilder_new( void ) {
  struct strbuilder *builder;
  size_t size;

  if( !strbuilder_cache ) {
    strbuilder_cache = cache_new( sizeof( *builder ),
                                  strbuilder_init,
                                  strbuilder_teardown );

    if( !strbuilder_cache ) {
      goto fail;
    }
  }

  builder = cache_alloc( strbuilder_cache );
  if( !builder ) {
    goto fail;
  }

  if( !builder->buffer ) {
    size = config_getpagesize(  );

    builder->buffer = alloc_mem( size );
    if( !builder->buffer ) {
      goto fail_buffer;
    }

    builder->buffer_end = builder->buffer + size;
  }

  builder->position = builder->buffer;
  return builder;

fail_buffer:
  cache_free( strbuilder_cache, builder );
fail:
  return NULL;
}

char *
strbuilder_to_string( const struct strbuilder *builder ) {
  size_t string_length;
  char *string;

  if( !builder ) {
    goto fail;
  }

  string_length = builder->position - builder->buffer;
  string = alloc_mem( string_length + 1 );
  if( !string ) {
    goto fail;
  }

  memcpy( string, builder->buffer, string_length );
  string[string_length] = '\0';

  return string;

fail:
  return NULL;
}


text:
var React = require('react');

var pagination = React.createClass({
	getInitialState: function() {
		return {
			start: 0
		};
	},
	render: function() {
		return (

				        	«

				        	<

				        	>

				          »

 / {this.props.max + 1}

				    <input type="text" className="form-control" value={this.state.start + 1}/>

		);
	},
	_firstClick:function(){
		this.state.start = 0;
		this._btnClick();
	},
	_preClick:function(){
		this.state.start--;
		if(this.state.start < 0){
			this.state.start = 0;
		}
		this._btnClick();
	},
	_nextClick:function(){
		this.state.start++;
		if(this.state.start > this.props.max){
			this.state.start = this.props.max;
		}
		this._btnClick();
	},
	_lastClick:function(){
		this.state.start = this.props.max;
		this._btnClick();
	},
	_btnClick:function(){
		this.props.onClick && this.props.onClick(this.state.start);
		this.forceUpdate()
	}

});

module.exports = pagination;


text:
class Route:
    '''
    Class to encapsulate our data and to make it easy for us to maintain it
    '''
    def __init__(self, id, route, usage, buses):
        self.id = id
        self.routeCode = route
        self.usage = usage
        self.buses = buses

    def __str__(self):
        x = "Bus id = " + str(self.id)
        x = x + "\nRoute Code = " + str(self.routeCode)
        x = x + "\nUsage percent = " + str(self.usage)
        x = x + "\nNumber of Buses = " + str(self.buses)
        return x

    def __repr__(self):
        return str(self)

    '''
    Getter and setters
    '''
    def setId(self, id):
        self.id = id

    def getId(self):
        return self.id

    def setRouteCode(self, route):
        self.routeCode = route

    def getRouteCode(self):
        return self.routeCode

    def setUsage(self, usage):
        self.usage = usage

    def getUsage(self):
        return self.usage

    def setBuses(self, buses):
        self.buses = buses

    def getBuses(self):
        return self.buses

    def __eq__(self, other):
        if not isinstance(other, Route):
            return False
        return self.getId() == other.getId()

    def checkUnique(self, other):
        '''
        function to check if two routes have the same id or the save code (which, by definition should be unique)
        :param other: the comparision is made between self and other using the == operator
        :return:    True if they share at least one duplicate property
                    False otherwise
        '''
        if not isinstance(other, Route):
            return True
        if self.getId() == other.getId() or self.getRouteCode() == other.getRouteCode():
            return False
        return True

    def isValid(self):
        '''
        Function to check if a route is valid, by the definition
        :return: True if it is valid,
                 False otherwise
        '''
        if len(self.getRouteCode()) > 3:
            return False
        if self.getUsage() < 0 or self.getUsage() > 100:
            return False
        return True

    def setAttr(self, other):
        '''
        Funciton to set the attr of another route to self
        :param other:
        :return:
        '''
        self.id = other.getId()
        self.buses = other.getBuses()
        self.routeCode = other.getRouteCode()
        self.usage = other.getUsage()


text:
import argparse
from collections import defaultdict
import os
import pysam
import sys

p = argparse.ArgumentParser()
p.add_argument("combined_bam", nargs="+")
args = p.parse_args()

print("%s files" % len(args.combined_bam))

fasta = pysam.Fastafile("/seq/references/Homo_sapiens_assembly19/v1/Homo_sapiens_assembly19.fasta")
total_variants = set()
variants = defaultdict(int)
mismatch_counts = []
for bam_path in args.combined_bam:
    f = pysam.AlignmentFile(bam_path)
    for r in f:
        tags = dict(r.tags)
        rg = tags['RG']  # eg. 19-51729103-CCCGG-C_hom2

        total_variants.add(rg)

        if len(r.cigarstring) > 4 or 'I' in r.cigarstring or 'D' in r.cigarstring or 'M' not in r.cigarstring:
            continue

        variant_pos = int(rg.split('-')[1])
        if not ((r.reference_start - 50 < variant_pos) and (r.reference_end + 50 > variant_pos)):
            continue

        read_sequence = r.query_alignment_sequence
        reference_sequence = fasta.fetch(r.reference_name, r.reference_start, r.reference_end)
        if len(read_sequence) != len(reference_sequence):
            print("ERROR: Different lengths - cigar: %s" % r.cigarstring)
            continue
        if read_sequence != reference_sequence:
            mismatches = [i for i, (a,b) in enumerate(zip(read_sequence, reference_sequence)) if a != b and a != 'N' and b != 'N']
            if len(mismatches) > 10:
                variants[rg] += 1
                mismatch_counts.append(1 - len(mismatches)/float(len(read_sequence)))
                print("#%s: %s %s - %s mismtaches - read: %s:%s %s" % (len(variants), rg.replace("_", " "), r.cigarstring, len(mismatches), r.reference_name, r.reference_start, r.query_name))

    class FakeOptions:
        def __getattr__(self, key):
            return None
    if len(set(variants.values())) > 1:
        print("Bad reads per variant:")
        os.system("echo '%s' | histogram.py" % '\n'.join(map(str, variants.values())))
    if len(set(mismatch_counts)) > 1:
        print("Fraction of read that matches the reference:")
        os.system("echo '%s' | histogram.py" % '\n'.join(map(str, mismatch_counts)))

    print("%s out of %s variants (%s)" % (len(variants), len(total_variants), len(variants)/float(len(total_variants))))

print("variants with mismatching reads :")
print("\n".join(variants))


text:
/**
 * MappingFrame.java
 *
 * This file was generated by MapForce 2011r2sp1.
 *
 * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
 * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
 *
 * Refer to the MapForce Documentation for further details.
 * http://www.altova.com/mapforce
 */

package com.mapforce;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

import com.altova.types.*;

public class MappingFrame extends JFrame implements com.altova.TraceTarget {

	JPanel			contentPane;
	TitledBorder	titledBorder1;
	Box 		jHeader = new Box(BoxLayout.X_AXIS);
	Box		jHeaderInfo = new Box(BoxLayout.Y_AXIS);
	Box 		jButtonPane = new Box(BoxLayout.X_AXIS);
	JScrollPane	jScrollPaneStructures	= new JScrollPane();
	JPanel		jPanelStructures		= new JPanel();
	JLabel		jIconLabel				= new JLabel();
	JLabel		jInfoLabel1				= new JLabel();
	JLabel		jInfoLabel2				= new JLabel();
	JLabel		jInfoLabel3				= new JLabel();
	JButton		jStartButton			= new JButton();
	JPanel		jPanel1					= new JPanel();
	JScrollPane	jTraceScrollPane		= new JScrollPane();
	JTextArea	jTraceTextArea			= new JTextArea();

	JLabel jgeneratedAIMSchema11Label0 = new JLabel();
	JTextField jgeneratedAIMSchema11TextField0 = new JTextField();

	JLabel jAIM_v3_rv9_XMLLabel1 = new JLabel();
	JTextField jAIM_v3_rv9_XMLTextField1 = new JTextField();

	public MappingFrame() {
		enableEvents(AWTEvent.WINDOW_EVENT_MASK);
		try {
			jbInit();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void jbInit() throws Exception {
		jInfoLabel1.setText("THIS APPLICATION WAS GENERATED BY MapForce 2011r2sp1");
		jInfoLabel2.setForeground(Color.blue);
		jInfoLabel2.setText("http://www.altova.com/mapforce");
		jInfoLabel3.setText("Please check the input and output files, and press the Start button...");
		jHeaderInfo.add(jInfoLabel1,0);
		jHeaderInfo.add(jInfoLabel2,1);
		jHeaderInfo.add(jInfoLabel3,2);

		jIconLabel.setIcon(new ImageIcon(MappingFrame.class.getResource("mapforce.png")));
		jIconLabel.setText("");

		jHeader.add(jIconLabel);
		jHeader.add(Box.createHorizontalStrut(15));
		jHeader.add(jHeaderInfo);
		jHeader.add(Box.createGlue());

		jStartButton.setFont(new java.awt.Font("Dialog", 0, 11));
		jStartButton.setText("Start");
		jStartButton.addActionListener(new MappingFrame_jStartButton_actionAdapter(this));
		jButtonPane.add(Box.createHorizontalStrut(5));
		jButtonPane.add(jStartButton);
		jButtonPane.add(Box.createGlue());

		jScrollPaneStructures.setBorder(BorderFactory.createLineBorder(Color.black));
		jScrollPaneStructures.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		jScrollPaneStructures.setAutoscrolls(true);
		jPanelStructures.setLayout(null);
		fillScrollPane();
		jScrollPaneStructures.getViewport().add(jPanelStructures, null);

		jTraceTextArea.setBackground(Color.white);
		jTraceTextArea.setForeground(Color.black);
		jTraceTextArea.setToolTipText("");
		jTraceTextArea.setText("");
		jTraceTextArea.setRows(20);

		jTraceScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		jTraceScrollPane.setViewportBorder(null);
		jTraceScrollPane.setAutoscrolls(true);
		jTraceScrollPane.setBorder(BorderFactory.createLineBorder(Color.black));
		jTraceScrollPane.setDebugGraphicsOptions(0);
		jTraceScrollPane.setToolTipText("");
		jTraceScrollPane.setVerifyInputWhenFocusTarget(true);
		jTraceScrollPane.getViewport().add(jTraceTextArea, null);
		jTraceScrollPane.setPreferredSize(new Dimension(0, 200));

		contentPane = (JPanel)this.getContentPane();
		titledBorder1 = new TitledBorder("");
		contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
		this.setSize(new Dimension(603, 511));
		this.setTitle("Mapforce Application");
		contentPane.add(jHeader, 0);
		contentPane.add(jScrollPaneStructures, 1);
		contentPane.add(jButtonPane, 2);
		contentPane.add(jTraceScrollPane, 3);
	}

	protected void fillScrollPane() {

		jgeneratedAIMSchema11Label0.setText("Source instance of generatedAIMSchema11.xsd:");
		jgeneratedAIMSchema11Label0.setBounds(new Rectangle(15, 10, 438, 23));
		jPanelStructures.add(jgeneratedAIMSchema11Label0, null);
		jgeneratedAIMSchema11TextField0.setText("C:/workspace_nbia/software/cedaraAIMMapping/map/cedaraAIM.xml");
		jgeneratedAIMSchema11TextField0.setBounds(new Rectangle(15, 35, 438, 23));
		jgeneratedAIMSchema11TextField0.setEditable(false);
		jPanelStructures.add(jgeneratedAIMSchema11TextField0, null);

		jAIM_v3_rv9_XMLLabel1.setText("Instance of AIM_v3_rv9_XML.xsd:");
		jAIM_v3_rv9_XMLLabel1.setBounds(new Rectangle(15, 60, 438, 23));
		jPanelStructures.add(jAIM_v3_rv9_XMLLabel1, null);
		jAIM_v3_rv9_XMLTextField1.setText("C:/workspace_nbia/software/cedaraAIMMapping/map/AIM_v3_rv9_XML.xml");
		jAIM_v3_rv9_XMLTextField1.setBounds(new Rectangle(15, 85, 438, 23));
		jAIM_v3_rv9_XMLTextField1.setEditable(false);
		jPanelStructures.add(jAIM_v3_rv9_XMLTextField1, null);

		jPanelStructures.setLayout(null);
		jPanelStructures.setPreferredSize(new Dimension(85, 500));
		jPanelStructures.setSize(new Dimension(85, 500));
		jPanelStructures.setMinimumSize(new Dimension(85, 500));
		jPanelStructures.setMaximumSize(new Dimension(85, 500));
	}

	protected void processWindowEvent(WindowEvent e) {
		super.processWindowEvent(e);
		if (e.getID() == WindowEvent.WINDOW_CLOSING) {
			System.exit(0);
		}
	}

    void jStartButton_actionPerformed(ActionEvent e) {
		if (e.getSource().equals(jStartButton)) {
			jStartButton.setEnabled(false);
			jTraceTextArea.removeAll();
			jTraceTextArea.append("Started...\n");
			com.altova.TraceTarget ttc = this;

			try {

			MappingMapToAIM_v3_rv9_XML MappingMapToAIM_v3_rv9_XMLObject = new MappingMapToAIM_v3_rv9_XML();

			MappingMapToAIM_v3_rv9_XMLObject.registerTraceTarget(ttc);

			// run mapping
			//
			// you have different options to provide mapping input and output:
			//
			// files using file names (available for XML, text, and Excel):
			//   com.altova.io.FileInput(String filename)
			//   com.altova.io.FileOutput(String filename)
			//
			// streams (available for XML, text, and Excel):
			//   com.altova.io.StreamInput(java.io.InputStream stream)
			//   com.altova.io.StreamOutput(java.io.OutputStream stream)
			//
			// strings (available for XML and text):
			//   com.altova.io.StringInput(String xmlcontent)
			//   com.altova.io.StringOutput()	(call getContent() after run() to get StringBuffer with content)
			//
			// Java IO reader/writer (available for XML and text):
			//   com.altova.io.ReaderInput(java.io.Reader reader)
			//   com.altova.io.WriterOutput(java.io.Writer writer)
			//
			// DOM documents (for XML only):
			//   com.altova.io.DocumentInput(org.w3c.dom.Document document)
			//   com.altova.io.DocumentOutput(org.w3c.dom.Document document)
			//
			// By default, run will close all inputs and outputs. If you do not want this,
			// call the following function:
			// MappingMapToAIM_v3_rv9_XMLObject.setCloseObjectsAfterRun(false);

			{
				com.altova.io.Input generatedAIMSchema112Source = com.altova.io.StreamInput.createInput("C:/workspace_nbia/software/cedaraAIMMapping/map/cedaraAIM.xml");

				MappingMapToAIM_v3_rv9_XMLObject.run(
						generatedAIMSchema112Source);
			}

				jTraceTextArea.append("Finished\n");
			} catch (Exception ex) {
				jTraceTextArea.append("ERROR: " + ex.getMessage());
			}

			jStartButton.setEnabled(true);
		}
    }

	public void writeTrace(String info) {
		jTraceTextArea.append(info);
	}
}

class MappingFrame_jStartButton_actionAdapter
	implements java.awt.event.ActionListener {
	MappingFrame adaptee;

	MappingFrame_jStartButton_actionAdapter(MappingFrame adaptee) {
		this.adaptee = adaptee;
	}

	public void actionPerformed(ActionEvent e) {
		adaptee.jStartButton_actionPerformed(e);
	}
}


text:
package com.treode.buffer

import com.google.common.hash.Hashing
import org.scalatest.FlatSpec
import org.scalatest.prop.PropertyChecks

import PropertyChecks._

class ArrayBufferSpec extends FlatSpec {

  "An ArrayBuffer" should "hash bytes at the beginning" in {
    val hashf = Hashing.murmur3_32()
    val bytes = Array.tabulate (11) (i => (i + 1).toByte)
    val buf = ArrayBuffer.writable (32)
    buf.writeBytes (bytes, 0, 11)
    assertResult (hashf.hashBytes (bytes)) (buf.hash (0, 11, hashf))
  }

  it should "hash bytes in the middle" in {
    val hashf = Hashing.murmur3_32()
    val bytes = Array.tabulate (11) (i => (i + 1).toByte)
    val buf = ArrayBuffer.writable (32)
    buf.writePos = 7
    buf.writeBytes (bytes, 0, 11)
    assertResult (hashf.hashBytes (bytes)) (buf.hash (7, 11, hashf))
  }

  it should "hash bytes at the end" in {
    val hashf = Hashing.murmur3_32()
    val bytes = Array.tabulate (11) (i => (i + 1).toByte)
    val buf = ArrayBuffer.writable (32)
    buf.writePos = 21
    buf.writeBytes (bytes, 0, 11)
    assertResult (hashf.hashBytes (bytes)) (buf.hash (21, 11, hashf))
  }

  // We regard PageBuffer as the gold standard, and check that ArrayBuffer can read and write data
  // from one.  Whereas in PagedBufferSpec, we check that a PagedBuffer can read and write with
  // itself only, and not with ArrayBuffer.
  private def flip (in: PagedBuffer): ArrayBuffer = {
    val bytes = new Array [Byte] (in.readableBytes)
    in.readBytes (bytes, 0, in.readableBytes)
    ArrayBuffer.readable (bytes)
  }

  private def flip (buf: ArrayBuffer): PagedBuffer = {
    val bytes = new Array [Byte] (buf.readableBytes)
    buf.readBytes (bytes, 0, buf.readableBytes)
    val out = PagedBuffer (12)
    out.writeBytes (bytes, 0, bytes.length)
    out
  }

  it should "read shorts" in {
    forAll ("x") { x: Short =>
      val out = PagedBuffer (5)
      out.writeShort (x)
      val in = flip (out)
      assertResult (x) (in.readShort())
    }}

  it should "write shorts" in {
    forAll ("x") { x: Short =>
      val out = ArrayBuffer.writable (256)
      out.writeShort (x)
      val in = flip (out)
      assertResult (x) (in.readShort())
    }}

  it should "read ints" in {
    forAll ("x") { x: Int =>
      val out = PagedBuffer (5)
      out.writeInt (x)
      val in = flip (out)
      assertResult (x) (in.readInt())
    }}

  it should "write ints" in {
    forAll ("x") { x: Int =>
      val out = ArrayBuffer.writable (256)
      out.writeInt (x)
      val in = flip (out)
      assertResult (x) (in.readInt())
    }}

  it should "read var ints" in {
    forAll ("x") { x: Int =>
      val out = PagedBuffer (5)
      out.writeVarInt (x)
      val in = flip (out)
      assertResult (x) (in.readVarInt())
    }}

  it should "write var ints" in {
    forAll ("x") { x: Int =>
      val out = ArrayBuffer.writable (256)
      out.writeVarInt (x)
      val in = flip (out)
      assertResult (x) (in.readVarInt())
    }}

  it should "read unsigned var ints" in {
    forAll ("x") { x: Int =>
      val out = PagedBuffer (5)
      out.writeVarUInt (x)
      val in = flip (out)
      assertResult (x) (in.readVarUInt())
    }}

  it should "write unsigned var ints" in {
    forAll ("x") { x: Int =>
      val out = ArrayBuffer.writable (256)
      out.writeVarUInt (x)
      val in = flip (out)
      assertResult (x) (in.readVarUInt())
    }}

  it should "read longs" in {
    forAll ("x") { x: Long =>
      val out = PagedBuffer (5)
      out.writeLong (x)
      val in = flip (out)
      assertResult (x) (in.readLong())
    }}

  it should "write longs" in {
    forAll ("x") { x: Long =>
      val out = ArrayBuffer.writable (256)
      out.writeLong (x)
      val in = flip (out)
      assertResult (x) (in.readLong())
    }}

  it should "read var longs" in {
    forAll ("x") { x: Byte =>
      val out = PagedBuffer (5)
      out.writeVarLong (-1L)
      val in = flip (out)
      assertResult (-1L) (in.readVarLong())
    }}

  it should "write var longs" in {
    forAll ("x") { x: Byte =>
      val out = ArrayBuffer.writable (256)
      out.writeVarLong (-1L)
      val in = flip (out)
      assertResult (-1L) (in.readVarLong())
    }}

  it should "read unsigned var longs" in {
    forAll ("x") { x: Long =>
      val out = PagedBuffer (5)
      out.writeVarULong (x)
      val in = flip (out)
      assertResult (x) (in.readVarULong())
    }}

  it should "write unsigned var longs" in {
    forAll ("x") { x: Long =>
      val out = ArrayBuffer.writable (256)
      out.writeVarULong (x)
      val in = flip (out)
      assertResult (x) (in.readVarULong())
    }}

  it should "read floats" in {
    forAll ("x") { x: Float =>
      val out = PagedBuffer (5)
      out.writeFloat (x)
      val in = flip (out)
      assertResult (x) (in.readFloat())
    }}

  it should "write floats" in {
    forAll ("x") { x: Float =>
      val out = ArrayBuffer.writable (256)
      out.writeFloat (x)
      val in = flip (out)
      assertResult (x) (in.readFloat())
    }}

  it should "read doubles" in {
    forAll ("x") { x: Double =>
      val out = PagedBuffer (5)
      out.writeDouble (x)
      val in = flip (out)
      assertResult (x) (in.readDouble())
    }}

  it should "write doubles" in {
    forAll ("x") { x: Double =>
      val out = ArrayBuffer.writable (256)
      out.writeDouble (x)
      val in = flip (out)
      assertResult (x) (in.readDouble())
    }}

  it should "read strings" in {
    forAll ("x") { x: String =>
      try {
      val out = PagedBuffer (9)
      out.writeString (x)
      val in = flip (out)
      assertResult (x) (in.readString())
      } catch {
        case e: Throwable => e.printStackTrace()
        throw e
      }
    }}

  it should "write strings" in {
    forAll ("x") { x: String =>
      try {
      val out = ArrayBuffer.writable (1024)
      out.writeString (x)
      val in = flip (out)
      assertResult (x) (in.readString())
      } catch {
        case e: Throwable => e.printStackTrace()
        throw e
      }
    }}}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cytospora achrae Henn.

### Remarks
null


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/pubsub/v1/pubsub.proto

package com.google.pubsub.v1;

public interface GetSubscriptionRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetSubscriptionRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * The name of the subscription to get.
   * Format is `projects/{project}/subscriptions/{sub}`.
   *

   *
   * string subscription = 1;
   */
  java.lang.String getSubscription();
  /**
   *
   *
   *

   * The name of the subscription to get.
   * Format is `projects/{project}/subscriptions/{sub}`.
   *

   *
   * string subscription = 1;
   */
  com.google.protobuf.ByteString getSubscriptionBytes();
}


text:
<?php

namespace Frontend\Core\Engine;

use Backend\Core\Engine\Language as BackendLanguage;

/**
 * Twig node for writing the SEO form
 *
 * @author Wouter Sioen <wouter@woutersioen.be>
 */
class SeoFormNode extends \Twig_Node
{
    private $form;

    /**
     * @param string $form Name of the template var holding the form this field
     *                     belongs to.
     * @param int $lineno Line number in the template source file.
     * @param string $tag
     */
    public function __construct($form, $lineno, $tag)
    {
        parent::__construct(array(), array(), $lineno, $tag);
        $this->form = $form;
    }

    /**
     * @param Twig_Compiler $compiler
     */
    public function compile(\Twig_Compiler $compiler)
    {
        $compiler
            ->addDebugInfo($this)
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('Titles') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "";')
            ->write($this->getField('page_title_overwrite'))
            ->write('echo "
' . $this->lbl('PageTitle') . '
";')
            ->write($this->getError('page_title'))
            ->write($this->getField('page_title'))
            ->write('echo "
' . $this->msg('HelpPageTitle') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';');

        $compiler
            ->write('if (' . $this->hasField('navigation_title_overwrite') . ') {')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "";')
            ->write($this->getField('navigation_title_overwrite'))
            ->write('echo "
' . $this->lbl('NavigationTitle') . '
";')
            ->write($this->getError('navigation_title'))
            ->write($this->getField('navigation_title'))
            ->write('echo "
' . $this->msg('HelpNavigationTitle') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('}');

        $compiler
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('MetaInformation') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "";')
            ->write($this->getField('meta_description_overwrite'))
            ->write('echo "
' . $this->lbl('Description') . '
";')
            ->write($this->getError('meta_description'))
            ->write($this->getField('meta_description'))
            ->write('echo "
' . $this->msg('HelpMetaDescription') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "";')
            ->write($this->getField('meta_keywords_overwrite'))
            ->write('echo "
' . $this->lbl('Keywords') . '
";')
            ->write($this->getError('meta_keywords'))
            ->write($this->getField('meta_keywords'))
            ->write('echo "
' . $this->msg('HelpMetaKeywords') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "' . $this->lbl('ExtraMetaTags') . '";')
            ->write($this->getError('meta_custom'))
            ->write($this->getField('meta_custom'))
            ->write('echo "
' . $this->msg('HelpMetaCustom') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('URL') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "";')
            ->write($this->getField('url_overwrite'))
            ->write('echo "
' . $this->lbl('URL') . '
";')
            ->write('echo \'
\';');

        $compiler
            ->write('echo \'\';')
            ->write('if (' . $this->hasVariable('detailUrl') . ') {')
            ->write($this->getVariable('detailUrl'))
            ->write('} else {')
            ->write('echo "' . SITE_URL . '/' . ' ' . '";')
            ->write('}')
            ->write('echo \'\';');

        $compiler
            ->write($this->getError('url'))
            ->write($this->getField('url'))
            ->write('echo \'
\';')
            ->write('echo "
' . $this->msg('HelpMetaURL') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('SEO') . '
";')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('Index') . '
";');

        $compiler
            ->write('if (' . $this->hasError('seo_index') . ') {')
            ->write('echo \'
\';')
            ->write($this->getError('seo_index'))
            ->write('echo \'
\';')
            ->write('}');

        $compiler
            ->write('echo \'
\';')
            ->write($this->loopTroughField('seo_index', '$index'))
            ->write('echo \'
\';')
            ->write('echo "" . $index["rbtSeoIndex"] . $index["label"] . "";')
            ->write('echo \'
\';')
            ->write('}')
            ->write('echo \'
\';');

        $compiler
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo "
' . $this->lbl('Follow') . '
";');

        $compiler
            ->write('if (' . $this->hasError('seo_follow') . ') {')
            ->write('echo \'
\';')
            ->write($this->getError('seo_follow'))
            ->write('echo \'
\';')
            ->write('}');

        $compiler
            ->write('echo \'
\';')
            ->write($this->loopTroughField('seo_follow', '$follow'))
            ->write('echo \'
\';')
            ->write('echo "" . $follow["rbtSeoFollow"] . $follow["label"] . "";')
            ->write('echo \'
\';')
            ->write('}')
            ->write('echo \'
\';');

        $compiler
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write('echo \'
\';')
            ->write($this->getField('meta_id'))
            ->write($this->getField('base_field_name'))
            ->write($this->getField('custom'))
            ->write($this->getField('class_name'))
            ->write($this->getField('method_name'))
            ->write($this->getField('parameters'))
            ->write('echo \'
\';');
    }

    private function lbl($label)
    {
        return ucfirst(BackendLanguage::getLabel($label));
    }

    private function msg($message)
    {
        return BackendLanguage::getMessage($message);
    }

    private function hasVariable($variable)
    {
        return "isset(\$context['{$variable}']) && !empty(\$context['{$variable}'])";
    }

    private function loopTroughField($variable, $as)
    {
        return "foreach (\$context['{$variable}'] as {$as}) {";
    }

    private function getVariable($variable)
    {
        return "echo \$context['{$variable}'];";
    }

    private function getField($fieldName)
    {
        $frm = "\$context['form_{$this->form}']";

        return 'echo ' . $frm . "->getField('" . $fieldName . "')->parse();";
    }

    private function hasField($fieldName)
    {
        $frm = "\$context['form_{$this->form}']";

        return $frm . "->existsField('" . $fieldName . "')";
    }

    private function hasError($fieldName)
    {
        return "\$context['form_{$this->form}']->getField('" . $fieldName . "')->getErrors() ";
    }

    private function getError($fieldName)
    {
        return "echo \$context['form_{$this->form}']->getField('" . $fieldName . "')->getErrors() "
            . "? '' "
            . ". \$context['form_{$this->form}']->getField('" . $fieldName . "')->getErrors() "
            . ". '' : '';";
    }
}


text:
void CollisionPolygon2DEditor::_notification(int p_what) {

	switch(p_what) {

		case NOTIFICATION_READY: {

			button_create->set_icon( get_icon("Edit","EditorIcons"));
			button_edit->set_icon( get_icon("MovePoint","EditorIcons"));
			button_edit->set_pressed(true);
			get_tree()->connect("node_removed",this,"_node_removed");

		} break;
		case NOTIFICATION_FIXED_PROCESS: {

		} break;
	}

}
void CollisionPolygon2DEditor::_node_removed(Node *p_node) {

	if(p_node==node) {
		node=NULL;
		hide();
		canvas_item_editor->get_viewport_control()->update();
	}

}

void CollisionPolygon2DEditor::_menu_option(int p_option) {

	switch(p_option) {

		case MODE_CREATE: {

			mode=MODE_CREATE;
			button_create->set_pressed(true);
			button_edit->set_pressed(false);
		} break;
		case MODE_EDIT: {

			mode=MODE_EDIT;
			button_create->set_pressed(false);
			button_edit->set_pressed(true);
		} break;

	}
}

void CollisionPolygon2DEditor::_wip_close() {

	undo_redo->create_action(TTR("Create Poly"));
	undo_redo->add_undo_method(node,"set_polygon",node->get_polygon());
	undo_redo->add_do_method(node,"set_polygon",wip);
	undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update");
	undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(),"update");
	undo_redo->commit_action();
	wip.clear();
	wip_active=false;
	mode=MODE_EDIT;
	button_edit->set_pressed(true);
	button_create->set_pressed(false);
	edited_point=-1;
}

bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) {

	if (!node)
		return false;

	switch(p_event.type) {

		case InputEvent::MOUSE_BUTTON: {

			const InputEventMouseButton &mb=p_event.mouse_button;

			Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();

			Vector2 gpoint = Point2(mb.x,mb.y);
			Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
			cpoint=canvas_item_editor->snap_point(cpoint);
			cpoint = node->get_global_transform().affine_inverse().xform(cpoint);

			Vector<Vector2> poly = node->get_polygon();

			//first check if a point is to be added (segment split)
			real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);

			switch(mode) {

				case MODE_CREATE: {

					if (mb.button_index==BUTTON_LEFT && mb.pressed) {

						if (!wip_active) {

							wip.clear();
							wip.push_back( cpoint );
							wip_active=true;
							edited_point_pos=cpoint;
							canvas_item_editor->get_viewport_control()->update();
							edited_point=1;
							return true;
						} else {

							if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_treshold) {
								//wip closed
								_wip_close();

								return true;
							} else {

								wip.push_back( cpoint );
								edited_point=wip.size();
								canvas_item_editor->get_viewport_control()->update();
								return true;

								//add wip point
							}
						}
					} else if (mb.button_index==BUTTON_RIGHT && mb.pressed && wip_active) {
						_wip_close();
					}

				} break;

				case MODE_EDIT: {

					if (mb.button_index==BUTTON_LEFT) {
						if (mb.pressed) {

							if (mb.mod.control) {

								if (poly.size() < 3) {

									undo_redo->create_action(TTR("Edit Poly"));
									undo_redo->add_undo_method(node,"set_polygon",poly);
									poly.push_back(cpoint);
									undo_redo->add_do_method(node,"set_polygon",poly);
									undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update");
									undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(),"update");
									undo_redo->commit_action();
									return true;
								}

								//search edges
								int closest_idx=-1;
								Vector2 closest_pos;
								real_t closest_dist=1e10;
								for(int i=0;i<poly.size();i++) {

									Vector2 points[2] ={ xform.xform(poly[i]),
										xform.xform(poly[(i+1)%poly.size()]) };

									Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint,points);
									if (cp.distance_squared_to(points[0])<CMP_EPSILON2 || cp.distance_squared_to(points[1])<CMP_EPSILON2)
										continue; //not valid to reuse point

									real_t d = cp.distance_to(gpoint);
									if (d<closest_dist && d<grab_treshold) {
										closest_dist=d;
										closest_pos=cp;
										closest_idx=i;
									}

								}

								if (closest_idx>=0) {

									pre_move_edit=poly;
									poly.insert(closest_idx+1,xform.affine_inverse().xform(closest_pos));
									edited_point=closest_idx+1;
									edited_point_pos=xform.affine_inverse().xform(closest_pos);
									node->set_polygon(poly);
									canvas_item_editor->get_viewport_control()->update();
									return true;
								}
							} else {

								//look for points to move

								int closest_idx=-1;
								Vector2 closest_pos;
								real_t closest_dist=1e10;
								for(int i=0;i<poly.size();i++) {

									Vector2 cp =xform.xform(poly[i]);

									real_t d = cp.distance_to(gpoint);
									if (d<closest_dist && d<grab_treshold) {
										closest_dist=d;
										closest_pos=cp;
										closest_idx=i;
									}

								}

								if (closest_idx>=0) {

									pre_move_edit=poly;
									edited_point=closest_idx;
									edited_point_pos=xform.affine_inverse().xform(closest_pos);
									canvas_item_editor->get_viewport_control()->update();
									return true;
								}
							}
						} else {

							if (edited_point!=-1) {

								//apply

								ERR_FAIL_INDEX_V(edited_point,poly.size(),false);
								poly[edited_point]=edited_point_pos;
								undo_redo->create_action(TTR("Edit Poly"));
								undo_redo->add_do_method(node,"set_polygon",poly);
								undo_redo->add_undo_method(node,"set_polygon",pre_move_edit);
								undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update");
								undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(),"update");
								undo_redo->commit_action();

								edited_point=-1;
								return true;
							}
						}
					} if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) {

						int closest_idx=-1;
						Vector2 closest_pos;
						real_t closest_dist=1e10;
						for(int i=0;i<poly.size();i++) {

							Vector2 cp =xform.xform(poly[i]);

							real_t d = cp.distance_to(gpoint);
							if (d<closest_dist && d<grab_treshold) {
								closest_dist=d;
								closest_pos=cp;
								closest_idx=i;
							}

						}

						if (closest_idx>=0) {

							undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
							undo_redo->add_undo_method(node,"set_polygon",poly);
							poly.remove(closest_idx);
							undo_redo->add_do_method(node,"set_polygon",poly);
							undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update");
							undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(),"update");
							undo_redo->commit_action();
							return true;
						}

					}

				} break;
			}

		} break;
		case InputEvent::MOUSE_MOTION: {

			const InputEventMouseMotion &mm=p_event.mouse_motion;

			if (edited_point!=-1 && (wip_active || mm.button_mask&BUTTON_MASK_LEFT)) {

				Vector2 gpoint = Point2(mm.x,mm.y);
				Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
				cpoint=canvas_item_editor->snap_point(cpoint);
				edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);

				canvas_item_editor->get_viewport_control()->update();

			}

		} break;
	}

	return false;
}
void CollisionPolygon2DEditor::_canvas_draw() {

	if (!node)
		return;

	Control *vpc = canvas_item_editor->get_viewport_control();

	Vector<Vector2> poly;

	if (wip_active)
		poly=wip;
	else
		poly=node->get_polygon();

	Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
	Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");

	int len = poly.size();

	for(int i=0;i<poly.size();i++) {

		Vector2 p,p2;
		p = i==edited_point ? edited_point_pos : poly[i];
		if ((wip_active && i==poly.size()-1) || (((i+1)%poly.size())==edited_point))
			p2=edited_point_pos;
		else
			p2 = poly[(i+1)%poly.size()];

		Vector2 point = xform.xform(p);
		Vector2 next_point = xform.xform(p2);

		Color col=Color(1,0.3,0.1,0.8);
		vpc->draw_line(point,next_point,col,2);
		vpc->draw_texture(handle,point-handle->get_size()*0.5);
	}
}

void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) {

	if (!canvas_item_editor) {
		canvas_item_editor=CanvasItemEditor::get_singleton();
	}

	if (p_collision_polygon) {

		node=p_collision_polygon->cast_to<CollisionPolygon2D>();
		if (!canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw"))
			canvas_item_editor->get_viewport_control()->connect("draw",this,"_canvas_draw");
		wip.clear();
		wip_active=false;
		edited_point=-1;
		canvas_item_editor->get_viewport_control()->update();

	} else {
		node=NULL;

		if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw"))
			canvas_item_editor->get_viewport_control()->disconnect("draw",this,"_canvas_draw");

	}

}

void CollisionPolygon2DEditor::_bind_methods() {

	ObjectTypeDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option);
	ObjectTypeDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw);
	ObjectTypeDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed);

}

CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) {

	node=NULL;
	canvas_item_editor=NULL;
	editor=p_editor;
	undo_redo = editor->get_undo_redo();

	add_child( memnew( VSeparator ));
	button_create = memnew( ToolButton );
	add_child(button_create);
	button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE));
	button_create->set_toggle_mode(true);
	button_create->set_tooltip(TTR("Create a new polygon from scratch"));

	button_edit = memnew( ToolButton );
	add_child(button_edit);
	button_edit->connect("pressed",this,"_menu_option",varray(MODE_EDIT));
	button_edit->set_toggle_mode(true);
	button_edit->set_tooltip("Edit existing polygon:\nLMB: Move Point.\nCtrl+LMB: Split Segment.\nRMB: Erase Point.");

	//add_constant_override("separation",0);

#if 0
	options = memnew( MenuButton );
	add_child(options);
	options->set_area_as_parent_rect();
	options->set_text(TTR("Polygon"));
	//options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE);
	options->get_popup()->connect("item_pressed", this,"_menu_option");
#endif

	mode = MODE_EDIT;
	wip_active=false;

}

void CollisionPolygon2DEditorPlugin::edit(Object *p_object) {

	collision_polygon_editor->edit(p_object->cast_to<Node>());
}

bool CollisionPolygon2DEditorPlugin::handles(Object *p_object) const {

	return p_object->is_type("CollisionPolygon2D");
}

void CollisionPolygon2DEditorPlugin::make_visible(bool p_visible) {

	if (p_visible) {
		collision_polygon_editor->show();
	} else {

		collision_polygon_editor->hide();
		collision_polygon_editor->edit(NULL);
	}

}

CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) {

	editor=p_node;
	collision_polygon_editor = memnew( CollisionPolygon2DEditor(p_node) );
	CanvasItemEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor);

	collision_polygon_editor->hide();

}

CollisionPolygon2DEditorPlugin::~CollisionPolygon2DEditorPlugin()
{
}


text:
// This file was generated using Parlex's cpp_generator

#ifndef INCLUDED_NON_NEG_NUMBER_HPP
#define INCLUDED_NON_NEG_NUMBER_HPP

#include <optional>
#include <variant>
#include <vector>

#include "erased.hpp"

#include "parlex/detail/abstract_syntax_tree.hpp"
#include "parlex/detail/builtins.hpp"
#include "parlex/detail/document.hpp"

#include "plange_grammar.hpp"

namespace plc {

struct NON_NEG_FRACTIONAL;
struct NON_NEG_NON_FRACTIONAL;

typedef std::variant<
	erased<NON_NEG_NON_FRACTIONAL>,
	erased<NON_NEG_FRACTIONAL>
> NON_NEG_NUMBER_base;

struct NON_NEG_NUMBER: NON_NEG_NUMBER_base {
	static NON_NEG_NUMBER build(parlex::detail::ast_node const & n);
	explicit NON_NEG_NUMBER(NON_NEG_NUMBER_base const & value) : NON_NEG_NUMBER_base(value) {}
	static parlex::detail::state_machine const & state_machine();
};
} // namespace plc

#endif //INCLUDED_NON_NEG_NUMBER_HPP


text:
package org.apache.activemq.security;

import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapNetworkConnection;
import org.apache.directory.server.annotations.CreateLdapServer;
import org.apache.directory.server.annotations.CreateTransport;
import org.apache.directory.server.core.annotations.ApplyLdifFiles;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.shared.ldap.model.name.Dn;
import org.junit.runner.RunWith;

import java.io.InputStream;

@RunWith(FrameworkRunner.class)
@CreateLdapServer(transports = {@CreateTransport(protocol = "LDAP")})
@ApplyLdifFiles(
   "org/apache/activemq/security/activemq-apacheds.ldif")
public class CachedLDAPAuthorizationModuleTest extends AbstractCachedLDAPAuthorizationModuleTest {

   @Override
   protected SimpleCachedLDAPAuthorizationMap createMap() {
      SimpleCachedLDAPAuthorizationMap map = super.createMap();
      map.setConnectionURL("ldap://localhost:" + getLdapServer().getPort());
      return map;
   }

   @Override
   protected InputStream getAddLdif() {
      return getClass().getClassLoader().getResourceAsStream("org/apache/activemq/security/activemq-apacheds-add.ldif");
   }

   @Override
   protected InputStream getRemoveLdif() {
      return getClass().getClassLoader().getResourceAsStream("org/apache/activemq/security/activemq-apacheds-delete.ldif");
   }

   @Override
   protected String getMemberAttributeValueForModifyRequest() {
      return "cn=users,ou=Group,ou=ActiveMQ,ou=system";
   }

   @Override
   protected String getQueueBaseDn() {
      return "ou=Queue,ou=Destination,ou=ActiveMQ,ou=system";
   }

   @Override
   protected LdapConnection getLdapConnection() throws Exception {
      LdapConnection connection = new LdapNetworkConnection("localhost", getLdapServer().getPort());
      connection.bind(new Dn("uid=admin,ou=system"), "secret");
      return connection;
   }
}


text:
package com.cloud.storage.download;

import com.cloud.legacymodel.communication.answer.DownloadAnswer;
import com.cloud.legacymodel.communication.command.DownloadProgressCommand.RequestType;
import com.cloud.legacymodel.storage.VMTemplateStatus;

public class DownloadErrorState extends DownloadInactiveState {

    public DownloadErrorState(final DownloadListener dl) {
        super(dl);
    }

    @Override
    public String handleAnswer(final DownloadAnswer answer) {
        switch (answer.getDownloadStatus()) {
            case DOWNLOAD_IN_PROGRESS:
                getDownloadListener().scheduleStatusCheck(RequestType.GET_STATUS);
                return VMTemplateStatus.DOWNLOAD_IN_PROGRESS.toString();
            case DOWNLOADED:
                getDownloadListener().scheduleImmediateStatusCheck(RequestType.PURGE);
                getDownloadListener().cancelTimeoutTask();
                return VMTemplateStatus.DOWNLOADED.toString();
            case NOT_DOWNLOADED:
                getDownloadListener().scheduleStatusCheck(RequestType.GET_STATUS);
                return VMTemplateStatus.NOT_DOWNLOADED.toString();
            case DOWNLOAD_ERROR:
                getDownloadListener().cancelStatusTask();
                getDownloadListener().cancelTimeoutTask();
                return VMTemplateStatus.DOWNLOAD_ERROR.toString();
            case UNKNOWN:
                getDownloadListener().cancelStatusTask();
                getDownloadListener().cancelTimeoutTask();
                return VMTemplateStatus.DOWNLOAD_ERROR.toString();
            default:
                return null;
        }
    }

    @Override
    public String handleAbort() {
        return VMTemplateStatus.ABANDONED.toString();
    }

    @Override
    public String getName() {
        return VMTemplateStatus.DOWNLOAD_ERROR.toString();
    }

    @Override
    public void onEntry(final String prevState, final DownloadEvent event, final Object evtObj) {
        super.onEntry(prevState, event, evtObj);
        if (event == DownloadEvent.DISCONNECT) {
            getDownloadListener().logDisconnect();
            getDownloadListener().cancelStatusTask();
            getDownloadListener().cancelTimeoutTask();
            final DownloadAnswer answer = new DownloadAnswer("Storage agent or storage VM disconnected", VMTemplateStatus.DOWNLOAD_ERROR);
            getDownloadListener().callback(answer);
            getDownloadListener().logWarn("Entering download error state because the storage host disconnected");
        } else if (event == DownloadEvent.TIMEOUT_CHECK) {
            final DownloadAnswer answer = new DownloadAnswer("Timeout waiting for response from storage host", VMTemplateStatus.DOWNLOAD_ERROR);
            getDownloadListener().callback(answer);
            getDownloadListener().logWarn("Entering download error state: timeout waiting for response from storage host");
        }
        getDownloadListener().setDownloadInactive(VMTemplateStatus.DOWNLOAD_ERROR);
    }
}


text:
package xal.ca;

import org.junit.Test;
import static org.junit.Assert.*;
import xal.plugin.epics7.Epics7ChannelFactory;
import xal.plugin.epics7.server.Epics7ServerChannelFactory;

/**
 *
 * @author Juan F. Esteban Müller <JuanF.EstebanMuller@ess.eu>
 */
public class ChannelFactoryPluginTest {

    /**
     * Test of getChannelFactoryInstance method, of class ChannelFactoryPlugin.
     */
    @Test
    public void testGetChannelFactoryInstance() {
        System.out.println("getChannelFactoryInstance");
        Class expResult = Epics7ChannelFactory.class;
        ChannelFactory result = ChannelFactoryPlugin.getChannelFactoryInstance();
        assertEquals(expResult, result.getClass());
    }

    /**
     * Test of getServerChannelFactoryInstance method, of class
     * ChannelFactoryPlugin.
     */
    @Test
    public void testGetServerChannelFactoryInstance() {
        System.out.println("getServerChannelFactoryInstance");
        Class expResult = Epics7ServerChannelFactory.class;
        ChannelFactory result = ChannelFactoryPlugin.getServerChannelFactoryInstance();
        assertEquals(expResult, result.getClass());
    }

}