text:
    var zrUtil = require('zrender/lib/core/util');
    var List = require('../../data/List');
    var numberUtil = require('../../util/number');

    var markerHelper = require('./markerHelper');

    var LineDraw = require('../../chart/helper/LineDraw');

    var markLineTransform = function (seriesModel, coordSys, mlModel, item) {
        var data = seriesModel.getData();
        // Special type markLine like 'min', 'max', 'average'
        var mlType = item.type;

        if (!zrUtil.isArray(item)
            && (
                mlType === 'min' || mlType === 'max' || mlType === 'average'
                // In case
                // data: [{
                //   yAxis: 10
                // }]
                || (item.xAxis != null || item.yAxis != null)
            )
        ) {
            var valueAxis;
            var valueDataDim;
            var value;

            if (item.yAxis != null || item.xAxis != null) {
                valueDataDim = item.yAxis != null ? 'y' : 'x';
                valueAxis = coordSys.getAxis(valueDataDim);

                value = zrUtil.retrieve(item.yAxis, item.xAxis);
            }
            else {
                var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);
                valueDataDim = axisInfo.valueDataDim;
                valueAxis = axisInfo.valueAxis;
                value = markerHelper.numCalculate(data, valueDataDim, mlType);
            }
            var valueIndex = valueDataDim === 'x' ? 0 : 1;
            var baseIndex = 1 - valueIndex;

            var mlFrom = zrUtil.clone(item);
            var mlTo = {};

            mlFrom.type = null;

            mlFrom.coord = [];
            mlTo.coord = [];
            mlFrom.coord[baseIndex] = -Infinity;
            mlTo.coord[baseIndex] = Infinity;

            var precision = mlModel.get('precision');
            if (precision >= 0 && typeof value === 'number') {
                value = +value.toFixed(precision);
            }

            mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;

            item = [mlFrom, mlTo, { // Extra option for tooltip and label
                type: mlType,
                valueIndex: item.valueIndex,
                // Force to use the value of calculated value.
                value: value
            }];
        }

        item = [
            markerHelper.dataTransform(seriesModel, item[0]),
            markerHelper.dataTransform(seriesModel, item[1]),
            zrUtil.extend({}, item[2])
        ];

        // Avoid line data type is extended by from(to) data type
        item[2].type = item[2].type || '';

        // Merge from option and to option into line option
        zrUtil.merge(item[2], item[0]);
        zrUtil.merge(item[2], item[1]);

        return item;
    };

    function isInifinity(val) {
        return !isNaN(val) && !isFinite(val);
    }

    // If a markLine has one dim
    function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
        var otherDimIndex = 1 - dimIndex;
        var dimName = coordSys.dimensions[dimIndex];
        return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])
            && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
    }

    function markLineFilter(coordSys, item) {
        if (coordSys.type === 'cartesian2d') {
            var fromCoord = item[0].coord;
            var toCoord = item[1].coord;
            // In case
            // {
            //  markLine: {
            //    data: [{ yAxis: 2 }]
            //  }
            // }
            if (
                fromCoord && toCoord &&
                (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)
                || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))
            ) {
                return true;
            }
        }
        return markerHelper.dataFilter(coordSys, item[0])
            && markerHelper.dataFilter(coordSys, item[1]);
    }

    function updateSingleMarkerEndLayout(
        data, idx, isFrom, seriesModel, api
    ) {
        var coordSys = seriesModel.coordinateSystem;
        var itemModel = data.getItemModel(idx);

        var point;
        var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());
        var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());
        if (!isNaN(xPx) && !isNaN(yPx)) {
            point = [xPx, yPx];
        }
        else {
            // Chart like bar may have there own marker positioning logic
            if (seriesModel.getMarkerPosition) {
                // Use the getMarkerPoisition
                point = seriesModel.getMarkerPosition(
                    data.getValues(data.dimensions, idx)
                );
            }
            else {
                var dims = coordSys.dimensions;
                var x = data.get(dims[0], idx);
                var y = data.get(dims[1], idx);
                point = coordSys.dataToPoint([x, y]);
            }
            // Expand line to the edge of grid if value on one axis is Inifnity
            // In case
            //  markLine: {
            //    data: [{
            //      yAxis: 2
            //      // or
            //      type: 'average'
            //    }]
            //  }
            if (coordSys.type === 'cartesian2d') {
                var xAxis = coordSys.getAxis('x');
                var yAxis = coordSys.getAxis('y');
                var dims = coordSys.dimensions;
                if (isInifinity(data.get(dims[0], idx))) {
                    point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);
                }
                else if (isInifinity(data.get(dims[1], idx))) {
                    point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);
                }
            }

            // Use x, y if has any
            if (!isNaN(xPx)) {
                point[0] = xPx;
            }
            if (!isNaN(yPx)) {
                point[1] = yPx;
            }
        }

        data.setItemLayout(idx, point);
    }

    require('./MarkerView').extend({

        type: 'markLine',

        updateLayout: function (markLineModel, ecModel, api) {
            ecModel.eachSeries(function (seriesModel) {
                var mlModel = seriesModel.markLineModel;
                if (mlModel) {
                    var mlData = mlModel.getData();
                    var fromData = mlModel.__from;
                    var toData = mlModel.__to;
                    // Update visual and layout of from symbol and to symbol
                    fromData.each(function (idx) {
                        updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api);
                        updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api);
                    });
                    // Update layout of line
                    mlData.each(function (idx) {
                        mlData.setItemLayout(idx, [
                            fromData.getItemLayout(idx),
                            toData.getItemLayout(idx)
                        ]);
                    });

                    this.markerGroupMap[seriesModel.name].updateLayout();

                }
            }, this);
        },

        renderSeries: function (seriesModel, mlModel, ecModel, api) {
            var coordSys = seriesModel.coordinateSystem;
            var seriesName = seriesModel.name;
            var seriesData = seriesModel.getData();

            var lineDrawMap = this.markerGroupMap;
            var lineDraw = lineDrawMap[seriesName];
            if (!lineDraw) {
                lineDraw = lineDrawMap[seriesName] = new LineDraw();
            }
            this.group.add(lineDraw.group);

            var mlData = createList(coordSys, seriesModel, mlModel);

            var fromData = mlData.from;
            var toData = mlData.to;
            var lineData = mlData.line;

            mlModel.__from = fromData;
            mlModel.__to = toData;
            // Line data for tooltip and formatter
            mlModel.setData(lineData);

            var symbolType = mlModel.get('symbol');
            var symbolSize = mlModel.get('symbolSize');
            if (!zrUtil.isArray(symbolType)) {
                symbolType = [symbolType, symbolType];
            }
            if (typeof symbolSize === 'number') {
                symbolSize = [symbolSize, symbolSize];
            }

            // Update visual and layout of from symbol and to symbol
            mlData.from.each(function (idx) {
                updateDataVisualAndLayout(fromData, idx, true);
                updateDataVisualAndLayout(toData, idx, false);
            });

            // Update visual and layout of line
            lineData.each(function (idx) {
                var lineColor = lineData.getItemModel(idx).get('lineStyle.normal.color');
                lineData.setItemVisual(idx, {
                    color: lineColor || fromData.getItemVisual(idx, 'color')
                });
                lineData.setItemLayout(idx, [
                    fromData.getItemLayout(idx),
                    toData.getItemLayout(idx)
                ]);

                lineData.setItemVisual(idx, {
                    'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'),
                    'fromSymbol': fromData.getItemVisual(idx, 'symbol'),
                    'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'),
                    'toSymbol': toData.getItemVisual(idx, 'symbol')
                });
            });

            lineDraw.updateData(lineData);

            // Set host model for tooltip
            // FIXME
            mlData.line.eachItemGraphicEl(function (el, idx) {
                el.traverse(function (child) {
                    child.dataModel = mlModel;
                });
            });

            function updateDataVisualAndLayout(data, idx, isFrom) {
                var itemModel = data.getItemModel(idx);

                updateSingleMarkerEndLayout(
                    data, idx, isFrom, seriesModel, api
                );

                data.setItemVisual(idx, {
                    symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],
                    symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],
                    color: itemModel.get('itemStyle.normal.color') || seriesData.getVisual('color')
                });
            }

            lineDraw.__keep = true;

            lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');
        }
    });

    /**
     * @inner
     * @param {module:echarts/coord/*} coordSys
     * @param {module:echarts/model/Series} seriesModel
     * @param {module:echarts/model/Model} mpModel
     */
    function createList(coordSys, seriesModel, mlModel) {

        var coordDimsInfos;
        if (coordSys) {
            coordDimsInfos = zrUtil.map(coordSys && coordSys.dimensions, function (coordDim) {
                var info = seriesModel.getData().getDimensionInfo(
                    seriesModel.coordDimToDataDim(coordDim)[0]
                ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys
                info.name = coordDim;
                return info;
            });
        }
        else {
            coordDimsInfos =[{
                name: 'value',
                type: 'float'
            }];
        }

        var fromData = new List(coordDimsInfos, mlModel);
        var toData = new List(coordDimsInfos, mlModel);
        // No dimensions
        var lineData = new List([], mlModel);

        var optData = zrUtil.map(mlModel.get('data'), zrUtil.curry(
            markLineTransform, seriesModel, coordSys, mlModel
        ));
        if (coordSys) {
            optData = zrUtil.filter(
                optData, zrUtil.curry(markLineFilter, coordSys)
            );
        }
        var dimValueGetter = coordSys ? markerHelper.dimValueGetter : function (item) {
            return item.value;
        };
        fromData.initData(
            zrUtil.map(optData, function (item) { return item[0]; }),
            null, dimValueGetter
        );
        toData.initData(
            zrUtil.map(optData, function (item) { return item[1]; }),
            null, dimValueGetter
        );
        lineData.initData(
            zrUtil.map(optData, function (item) { return item[2]; })
        );
        lineData.hasItemOption = true;
        return {
            from: fromData,
            to: toData,
            line: lineData
        };
    }


text:
import Ansi from "../src/index";
import * as React from "react";
import { configure, shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";

configure({ adapter: new Adapter() });

const GREEN_FG = "\u001b[32m";
const YELLOW_BG = "\u001b[43m";
const RESET = "\u001b[0;m";

describe("Ansi", () => {
  test("hello world", () => {
    const el = shallow(React.createElement(Ansi, null, "hello world"));
    expect(el).not.toBeNull();
    expect(el.text()).toBe("hello world");
  });

  test("can color", () => {
    const el = shallow(
      React.createElement(Ansi, null, `hello ${GREEN_FG}world`)
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("hello world");
    expect(el.html()).toBe(
      'hello world'
    );
  });

  test("can have className", () => {
    const el = shallow(
      React.createElement(Ansi, { className: "my-class" }, `hello world`)
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("hello world");
    expect(el.html()).toBe(
      'hello world'
    );
  });

  test("can nest", () => {
    const el = shallow(
      React.createElement(
        Ansi,
        null,
        `hello ${GREEN_FG}wo${YELLOW_BG}rl${RESET}d`
      )
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("hello world");
    expect(el.html()).toBe(
      'hello world'
    );
  });

  test("can handle carriage symbol", () => {
    const el = shallow(
      React.createElement(
        Ansi,
        null,
        "this sentence\rthat\nwill make you pause"
      )
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("that sentence\nwill make you pause");
  });

  test("can linkify", () => {
    const el = shallow(
      React.createElement(
        Ansi,
        { linkify: true },
        "this is a link: https://nteract.io/"
      )
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("this is a link: https://nteract.io/");
    expect(el.html()).toBe(
      'this is a link: https://nteract.io/'
    );
  });

  test("can distinguish URL-ish text", () => {
    const el = shallow(
      React.createElement(
        Ansi,
        { linkify: true },
        "<transport.model.TransportInfo"
      )
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe("<transport.model.TransportInfo");
  });

  test("can distinguish URL-ish text", () => {
    const el = shallow(
      React.createElement(
        Ansi,
        { linkify: true },
        "<module 'something' from '/usr/local/lib/python2.7/dist-packages/something/__init__.pyc'>"
      )
    );
    expect(el).not.toBeNull();
    expect(el.text()).toBe(
      "<module 'something' from '/usr/local/lib/python2.7/dist-packages/something/__init__.pyc'>"
    );
  });
});

redpajama_set_name: RedPajamaGithub


text:
package org.onosproject.drivers.utilities;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.junit.Before;
import org.junit.Test;
import org.onlab.packet.IpAddress;
import org.onosproject.net.behaviour.ControllerInfo;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.junit.Assert.*;

/**
 * Tests for the XMLYangUtils.
 */
public class YangXmlUtilsTest {
    public static final String OF_CONFIG_XML_PATH = "/of-config/of-config.xml";
    private YangXmlUtilsAdap utils;
    private XMLConfiguration testCreateConfig;

    @Before
    public void setUp() throws Exception {
        assertTrue("No resource for test", YangXmlUtilsTest.class.
                getResourceAsStream("/of-config/of-config.xml") != null);
        utils = new YangXmlUtilsAdap();

        testCreateConfig = new XMLConfiguration();
    }

    /**
     * Tests getting a single object configuration via passing the path and the map of the desired values.
     *
     * @throws ConfigurationException if the testing xml file is not there.
     */
    @Test
    public void testGetXmlUtilsInstance() throws ConfigurationException {

        YangXmlUtils instance1 = YangXmlUtils.getInstance();
        YangXmlUtils instance2 = YangXmlUtils.getInstance();

        assertEquals("Duplicate instance", instance1, instance2);

    }

    private String canonicalXml(String s) {
        String[] lines = s.split("\n");
        StringBuilder xml = new StringBuilder();
        for (String line : lines) {
            if (line.contains("<")) {
                xml.append(line);
                xml.append("\n");
            }
        }
        return xml.toString().trim();
    }

    /**
     * Tests getting a single object configuration via passing the path and the map of the desired values.
     *
     * @throws ConfigurationException if the testing xml file is not there.
     */
    @Test
    public void testGetXmlConfigurationFromMap() throws ConfigurationException {
        Map<String, String> pathAndValues = new HashMap<>();
        pathAndValues.put("capable-switch.id", "openvswitch");
        pathAndValues.put("switch.id", "ofc-bridge");
        pathAndValues.put("controller.id", "tcp:1.1.1.1:1");
        pathAndValues.put("controller.ip-address", "1.1.1.1");
        XMLConfiguration cfg = utils.getXmlConfiguration(OF_CONFIG_XML_PATH, pathAndValues);
        testCreateConfig.load(getClass().getResourceAsStream("/testCreateSingleYangConfig.xml"));
        assertNotEquals("Null testConfiguration", new XMLConfiguration(), testCreateConfig);

        assertEquals("Wrong configuaration", IteratorUtils.toList(testCreateConfig.getKeys()),
                     IteratorUtils.toList(cfg.getKeys()));

        assertEquals("Wrong string configuaration", canonicalXml(utils.getString(testCreateConfig)),
                     canonicalXml(utils.getString(cfg)));
    }

    /**
     * Tests getting a multiple object nested configuration via passing the path
     * and a list of YangElements containing with the element and desired value.
     *
     * @throws ConfigurationException
     */
    @Test
    public void getXmlConfigurationFromYangElements() throws ConfigurationException {

        assertNotEquals("Null testConfiguration", new XMLConfiguration(), testCreateConfig);
        testCreateConfig.load(getClass().getResourceAsStream("/testYangConfig.xml"));
        List<YangElement> elements = new ArrayList<>();
        elements.add(new YangElement("capable-switch", ImmutableMap.of("id", "openvswitch")));
        elements.add(new YangElement("switch", ImmutableMap.of("id", "ofc-bridge")));
        List<ControllerInfo> controllers =
                ImmutableList.of(new ControllerInfo(IpAddress.valueOf("1.1.1.1"), 1, "tcp"),
                                 new ControllerInfo(IpAddress.valueOf("2.2.2.2"), 2, "tcp"));
        controllers.forEach(cInfo -> {
            elements.add(new YangElement("controller", ImmutableMap.of("id", cInfo.target(),
                                                                       "ip-address", cInfo.ip().toString())));
        });
        XMLConfiguration cfg =
                new XMLConfiguration(YangXmlUtils.getInstance()
                                             .getXmlConfiguration(OF_CONFIG_XML_PATH, elements));
        assertEquals("Wrong configuaration", IteratorUtils.toList(testCreateConfig.getKeys()),
                     IteratorUtils.toList(cfg.getKeys()));
        assertEquals("Wrong string configuaration", canonicalXml(utils.getString(testCreateConfig)),
                     canonicalXml(utils.getString(cfg)));
    }

    /**
     * Test reading an XML configuration and retrieving the requested elements.
     *
     * @throws ConfigurationException
     */
    @Test
    public void testReadLastXmlConfiguration() throws ConfigurationException {
        testCreateConfig.load(getClass().getResourceAsStream("/testYangConfig.xml"));
        List<YangElement> elements = utils.readXmlConfiguration(testCreateConfig,
                                                                "controller");
        List<YangElement> expected = ImmutableList.of(
                new YangElement("controller", ImmutableMap.of("id", "tcp:1.1.1.1:1",
                                                              "ip-address", "1.1.1.1")),
                new YangElement("controller", ImmutableMap.of("id", "tcp:2.2.2.2:2",
                                                              "ip-address", "2.2.2.2")));
        assertEquals("Wrong elements collected", expected, elements);
    }

    /**
     * Test reading an XML configuration and retrieving the requested elements.
     *
     * @throws ConfigurationException
     */
    @Test
    public void testReadNestedXmlConfiguration() throws ConfigurationException {
        testCreateConfig.load(getClass().getResourceAsStream("/testYangConfig.xml"));
        List<YangElement> elements = utils.readXmlConfiguration(testCreateConfig, "controllers");
        List<YangElement> expected = ImmutableList.of(
                new YangElement("controllers", ImmutableMap.of("controller.id", "tcp:1.1.1.1:1",
                                                               "controller.ip-address", "1.1.1.1")),
                new YangElement("controllers", ImmutableMap.of("controller.id", "tcp:2.2.2.2:2",
                                                               "controller.ip-address", "2.2.2.2")));
        assertEquals("Wrong elements collected", expected, elements);
    }

    //enables to change the path to the resources directory.
    private class YangXmlUtilsAdap extends YangXmlUtils {

        @Override
        protected InputStream getCfgInputStream(String file) {
            return YangXmlUtilsAdap.class.getResourceAsStream(file);
        }
    }
}


text:
using namespace RISE;
using namespace RISE::Implementation;

#define ENABLE_MAX_RECURSION

GlobalSpectralPhotonTracer::GlobalSpectralPhotonTracer(
	const unsigned int maxR,					///< [in] Maximum recursion depth
	const Scalar ext,							///< [in] Minimum importance for a photon before extinction
	const Scalar nm_begin_,						///< [in] Wavelength to start shooting photons at
	const Scalar nm_end_,						///< [in] Wavelength to end shooting photons at
	const unsigned int num_wavelengths_,		///< [in] Number of wavelengths to shoot photons at
	const bool useiorstack,						///< [in] Should we use an ior stack ?
	const bool branch,							///< [in] Should the tracer branch or only follow one path?
	const Scalar powerscale,
	const unsigned int temporal_samples,
	const bool regenerate
	) :
  SpectralPhotonTracer<GlobalSpectralPhotonMap>( nm_begin_, nm_end_, num_wavelengths_, useiorstack, powerscale, temporal_samples, regenerate ),
  nMaxRecursions( maxR ),
  dExtinction( ext ),
  bBranch( branch )
{
}

GlobalSpectralPhotonTracer::~GlobalSpectralPhotonTracer( )
{
}

void GlobalSpectralPhotonTracer::TracePhoton(
	const Ray& ray,
	const Scalar power,
	const Scalar nm,
	bool bStorePhoton,
	GlobalSpectralPhotonMap& pPhotonMap,
	const IORStack* const ior_stack								///< [in/out] Index of refraction stack
	) const
{
	static unsigned int		numRecursions = 0;

#ifdef ENABLE_MAX_RECURSION
	if( numRecursions > nMaxRecursions )
	{
#ifdef ENABLE_TERMINATION_MESSAGES
		GlobalLog()->PrintEasyInfo( "FORCED RECURSION TERMINATION" );
#endif
		return;
	}
#endif

	if( power < dExtinction )
	{
#ifdef ENABLE_TERMINATION_MESSAGES
		GlobalLog()->PrintEasyInfo( "PHOTON BECAME EXTINCT :(" );
#endif
		return;
	}

	numRecursions++;

	// Cast the ray into the scene
	RayIntersection	ri( ray, nullRasterizerState );
	Vector3Ops::NormalizeMag(ri.geometric.ray.dir);
	pScene->GetObjects()->IntersectRay( ri, true, true, false );

	if( ri.geometric.bHit )
	{
		// If there is an intersection modifier, then get it to modify
		// the intersection information
		if( ri.pModifier ) {
			ri.pModifier->Modify( ri.geometric );
		}

		// Set the current object on the IOR stack
		if( ior_stack ) {
			ior_stack->SetCurrentObject( ri.pObject );
		}

		ISPF* pSPF = ri.pMaterial->GetSPF();

		if( pSPF )
		{
			// Get information from the material as to what to do
			ScatteredRayContainer		scattered;

			pSPF->ScatterNM( ri.geometric, random, nm, scattered, ior_stack );

			bool bDiffuseComponentAvailable = false;
			for( unsigned int i=0; i<scattered.Count(); i++ ) {
				ScatteredRay& scat = scattered[i];
				if( scat.type==ScatteredRay::eRayDiffuse ) {
					bDiffuseComponentAvailable = true;
					break;
				}
			}

			if( bDiffuseComponentAvailable && bStorePhoton ) {
				pPhotonMap.Store( power, nm, ri.geometric.ptIntersection, -ray.dir );
			}

			if( bBranch ) {
				for( unsigned int i=0; i<scattered.Count(); i++ ) {
					ScatteredRay& scat = scattered[i];
					scat.ray.Advance( 1e-8 );
					TracePhoton( scat.ray, power*scat.krayNM, nm, scat.type==ScatteredRay::eRayDiffuse, pPhotonMap, scat.ior_stack?scat.ior_stack:ior_stack );
				}
			} else {
				ScatteredRay* pScat = scattered.RandomlySelect( random.CanonicalRandom(), true );
				if( pScat ) {
					pScat->ray.Advance( 1e-8 );
					TracePhoton( pScat->ray, power*pScat->krayNM, nm, pScat->type==ScatteredRay::eRayDiffuse, pPhotonMap, pScat->ior_stack?pScat->ior_stack:ior_stack );
				}
			}
		}
	}

	// If there was no hit then the photon just got ejected into space!

	numRecursions--;
}


text:
{{<layout}}

{{$pageTitle}} Add your medication {{/pageTitle}}

{{$head}}
	{{>includes/head}}
	{{>includes/scripts}}
{{/head}}

{{$content}}
{{>includes/buttons/no-back-phase-banner}}

            {{>includes/errors/summary-medication}}

Add  medication

            Only add one medication per page

			<form class="form">

					<legend></legend>

						Medication name

Provide your medication name

                    <input class="form-control" id="medicationname" name="medication" type="text" value="" autocomplete="off" autocorrect="off" spellcheck="false">

					<fieldset>
						<legend class="visuallyhidden">Medication start date</legend>

								Start date
								For example, 31 3 2015
                                Provide a valid medication start date

								Day
								<input class="form-control" id="startday" name="startday" type="number" pattern="[0-9]*" min="1" max="31">

								Month
								<input class="form-control" id="startmonth" name="startmonth" type="number" pattern="[0-9]*" min="1" max="12">

								Year
								<input class="form-control" id="startyear" name="startyear" type="number" pattern="[0-9]*" min="1900">

					</fieldset>

Are you still taking this medication?

                    Tell us whether you are still taking this medication

					<fieldset class="inline">
						<legend class="visuallyhidden">Are you still taking this medication?</legend>

							<input id="FEP8-a1" type="radio" name="FEP8" value="Y">
							Yes

							<input id="FEP8-a2" type="radio" name="FEP8" value="N">
							No

					</fieldset>

					<fieldset id="FEP8B" class="panel panel-border-narrow" style="display: none;">

When did you stop taking this medication?

							<legend class="visuallyhidden">Medication stop date</legend>
                            Provide a valid medication end date

								Day
								<input class="form-control" id="endday" name="endday" type="number" pattern="[0-9]*" min="1" max="31">

								Month
								<input class="form-control" id="endmonth" name="endmonth" type="number" pattern="[0-9]*" min="1" max="12">

								Year
								<input class="form-control" id="endyear" name="endyear" type="number" pattern="[0-9]*" min="1900">

					</fieldset>

					<input id="continue" name="continue" class="button" type="button" value="Add this medication" onclick="validate()">

				Cancel
			</form>

		{{>includes/widgets/need-help}}

{{/content}}

{{/layout}}


text:
from setuptools import find_packages, setup

import os
import sys

import pygrametl

setup(
    name='pygrametl',
    version=pygrametl.__version__,
    author='Aalborg University',
    author_email='pygrametl@cs.aau.dk',
    packages=find_packages(),
    package_data={
        'pygrametl': [
            'jythonsupport/Value.class',
            'jythonsupport/Value.java']},
    url='http://pygrametl.org/',
    license='BSD',
    description='ETL programming in Python',
    long_description=open('README.rst').read(),
    long_description_content_type="text/x-rst",
    classifiers=[
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'License :: OSI Approved :: BSD License',
                'Programming Language :: Java',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Topic :: Database',
                'Topic :: Database :: Front-Ends',
                'Topic :: Software Development',
                'Topic :: Software Development :: Libraries :: Python Modules',
                'Topic :: Software Development :: Libraries :: Application '
                'Frameworks'],
    entry_points={
        'console_scripts': [
            'dttr = pygrametl.drawntabletesting.dttr:main']
   }
)


text:
import * as std from "../../index";

export function rand_bool(): boolean {
    return Math.random() < 0.5 ? false : true;
}

export function test_vector_bools() {
    _Test_vector_bool_elements_io();
    _Test_vector_bool_flip();
}

/* ---------------------------------------------------------
    ELEMENTS I/O
--------------------------------------------------------- */
function _Test_vector_bool_elements_io() {
    const v: std.Vector<boolean> = new std.Vector();
    const d: std.Deque<boolean> = new std.Deque();
    const l: std.List<boolean> = new std.List();
    const vb: std.VectorBoolean = new std.VectorBoolean();

    //----
    // PARTIAL TESTS
    //----
    // INITIALIZE WITH 10 FALSES
    _Modify_bool_containers(vb, v, d, l, function (obj) {
        obj.assign(10, false);
    });

    // REPEAT INSERTIONS
    for (let i: number = 0; i < 100; ++i) {
        const pos: number = std.randint(0, v.size());
        const size: number = std.randint(1, 10);
        const value: boolean = rand_bool();

        _Modify_bool_containers(vb, v, d, l, function (obj) {
            obj.insert(std.advance(obj.begin(), pos), size, value);
        });
        _Validate_bool_containers(vb, v, d, l);
    }

    // REPEAT DELETIONS
    for (let i: number = 0; i < 100; ++i) {
        const first: number = std.randint(0, v.size() - 1);
        const last: number = std.randint(first + 1, v.size());

        _Modify_bool_containers(vb, v, d, l, function (obj) {
            obj.erase(
                std.advance(obj.begin(), first),
                std.advance(obj.begin(), last),
            );
        });
        _Validate_bool_containers(vb, v, d, l);
    }

    //----
    // REPEATED INSERTIONS & DELETIONS KEEPING SIZE
    //----
    // ASSIGN 10 FLAGS
    const initial_value: boolean = rand_bool();

    _Modify_bool_containers(vb, v, d, l, function (obj) {
        obj.assign(100, initial_value);
    });

    // CHANGE VALUES RANDOMLY
    for (let i: number = 0; i < 100; ++i) {
        const index: number = std.randint(0, 99);
        const value: boolean = rand_bool();

        _Modify_bool_containers(vb, v, d, l, function (obj) {
            std.advance(obj.begin(), index).value = value;
        });
        _Validate_bool_containers(vb, v, d, l);
    }

    // MASS DELETIONS AND INSERTIONS KEEPING SIZE
    for (let i: number = 0; i < 100; ++i) {
        // ERASE ELEMENTS
        const first_index: number = std.randint(0, v.size() - 1);
        const last_index: number = std.randint(first_index + 1, v.size());

        if (v.empty() || first_index >= last_index) continue;

        _Modify_bool_containers(vb, v, d, l, function (obj) {
            obj.erase(
                std.advance(obj.begin(), first_index),
                std.advance(obj.begin(), last_index),
            );
        });

        // INSERT ELEMENTS
        const index: number = std.randint(0, v.size());
        const size: number = last_index - first_index;
        const value: boolean = rand_bool();

        _Modify_bool_containers(vb, v, d, l, function (obj) {
            obj.insert(std.advance(obj.begin(), index), size, value);
        });
        _Validate_bool_containers(vb, v, d, l);
    }
}

function _Validate_bool_containers(
    vb: std.VectorBoolean,
    v: std.Vector<boolean>,
    d: std.Deque<boolean>,
    l: std.List<boolean>,
): void {
    for (const container of [v, d, l])
        if (
            vb.size() !== container.size() ||
            std.equal(vb.begin(), vb.end(), container.begin()) === false
        )
            throw new Error(
                `Bug on ${vb.constructor.name}: different elements are stored with ${container.constructor.name}`,
            );
}

function _Modify_bool_containers(
    vb: std.VectorBoolean,
    v: std.Vector<boolean>,
    d: std.Deque<boolean>,
    l: std.List<boolean>,
    func: (
        container: std.base.ILinearContainer<boolean, any, any, any, boolean>,
    ) => void,
): void {
    func(v);
    func(d);
    func(l);
    func(vb);
}

/* ---------------------------------------------------------
    FLIP
--------------------------------------------------------- */
function _Test_vector_bool_flip() {
    const vb = new std.VectorBoolean();
    for (let i: number = 0; i < 100; ++i) vb.push_back(rand_bool());

    const cpy = new std.VectorBoolean(vb);
    cpy.flip();

    const valid = std.equal(
        vb.begin(),
        vb.end(),
        cpy.begin(),
        std.not_equal_to,
    );
    if (valid === false)
        throw new std.DomainError(`Bug on std.${vb.constructor.name}.flip().`);
}


text:
package com.capitalone.dashboard.repository;

import com.capitalone.dashboard.model.Component;
import com.capitalone.dashboard.model.Dashboard;
import com.capitalone.dashboard.model.Owner;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Collection;
import java.util.List;

/**
 * {@link Dashboard} repository.
 */
public interface DashboardRepository extends PagingAndSortingRepository<Dashboard, ObjectId> {

	List<Dashboard> findByOwner(String owner);
	List<Dashboard> findByOwners(Owner owner);
	List<Dashboard> findByTitle(String title);
	Dashboard findByTitleAndType(String title, String type);

    List<Dashboard> findByApplicationComponentsIn(Collection<Component> components);

	@Query(value="{'type': {$in : [null, 'Team']}}")
	List<Dashboard> findTeamDashboards();

	@Query(value="{'widgets.options.teams.collectorItemId': ?0 }")
	List<Dashboard> findProductDashboardsByTeamDashboardCollectorItemId(String teamDashboardCollectorItemId);

	Iterable<Dashboard> findAllByConfigurationItemBusServObjectId(ObjectId appObjectId);
	Iterable<Dashboard> findAllByConfigurationItemBusServObjectIdIn(Iterable<ObjectId> busServiceObjectIdList);
	Iterable<Dashboard> findAllByConfigurationItemBusAppObjectId(ObjectId compObjectId);
	Iterable<Dashboard> findAllByConfigurationItemBusServObjectIdAndConfigurationItemBusAppObjectId(ObjectId appObjectId, ObjectId compObjectId);

	Dashboard findByConfigurationItemBusServObjectIdAndConfigurationItemBusAppObjectId(ObjectId appObjectId, ObjectId compObjectId);

}


text:
package com.vinkel.remindmewheniamthere.utils;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.SystemClock;
import com.vinkel.remindmewheniamthere.background.receivers.ReminderReceiver;
import com.vinkel.remindmewheniamthere.config.di.annotations.UnscopedIntentFactory;
import com.vinkel.remindmewheniamthere.providers.base.IIntentFactory;
import com.vinkel.remindmewheniamthere.utils.base.IReminderManager;
import java.util.Calendar;
import javax.inject.Inject;

public class ReminderManager implements IReminderManager {
  public static final String EXTRA_REMINDER_ID_KEY = "ALARM_ID";

  private final AlarmManager alarmManager;
  private final IIntentFactory intentFactory;

  @Inject
  public ReminderManager(AlarmManager alarmManager, @UnscopedIntentFactory IIntentFactory intentFactory) {
    this.alarmManager = alarmManager;
    this.intentFactory = intentFactory;
  }

  public void setReminder(Calendar time, int alarmId) {
    Intent intent = this.intentFactory.getIntent(ReminderReceiver.class);
    intent.putExtra(EXTRA_REMINDER_ID_KEY, (int)(long) alarmId);
    PendingIntent pendingIntent = this.intentFactory.getBroadcastPendingIntent((int)(long) alarmId, intent, PendingIntent.FLAG_CANCEL_CURRENT);

    Calendar currentCalendar = Calendar.getInstance();
    long currentTime = currentCalendar.getTimeInMillis();
    long deltaTime = time.getTimeInMillis() - currentTime;

    this.alarmManager.set(
        AlarmManager.ELAPSED_REALTIME,
        SystemClock.elapsedRealtime() + deltaTime,
        pendingIntent);

  }

  public void cancelReminder(int alarmId) {
    Intent intentToCancel = this.intentFactory.getIntent(ReminderReceiver.class);
    PendingIntent cancelIntent = intentFactory.getBroadcastPendingIntent(alarmId, intentToCancel, 0);

    this.alarmManager.cancel(cancelIntent);
  }
}


text:
<?php
# $Id$
# PHPlot test: Stacked Bars with zero segments - case 5
# This is a parameterized test. See the script named at the bottom for details.
$horizontal = True;
$shading = 0;
require_once 'stackedbarzero.php';


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

		<title>RNAstructure Command Line Help</title><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<link href="Stylesheet.css" rel="stylesheet" type="text/css">

RNAstructure Command Line Help

					Version 5.8

Contents

Index

RNAstructure is a product of the Mathews Lab, University of Rochester Medical Center, Department of Biochemistry and Biophysics.

Continued development of RNAstructure is made possible by the support of NIH grant R01GM076485.

General Help

Instructions for building the text interfaces

General instructions for specifying thermodynamic parameters

I/O file formats

Common pathways for analysis, i.e. how the programs work together

Specific Interface Help

AccessFold

Bimolecular
folding of nucleic acids without intramolecular pairs allowed. This
program uses a heuristic to determine accessibility to to duplex
formation.

AllSub

Generate all suboptimal nucleic acid structures within a small free energy increment of the lowest free energy structure.

bifold and bifold-smp

Bimolecular folding of nucleic acids with intramolecular pairs allowed.

bipartition and bipartition-smp

Bimolecular partition function calculation of nucleic acids without intramolecular pairs allowed.

CircleCompare

Compare
two structures for the same sequence, with the nucleic acid backbone
arranged around a circle to facilitate easy comparisons.

ct2dot

Generate a dot bracket file from a CT file. The CT file can be regenerated from the dot bracket file using dot2ct (below).

design

Find an RNA (or DNA) sequence that is expected to fold into a given structure.

dot2ct

Generate a CT file from a dot bracket file. The dot bracket file can be regenerated from the CT file using ct2dot (above).

draw

Draw
a structure (or structures) in Postscript from a CT file. This can be
done a variety of ways: annotated, unannotated, circularized, or a
combination of these.

DuplexFold

Bimolecular folding of nucleic acids without intramolecular pairs allowed.

dynalign_ii, dynalign, dynalign_ii-smp, and dynalign-smp

Find a secondary structure common to two sequences.

DynalignDotPlot

Generate a free energy dot plot from a Dynalign calculation, exported as a Postscript file.

efn2 (Energy Function 2) and efn2-smp

Determine the folding free energy change of a structure.

EnergyPlot

Generate a free energy dot plot from a folding calculation save file, exported as a Postscript file.

EnsembleEnergy

Calculate the ensemble energy of structures from base pair probabilities or sequence data.

Fold and Fold-smp

Predict the lowest free energy structure for a nucleic acid sequence, as well as a set of low free energy structures.

Fold-cuda

Predict the lowest free energy structure for a nucleic acid sequence, in parallel using a GPU.

MaxExpect

Predict the maximum expected accuracy structure for a nucleic acid sequence.

multifind

Find non-coding RNAs in sequence alignments.

multilign

Find secondary structures common to multiple sequences (more than two).

NAPSS

Use NMR data to improve the prediction of an RNA secondary structure.

oligoscreen and oligoscreen-smp

Determine folding thermodynamics for a set of oligonucleotides.

OligoWalk

Calculate
thermodynamic features of sense-antisense hybridization and predict
free energy changes of oligonucleotides binding to target RNA.

partition and partition-smp

Predict nucleic acid base pairing probabilities using a partition function.

partition-cuda

Predict nucleic acid base pairing probabilities using a partition function in parallel using a GPU.

PARTS

Find
a secondary structure common to two nucleic acid sequences, a sample of
those structures, and/or the probability of pairing for common base
pairs.

phmm

Predict the probablistic alignment between two RNA sequences.

ProbabilityPlot

Generate a base pairing probabilities dot plot from a partition function save file, exported as a Postscript file.

ProbablePair

Predict
structures from base pair probabilities, using a threshold to include
only pairs within a specific range of probabilities.

ProbKnot

Predict a maximum expected accuracy structure, including pseudoknots.

ProbScan

Calculate the probabilities of loops or helix stacks.

refold

Use a save file to predict a new set of suboptimal structures.

RemovePseudoknots

Remove pseudoknots from an RNA structure, outputting the most likely pseudoknot-free structure.

scorer

Calculate sensitivity and positive predictive value for two structures being compared.

ShapeKnots

Predict a secondary structure that can contains pseudoknots, restrained by SHAPE mapping data.

stochastic and stochastic-smp

Generate a representative ensemble of structures.

TurboFold

Fold multiple sequences into their optimal conformations, using one of three different folding modes.

Visit The Mathews Lab RNAstructure Page for updates and latest information.


text:
class UserMailer < ApplicationMailer
  default from: 'qb@kittenkaboodleshow.com'

  def welcome_email(user)
    @user = user
    @url = 'http://kittenkaboodleshow.com/kaboodleme'
    mail(to: @user.email, subject: 'Welcome to Kittopia, Kittizen! - KaboodleMe App')
  end
end


text:
#import "MaterialCell.h"
#import <FontAwesome+iOS/NSString+FontAwesome.h>
#import <FontAwesome+iOS/UIFont+FontAwesome.h>

@interface MaterialCell()

@property (weak, nonatomic) IBOutlet UILabel *materialLabel;
@property (weak, nonatomic) IBOutlet UILabel *chevronRight;

@end

@implementation MaterialCell

-(void)updateMaterial:(Material *)material {
    self.material = material;
    self.materialLabel.text = material.title;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.chevronRight.font = [UIFont fontAwesomeFontOfSize:17.0];
    self.chevronRight.text = [NSString fontAwesomeIconStringForEnum:FAIconChevronRight];
}

@end


text:
import React from 'react'

// const timeline = [{
//   time: 0,
//   fact: ''
// }]
//

export default function AnotherParachuteEnding() {
  return (

  )
}


text:
* [Manual Web](https://docs.google.com/document/d/1oLTunMPyFFdjQRuCJUCrbmxJz8Tfk2TBaextgsT12DQ/edit?usp=sharing,"Manual Web")
* [Manual Móvil](https://docs.google.com/document/d/1N36pVaTo6nKYtzKe7_2Fe0CTbm0Sphp4cmHtfuP5w2E/edit?usp=sharing,"Manual Móvil")

## Demo
* [Demo Web Usuarios](http://forestapp.appjota.com/)
* [Demo Web Administrador](http://adminforestapp.appjota.com/)
* [APK App Usuarios](https://github.com/fabmost/RetoForestal/blob/master/Apps/FORESTAPP.apk)
* [APK App Agente de PROFEPA](https://github.com/fabmost/RetoForestal/blob/master/Apps/PROFEPA.apk)

## Documentación

### Cronograma (Descargar para poder visualizarlo mejor)
[Enlace de Google Drive](https://drive.google.com/file/d/0B3zEsL35AGAkVHFhaFdpYnlfZTQ/view?usp=sharing,"Cronograma")

### ERS
[Enlace de Google Drive](https://docs.google.com/document/d/1c9fw1120S_Qo9hihBXNFbNGeULCRGEVC2H-w0frDi14/edit?usp=sharing,"ERS")

### Plan de Trabajo
[Enlace de Google Drive](https://docs.google.com/document/d/13n8vHyOQ0m_PPLuKcZsVvkE5MepcFgO5Vg4ru7hqknk/edit?usp=sharing,"Pan de Trabajo")

### Video Promocional
[Enlace de Youtube](https://youtu.be/gf9ILj9WFeo)

## Clicky
| Misión     | Visión    | Valores |
|------------|-----------|---------|
|Crear Software para facilitar y mejorar la vida de las personas, brindando herramientas inteligentes que estén a la vanguardia de la tecnología.| Difundir e implementar soluciones tecnológicas para los problemas de hoy y necesidades del mañana.|Equidad, Inclusión, Innovación, Compromiso, Adaptabilidad, Responsabilidad y sobre todo Profesionalismo.|

### Reconocimientos
* Mención Honorífica y Ganadores del Reto 'Mi Policia' Hack CDMX 2015
* Premio del Público TheAppDateAwards 2015
* Finalistas Hack CDMX 2014

### RFC y Carta Bajo Protesta
[Enlace de Google Drive](https://drive.google.com/open?id=0B4d_GAiVrlp3fnF3WVlnMXBZR3NQdmFiTmQtOUFFSDBDaWF3R0JucG9uRXNQdVp6T0NVMGM&authuser=0,"RFC y Carta Bajo Protesta")

## LICENSE
FORESTAPP is an open-sourced software licensed under the [Apache License](https://github.com/fabmost/RetoForestal/blob/master/LICENSE,"Apache License")


text:
package org.trafodion.rest;

import java.io.*;
import java.util.*;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.CacheControl;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.ResponseBuilder;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.trafodion.rest.Constants;
import org.trafodion.rest.util.Bytes;
import org.trafodion.rest.RestConstants;

@Path("/")
public class RootResource extends ResourceBase {
	private static final Log LOG = LogFactory.getLog(RootResource.class);

	static CacheControl cacheControl;
	static {
		cacheControl = new CacheControl();
		cacheControl.setNoCache(true);
		cacheControl.setNoTransform(false);
	}

	public RootResource() throws IOException {
		super();
	}

	@Path("/v1/servers")
	public ServerResource getServerResource() throws IOException {
		//To test:
		//curl -v -L -k -X GET -H "Accept: application/json" http://<Rest server IP address>:8080/v1/servers
		//
		return new ServerResource();
	}

  @Path("/v1/transactions")
   public TransactionsResource getTransactionsTm() throws IOException {
       //To test:
       //curl -v -L -k -X GET -H "Accept: application/json" http://<Rest server IP address>:8080/v1/transactions
       //
       return new TransactionsResource();
   }

   @Path("/v1/version")
   public VersionResource getVersionResource() throws IOException {
       //To test:
       //curl -v -L -k -X GET -H "Accept: application/json" http://<Rest server IP address>:8080/v1/version
       //
       return new VersionResource();
   }

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
G. bot. ital. , n. s. 2(7-8): 44 (1847)

#### Original name
Hysterium melaleucum Fr., 1815

### Remarks
null


text:
package com.rozdoum.socialcomponents.main.interactors;

import android.content.Context;

import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.MutableData;
import com.google.firebase.database.Transaction;
import com.google.firebase.database.ValueEventListener;
import com.rozdoum.socialcomponents.ApplicationHelper;
import com.rozdoum.socialcomponents.managers.DatabaseHelper;
import com.rozdoum.socialcomponents.managers.listeners.OnDataChangedListener;
import com.rozdoum.socialcomponents.managers.listeners.OnTaskCompleteListener;
import com.rozdoum.socialcomponents.model.Comment;
import com.rozdoum.socialcomponents.utils.LogUtil;

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

/**
 * Created by Alexey on 05.06.18.
 */

public class CommentInteractor {

    private static final String TAG = CommentInteractor.class.getSimpleName();
    private static CommentInteractor instance;

    private DatabaseHelper databaseHelper;
    private Context context;

    public static CommentInteractor getInstance(Context context) {
        if (instance == null) {
            instance = new CommentInteractor(context);
        }

        return instance;
    }

    private CommentInteractor(Context context) {
        this.context = context;
        databaseHelper = ApplicationHelper.getDatabaseHelper();
    }

    public void createComment(String commentText, final String postId, final OnTaskCompleteListener onTaskCompleteListener) {
        try {
            String authorId = FirebaseAuth.getInstance().getCurrentUser().getUid();
            DatabaseReference mCommentsReference = databaseHelper.getDatabaseReference().child(DatabaseHelper.POST_COMMENTS_DB_KEY + "/" + postId);
            String commentId = mCommentsReference.push().getKey();
            Comment comment = new Comment(commentText);
            comment.setId(commentId);
            comment.setAuthorId(authorId);

            mCommentsReference.child(commentId).setValue(comment, new DatabaseReference.CompletionListener() {
                @Override
                public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
                    if (databaseError == null) {
                        incrementCommentsCount(postId);
                    } else {
                        LogUtil.logError(TAG, databaseError.getMessage(), databaseError.toException());
                    }
                }

                private void incrementCommentsCount(String postId) {
                    DatabaseReference postRef = databaseHelper.getDatabaseReference().child(DatabaseHelper.POSTS_DB_KEY + "/" + postId + "/commentsCount");
                    postRef.runTransaction(new Transaction.Handler() {
                        @Override
                        public Transaction.Result doTransaction(MutableData mutableData) {
                            Integer currentValue = mutableData.getValue(Integer.class);
                            if (currentValue == null) {
                                mutableData.setValue(1);
                            } else {
                                mutableData.setValue(currentValue + 1);
                            }

                            return Transaction.success(mutableData);
                        }

                        @Override
                        public void onComplete(DatabaseError databaseError, boolean b, DataSnapshot dataSnapshot) {
                            LogUtil.logInfo(TAG, "Updating comments count transaction is completed.");
                            if (onTaskCompleteListener != null) {
                                onTaskCompleteListener.onTaskComplete(true);
                            }
                        }
                    });
                }
            });
        } catch (Exception e) {
            LogUtil.logError(TAG, "createComment()", e);
        }
    }

    public void updateComment(String commentId, String commentText, String postId, final OnTaskCompleteListener onTaskCompleteListener) {
        DatabaseReference mCommentReference = databaseHelper.getDatabaseReference().child(DatabaseHelper.POST_COMMENTS_DB_KEY).child(postId).child(commentId).child("text");
        mCommentReference.setValue(commentText).addOnSuccessListener(aVoid -> {
            if (onTaskCompleteListener != null) {
                onTaskCompleteListener.onTaskComplete(true);
            }
        }).addOnFailureListener(e -> {
            if (onTaskCompleteListener != null) {
                onTaskCompleteListener.onTaskComplete(false);
            }
            LogUtil.logError(TAG, "updateComment", e);
        });
    }

    public void decrementCommentsCount(String postId, final OnTaskCompleteListener onTaskCompleteListener) {
        DatabaseReference postRef = databaseHelper
                .getDatabaseReference()
                .child(DatabaseHelper.POSTS_DB_KEY + "/" + postId + "/commentsCount");
        postRef.runTransaction(new Transaction.Handler() {
            @Override
            public Transaction.Result doTransaction(MutableData mutableData) {
                Integer currentValue = mutableData.getValue(Integer.class);
                if (currentValue != null && currentValue >= 1) {
                    mutableData.setValue(currentValue - 1);
                }

                return Transaction.success(mutableData);
            }

            @Override
            public void onComplete(DatabaseError databaseError, boolean b, DataSnapshot dataSnapshot) {
                LogUtil.logInfo(TAG, "Updating comments count transaction is completed.");
                if (onTaskCompleteListener != null) {
                    onTaskCompleteListener.onTaskComplete(true);
                }
            }
        });
    }

    public void removeComment(String commentId, final String postId, final OnTaskCompleteListener onTaskCompleteListener) {
        DatabaseReference reference = databaseHelper
                .getDatabaseReference()
                .child(DatabaseHelper.POST_COMMENTS_DB_KEY)
                .child(postId)
                .child(commentId);
        reference.removeValue().addOnSuccessListener(aVoid -> decrementCommentsCount(postId, onTaskCompleteListener)).addOnFailureListener(e -> {
            onTaskCompleteListener.onTaskComplete(false);
            LogUtil.logError(TAG, "removeComment()", e);
        });
    }

    public ValueEventListener getCommentsList(String postId, final OnDataChangedListener<Comment> onDataChangedListener) {
        DatabaseReference databaseReference = databaseHelper
                .getDatabaseReference()
                .child(DatabaseHelper.POST_COMMENTS_DB_KEY)
                .child(postId);
        ValueEventListener valueEventListener = databaseReference.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                List<Comment> list = new ArrayList<>();
                for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                    Comment comment = snapshot.getValue(Comment.class);
                    list.add(comment);
                }

                Collections.sort(list, (lhs, rhs) -> ((Long) rhs.getCreatedDate()).compareTo((Long) lhs.getCreatedDate()));

                onDataChangedListener.onListChanged(list);

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                LogUtil.logError(TAG, "getCommentsList(), onCancelled", new Exception(databaseError.getMessage()));
            }
        });

        databaseHelper.addActiveListener(valueEventListener, databaseReference);
        return valueEventListener;
    }

    public Task<Void> removeCommentsByPost(String postId) {
        return databaseHelper
                .getDatabaseReference()
                .child(DatabaseHelper.POST_COMMENTS_DB_KEY)
                .child(postId)
                .removeValue();
    }

}


text:
import requests
import sys
f = open("test1.out", 'w')
sys.stdout = f
from bs4 import BeautifulSoup

for x in range(1,11):
    s = "http://www.zopbazaar.com/6-groceries?=1&p=" + str(x)
    res = requests.get(s)
    if res.status_code == 200:
        html_doc=res.text
        s=BeautifulSoup(html_doc,"html.parser")
        x=s.find_all('img',class_="replace-2x img-responsive")
        for i in range(len(x)):
            print x[i]['alt']

    else:
        print "Didn't got correct response for this url -> %s" % s

f.close()


text:
package org.apache.wiki.tags;

import org.apache.wiki.api.core.Engine;
import org.apache.wiki.api.core.Page;
import org.apache.wiki.api.exceptions.ProviderException;
import org.apache.wiki.pages.PageManager;

import java.io.IOException;

/**
 *  Includes the body in case there is no such page available.
 *
 *  @since 2.0
 */
public class NoSuchPageTag extends WikiTagBase {

    private static final long serialVersionUID = 0L;

    private String m_pageName;

    @Override
    public void initTag() {
        super.initTag();
        m_pageName = null;
    }

    public void setPage( final String name )
    {
        m_pageName = name;
    }

    public String getPage()
    {
        return m_pageName;
    }

    @Override
    public int doWikiStartTag() throws IOException, ProviderException {
        final Engine engine = m_wikiContext.getEngine();
        final Page page;

        if( m_pageName == null ) {
            page = m_wikiContext.getPage();
        } else {
            page = engine.getManager( PageManager.class ).getPage( m_pageName );
        }

        if( page != null && engine.getManager( PageManager.class ).wikiPageExists( page.getName(), page.getVersion() ) ) {
            return SKIP_BODY;
        }

        return EVAL_BODY_INCLUDE;
    }
}


text:
<?php

namespace Cocur\Slugify\Bridge\Symfony;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;

/**
 * CocurSlugifyExtension
 *
 * @package    cocur/slugify
 * @subpackage bridge
 * @author     Florian Eckerstorfer <florian@eckerstorfer.co>
 * @copyright  2012-2014 Florian Eckerstorfer
 * @license    http://www.opensource.org/licenses/MIT The MIT License
 */
class CocurSlugifyExtension extends Extension
{
    /**
     * {@inheritDoc}
     *
     * @param mixed[]          $configs
     * @param ContainerBuilder $container
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        if (empty($config['rulesets'])) {
            unset($config['rulesets']);
        }

        // Extract slugify arguments from config
        $slugifyArguments = array_intersect_key($config, array_flip(['lowercase', 'separator', 'regexp', 'rulesets']));

        $container->setDefinition('cocur_slugify', new Definition('Cocur\Slugify\Slugify', [$slugifyArguments]));
        $container
            ->setDefinition(
                'cocur_slugify.twig.slugify',
                new Definition(
                    'Cocur\Slugify\Bridge\Twig\SlugifyExtension',
                    [new Reference('cocur_slugify')]
                )
            )
            ->addTag('twig.extension')
            ->setPublic(false);
        $container->setAlias('slugify', 'cocur_slugify');

        // for symfony versions >= 3.3
        if (Kernel::VERSION_ID >= 30300) {
            $container->setAlias('Cocur\Slugify\SlugifyInterface', 'cocur_slugify');
        }
    }
}


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/service_worker/service_worker_process_manager.h"

#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/common/service_worker/embedded_worker_settings.h"
#include "content/public/common/child_process_host.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace content {

namespace {

void DidAllocateWorkerProcess(const base::Closure& quit_closure,
                              ServiceWorkerStatusCode* status_out,
                              int* process_id_out,
                              bool* is_new_process_out,
                              ServiceWorkerStatusCode status,
                              int process_id,
                              bool is_new_process,
                              const EmbeddedWorkerSettings& settings) {
  *status_out = status;
  *process_id_out = process_id;
  *is_new_process_out = is_new_process;
  quit_closure.Run();
}

}  // namespace

class ServiceWorkerProcessManagerTest : public testing::Test {
 public:
  ServiceWorkerProcessManagerTest() {}

  void SetUp() override {
    browser_context_.reset(new TestBrowserContext);
    process_manager_.reset(
        new ServiceWorkerProcessManager(browser_context_.get()));
    pattern_ = GURL("http://www.example.com/");
    script_url_ = GURL("http://www.example.com/sw.js");
  }

  void TearDown() override {
    process_manager_->Shutdown();
    process_manager_.reset();
  }

  std::unique_ptr<MockRenderProcessHost> CreateRenderProcessHost() {
    return base::MakeUnique<MockRenderProcessHost>(browser_context_.get());
  }

 protected:
  std::unique_ptr<TestBrowserContext> browser_context_;
  std::unique_ptr<ServiceWorkerProcessManager> process_manager_;
  GURL pattern_;
  GURL script_url_;

 private:
  content::TestBrowserThreadBundle thread_bundle_;
  DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProcessManagerTest);
};

class ServiceWorkerProcessManagerTestP
    : public MojoServiceWorkerTestP<ServiceWorkerProcessManagerTest> {};

TEST_P(ServiceWorkerProcessManagerTestP, SortProcess) {
  // Process 1 has 2 refs, 2 has 3 refs and 3 has 1 ref.
  process_manager_->AddProcessReferenceToPattern(pattern_, 1);
  process_manager_->AddProcessReferenceToPattern(pattern_, 1);
  process_manager_->AddProcessReferenceToPattern(pattern_, 2);
  process_manager_->AddProcessReferenceToPattern(pattern_, 2);
  process_manager_->AddProcessReferenceToPattern(pattern_, 2);
  process_manager_->AddProcessReferenceToPattern(pattern_, 3);

  // Process 2 has the biggest # of references and it should be chosen.
  EXPECT_THAT(process_manager_->SortProcessesForPattern(pattern_),
              testing::ElementsAre(2, 1, 3));

  process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1);
  process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1);
  // Scores for each process: 2 : 3, 3 : 1, process 1 is removed.
  EXPECT_THAT(process_manager_->SortProcessesForPattern(pattern_),
              testing::ElementsAre(2, 3));
}

TEST_P(ServiceWorkerProcessManagerTestP, FindAvailableProcess) {
  std::unique_ptr<MockRenderProcessHost> host1(CreateRenderProcessHost());
  std::unique_ptr<MockRenderProcessHost> host2(CreateRenderProcessHost());
  std::unique_ptr<MockRenderProcessHost> host3(CreateRenderProcessHost());

  // Process 1 has 2 refs, 2 has 3 refs and 3 has 1 ref.
  process_manager_->AddProcessReferenceToPattern(pattern_, host1->GetID());
  process_manager_->AddProcessReferenceToPattern(pattern_, host1->GetID());
  process_manager_->AddProcessReferenceToPattern(pattern_, host2->GetID());
  process_manager_->AddProcessReferenceToPattern(pattern_, host2->GetID());
  process_manager_->AddProcessReferenceToPattern(pattern_, host2->GetID());
  process_manager_->AddProcessReferenceToPattern(pattern_, host3->GetID());

  // When all processes are in foreground, process 2 that has the highest
  // refcount should be chosen.
  EXPECT_EQ(host2->GetID(), process_manager_->FindAvailableProcess(pattern_));

  // Backgrounded process 2 should be deprioritized.
  host2->set_is_process_backgrounded(true);
  EXPECT_EQ(host1->GetID(), process_manager_->FindAvailableProcess(pattern_));

  // When all processes are in background, process 2 that has the highest
  // refcount should be chosen.
  host1->set_is_process_backgrounded(true);
  host3->set_is_process_backgrounded(true);
  EXPECT_EQ(host2->GetID(), process_manager_->FindAvailableProcess(pattern_));

  // Process 3 should be chosen because it is the only foreground process.
  host3->set_is_process_backgrounded(false);
  EXPECT_EQ(host3->GetID(), process_manager_->FindAvailableProcess(pattern_));
}

TEST_P(ServiceWorkerProcessManagerTestP,
       AllocateWorkerProcess_FindAvailableProcess) {
  const int kEmbeddedWorkerId1 = 100;
  const int kEmbeddedWorkerId2 = 200;
  const int kEmbeddedWorkerId3 = 300;
  GURL scope1("http://example.com/scope1");
  GURL scope2("http://example.com/scope2");

  // Set up mock renderer process hosts.
  std::unique_ptr<MockRenderProcessHost> host1(CreateRenderProcessHost());
  std::unique_ptr<MockRenderProcessHost> host2(CreateRenderProcessHost());
  process_manager_->AddProcessReferenceToPattern(scope1, host1->GetID());
  process_manager_->AddProcessReferenceToPattern(scope2, host2->GetID());
  ASSERT_EQ(0, host1->worker_ref_count());
  ASSERT_EQ(0, host2->worker_ref_count());

  std::map<int, ServiceWorkerProcessManager::ProcessInfo>& instance_info =
      process_manager_->instance_info_;

  // (1) Allocate a process to a worker.
  base::RunLoop run_loop1;
  ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE;
  int process_id = -10;
  bool is_new_process = true;
  process_manager_->AllocateWorkerProcess(
      kEmbeddedWorkerId1, scope1, script_url_,
      true /* can_use_existing_process */,
      base::Bind(&DidAllocateWorkerProcess, run_loop1.QuitClosure(), &status,
                 &process_id, &is_new_process));
  run_loop1.Run();

  // An existing process should be allocated to the worker.
  EXPECT_EQ(SERVICE_WORKER_OK, status);
  EXPECT_EQ(host1->GetID(), process_id);
  EXPECT_FALSE(is_new_process);
  EXPECT_EQ(1, host1->worker_ref_count());
  EXPECT_EQ(0, host2->worker_ref_count());
  EXPECT_EQ(1u, instance_info.size());
  std::map<int, ServiceWorkerProcessManager::ProcessInfo>::iterator found =
      instance_info.find(kEmbeddedWorkerId1);
  ASSERT_TRUE(found != instance_info.end());
  EXPECT_EQ(host1->GetID(), found->second.process_id);

  // (2) Allocate a process to another worker whose scope is the same with the
  // first worker.
  base::RunLoop run_loop2;
  status = SERVICE_WORKER_ERROR_MAX_VALUE;
  process_id = -10;
  is_new_process = true;
  process_manager_->AllocateWorkerProcess(
      kEmbeddedWorkerId2, scope1, script_url_,
      true /* can_use_existing_process */,
      base::Bind(&DidAllocateWorkerProcess, run_loop2.QuitClosure(), &status,
                 &process_id, &is_new_process));
  run_loop2.Run();

  // The same process should be allocated to the second worker.
  EXPECT_EQ(SERVICE_WORKER_OK, status);
  EXPECT_EQ(host1->GetID(), process_id);
  EXPECT_FALSE(is_new_process);
  EXPECT_EQ(2, host1->worker_ref_count());
  EXPECT_EQ(0, host2->worker_ref_count());
  EXPECT_EQ(2u, instance_info.size());
  found = instance_info.find(kEmbeddedWorkerId2);
  ASSERT_TRUE(found != instance_info.end());
  EXPECT_EQ(host1->GetID(), found->second.process_id);

  // (3) Allocate a process to a third worker whose scope is different from
  // other workers.
  base::RunLoop run_loop3;
  status = SERVICE_WORKER_ERROR_MAX_VALUE;
  process_id = -10;
  is_new_process = true;
  process_manager_->AllocateWorkerProcess(
      kEmbeddedWorkerId3, scope2, script_url_,
      true /* can_use_existing_process */,
      base::Bind(&DidAllocateWorkerProcess, run_loop3.QuitClosure(), &status,
                 &process_id, &is_new_process));
  run_loop3.Run();

  // A different existing process should be allocated to the third worker.
  EXPECT_EQ(SERVICE_WORKER_OK, status);
  EXPECT_EQ(host2->GetID(), process_id);
  EXPECT_FALSE(is_new_process);
  EXPECT_EQ(2, host1->worker_ref_count());
  EXPECT_EQ(1, host2->worker_ref_count());
  EXPECT_EQ(3u, instance_info.size());
  found = instance_info.find(kEmbeddedWorkerId3);
  ASSERT_TRUE(found != instance_info.end());
  EXPECT_EQ(host2->GetID(), found->second.process_id);

  // The instance map should be updated by process release.
  process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId3);
  EXPECT_EQ(2, host1->worker_ref_count());
  EXPECT_EQ(0, host2->worker_ref_count());
  EXPECT_EQ(2u, instance_info.size());
  EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId1));
  EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId2));

  process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId1);
  EXPECT_EQ(1, host1->worker_ref_count());
  EXPECT_EQ(0, host2->worker_ref_count());
  EXPECT_EQ(1u, instance_info.size());
  EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId2));

  process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId2);
  EXPECT_EQ(0, host1->worker_ref_count());
  EXPECT_EQ(0, host2->worker_ref_count());
  EXPECT_TRUE(instance_info.empty());
}

TEST_P(ServiceWorkerProcessManagerTestP, AllocateWorkerProcess_InShutdown) {
  process_manager_->Shutdown();
  ASSERT_TRUE(process_manager_->IsShutdown());

  base::RunLoop run_loop;
  ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE;
  int process_id = -10;
  bool is_new_process = true;
  process_manager_->AllocateWorkerProcess(
      1, pattern_, script_url_, true /* can_use_existing_process */,
      base::Bind(&DidAllocateWorkerProcess, run_loop.QuitClosure(), &status,
                 &process_id, &is_new_process));
  run_loop.Run();

  // Allocating a process in shutdown should abort.
  EXPECT_EQ(SERVICE_WORKER_ERROR_ABORT, status);
  EXPECT_EQ(ChildProcessHost::kInvalidUniqueID, process_id);
  EXPECT_FALSE(is_new_process);
  EXPECT_TRUE(process_manager_->instance_info_.empty());
}

INSTANTIATE_TEST_CASE_P(ServiceWorkerProcessManagerTest,
                        ServiceWorkerProcessManagerTestP,
                        testing::Bool());

}  // namespace content


text:
'use strict';

module.exports = function(world) {
  world.then('I should see all tests in gray', function(done) {
    done();
  });

  world.then('I should see implementation suggestions at the very end', function(done) {
    done();
  });

  world.and('I should only see the implementation suggestion once per step', function(done) {
    done();
  });
};


text:
/**
 * generated by Xtext 2.9.2
 */
package org.xtuml.bp.xtext.masl.masl.behavior;

import org.eclipse.emf.ecore.EObject;

import org.xtuml.bp.xtext.masl.masl.structure.AttributeDefinition;
import org.xtuml.bp.xtext.masl.masl.structure.StateDeclaration;

/**
 *
 * A representation of the model object 'Create Argument'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getAttribute Attribute}

 *
{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getValue Value}

 *
{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getCurrentState Current State}

 *

 *
 * @see org.xtuml.bp.xtext.masl.masl.behavior.BehaviorPackage#getCreateArgument()
 * @model
 * @generated
 */
public interface CreateArgument extends EObject {
	/**
	 * Returns the value of the 'Attribute' reference.
	 *
	 *

	 * If the meaning of the 'Attribute' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Attribute' reference.
	 * @see #setAttribute(AttributeDefinition)
	 * @see org.xtuml.bp.xtext.masl.masl.behavior.BehaviorPackage#getCreateArgument_Attribute()
	 * @model
	 * @generated
	 */
	AttributeDefinition getAttribute();

	/**
	 * Sets the value of the '{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getAttribute Attribute}' reference.
	 *
	 *
	 * @param value the new value of the 'Attribute' reference.
	 * @see #getAttribute()
	 * @generated
	 */
	void setAttribute(AttributeDefinition value);

	/**
	 * Returns the value of the 'Value' containment reference.
	 *
	 *

	 * If the meaning of the 'Value' containment reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Value' containment reference.
	 * @see #setValue(Expression)
	 * @see org.xtuml.bp.xtext.masl.masl.behavior.BehaviorPackage#getCreateArgument_Value()
	 * @model containment="true"
	 * @generated
	 */
	Expression getValue();

	/**
	 * Sets the value of the '{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getValue Value}' containment reference.
	 *
	 *
	 * @param value the new value of the 'Value' containment reference.
	 * @see #getValue()
	 * @generated
	 */
	void setValue(Expression value);

	/**
	 * Returns the value of the 'Current State' reference.
	 *
	 *

	 * If the meaning of the 'Current State' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Current State' reference.
	 * @see #setCurrentState(StateDeclaration)
	 * @see org.xtuml.bp.xtext.masl.masl.behavior.BehaviorPackage#getCreateArgument_CurrentState()
	 * @model
	 * @generated
	 */
	StateDeclaration getCurrentState();

	/**
	 * Sets the value of the '{@link org.xtuml.bp.xtext.masl.masl.behavior.CreateArgument#getCurrentState Current State}' reference.
	 *
	 *
	 * @param value the new value of the 'Current State' reference.
	 * @see #getCurrentState()
	 * @generated
	 */
	void setCurrentState(StateDeclaration value);

} // CreateArgument


text:
BasicGame.MainMenu = function (game) {

  this.music = null;
  this.playButton = null;

};

BasicGame.MainMenu.prototype = {

  create: function () {

    //  We've already preloaded our assets, so let's kick right into the Main Menu itself.
    //  Here all we're doing is playing some music and adding a picture and button
    //  Naturally I expect you to do something significantly better :)

    this.add.sprite(0, 0, 'titlepage');

    this.loadingText = this.add.text(this.game.width / 2, this.game.height / 2 + 80, "Press Z or tap/click game to start", { font: "20px monospace", fill: "#fff" });
    this.loadingText.anchor.setTo(0.5, 0.5);
    this.add.text(this.game.width / 2, this.game.height - 90, "image assets Copyright (c) 2002 Ari Feldman", { font: "12px monospace", fill: "#fff", align: "center"}).anchor.setTo(0.5, 0.5);
    this.add.text(this.game.width / 2, this.game.height - 75, "sound assets Copyright (c) 2012 - 2013 Devin Watson", { font: "12px monospace", fill: "#fff", align: "center"}).anchor.setTo(0.5, 0.5);

  },

  update: function () {

    if (this.input.keyboard.isDown(Phaser.Keyboard.Z) || this.input.activePointer.isDown) {
      this.startGame();
    }
    //  Do some nice funky main menu effect here

  },

  startGame: function () {

    //  Ok, the Play Button has been clicked or touched, so let's stop the music (otherwise it'll carry on playing)
    // this.music.stop();

    //  And start the actual game
    this.state.start('Game');

  }

};


text:
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine;

use Symfony\Bundle\FrameworkBundle\Routing\Router;
use Symfony\Component\Asset\Packages;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Templating\Helper\AssetsHelper;

class ParamResolver
{
    /** @var Router */
    private $router;
    /** @var RequestContext */
    private $context;
    /** @var array */
    private $hosts;
    /** @var boolean */
    private $compiled;
    /** @var AssetsHelper */
    private $assets;
    /** @var Packages */
    private $packages;

    /** @var string[] */
    private $cachePrefix = [];
    /** @var string[] */
    private $webRoot = [];
    /** @var string[] */
    private $routeSuffix = [];

    /** @var string */
    private $assetsHost;

    /**
     * Constructs cache path resolver with a given web root and cache prefix
     *
     * @param array          $hosts
     * @param Router         $router
     * @param RequestContext $context
     * @param AssetsHelper   $assets
     * @param Packages       $packages
     */
    public function __construct(
        array $hosts,
        Router $router,
        RequestContext $context = null,
        /*AssetsHelper*/ $assets = null,
        /*Packages*/ $packages = null
    ) {
        $this->hosts    = $hosts;
        $this->router   = $router;
        $this->context  = $context;
        $this->assets   = $assets;
        $this->packages = $packages;
    }

    /**
     * Get current best matching web root
     *
     * @param boolean $assetsHost
     *
     * @return string
     */
    public function getWebRoot($assetsHost = true)
    {
        $this->prepare();

        return $this->webRoot[$assetsHost ? $this->getAssetsHost() : $this->getHost()];
    }

    /**
     * Get current best matching cache prefix
     *
     * @param boolean $assetsHost
     *
     * @return string
     */
    public function getCachePrefix($assetsHost = true)
    {
        $this->prepare();

        return $this->cachePrefix[$assetsHost ? $this->getAssetsHost() : $this->getHost()];
    }

    /**
     * Get route's name suffix
     *
     * Since now host can be involved we need to distinguish imagine routes not only by used filter.
     *
     * @param boolean $assetsHost
     *
     * @return string
     */
    public function getRouteSuffix($assetsHost = true)
    {
        $this->prepare();

        return $this->routeSuffix[$assetsHost ? $this->getAssetsHost() : $this->getHost()];
    }

    /**
     * Get host->cache-prefix association array
     *
     * This host->cache-prefix association array will be used when building route collection.
     * Main purpose of this is a multi-domain setup where we're serving HTML content from one sub-domain
     * and serving no-cookie assets from different sub-domain.
     *
     * @return array
     */
    public function getRouteOptions()
    {
        $this->prepare();

        $options = [];

        foreach ($this->hosts as $host => $opts) {
            $options['default' === $host ? '' : $host] = $opts['cache_prefix'];
        }

        $options += $this->cachePrefix;

        return $options;
    }

    /** @internal */
    private function prepare()
    {
        if ($this->compiled) {
            return;
        }

        $this->compiled = true;

        $this->compileFor($this->getHost());
        if ($this->getAssetsHost() !== $this->getHost()) {
            $this->compileFor($this->getAssetsHost());
        }
    }

    private function compileFor($host)
    {
        $map  = array(
            'cachePrefix' => 'cache_prefix',
            'webRoot'     => 'web_root',
        );

        foreach ($map as $field => $key) {
            if (isset($this->hosts[$host][$key])) {
                $this->routeSuffix[$host] = '_' . preg_replace('#[^a-z0-9]+#i', '_', $host);
                $this->{$field}[$host]    = $this->hosts[$host][$key];
            } elseif (isset($this->hosts['default'][$key])) {
                $this->routeSuffix[$host] = '_';
                $this->{$field}[$host]    = $this->hosts['default'][$key];
            } else {
                $message = '%1$s parameter is required by AvalancheImagineBundle; define either imagine.hosts.default.%1$s or imagine.hosts["%2$s"].%1$s';
                throw new \InvalidArgumentException(sprintf($message, $key, $host));
            }
        }
    }

    /**
     * Get current host name
     *
     * @return string
     */
    public function getHost()
    {
        return $this->context ? $this->context->getHost() : '';
    }

    /**
     * Get host name used by web assets
     *
     * In case we don't have access to web request return "" (empty string).
     *
     * @return string
     */
    public function getAssetsHost()
    {
        if ($this->assetsHost) {
            return $this->assetsHost;
        }

        if ($this->packages && $host = parse_url($this->packages->getUrl(''), PHP_URL_HOST)) {
        } elseif ($this->assets && $host = parse_url($this->assets->getUrl(''), PHP_URL_HOST)) {
        } elseif ($this->context) {
            $host = $this->context->getHost();
        } else {
            $host = '';
        }

        return $this->assetsHost = $host;
    }

    // FIXME: shady way of dealing with remote resource
    public function generateUrl($name, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        $uri  = $this->router->generate($name, $parameters, $referenceType);
        $host = parse_url(0 === strpos($uri, '//') ? 's:' . $uri : $uri, PHP_URL_HOST);

        // Need to regenerate URI as we might end up with different ports set
        if (isset($this->hosts[$host]) && isset($this->hosts[$host]['ports'])) {
            $map       = ['http' => 'HttpPort', 'ssl' => 'HttpsPort'];
            $ports     = $this->hosts[$host]['ports'];
            $originals = [];
            foreach ($map as $key => $method) {
                $originals[$key] = $this->router->getContext()->{'get' . $method}();
                isset($ports[$key]) && $this->router->getContext()->{'set' . $method}($ports[$key]);
            }
            $uri = $this->router->generate($name, $parameters, $referenceType);
            foreach ($map as $key => $method) {
                $this->router->getContext()->{'set' . $method}($originals[$key]);
            }
        }

        return $uri;
    }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="robots" content="noindex">

	<title>File QueryHandler.php | ArangoDB-PHP API Documentation</title>

	<link rel="stylesheet" href="resources/bootstrap.min.css?973e37a8502921d56bc02bb55321f45b072b6f71">
	<link rel="stylesheet" href="resources/style.css?49f43d3208c5d7e33fa16d36107a345bf11cc00d">

				ArangoDB-PHP API Documentation

                <form id="search" class="navbar-form navbar-left" role="search">
                    <input type="hidden" name="cx" value="">
                    <input type="hidden" name="ie" value="UTF-8">

                        <input type="text" name="q" class="search-query form-control" placeholder="Search">

				</form>

Namespace

Class

								Deprecated

Namespaces

							triagens

							ArangoDb

Classes

triagens\ArangoDb\AdminHandler

triagens\ArangoDb\AqlUserFunction

triagens\ArangoDb\Autoloader

triagens\ArangoDb\Batch

triagens\ArangoDb\BatchPart

triagens\ArangoDb\BindVars

triagens\ArangoDb\Collection

triagens\ArangoDb\CollectionHandler

triagens\ArangoDb\Connection

triagens\ArangoDb\ConnectionOptions

triagens\ArangoDb\Cursor

triagens\ArangoDb\Database

triagens\ArangoDb\DefaultValues

triagens\ArangoDb\Document

triagens\ArangoDb\DocumentHandler

triagens\ArangoDb\Edge

triagens\ArangoDb\EdgeDefinition

triagens\ArangoDb\EdgeHandler

triagens\ArangoDb\Endpoint

triagens\ArangoDb\Export

triagens\ArangoDb\ExportCursor

triagens\ArangoDb\Graph

triagens\ArangoDb\GraphHandler

triagens\ArangoDb\Handler

triagens\ArangoDb\HttpHelper

triagens\ArangoDb\HttpResponse

triagens\ArangoDb\QueryCacheHandler

triagens\ArangoDb\QueryHandler

triagens\ArangoDb\Statement

triagens\ArangoDb\TraceRequest

triagens\ArangoDb\TraceResponse

triagens\ArangoDb\Transaction

triagens\ArangoDb\Traversal

triagens\ArangoDb\UpdatePolicy

triagens\ArangoDb\UrlHelper

triagens\ArangoDb\Urls

triagens\ArangoDb\User

triagens\ArangoDb\UserHandler

triagens\ArangoDb\ValueValidator

triagens\ArangoDb\Vertex

triagens\ArangoDb\VertexHandler

Exceptions

triagens\ArangoDb\ClientException

triagens\ArangoDb\ConnectException

triagens\ArangoDb\Exception

triagens\ArangoDb\ServerException

 1 <?php
 2
 3
10
11 namespace triagens\ArangoDb;
12
13 class QueryHandler extends
14     Handler
15 {
16     /**
17      * Clears the list of slow queries
18      *
19      * @throws Exception
20      */
21     public function clearSlow()
22     {
23         $url = UrlHelper::buildUrl(Urls::URL_QUERY, ['slow']);
24         $this->getConnection()->delete($url);
25     }
26
27     /**
28      * Returns the list of slow queries
29      *
30      * @throws Exception
31      *
32      * @return array
33      */
34     public function getSlow()
35     {
36         $url      = UrlHelper::buildUrl(Urls::URL_QUERY, ['slow']);
37         $response = $this->getConnection()->get($url);
38
39         return $response->getJson();
40     }
41
42     /**
43      * Returns the list of currently executing queries
44      *
45      * @throws Exception
46      *
47      * @return array
48      */
49     public function getCurrent()
50     {
51         $url      = UrlHelper::buildUrl(Urls::URL_QUERY, ['current']);
52         $response = $this->getConnection()->get($url);
53
54         return $response->getJson();
55     }
56
57     /**
58      * Kills a specific query
59      *
60      * This will send an HTTP DELETE command to the server to terminate the specified query
61      *
62      * @param string $id - query id
63      *
64      * @throws Exception
65      *
66      * @return bool
67      */
68     public function kill($id)
69     {
70         $url = UrlHelper::buildUrl(Urls::URL_QUERY, [$id]);
71         $this->getConnection()->delete($url);
72
73         return true;
74     }
75
76 }
77

		ArangoDB-PHP API Documentation API documentation generated by ApiGen


text:
@interface EPQuestionPostman : NSObject<EPPostmanProtocol,EPConnectionDelegateProtocol>

@property (nonatomic,assign) id<EPPostmanDelegateProtocol> delegate;

- (id)initWithConnection:(id<EPConnectionProtocol>)connection;

- (void)post:(NSString*)item;

@end