text:
from mock import MagicMock, patch
import numpy as np
from numpy.testing import assert_almost_equal

from ..mouse_mode import (MouseMode, RectangleMode, CircleMode, PolyMode,
                          ContrastMode, ContourMode, contour_to_roi, LassoMode,
                          ClickRoiMode)

class Event(object):
    def __init__(self, x, y, button=3, key='a'):
        self.x = x
        self.y = y
        self.xdata = x
        self.ydata = y
        self.button = button
        self.key = key
        self.inaxes = True

def axes():
    result = MagicMock()
    result.figure.canvas.get_width_height.return_value = (640, 480)
    return result

class TestMouseMode(object):

    def setup_method(self, method):
        self.mode = self.mode_factory()(axes())
        self.axes = self.mode._axes
        self.attach_callbacks()

    def attach_callbacks(self):
        self.press = self.mode._press_callback = MagicMock()
        self.move = self.mode._move_callback = MagicMock()
        self.release = self.mode._release_callback = MagicMock()

    def mode_factory(self):
        return MouseMode

    def test_press_callback(self):
        e = Event(1, 2)
        self.mode.press(e)
        self.press.assert_called_once_with(self.mode)
        assert self.move.call_count == 0
        assert self.release.call_count == 0

    #def test_log_null_event(self):
    #    """ Should exit quietly if event is None """
    #    self.mode._log_position(None)

    def test_move_callback(self):
        e = Event(1, 2)
        self.mode.move(e)
        self.move.assert_called_once_with(self.mode)
        assert self.press.call_count == 0
        assert self.release.call_count == 0

    def test_release_callback(self):
        e = Event(1, 2)
        self.mode.release(e)
        self.release.assert_called_once_with(self.mode)
        assert self.press.call_count == 0
        assert self.move.call_count == 0

    def test_press_log(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

    def test_move_log(self):
        e = Event(1, 2)
        self.mode.move(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

    def test_release_log(self):
        e = Event(1, 2)
        self.mode.release(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

class TestRoiMode(TestMouseMode):

    def setup_method(self, method):
        TestMouseMode.setup_method(self, method)
        self.mode._roi_tool = MagicMock()

    def mode_factory(self):
        raise NotImplementedError()

    def test_roi_not_called_on_press(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._roi_tool.start_selection.call_count == 0

    def test_roi_called_on_drag(self):
        e = Event(1, 2)
        e2 = Event(10, 200)
        self.mode.press(e)
        self.mode.move(e2)
        self.mode._roi_tool.start_selection.assert_called_once_with(e)
        self.mode._roi_tool.update_selection.assert_called_once_with(e2)

    def test_roi_ignores_small_drags(self):
        e = Event(1, 2)
        e2 = Event(1, 3)
        self.mode.press(e)
        self.mode.move(e2)
        assert self.mode._roi_tool.start_selection.call_count == 0
        assert self.mode._roi_tool.update_selection.call_count == 0

    def test_roi_called_on_release(self):
        e = Event(1, 2)
        e2 = Event(10, 20)
        self.mode.press(e)
        self.mode.move(e2)
        self.mode.release(e2)
        self.mode._roi_tool.finalize_selection.assert_called_once_with(e2)

    def test_roi(self):
        r = self.mode.roi()
        self.mode._roi_tool.roi.assert_called_once_with()

class TestClickRoiMode(TestMouseMode):

    def setup_method(self, method):
        TestMouseMode.setup_method(self, method)
        self.mode._roi_tool = MagicMock()
        self.mode._roi_tool.active.return_value = False

    def mode_factory(self):
        raise NotImplementedError()

    def test_roi_started_on_press(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._roi_tool.start_selection.call_count == 1

    def test_roi_updates_on_subsequent_presses(self):
        e = Event(1, 2)
        e2 = Event(1, 30)
        self.mode.press(e)
        self.mode._roi_tool.active.return_value = True
        self.mode.press(e2)
        assert self.mode._roi_tool.start_selection.call_count == 1
        assert self.mode._roi_tool.update_selection.call_count == 1

    def test_roi_finalizes_on_enter(self):
        e = Event(1, 2)
        e2 = Event(1, 20)
        e3 = Event(1, 30, key='enter')
        self.mode.press(e)
        self.mode._roi_tool.active.return_value = True
        self.mode.press(e2)
        self.mode.key(e3)
        self.mode._roi_tool.start_selection.assert_called_once_with(e)
        self.mode._roi_tool.update_selection.assert_called_once_with(e2)
        self.mode._roi_tool.finalize_selection.assert_called_once_with(e2)

    def test_roi_resets_on_escape(self):
        e = Event(1, 2)
        e2 = Event(1, 30, key='escape')
        self.mode.press(e)
        self.mode.key(e2)
        self.mode.press(e)
        assert self.mode._roi_tool.reset.call_count == 1
        assert self.mode._roi_tool.start_selection.call_count == 2

class TestRectangleMode(TestRoiMode):
    def mode_factory(self):
        return RectangleMode

class TestCircleMode(TestRoiMode):
    def mode_factory(self):
        return CircleMode

class TestLassoMode(TestRoiMode):
    def mode_factory(self):
        return LassoMode

class TestPolyMode(TestClickRoiMode):
    def mode_factory(self):
        return PolyMode

class TestContrastMode(TestMouseMode):
    def mode_factory(self):
        return ContrastMode

    def test_move_ignored_if_not_right_drag(self):
        e = Event(1, 2, button=1)
        self.mode.move(e)
        count = self.mode._axes.figure.canvas.get_width_height.call_count
        assert count == 0

class TestContourMode(TestMouseMode):

    def mode_factory(self):
        return ContourMode

    def test_roi_before_event(self):
        data = MagicMock()
        roi = self.mode.roi(data)
        assert roi is None

    def test_roi(self):
        with patch('glue.qt.mouse_mode.contour_to_roi') as cntr:
            data = MagicMock()
            e = Event(1, 2)
            self.mode.press(e)
            self.mode.roi(data)
            cntr.assert_called_once_with(1, 2, data)

class TestContourToRoi(object):

    def test_roi(self):
        with patch('glue.core.util.point_contour') as point_contour:
            point_contour.return_value = np.array([[1, 2], [2, 3]])
            p = contour_to_roi(1, 2, None)
            np.testing.assert_array_almost_equal(p.vx, [1, 2])
            np.testing.assert_array_almost_equal(p.vy, [2, 3])

    def test_roi_null_result(self):
        with patch('glue.core.util.point_contour') as point_contour:
            point_contour.return_value = None
            p = contour_to_roi(1, 2, None)
            assert p is None

del TestRoiMode  # prevents test discovery from running abstract test
del TestClickRoiMode


text: export { default as scores } from './scores';

redpajama_set_name: RedPajamaGithub


text:
[![godoc](https://godoc.org/github.com/serulian/compiler?status.svg)](http://godoc.org/github.com/serulian/playground)
[![Build Status (Travis)](https://travis-ci.org/serulian/playground.svg?branch=master)](https://travis-ci.org/serulian/playground)
[![Container Image on Quay](https://quay.io/repository/serulian/playground/status "Container Image on Quay")](https://quay.io/repository/serulian/playground)

The Serulian Playground provides a browser-based playground for building and running small Serulian applications without installation of the [Serulian Toolkit](https://github.com/serulian/compiler).

## Running the playground

The playground can be run via a single Docker command. The `SHARED_ROOT_PATH` environment variable must be defined to point to a temporary directory accessible to Docker on the host. If `/tmp` is not used, mount a different directory.

```sh
docker run -v /var/run/docker.sock:/var/run/docker.sock  -p 80:80 -v /tmp:/tmp -e SHARED_ROOT_PATH=/tmp  -ti quay.io/serulian/playground
```

## Building the playground image

```sh
docker build -t quay.io/serulian/playground .
```

## Modfiying the playground's Serulian code

### Making changes

The Playground's Seruian frontend code can be found in the [frontend](frontend) directory. To test modifications, run the Serulian Toolkit in development mode and add `?develop=true` to the Playground URL.

Run development mode:

```sh
cd frontend
serulian develop playground.seru
```

The code will automatically recompile on every refresh of the Playground.

### Comitting changes

Once changes are verified, run the `build` command to update the compiled code:

```sh
cd frontend
serulian build playground.seru
cd ..
docker build -t quay.io/serulian/playground .
```


text:
var preguntaNew = function () {
};
preguntaNew.prototype = new newModule();
preguntaNew.prototype.doEventsLoading = function () {
    this.form_getForeign('pregunta','documento');
};


text:
package com.thoughtworks.xstream.io.xml;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.net.URL;

import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.StreamException;
import com.thoughtworks.xstream.io.naming.NameCoder;

import nu.xom.Builder;
import nu.xom.Document;
import nu.xom.ParsingException;
import nu.xom.ValidityException;

public class XomDriver extends AbstractXmlDriver {

    private final Builder builder;

    public XomDriver() {
        this(new Builder());
    }

    public XomDriver(final Builder builder) {
        this(builder, new XmlFriendlyNameCoder());
    }

    /**
     * @since 1.4
     */
    public XomDriver(final NameCoder nameCoder) {
        this(new Builder(), nameCoder);
    }

    /**
     * @since 1.4
     */
    public XomDriver(final Builder builder, final NameCoder nameCoder) {
        super(nameCoder);
        this.builder = builder;
    }

    /**
     * @since 1.2
     * @deprecated As of 1.4, use {@link #XomDriver(Builder, NameCoder)} instead
     */
    @Deprecated
    public XomDriver(final XmlFriendlyReplacer replacer) {
        this(new Builder(), replacer);
    }

    /**
     * @since 1.2
     * @deprecated As of 1.4, use {@link #XomDriver(Builder, NameCoder)} instead
     */
    @Deprecated
    public XomDriver(final Builder builder, final XmlFriendlyReplacer replacer) {
        this((NameCoder)replacer);
    }

    protected Builder getBuilder() {
        return builder;
    }

    @Override
    public HierarchicalStreamReader createReader(final Reader text) {
        try {
            final Document document = getBuilder().build(text);
            return new XomReader(document, getNameCoder());
        } catch (final ValidityException e) {
            throw new StreamException(e);
        } catch (final ParsingException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }

    @Override
    public HierarchicalStreamReader createReader(final InputStream in) {
        try {
            final Document document = getBuilder().build(in);
            return new XomReader(document, getNameCoder());
        } catch (final ValidityException e) {
            throw new StreamException(e);
        } catch (final ParsingException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }

    @Override
    public HierarchicalStreamReader createReader(final URL in) {
        try {
            final Document document = getBuilder().build(in.toExternalForm());
            return new XomReader(document, getNameCoder());
        } catch (final ValidityException e) {
            throw new StreamException(e);
        } catch (final ParsingException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }

    @Override
    public HierarchicalStreamReader createReader(final File in) {
        try {
            final Document document = getBuilder().build(in);
            return new XomReader(document, getNameCoder());
        } catch (final ValidityException e) {
            throw new StreamException(e);
        } catch (final ParsingException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }

    @Override
    public HierarchicalStreamWriter createWriter(final Writer out) {
        return new PrettyPrintWriter(out, getNameCoder());
    }

    @Override
    public HierarchicalStreamWriter createWriter(final OutputStream out) {
        return new PrettyPrintWriter(new OutputStreamWriter(out), getNameCoder());
    }
}


text:
require 'machinist/active_record'
require 'sham'
require 'faker'
require 'polyamorous'

Time.zone = 'Eastern Time (US & Canada)'

Dir[File.expand_path('../{helpers,support,blueprints}/**/*.rb', __FILE__)]
.each do |f|
  require f
end

Sham.define do
  name     { Faker::Name.name }
  title    { Faker::Lorem.sentence }
  body     { Faker::Lorem.paragraph }
  salary   { |index| 30000 + (index * 1000) }
  tag_name { Faker::Lorem.words(3).join(' ') }
  note     { Faker::Lorem.words(7).join(' ') }
end

RSpec.configure do |config|
  config.before(:suite) do
    message = "Running Polyamorous specs with #{
      ActiveRecord::Base.connection.adapter_name
      }, Active Record #{::ActiveRecord::VERSION::STRING}, Arel #{Arel::VERSION
      } and Ruby #{RUBY_VERSION}"
    line = '=' * message.length
    puts line, message, line
    Schema.create
  end
  config.before(:all)   { Sham.reset(:before_all) }
  config.before(:each)  { Sham.reset(:before_each) }

  config.include PolyamorousHelper
end

RSpec::Matchers.define :be_like do |expected|
  match do |actual|
    actual.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip ==
      expected.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip
  end
end


text:
<?php

namespace TP\SolariumExtensionsBundle\Tests\Converter;

use TP\SolariumExtensionsBundle\Converter\ConverterCollection;
use TP\SolariumExtensionsBundle\Doctrine\Annotations\Operation;
use TP\SolariumExtensionsBundle\EventListener\DoctrineListener;
use TP\SolariumExtensionsBundle\Doctrine\Annotations\Field;
use TP\SolariumExtensionsBundle\Converter\ValueConverter;

/**
 * Class ConverterCollectionTest
 *
 * @package TP\SolariumExtensionsBundle\Tests\Converter
 */
class ConverterCollectionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ConverterCollection
     */
    public $converter;

    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        $this->converter = new ConverterCollection();
    }

    public function testConverterRegistration()
    {
        $converter = $this->converter->registerConverter(
            Field::TYPE_DATE,
            'TP\SolariumExtensionsBundle\Converter\ValueConverter'
        );

        $this->assertSame($this->converter, $converter);

        $this->converter->registerConverter(
            Field::TYPE_DATE_MULTI,
            'TP\SolariumExtensionsBundle\Converter\ValueConverter'
        );

        $this->assertInstanceOf(
            'TP\SolariumExtensionsBundle\Converter\ValueConverter',
            $this->converter->getConverter(Field::TYPE_DATE)
        );

        $this->assertInstanceOf(
            'TP\SolariumExtensionsBundle\Converter\ValueConverter',
            $this->converter->getConverter(Field::TYPE_DATE_MULTI)
        );

        $this->assertSame(
            $this->converter->getConverter(Field::TYPE_DATE),
            $this->converter->getConverter(Field::TYPE_DATE_MULTI)
        );

        $this->assertNull($this->converter->getConverter(Field::TYPE_STRING));
    }

    public function testHasConverter()
    {
        $this->converter->registerConverter(
            Field::TYPE_DATE,
            'TP\SolariumExtensionsBundle\Converter\ValueConverter'
        );

        $this->assertTrue($this->converter->hasConverter(Field::TYPE_DATE));
        $this->assertFalse($this->converter->hasConverter(Field::TYPE_DATE_MULTI));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage Class '\stdClass' must implement 'TP\SolariumExtensionsBundle\Converter\ValueConverterInterface'
     */
    public function testExceptionOnInvalidConverterClass()
    {
        $this->converter->registerConverter(Field::TYPE_DATE, '\stdClass');
    }
}


text:
package com.planet_ink.coffee_mud.Races;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

@SuppressWarnings("unchecked")
public class ElectricityElemental extends StdRace
{
	public String ID(){	return "ElectricityElemental"; }
	public String name(){ return "Electricity Elemental"; }
	public int shortestMale(){return 64;}
	public int shortestFemale(){return 60;}
	public int heightVariance(){return 12;}
	public int lightestWeight(){return 400;}
	public int weightVariance(){return 100;}
	public long forbiddenWornBits(){return 0;}
	public String racialCategory(){return "Electricity Elemental";}
	public boolean fertile(){return false;}
	public boolean uncharmable(){return true;}
	protected boolean destroyBodyAfterUse(){return true;}

	protected static Vector resources=new Vector();
	public int availabilityCode(){return Area.THEME_FANTASY|Area.THEME_SKILLONLYMASK;}

	//                                an ey ea he ne ar ha to le fo no gi mo wa ta wi
	private static final int[] parts={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
	public int[] bodyMask(){return parts;}

	private int[] agingChart={0,0,0,0,0,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE};
	public int[] getAgingChart(){return agingChart;}

	public void affectCharStats(MOB affectedMOB, CharStats affectableStats)
	{
		super.affectCharStats(affectedMOB, affectableStats);
		affectableStats.setStat(CharStats.STAT_SAVE_POISON,affectableStats.getStat(CharStats.STAT_SAVE_POISON)+100);
		affectableStats.setStat(CharStats.STAT_SAVE_DISEASE,affectableStats.getStat(CharStats.STAT_SAVE_DISEASE)+100);
		affectableStats.setStat(CharStats.STAT_SAVE_ELECTRIC,affectableStats.getStat(CharStats.STAT_SAVE_ELECTRIC)+100);
	}
	public Weapon myNaturalWeapon()
	{
		if(naturalWeapon==null)
		{
			naturalWeapon=CMClass.getWeapon("StdWeapon");
			naturalWeapon.setName("a deadly spark");
			naturalWeapon.setWeaponType(Weapon.TYPE_STRIKING);
		}
		return naturalWeapon;
	}

	public String healthText(MOB viewer, MOB mob)
	{
		double pct=(CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints()));

		if(pct<.10)
			return "^r" + mob.displayName(viewer) + "^r is near destruction!^N";
		else
		if(pct<.20)
			return "^r" + mob.displayName(viewer) + "^r is flickering alot and massively damaged.^N";
		else
		if(pct<.30)
			return "^r" + mob.displayName(viewer) + "^r is flickering alot and extremely damaged.^N";
		else
		if(pct<.40)
			return "^y" + mob.displayName(viewer) + "^y is flickering alot and very damaged.^N";
		else
		if(pct<.50)
			return "^y" + mob.displayName(viewer) + "^y is flickering and damaged.^N";
		else
		if(pct<.60)
			return "^p" + mob.displayName(viewer) + "^p is flickering and slightly damaged.^N";
		else
		if(pct<.70)
			return "^p" + mob.displayName(viewer) + "^p is showing large flickers.^N";
		else
		if(pct<.80)
			return "^g" + mob.displayName(viewer) + "^g is showing some flickers.^N";
		else
		if(pct<.90)
			return "^g" + mob.displayName(viewer) + "^g is showing small flickers.^N";
		else
		if(pct<.99)
			return "^g" + mob.displayName(viewer) + "^g is no longer in perfect condition.^N";
		else
			return "^c" + mob.displayName(viewer) + "^c is in perfect condition.^N";
	}
	public Vector myResources()
	{
		synchronized(resources)
		{
			if(resources.size()==0)
			{
				resources.addElement(makeResource
					("a small conductive filing",RawMaterial.RESOURCE_IRON));
			}
		}
		return resources;
	}
}


text:
. `dirname $0`/../lib_logging.sh
. `dirname $0`/../lib_apache.sh

info "Configuring Data Quality subsytem ... "

#======================================================================

[ -z "$ODAOS_DQ_HOME" ] && error "Missing the required ODAOS_DQ_HOME variable!"
[ -z "$ODAOSHOSTNAME" ] && error "Missing the required ODAOSHOSTNAME variable!"
[ -z "$ODAOSLOGDIR" ] && error "Missing the required ODAOSLOGDIR variable!"
[ -z "$ODAOSUSER" ] && error "Missing the required ODAOSUSER variable!"
[ -z "$ODAOSGROUP" ] && error "Missing the required ODAOSGROUP variable!"
[ -z "$ODAOSDATADIR" ] && error "Missing the required ODAOSDATADIR variable!"

DQ_USER="$ODAOSUSER"
DQ_GROUP="$ODAOSGROUP"
DQ_LOG_DIR="$ODAOSLOGDIR/data-quality"
DQ_DATA_DIR="$ODAOSDATADIR/data-quality"
DQ_WPS_CONTEXT="ool-wps-server"
DQ_SERVICE_HOST="services.spotimage.fr"
DQ_SERVICE_PORT=8443
DQ_PROXY_HOST="127.0.0.1"
DQ_PROXY_PORT=8280
ODAOS_PORT=80
DQ_SERVICE="tomcat-dq"

EOXS_ID2PATH_URL="http://127.0.0.1/eoxs/id2path?id="
IE_ADDPRODUCT_URL="http://127.0.0.1:8000/ingest/addProduct"
IE_UPDATEMD_URL="http://127.0.0.1:8000/ingest/uqmd"
IE_ADDPRODUCT_INTERVAL=30
IE_ADDPRODUCT_TIMEOUT=5400

if [ ! -d "$ODAOS_DQ_HOME" ]
then
    error "Data Quality subsytem does not seem to be installed in: $ODAOS_DQ_HOME"
    error "Data Quality subsytem configuration is terminated."
    exit 0
fi

# try to stop the service if it is running
[ -f "/etc/init.d/$DQ_SERVICE" ] && service "$DQ_SERVICE" stop || :

#======================================================================

info "Preparing the log directory: $DQ_LOG_DIR"

[ -d "$DQ_LOG_DIR" -o -f "$DQ_LOG_DIR" ] && rm -vfR "$DQ_LOG_DIR"

mkdir -vp "$DQ_LOG_DIR"
chown -v "$DQ_USER:$DQ_GROUP" "$DQ_LOG_DIR"
chmod -v 0755 "$DQ_LOG_DIR"

info "Preparing the data directory: $DQ_DATA_DIR"

[ -d "$DQ_DATA_DIR" -o -f "$DQ_DATA_DIR" ] && rm -vfR "$DQ_DATA_DIR"

mkdir -vp "$DQ_DATA_DIR"
chown -v "$DQ_USER:$DQ_GROUP" "$DQ_DATA_DIR"
chmod -v 0755 "$DQ_DATA_DIR"

#======================================================================

info "Data Quality subsytem configuration ..."

DQ_KEYSTORE="$ODAOS_DQ_HOME/q2/config/truststore.jks"
DQ_SERVER_CERT="$ODAOS_DQ_HOME/q2/services.spotimage.fr.pem"
DQ_INSTALLER="$ODAOS_DQ_HOME/q2/install.sh"

[ ! -f "$DQ_KEYSTORE" ] || rm -fv "$DQ_KEYSTORE"
[ -f "$DQ_INSTALLER" ] || error "Cannot find the '$DQ_INSTALLER' installer!"

# NOTE: The install script requires the working directory
#       to be the same as the location of the script.
(
    cd "`dirname "$DQ_INSTALLER" `"
    sudo -u "$DQ_USER" sh "./`basename "$DQ_INSTALLER" `" \
            -t "$DQ_PROXY_HOST" -u "$DQ_PROXY_PORT" \
            -j "http" -k "$ODAOSHOSTNAME" -l "$ODAOS_PORT" \
            -p "$DQ_SERVICE_HOST" -q "$DQ_SERVICE_PORT" -r "$DQ_WPS_CONTEXT" \
            -a "$DQ_LOG_DIR" -b "$DQ_DATA_DIR" \
            -z "$DQ_SERVER_CERT" -v "$DQ_USER"
)

# fix the configuration of the interfaces
sudo -u "$DQ_USER" ex -V "$ODAOS_DQ_HOME/q2/config/_.dream/dream.properties" <<END
1,\$s#^\([ 	]*ODA_ID2PATH_URL[ 	]*=\).*\$#\1$EOXS_ID2PATH_URL#
1,\$s#^\([ 	]*ODA_ADDPRODUCT_URL[ 	]*=\).*\$#\1$IE_ADDPRODUCT_URL#
1,\$s#^\([ 	]*ODA_UPDATEMD_URL[ 	]*=\).*\$#\1$IE_UPDATEMD_URL#
1,\$s#^\([ 	]*ODA_ADDPRODUCT_INTERVAL[ 	]*=\).*\$#\1$IE_ADDPRODUCT_INTERVAL#
1,\$s#^\([ 	]*ODA_ADDPRODUCT_TIMEOUT[ 	]*=\).*\$#\1$IE_ADDPRODUCT_TIMEOUT#
wq
END

#======================================================================
# start the service

info "Data Quality subsytem service initialization ..."

DQ_INIT_SRC="$ODAOS_DQ_HOME/q2/$DQ_SERVICE"
DQ_INIT="/etc/init.d/$DQ_SERVICE"

#sudo -u "$DQ_USER" ex "$DQ_INIT_SRC" <<END
#1,\$s/^\([ 	]*CATALINA_USER[ 	]*=\).*\$/\1"$DQ_USER"/
#wq
#END
#cp -fv "$DQ_INIT_SRC" "$DQ_INIT"

[ -f "$DQ_INIT" ] && mv -fv "$DQ_INIT" "$DQ_INIT.bak"
[ -f "$DQ_INIT" ] && rm -fv "$DQ_INIT"

cat >"$DQ_INIT" <<END
#!/bin/sh
#
# $DQ_SERVICE	Tomcat - Data Quality Proxy
#
# chkconfig: - 80 20
# description: starts, stops, and restarts the tomcat instance
#
# NOTE: This init script is created by the DREAM ODA-OS installation script.
# NOTE: The service must be explicitely enabled by 'chkconfig $DQ_SERVICE on' command.
#
### BEGIN INIT INFO
# Provides: $DQ_SERVICE
# Required-Start: \$local_fs \$remote_fs \$network \$named
# Required-Stop: \$local_fs \$remote_fs \$network
# Default-Stop: 0 1 2 3 4 5 6
# Default-Start:
# Short-Description: Starts, stops, and restarts the ngEO donwload manager
# Description: Starts, stops, and restarts the ngEO donwload manager
### END INIT INFO

. /etc/rc.d/init.d/functions

CATALINA_USER="$DQ_USER"
CATALINA_HOME="$ODAOS_DQ_HOME/q2/local/tomcat"
CATALINA_SH="\${CATALINA_HOME}/bin/catalina.sh"
CATALINA_PID="\${CATALINA_HOME}/var/catalina.pid"
SHUTDOWN_WAIT=20

prog="$DQ_SERVICE"
pidfile="\$CATALINA_PID"

status()
{
    if [ -f "\${pidfile}" ]
    then
        pid="\$( cat "\${pidfile}" )"
        if ps p "\$pid" >/dev/null
        then
            echo \$"\${prog} (pid \$pid) is running ..."
            return 0
        else
            echo \$"\${prog} is dead but pid file exists"
            return 1
        fi
    else
        echo \$"\${prog} is stopped"
        return 2
    fi
}

start()
{
    MSG=\$( status )
    case "\$?" in
        0 )
            echo \$"\$MSG" ;
            return 0
            ;;
        1 )
            echo \$"WARNING: \$MSG"
            rm -fv "\$pidfile"
            ;;
    esac

    echo \$"Starting tomcat"
    runuser -l \$CATALINA_USER -c "\${CATALINA_SH} start"

    MSG=\$( status )
    case "\$?" in
        0 ) echo \$"OK" ; return 0 ;;
        1 | 2 ) echo \$"FAILED" ; return 1 ;;
    esac
}

stop()
{
    MSG=\$( status )
    case "\$?" in
        2 )
            echo \$"\$MSG" ;
            return 0
            ;;
        1 )
            echo \$"WARNING: \$MSG"
            rm -fv "\$pidfile"
            return 0
            ;;
    esac

    pid="\$( cat "\${pidfile}" )"

    echo \$"Stopping Tomcat"
    runuser -l \$CATALINA_USER -c "\${CATALINA_SH} stop"

    count_max="\${SHUTDOWN_WAIT:-5}"
    count=0

    while [ \$count -le "\$count_max" ] && ps p "\$pid" >/dev/null 2>&1
    do
        echo \$"Waiting for the processes to exit ...";
        sleep 1
        let count=\$count+1;
    done

    if ps p "\$pid" >/dev/null 2>&1
    then
        echo \$"Killing the processes which didn't stop after \$SHUTDOWN_WAIT seconds!"
        kill -9 \$pid
        sleep 1
    fi

    MSG=\$( status )
    case "\$?" in
        2 ) echo \$"OK" ; return 0 ;;
        1 ) echo \$"OK" ; rm -fv "\$pidfile" ; return 0 ;;
        0 ) echo \$"FAILED" ; return 1 ;;
    esac
}

case \$1 in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  status)
    status
    ;;
esac
exit 0
END
chmod +x "$DQ_INIT"

chkconfig "$DQ_SERVICE" on
service "$DQ_SERVICE" start

#======================================================================
# Integration with the Apache web server

info "Setting Data Quality proxy behind the Apache reverse proxy ..."

# locate proper configuration file (see also apache configuration)
{
    locate_apache_conf 80
    locate_apache_conf 443
} | while read CONF
do
    # delete any previous configuration and write a new one
    { ex "$CONF" || /bin/true ; } <<END
/DQ00_BEGIN/,/DQ00_END/de
/^[ 	]*<\/VirtualHost>/i
    # DQ00_BEGIN - Data Quality Proxy - Do not edit or remove this line!

    # improvised Q1 client
    Alias /q1 "/srv/odaos/data-quality/q1"
    <Directory "/srv/odaos/data-quality/q1">
            Options -MultiViews +FollowSymLinks
            AllowOverride None
            Order Allow,Deny
            Allow from all
            Header set Access-Control-Allow-Origin "*"
    </Directory>

    # reverse proxy to the Data Qaulity Proxy

    ProxyPass        /constellation http://$DQ_PROXY_HOST:$DQ_PROXY_PORT/constellation
    ProxyPassReverse /constellation http://$DQ_PROXY_HOST:$DQ_PROXY_PORT/constellation

    # DQ00_END - Data Quality Proxy - Do not edit or remove this line!
.
wq
END
done

# restart apache to force the changes to take effect
service httpd restart


text:
var chai = require('chai');
var sinon = require('sinon');

chai.use(require('chai-as-promised'));
chai.use(require('sinon-chai'));
var expect = chai.expect;

var module = require('../../lib/vk');
var Chain = require('../../lib/chain').Chain;

describe('VK', () => {
  describe("#constructor", () => {

    it("creates instance with default values", () => {
      var inst = new module.VK({
        token: 1
      });

      expect(inst.config).to.deep.equal({
        token: 1,
        timeout: module.DEFAULT_TIMEOUT,
        api_url: module.DEFAULTAPI,
        version: module.CURRRENT_VERSION,
        groupId: null
      })
    });

    it("creates instance with custom values", () => {
      var conf = {
        token: 1,
        timeout: 100,
        api_url: "http://google.com",
        version: "5.43",
        groupId: 1
      };
      var inst = new module.VK(conf);

      expect(inst.config).to.deep.equal(conf);
    })
  });

  describe("#setToken", () => {
    it("sets token", () => {
      var inst = new module.VK({
        token: 1
      });
      inst.setToken(2);

      expect(inst.config.token).to.equal(2);
    });
  });

  describe("#chain", () => {
    it("returns initialized chain object", () => {
      var inst = new module.VK({ token: 2 });
      var chain = inst.chain();
      expect(chain.api).to.equal(inst);
      expect(chain).to.be.instanceof(Chain)
    })
  });
});


text:
module Foo where

import Data.Kind (Type)

data Foo (a :: Type) = Foo a


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: Selenium::WebDriver::IE

    — Documentation by YARD 0.8.7.3

</title>

  <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />

    Index (I) »
    Selenium » WebDriver
     »
    IE

(no frames)

      Class List

      Method List

      File List

Module: Selenium::WebDriver::IE

  Private

Defined in:

rb/lib/selenium/webdriver/ie.rb,

  rb/lib/selenium/webdriver/ie/bridge.rb,
 rb/lib/selenium/webdriver/ie/server.rb

  This module is part of a private API.
  You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

      Classes: Bridge, Server

      Class Method Summary
      (collapse)

      + (Object) driver_path

  private

      + (Object) driver_path=(path)

  private

Class Method Details

    + (<tt>Object</tt>) driver_path

  This method is part of a private API.
  You should avoid using this method if possible, as it may be removed or be changed in the future.

11
12
13

# File 'rb/lib/selenium/webdriver/ie.rb', line 11

def self.driver_path
  @driver_path ||= nil
end

    + (<tt>Object</tt>) driver_path=(path)

  This method is part of a private API.
  You should avoid using this method if possible, as it may be removed or be changed in the future.

6
7
8
9

# File 'rb/lib/selenium/webdriver/ie.rb', line 6

def self.driver_path=(path)
  Platform.assert_executable path
  @driver_path = path
end

  Generated on Mon Feb 17 23:05:57 2014 by
  yard
  0.8.7.3 (ruby-2.1.0).


text:
layout: post
date: 2018-03-01
title: "Pronovias YESEL 2015 Sleeveless Chapel Train Aline/Princess Open Back"
category: Pronovias
tags: [Pronovias,Aline/Princess ,Open Back,V-neck,Chapel Train,Sleeveless,2015,Gauze and silk organza]
---
### Pronovias YESEL
Just **$369.99**
### 2015  Sleeveless Chapel Train Aline/Princess  Open Back

BRANDS	Pronovias

Silhouette	Aline/Princess

Trend	Open Back

Neckline	V-neck

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Years	2015

Fabric	Gauze and silk organza

Buy it: [https://www.readybrides.com/en/pronovias/4266-pronovias-yesel.html](https://www.readybrides.com/en/pronovias/4266-pronovias-yesel.html)


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

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <PreferenceCategory android:title="@string/setting_title_browser">
        <!-- TODO: ListPreference entryValues should language-independent -->
        <ListPreference android:key="@string/sp_search_engine"
                        android:defaultValue="@string/setting_summary_search_engine_google"
                        android:title="@string/setting_title_search_engine"
                        android:summary="@string/setting_summary_search_engine_google"
                        android:entries="@array/setting_values_search_engine"
                        android:entryValues="@array/setting_values_search_engine">
        </ListPreference>

        <!-- TODO: ListPreference entryValues should language-independent -->
        <ListPreference android:key="@string/sp_notification_priority"
                        android:defaultValue="@string/setting_summary_notification_priority_default"
                        android:title="@string/setting_title_notification_priority"
                        android:summary="@string/setting_summary_notification_priority_default"
                        android:entries="@array/setting_values_notification_priority"
                        android:entryValues="@array/setting_values_notification_priority">
        </ListPreference>

        <!-- TODO: ListPreference entryValues should language-independent -->
        <ListPreference android:key="@string/sp_anchor"
                        android:defaultValue="@string/setting_summary_tab_position_top"
                        android:title="@string/setting_title_tab_position"
                        android:summary="@string/setting_summary_tab_position_top"
                        android:entries="@array/setting_values_tab_position"
                        android:entryValues="@array/setting_values_tab_position">
        </ListPreference>

        <CheckBoxPreference android:key="@string/sp_volume"
                            android:defaultValue="true"
                            android:title="@string/setting_title_scroll_control"
                            android:summary="@string/setting_summary_scroll_control">
        </CheckBoxPreference>

        <CheckBoxPreference android:key="@string/sp_images"
                            android:defaultValue="true"
                            android:title="@string/setting_title_images"
                            android:summary="@string/setting_summary_images">
        </CheckBoxPreference>

        <CheckBoxPreference android:key="@string/sp_cookies"
                            android:defaultValue="true"
                            android:title="@string/setting_title_cookie"
                            android:summary="@string/setting_summary_cookie">
        </CheckBoxPreference>

        <CheckBoxPreference android:key="@string/sp_javascript"
                            android:defaultValue="true"
                            android:title="@string/setting_title_javascript"
                            android:summary="@string/setting_summary_javascript">
        </CheckBoxPreference>

        <CheckBoxPreference android:key="@string/sp_location"
                            android:defaultValue="true"
                            android:title="@string/setting_title_location"
                            android:summary="@string/setting_summary_location">
        </CheckBoxPreference>

        <CheckBoxPreference android:key="@string/sp_multiple_windows"
                            android:defaultValue="true"
                            android:title="@string/setting_title_multiple_windows"
                            android:summary="@string/setting_summary_multiple_windows">
        </CheckBoxPreference>

        <!-- TODO: ListPreference entryValues should language-independent -->
        <ListPreference android:key="@string/sp_user_agent"
                        android:defaultValue="@string/setting_summary_user_agent_default"
                        android:title="@string/setting_title_user_agent"
                        android:summary="@string/setting_summary_user_agent_default"
                        android:entries="@array/setting_values_user_agent"
                        android:entryValues="@array/setting_values_user_agent">
        </ListPreference>

    </PreferenceCategory>

    <PreferenceCategory android:title="@string/setting_title_adblock">

        <CheckBoxPreference android:key="@string/sp_ad_block"
                            android:defaultValue="true"
                            android:title="@string/setting_title_adblock"
                            android:summary="@string/setting_summary_adblock">
        </CheckBoxPreference>

        <Preference android:title="@string/setting_title_whitelist"
                    android:summary="@string/setting_summary_whitelist">
        </Preference>

        <Preference android:title="@string/setting_title_export_whilelist" />

        <Preference android:title="@string/setting_title_import_whilelist" />

    </PreferenceCategory>

    <PreferenceCategory android:title="@string/setting_title_data">

        <CheckBoxPreference android:key="@string/sp_passwords"
                            android:defaultValue="true"
                            android:title="@string/setting_title_passwords"
                            android:summary="@string/setting_summary_passwords">
        </CheckBoxPreference>

        <Preference android:title="@string/setting_title_export_bookmarks" />

        <Preference android:title="@string/setting_title_import_bookmarks" />

        <Preference android:title="@string/setting_title_clear_bookmarks" />

        <Preference android:title="@string/setting_title_clear_cache" />

        <Preference android:title="@string/setting_title_clear_cookie" />

        <Preference android:title="@string/setting_title_clear_form_data" />

        <Preference android:title="@string/setting_title_clear_history" />

        <Preference android:title="@string/setting_title_clear_passwords" />

    </PreferenceCategory>

    <PreferenceCategory android:title="@string/setting_title_others">

        <Preference android:title="@string/setting_title_version"
                    android:summary="@string/app_version">
        </Preference>

        <Preference android:title="@string/setting_title_license" />

        <Preference android:title="@string/setting_title_contact_us" />

    </PreferenceCategory>

</PreferenceScreen>


text:
A script and code registry to create simple maps using [OpenLayers](http://www.openlayers.org) with no need to know or code Javascript: simply specify options in a form or define the same in a json object or custom element.

## Objective
Simplify map creation for those with little or no knowledge of Javascript or cartography.
Also helps developers try out different options.

## Current features
- raster source definitions stored in a registry (`lib/registry/sources`); pretty much any raster source supported by OL can be added to this
- GeoJSON, KML and GPX vector sources can be loaded and displayed over the raster source
- by default, maps with vector data will initially be zoomed to the extent of the data;
  those without will be zoomed to the maximum extent of the projection;
  this can be overridden by specifying a center and zoom level
- raster sources can be in different projections, and can be made in/visible by the layerswitcher provided by default
- the layerswitcher will automatically reproject vector features when the projection of the underlying raster source changes (OL's raster reprojection is not used; the view is simply redisplayed using the nearest zoom level for the new projection)
- uses the default OL zoom and scaleline controls, to which other widgets such as cursor position display, tooltips and feature info popups can be added; these widgets are also stored in a registry (`lib/registry/components`)
- custom feature styles can be specified for each vector source
- vector data/features can be drawn and moved/edited; this includes splitting and joining of linestrings
- map div uses 100% of screen viewport so keyboard arrows can pan map
- should be usable on both mouse/keyboard (desktop/laptop) and touch-screen (mobile) devices

## Usage
The main html file `map-make.html` is all that needs to be installed. When loaded in the browser, this will display the main toolbar which enables you to define which sources and tools you wish to use.

This is fine for one-off maps, but is unwieldy for maps you want to reuse, so the *map definition* (mapDef) can be saved for future use.

This can be a JSON object stored in a file which can be loaded from a url. It can also be a `<map-def>` custom element defined in the HTML file.

In addition, parameters can be specified as key-value pairs in the query string.

There are some sample mapDefs and sample HTML files to load them in  `samples/`. See [Usage file](usage.md) for more detailed instructions and further examples.

## Technical details
The JS source is in `lib/` and is modularised in ES2015 module syntax (`import`/`export`). It runs entirely in the browser, using the [jsDelivr](https://cdn.jsdelivr.net/) CDN to load the appropriate modules direct from this Github repo. The initial entry point is from the HTML file with other modules loaded dynamically from code using `import()`.

For more info on registry entries, see the Readme in the appropriate section of `lib/registry`.

Until version 3.1, the OL code was compiled into a separate build imported by the map-make modules, but since 3.1 the OL and map-make code has been built together, split into modules for each of the different entry points.

`map-make.html` loads `initloader.js` as the initial bootstrap, by default from `dist` on Github `master`, served from jsDelivr. This is a standard script, not a module. A field in `initloader` defines the latest version, and by default, it loads CSS from `dist/css/` for this version, and modules from `dist` for this version, using `initloader`'s URL as the base URL. This can however be overridden to enable loading a different version or from localhost. A test HTML could, for example, load a local `initloader`, and both CSS and base URL can be defined in a `data-configVars` attribute in the `<script>` tag:

```html
<script data-configVars='{"css":"../another/path/css/map-make.css","baseURL":"./further/path/map-make/lib/"}' src="../map-make/lib/initloader.js"></script>
```

A new version can thus be pushed to Github, and tested there; only when the release tag is added, and the `tag` field is changed in `initloader`, will this be used by default. See below for more on the release procedure, and `initloader.js` source for more info.

### External libraries
Besides OL, a modular build of [Proj4js](http://proj4js.org/) is used by the projection modules (`registry/projections`), [slideout.js](https://mango.github.io/slideout/) by the `toolbar` component, and [Awesomplete](https://leaverou.github.io/awesomplete/) by the `addlayer` component for autocompletion. Until these libraries produce ES-module versions, the last two are wrapped in an `export default` so they can be imported. See `lib/registry/projections/Readme.md` for details of the Proj4js custom build. The CSS for OL, Font Awesome and Slideout is combined into one file (`css/map-make.css`), which is minified into `dist/css/`; that for Awesomplete is loaded from CDN from the `addlayer` component. A custom version of the [Font Awesome webfont](http://fontawesome.io/) including only those glyphs used is loaded by `map-make.css`.

### More on `lib` and `dist`
As discussed above, the source is in `lib`, with a built/minified version in `dist`. The source imports OL modules using `ol/...` specifiers. An import map can then determine where `ol/` should be loaded from - for example, from localhost or from the repo. The build process takes these modules, also using an import map to load the OL code from the repo, and builds each of the entry modules into `dist`.

So, `lib/` contains:
* uncompressed module sources which can be loaded for testing on localhost
* compressed code for external libraries in `registry/components/ext/`; these are in a simple `export default` wrapper so they can be loaded as dependencies
* component HTML in `registry/components/*.html.js` are `<template>` elements in a simple `export default` wrapper so they can be loaded as dependencies

`dist/` is built from `lib` using [deno-rollup](https://deno.land/x/drollup), a port of Rollup for Deno, with `drollup.split.js` as the config file. This is run with `deno run -A --unstable ./drollup.split.js`, which combines the map-make and OL code, and splits into modules corresponding to the dynamically imported map-make modules. This uses an import map to define where the external source is loaded from; see [build page](OLbuild.md) for more details. The modules are minified using deno-rollup's Terser plugin, and using the `module` option so top-level names can be mangled. `initloader.js` can be edited manually.

The component `ext/` files are included in the build, but the `proj4js` files are at the moment kept external.

`dist/` also contains `css` and `font` directories.

## Raster sources
Some source providers require an API code to be given when fetching tiles; these are specified in the appropriate source files, and should be provided at runtime in the map definition.

## Limitations
Only 1 raster layer can be active/visible at a time.

At present, there is no error validation at all.

Because this software is based on new language features like modules, it will not work in old browsers such as IE.

## Future plans
See issues.

## Contributions
are welcome, as are all good ideas on how this can be developed further.

## Release process
Code is loaded from a release tag. As mentioned above, which release tag to use is defined in `initloader.js`. So:
- changes can be committed and pushed to Github without affecting the loaded code
- for new release, add a new tag (`git tag n.n.n`) and `git push --tags`
- change `initloader.js` to use new tag/release; when pushed to Github, this release will be used once jsDelivr's cache has cleared.


text:
/**
 * @fileoverview Options configuration for optionator.
 * @author George Zahariev
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var optionator = require("optionator");

//------------------------------------------------------------------------------
// Initialization and Public Interface
//------------------------------------------------------------------------------

// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
module.exports = optionator({
    prepend: "eslint [options] file.js [file.js] [dir]",
    concatRepeatedArrays: true,
    mergeRepeatedObjects: true,
    options: [{
        heading: "Options"
    }, {
        option: "help",
        alias: "h",
        type: "Boolean",
        description: "Show help"
    }, {
        option: "config",
        alias: "c",
        type: "path::String",
        description: "Use configuration from this file or sharable config"
    }, {
        option: "rulesdir",
        type: "[path::String]",
        description: "Use additional rules from this directory"
    }, {
        option: "format",
        alias: "f",
        type: "String",
        default: "stylish",
        description: "Use a specific output format"
    }, {
        option: "version",
        alias: "v",
        type: "Boolean",
        description: "Outputs the version number"
    }, {
        option: "eslintrc",
        type: "Boolean",
        default: "true",
        description: "Disable use of configuration from .eslintrc"
    }, {
        option: "env",
        type: "[String]",
        description: "Specify environments"
    }, {
        option: "ext",
        type: "[String]",
        default: ".js",
        description: "Specify JavaScript file extensions"
    }, {
        option: "plugin",
        type: "[String]",
        description: "Specify plugins"
    }, {
        option: "global",
        type: "[String]",
        description: "Define global variables"
    }, {
        option: "rule",
        type: "Object",
        description: "Specify rules"
    },
    {
        option: "ignore-path",
        type: "path::String",
        description: "Specify path of ignore file"
    },
    {
        option: "ignore",
        type: "Boolean",
        default: "true",
        description: "Disable use of .eslintignore"
    },
    {
        option: "ignore-pattern",
        type: "String",
        description: "Pattern of files to ignore (in addition to those in .eslintignore)"
    },
    {
        option: "color",
        type: "Boolean",
        default: "true",
        description: "Disable color in piped output"
    },
    {
        option: "output-file",
        alias: "o",
        type: "path::String",
        description: "Specify file to write report to"
    },
    {
        option: "quiet",
        type: "Boolean",
        default: "false",
        description: "Report errors only"
    },
    {
        option: "stdin",
        type: "Boolean",
        default: "false",
        description: "Lint code provided on <STDIN>"
    },
    {
        option: "stdin-filename",
        type: "String",
        description: "Specify filename to process STDIN as"
    },
    {
        option: "init",
        type: "Boolean",
        default: "false",
        description: "Run config initialization wizard"
    }]
});


text:
TestedInterface = "VR"
Tested_resultCode = "REJECTED"
Tested_wrongJSON = false

Test = require('user_modules/IsReady_Template/ATF_Interface_IsReady_missing_SingleRPC_Template')

return Test


text:
#ifndef __ARCH_X86_ISATRAITS_HH__
#define __ARCH_X86_ISATRAITS_HH__

#include "arch/x86/types.hh"
#include "arch/x86/x86_traits.hh"
#include "base/types.hh"

namespace LittleEndianGuest {}

namespace X86ISA
{
    //This makes sure the little endian version of certain functions
    //are used.
    using namespace LittleEndianGuest;

    // X86 does not have a delay slot
#define ISA_HAS_DELAY_SLOT 0

    // X86 NOP (XCHG rAX, rAX)
    //XXX This needs to be set to an intermediate instruction struct
    //which encodes this instruction

    const Addr PageShift = 12;
    const Addr PageBytes = ULL(1) << PageShift;

    // Memory accesses can be unaligned
    const bool HasUnalignedMemAcc = true;

    const bool CurThreadInfoImplemented = false;
    const int CurThreadInfoReg = -1;

    const ExtMachInst NoopMachInst M5_VAR_USED = {
        0x0,                            // No legacy prefixes.
        0x0,                            // No rex prefix.
        0x0,                            // No two / three byte escape sequence
        { OneByteOpcode, 0x90 },        // One opcode byte, 0x90.
        0x0, 0x0,                       // No modrm or sib.
        0, 0,                           // No immediate or displacement.
        8, 8, 8,                        // All sizes are 8.
        0,                              // Displacement size is 0.
        SixtyFourBitMode                // Behave as if we're in 64 bit
                                        // mode (this doesn't actually matter).
    };
}

#endif // __ARCH_X86_ISATRAITS_HH__


text:
package net.jawr.web.resource.handler.reader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.Reader;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.util.Set;

import net.jawr.web.JawrConstant;
import net.jawr.web.config.JawrConfig;
import net.jawr.web.exception.BundlingProcessException;
import net.jawr.web.resource.bundle.JoinableResourceBundle;
import net.jawr.web.util.FileUtils;
import net.jawr.web.util.StringUtils;

/**
 * This class defines the resource reader which is based on a file system and
 * which can handle text and stream resources.
 *
 * @author Ibrahim Chaehoi
 *
 */
public class FileSystemResourceReader implements TextResourceReader, StreamResourceReader, ResourceBrowser {

	/** The base directory */
	private String baseDir;

	/** The charset */
	private Charset charset;

	/**
	 * Constructor
	 *
	 * @param config
	 *            the Jawr config
	 */
	public FileSystemResourceReader(JawrConfig config) {
		this(config.getProperty(JawrConstant.JAWR_BASECONTEXT_DIRECTORY), config);
	}

	/**
	 * Constructor
	 *
	 * @param baseDir
	 *            the base directory
	 * @param config
	 *            the Jawr config
	 */
	public FileSystemResourceReader(String baseDir, JawrConfig config) {

		this.baseDir = baseDir;
		if (StringUtils.isEmpty(this.baseDir)) {
			throw new BundlingProcessException(
					"The 'jawr.basecontext.directory' is not set. Please provide a value or remove it if it's not used.");
		}
		if (this.baseDir != null && this.baseDir.startsWith(JawrConstant.FILE_URI_PREFIX)) {
			this.baseDir = this.baseDir.substring(JawrConstant.FILE_URI_PREFIX.length());
		}

		File baseDirFile = new File(this.baseDir);
		if (!baseDirFile.exists()) {
			throw new BundlingProcessException("The base context directory '" + this.baseDir
					+ " doesn't exists. Please check your configuration.");
		} else if (!baseDirFile.isDirectory()) {
			throw new BundlingProcessException("The base context directory '" + this.baseDir
					+ " is not a directory. Please check your configuration.");
		}
		this.charset = config.getResourceCharset();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see net.jawr.web.resource.handler.ResourceReader#getResource(java.lang.
	 * String)
	 */
	@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName) {

		return getResource(bundle, resourceName, false);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * net.jawr.web.resource.handler.reader.TextResourceReader#getResource(net.
	 * jawr.web.resource.bundle.JoinableResourceBundle, java.lang.String,
	 * boolean)
	 */
	@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle) {

		Reader rd = null;
		FileInputStream fis = (FileInputStream) getResourceAsStream(resourceName);
		if (fis != null) {
			FileChannel inchannel = fis.getChannel();
			rd = Channels.newReader(inchannel, charset.newDecoder(), -1);
		}

		return rd;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see net.jawr.web.resource.handler.reader.StreamResourceReader#
	 * getResourceAsStream(net.jawr.web.resource.bundle.JoinableResourceBundle,
	 * java.lang.String)
	 */
	@Override
	public InputStream getResourceAsStream(String resourceName) {

		return getResourceAsStream(resourceName, false);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see net.jawr.web.resource.handler.reader.StreamResourceReader#
	 * getResourceAsStream(net.jawr.web.resource.bundle.JoinableResourceBundle,
	 * java.lang.String, boolean)
	 */
	@Override
	public InputStream getResourceAsStream(String resourceName, boolean processingBundle) {

		InputStream is = null;
		try {
			File resource = new File(baseDir, resourceName);
			is = new FileInputStream(resource);
		} catch (FileNotFoundException e) {
			// Nothing to do
		}

		return is;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * net.jawr.web.resource.handler.reader.ResourceBrowser#getResourceNames(
	 * java.lang.String)
	 */
	@Override
	public Set<String> getResourceNames(String path) {
		path = path.replace('/', File.separatorChar);
		File resource = new File(baseDir, path);
		return FileUtils.getResourceNames(resource);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * net.jawr.web.resource.handler.reader.ResourceBrowser#isDirectory(java.
	 * lang.String)
	 */
	@Override
	public boolean isDirectory(String dirPath) {
		String path = dirPath.replace('/', File.separatorChar);
		return new File(baseDir, path).isDirectory();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * net.jawr.web.resource.handler.reader.ResourceBrowser#getFilePath(java.
	 * lang.String)
	 */
	@Override
	public String getFilePath(String resourcePath) {
		String path = resourcePath.replace('/', File.separatorChar);
		return new File(baseDir, path).getAbsolutePath();
	}

}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Policy;
using Python.Runtime;
using QuantConnect.Interfaces;
using QuantConnect.Logging;
using QuantConnect.AlgorithmFactory.Python.Wrappers;
using QuantConnect.Configuration;
using QuantConnect.Python;
using QuantConnect.Util;
using System.Runtime.Loader;

namespace QuantConnect.AlgorithmFactory
{
    /// <summary>
    /// Loader creates and manages the memory and exception space of the algorithm, ensuring if it explodes the Lean Engine is intact.
    /// </summary>
    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class Loader : MarshalByRefObject
    {
        // True if we are in a debugging session
        private readonly bool _debugging;

        // Defines the maximum amount of time we will allow for instantiating an instance of IAlgorithm
        private readonly TimeSpan _loaderTimeLimit;

        // Language of the loader class.
        private readonly Language _language;

        // Defines how we resolve a list of type names into a single type name to be instantiated
        private readonly Func<List<string>, string> _multipleTypeNameResolverFunction;

        // The worker thread instance the loader will use if not null
        private readonly WorkerThread _workerThread;

        /// <summary>
        /// Memory space of the user algorithm
        /// </summary>
        public AppDomain appDomain;

        /// <summary>
        /// The algorithm's interface type that we'll be trying to load
        /// </summary>
        private static readonly Type AlgorithmInterfaceType = typeof (IAlgorithm);

        /// <summary>
        /// The full type name of QCAlgorithm, this is so we don't pick him up when querying for types
        /// </summary>
        private const string AlgorithmBaseTypeFullName = "QuantConnect.Algorithm.QCAlgorithm";

        /// <summary>
        /// The full type name of QCAlgorithmFramework, this is so we don't pick him up when querying for types
        /// </summary>
        private const string FrameworkBaseTypeFullName = "QuantConnect.Algorithm.Framework.QCAlgorithmFramework";

        /// <summary>
        /// Creates a new loader with a 10 second maximum load time that forces exactly one derived type to be found
        /// </summary>
        public Loader()
            : this(false, Language.CSharp, TimeSpan.FromSeconds(10), names => names.SingleOrDefault())
        {
        }

        /// <summary>
        /// Creates a new loader with the specified configuration
        /// </summary>
        /// <param name="debugging">True if we are debugging</param>
        /// <param name="language">Which language are we trying to load</param>
        /// <param name="loaderTimeLimit">
        /// Used to limit how long it takes to create a new instance
        /// </param>
        /// <param name="multipleTypeNameResolverFunction">
        /// Used to resolve multiple type names found in assembly to a single type name, if null, defaults to names => names.SingleOrDefault()
        ///
        /// When we search an assembly for derived types of IAlgorithm, sometimes the assembly will contain multiple matching types. This is the case
        /// for the QuantConnect.Algorithm assembly in this solution.  In order to pick the correct type, consumers must specify how to pick the type,
        /// that's what this function does, it picks the correct type from the list of types found within the assembly.
        /// </param>
        /// <param name="workerThread">The worker thread instance the loader should use</param>
        public Loader(bool debugging, Language language, TimeSpan loaderTimeLimit, Func<List<string>, string> multipleTypeNameResolverFunction, WorkerThread workerThread = null)
        {
            _debugging = debugging;
            _language = language;
            _workerThread = workerThread;
            if (multipleTypeNameResolverFunction == null)
            {
                throw new ArgumentNullException("multipleTypeNameResolverFunction");
            }

            _loaderTimeLimit = loaderTimeLimit;
            _multipleTypeNameResolverFunction = multipleTypeNameResolverFunction;
        }

        /// <summary>
        /// Creates a new instance of the specified class in the library, safely.
        /// </summary>
        /// <param name="assemblyPath">Location of the DLL</param>
        /// <param name="algorithmInstance">Output algorithm instance</param>
        /// <param name="errorMessage">Output error message on failure</param>
        /// <returns>Bool true on successfully loading the class.</returns>
        public bool TryCreateAlgorithmInstance(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)
        {
            //Default initialisation of Assembly.
            algorithmInstance = null;
            errorMessage = "";

            //First most basic check:
            if (!File.Exists(assemblyPath))
            {
                return false;
            }

            switch (_language)
            {
                case Language.Python:
                    TryCreatePythonAlgorithm(assemblyPath, out algorithmInstance, out errorMessage);
                    break;

                default:
                    TryCreateILAlgorithm(assemblyPath, out algorithmInstance, out errorMessage);
                    break;
            }

            //Successful load.
            return algorithmInstance != null;
        }

        /// <summary>
        /// Create a new instance of a python algorithm
        /// </summary>
        /// <param name="assemblyPath"></param>
        /// <param name="algorithmInstance"></param>
        /// <param name="errorMessage"></param>
        /// <returns></returns>
        private bool TryCreatePythonAlgorithm(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)
        {
            algorithmInstance = null;
            errorMessage = string.Empty;

            //File does not exist.
            if (!File.Exists(assemblyPath))
            {
                errorMessage = $"Loader.TryCreatePythonAlgorithm(): Unable to find py file: {assemblyPath}";
                return false;
            }

            var pythonFile = new FileInfo(assemblyPath);
            var moduleName = pythonFile.Name.Replace(".pyc", "").Replace(".py", "");

            try
            {
                PythonInitializer.Initialize();

                algorithmInstance = new AlgorithmPythonWrapper(moduleName);

                // we need stdout for debugging
                if (!_debugging && Config.GetBool("mute-python-library-logging", true))
                {
                    using (Py.GIL())
                    {
                        PythonEngine.Exec(
                            @"
import logging, os, sys
sys.stdout = open(os.devnull, 'w')
logging.captureWarnings(True)"
                        );
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
                errorMessage = $"Loader.TryCreatePythonAlgorithm(): Unable to import python module {assemblyPath}. {e.Message}";
                return false;
            }

            //Successful load.
            return true;
        }

        /// <summary>
        /// Create a generic IL algorithm
        /// </summary>
        /// <param name="assemblyPath"></param>
        /// <param name="algorithmInstance"></param>
        /// <param name="errorMessage"></param>
        /// <returns></returns>
        private bool TryCreateILAlgorithm(string assemblyPath, out IAlgorithm algorithmInstance, out string errorMessage)
        {
            errorMessage = "";
            algorithmInstance = null;

            try
            {
                byte[] debugInformationBytes = null;

                // if the assembly is located in the base directory then don't bother loading the pdbs
                // manually, they'll be loaded automatically by the .NET runtime.
                var directoryName = new FileInfo(assemblyPath).DirectoryName;
                if (directoryName != null && directoryName.TrimEnd(Path.DirectorySeparatorChar) != AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar))
                {
                    // see if the pdb exists
                    var mdbFilename = assemblyPath + ".mdb";
                    var pdbFilename = assemblyPath.Substring(0, assemblyPath.Length - 4) + ".pdb";
                    if (File.Exists(pdbFilename))
                    {
                        debugInformationBytes = File.ReadAllBytes(pdbFilename);
                    }
                    // see if the mdb exists
                    if (File.Exists(mdbFilename))
                    {
                        debugInformationBytes = File.ReadAllBytes(mdbFilename);
                    }
                }

                //Load the assembly:
                Assembly assembly;
                if (debugInformationBytes == null)
                {
                    Log.Trace("Loader.TryCreateILAlgorithm(): Loading only the algorithm assembly");
                    //this is needed to isolate multiple execution contexts
                    assembly = (AssemblyLoadContext.CurrentContextualReflectionContext ?? AssemblyLoadContext.Default)
                        .LoadFromAssemblyPath(Path.GetFullPath(assemblyPath));
                }
                else
                {
                    Log.Trace("Loader.TryCreateILAlgorithm(): Loading debug information with algorithm");
                    var assemblyBytes = File.ReadAllBytes(assemblyPath);
                    //this is needed to isolate multiple execution contexts
                    assembly = (AssemblyLoadContext.CurrentContextualReflectionContext ?? AssemblyLoadContext.Default)
                        .LoadFromStream(new MemoryStream(assemblyBytes), new MemoryStream(debugInformationBytes));
                }

                //Get the list of extention classes in the library:
                var types = GetExtendedTypeNames(assembly);
                Log.Debug("Loader.TryCreateILAlgorithm(): Assembly types: " + string.Join(",", types));

                //No extensions, nothing to load.
                if (types.Count == 0)
                {
                    errorMessage = "Algorithm type was not found.";
                    Log.Error("Loader.TryCreateILAlgorithm(): Types array empty, no algorithm type found.");
                    return false;
                }

                if (types.Count > 1)
                {
                    // reshuffle type[0] to the resolved typename
                    types[0] = _multipleTypeNameResolverFunction.Invoke(types);

                    if (string.IsNullOrEmpty(types[0]))
                    {
                        errorMessage = "Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.";
                        Log.Error($"Loader.TryCreateILAlgorithm(): {errorMessage}");
                        return false;
                    }
                }
                //Load the assembly into this AppDomain:
                algorithmInstance = (IAlgorithm)assembly.CreateInstance(types[0], true);

                if (algorithmInstance != null)
                {
                    Log.Trace("Loader.TryCreateILAlgorithm(): Loaded " + algorithmInstance.GetType().Name);
                }

            }
            catch (ReflectionTypeLoadException err)
            {
                Log.Error(err);
                Log.Error("Loader.TryCreateILAlgorithm(1): " + err.LoaderExceptions[0]);
                if (err.InnerException != null) errorMessage = err.InnerException.Message;
            }
            catch (Exception err)
            {
                errorMessage = "Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.";
                Log.Error($"Loader.TryCreateILAlgorithm(): {errorMessage}\n{err.InnerException ?? err}");
                return false;
            }

            return true;
        }

        /// <summary>
        /// Get a list of all the matching type names in this DLL assembly:
        /// </summary>
        /// <param name="assembly">Assembly dll we're loading.</param>
        /// <returns>String list of types available.</returns>
        public static List<string> GetExtendedTypeNames(Assembly assembly)
        {
            var types = new List<string>();
            try
            {
                Type[] assemblyTypes;
                try
                {
                    assemblyTypes = assembly.GetTypes();
                }
                catch (ReflectionTypeLoadException e)
                {
                    // We may want to exclude possible null values
                    // See https://stackoverflow.com/questions/7889228/how-to-prevent-reflectiontypeloadexception-when-calling-assembly-gettypes
                    assemblyTypes = e.Types.Where(t => t != null).ToArray();

                    var countTypesNotLoaded = e.LoaderExceptions.Length;
                    Log.Error($"Loader.GetExtendedTypeNames(): Unable to load {countTypesNotLoaded} of the requested types, " +
                              "see below for more details on what causes an issue:");

                    foreach (Exception inner in e.LoaderExceptions)
                    {
                        Log.Error($"Loader.GetExtendedTypeNames(): {inner.Message}");
                    }
                }

                if (assemblyTypes != null && assemblyTypes.Length > 0)
                {
                    types = (from t in assemblyTypes
                             where t.IsClass                                    // require class
                             where !t.IsAbstract                                // require concrete impl
                             where AlgorithmInterfaceType.IsAssignableFrom(t)   // require derived from IAlgorithm
                             where t.FullName != AlgorithmBaseTypeFullName      // require not equal to QuantConnect.QCAlgorithm
                             where t.FullName != FrameworkBaseTypeFullName      // require not equal to QuantConnect.QCAlgorithmFramework
                             where t.GetConstructor(Type.EmptyTypes) != null    // require default ctor
                             select t.FullName).ToList();
                }
                else
                {
                    Log.Error("API.GetExtendedTypeNames(): No types found in assembly.");
                }
            }
            catch (Exception err)
            {
                Log.Error(err);
            }

            return types;
        }

        /// <summary>
        /// Creates a new instance of the class in the library, safely.
        /// </summary>
        /// <param name="assemblyPath">Location of the DLL</param>
        /// <param name="ramLimit">Limit of the RAM for this process</param>
        /// <param name="algorithmInstance">Output algorithm instance</param>
        /// <param name="errorMessage">Output error message on failure</param>
        /// <returns>bool success</returns>
        public bool TryCreateAlgorithmInstanceWithIsolator(string assemblyPath, int ramLimit, out IAlgorithm algorithmInstance, out string errorMessage)
        {
            IAlgorithm instance = null;
            var error = string.Empty;

            var success = false;
            var isolator = new Isolator();
            var complete = isolator.ExecuteWithTimeLimit(_loaderTimeLimit, () =>
            {
                success = TryCreateAlgorithmInstance(assemblyPath, out instance, out error);
            }, ramLimit, sleepIntervalMillis:100, workerThread:_workerThread);

            algorithmInstance = instance;
            errorMessage = error;

            // if the isolator stopped us early add that to our error message
            if (!complete)
            {
                errorMessage = "Failed to create algorithm instance within 10 seconds. Try re-building algorithm. " + error;
            }

            return complete && success && algorithmInstance != null;
        }

        /// <summary>
        /// Unload this factory's appDomain.
        /// </summary>
        /// <remarks>Not used in lean engine. Running the library in an app domain is 10x slower.</remarks>
        /// <seealso cref="AppDomain.CreateDomain(string, Evidence, string, string, bool, AppDomainInitializer, string[])"/>
        public void Unload() {
            if (appDomain != null)
            {
                AppDomain.Unload(appDomain);
                appDomain = null;
            }
        }

    } // End Algorithm Factory Class

} // End QC Namespace.