text:
package threesixty.visualizer.visualizations.scatterChart

import spray.json._
import threesixty.data.Data.{Identifier, Timestamp}
import threesixty.data.DataJsonProtocol._
import threesixty.data.metadata.Scaling
import threesixty.data.{DataPool, ProcessedData, TaggedDataPoint}
import threesixty.visualizer._
import threesixty.visualizer.util._
import ColorScheme.ColorSchemeJsonFormat
import threesixty.visualizer.util.param._

import scala.xml.Elem
import scala.annotation.tailrec

trait Mixin extends VisualizationMixins {
    abstract override def visualizationInfos: Map[String, VisualizationCompanion] =
        super.visualizationInfos + ("scatterchart" -> ScatterChartConfig)
}

/**
 *  The config class for a [[threesixty.visualizer.visualizations.scatterChart.ScatterChartConfig.ScatterChart]].
 *
 *  @author Thomas Engel
 */
object ScatterChartConfig extends VisualizationCompanion {

    def name = "ScatterChart"

    def usage = "ScatterChart\n" +
                "  Parameters: \n" +
                "    ids:                       Set[String]            - The data identifiers\n" +
                "    height:                    Int                    - Height of the diagram in px\n" +
                "    width:                     Int                    - Width of the diagram in px\n" +
                "    border:                    Border      (optional) - Border (top, bottom, left, right) in px\n" +
                "    colorScheme:               String      (optional) - The color scheme\n" +
                "    title:                     Title       (optional) - Diagram title (title, position, verticalOffset, horizontalOffset, size, fontFamily, alignment)\n" +
                "    xAxis:                     ValueAxis   (optional) - The x-axis (label, labelSize, labelFontFamily, min, max, minDistance, unit, unitLabelSize, unitLabelFontFamily, showGrid, showLabels, arrowSize, arrowFilled)\n" +
                "    yAxis:                     ValueAxis   (optional) - The y-axis (label, labelSize, labelFontFamily, min, max, minDistance, unit, unitLabelSize, unitLabelFontFamily, showGrid, showLabels, arrowSize, arrowFilled)\n" +
                "    radius:                    Int         (optional) - The radius of the displayed points\n"

    def fromString: (String) => VisualizationConfig = { s => apply(s) }

  def default(ids: Seq[Identifier], height: Int, width: Int) = ScatterChartConfig(ids, height, width)
    /**
     *  Public constructor that parses JSON into a configuration
     *  @param jsonString representation of the config
     *  @return ScatterChartConfig with all arguments from the JSON set
     */
    def apply(jsonString: String): ScatterChartConfig = {
        implicit val scatterChartConfigFormat = jsonFormat(ScatterChartConfig.apply,
            "ids",
            "height", "width",
            "border",
            "colorScheme", "title",
            "xAxis", "yAxis",
            "radius")
        jsonString.parseJson.convertTo[ScatterChartConfig]
    }

    val metadata = new VisualizationMetadata(
        List(DataRequirement(
            scaling = Some(Scaling.Ordinal)
        ), DataRequirement(
            scaling = Some(Scaling.Ordinal)
        )))

    /**
     * This class creates the svg element for a scatter chart.
     *
     * @param config the scatter chart config
     * @param data the data
     *
     * @author Thomas Engel, Thomas Weber
     */
    case class ScatterChart(config: ScatterChartConfig, val data: ProcessedData*) extends Visualization(data: _*) {
        require(data.size == 2, "Scatter chart can only be applied to two sets of data.")

        val joinedDatasets: Seq[List[(TaggedDataPoint, TaggedDataPoint)]] =
            data.tail.map {
                dataset => data.head.equiJoin(dataset, _.timestamp.getTime)
            }

        // TODO Performance optimization, get both in one run
        val dataMinMaxX: (Double, Double) =
            (joinedDatasets.map(_.map({ case (dp: TaggedDataPoint, _: TaggedDataPoint) => dp.value.value}).min).min,
            joinedDatasets.map(_.map({ case (dp: TaggedDataPoint, _: TaggedDataPoint) => dp.value.value}).max).min)
        val dataMinMaxY: (Double, Double) = dataMinMaxX
        val dataMinX: Double = dataMinMaxX._1
        val dataMaxX: Double = dataMinMaxX._2
        val dataMinY: Double = dataMinMaxY._1
        val dataMaxY: Double = dataMinMaxY._2
        val chartOrigin = (config.border.left, config.height - config.border.bottom)

        val _xMin = config._xAxis.map(_.min).getOrElse(None)
        val _xMax = config._xAxis.map(_.max).getOrElse(None)
        val _yMin = config._yAxis.map(_.min).getOrElse(None)
        val _yMax = config._yAxis.map(_.max).getOrElse(None)

        val _xUnit = config._xAxis.map(_.unit).getOrElse(None)
        val _yUnit = config._yAxis.map(_.unit).getOrElse(None)

        val xScale = _xUnit.map(
                ValueScale(_xMin.getOrElse(dataMinX),
                    _xMax.getOrElse(dataMaxX), 0, config.chartWidth, _)).getOrElse {
                    ValueScale(_xMin.getOrElse(dataMinX),
                        _xMax.getOrElse(dataMaxX), 0, config.chartWidth)
            }
        val yScale = _yUnit.map(
                ValueScale(_yMin.getOrElse(dataMinY),
                    _yMax.getOrElse(dataMaxY), 0, config.chartHeight, _)).getOrElse {
                    ValueScale(_yMin.getOrElse(dataMinY),
                        _yMax.getOrElse(dataMaxY), 0, config.chartHeight)
            }

        val xAxisLabels: Seq[(String, Int)] = {
            @tailrec
            def construct(v: Double, init: Seq[(String, Int)]): Seq[(String, Int)] = {
                if (v > xScale.inMax) {
                    init
                } else {
                    construct(xScale.nextBreakpoint(v), init ++ Seq((xScale.format(v), xScale(v).toInt)))
                }
            }
            construct(xScale.nextBreakpoint(xScale.inMin), Seq())
        }

        val yAxisLabels: Seq[(String, Int)] =  {
            @tailrec
            def construct(v: Double, init: Seq[(String, Int)]): Seq[(String, Int)] = {
                if (v > yScale.inMax) {
                    init
                } else {
                    construct(yScale.nextBreakpoint(v), init ++ Seq((yScale.format(v), yScale(v).toInt)))
                }
            }
            construct(yScale.nextBreakpoint(yScale.inMin), Seq())
        }

        def toSVG: Elem = {
            val (viewBoxX, viewBoxY, viewBoxWidth, viewBoxHeight) = config.viewBox
            val (xtitle, ytitle) = config.getTitleCoordinates

            (<g id="datapoints">
                { for { dataPoints <- joinedDatasets } yield  {
                    val color = DefaultColorScheme.next
                    for { (dp1, dp2) <- dataPoints } yield
                        <circle
                            class={(dp1.tags ++ dp2.tags).map(_.toString.replace(' ', '_')) mkString " " }
                            cx={ (chartOrigin._1 + xScale(dp1.value.value)).toString }
                            cy={ (chartOrigin._2 - yScale(dp2.value.value)).toString }
                            fill={ color.toHexString }
                            r={config.radius.toString} />
                } }
            </g>: SVGXML)
                .withGrid(Grid(
                    chartOrigin._1,
                    chartOrigin._2,
                    config.chartWidth,
                    config.chartHeight,
                    xPositions = if(config.xAxis.showGrid) xAxisLabels.map(_._2) else Seq(),
                    yPositions = if(config.yAxis.showGrid) yAxisLabels.map(_._2) else Seq()
                    ))
                .withAxis(HorizontalAxis(
                    x = chartOrigin._1,
                    y = chartOrigin._2,
                    width = config.chartWidth,
                    title = config.xAxis.label,
                    titleSize = config.xAxis.labelSize,
                    titleFontFamily = config.xAxis.labelFontFamily,
                    labels = if(config.xAxis.showLabels) xAxisLabels else Seq(),
                    labelSize = config.xAxis.unitLabelSize,
                    labelFontFamily = config.xAxis.unitLabelFontFamily,
                    arrowSize = config.xAxis.arrowSize,
                    arrowFilled = config.xAxis.arrowFilled))
                .withAxis(VerticalAxis(
                    x = chartOrigin._1,
                    y = chartOrigin._2,
                    height = config.chartHeight,
                    title = config.yAxis.label,
                    titleSize = config.yAxis.labelSize,
                    titleFontFamily = config.yAxis.labelFontFamily,
                    labels = if(config.yAxis.showLabels) yAxisLabels else Seq(),
                    labelSize = config.yAxis.labelSize,
                    labelFontFamily = config.yAxis.labelFontFamily,
                    arrowSize = config.yAxis.arrowSize,
                    arrowFilled = config.yAxis.arrowFilled))
                .withTitle(
                    config.title.title,
                    xtitle,
                    ytitle,
                    config.title.size,
                    config.title.fontFamily,
                    config.title.alignment)
                .withSVGHeader(viewBoxX, viewBoxY, viewBoxWidth, viewBoxHeight)
        }
    }
}

/**
 * The config to create a [[threesixty.visualizer.visualizations.scatterChart.ScatterChartConfig.ScatterChart]].
 *
 * @param ids ids set of ids which are to be displayed in the visualization
 * @param height the height
 * @param width the width
 * @param _border the border
 * @param _colorScheme the color scheme
 * @param _title the title
 * @param _xAxis the x-axis
 * @param _yAxis the y-axis
 * @param _radius the radius of the points
 *
 * @author Thomas {Engel, Weber}
 */
case class ScatterChartConfig(
    val ids:                        Seq[Identifier],
    val height:                     Int,
    val width:                      Int,
    val _border:                    Option[OptBorder]           = None,
    val _colorScheme:               Option[ColorScheme]         = None,
    val _title:                     Option[OptTitleParam]       = None,

    val _xAxis:                     Option[OptValueAxisParam]   = None,
    val _yAxis:                     Option[OptValueAxisParam]   = None,
    val _radius:                    Option[Int]                 = None
) extends VisualizationConfig(
    ids = ids,
    height = height,
    width = width,
    _border = _border,
    _colorScheme = _colorScheme,
    _title = _title,
    _xAxis = _xAxis,
    _yAxis = _yAxis
) {

    /**
      * @return the radius of the points
      */
    def radius: Int = _radius.getOrElse(2)

    require(radius > 0, "Value for radius must be greater than 0.")

    /**
     *  Returns a
     *  [[threesixty.visualizer.visualizations.scatterChart.ScatterChartConfig.ScatterChart]]
     *  using visualizing the given dataset with configuration.
     *
     *  @param pool the pool containing the data
     *  @return the [[threesixty.visualizer.visualizations.lineChart.LineChartConfig.LineChart]] for this configuration
     */
    def apply(pool: DataPool): ScatterChartConfig.ScatterChart =  {
        ScatterChartConfig.ScatterChart(this, pool.getDatasets(ids: _*): _*)
    }

    override def toString(): String = f"$ids $height $width ${_border} ${_colorScheme} ${_title} ${_xAxis} ${_yAxis} ${_radius}"

}


text:
spring-boot-admin
=================
[![Build Status](https://travis-ci.org/codecentric/spring-boot-admin.png?branch=master)](https://travis-ci.org/codecentric/spring-boot-admin)
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/codecentric/spring-boot-admin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This is a simple admin interface for [Spring Boot](http://projects.spring.io/spring-boot/ "Official Spring-Boot website") applications.

This application provides a simple GUI to administrate Spring Boot applications in some ways. At the moment it provides the following features for every registered application.

* Show name/id and version number
* Show health status
* Download main logfile
* Show details, like
 * Java System- / Environment- / Spring properties
 * JVM & memory metrics
 * Counter & gauge Metrics
 * Datasource Metrics
* Easy loggerlevel management
* Interact with JMX-Beans
* View Threaddump

#### Server application
Add the following dependency to your pom.xml.
```xml
<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-admin-server</artifactId>
	<version>1.1.1</version>
</dependency>
```
If you have built your own snapshot-release from git you have to enable the UI seperately by adding one additional dependency
```xml
<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-admin-server-ui</artifactId>
	<version>1.1.1</version>
</dependency>
```

Create the Spring Boot Admin Server with only one single Annotation.
```java
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class Application {
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}
```

See also the [example project](https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample) in this repository.

For configuring Hazelcast support see [spring-boot-admin-server](https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-server/README.md) or [hazelcast-example project](https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast)

#### Client applications
Each application that want to register itself to the admin application has to include the [spring-boot-starter-admin-client](https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-starter-admin-client) as dependency. This starter JAR includes some [AutoConfiguration](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-auto-configuration "Spring Boot documentation") features that includes registering tasks, controller, etc.
```xml
<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-starter-admin-client</artifactId>
	<version>1.1.1</version>
</dependency>
```

Inside your configuration (e.g. application.properties) you also have to define the URL of the Spring Boot Admin Server, e.g.
```
spring.boot.admin.url=http://localhost:8080
```

For all configuration options see [spring-boot-starter-admin-client](https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-starter-admin-client/README.md)

#### Screenshots

##### Dashboard

[](url "title")

##### Details

[](url "title")

##### Logging

[](url "title")

##### JMX

[](url "title")

#### Build
In order to build spring-boot-admin you need to have node.js and npm on your PATH.

```shell
mvn clean package
```

#### Release

```shell
mvn build-helper:parse-version versions:set -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
mvn -Psign-artifacts clean deploy
```

#### Increment version for next release

Example:

```shell
mvn build-helper:parse-version versions:set -DnewVersion=1.0.0-SNAPSHOT
mvn versions:commit
```

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using JetBrains.Metadata.Reader.API;
using Xunit.Sdk;

namespace XunitContrib.Runner.ReSharper.UnitTestProvider
{
    internal class MetadataMethodInfoAdapter : IMethodInfo
    {
        readonly IMetadataMethod method;

        public MetadataMethodInfoAdapter(IMetadataMethod method)
        {
            this.method = method;
        }

        public string TypeName
        {
            get { return method.DeclaringType.FullyQualifiedName; }
        }

        public void Invoke(object testClass, params object[] parameters)
        {
            throw new NotImplementedException();
        }

        public ITypeInfo Class
        {
            get { return method.DeclaringType.AsTypeInfo(); }
        }

        public bool IsAbstract
        {
            get { return method.IsAbstract; }
        }

        public bool IsStatic
        {
            get { return method.IsStatic; }
        }

        public MethodInfo MethodInfo
        {
            get { return null; }
        }

        public string Name
        {
            get { return method.Name; }
        }

        public string ReturnType
        {
            get { return method.ReturnValue.Type.AssemblyQualifiedName; }
        }

        public object CreateInstance()
        {
            throw new NotImplementedException();
        }

        // Get any attributes that are of type attributeType, or that are assignable to attributeType
        // (i.e. attributes that are subclasses of attributeType)
        public IEnumerable<IAttributeInfo> GetCustomAttributes(Type attributeType)
        {
            return from attribute in method.CustomAttributes
                   where attributeType.IsAssignableFrom(attribute.UsedConstructor.DeclaringType)
                   select attribute.AsAttributeInfo();
        }

        public bool HasAttribute(Type attributeType)
        {
            return GetCustomAttributes(attributeType).Any();
        }

        public override string ToString()
        {
            return String.Format("{0} {1}({2})",
                                 method.ReturnValue.Type.AssemblyQualifiedName,
                                 method.Name,
                                 String.Join(", ", method.Parameters.Select(param => param.Type.AssemblyQualifiedName).ToArray()));
        }
    }
}


text:
<?php namespace SleepingOwl\Admin\ColumnFilters;

use AdminTemplate;
use Illuminate\Contracts\Support\Renderable;
use SleepingOwl\Admin\AssetManager\AssetManager;
use SleepingOwl\Admin\Helpers\ExceptionHandler;
use SleepingOwl\Admin\Interfaces\ColumnFilterInterface;

abstract class BaseColumnFilter implements Renderable, ColumnFilterInterface
{

	protected $view;

	/**
	 * Initialize column filter
	 */
	public function initialize()
	{
		AssetManager::addScript('admin::default/js/columnfilters/base.js');
	}

	protected function getParams()
	{
		return [];
	}

	public function render()
	{
		$params = $this->getParams();
		return view(AdminTemplate::view('columnfilter.' . $this->view), $params);
	}

	/**
	 * @return string
	 */
	function __toString()
	{
		try
		{
			return (string)$this->render();
		} catch (\Exception $e)
		{
			ExceptionHandler::handle($e);
		}
	}

}


text:
#pragma once
#include <BWAPI.h>
#include <BWTA.h>
#include "Utils/CSingleton.h"
#include "Intelligence/EUnitsFilter.h"
#include <vector>
#include "Utils/Vec.h"

#include <windows.h>
#include <process.h>

#include "boost/archive/binary_oarchive.hpp"
#include "boost/archive/binary_iarchive.hpp"
#include "boost/serialization/map.hpp"
#include "boost/serialization/utility.hpp"

// #define __BUILDINGS_WT_STRICT__

class BayesianUnit;

struct PathfindWork
{
	BayesianUnit* bunit;
	BWAPI::Unit* unit;
	BWAPI::TilePosition start;
	BWAPI::TilePosition end;
	int damages;
	bool flyer;
	std::vector<BWAPI::TilePosition> btpath;
	PathfindWork(BayesianUnit* ptr, BWAPI::Unit* u, BWAPI::TilePosition s, BWAPI::TilePosition e, int dmg, bool f = false)
		: bunit(ptr)
		, unit(u)
		, start(s)
		, end(e)
		, damages(dmg)
		, flyer(f)
	{
	}
};

struct PathAwareMaps
{
    friend class boost::serialization::access;
	template <class archive>
    void serialize(archive & ar, const unsigned int version)
    {
        ar & regionsPFCenters;
		ar & distRegions;
		ar & distCDR;
        ar & distBaseToBase;
    }
	std::map<int, std::pair<int, int> > regionsPFCenters; // Pathfinding wise region centers
	std::map<int, std::map<int, double> > distRegions; // distRegions[R1][R2] w.r.t regionsPFCenters
	std::map<int, std::map<int, double> > distCDR;
	std::map<int, std::map<int, double> > distBaseToBase;
};

BOOST_CLASS_TRACKING(PathAwareMaps, boost::serialization::track_never);
BOOST_CLASS_VERSION(PathAwareMaps, 2);

typedef int ChokeDepReg;
struct ChokeDepReg_data
{
    friend class boost::serialization::access;
	template <class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
        ar & chokeDependantRegion;
    }
	// -1 -> unwalkable regions
	std::vector<std::vector<ChokeDepReg> > chokeDependantRegion;
	ChokeDepReg_data()
		: chokeDependantRegion(std::vector<std::vector<ChokeDepReg> >(BWAPI::Broodwar->mapWidth(), std::vector<ChokeDepReg>(BWAPI::Broodwar->mapHeight(), -1)))
	{}
	ChokeDepReg_data(const std::vector<std::vector<ChokeDepReg> >& cdr)
		: chokeDependantRegion(cdr)
	{}
};

BOOST_CLASS_TRACKING(ChokeDepReg_data, boost::serialization::track_never);
BOOST_CLASS_VERSION(ChokeDepReg_data, 2);

/** From BWAPI's doc:
* Positions are measured in pixels and are the highest resolution
* Walk Tiles - each walk tile is an 8x8 square of pixels. These are called walk tiles because walkability data is available at this resolution.
* Build Tiles - each build tile is a 4x4 square of walk tiles, or a 32x32 square of pixels. These are called build tiles because buildability data is available at this resolution.
*/

// TODO improve storms with units movements (interpolate)
// TODO improve storms by scoring on UnitTypes
// TODO improve the damage map by considering DPS
// TOCHECK perhaps problem when we lift a terran building (we should call onUnitDestroy)
class MapManager : public CSingleton<MapManager>
{
    friend class CSingleton<MapManager>;
    EUnitsFilter* _eUnitsFilter;
    std::map<BWAPI::Unit*, BWAPI::Position> _ourUnits;
    std::map<BWAPI::Unit*, BWAPI::Position> _trackedUnits;
    std::map<BWAPI::Bullet*, BWAPI::Position> _trackedStorms;
    HANDLE _stormPosMutex;
    HANDLE _signalLaunchStormUpdate;
	HANDLE _stormThread;
    static unsigned __stdcall StaticLaunchUpdateStormPos(void* obj);
    DWORD LaunchUpdateStormPos();
    HANDLE _pathfindingMutex;
    HANDLE _signalLaunchPathfinding;
    HANDLE _pathfindingThread;
    static unsigned __stdcall StaticLaunchPathfinding(void* obj);
    DWORD LaunchPathfinding();
    int _lastStormUpdateFrame;
	std::map<BWAPI::Position, int> _stormPosBuf;
    std::map<BWAPI::Position, int> _dontReStorm;
    std::map<BWAPI::Position, int> _dontReStormBuf;
    std::multimap<double, BWAPI::Unit*> _rangeEnemiesBuf;
    std::map<BWAPI::Unit*, BWAPI::Position> _alliedUnitsPosBuf;
    std::map<BWAPI::Unit*, BWAPI::Position> _enemyUnitsPosBuf;
    std::map<BWAPI::Unit*, std::pair<BWAPI::UnitType, BWAPI::Position> > _invisibleUnitsBuf;
    inline void updateStormPos();
    int _width;
    int _height;
    int _pix_width;
    int _pix_height;
    MapManager();
    ~MapManager();
    inline void modifyBuildings(BWAPI::Unit* u, bool b);
    inline void addBuilding(BWAPI::Unit* u);
    inline void addAlliedUnit(BWAPI::Unit* u);
    inline void removeBuilding(BWAPI::Unit* u);
    inline void removeAlliedUnit(BWAPI::Unit* u);
    inline void modifyDamages(int* tab, BWAPI::Position p, int minRadius, int maxRadius, int damages);
    inline void updateDamagesGrad(Vec* grad, int* tab, BWAPI::Position p, int minRadius, int maxRadius);
    inline void removeDmg(BWAPI::UnitType ut, BWAPI::Position p);
    inline void removeDmgStorm(BWAPI::Position p);
    inline void addDmg(BWAPI::UnitType ut, BWAPI::Position p);
    inline void addDmgWithoutGrad(BWAPI::UnitType ut, BWAPI::Position p);
    inline void addDmgStorm(BWAPI::Position p);
    inline int additionalRangeGround(BWAPI::UnitType ut);
    inline int additionalRangeAir(BWAPI::UnitType ut);

	inline void registerPathfindWork(BayesianUnit* ptr, BWAPI::Unit* u, BWAPI::TilePosition start, BWAPI::TilePosition end, int damages);
	std::list<PathfindWork> _pathfindWorks;
	PathfindWork _currentPathfindWork;
	bool _currentPathfindWorkAborded;
    bool* _buildingsBuf;            // low res => building tiless
    int* _groundDamagesBuf;         // build tiles
    int* _airDamagesBuf;            // build tiles
    bool* _lowResWalkability;       // low res => building tiles
	std::map<BWTA::BaseLocation*, std::vector<BWAPI::TilePosition> > _pathsFromHomeToSL;

    void buildingsAwarePathFind(std::vector<BWAPI::TilePosition>& btpath,
        const BWAPI::TilePosition& start, const BWAPI::TilePosition& end);
    void damagesAwarePathFindAir(std::vector<BWAPI::TilePosition>& btpath,
        const BWAPI::TilePosition& start, const BWAPI::TilePosition& end, int damages);
    void damagesAwarePathFindGround(std::vector<BWAPI::TilePosition>& btpath,
        const BWAPI::TilePosition& start, const BWAPI::TilePosition& end, int damages);
    //void quickPathFind(std::vector<BWAPI::TilePosition>& btpath, // works only with correct Regions
    //    const BWAPI::TilePosition& start,                               // often not the case on custom maps
    //    const BWAPI::TilePosition& end);
    // void pathFind(std::vector<WalkTilePosition>& path,
    //    const BWAPI::Position& p_start, const BWAPI::Position& p_end);
    void straightLine(std::vector<BWAPI::TilePosition>& btpath,
        const BWAPI::TilePosition& start, const BWAPI::TilePosition& end);

	// Neither Region* (of course) nor the ordering in the Regions set is
	// deterministic, so we have a map which maps Region* to a unique int
	// which is region's center (0)<x Position + 1><y Position>
	// on                               16 bits      16 bits
	std::set<ChokeDepReg> allChokeDepRegs;
	ChokeDepReg_data _rd;
	PathAwareMaps _pfMaps;

public:
    bool* walkability;          // walk tiles
    bool* buildings_wt;         // walk tiles
#ifdef __BUILDINGS_WT_STRICT__
    bool* buildings_wt_strict;  // walk tiles
#endif
    bool* buildings;            // low res => building tiless
    int* groundDamages;         // build tiles
    int* airDamages;            // build tiles
    Vec* groundDamagesGrad;     // build tiles
    Vec* airDamagesGrad;        // build tiles
    std::map<BWAPI::Position, int> stormPos;
	bool isWalkable(const BWAPI::TilePosition& tp);
    void onUnitCreate(BWAPI::Unit* u);
    void onUnitDestroy(BWAPI::Unit* u);
    void onUnitShow(BWAPI::Unit* u);
    void onUnitHide(BWAPI::Unit* u);
    void justStormed(BWAPI::Position p);
	void pathfind(BayesianUnit* ptr, BWAPI::Unit* u, BWAPI::TilePosition start, BWAPI::TilePosition end);
	void threatAwarePathfind(BayesianUnit* ptr, BWAPI::Unit* u, BWAPI::TilePosition start, BWAPI::TilePosition end, int damages);
	void cancelPathfind(BayesianUnit* ptr);
	const std::vector<BWAPI::TilePosition>& getPathFromHomeToSL(BWTA::BaseLocation* b);
    void update();
    const std::map<BWAPI::Unit*, BWAPI::Position> & getOurUnits();
    const std::map<BWAPI::Unit*, BWAPI::Position> & getTrackedUnits();
    const std::map<BWAPI::Bullet*, BWAPI::Position> & getTrackedStorms();
    BWAPI::Position closestWalkableSameRegionOrConnected(BWAPI::Position p);
	BWAPI::TilePosition closestWalkable(BWAPI::TilePosition tp, BWTA::Region* r);
    BWAPI::TilePosition closestWalkableSameRegionOrConnected(BWAPI::TilePosition tp);
	BWAPI::TilePosition closestWalkableSameCDR(const BWAPI::TilePosition& tp, ChokeDepReg c);
	BWAPI::TilePosition closestWalkable(const BWAPI::TilePosition& tp);
	static BWTA::Region* closestRegion(const BWAPI::TilePosition& tp);
	ChokeDepReg closestCDR(const BWAPI::TilePosition& tp);
	inline bool isBTRawWalkable(const BWAPI::TilePosition& tp);
	bool isBTWalkable(int x, int y);
	bool isBTWalkable(const BWAPI::TilePosition& tp);
	BWAPI::TilePosition regionsPFCenters(BWTA::Region* r);

	double distRegions(BWTA::Region* r1, BWTA::Region* r2);
	double distBaseToBase(BWTA::BaseLocation* b1, BWTA::BaseLocation* b2);

    void drawBuildings();           // debug
    void drawBuildingsStrict();     // debug
    void drawWalkability();         // debug
    void drawLowResWalkability();   // debug
    void drawLowResBuildings();     // debug
    void drawGroundDamages();       // debug
    void drawAirDamages();          // debug
    void drawGroundDamagesGrad();   // debug
    void drawAirDamagesGrad();      // debug
    void drawBestStorms();          // debug
};


text:
'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var React = require('react');
var touchStyles = require('./touchStyles');

/**
 * Tappable Component
 * ==================
 */
module.exports = function (mixins) {
	return React.createClass({
		displayName: 'Tappable',

		mixins: mixins,

		propTypes: {
			component: React.PropTypes.any, // component to create
			className: React.PropTypes.string, // optional className
			classBase: React.PropTypes.string, // base for generated classNames
			style: React.PropTypes.object, // additional style properties for the component
			disabled: React.PropTypes.bool // only applies to buttons
		},

		getDefaultProps: function getDefaultProps() {
			return {
				component: 'span',
				classBase: 'Tappable'
			};
		},

		render: function render() {
			var props = this.props;
			var className = props.classBase + (this.state.isActive ? '-active' : '-inactive');

			if (props.className) {
				className += ' ' + props.className;
			}

			if (props.classes) {
				className += ' ' + (this.state.isActive ? props.classes.active : props.classes.inactive);
			}

			var style = {};
			_extends(style, touchStyles, props.style);

			var newComponentProps = _extends({}, props, {
				style: style,
				className: className,
				disabled: props.disabled,
				handlers: this.handlers
			}, this.handlers());

			delete newComponentProps.onTap;
			delete newComponentProps.onPress;
			delete newComponentProps.onPinchStart;
			delete newComponentProps.onPinchMove;
			delete newComponentProps.onPinchEnd;
			delete newComponentProps.moveThreshold;
			delete newComponentProps.pressDelay;
			delete newComponentProps.pressMoveThreshold;
			delete newComponentProps.preventDefault;
			delete newComponentProps.stopPropagation;
			delete newComponentProps.component;

			return React.createElement(props.component, newComponentProps, props.children);
		}
	});
};


text:
#include "sensor3d.h"

#include "src/sensor3dWorker.h"

using namespace trikControl;

Sensor3d::Sensor3d(int min, int max, const QString &controlFile)
	: mSensor3dWorker(new Sensor3dWorker(min, max, controlFile))
{
	connect(mSensor3dWorker.data(), SIGNAL(newData(QVector<int>)), this, SIGNAL(newData(QVector<int>)));
	mSensor3dWorker->moveToThread(&mWorkerThread);
	mWorkerThread.start();
}

Sensor3d::~Sensor3d()
{
	mWorkerThread.quit();
	mWorkerThread.wait();
}

QVector<int> Sensor3d::read() const
{
	return mSensor3dWorker->read();
}


text:
"""
Migration for the Submitty system.
Adds bool to specify if the machine is a worker to Submitty.config
"""
from pathlib import Path
import json
import os
import pwd
import shutil

def up(config):
    DAEMON_USER = 'submitty_daemon'

    autograding_containers = str(Path(config.submitty['submitty_install_dir'], 'config', 'autograding_containers.json'))

    if os.path.exists(autograding_containers):
        return

    container_dict = {
            "default": [
                          "submitty/clang:6.0",
                          "submitty/autograding-default:latest",
                          "submitty/java:8",
                          "submitty/java:11",
                          "submitty/python:3.6"
                       ]
        }

    with open(autograding_containers, 'w') as container_file:
        json.dump(container_dict, container_file, indent=4)

    shutil.chown(autograding_containers, 'root', pwd.getpwnam(DAEMON_USER).pw_gid)
    os.chmod(autograding_containers, 0o460)

# no need for down as email_enabled is not used in previous builds
def down(config):
    pass


text:
package org.apache.activemq.artemis.tests.integration.mqtt;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import java.util.LinkedList;

import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
import org.apache.activemq.artemis.tests.integration.mqtt.imported.MQTTTestSupport;
import org.apache.activemq.artemis.tests.util.Wait;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.jgroups.util.UUID;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;

public class MqttWildCardSubAutoCreateTest extends MQTTTestSupport {

   private int lastId;
   private MqttClient subscriber;
   private MqttClient sender;
   private volatile LinkedList<String> topics = new LinkedList<>();

   @After
   public void clean() throws MqttException {
      topics.clear();
      if (subscriber != null && subscriber.isConnected()) {
         subscriber.disconnect();
         subscriber.close();
      }
      if (sender != null && sender.isConnected()) {
         sender.disconnect();
         sender.close();
      }
   }

   @Override
   protected ActiveMQServer createServer(final boolean realFiles, final Configuration configuration) {
      configuration.setGlobalMaxSize(15);
      return createServer(realFiles, configuration, AddressSettings.DEFAULT_PAGE_SIZE, 10);
   }

   @Test
   public void testWildcardSubAutoCreateDoesNotPageToWildcardAddress() throws Exception {

      server.getManagementService().enableNotifications(false);

      String subscriberId = UUID.randomUUID().toString();
      String senderId = UUID.randomUUID().toString();
      String subscribeTo = "A.*";
      String publishTo = "A.a";

      subscriber = createMqttClient(subscriberId);
      subscriber.subscribe(subscribeTo, 2);

      subscriber.disconnect();

      sender = createMqttClient(senderId);
      sender.publish(publishTo, UUID.randomUUID().toString().getBytes(), 2, false);
      sender.publish(publishTo, UUID.randomUUID().toString().getBytes(), 2, false);

      assertTrue(server.getPagingManager().getPageStore(new SimpleString(subscribeTo)).isPaging());

      subscriber = createMqttClient(subscriberId);
      subscriber.subscribe(subscribeTo, 2);

      boolean satisfied = Wait.waitFor(() -> topics.size() == 2, 5_000);
      if (!satisfied) {
         Assert.fail();
      }

      subscriber.messageArrivedComplete(lastId, 2);
      subscriber.disconnect();
      subscriber.close();

      for (String topic : topics) {
         assertEquals("A/a", topic);
      }

   }

   private MqttClient createMqttClient(String clientId) throws MqttException {
      MqttClient client = new MqttClient("tcp://localhost:" + getPort(), clientId, new MemoryPersistence());
      client.setCallback(createCallback());
      client.setManualAcks(true);
      MqttConnectOptions options = new MqttConnectOptions();
      options.setCleanSession(false);
      client.connect(options);
      return client;
   }

   private MqttCallback createCallback() {
      return new MqttCallback() {

         @Override
         public void messageArrived(String topic, MqttMessage message) throws Exception {
            topics.add(topic);
            lastId = message.getId();
         }

         @Override
         public void deliveryComplete(IMqttDeliveryToken token) {
         }

         @Override
         public void connectionLost(Throwable cause) {
         }
      };
   }

   @Test
   public void testCoreHierarchicalTopic() throws Exception {

      try {
         AssertionLoggerHandler.startCapture();

         ConnectionFactory cf = new ActiveMQConnectionFactory();

         Connection connection = cf.createConnection();
         connection.setClientID("CLI-ID");

         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

         Topic topicSubscribe = ActiveMQJMSClient.createTopic("news.europe.#");

         MessageConsumer messageConsumer = session.createDurableConsumer(topicSubscribe, "news-eu");

         MessageProducer producer = session.createProducer(null);

         Topic topicNewsUsaWrestling = ActiveMQJMSClient.createTopic("news.usa.wrestling");
         Topic topicNewsEuropeSport = ActiveMQJMSClient.createTopic("news.europe.sport");
         Topic topicNewsEuropeEntertainment = ActiveMQJMSClient.createTopic("news.europe.entertainment");

         TextMessage messageWrestlingNews = session.createTextMessage("Hulk Hogan starts ballet classes");
         addSizeProp(messageWrestlingNews);
         producer.send(topicNewsUsaWrestling, messageWrestlingNews);

         TextMessage messageEuropeSport = session.createTextMessage("Lewis Hamilton joins European synchronized swimming team");
         producer.send(topicNewsEuropeSport, messageEuropeSport);

         TextMessage messageEuropeEntertainment = session.createTextMessage("John Lennon resurrected from dead");
         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);

         connection.start();

         // second consumer to page to different address
         Topic topicSubscribeAllNews = ActiveMQJMSClient.createTopic("news.#");

         MessageConsumer messageConsumerAllNews = session.createDurableConsumer(topicSubscribeAllNews, "news-all");

         producer.send(topicNewsUsaWrestling, messageWrestlingNews);
         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);

         MessageConsumer messageConsumerEuEnt = session.createDurableConsumer(topicNewsEuropeEntertainment, "news-eu-ent");

         producer.send(topicNewsUsaWrestling, messageWrestlingNews);
         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);

         System.out.println("Usage " + server.getPagingManager().getGlobalSize());

         TextMessage msg = (TextMessage) messageConsumerAllNews.receive(5000);

         System.out.println("1 All received message: " + msg.getText() + ", dest: " + msg.getJMSDestination());

         msg = (TextMessage) messageConsumerAllNews.receive(5000);

         System.out.println("2 All received message: " + msg.getText() + ", dest: " + msg.getJMSDestination());

         msg = (TextMessage) messageConsumerEuEnt.receive(5000);

         System.out.println("3 EuEnt received message: " + msg.getText() + ", dest: " + msg.getJMSDestination());

         TextMessage messageReceived1 = (TextMessage) messageConsumer.receive(5000);

         System.out.println("4 Received message: " + messageReceived1.getText() + ", dest: " + messageReceived1.getJMSDestination());

         TextMessage messageReceived2 = (TextMessage) messageConsumer.receive(5000);

         System.out.println("5 Received message: " + messageReceived2.getText() + ", dest: " + messageReceived2.getJMSDestination());

         // verify messageConsumer gets messageEuropeEntertainment
         msg = (TextMessage) messageConsumer.receive(5000);

         System.out.println("6 Eu received message: " + msg.getText() + ", dest: " + msg.getJMSDestination());

         assertEquals(topicNewsEuropeSport, messageReceived1.getJMSDestination());
         assertEquals(topicNewsEuropeEntertainment, messageReceived2.getJMSDestination());
         assertEquals(topicNewsEuropeEntertainment, msg.getJMSDestination());

         messageConsumer.close();
         messageConsumerAllNews.close();

         int countOfPageStores = server.getPagingManager().getStoreNames().length;
         assertEquals("there should be 5", 5, countOfPageStores);

         connection.close();

         Assert.assertFalse(AssertionLoggerHandler.findText("222295"));
      } finally {
         AssertionLoggerHandler.stopCapture();
      }
   }

   private void addSizeProp(TextMessage messageWrestlingNews) throws JMSException {
      messageWrestlingNews.setStringProperty("stuff", new String(new byte[1024]));
   }
}


text:
package formbeans;

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

import org.mybeans.form.FormBean;

public class UserForm extends FormBean {
	private String email = "";

	public String getEmail()  { return email; }

	public void setEmail(String s)  { email = trimAndConvert(s,"<>>\"]"); }

	public List<String> getValidationErrors() {
		List<String> errors = new ArrayList<String>();

		if (email == null || email.length() == 0) {
			errors.add("Email is required");
		}

		return errors;
	}
}


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

<TITLE>
NPOIFSStream.StreamBlockByteBuffer (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.poifs.filesystem

Class NPOIFSStream.StreamBlockByteBuffer

java.lang.Object
  java.io.OutputStream
      org.apache.poi.poifs.filesystem.NPOIFSStream.StreamBlockByteBuffer

All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

Enclosing class:
NPOIFSStream

protected class NPOIFSStream.StreamBlockByteBuffer
extends java.io.OutputStream

Constructor Summary

protected
NPOIFSStream.StreamBlockByteBuffer()

Method Summary

 void
close()

protected  void
createBlockIfNeeded()

 void
write(byte[] b,
      int off,
      int len)

 void
write(int b)

Methods inherited from class java.io.OutputStream

flush, write

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NPOIFSStream.StreamBlockByteBuffer

protected NPOIFSStream.StreamBlockByteBuffer()
                                      throws java.io.IOException

Throws:

java.io.IOException

Method Detail

createBlockIfNeeded

protected void createBlockIfNeeded()
                            throws java.io.IOException

Throws:

java.io.IOException

write

public void write(int b)
           throws java.io.IOException

Specified by:
write in class java.io.OutputStream

Throws:

java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException

Overrides:
write in class java.io.OutputStream

Throws:

java.io.IOException

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

Throws:

java.io.IOException

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2015 The Apache Software Foundation or
        its licensors, as applicable.


text:
using System;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;
using System.Xml.Serialization;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Spatial.Units;

namespace MathNet.Spatial
{
    [Serializable]
    public struct Plane : IEquatable<Plane>, IXmlSerializable
    {
        public readonly UnitVector3D Normal;
        public readonly Point3D RootPoint;
        public readonly double D;

        public Plane(double a, double b, double c, double d)
            : this(new UnitVector3D(a, b, c), -1*d)
        {
        }

        public Plane(UnitVector3D normal, double offset = 0)
        {
            this.Normal = normal;
            this.RootPoint = (offset*normal).ToPoint3D();
            this.D = -1*offset;
        }

        public Plane(UnitVector3D normal, Point3D rootPoint)
            : this(rootPoint, normal)
        {
        }

        public Plane(Point3D rootPoint, UnitVector3D normal)
        {
            this.RootPoint = rootPoint;
            this.Normal = normal;
            this.D = -this.RootPoint.ToVector3D().DotProduct(this.Normal);
        }

        /// <summary>
        /// Creates a Plane from its string representation
        /// </summary>
        /// <param name="s">The string representation of the Plane</param>
        /// <returns></returns>
        public static Plane Parse(string s)
        {
            return Parser.ParsePlane(s);
        }

        public double A
        {
            get { return this.Normal.X; }
        }

        public double B
        {
            get { return this.Normal.Y; }
        }

        public double C
        {
            get { return this.Normal.Z; }
        }

        public static bool operator ==(Plane left, Plane right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(Plane left, Plane right)
        {
            return !left.Equals(right);
        }

        public double SignedDistanceTo(Point3D point)
        {
            var point3D = Project(point);
            var vectorTo = point3D.VectorTo(point);
            return vectorTo.DotProduct(this.Normal);
        }

        public double SignedDistanceTo(Plane otherPlane)
        {
            if (!this.Normal.IsParallelTo(otherPlane.Normal, tolerance: 1E-15))
            {
                throw new ArgumentException("Planes are not parallel");
            }

            return SignedDistanceTo(otherPlane.RootPoint);
        }

        public double SignedDistanceTo(Ray3D ray)
        {
            if (Math.Abs(ray.Direction.DotProduct(this.Normal) - 0) < 1E-15)
            {
                return SignedDistanceTo(ray.ThroughPoint);
            }

            return 0;
        }

        public double AbsoluteDistanceTo(Point3D point)
        {
            return Math.Abs(SignedDistanceTo(point));
        }

        public Point3D Project(Point3D p, UnitVector3D? projectionDirection = null)
        {
            double dotProduct = this.Normal.DotProduct(p.ToVector3D());
            var projectiononNormal = projectionDirection == null ? this.Normal : projectionDirection.Value;
            var projectionVector = (dotProduct + this.D)*projectiononNormal;
            return p - projectionVector;
        }

        public Line3D Project(Line3D line3DToProject)
        {
            var projectedStartPoint = Project(line3DToProject.StartPoint);
            var projectedEndPoint = Project(line3DToProject.EndPoint);
            return new Line3D(projectedStartPoint, projectedEndPoint);
        }

        public Ray3D Project(Ray3D rayToProject)
        {
            var projectedThroughPoint = Project(rayToProject.ThroughPoint);
            var projectedDirection = Project(rayToProject.Direction.ToVector3D());
            return new Ray3D(projectedThroughPoint, projectedDirection.Direction);
        }

        /// <summary>
        /// Project Vector3D onto this plane
        /// </summary>
        /// <param name="vector3DToProject">The Vector3D to project</param>
        /// <returns>The projected Vector3D</returns>
        public Ray3D Project(Vector3D vector3DToProject)
        {
            var projectedEndPoint = Project(vector3DToProject.ToPoint3D());
            var projectedZero = this.Project(new Point3D(0, 0, 0));
            return new Ray3D(projectedZero, projectedZero.VectorTo(projectedEndPoint).Normalize());
        }

        /// <summary>
        /// Project Vector3D onto this plane
        /// </summary>
        /// <param name="vector3DToProject">The Vector3D to project</param>
        /// <returns>The projected Vector3D</returns>
        public Ray3D Project(UnitVector3D vector3DToProject)
        {
            return Project(vector3DToProject.ToVector3D());
        }

        /// <summary>
        /// Finds the intersection of the two planes, throws if they are parallel
        /// http://mathworld.wolfram.com/Plane-PlaneIntersection.html
        /// </summary>
        /// <param name="intersectingPlane"></param>
        /// <param name="tolerance"></param>
        /// <returns></returns>
        public Ray3D IntersectionWith(Plane intersectingPlane, double tolerance = float.Epsilon)
        {
            var a = new DenseMatrix(2, 3);
            a.SetRow(0, this.Normal.ToVector());
            a.SetRow(1, intersectingPlane.Normal.ToVector());
            var svd = a.Svd(true);
            if (svd.S[1] < tolerance)
            {
                throw new ArgumentException("Planes are parallel");
            }

            var y = new DenseMatrix(2, 1);
            y[0, 0] = -1*this.D;
            y[1, 0] = -1*intersectingPlane.D;

            Matrix<double> pointOnIntersectionLine = svd.Solve(y);
            var throughPoint = new Point3D(pointOnIntersectionLine.Column(0));

            var direction = new UnitVector3D(svd.VT.Row(2));

            return new Ray3D(throughPoint, direction);
        }

        /// <summary>
        /// http://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/raycast/sld017.htm
        /// </summary>
        /// <param name="ray"></param>
        /// <param name="tolerance"></param>
        /// <returns></returns>
        public Point3D IntersectionWith(Ray3D ray, double tolerance = float.Epsilon)
        {
            var d = SignedDistanceTo(ray.ThroughPoint);
            var t = -1*d/ray.Direction.DotProduct(this.Normal);
            return ray.ThroughPoint + (t*ray.Direction);
        }

        public Point3D MirrorAbout(Point3D p)
        {
            Point3D p2 = Project(p);
            double d = SignedDistanceTo(p);
            return p2 - (1*d*this.Normal);
        }

        public Plane Rotate(UnitVector3D aboutVector, Angle angle)
        {
            var rootPoint = this.RootPoint;
            var rotatedPoint = rootPoint.Rotate(aboutVector, angle);
            var rotatedPlaneVector = this.Normal.Rotate(aboutVector, angle);
            return new Plane(rotatedPlaneVector, rotatedPoint);
        }

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(Plane other)
        {
            return this.RootPoint == other.RootPoint && this.Normal == other.Normal;
        }

        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            return obj is Plane && this.Equals((Plane)obj);
        }

        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = this.A.GetHashCode();
                result = (result*397) ^ this.C.GetHashCode();
                result = (result*397) ^ this.B.GetHashCode();
                result = (result*397) ^ this.D.GetHashCode();
                return result;
            }
        }

        public static Point3D PointFromPlanes(Plane plane1, Plane plane2, Plane plane3)
        {
            return Point3D.ItersectionOf(plane1, plane2, plane3);
        }

        public override string ToString()
        {
            return string.Format("A:{0} B:{1} C:{2} D:{3}", Math.Round(this.A, 4), Math.Round(this.B, 4), Math.Round(this.C, 4), Math.Round(this.D, 4));
        }

        public XmlSchema GetSchema()
        {
            return null;
        }

        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            var e = (XElement)XNode.ReadFrom(reader);
            XmlExt.SetReadonlyField(ref this, l => l.RootPoint, Point3D.ReadFrom(e.SingleElement("RootPoint").CreateReader()));
            XmlExt.SetReadonlyField(ref this, l => l.Normal, UnitVector3D.ReadFrom(e.SingleElement("Normal").CreateReader()));
            XmlExt.SetReadonlyField(ref this, l => l.D, -this.RootPoint.ToVector3D().DotProduct(this.Normal));
        }

        public void WriteXml(XmlWriter writer)
        {
            writer.WriteElement("RootPoint", this.RootPoint);
            writer.WriteElement("Normal", this.Normal);
        }
    }
}


text:
"""The syncthru component."""
from __future__ import annotations

from datetime import timedelta
import logging

import async_timeout
from pysyncthru import ConnectionMode, SyncThru, SyncThruAPINotSupported

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_URL, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import aiohttp_client, device_registry as dr
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

from .const import DOMAIN

_LOGGER = logging.getLogger(__name__)

PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
    """Set up config entry."""

    session = aiohttp_client.async_get_clientsession(hass)
    hass.data.setdefault(DOMAIN, {})
    printer = SyncThru(
        entry.data[CONF_URL], session, connection_mode=ConnectionMode.API
    )

    async def async_update_data() -> SyncThru:
        """Fetch data from the printer."""
        try:
            async with async_timeout.timeout(10):
                await printer.update()
        except SyncThruAPINotSupported as api_error:
            # if an exception is thrown, printer does not support syncthru
            _LOGGER.info(
                "Configured printer at %s does not provide SyncThru JSON API",
                printer.url,
                exc_info=api_error,
            )
            raise api_error
        else:
            # if the printer is offline, we raise an UpdateFailed
            if printer.is_unknown_state():
                raise UpdateFailed(
                    f"Configured printer at {printer.url} does not respond."
                )
            return printer

    coordinator: DataUpdateCoordinator = DataUpdateCoordinator(
        hass,
        _LOGGER,
        name=DOMAIN,
        update_method=async_update_data,
        update_interval=timedelta(seconds=30),
    )
    hass.data[DOMAIN][entry.entry_id] = coordinator
    await coordinator.async_config_entry_first_refresh()
    if isinstance(coordinator.last_exception, SyncThruAPINotSupported):
        # this means that the printer does not support the syncthru JSON API
        # and the config should simply be discarded
        return False

    device_registry = dr.async_get(hass)
    device_registry.async_get_or_create(
        config_entry_id=entry.entry_id,
        configuration_url=printer.url,
        connections=device_connections(printer),
        default_manufacturer="Samsung",
        identifiers=device_identifiers(printer),
        model=printer.model(),
        name=printer.hostname(),
    )

    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
    return True

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
    """Unload the config entry."""
    unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
    hass.data[DOMAIN].pop(entry.entry_id, None)
    return unload_ok

def device_identifiers(printer: SyncThru) -> set[tuple[str, str]] | None:
    """Get device identifiers for device registry."""
    serial = printer.serial_number()
    if serial is None:
        return None
    return {(DOMAIN, serial)}

def device_connections(printer: SyncThru) -> set[tuple[str, str]]:
    """Get device connections for device registry."""
    if mac := printer.raw().get("identity", {}).get("mac_addr"):
        return {(dr.CONNECTION_NETWORK_MAC, mac)}
    return set()


text:
import base64

def generate_icon(image_path):
    """
    Get the feed icon as a base64(png)
    returns None when not found
    """
    try:
        f = open(image_path, 'rb')
        return base64.b64encode(f.read()).decode()
    except:
        return None

def generate_feed(feed_name, summary, tech_data, provider_url, icon_path, display_name=None, category=None, small_icon_path=None):
    """
    return a dictionary that represents a feed
    this sets the feed 'metadata' - the description of the feed, and not the feed contents
    this also initializes the reports value
    """

    feed = {}
    feed_info = {}

    feed_info["name"] = feed_name
    feed_info["display_name"] = display_name or feed_name
    feed_info["summary"] = summary
    feed_info["tech_data"] = tech_data
    feed_info["provider_url"] = provider_url

    icon = generate_icon(icon_path)
    if None != icon:
        feed_info["icon"] = icon

    # Add a small icon, if present
    # FEED-129
    if None != small_icon_path:
        small_icon = generate_icon(small_icon_path)
        if None != small_icon:
            feed_info["icon_small"] = small_icon

    # Add a feed category, if present
    # FEED-129
    if None != category:
        feed_info["category"] = category

    feed["feedinfo"] = feed_info
    feed["reports"] = []

    return feed


text:
//-----------------------------------------------------------------------
// <copyright file="XamlFilterTree.cs" company="Development In Progress Ltd">
//     Copyright © Development In Progress Ltd 2013. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

using System.Collections;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace DevelopmentInProgress.WPFControls.FilterTree
{
    /// <summary>
    /// The XamlFilterTree control displays hierarchical data that can be filtered
    /// dynamically. It also provides commands for adding and removing new items
    /// to the hierarchy via context menues and facilitates drag and drop.
    /// </summary>
    public class XamlFilterTree : Control
    {
        private static readonly DependencyProperty HeaderProperty;
        private static readonly DependencyProperty FilterTextProperty;
        private static readonly DependencyProperty ItemsSourceProperty;
        private static readonly DependencyProperty AddItemCommandProperty;
        private static readonly DependencyProperty RemoveItemCommandProperty;
        private static readonly DependencyProperty SelectItemCommandProperty;
        private static readonly DependencyProperty DragDropCommandProperty;
        private static readonly DependencyProperty IsEditableProperty;

        /// <summary>
        /// Static constructor for registering dependency properties.
        /// </summary>
        static XamlFilterTree()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof (XamlFilterTree),
                new FrameworkPropertyMetadata(typeof (XamlFilterTree)));

            HeaderProperty = DependencyProperty.Register("Header", typeof (string), typeof (XamlFilterTree));

            FilterTextProperty = DependencyProperty.Register("FilterText", typeof (string), typeof (XamlFilterTree));

            ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable),
                typeof(XamlFilterTree));

            AddItemCommandProperty = DependencyProperty.Register("AddItemCommand", typeof (ICommand),
                typeof (XamlFilterTree));

            RemoveItemCommandProperty = DependencyProperty.Register("RemoveItemCommand", typeof(ICommand),
                typeof (XamlFilterTree));

            SelectItemCommandProperty = DependencyProperty.Register("SelectItemCommand", typeof (ICommand),
                typeof (XamlFilterTree));

            DragDropCommandProperty = DependencyProperty.Register("DragDropCommand", typeof(ICommand),
                typeof (XamlFilterTree));

            IsEditableProperty = DependencyProperty.Register("IsEditable", typeof(bool),
                typeof (XamlFilterTree), new PropertyMetadata(true));
        }

        /// <summary>
        /// Gets or sets the header.
        /// </summary>
        public string Header
        {
            get { return (string)GetValue(HeaderProperty); }
            set { SetValue(HeaderProperty, value); }
        }

        /// <summary>
        /// Gets or sets the filter text.
        /// </summary>
        public string FilterText
        {
            get { return GetValue(FilterTextProperty).ToString(); }
            set { SetValue(FilterTextProperty, value); }
        }

        /// <summary>
        /// Gets or sets the hierarchical items source.
        /// </summary>
        public IEnumerable ItemsSource
        {
            get { return (IEnumerable)GetValue(ItemsSourceProperty); }
            set { SetValue(ItemsSourceProperty, value); }
        }

        /// <summary>
        /// Gets or sets the command to add items to the hierarchical list.
        /// </summary>
        public ICommand AddItemCommand
        {
            get { return (ICommand)GetValue(AddItemCommandProperty); }
            set { SetValue(AddItemCommandProperty, value); }
        }

        /// <summary>
        /// Gets or sets the command to remove items from the hierarchical list.
        /// </summary>
        public ICommand RemoveItemCommand
        {
            get { return (ICommand)GetValue(RemoveItemCommandProperty); }
            set { SetValue(RemoveItemCommandProperty, value); }
        }

        /// <summary>
        /// Gets or sets the selected item command which is executed when pressing
        /// the return key on the selected item or double clicking it with the mouse.
        /// </summary>
        public ICommand SelectItemCommand
        {
            get { return (ICommand)GetValue(SelectItemCommandProperty); }
            set { SetValue(SelectItemCommandProperty, value); }
        }

        /// <summary>
        /// Gets or sets the drag drop command which is executed when an item is
        /// dragged and dropped onto a target item in the <see cref="XamlFilterTree"/>.
        /// </summary>
        public ICommand DragDropCommand
        {
            get { return (ICommand)GetValue(DragDropCommandProperty); }
            set { SetValue(DragDropCommandProperty, value); }
        }

        /// <summary>
        /// Gets or sets a value indicating wwhether the XamlFilterTree is editable or not.
        /// The XamlFilterTree is editable by default.
        /// </summary>
        public bool IsEditable
        {
            get { return (bool) GetValue(IsEditableProperty); }
            set { SetValue(IsEditableProperty, value); }
        }
    }
}


text:
import { invoke } from "../fp";
export = invoke;


text:
class FireCube
{
public:
    FireCube(void);
    ~FireCube(void);

    bool    init();

    void    draw();

private:

    bool            initBuffer();
    bool            initVertexArray();
    bool            initProgram();
    bool            initTexture(const char* pFileName);

    GLuint			m_uiVertexBuffer;
    GLuint          m_uiElementBuffer;
    GLuint          m_uiVertexArray;
    GLuint          m_uiTexture;
    GLint           m_nSampler;

    GLuint          m_MVMLocation;
    GLuint          m_MVPLocation;
    GLuint          m_uiLightBuffer;

	GLuint m_program;

};


text:
<?php global $wptouch_settings; ?>

 <?php _e( "Advertising, Stats & Custom Code", "wptouch" ); ?>

<?php _e( 'Advertising Service', 'wptouch' ); ?>

<?php _e( 'Choose which advertising service you would like to use within WPtouch.', 'wptouch' ); ?>

						<select name="ad_service" id="ad_service">
							<option value="none"<?php if ( $wptouch_settings['ad_service'] == 'none') echo " selected"; ?>><?php _e( "None", "wptouch" ); ?></option>
							<option value="adsense"<?php if ( $wptouch_settings['ad_service'] == 'adsense') echo " selected"; ?>><?php _e( "Google Adsense", "wptouch" ); ?></option>

						</select>
						<?php _e( "Advertising Service", "wptouch" ); ?>

<?php _e( "Google Adsense", "wptouch" ); ?>

<?php _e( "Enter your Google AdSense ID if you'd like use it to add support for mobile advertising in WPtouch posts.", "wptouch" ); ?>

<?php _e( "Make sure to include the 'pub-' part of your ID string.", "wptouch" ); ?>

<input name="adsense-id" type="text" value="<?php echo $wptouch_settings['adsense-id']; ?>" /><?php _e( "Google AdSense ID", "wptouch" ); ?>

<input name="adsense-channel" type="text" value="<?php echo $wptouch_settings['adsense-channel']; ?>" /><?php _e( "Google AdSense Channel", "wptouch" ); ?>

<?php _e( "Stats & Custom Code", "wptouch" ); ?>

<?php _e( "If you'd like to capture traffic statistics ", "wptouch" ); ?>
<?php _e( "(Google Analytics, MINT, etc.)", "wptouch" ); ?>

<?php _e( "Enter the code snippet(s) for your statistics tracking.", "wptouch" ); ?> <?php _e( "You can also enter custom CSS & other HTML code.", "wptouch" ); ?> ?

<?php _e( "More Info", "wptouch" ); ?>

<?php _e( "You may enter a custom css file link easily. Simply add the full link to the css file like this:", "wptouch" ); ?>

<?php _e( "<style type="text/css">#mydiv { color: red; }</style>", "wptouch" ); ?>

				<?php if ( is_super_admin() ) { ?>
					<textarea id="wptouch-stats" name="statistics"><?php echo stripslashes($wptouch_settings['statistics']); ?></textarea>
				<?php } else { ?>
					<?php _e( "(Requires Super Admin priviledges)", "wptouch" ); ?>
				<?php } ?>


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p10/procedures/hwp/nest/p10_pcie_utils.C $   */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2020                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
///
/// @file p10_pcie_utils.C
/// @brief Common utility functions to support PCIE related HWPs.
///
/// *HWP HW Maintainer: Thi Tran <thi@us.ibm.com>
/// *HWP FW Maintainer: Ilya Smirnov <ismirno@us.ibm.com>
/// *HWP Consumed by: HB, Cronus
///

//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include <p10_pcie_utils.H>

//------------------------------------------------------------------------------
// Function definitions
//------------------------------------------------------------------------------

// Doxygen is in header file
fapi2::ReturnCode isPHBEnabled(const fapi2::Target<fapi2::TARGET_TYPE_PHB>& i_target,
                               bool& o_enabled)
{
    FAPI_DBG("Start");

    fapi2::ATTR_CHIP_UNIT_POS_Type l_phb_id;
    o_enabled = false;
    uint8_t l_phb_active[NUM_PHB_PER_PEC] = {0};
    fapi2::Target<fapi2::TARGET_TYPE_PEC> l_pecTarget = i_target.getParent<fapi2::TARGET_TYPE_PEC>();

    //Get the PHB id
    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_phb_id),
             "Error from FAPI_ATTR_GET (ATTR_CHIP_UNIT_POS)");
    // Get active PEC's PHB active attributes
    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_PCIE_PHB_ACTIVE, l_pecTarget, l_phb_active),
             "Error from FAPI_ATTR_GET (ATTR_PROC_PCIE_PHB_ACTIVE");
    FAPI_DBG("PHB id %d: Active 0=%d, 1=%d, 2=%d",
             l_phb_id, l_phb_active[0], l_phb_active[1], l_phb_active[2]);

    if ( l_phb_active[(l_phb_id % NUM_PHB_PER_PEC)] ==
         fapi2::ENUM_ATTR_PROC_PCIE_PHB_ACTIVE_ENABLE )
    {
        o_enabled = true;
    }

fapi_try_exit:
    FAPI_DBG("End");
    return fapi2::current_err;
}


text:
package net.sundell.otter;

/**
 * Convenience class to simplify the creation
 * of mixed content TUs.
 */
public class TUVBuilder {
	private TU tu = null;
	private TUV tuv;
	private boolean built = false;

	TUVBuilder(String locale) {
		tuv = new TUV(locale);
	}

	TUVBuilder(TU tu, String locale) {
	    this(locale);
	    this.tu = tu;
	}

	/**
	 * Return a nested TUVBuilder that will insert its
	 * contents at the current build point.
	 * @return a new TUVBuilder inserted at the current point
	 *         in the parent TUV
	 */
	public TUVBuilder nested() {
	    return new TUVBuilder(tuv.getLocale());
	}

	/**
	 * Generate a TUV based on the content that has been
	 * added to this TUVBuilder.  This TUV will also
	 * be added to the {@link TU} that created this object.
	 *

	 * Calling this method multiple times will cause an
	 * {@link IllegalStateException} to be thrown.
	 * @return TUV constructed from the contents of this builder
	 */
	public TUV build() {
	    if (built) {
	        throw new IllegalStateException(
	                "TUVBuilder.build() called multiple times");
	    }
	    built = true;
	    if (tu != null) {
	        tu.addTUV(tuv);
	    }
		return tuv;
	}

	/**
	 * Add text to thi
	 * @param content
	 * @return this TUVBuilder
	 */
	public TUVBuilder text(String content) {
		tuv.addContent(new TextContent(content));
		return this;
	}

	/**
	 * Add {@link TagContent} to this TUV.  Not all
	 * {@link TagContent} objects may be added at all times -
	 * the builder will enforce the same restrictions as various
	 * implementations of {@link TUVContentSink#addContent(TUVContent)},
	 * as appropriate.
	 * @param content {@link TUVContent} object to add.
	 * @return this TUVBuilder
	 */
	public TUVBuilder tag(TagContent content) {
	    tuv.addContent(content);
	    return this;
	}

	/**
	 * Add a {@link BeginTag} with the specified i value and
	 * code content.
	 * @param i
	 * @param codeContent
	 * @return this TUVBuilder
	 */
	public TUVBuilder bpt(int i, String codeContent) {
		BeginTag bpt = new BeginTag(i);
		return addCodeContent(bpt, codeContent);
	}

    /**
     * Add a {@link BeginTag} with the specified i and
     * x value and code content.
     * @param i
     * @param codeContent
     * @return this TUVBuilder
     */
	public TUVBuilder bpt(int i, int x, String codeContent) {
	    BeginTag bpt = new BeginTag(i);
	    bpt.setX(x);
        return addCodeContent(bpt, codeContent);
	}

    /**
     * Add a {@link BeginTag} with the specified i value and
     * complex code contents.
     * @param i
     * @param content
     * @return this TUVBuilder
     */
	public TUVBuilder bpt(int i, ComplexContent content) {
	    BeginTag bpt = new BeginTag(i);
	    return addComplexContent(bpt, content);
	}

    /**
     * Add a {@link BeginTag} with the specified i and
     * x values and complex code contents.
     * @param i
     * @param content
     * @return this TUVBuilder
     */
	public TUVBuilder bpt(int i, int x, ComplexContent content) {
	    BeginTag bpt = new BeginTag(i);
        bpt.setX(x);
        return addComplexContent(bpt, content);
    }

	/**
	 * Add a {@link EndTag} with the specified i value
	 * and code contents.
	 * @param i
	 * @param codeContent
	 * @return this TUVBuilder
	 */
	public TUVBuilder ept(int i, String codeContent) {
		tuv.addContent(new EndTag(i, codeContent));
		return this;
	}

	/**
	 * Add a {@link PlaceholderTag} with the specified code contents.
	 * @param codeContent
	 * @return this TUVBuilder
	 */
	public TUVBuilder ph(String codeContent) {
		PlaceholderTag ph = new PlaceholderTag();
		return addCodeContent(ph, codeContent);
	}

	/**
	 * Add a {@link PlaceholderTag} with the specified x
	 * value and code contents.
	 * @param codeContent
	 * @return this TUVBuilder
	 */
	public TUVBuilder ph(int x, String codeContent) {
        PlaceholderTag ph = new PlaceholderTag();
        ph.setX(x);
        return addCodeContent(ph, codeContent);
    }

	/**
	 * Add a {@link PlaceholderTag} with the specified complex content.
	 * @param content
	 * @return this TUVBuilder
	 */
	public TUVBuilder ph(ComplexContent content) {
	    PlaceholderTag ph = new PlaceholderTag();
	    return addComplexContent(ph, content);
	}

   /**
     * Add a {@link PlaceholderTag} with the specified x
     * value and complex code contents.
     * @param content
     * @return this TUVBuilder
     */
    public TUVBuilder ph(int x, ComplexContent content) {
        PlaceholderTag ph = new PlaceholderTag();
        ph.setX(x);
        return addComplexContent(ph, content);
    }

    /**
     * Add a {@link IsolatedTag} with the specified pos
     * value and code contents.
     * @param pos
     * @param codeContent
     * @return this TUVBuilder
     */
    public TUVBuilder it(IsolatedTag.Pos pos, String codeContent) {
        IsolatedTag it = new IsolatedTag(pos);
        return addCodeContent(it, codeContent);
    }

    /**
     * Add a {@link IsolatedTag} with the specified pos
     * value and complex contents.
     * @param pos
     * @param content
     * @return this TUVBuilder
     */
    public TUVBuilder it(IsolatedTag.Pos pos, ComplexContent content) {
        IsolatedTag it = new IsolatedTag(pos);
        return addComplexContent(it, content);
    }

    /**
     * Add a {@link HighlightTag} with the specified text content.
     * @param textContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(String textContent) {
        HighlightTag hi = new HighlightTag();
        hi.addContent(new TextContent(textContent));
        tuv.addContent(hi);
        return this;
    }

    /**
     * Add a {@link HighlightTag} with the specified x value
     * and text content.
     * @param x
     * @param textContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(int x, String textContent) {
        HighlightTag hi = new HighlightTag().setX(x);
        hi.addContent(new TextContent(textContent));
        tuv.addContent(hi);
        return this;
    }

    /**
     * Add a {@link HighlightTag} with the content collected in the specified
     * {@link TUVBuilder}.
     * and text content.
     * @param highlightedContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(TUVBuilder highlightedContent) {
        return hi(highlightedContent.build());
    }

    /**
     * Add a {@link HighlightTag} with the specified x value and
     * the content collected in the specified {@link TUVBuilder}.
     * @param x
     * @param highlightedContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(int x, TUVBuilder highlightedContent) {
        return hi(x, highlightedContent.build());
    }

    /**
     * Add a {@link HighlightTag} with the content collected in the specified
     * {@link TUV}.
     * and text content.
     * @param highlightedContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(TUV highlightedContent) {
        HighlightTag hi = new HighlightTag();
        hi.addContents(highlightedContent.getContents());
        tuv.addContent(hi);
        return this;
    }

    /**
     * Add a {@link HighlightTag} with the specified x value and
     * the content collected in the specified {@link TUV}.
     * @param x
     * @param highlightedContent
     * @return this TUVBuilder
     */
    public TUVBuilder hi(int x, TUV highlightedContent) {
        HighlightTag hi = new HighlightTag().setX(x);
        hi.addContents(highlightedContent.getContents());
        tuv.addContent(hi);
        return this;
    }

	protected TUVBuilder addCodeContent(TagContent sink, String codes) {
	    sink.addContent(new CodeContent(codes));
	    tuv.addContent(sink);
	    return this;
	}

	protected TUVBuilder addComplexContent(TagContent sink, ComplexContent content) {
	    sink.addContents(content.getContent());
	    tuv.addContent(sink);
	    return this;
	}
}


text:
(function($, undefined) {
$(function() {

// Settings
var mobileScreenWidth = {
	min: 320,
	max: 480
};
var sizes = {
	standard: {
		width: 600,
		height: 600
	},
	mobile: {
		width: 260,
		height: 400
	}
};
var atStandardSize = true;

// Cached elements
var $window = $(window);
var $calendar = $('#google-calendar');

// Resizes the calendar based on the current window width.
function resizeCalendar(calendar, windowWidth) {
	if (windowWidth <= mobileScreenWidth.max) {
		// Fit to a mobile screen width
		var width = sizes.mobile.width + (windowWidth - mobileScreenWidth.min);
		calendar.attr({
			width: width,
			height: sizes.mobile.height
		});
		atStandardSize = false;
	} else if (!atStandardSize) {
		// Return to the standard size
		calendar.attr(sizes.standard);
		atStandardSize = true;
	}
}

// Resize the calendar whenever the window's size changes.
$window.on('resize', function() {
	resizeCalendar($calendar, $window.width());
});

// Resize once on page load, in case the window is never again resized.
resizeCalendar($calendar, $window.width());

});
}(jQuery));


text:
<?php
namespace tests\Form;

use Tuum\Form\Tags\Input;

require_once(__DIR__ . '/../autoloader.php');

class InputTest extends \PHPUnit_Framework_TestCase
{
    function test0()
    {
        $input = (new Input('text', 'testing'));
        $this->assertEquals('Tuum\Form\Tags\Input', get_class($input));
        $this->assertEquals('<input type="text" name="testing" >', (string)$input);
    }

    /**
     * @test
     */
    function values_are_not_escaped()
    {
        $input = (new Input('text', '<bold\'"'));
        $this->assertEquals('Tuum\Form\Tags\Input', get_class($input));
        $this->assertEquals('<input type="text" name="<bold\'"" >', (string)$input);
    }

    /**
     * @test
     */
    function label_surrounds_input()
    {
        $input = (new Input('text', 'testing'))
            ->value('more')
            ->maxlength(5)
            ->label('done')
            ->imeOn();
        $this->assertEquals(
            '<label><input type="text" name="testing" value="more" maxlength="5" style="ime-mode:active" > done</label>',
            (string)$input);
    }

    /**
     * @test
     */
    function input_has_more_methods()
    {
        $input = (new Input('text', 'testing'))
            ->imeOff()
            ->width('5em')
            ->height('10em');
        $this->assertEquals(
            '<input type="text" name="testing" style="ime-mode:inactive; width:5em; height:10em" >',
            (string)$input);
    }

    /**
     * @test
     */
    function set_multiple_adds_double_bracket_to_name()
    {
        $input = (new Input('text', 'testing'));
        $this->assertEquals('testing', $input->getName());
        $input->setMultiple();
        $this->assertEquals('testing[]', $input->getName());
    }

    /**
     * @test
     */
    function name_is_used_if_id_is_not_set()
    {
        $input = (new Input('text', 'testing'));
        $this->assertEquals('testing', $input->getId());
    }

    /**
     * @test
     */
    function id_is_used_if_id_is_set()
    {
        $input = (new Input('text', 'testing'))->id('real-id');
        $this->assertEquals('real-id', $input->getId());
    }

    /**
     * @test
     */
    function id_adds_value_to_id_for_radio_and_checks_if_id_is_not_set()
    {
        $input = (new Input('radio', 'testing'))->value('more');
        $this->assertEquals('testing-more', $input->getId());
        $input->setMultiple();
        $this->assertEquals('testing---more', $input->id()->getId());
    }

    /**
     * @test
     */
    function value_zero_sets_0()
    {
        $input = (new Input('text', 'testing'))->value(0);
        $this->assertEquals('Tuum\Form\Tags\Input', get_class($input));
        $this->assertEquals('<input type="text" name="testing" value="0" >', (string)$input);
    }

    /**
     * @test
     */
    function value_empty_string_sets_value_attribute()
    {
        $input = (new Input('text', 'testing'))->value('');
        $this->assertEquals('Tuum\Form\Tags\Input', get_class($input));
        $this->assertEquals('<input type="text" name="testing" >', (string)$input);
    }

    /**
     * @test
     */
    function value_false_removes_value_attribute()
    {
        $input = (new Input('text', 'testing'))->value(false);
        $this->assertEquals('Tuum\Form\Tags\Input', get_class($input));
        $this->assertEquals('<input type="text" name="testing" >', (string)$input);
    }

}


text:
extern "C" {
#include <GL/glew.h>
}

#include "shader.h"

struct Vertex {
  glm::vec3 position;
  glm::vec3 normal;
  glm::vec2 uv;
};

struct Texture {
  GLuint id;
  std::string type;
  aiString path;
};

class Mesh {
  public:
    // Generic raw mesh data.
    std::vector<Vertex> vertices;
    std::vector<GLuint> indices;
    std::vector<Texture> textures;

    Mesh(std::vector<Vertex> vertices, std::vector<GLuint> indices,
      std::vector<Texture> textures);

    // Draw the mesh with the given shader program.
    void draw(Shader shader);
  private:
    // OpenGL state data.
    GLuint VAO, VBO, EBO;

    // Works with OpenGL to create buffers to store the mesh data on the GPU.
    void setup();
};

#endif


text:
print "Enter a name"
name = raw_input()

#Defining all vowels in a list
vowels = ['a', 'e', 'i', 'o', 'u']
name_without_vowels = ''

#Removing the vowels or rather forming a name with only consonants
for i in name:
    if i in vowels:
        continue
    name_without_vowels += i

print "The name without vowels is:"
print name_without_vowels


text:
<!DOCTYPE html>

    <title>Arithmagic</title>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="addition.css">
    <link rel="stylesheet" href="standard-subtraction.css">
    <link rel="stylesheet" href="austrian-subtraction.css">


text:
package com.cardpay.pccredit.report.model;

import com.wicresoft.jrad.base.database.dao.business.BusinessFilter;

public class CustomerHmd extends BusinessFilter{

	/**
	 *
	 */
	private String name;
	private String cardId;
	private String comefrom;

	public CustomerHmd(String name, String cardId, String comefrom) {
		super();
		this.name = name;
		this.cardId = cardId;
		this.comefrom = comefrom;
	}

	public CustomerHmd() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public String getComefrom() {
		return comefrom;
	}

	public void setComefrom(String comefrom) {
		this.comefrom = comefrom;
	}

}


text:
namespace JetBrains.ReSharper.Koans.Editing
{
    // Smart Completion
    //
    // Narrows candidates to those that best suit the current context
    //
    // <shortcut id="Smart Completion">Ctrl+Alt+Space (VS)</shortcut>
    //

    public class SmartCompletion
    {
        // 1. Start typing: string s =
        //    Automatic Completion offers Smart Completion items first (string items)
        //      (followed by local Basic items, wider Basic and then Import items)
        // 2. Uncomment: string s2 =
        //    Invoke Smart Completion at the end of the line
        //    Smart Completion only shows string based candidates
        //    (Including methods that return string, such as String.Concat)
        // 3. Uncomment: string s3 = this.
        //    Invoke Smart Completion at the end of the line
        //    Smart Completion only shows string based candidates for the this parameter
        // Note that the Age property isn't used
        public void SmartUseString(string stringParameter)
        {
            //string s2 =
            //string s3 = this.
        }

        public int Age { get; set; }

        #region Implementation details

        public string Name { get; set; }
        public string GetGreeting()
        {
            return "hello";
        }

        #endregion
    }
}


text:
<?php namespace LaravelAuthLdap;

use adLDAP\adLDAP;
use Illuminate\Support\ServiceProvider;

class AuthLdapServiceProvider extends ServiceProvider {

    public function boot()
    {
        $this->app['auth']->extend('ldap', function($app)
        {
            return $app->make('LaravelAuthLdap\Contracts\LdapUserProvider');
        });
    }

    public function register()
    {
        $this->publishConfigs();
        $this->registerLdapInterfaces();
    }

    /**
     * Publish the config files used in the library.
     */
    public function publishConfigs()
    {
        $configFiles = [];

        foreach (['auth-ldap.php', 'adldap.php'] as $configFile)
        {
            $configFiles[__DIR__ . '/../config/' . $configFile] = config_path($configFile);
        }

        $this->publishes($configFiles, 'config');
    }

    /**
     * Bind the interfaces to their implementations in the service container.
     */
    public function registerLdapInterfaces()
    {
        $this->app->bind('LaravelAuthLdap\Contracts\LdapServer', function($app)
        {
            $server = new AdLDAPLdapServer;
            $server->setAdServer(new adLDAP($app->config['adldap']));

            return $server;
        });

        $this->app->bind('LaravelAuthLdap\Contracts\LdapUser', function($app)
        {
            $user = new BaseLdapUser;
            $user->setConvertFields($app->config['auth-ldap.convert_fields']);
            $user->setUsernameField($app->config['auth-ldap.username_field']);

            return $user;
        });

        $this->app->bind('LaravelAuthLdap\Contracts\LdapUserProvider', function($app)
        {
            $provider = new BaseLdapUserProvider;

            $driverName = array_get($app->config['auth-ldap'], 'provider.driver');

            if ($driverName !== null)
            {
                $driver = $this->app['auth']->driver($driverName);

                $provider->setProvider($driver->getProvider());
            }

            $provider->setLdapServer($app->make('LaravelAuthLdap\Contracts\LdapServer'));

            $mustExist = array_get($app->config['auth-ldap'], 'provider.must_exist');
            $provider->setUserMustExistInProvider($mustExist === null ? false : $mustExist);

            $provider->setCredentialsFields($app->config['auth-ldap.credentials_fields']);

            return $provider;
        });
    }

}


text:
package com.thepsionic.undercraft.proxy;

public class CommonProxy {
    public void registerRenders() {}
    public void registerColors() {}
}


text:
#ifndef ALIOBJECTLOADER_H
#define ALIOBJECTLOADER_H

/* $Id$ */

////////////////////////////////////////////
//                                        //
//  class AliObjectLoader                 //
//                                        //
//                                        //
////////////////////////////////////////////

class TObject;
class TFolder;
class TString;
class AliDataLoader;

#include "AliBaseLoader.h"

class AliObjectLoader: public AliBaseLoader
{
 public:
     AliObjectLoader(){};
     AliObjectLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
     virtual          ~AliObjectLoader(){};
     TObject*          Get() const;

 protected:
     TFolder*          GetFolder() const;
     Int_t             AddToBoard(TObject* obj);
     void              RemoveFromBoard(TObject* obj);

 private:
     AliObjectLoader(const AliObjectLoader&);            //Not implemented
     AliObjectLoader& operator=(const AliObjectLoader&); //Not implemented

 ClassDef(AliObjectLoader,1)

};
#endif


text:
namespace blink {

static const struct {
    const char* name;
    uint32_t property;
} allowedProperties[] = {
    { "opacity", CompositorMutableProperty::kOpacity },
    { "scrollleft", CompositorMutableProperty::kScrollLeft },
    { "scrolltop", CompositorMutableProperty::kScrollTop },
    { "transform", CompositorMutableProperty::kTransform },
};

static uint32_t compositorMutablePropertyForName(const String& attributeName)
{
    for (const auto& mapping : allowedProperties) {
        if (equalIgnoringCase(mapping.name, attributeName))
            return mapping.property;
    }
    return CompositorMutableProperty::kNone;
}

static bool isControlThread()
{
    return !isMainThread();
}

static bool isCallingCompositorFrameCallback()
{
    // TODO(sad): Check that the requestCompositorFrame callbacks are currently being called.
    return true;
}

static void decrementCompositorProxiedPropertiesForElement(uint64_t elementId, uint32_t compositorMutableProperties)
{
    DCHECK(isMainThread());
    Node* node = DOMNodeIds::nodeForId(elementId);
    if (!node)
        return;
    Element* element = toElement(node);
    element->decrementCompositorProxiedProperties(compositorMutableProperties);
}

static void incrementCompositorProxiedPropertiesForElement(uint64_t elementId, uint32_t compositorMutableProperties)
{
    DCHECK(isMainThread());
    Node* node = DOMNodeIds::nodeForId(elementId);
    if (!node)
        return;
    Element* element = toElement(node);
    element->incrementCompositorProxiedProperties(compositorMutableProperties);
}

static bool raiseExceptionIfMutationNotAllowed(ExceptionState& exceptionState)
{
    if (!isControlThread()) {
        exceptionState.throwDOMException(NoModificationAllowedError, "Cannot mutate a proxy attribute from the main page.");
        return true;
    }
    if (!isCallingCompositorFrameCallback()) {
        exceptionState.throwDOMException(NoModificationAllowedError, "Cannot mutate a proxy attribute outside of a requestCompositorFrame callback.");
        return true;
    }
    return false;
}

static uint32_t compositorMutablePropertiesFromNames(const Vector<String>& attributeArray)
{
    uint32_t properties = 0;
    for (const auto& attribute : attributeArray) {
        properties |= compositorMutablePropertyForName(attribute);
    }
    return properties;
}

#if DCHECK_IS_ON()
static bool sanityCheckMutableProperties(uint32_t properties)
{
    // Ensures that we only have bits set for valid mutable properties.
    uint32_t sanityCheckProperties = properties;
    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(allowedProperties); ++i) {
        sanityCheckProperties &= ~static_cast<uint32_t>(allowedProperties[i].property);
    }
    return !sanityCheckProperties;
}
#endif

CompositorProxy* CompositorProxy::create(ExecutionContext* context, Element* element, const Vector<String>& attributeArray, ExceptionState& exceptionState)
{
    if (!context->isDocument()) {
        exceptionState.throwTypeError(ExceptionMessages::failedToConstruct("CompositorProxy", "Can only be created from the main context."));
        exceptionState.throwIfNeeded();
        return nullptr;
    }

    return new CompositorProxy(*element, attributeArray);
}

CompositorProxy* CompositorProxy::create(uint64_t elementId, uint32_t compositorMutableProperties)
{
    return new CompositorProxy(elementId, compositorMutableProperties);
}

CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attributeArray)
    : m_elementId(DOMNodeIds::idForNode(&element))
    , m_compositorMutableProperties(compositorMutablePropertiesFromNames(attributeArray))
{
    DCHECK(isMainThread());
    DCHECK(m_compositorMutableProperties);
#if DCHECK_IS_ON()
    DCHECK(sanityCheckMutableProperties(m_compositorMutableProperties));
#endif

    incrementCompositorProxiedPropertiesForElement(m_elementId, m_compositorMutableProperties);
}

CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t compositorMutableProperties)
    : m_elementId(elementId)
    , m_compositorMutableProperties(compositorMutableProperties)
{
    DCHECK(isControlThread());
#if DCHECK_IS_ON()
    DCHECK(sanityCheckMutableProperties(m_compositorMutableProperties));
#endif
    Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&incrementCompositorProxiedPropertiesForElement, m_elementId, m_compositorMutableProperties));
}

CompositorProxy::~CompositorProxy()
{
    if (m_connected)
        disconnect();
}

bool CompositorProxy::supports(const String& attributeName) const
{
    return m_compositorMutableProperties & compositorMutablePropertyForName(attributeName);
}

double CompositorProxy::opacity(ExceptionState& exceptionState) const
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return 0.0;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kOpacity, exceptionState))
        return 0.0;
    return m_opacity;
}

double CompositorProxy::scrollLeft(ExceptionState& exceptionState) const
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return 0.0;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kScrollLeft, exceptionState))
        return 0.0;
    return m_scrollLeft;
}

double CompositorProxy::scrollTop(ExceptionState& exceptionState) const
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return 0.0;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kScrollTop, exceptionState))
        return 0.0;
    return m_scrollTop;
}

DOMMatrix* CompositorProxy::transform(ExceptionState& exceptionState) const
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return nullptr;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kTransform, exceptionState))
        return nullptr;
    return m_transform;
}

void CompositorProxy::setOpacity(double opacity, ExceptionState& exceptionState)
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kOpacity, exceptionState))
        return;
    m_opacity = std::min(1., std::max(0., opacity));
    m_mutatedProperties |= CompositorMutableProperty::kTransform;
}

void CompositorProxy::setScrollLeft(double scrollLeft, ExceptionState& exceptionState)
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kScrollLeft, exceptionState))
        return;
    m_scrollLeft = scrollLeft;
    m_mutatedProperties |= CompositorMutableProperty::kScrollLeft;
}

void CompositorProxy::setScrollTop(double scrollTop, ExceptionState& exceptionState)
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kScrollTop, exceptionState))
        return;
    m_scrollTop = scrollTop;
    m_mutatedProperties |= CompositorMutableProperty::kScrollTop;
}

void CompositorProxy::setTransform(DOMMatrix* transform, ExceptionState& exceptionState)
{
    if (raiseExceptionIfMutationNotAllowed(exceptionState))
        return;
    if (raiseExceptionIfNotMutable(CompositorMutableProperty::kTransform, exceptionState))
        return;
    m_transform = transform;
    m_mutatedProperties |= CompositorMutableProperty::kTransform;
}

bool CompositorProxy::raiseExceptionIfNotMutable(uint32_t property, ExceptionState& exceptionState) const
{
    if (m_connected && (m_compositorMutableProperties & property))
        return false;
    exceptionState.throwDOMException(NoModificationAllowedError,
        m_connected ? "Attempted to mutate non-mutable attribute." : "Attempted to mutate attribute on a disconnected proxy.");
    return true;
}

void CompositorProxy::disconnect()
{
    m_connected = false;
    if (isMainThread())
        decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositorMutableProperties);
    else
        Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_elementId, m_compositorMutableProperties));
}

} // namespace blink