text:
package org.datasyslab.geosparkviz.utils;

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import org.apache.log4j.Logger;
import scala.Tuple2;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

// TODO: Auto-generated Javadoc

/**
 * The Class RasterizationUtils.
 */
public class RasterizationUtils
        implements Serializable
{

    /**
     * The Constant logger.
     */
    final static Logger logger = Logger.getLogger(RasterizationUtils.class);

    /**
     * Find one pixel coordinate.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundaryOriginal the dataset boundary original
     * @param spatialCoordinateOriginal the spatial coordinate original
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @return the tuple 2
     */
    public static Tuple2<Integer, Integer> FindOnePixelCoordinate(int resolutionX, int resolutionY, Envelope datasetBoundaryOriginal, Coordinate spatialCoordinateOriginal, boolean reverseSpatialCoordinate)
    {
        Coordinate spatialCoordinate;
        Envelope datasetBoundary;
        if (reverseSpatialCoordinate) {
            spatialCoordinate = new Coordinate(spatialCoordinateOriginal.y, spatialCoordinateOriginal.x);
            datasetBoundary = new Envelope(datasetBoundaryOriginal.getMinY(), datasetBoundaryOriginal.getMaxY(), datasetBoundaryOriginal.getMinX(), datasetBoundaryOriginal.getMaxX());
        }
        else {
            spatialCoordinate = spatialCoordinateOriginal;
            datasetBoundary = datasetBoundaryOriginal;
        }
		/*
		 if(spatialCoordinate.x < datasetBoundary.getMinX() || spatialCoordinate.x > datasetBoundary.getMaxX())
		{
			throw new Exception("[RasterizationUtils][FindOnePixelCoordinate] This spatial coordinate is out of the given boundary. Should be ignored.");
		}
		if(spatialCoordinate.y < datasetBoundaryOriginal.getMinY() || spatialCoordinate.y > datasetBoundaryOriginal.getMaxY())
		{
			throw new Exception("[RasterizationUtils][FindOnePixelCoordinate] This spatial coordinate is out of the given boundary. Should be ignored.");
		}*/

        Double pixelXDouble = ((spatialCoordinate.x - datasetBoundary.getMinX()) / (datasetBoundary.getMaxX() - datasetBoundary.getMinX())) * resolutionX;
        Double xRemainder = (spatialCoordinate.x - datasetBoundary.getMinX()) % (datasetBoundary.getMaxX() - datasetBoundary.getMinX());
        Double pixelYDouble = ((spatialCoordinate.y - datasetBoundary.getMinY()) / (datasetBoundary.getMaxY() - datasetBoundary.getMinY())) * resolutionY;
        Double yRemainder = (spatialCoordinate.y - datasetBoundary.getMinY()) % (datasetBoundary.getMaxY() - datasetBoundary.getMinY());
        int pixelX = pixelXDouble.intValue();
        int pixelY = pixelYDouble.intValue();
        if (xRemainder == 0.0 && pixelXDouble != 0.0) {
            pixelX--;
        }
        if (pixelX >= resolutionX) {
            pixelX--;
        }
        if (yRemainder == 0.0 && pixelYDouble != 0) {
            pixelY--;
        }
        if (pixelY >= resolutionY) {
            pixelY--;
        }
        return new Tuple2<Integer, Integer>(pixelX, pixelY);
    }

    /**
     * Find one pixel coordinate.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundaryOriginal the dataset boundary original
     * @param spatialCoordinateOriginal the spatial coordinate original
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @param flipOverX the flip over X
     * @param flipOverY the flip over Y
     * @return the tuple 2
     */
    public static Tuple2<Integer, Integer> FindOnePixelCoordinate(int resolutionX, int resolutionY, Envelope datasetBoundaryOriginal, Coordinate spatialCoordinateOriginal, boolean reverseSpatialCoordinate, boolean flipOverX, boolean flipOverY)
    {
        Coordinate spatialCoordinate;
        Envelope datasetBoundary;
        if (reverseSpatialCoordinate) {
            spatialCoordinate = new Coordinate(spatialCoordinateOriginal.y, spatialCoordinateOriginal.x);
            datasetBoundary = new Envelope(datasetBoundaryOriginal.getMinY(), datasetBoundaryOriginal.getMaxY(), datasetBoundaryOriginal.getMinX(), datasetBoundaryOriginal.getMaxX());
        }
        else {
            spatialCoordinate = spatialCoordinateOriginal;
            datasetBoundary = datasetBoundaryOriginal;
        }
        Double pixelXDouble = ((spatialCoordinate.x - datasetBoundary.getMinX()) / (datasetBoundary.getMaxX() - datasetBoundary.getMinX())) * resolutionX;
        Double xRemainder = (spatialCoordinate.x - datasetBoundary.getMinX()) % (datasetBoundary.getMaxX() - datasetBoundary.getMinX());
        Double pixelYDouble = ((spatialCoordinate.y - datasetBoundary.getMinY()) / (datasetBoundary.getMaxY() - datasetBoundary.getMinY())) * resolutionY;
        Double yRemainder = (spatialCoordinate.y - datasetBoundary.getMinY()) / (datasetBoundary.getMaxY() - datasetBoundary.getMinY());
        int pixelX = pixelXDouble.intValue();
        int pixelY = pixelYDouble.intValue();
        if (xRemainder == 0.0 && pixelXDouble != 0.0) {
            pixelX--;
        }
        if (pixelX >= resolutionX) {
            pixelX--;
        }
        if (yRemainder == 0.0 && pixelYDouble != 0) {
            pixelY--;
        }
        if (pixelY >= resolutionY) {
            pixelY--;
        }
        // Flip over X or Y value. For example, if the original X is 15, the X resolution is 100, the flipped X will be 100 -15 = 85.
        if (flipOverX) { pixelX = resolutionX - pixelX; }
        if (flipOverY) { pixelY = resolutionY - pixelY; }
        return new Tuple2<Integer, Integer>(pixelX, pixelY);
    }

    /**
     * Gets the width from height.
     *
     * @param y the y
     * @param boundary the boundary
     * @return the int
     */
    public static int GetWidthFromHeight(int y, Envelope boundary)
    {
        int x = (int) (y * (boundary.getWidth() / boundary.getHeight()));
        return x;
    }

    /**
     * Encode 2 D to 1 D id.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param twoDimensionIdX the two dimension id X
     * @param twoDimensionIdY the two dimension id Y
     * @return the int
     * @throws Exception the exception
     */
    public static int Encode2DTo1DId(int resolutionX, int resolutionY, int twoDimensionIdX, int twoDimensionIdY)
            throws Exception
    {
        if (twoDimensionIdX < 0 || twoDimensionIdX >= resolutionX || twoDimensionIdY < 0 || twoDimensionIdY >= resolutionY) {
            throw new Exception("[RasterizationUtils][Encode2DTo1DId] This given 2 dimension coordinate is " + twoDimensionIdX + " " + twoDimensionIdY + ". This coordinate is out of the given boundary and will be dropped.");
        }
		/*
		if((twoDimensionIdX+twoDimensionIdY*resolutionX)<0 ||(twoDimensionIdX+twoDimensionIdY*resolutionX)>(resolutionX*resolutionY-1))
		{
			throw new Exception("[RasterizationUtils][Encode2DTo1DId] This given 2 dimension coordinate is "+twoDimensionIdX+" "+twoDimensionIdY+". This coordinate is out of the given boundary and will be dropped.");
		}
		*/
        return twoDimensionIdX + twoDimensionIdY * resolutionX;
    }

    /**
     * Decode 1 D to 2 D id.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param oneDimensionId the one dimension id
     * @return the tuple 2
     */
    public static Tuple2<Integer, Integer> Decode1DTo2DId(int resolutionX, int resolutionY, int oneDimensionId)
    {
        int twoDimensionIdX = oneDimensionId % resolutionX;
        int twoDimensionIdY = oneDimensionId / resolutionX;
        return new Tuple2<Integer, Integer>(twoDimensionIdX, twoDimensionIdY);
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param spatialObject the spatial object
     * @param colorizeOption the colorize option
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @return the list
     */
    public static List<Tuple2<Pixel, Double>> FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, Point spatialObject, ColorizeOption colorizeOption, boolean reverseSpatialCoordinate)
    {
        List<Tuple2<Pixel, Double>> result = new ArrayList<Tuple2<Pixel, Double>>();
        Tuple2<Integer, Integer> pixelCoordinate = null;
        try {
            pixelCoordinate = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinate(), reverseSpatialCoordinate);
        }
        catch (Exception e) {
            // This pixel is out of boundary. Should be ignored.
            return result;
        }
        if (colorizeOption == ColorizeOption.EARTHOBSERVATION) {
            Pixel newPixel = new Pixel(pixelCoordinate._1, pixelCoordinate._2, resolutionX, resolutionY);
            result.add(new Tuple2<Pixel, Double>(newPixel, spatialObject.getCoordinate().z));
        }
        else {
            Pixel newPixel = new Pixel(pixelCoordinate._1, pixelCoordinate._2, resolutionX, resolutionY);
            result.add(new Tuple2<Pixel, Double>(newPixel, new Double(1.0)));
        }
        return result;
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param coordinates the coordinates
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @param flipOverX the flip over X
     * @param flipOverY the flip over Y
     * @return the coordinate[]
     */
    public static Coordinate[] FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, Coordinate[] coordinates, boolean reverseSpatialCoordinate, boolean flipOverX, boolean flipOverY)
    {
        /*
         * This function is used to rasterize vector image pixels
         */
        List<Coordinate> result = new ArrayList<Coordinate>();
        for (Coordinate coordinate : coordinates) {
            Tuple2<Integer, Integer> pixelCoordinate = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, coordinate, reverseSpatialCoordinate, flipOverX, flipOverY);
            result.add(new Coordinate(pixelCoordinate._1(), pixelCoordinate._2()));
        }
        Coordinate[] arrayResult = result.toArray(new Coordinate[result.size()]);
        return arrayResult;
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param coordinate the coordinate
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @param flipOverX the flip over X
     * @param flipOverY the flip over Y
     * @return the coordinate
     */
    public static Coordinate FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, Coordinate coordinate, boolean reverseSpatialCoordinate, boolean flipOverX, boolean flipOverY)
    {
        /*
         * This function is used to rasterize vector image pixels
         */
        Tuple2<Integer, Integer> pixelCoordinate = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, coordinate, reverseSpatialCoordinate, flipOverX, flipOverY);
        return new Coordinate(pixelCoordinate._1(), pixelCoordinate._2());
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param spatialObject the spatial object
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @return the list
     */
    public static List<Tuple2<Pixel, Double>> FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, Polygon spatialObject, boolean reverseSpatialCoordinate)
    {
        List<Tuple2<Pixel, Double>> result = new ArrayList<Tuple2<Pixel, Double>>();
        for (int i = 0; i < spatialObject.getCoordinates().length - 1; i++) {
            Tuple2<Integer, Integer> pixelCoordinate1 = null;
            Tuple2<Integer, Integer> pixelCoordinate2 = null;
            try {
                pixelCoordinate1 = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinates()[i], reverseSpatialCoordinate);
                pixelCoordinate2 = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinates()[i + 1], reverseSpatialCoordinate);
            }
            catch (Exception e) {
                // This pixel is out of boundary. Should be ignored.
                continue;
            }
            result.addAll(FindPixelCoordinates(resolutionX, resolutionY, pixelCoordinate1, pixelCoordinate2, reverseSpatialCoordinate));
        }
        return result;
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param spatialObject the spatial object
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @param objectWeight the object weight
     * @return the list
     */
    public static List<Tuple2<Pixel, Double>> FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, Polygon spatialObject, boolean reverseSpatialCoordinate, Double objectWeight)
    {
        List<Tuple2<Pixel, Double>> result = new ArrayList<Tuple2<Pixel, Double>>();
        GeometryFactory geometryfactory = new GeometryFactory();
        ArrayList<Coordinate> coordinatesList = new ArrayList<Coordinate>();
        LinearRing linear;
        for (int i = 0; i < spatialObject.getCoordinates().length; i++) {
            Tuple2<Integer, Integer> pixelCoordinate = null;
            pixelCoordinate = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinates()[i], reverseSpatialCoordinate);

            coordinatesList.add(new Coordinate(pixelCoordinate._1, pixelCoordinate._2));
        }

        coordinatesList.add(coordinatesList.get(0));
        linear = geometryfactory.createLinearRing(coordinatesList.toArray(new Coordinate[coordinatesList.size()]));
        Polygon polygon = new Polygon(linear, null, geometryfactory);
        int minPixelX = (int) polygon.getEnvelopeInternal().getMinX();
        int maxPixelX = (int) polygon.getEnvelopeInternal().getMaxX();
        int minPixelY = (int) polygon.getEnvelopeInternal().getMinY();
        int maxPixelY = (int) polygon.getEnvelopeInternal().getMaxY();
        for (int j = minPixelY; j <= maxPixelY; j++) {
            for (int i = minPixelX; i <= maxPixelX; i++) {
                if (polygon.contains(geometryfactory.createPoint(new Coordinate(i, j)))) {
                    try {
                        Pixel newPixel = new Pixel(i, j, resolutionX, resolutionY);
                        result.add(new Tuple2<Pixel, Double>(newPixel, new Double(objectWeight)));
                    }
                    catch (Exception e) {
                        /*
                         * This spatial object is out of the given dataset boundary. It is ignored here.
                         */
                    }
                }
            }
        }
        return result;
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param pixelCoordinate1 the pixel coordinate 1
     * @param pixelCoordinate2 the pixel coordinate 2
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @return the list
     */
    public static List<Tuple2<Pixel, Double>> FindPixelCoordinates(int resolutionX, int resolutionY, Tuple2<Integer, Integer> pixelCoordinate1, Tuple2<Integer, Integer> pixelCoordinate2, boolean reverseSpatialCoordinate)
    {
        /*
         * This function uses Bresenham's line algorithm to plot pixels touched by a given line segment.
         */
        int x1 = pixelCoordinate1._1;
        int y1 = pixelCoordinate1._2;
        int x2 = pixelCoordinate2._1;
        int y2 = pixelCoordinate2._2;
        int dx = x2 - x1;
        int dy = y2 - y1;
        int ux = dx > 0 ? 1 : -1; // x direction
        int uy = dy > 0 ? 1 : -1; // y direction
        int x = x1, y = y1;
        int eps = 0; //cumulative errors
        dx = Math.abs(dx);
        dy = Math.abs(dy);
        List<Tuple2<Pixel, Double>> result = new ArrayList<Tuple2<Pixel, Double>>();
        if (dx > dy) {
            for (x = x1; x != x2; x += ux) {
                try {
                    Pixel newPixel = new Pixel(x, y, resolutionX, resolutionY);
                    result.add(new Tuple2<Pixel, Double>(newPixel, 1.0));
                }
                catch (Exception e) {
                    /*
                     * This spatial object is out of the given dataset boudanry. It is ignored here.
                     */
                }
                eps += dy;
                if ((eps << 1) >= dx) {
                    y += uy;
                    eps -= dx;
                }
            }
        }
        else {
            for (y = y1; y != y2; y += uy) {
                try {
                    Pixel newPixel = new Pixel(x, y, resolutionX, resolutionY);
                    result.add(new Tuple2<Pixel, Double>(newPixel, 1.0));
                }
                catch (Exception e) {
                    /*
                     * This spatial object is out of the given dataset boudanry. It is ignored here.
                     */
                }
                eps += dx;
                if ((eps << 1) >= dy) {
                    x += ux;
                    eps -= dy;
                }
            }
        }
        return result;
    }

    /**
     * Find pixel coordinates.
     *
     * @param resolutionX the resolution X
     * @param resolutionY the resolution Y
     * @param datasetBoundary the dataset boundary
     * @param spatialObject the spatial object
     * @param reverseSpatialCoordinate the reverse spatial coordinate
     * @return the list
     */
    public static List<Tuple2<Pixel, Double>> FindPixelCoordinates(int resolutionX, int resolutionY, Envelope datasetBoundary, LineString spatialObject, boolean reverseSpatialCoordinate)
    {
        List<Tuple2<Pixel, Double>> result = new ArrayList<Tuple2<Pixel, Double>>();
        for (int i = 0; i < spatialObject.getCoordinates().length - 1; i++) {
            Tuple2<Integer, Integer> pixelCoordinate1 = null;
            Tuple2<Integer, Integer> pixelCoordinate2 = null;
            try {
                pixelCoordinate1 = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinates()[i], reverseSpatialCoordinate);
                pixelCoordinate2 = FindOnePixelCoordinate(resolutionX, resolutionY, datasetBoundary, spatialObject.getCoordinates()[i + 1], reverseSpatialCoordinate);
            }
            catch (Exception e) {
                // This line segment is out of boundary, Should be ignored.
                continue;
            }
            result.addAll(FindPixelCoordinates(resolutionX, resolutionY, pixelCoordinate1, pixelCoordinate2, reverseSpatialCoordinate));
        }
        return result;
    }

    public static String getImageTileName(int zoomLevel, int partitionOnX, int partitionOnY, int tileSerialId)
    {
        Tuple2<Integer, Integer> tileCoordinate = RasterizationUtils.Decode1DTo2DId(partitionOnX, partitionOnY, tileSerialId);
        return zoomLevel + "-" + tileCoordinate._1() + "-" + tileCoordinate._2();
    }
}


text:
'use strict';

// first, load environment settings from .env file; if it exists
require('dotenv').load();

process.env.NODE_ENV || (process.env.NODE_ENV = "development")

var path = require('path');

var express = require('express')
  , logger = require('morgan')
  , debug = require('debug')('api')
  , bodyParser = require('body-parser')
  , cookieParser = require('cookie-parser')
  , multipart = require('connect-multiparty')
  , accepts = require('accepts')
  , session = require('express-session')
  , rem = require('rem')
  ;

var apiRouter = require('./routes/api_routes'),
    oauthRouter = require('./routes/oauth_routes');

// connect to and synchronize database
var db = require('./models');

db.sequelize
  .sync()
  .complete(function(err) {
    if (!!err) {
      debug(err);
      process.exit();
    }

    debug('db synced successfully')
  });

var app = express();

app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(multipart());
app.use(session({
  secret: "what is the secret who has the secret"
}));

// Create our API client.
var tesselauth = rem.createClient({
  "id": "tessel.io",
  "base": process.env.OAUTH_SERVER,
  "auth": {
    "type": "oauth",
    "version": "2.0",
    "base": process.env.OAUTH_SERVER,
    "authorizePath": "/oauth/authorise",
    "tokenPath": "/oauth/token",
    "params": {
      "scope": [process.env.GRANT_TYPE],
      "response_type": "code"
    },
    "validate": "/profile",
    "oob": false,
    "oobVerifier": false,
  },
}, {
  key: process.env.CLIENT_ID,
  secret: process.env.CLIENT_SECRET,
});

app.use('/api*', function(req, res, next) {
  var accept = accepts(req);
  if (accept.types('application/vnd.tessel.remote.v1')) {
    next();
  } else {
    return res.json(400, {
      message: "Incorrect API version"
    });
  }
});

// Create the OAuth interface.
var oauth = rem.oauth(tesselauth, process.env.OAUTH_REDIRECT);
app.use('/', oauthRouter(oauth));

// Default routes.
app.use('/', apiRouter);

/// catch 404 and forwarding to error handler
app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});

/// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
        res.status(err.status || 500);
        res.json({
            message: err.message,
            error: err
        });
    });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.json({
        message: err.message,
        error: {}
    });
});

module.exports = app;

redpajama_set_name: RedPajamaGithub


text:
describe("CamelCase Tests", function() {
    var testObject, finalObject, parser;
    var objectCache = {
        "a": {id: "a"},
        "b": {id: "b"}
    };

    beforeEach(function() {
        parser = new layer.js.LayerPatchParser({
            camelCase: true,
            getObjectCallback: function(id) {
                return objectCache[id];
            }
        });

        testObject = {
            hey: "ho",
            outerSet: ["d"],
            "subObject": {
                subhey: "subho",
                count: 5,
                "subberObject": {
                    count: 10,
                    set: ["a", "c", "z"]
                }
            }
        };

        // finalObject is a clone of testObject
        finalObject = JSON.parse(JSON.stringify(testObject));
    });

    it("Should map sub-object to subObject for set operation", function() {
        parser.parse({
            object: testObject,
            operations: [
                {operation: "set", property: "sub-object", value: {howdy: "ho"}}
            ]
        });
        finalObject.subObject = {"howdy": "ho"};
        expect(testObject).toEqual(finalObject);
    });

    it("Should map sub-object to subObject for delete operation", function() {
        parser.parse({
            object: testObject,
            operations: [
                {operation: "delete", property: "sub-object"}
            ]
        });
        delete finalObject.subObject;
        expect(testObject).toEqual(finalObject);
    });

    it("Should map sub-object to subObject for add operation", function() {
        testObject.subObject = [];
        parser.parse({
            object: testObject,
            operations: [
                {operation: "add", property: "sub-object", value: "hi"}
            ]
        });
        finalObject.subObject = ["hi"];
        expect(testObject).toEqual(finalObject);
    });

    it("Should map sub-object to subObject for remove operation", function() {
        testObject.subObject = ["hi", "ho"];
        parser.parse({
            object: testObject,
            operations: [
                {operation: "remove", property: "sub-object", value: "hi"}
            ]
        });
        finalObject.subObject = ["ho"];
        expect(testObject).toEqual(finalObject);
    });

    it("Should map sub-object to subObject but NOT subproperties for set operation", function() {
        parser.parse({
            object: testObject,
            operations: [
                {operation: "set", property: "sub-object.doh-ray", value: "me"}
            ]
        });
        finalObject.subObject["doh-ray"] = "me";
        expect(testObject).toEqual(finalObject);
    });

    xdescribe("Add by Index", function() {});
    xdescribe("Remove by Index", function() {});
    xdescribe("Add by Index and Value", function() {});
});


text:
<?php

namespace PandaFire\CoreBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;

class DayEndTransformer implements DataTransformerInterface
{
    /**
     * {@inheritdoc}
     */
    public function transform($value)
    {
        return $value;
    }

    /**
     * {@inheritdoc}
     */
    public function reverseTransform($value)
    {
        if (!$value instanceof \DateTime) {
            throw new TransformationFailedException();
        }

        $value->setTime(23, 59, 59);

        return $value;
    }
}


text:
import _ from 'lodash';
import * as actions from '../actions/action-types';

const defaultState = {
  fetching: false,
  fetched: false,
  data: null,
};

export default function (state = defaultState, action) {
  switch (action.type) {
    case actions.INVALIDATE_ALL_LOCATION_DATA:
      state = _.cloneDeep(defaultState);
      break;
    case actions.REQUEST_LOCATION:
      state = _.cloneDeep(state);
      state.error = null;
      state.fetching = true;
      break;
    case actions.RECEIVE_LOCATION:
      state = _.cloneDeep(state);
      if (action.error) {
        state.error = action.error;
      } else {
        state.data = action.json;
      }
      state.fetching = false;
      state.fetched = true;
      break;
  }
  return state;
}


text:
/*global console */
var utils = require('../../../utils');

/**
 * @class
 * @memberof PIXI
 * @param shaderManager {ShaderManager} The webgl shader manager this shader works for.
 * @param [vertexSrc] {string} The source of the vertex shader.
 * @param [fragmentSrc] {string} The source of the fragment shader.
 * @param [uniforms] {object} Uniforms for this shader.
 * @param [attributes] {object} Attributes for this shader.
 */
function Shader(shaderManager, vertexSrc, fragmentSrc, uniforms, attributes)
{
    if (!vertexSrc || !fragmentSrc)
    {
         throw new Error('Pixi.js Error. Shader requires vertexSrc and fragmentSrc');
    }

    /**
     * A unique id
     * @member {number}
     * @readonly
     */
    this.uuid = utils.uuid();

    /**
     * The current WebGL drawing context
     * @member {WebGLRenderingContext}
     * @readonly
     */
    this.gl = shaderManager.renderer.gl;

    //TODO maybe we should pass renderer rather than shader manger?? food for thought..
    this.shaderManager = shaderManager;

    /**
     * The WebGL program.
     *
     * @member {WebGLProgram}
     * @readonly
     */
    this.program = null;

    /**
     * The uniforms as an object
     * @member {object}
     * @private
     */
    this.uniforms = uniforms || {};

    /**
     * The attributes as an object
     * @member {object}
     * @private
     */
    this.attributes = attributes || {};

    /**
     * Internal texture counter
     * @member {number}
     * @private
     */
    this.textureCount = 1;

    /**
     * The vertex shader as an array of strings
     *
     * @member {string}
     */
    this.vertexSrc = vertexSrc;

    /**
     * The fragment shader as an array of strings
     *
     * @member {string}
     */
    this.fragmentSrc = fragmentSrc;

    this.init();
}

Shader.prototype.constructor = Shader;
module.exports = Shader;

/*
 * Creates the shader and uses it
 *
 */
Shader.prototype.init = function ()
{
    this.compile();

    this.gl.useProgram(this.program);

    this.cacheUniformLocations(Object.keys(this.uniforms));
    this.cacheAttributeLocations(Object.keys(this.attributes));
};

/*
 * Caches the locations of the uniform for reuse
 * @param keys {string} the uniforms to cache
 */
Shader.prototype.cacheUniformLocations = function (keys)
{
    for (var i = 0; i < keys.length; ++i)
    {
        this.uniforms[keys[i]]._location = this.gl.getUniformLocation(this.program, keys[i]);
    }
};

/*
 * Caches the locations of the attribute for reuse
 * @param keys {string} the attributes to cache
 */
Shader.prototype.cacheAttributeLocations = function (keys)
{
    for (var i = 0; i < keys.length; ++i)
    {
        this.attributes[keys[i]] = this.gl.getAttribLocation(this.program, keys[i]);
    }

    // TODO: Check if this is needed anymore...

    // Begin worst hack eva //

    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    // maybe its something to do with the current state of the gl context.
    // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    // If theres any webGL people that know why could happen please help :)
    // if (this.attributes.aColor === -1){
    //     this.attributes.aColor = 2;
    // }

    // End worst hack eva //
};

/*
 * Attaches the shaders and creates the program
 * @return {WebGLProgram}
 */
Shader.prototype.compile = function ()
{
    var gl = this.gl;

    var glVertShader = this._glCompile(gl.VERTEX_SHADER, this.vertexSrc);
    var glFragShader = this._glCompile(gl.FRAGMENT_SHADER, this.fragmentSrc);

    var program = gl.createProgram();

    gl.attachShader(program, glVertShader);
    gl.attachShader(program, glFragShader);
    gl.linkProgram(program);

    // if linking fails, then log and cleanup
    if (!gl.getProgramParameter(program, gl.LINK_STATUS))
    {
        console.error('Pixi.js Error: Could not initialize shader.');
        console.error('gl.VALIDATE_STATUS', gl.getProgramParameter(program, gl.VALIDATE_STATUS));
        console.error('gl.getError()', gl.getError());

        // if there is a program info log, log it
        if (gl.getProgramInfoLog(program) !== '')
        {
            console.warn('Pixi.js Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));
        }

        gl.deleteProgram(program);
        program = null;
    }

    // clean up some shaders
    gl.deleteShader(glVertShader);
    gl.deleteShader(glFragShader);

    return (this.program = program);
};

/*
Shader.prototype.buildSync = function ()
{
   // var str = ""

   // str =  "Shader.prototype.syncUniforms = function()";
   // str += "{\n";

    for (var key in this.uniforms)
    {
        var uniform = this.uniforms[key];

        Object.defineProperty(this, key, {

            get: function ()
            {
                return uniform.value
            },
            set: function (value)
            {
                this.setUniform(uniform, value);
            }
        });

        console.log( makePropSetter( key, " bloop", uniform.type )  )
  //      Object.def
        //    location = uniform._location,
          //  value = uniform.value,
            //i, il;

    //    str += "gl.uniform1i(this.uniforms."+ key +"._location, this.uniforms." + key + ".value );\n"

    }

}*/

/**
* Adds a new uniform
*
* @param uniform {Object} the new uniform to attach
*/
Shader.prototype.syncUniform = function (uniform)
{
    var location = uniform._location,
        value = uniform.value,
        gl = this.gl,
        i, il;

    switch (uniform.type)
    {
        // single int value
        case 'i':
        case '1i':
            gl.uniform1i(location, value);
            break;

        // single float value
        case 'f':
        case '1f':
            gl.uniform1f(location, value);
            break;

        // Float32Array(2) or JS Arrray
        case '2f':
            gl.uniform2f(location, value[0], value[1]);
            break;

        // Float32Array(3) or JS Arrray
        case '3f':
            gl.uniform3f(location, value[0], value[1], value[2]);
            break;

        // Float32Array(4) or JS Arrray
        case '4f':
            gl.uniform4f(location, value[0], value[1], value[2], value[3]);
            break;

        // a 2D Point object
        case 'v2':
            gl.uniform2f(location, value.x, value.y);
            break;

        // a 3D Point object
        case 'v3':
            gl.uniform3f(location, value.x, value.y, value.z);
            break;

        // a 4D Point object
        case 'v4':
            gl.uniform4f(location, value.x, value.y, value.z, value.w);
            break;

        // Int32Array or JS Array
        case '1iv':
            gl.uniform1iv(location, value);
            break;

        // Int32Array or JS Array
        case '2iv':
            gl.uniform2iv(location, value);
            break;

        // Int32Array or JS Array
        case '3iv':
            gl.uniform3iv(location, value);
            break;

        // Int32Array or JS Array
        case '4iv':
            gl.uniform4iv(location, value);
            break;

        // Float32Array or JS Array
        case '1fv':
            gl.uniform1fv(location, value);
            break;

        // Float32Array or JS Array
        case '2fv':
            gl.uniform2fv(location, value);
            break;

        // Float32Array or JS Array
        case '3fv':
            gl.uniform3fv(location, value);
            break;

        // Float32Array or JS Array
        case '4fv':
            gl.uniform4fv(location, value);
            break;

        // Float32Array or JS Array
        case 'm2':
        case 'mat2':
        case 'Matrix2fv':
            gl.uniformMatrix2fv(location, uniform.transpose, value);
            break;

        // Float32Array or JS Array
        case 'm3':
        case 'mat3':
        case 'Matrix3fv':

            gl.uniformMatrix3fv(location, uniform.transpose, value);
            break;

        // Float32Array or JS Array
        case 'm4':
        case 'mat4':
        case 'Matrix4fv':
            gl.uniformMatrix4fv(location, uniform.transpose, value);
            break;

        // a Color Value
        case 'c':
            if (typeof value === 'number')
            {
                value = utils.hex2rgb(value);
            }

            gl.uniform3f(location, value[0], value[1], value[2]);
            break;

        // flat array of integers (JS or typed array)
        case 'iv1':
            gl.uniform1iv(location, value);
            break;

        // flat array of integers with 3 x N size (JS or typed array)
        case 'iv':
            gl.uniform3iv(location, value);
            break;

        // flat array of floats (JS or typed array)
        case 'fv1':
            gl.uniform1fv(location, value);
            break;

        // flat array of floats with 3 x N size (JS or typed array)
        case 'fv':
            gl.uniform3fv(location, value);
            break;

        // array of 2D Point objects
        case 'v2v':
            if (!uniform._array)
            {
                uniform._array = new Float32Array(2 * value.length);
            }

            for (i = 0, il = value.length; i < il; ++i)
            {
                uniform._array[i * 2]       = value[i].x;
                uniform._array[i * 2 + 1]   = value[i].y;
            }

            gl.uniform2fv(location, uniform._array);
            break;

        // array of 3D Point objects
        case 'v3v':
            if (!uniform._array)
            {
                uniform._array = new Float32Array(3 * value.length);
            }

            for (i = 0, il = value.length; i < il; ++i)
            {
                uniform._array[i * 3]       = value[i].x;
                uniform._array[i * 3 + 1]   = value[i].y;
                uniform._array[i * 3 + 2]   = value[i].z;

            }

            gl.uniform3fv(location, uniform._array);
            break;

        // array of 4D Point objects
        case 'v4v':
            if (!uniform._array)
            {
                uniform._array = new Float32Array(4 * value.length);
            }

            for (i = 0, il = value.length; i < il; ++i)
            {
                uniform._array[i * 4]       = value[i].x;
                uniform._array[i * 4 + 1]   = value[i].y;
                uniform._array[i * 4 + 2]   = value[i].z;
                uniform._array[i * 4 + 3]   = value[i].w;

            }

            gl.uniform4fv(location, uniform._array);
            break;

        // PIXI.Texture
        case 't':
        case 'sampler2D':

            if (!uniform.value || !uniform.value.baseTexture.hasLoaded)
            {
                break;
            }

            // activate this texture
            gl.activeTexture(gl['TEXTURE' + this.textureCount]);

            var texture = uniform.value.baseTexture._glTextures[gl.id];

            if (!texture)
            {
                this.initSampler2D(uniform);
            }

            // bind the texture
            gl.bindTexture(gl.TEXTURE_2D, texture);

            // set uniform to texture index
            gl.uniform1i(uniform._location, this.textureCount);

            // increment next texture id
            this.textureCount++;

            break;

        default:
            console.warn('Pixi.js Shader Warning: Unknown uniform type: ' + uniform.type);
    }
};

/*
 * Updates the shader uniform values.
 */
Shader.prototype.syncUniforms = function ()
{
    this.textureCount = 1;

    for (var key in this.uniforms)
    {
        this.syncUniform(this.uniforms[key]);
    }
};

/**
 * Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
 *
 */
Shader.prototype.initSampler2D = function (uniform)
{
    var gl = this.gl;

    var texture = uniform.value.baseTexture;

    if(!texture.hasLoaded)
    {
        return;
    }

    if (uniform.textureData)
    {

        //TODO move this...
        var data = uniform.textureData;

        texture._glTextures[gl.id] = gl.createTexture();

        gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);

        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
        // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);
        // GLTextureLinear = mag/min linear, wrap clamp
        // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat
        // GLTextureNearest = mag/min nearest, wrap clamp
        // AudioTexture = whatever + luminance + width 512, height 2, border 0
        // KeyTexture = whatever + luminance + width 256, height 2, border 0

        //  magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST
        //  wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT

        gl.texImage2D(gl.TEXTURE_2D, 0, data.luminance ? gl.LUMINANCE : gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);

        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, data.magFilter ? data.magFilter : gl.LINEAR );
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, data.wrapS ? data.wrapS : gl.CLAMP_TO_EDGE );

        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, data.wrapS ? data.wrapS : gl.CLAMP_TO_EDGE);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, data.wrapT ? data.wrapT : gl.CLAMP_TO_EDGE);
    }
    else
    {
        this.shaderManager.renderer.updateTexture(texture);
    }
};

/**
 * Destroys the shader.
 *
 */
Shader.prototype.destroy = function ()
{
    this.gl.deleteProgram(this.program);

    this.gl = null;
    this.uniforms = null;
    this.attributes = null;

    this.vertexSrc = null;
    this.fragmentSrc = null;
};

Shader.prototype._glCompile = function (type, src)
{
    var shader = this.gl.createShader(type);

    this.gl.shaderSource(shader, src);
    this.gl.compileShader(shader);

    if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
    {
        console.log(this.gl.getShaderInfoLog(shader));
        return null;
    }

    return shader;
};


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

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>

    Мы стали еще ближе к Вам

                                Нажмите
                                здесь,
                                чтобы увидеть сообщение в окне браузера.

                                IQOS стал еще ближе

                                            Мы делаем наш сервис максимально удобным для Вас и постоянно открываем новые фирменные магазины и точки выдачи заказов IQOS по всей России.

                                            БОЛЕЕ 170 ТОЧЕК ПРОДАЖ В САНКТ-ПЕТЕРБУРГЕ!

                                            Куда бы Вы ни отправились — IQOS будет рядом.

                                                                    Фирменные
магазины

                                                                    Партнеры
IQOS

                                                                    Автоматизиро-
ванные места
выдачи

                                                                    Мобильные
точки

<a href="https://www.iqos.ru/storelocator-search?desktop&utm_source=marketing&utm_medium=email&utm_content=button_1&utm_campaign=exp_distrib_announce_090417_SPB_clients" style="background-color:#0071dc; color:#ffffff; display:inline-block; font-family:Helvetica, Arial, sans-serif; font-size:24px; font-style:italic; line-height:66px; height:66px; text-align:center; text-decoration:none; width:241px; -webkit-text-size-adjust:none; mso-hide:all; border-radius: 5px;  background-image:url(http://pmi.nvtst.ru/iqos/1039128/button.png);">Все адреса

                                            ЕСЛИ ВЫ ЦЕНИТЕ СВОЕ ВРЕМЯ, ЗАКАЗЫВАЙТЕ ОНЛАЙН 24/7

                                Выбирайте:

                                                                Удобный для Вас способ
доставки стиков:

                                                                · Автоматизированные места выдачи

                                                                · Курьерская доставка

                                                                Комфортный способ оплаты:

                                                                При получении заказа ·

                                                                Банковской картой онлайн ·

                                            Или оформите подписку на доставку стиков онлайн и больше не беспокойтесь о том, что они закончатся.

                                                            Мы сами

                                                            · Напомним

                                                            · Бережно подготовим

                                                            · Доставим куда и когда Вам удобно

<a href="https://www.iqos.ru/kits/?desktop&utm_source=marketing&utm_medium=email&utm_content=button_2&utm_campaign=exp_distrib_announce_090417_SPB_clients" style="background-color:#0071dc; color:#ffffff; display:inline-block; font-family:Helvetica, Arial, sans-serif; font-size:24px; font-style:italic; line-height:66px; height:66px; text-align:center; text-decoration:none; width:241px; -webkit-text-size-adjust:none; mso-hide:all; border-radius: 5px;  background-image:url(http://pmi.nvtst.ru/iqos/1039128/button.png);">Купить онлайн

                                IQOS. Это меняет все.

                                            IQOS.RU

                                            Купить

                                            Где найти

                                            my@iqos.ru

                                            8-800-301-4767

                            Вы получили это сообщение, так как подтвердили свое согласие обществу с ограниченной ответственностью «Филип Моррис Сэйлз энд Маркетинг» на получение сообщений. Это персональное сообщение адресовано исключительно вам и не должно быть переадресовано другим лицам. Любое иное лицо, случайно или намеренно получившее доступ к этому сообщению, не может воспользоваться предложениями и возможностями, которые приведены в настоящем сообщении. Данная информация предназначается только для лиц старше 18 лет, которые являются потребителями табака. Пожалуйста, не отвечайте на данное сообщение, так как мы не сможем получить Ваш ответ по электронной почте.

                            В случае если информация, содержащаяся в данном сообщении, была получена вами вследствие возникновения технических ошибок отправки данного сообщения компанией ООО «Филип Моррис Сэйлз энд Маркетинг» или третьими лицами, то требования, обязательства и иные отношения, следующие из данного сообщения, не могут быть выполнены компанией; такие ошибки не могут считаться предумышленными и/или становиться предметом судебного разбирательства. Компания ООО «Филип Моррис Сэйлз энд Маркетинг» не несет ответственность за любые убытки, имеющие отношение или возникающие в результате получения вами настоящего сообщения, в том числе в результате каких-либо ошибок, прерываний связи, неисправностей, задержек, компьютерных вирусов, потери какой-либо прибыли или информации, несанкционированного доступа третьих лиц к вашей информации.

                                         Письмо № 10471

                                        Отписаться от рассылки


text:
.class public final Lorg/apache/http/impl/cookie/DateUtils;
.super Ljava/lang/Object;
.source "DateUtils.java"

# annotations
.annotation runtime Ljava/lang/Deprecated;
.end annotation

# static fields
.field public static final GMT:Ljava/util/TimeZone;

.field public static final PATTERN_ASCTIME:Ljava/lang/String; = "EEE MMM d HH:mm:ss yyyy"

.field public static final PATTERN_RFC1036:Ljava/lang/String; = "EEE, dd-MMM-yy HH:mm:ss zzz"

.field public static final PATTERN_RFC1123:Ljava/lang/String; = "EEE, dd MMM yyyy HH:mm:ss zzz"

# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-string/jumbo v0, "GMT"

    invoke-static {v0}, Ljava/util/TimeZone;->getTimeZone(Ljava/lang/String;)Ljava/util/TimeZone;

    move-result-object v0

    sput-object v0, Lorg/apache/http/impl/cookie/DateUtils;->GMT:Ljava/util/TimeZone;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static formatDate(Ljava/util/Date;)Ljava/lang/String;
    .locals 1

    invoke-static {p0}, Lorg/apache/http/client/utils/DateUtils;->formatDate(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static formatDate(Ljava/util/Date;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    invoke-static {p0, p1}, Lorg/apache/http/client/utils/DateUtils;->formatDate(Ljava/util/Date;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static parseDate(Ljava/lang/String;)Ljava/util/Date;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/apache/http/impl/cookie/DateParseException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-static {p0, v0, v0}, Lorg/apache/http/impl/cookie/DateUtils;->parseDate(Ljava/lang/String;[Ljava/lang/String;Ljava/util/Date;)Ljava/util/Date;

    move-result-object v0

    return-object v0
.end method

.method public static parseDate(Ljava/lang/String;[Ljava/lang/String;)Ljava/util/Date;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/apache/http/impl/cookie/DateParseException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-static {p0, p1, v0}, Lorg/apache/http/impl/cookie/DateUtils;->parseDate(Ljava/lang/String;[Ljava/lang/String;Ljava/util/Date;)Ljava/util/Date;

    move-result-object v0

    return-object v0
.end method

.method public static parseDate(Ljava/lang/String;[Ljava/lang/String;Ljava/util/Date;)Ljava/util/Date;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/apache/http/impl/cookie/DateParseException;
        }
    .end annotation

    invoke-static {p0, p1, p2}, Lorg/apache/http/client/utils/DateUtils;->parseDate(Ljava/lang/String;[Ljava/lang/String;Ljava/util/Date;)Ljava/util/Date;

    move-result-object v0

    if-eqz v0, :cond_0

    return-object v0

    :cond_0
    new-instance v1, Lorg/apache/http/impl/cookie/DateParseException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "Unable to parse the date "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lorg/apache/http/impl/cookie/DateParseException;-><init>(Ljava/lang/String;)V

    throw v1
.end method


text:
layout: post
title: Theme to be confirmed
date: 2017-11-29 19:30:00
leader: Nevyn
---


text:
@implementation ARBaseArrayInterface
@synthesize queryInfo;

#pragma mark -
#pragma mark Creation
+ (id)find:(ARFindSpecification)idOrSpecification
{
  return [self find:idOrSpecification
         connection:[ARBase defaultConnection]];
}
+ (id)find:(ARFindSpecification)idOrSpecification connection:(id<ARConnection>)connection
{
  return [self find:idOrSpecification
             filter:nil
							 join:nil
              order:nil
              limit:0
         connection:connection];
}
+ (id)find:(ARFindSpecification)idOrSpecification
           filter:(NSString *)whereSQL
						 join:(NSString *)joinSQL
						order:(NSString *)orderSQL
            limit:(NSUInteger)limit
{
	return [self find:idOrSpecification
						 filter:whereSQL
							 join:joinSQL
							order:orderSQL
							limit:limit
				 connection:[ARBase defaultConnection]];
}

+ (id)find:(ARFindSpecification)idOrSpecification
           filter:(NSString *)whereSQL
						 join:(NSString *)joinSQL
            order:(NSString *)orderSQL
            limit:(NSUInteger)limit
       connection:(id<ARConnection>)aConnection
{
	ARBaseArrayInterface *ret = [[self alloc] init];
	[ret.queryInfo setObject:[NSNumber numberWithInt:idOrSpecification] forKey:@"findSpecification"];
	if(whereSQL)
		[ret.queryInfo setObject:whereSQL forKey:@"whereSQL"];
	if(joinSQL)
		[ret.queryInfo setObject:joinSQL  forKey:@"joinSQL"];
	if(orderSQL)
		[ret.queryInfo setObject:orderSQL forKey:@"orderSQL"];
	[ret.queryInfo setObject:[NSNumber numberWithInt:limit] forKey:@"limit"];
	if(aConnection)
		[ret.queryInfo setObject:aConnection forKey:@"connection"];

	return [ret autorelease];
}
- (id)init
{
	if(![super init])
		return nil;
	self.queryInfo = [NSMutableDictionary dictionary];

	return self;
}

#pragma mark -
+ (NSString *)modelName
{
  NSMutableString *ret = [[[self className] mutableCopy] autorelease];
	[ret replaceOccurrencesOfString:@"ArrayInterface"
											 withString:@""
													options:0
														range:NSMakeRange(0, [ret length])];
	return ret;
}
+ (Class)modelClass
{
	return NSClassFromString([self modelName]);
}

#pragma mark -
#pragma mark Database access
- (NSArray *)matchingIds
{
	Class modelClass = [[self class] modelClass];
	return [modelClass findIds:[[queryInfo objectForKey:@"findSpecification"] intValue]
											filter:[queryInfo objectForKey:@"whereSQL"]
												join:[queryInfo objectForKey:@"joinSQL"]
											 order:[queryInfo objectForKey:@"orderSQL"]
											 limit:[queryInfo objectForKey:@"limit"]
									connection:[queryInfo objectForKey:@"connection"]];
}
- (NSArray *)allObjects
{
	Class modelClass = [[self class] modelClass];
	return (NSArray *)[modelClass find:[[queryInfo objectForKey:@"findSpecification"] intValue]
															filter:[queryInfo objectForKey:@"whereSQL"]
																join:[queryInfo objectForKey:@"joinSQL"]
															 order:[queryInfo objectForKey:@"orderSQL"]
															 limit:[[queryInfo objectForKey:@"limit"] intValue]
													connection:[queryInfo objectForKey:@"connection"]];
}
- (id)objectAtIndex:(NSUInteger)index
{
	// Fetch the id
	Class modelClass = [[self class] modelClass];
	NSArray *ids = [self matchingIds];
	if([ids count] > index)
		return [[[modelClass alloc] initWithId:[[[ids objectAtIndex:index] objectForKey:@"id"] unsignedIntValue]] autorelease];
	return nil;
}
- (id)lastObject
{
	NSUInteger count = [self count];
	if(count > 0)
		return [self objectAtIndex:count - 1];
	return nil;
}
- (void)addObject:(NSDictionary *)attributes
{
	[[[self class] modelClass] createWithAttributes:attributes connection:[queryInfo objectForKey:@"connection"]];
}

- (BOOL)removeObjectAtIndex:(NSUInteger)index
{
	return [[self objectAtIndex:index] destroy];
}

- (NSUInteger)count
{
	return [[self matchingIds] count];
}

#pragma mark -
#pragma mark KVC
- (NSArray *)valueForKey:(NSString *)key
{
	NSMutableArray *ret = [NSMutableArray array];
	for(ARBase *record in [self allObjects])
	{
		[ret addObject:[record valueForKey:key]];
	}
	return ret;
}
- (void)setValue:(id)value forKey:(NSString *)key
{
	for(ARBase *record in [self allObjects])
	{
		[record setValue:value forKey:key];
	}
}
@end


text:
package de.ahus1.lottery.adapter.dropwizard.pages;

import org.jboss.arquillian.drone.api.annotation.Drone;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import static org.assertj.core.api.Assertions.assertThat;

public class LoginPage<T extends Page> extends Page {

    @Drone
    private WebDriver browser;

    @FindBy(name = "username")
    private WebElement fieldUsername;

    @FindBy(name = "password")
    private WebElement fieldPassword;

    @FindBy(name = "login")
    private WebElement buttonLogin;

    private Class<T> clazz;

    @Override
    public void verify() {
        assertThat(browser.getTitle()).isEqualTo("Sign in to test");
    }

    public T login(String login, String password) {
        fieldUsername.sendKeys(login);
        fieldPassword.sendKeys(password);
        buttonLogin.click();
        return createPage(clazz);
    }

    public void setReturnPage(Class<T> returnPage) {
        this.clazz = returnPage;
    }
}


text:
<?php namespace Tests\Feature;

use App\Domain\GigStatus;
use App\Factory\GigFactory;
use App\Gig;
use App\Http\Livewire\Acp\GigForm;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;

class AcpGigsTest extends TestCase
{
    use BeAdmin;
    use DatabaseTransactions;

    public function testCreate()
    {
        $this->get('acp/gigs/create')
            ->assertOk()
            ->assertSeeLivewire(GigForm::class);
    }

    public function testEdit()
    {
        $gig = GigFactory::new()->create();

        $this->get("acp/gigs/{$gig->id}/edit")
            ->assertOk()
            ->assertSee($gig->title)
            ->assertSeeLivewire(GigForm::class);
    }

    public function testIndex()
    {
        GigFactory::new()->create();

        $this->get('acp/gigs')
            ->assertOk();
    }

    public function testShow()
    {
        $gig = GigFactory::new()->create();

        $this->get("acp/gigs/{$gig->id}")
            ->assertOk()
            ->assertSee($gig->title);
    }

    public function testStore()
    {
        $gig = GigFactory::new()->make();

        \Livewire::test(GigForm::class, ['gig' => new Gig])
            ->set('gig.city_id', $gig->city_id)
            ->set('gig.artist_id', $gig->artist_id)
            ->call('submit')
            ->assertHasNoErrors()
            ->assertRedirect('/acp/gigs');

        $this->get('acp/gigs')
            ->assertSee($gig->artist->title);
    }

    public function testUpdate()
    {
        $gig = GigFactory::new()->create();

        \Livewire::test(GigForm::class, ['gig' => $gig])
            ->set('gig.status', GigStatus::Hidden)
            ->call('submit')
            ->assertHasNoErrors()
            ->assertRedirect('/acp/gigs');

        $gig->refresh();

        $this->assertSame(GigStatus::Hidden, $gig->status);
    }
}


text:
<?php

$definition = array (
    'dep_transfer_only_explicit' => new ezcInputFormDefinitionElement(
        ezcInputFormDefinitionElement::OPTIONAL, 'boolean'
    ),
    'dep_transfer_exclude_hidden' => new ezcInputFormDefinitionElement(
        ezcInputFormDefinitionElement::OPTIONAL, 'boolean'
    ),
    'dep_transfer_exclude_disabled' => new ezcInputFormDefinitionElement(
        ezcInputFormDefinitionElement::OPTIONAL, 'boolean'
    )
);

$filter = array();
$filter['sort'] = 'sort_priority ASC, name ASC';

$form = new ezcInputForm( INPUT_POST, $definition );
$Errors = array();

if ( $form->hasValidData( 'dep_transfer_only_explicit' ) && $form->dep_transfer_only_explicit == true ) {
    $explicit = true;
} else {
    $explicit = false;
}

if ( $form->hasValidData( 'dep_transfer_exclude_hidden' ) && $form->dep_transfer_exclude_hidden == true ) {
    $filter['filter']['hidden'] = 0;
}

if ( $form->hasValidData( 'dep_transfer_exclude_disabled' ) && $form->dep_transfer_exclude_disabled == true ) {
    $filter['filter']['disabled'] = 0;
}

$chat = erLhcoreClassModelChat::fetch($Params['user_parameters']['chat_id']);

$tpl = erLhcoreClassTemplate::getInstance( 'lhchat/transferchatrefilter.tpl.php');
$tpl->set('departments_filter',array(
    'filter' => $filter,
    'explicit' => $explicit,
    'dep_id' => $chat->dep_id,
    'chat_id' => $chat->id
));

echo $tpl->fetch();

exit;
?>


text:
namespace base {

bool PathProviderAndroid(int key, FilePath* result) {
  switch (key) {
    case base::FILE_EXE: {
      FilePath bin_dir;
      if (!ReadSymbolicLink(FilePath(kProcSelfExe), &bin_dir)) {
        NOTREACHED() << "Unable to resolve " << kProcSelfExe << ".";
        return false;
      }
      *result = bin_dir;
      return true;
    }
    case base::FILE_MODULE:
      // dladdr didn't work in Android as only the file name was returned.
      NOTIMPLEMENTED();
      return false;
    case base::DIR_MODULE:
      return base::android::GetNativeLibraryDirectory(result);
    case base::DIR_SOURCE_ROOT:
      // Used only by tests.
      // In that context, hooked up via base/test/test_support_android.cc.
      NOTIMPLEMENTED();
      return false;
    case base::DIR_USER_DESKTOP:
      // Android doesn't support GetUserDesktop.
      NOTIMPLEMENTED();
      return false;
    case base::DIR_CACHE:
      return base::android::GetCacheDirectory(result);
    case base::DIR_ASSETS:
      // On Android assets are normally loaded from the APK using
      // base::android::OpenApkAsset(). In tests, since the assets are no
      // packaged, DIR_ASSETS is overridden to point to the build directory.
      return false;
    case base::DIR_ANDROID_APP_DATA:
      return base::android::GetDataDirectory(result);
    case base::DIR_ANDROID_EXTERNAL_STORAGE:
      return base::android::GetExternalStorageDirectory(result);
    default:
      // Note: the path system expects this function to override the default
      // behavior. So no need to log an error if we don't support a given
      // path. The system will just use the default.
      return false;
  }
}

}  // namespace base


text:
module Viewpoint::EWS::Types
  class Task
    include Viewpoint::EWS
    include Viewpoint::EWS::Types
    include Viewpoint::EWS::Types::Item
  end
end


text:
require 'spec_helper'

describe Gitlab::Metrics::Subscribers::ActiveRecord do
  let(:env) { {} }
  let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) }
  let(:subscriber)  { described_class.new }

  let(:event) do
    double(:event, duration: 2,
                   payload:  { sql: 'SELECT * FROM users WHERE id = 10' })
  end

  describe '#sql' do
    describe 'without a current transaction' do
      it 'simply returns' do
        expect_any_instance_of(Gitlab::Metrics::Transaction)
          .not_to receive(:increment)

        subscriber.sql(event)
      end
    end

    describe 'with a current transaction' do
      it 'observes sql_duration metric' do
        expect(subscriber).to receive(:current_transaction)
                                .at_least(:once)
                                .and_return(transaction)
        expect(described_class.send(:gitlab_sql_duration_seconds)).to receive(:observe).with({}, 0.002)
        subscriber.sql(event)
      end

      it 'increments the :sql_duration value' do
        expect(subscriber).to receive(:current_transaction)
          .at_least(:once)
          .and_return(transaction)

        expect(transaction).to receive(:increment)
          .with(:sql_duration, 2, false)

        expect(transaction).to receive(:increment)
          .with(:sql_count, 1, false)

        subscriber.sql(event)
      end

      context 'events are internal to Rails or irrelevant' do
        let(:schema_event) do
          double(
            :event,
            name: 'sql.active_record',
            payload: {
              sql: "SELECT attr.attname FROM pg_attribute attr INNER JOIN pg_constraint cons ON attr.attrelid = cons.conrelid AND attr.attnum = any(cons.conkey) WHERE cons.contype = 'p' AND cons.conrelid = '\"projects\"'::regclass",
              name: 'SCHEMA',
              connection_id: 135,
              statement_name: nil,
              binds: []
            },
            duration: 0.7
          )
        end

        let(:begin_event) do
          double(
            :event,
            name: 'sql.active_record',
            payload: {
              sql: "BEGIN",
              name: nil,
              connection_id: 231,
              statement_name: nil,
              binds: []
            },
            duration: 1.1
          )
        end

        let(:commit_event) do
          double(
            :event,
            name: 'sql.active_record',
            payload: {
              sql: "COMMIT",
              name: nil,
              connection_id: 212,
              statement_name: nil,
              binds: []
            },
            duration: 1.6
          )
        end

        it 'skips schema/begin/commit sql commands' do
          expect(subscriber).to receive(:current_transaction)
                                  .at_least(:once)
                                  .and_return(transaction)

          expect(transaction).not_to receive(:increment)

          subscriber.sql(schema_event)
          subscriber.sql(begin_event)
          subscriber.sql(commit_event)
        end
      end
    end
  end
end


text:
function SCIPincludeBranchrule(scip, name, desc, priority, maxdepth, maxbounddist, branchcopy, branchfree, branchinit, branchexit, branchinitsol, branchexitsol, branchexeclp, branchexecext, branchexecps, branchruledata)
    ccall((:SCIPincludeBranchrule, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Cstring, Cstring, Cint, Cint, Cdouble, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{SCIP_BRANCHRULEDATA}), scip, name, desc, priority, maxdepth, maxbounddist, branchcopy, branchfree, branchinit, branchexit, branchinitsol, branchexitsol, branchexeclp, branchexecext, branchexecps, branchruledata)
end

function SCIPincludeBranchruleBasic(scip, branchruleptr, name, desc, priority, maxdepth, maxbounddist, branchruledata)
    ccall((:SCIPincludeBranchruleBasic, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{Ptr{SCIP_BRANCHRULE}}, Cstring, Cstring, Cint, Cint, Cdouble, Ptr{SCIP_BRANCHRULEDATA}), scip, branchruleptr, name, desc, priority, maxdepth, maxbounddist, branchruledata)
end

function SCIPsetBranchruleCopy(scip, branchrule, branchcopy)
    ccall((:SCIPsetBranchruleCopy, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchcopy)
end

function SCIPsetBranchruleFree(scip, branchrule, branchfree)
    ccall((:SCIPsetBranchruleFree, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchfree)
end

function SCIPsetBranchruleInit(scip, branchrule, branchinit)
    ccall((:SCIPsetBranchruleInit, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchinit)
end

function SCIPsetBranchruleExit(scip, branchrule, branchexit)
    ccall((:SCIPsetBranchruleExit, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchexit)
end

function SCIPsetBranchruleInitsol(scip, branchrule, branchinitsol)
    ccall((:SCIPsetBranchruleInitsol, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchinitsol)
end

function SCIPsetBranchruleExitsol(scip, branchrule, branchexitsol)
    ccall((:SCIPsetBranchruleExitsol, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchexitsol)
end

function SCIPsetBranchruleExecLp(scip, branchrule, branchexeclp)
    ccall((:SCIPsetBranchruleExecLp, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchexeclp)
end

function SCIPsetBranchruleExecExt(scip, branchrule, branchexecext)
    ccall((:SCIPsetBranchruleExecExt, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchexecext)
end

function SCIPsetBranchruleExecPs(scip, branchrule, branchexecps)
    ccall((:SCIPsetBranchruleExecPs, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Ptr{Cvoid}), scip, branchrule, branchexecps)
end

function SCIPfindBranchrule(scip, name)
    ccall((:SCIPfindBranchrule, libscip), Ptr{SCIP_BRANCHRULE}, (Ptr{SCIP_}, Cstring), scip, name)
end

function SCIPgetBranchrules(scip)
    ccall((:SCIPgetBranchrules, libscip), Ptr{Ptr{SCIP_BRANCHRULE}}, (Ptr{SCIP_},), scip)
end

function SCIPgetNBranchrules(scip)
    ccall((:SCIPgetNBranchrules, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPsetBranchrulePriority(scip, branchrule, priority)
    ccall((:SCIPsetBranchrulePriority, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Cint), scip, branchrule, priority)
end

function SCIPsetBranchruleMaxdepth(scip, branchrule, maxdepth)
    ccall((:SCIPsetBranchruleMaxdepth, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Cint), scip, branchrule, maxdepth)
end

function SCIPsetBranchruleMaxbounddist(scip, branchrule, maxbounddist)
    ccall((:SCIPsetBranchruleMaxbounddist, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_BRANCHRULE}, Cdouble), scip, branchrule, maxbounddist)
end

function SCIPgetLPBranchCands(scip, lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars)
    ccall((:SCIPgetLPBranchCands, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{Ptr{Ptr{SCIP_VAR}}}, Ptr{Ptr{Cdouble}}, Ptr{Ptr{Cdouble}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), scip, lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars)
end

function SCIPgetNLPBranchCands(scip)
    ccall((:SCIPgetNLPBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioLPBranchCands(scip)
    ccall((:SCIPgetNPrioLPBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetExternBranchCands(scip, externcands, externcandssol, externcandsscore, nexterncands, nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls)
    ccall((:SCIPgetExternBranchCands, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{Ptr{Ptr{SCIP_VAR}}}, Ptr{Ptr{Cdouble}}, Ptr{Ptr{Cdouble}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), scip, externcands, externcandssol, externcandsscore, nexterncands, nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls)
end

function SCIPgetNExternBranchCands(scip)
    ccall((:SCIPgetNExternBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioExternBranchCands(scip)
    ccall((:SCIPgetNPrioExternBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioExternBranchBins(scip)
    ccall((:SCIPgetNPrioExternBranchBins, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioExternBranchInts(scip)
    ccall((:SCIPgetNPrioExternBranchInts, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioExternBranchImpls(scip)
    ccall((:SCIPgetNPrioExternBranchImpls, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioExternBranchConts(scip)
    ccall((:SCIPgetNPrioExternBranchConts, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPaddExternBranchCand(scip, var, score, solval)
    ccall((:SCIPaddExternBranchCand, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble, Cdouble), scip, var, score, solval)
end

function SCIPclearExternBranchCands(scip)
    ccall((:SCIPclearExternBranchCands, libscip), Cvoid, (Ptr{SCIP_},), scip)
end

function SCIPcontainsExternBranchCand(scip, var)
    ccall((:SCIPcontainsExternBranchCand, libscip), UInt32, (Ptr{SCIP_}, Ptr{SCIP_VAR}), scip, var)
end

function SCIPgetPseudoBranchCands(scip, pseudocands, npseudocands, npriopseudocands)
    ccall((:SCIPgetPseudoBranchCands, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{Ptr{Ptr{SCIP_VAR}}}, Ptr{Cint}, Ptr{Cint}), scip, pseudocands, npseudocands, npriopseudocands)
end

function SCIPgetNPseudoBranchCands(scip)
    ccall((:SCIPgetNPseudoBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioPseudoBranchCands(scip)
    ccall((:SCIPgetNPrioPseudoBranchCands, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioPseudoBranchBins(scip)
    ccall((:SCIPgetNPrioPseudoBranchBins, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioPseudoBranchInts(scip)
    ccall((:SCIPgetNPrioPseudoBranchInts, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetNPrioPseudoBranchImpls(scip)
    ccall((:SCIPgetNPrioPseudoBranchImpls, libscip), Cint, (Ptr{SCIP_},), scip)
end

function SCIPgetBranchScore(scip, var, downgain, upgain)
    ccall((:SCIPgetBranchScore, libscip), Cdouble, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble, Cdouble), scip, var, downgain, upgain)
end

function SCIPgetBranchScoreMultiple(scip, var, nchildren, gains)
    ccall((:SCIPgetBranchScoreMultiple, libscip), Cdouble, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cint, Ptr{Cdouble}), scip, var, nchildren, gains)
end

function SCIPgetBranchingPoint(scip, var, suggestion)
    ccall((:SCIPgetBranchingPoint, libscip), Cdouble, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble), scip, var, suggestion)
end

function SCIPcalcNodeselPriority(scip, var, branchdir, targetvalue)
    ccall((:SCIPcalcNodeselPriority, libscip), Cdouble, (Ptr{SCIP_}, Ptr{SCIP_VAR}, SCIP_BRANCHDIR, Cdouble), scip, var, branchdir, targetvalue)
end

function SCIPcalcChildEstimate(scip, var, targetvalue)
    ccall((:SCIPcalcChildEstimate, libscip), Cdouble, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble), scip, var, targetvalue)
end

function SCIPcreateChild(scip, node, nodeselprio, estimate)
    ccall((:SCIPcreateChild, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{Ptr{SCIP_NODE}}, Cdouble, Cdouble), scip, node, nodeselprio, estimate)
end

function SCIPbranchVar(scip, var, downchild, eqchild, upchild)
    ccall((:SCIPbranchVar, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Ptr{Ptr{SCIP_NODE}}, Ptr{Ptr{SCIP_NODE}}, Ptr{Ptr{SCIP_NODE}}), scip, var, downchild, eqchild, upchild)
end

function SCIPbranchVarHole(scip, var, left, right, downchild, upchild)
    ccall((:SCIPbranchVarHole, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble, Cdouble, Ptr{Ptr{SCIP_NODE}}, Ptr{Ptr{SCIP_NODE}}), scip, var, left, right, downchild, upchild)
end

function SCIPbranchVarVal(scip, var, val, downchild, eqchild, upchild)
    ccall((:SCIPbranchVarVal, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble, Ptr{Ptr{SCIP_NODE}}, Ptr{Ptr{SCIP_NODE}}, Ptr{Ptr{SCIP_NODE}}), scip, var, val, downchild, eqchild, upchild)
end

function SCIPbranchVarValNary(scip, var, val, n, minwidth, widthfactor, nchildren)
    ccall((:SCIPbranchVarValNary, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_VAR}, Cdouble, Cint, Cdouble, Cdouble, Ptr{Cint}), scip, var, val, n, minwidth, widthfactor, nchildren)
end

function SCIPbranchLP(scip, result)
    ccall((:SCIPbranchLP, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_RESULT}), scip, result)
end

function SCIPbranchExtern(scip, result)
    ccall((:SCIPbranchExtern, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_RESULT}), scip, result)
end

function SCIPbranchPseudo(scip, result)
    ccall((:SCIPbranchPseudo, libscip), SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_RESULT}), scip, result)
end


text:
from __future__ import absolute_import
from __future__ import print_function

import datetime
import logging
import random
import re
import string
import sys

import argparse
import mock
import simplejson
import yaml

from elastalert.config import load_modules
from elastalert.config import load_options
from elastalert.elastalert import ElastAlerter
from elastalert.elastalert import Elasticsearch
from elastalert.util import lookup_es_key
from elastalert.util import ts_now
from elastalert.util import ts_to_dt

logging.getLogger().setLevel(logging.INFO)
logging.getLogger('elasticsearch').setLevel(logging.WARNING)

def print_terms(terms, parent):
    """ Prints a list of flattened dictionary keys """
    for term in terms:
        if type(terms[term]) != dict:
            print('\t' + parent + term)
        else:
            print_terms(terms[term], parent + term + '.')

class MockElastAlerter(object):
    def __init__(self):
        self.data = []

    def test_file(self, args):
        """ Loads a rule config file, performs a query over the last day (args.days), lists available keys
        and prints the number of results. """
        filename = args.file
        with open(filename) as fh:
            conf = yaml.load(fh)
        load_options(conf)
        print("Successfully loaded %s\n" % (conf['name']))

        if args.schema_only:
            return []

        # Set up elasticsearch client and query
        es_client = Elasticsearch(host=conf['es_host'], port=conf['es_port'])
        start_time = ts_now() - datetime.timedelta(days=args.days)
        end_time = ts_now()
        ts = conf.get('timestamp_field', '@timestamp')
        query = ElastAlerter.get_query(conf['filter'], starttime=start_time, endtime=end_time, timestamp_field=ts)
        index = ElastAlerter.get_index(conf, start_time, end_time)

        # Get one document for schema
        try:
            res = es_client.search(index, size=1, body=query, ignore_unavailable=True)
        except Exception as e:
            print("Error running your filter:", file=sys.stderr)
            print(repr(e)[:2048], file=sys.stderr)
            return None
        num_hits = len(res['hits']['hits'])
        if not num_hits:
            return []

        terms = res['hits']['hits'][0]['_source']
        doc_type = res['hits']['hits'][0]['_type']

        # Get a count of all docs
        count_query = ElastAlerter.get_query(conf['filter'], starttime=start_time, endtime=end_time, timestamp_field=ts, sort=False)
        count_query = {'query': {'filtered': count_query}}
        try:
            res = es_client.count(index, doc_type=doc_type, body=count_query, ignore_unavailable=True)
        except Exception as e:
            print("Error querying Elasticsearch:", file=sys.stderr)
            print(repr(e)[:2048], file=sys.stderr)
            return None

        num_hits = res['count']
        print("Got %s hits from the last %s day%s" % (num_hits, args.days, 's' if args.days > 1 else ''))
        print("\nAvailable terms in first hit:")
        print_terms(terms, '')

        # Check for missing keys
        pk = conf.get('primary_key')
        ck = conf.get('compare_key')
        if pk and not lookup_es_key(terms, pk):
            print("Warning: primary key %s is either missing or null!", file=sys.stderr)
        if ck and not lookup_es_key(terms, ck):
            print("Warning: compare key %s is either missing or null!", file=sys.stderr)

        include = conf.get('include')
        if include:
            for term in include:
                if not lookup_es_key(terms, term) and '*' not in term:
                    print("Included term %s may be missing or null" % (term), file=sys.stderr)

        for term in conf.get('top_count_keys', []):
            # If the index starts with 'logstash', fields with .raw will be available but won't in _source
            if term not in terms and not (term.endswith('.raw') and term[:-4] in terms and index.startswith('logstash')):
                print("top_count_key %s may be missing" % (term), file=sys.stderr)
        print('')  # Newline

        # Download up to 10,000 documents to save
        if args.save and not args.count:
            try:
                res = es_client.search(index, size=10000, body=query, ignore_unavailable=True)
            except Exception as e:
                print("Error running your filter:", file=sys.stderr)
                print(repr(e)[:2048], file=sys.stderr)
                return None
            num_hits = len(res['hits']['hits'])
            print("Downloaded %s documents to save" % (num_hits))
            return res['hits']['hits']

        return None

    def mock_count(self, rule, start, end, index):
        """ Mocks the effects of get_hits_count using global data instead of Elasticsearch """
        count = 0
        for doc in self.data:
            if start <= ts_to_dt(doc[rule['timestamp_field']]) < end:
                count += 1
        return {end: count}

    def mock_hits(self, rule, start, end, index):
        """ Mocks the effects of get_hits using global data instead of Elasticsearch. """
        docs = []
        for doc in self.data:
            if start <= ts_to_dt(doc[rule['timestamp_field']]) < end:
                docs.append(doc)

        # Remove all fields which don't match 'include'
        for doc in docs:
            fields_to_remove = []
            for field in doc:
                if field != '_id':
                    if not any([re.match(incl.replace('*', '.*'), field) for incl in rule['include']]):
                        fields_to_remove.append(field)
            map(doc.pop, fields_to_remove)

        # Separate _source and _id, convert timestamps
        resp = [{'_source': doc, '_id': doc['_id']} for doc in docs]
        for doc in resp:
            doc['_source'].pop('_id')
        ElastAlerter.process_hits(rule, resp)
        return resp

    def mock_terms(self, rule, start, end, index, key, qk=None, size=None):
        """ Mocks the effects of get_hits_terms using global data instead of Elasticsearch. """
        if key.endswith('.raw'):
            key = key[:-4]
        buckets = {}
        for doc in self.data:
            if key not in doc:
                continue
            if start <= ts_to_dt(doc[rule['timestamp_field']]) < end:
                if qk is None or doc[rule['query_key']] == qk:
                    buckets.setdefault(doc[key], 0)
                    buckets[doc[key]] += 1
        counts = buckets.items()
        counts.sort(key=lambda x: x[1], reverse=True)
        if size:
            counts = counts[:size]
        buckets = [{'key': value, 'doc_count': count} for value, count in counts]
        return {end: buckets}

    def mock_elastalert(self, elastalert):
        """ Replaces elastalert's get_hits functions with mocks. """
        elastalert.get_hits_count = self.mock_count
        elastalert.get_hits_terms = self.mock_terms
        elastalert.get_hits = self.mock_hits
        elastalert.new_elasticsearch = mock.Mock()

    def run_elastalert(self, args):
        """ Creates an ElastAlert instance and run's over for a specific rule using either real or mock data. """
        # Mock configuration. Nothing here is used except run_every
        conf = {'rules_folder': 'rules',
                'run_every': datetime.timedelta(minutes=5),
                'buffer_time': datetime.timedelta(minutes=45),
                'alert_time_limit': datetime.timedelta(hours=24),
                'es_host': 'es',
                'es_port': 14900,
                'writeback_index': 'wb',
                'max_query_size': 100000,
                'old_query_limit': datetime.timedelta(weeks=1),
                'disable_rules_on_error': False}

        # Load and instantiate rule
        with open(args.file) as fh:
            rule = yaml.load(fh)
        load_options(rule)
        load_modules(rule)
        conf['rules'] = [rule]

        # If using mock data, make sure it's sorted and find appropriate time range
        timestamp_field = rule.get('timestamp_field', '@timestamp')
        if args.json:
            if not self.data:
                return
            try:
                self.data.sort(key=lambda x: x[timestamp_field])
                starttime = ts_to_dt(self.data[0][timestamp_field])
                endtime = self.data[-1][timestamp_field]
                endtime = ts_to_dt(endtime) + datetime.timedelta(seconds=1)
            except KeyError as e:
                print("All documents must have a timestamp and _id: %s" % (e), file=sys.stderr)
                return

            # Create mock _id for documents if it's missing
            used_ids = []

            def get_id():
                _id = ''.join([random.choice(string.letters) for i in range(16)])
                if _id in used_ids:
                    return get_id()
                used_ids.append(_id)
                return _id

            for doc in self.data:
                doc.update({'_id': doc.get('_id', get_id())})
        else:
            endtime = ts_now()
            starttime = endtime - datetime.timedelta(days=1)

        # Set run_every to cover the entire time range unless use_count_query or use_terms_query is set
        # This is to prevent query segmenting which unnecessarily slows down tests
        if not rule.get('use_terms_query') and not rule.get('use_count_query'):
            conf['run_every'] = endtime - starttime

        # Instantiate ElastAlert to use mock config and special rule
        with mock.patch('elastalert.elastalert.get_rule_hashes'):
            with mock.patch('elastalert.elastalert.load_rules') as load_conf:
                load_conf.return_value = conf
                if args.alert:
                    client = ElastAlerter(['--verbose'])
                else:
                    client = ElastAlerter(['--debug'])

        # Replace get_hits_* functions to use mock data
        if args.json:
            self.mock_elastalert(client)

        # Mock writeback for both real data and json data
        client.writeback_es = None
        with mock.patch.object(client, 'writeback') as mock_writeback:
            client.run_rule(rule, endtime, starttime)

            if mock_writeback.call_count:
                print("\nWould have written the following documents to elastalert_status:\n")
                for call in mock_writeback.call_args_list:
                    print("%s - %s\n" % (call[0][0], call[0][1]))

    def run_rule_test(self):
        """ Uses args to run the various components of MockElastAlerter such as loading the file, saving data, loading data, and running. """
        parser = argparse.ArgumentParser(description='Validate a rule configuration')
        parser.add_argument('file', metavar='rule', type=str, help='rule configuration filename')
        parser.add_argument('--schema-only', action='store_true', help='Show only schema errors; do not run query')
        parser.add_argument('--days', type=int, default=1, action='store', help='Query the previous N days with this rule')
        parser.add_argument('--data', type=str, metavar='FILENAME', action='store', dest='json', help='A JSON file containing data to run the rule against')
        parser.add_argument('--alert', action='store_true', help='Use actual alerts instead of debug output')
        parser.add_argument('--save-json', type=str, metavar='FILENAME', action='store', dest='save', help='A file to which documents from the last day or --days will be saved')
        parser.add_argument('--count-only', action='store_true', dest='count', help='Only display the number of documents matching the filter')
        args = parser.parse_args()

        if args.json:
            with open(args.json, 'r') as data_file:
                self.data = simplejson.loads(data_file.read())
        else:
            hits = self.test_file(args)
            if hits and args.save:
                with open(args.save, 'wb') as data_file:
                    # Add _id to _source for dump
                    [doc['_source'].update({'_id': doc['_id']}) for doc in hits]
                    data_file.write(simplejson.dumps([doc['_source'] for doc in hits], indent='    '))
        if not args.schema_only and not args.count:
            self.run_elastalert(args)

def main():
    test_instance = MockElastAlerter()
    test_instance.run_rule_test()

if __name__ == '__main__':
    main()


text:
package com.sms4blood.emergencyhealthservices;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.json.JSONObject;

import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.PolylineOptions;

public class MainActivity2 extends FragmentActivity {

    GoogleMap map;
    ArrayList<LatLng> markerPoints;
    TextView tvDistanceDuration;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main2);

        tvDistanceDuration = (TextView) findViewById(R.id.tv_distance_time);

        // Initializing
        markerPoints = new ArrayList<LatLng>();

        // Getting reference to SupportMapFragment of the activity_main
        SupportMapFragment fm = (SupportMapFragment)getSupportFragmentManager().findFragmentById(
                R.id.map);

        // Getting Map for the SupportMapFragment
        map = fm.getMap();

        // Enable MyLocation Button in the Map
        map.setMyLocationEnabled(true);

        // Setting onclick event listener for the map
        map.setOnMapClickListener(new OnMapClickListener() {

            @Override
            public void onMapClick(LatLng point) {

                // Already two locations
                if(markerPoints.size()>1){
                    markerPoints.clear();
                    map.clear();
                }

                // Adding new item to the ArrayList
                markerPoints.add(point);

                // Creating MarkerOptions
                MarkerOptions options = new MarkerOptions();

                // Setting the position of the marker
                options.position(point);

                /**
                 * For the start location, the color of marker is GREEN and
                 * for the end location, the color of marker is RED.
                 */
                if(markerPoints.size()==1){
                    options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
                }else if(markerPoints.size()==2){
                    options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
                }

                // Add new marker to the Google Map Android API V2
                map.addMarker(options);

                // Checks, whether start and end locations are captured
                if(markerPoints.size() >= 2){
                    LatLng origin = markerPoints.get(0);
                    LatLng dest = markerPoints.get(1);

                    // Getting URL to the Google Directions API
                    String url = getDirectionsUrl(origin, dest);

                    DownloadTask downloadTask = new DownloadTask();

                    // Start downloading json data from Google Directions API
                    downloadTask.execute(url);
                }
            }
        });
    }

    private String getDirectionsUrl(LatLng origin,LatLng dest){

        // Origin of route
        String str_origin = "origin="+origin.latitude+","+origin.longitude;

        // Destination of route
        String str_dest = "destination="+dest.latitude+","+dest.longitude;

        // Sensor enabled
        String sensor = "sensor=false";

        // Building the parameters to the web service
        String parameters = str_origin+"&"+str_dest+"&"+sensor;

        // Output format
        String output = "json";

        // Building the url to the web service
        String url = "https://maps.googleapis.com/maps/api/directions/"+output+"?"+parameters;

        return url;
    }

    /** A method to download json data from url */
    private String downloadUrl(String strUrl) throws IOException{
        String data = "";
        InputStream iStream = null;
        HttpURLConnection urlConnection = null;
        try{
            URL url = new URL(strUrl);

            // Creating an http connection to communicate with url
            urlConnection = (HttpURLConnection) url.openConnection();

            // Connecting to url
            urlConnection.connect();

            // Reading data from url
            iStream = urlConnection.getInputStream();

            BufferedReader br = new BufferedReader(new InputStreamReader(iStream));

            StringBuffer sb  = new StringBuffer();

            String line = "";
            while( ( line = br.readLine())  != null){
                sb.append(line);
            }

            data = sb.toString();

            br.close();

        }catch(Exception e){
            Log.d("Exception while downloading url", e.toString());
        }finally{
            iStream.close();
            urlConnection.disconnect();
        }
        return data;
    }

    // Fetches data from url passed
    private class DownloadTask extends AsyncTask<String, Void, String>{

        // Downloading data in non-ui thread
        @Override
        protected String doInBackground(String... url) {

            // For storing data from web service
            String data = "";

            try{
                // Fetching the data from web service
                data = downloadUrl(url[0]);
            }catch(Exception e){
                Log.d("Background Task",e.toString());
            }
            return data;
        }

        // Executes in UI thread, after the execution of
        // doInBackground()
        @Override
        protected void onPostExecute(String result) {
            super.onPostExecute(result);

            ParserTask parserTask = new ParserTask();

            // Invokes the thread for parsing the JSON data
            parserTask.execute(result);
        }
    }

    /** A class to parse the Google Places in JSON format */
    private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String,String>>> >{

        // Parsing the data in non-ui thread
        @Override
        protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {

            JSONObject jObject;
            List<List<HashMap<String, String>>> routes = null;

            try{
                jObject = new JSONObject(jsonData[0]);
                DirectionsJSONParser1 parser = new DirectionsJSONParser1();

                // Starts parsing data
                routes = parser.parse(jObject);
            }catch(Exception e){
                e.printStackTrace();
            }
            return routes;
        }

        // Executes in UI thread, after the parsing process
        @Override
        protected void onPostExecute(List<List<HashMap<String, String>>> result) {
            ArrayList<LatLng> points = null;
            PolylineOptions lineOptions = null;
            MarkerOptions markerOptions = new MarkerOptions();
            String distance = "";
            String duration = "";

            if(result.size()<1){
                Toast.makeText(getBaseContext(), "No Points", Toast.LENGTH_SHORT).show();
                return;
            }

            // Traversing through all the routes
            for(int i=0;i<result.size();i++){
                points = new ArrayList<LatLng>();
                lineOptions = new PolylineOptions();

                // Fetching i-th route
                List<HashMap<String, String>> path = result.get(i);

                // Fetching all the points in i-th route
                for(int j=0;j<path.size();j++){
                    HashMap<String,String> point = path.get(j);

                    if(j==0){    // Get distance from the list
                        distance = (String)point.get("distance");
                        continue;
                    }else if(j==1){ // Get duration from the list
                        duration = (String)point.get("duration");
                        continue;
                    }

                    double lat = Double.parseDouble(point.get("lat"));
                    double lng = Double.parseDouble(point.get("lng"));
                    LatLng position = new LatLng(lat, lng);

                    points.add(position);
                }

                // Adding all the points in the route to LineOptions
                lineOptions.addAll(points);
                lineOptions.width(2);
                lineOptions.color(Color.RED);
            }

            tvDistanceDuration.setText("Distance:"+distance + ", Duration:"+duration);

            // Drawing polyline in the Google Map for the i-th route
            map.addPolyline(lineOptions);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}


text:
namespace faint {

using Row = std::vector<std::string>;
using Rows = std::vector<Row>;

class ImageTable::ImageTableImpl {
public:
  ImageTableImpl(const std::string& pageTitle,
    const std::vector<utf8_string>& headings)
  {
    for (auto& h : headings){
      m_columnHeadings.emplace_back(h.str());
    }
    m_pageTitle = pageTitle;
  }

  void AddCell(const std::string& s){
    assert(m_rows.size() != 0);
    Row& row = m_rows.back();
    row.emplace_back(s);
    m_numCols = std::max(m_numCols, row.size());
  }

  void AddRow(){
    m_rows.emplace_back(Row());
  }

  std::string ToHtml() const{
    std::string html = std::string("<title>") + m_pageTitle  +
      "</title>

";
    for (const auto& heading : m_columnHeadings){
      html += "" + heading + "	";
    }
    html += "
";

    for (const auto& row : m_rows){
      html += "
";
      for (auto& cell : row){
        html += "" + cell + "	";
      }
      for (size_t colNum = row.size(); colNum < m_numCols; colNum++){
        html += "	";
      }
      html += "
";
    }
    html += "
";
    return html;
  }

private:
  std::string m_pageTitle;
  Row m_columnHeadings;
  Rows m_rows;
  size_t m_numCols = 0;
};

ImageTable::ImageTable(const std::string& title,
  const std::vector<utf8_string>& headings)
{
  m_impl = new ImageTableImpl(title, headings);
}

ImageTable::~ImageTable(){
  delete m_impl;
}

void ImageTable::AddRow(const std::string& label, const FileName& f1, const FileName& f2){
  m_impl->AddRow();

  m_impl->AddCell("" + label + ""); // Fixme
  std::stringstream ss;
  ss << "<img src='" << f1.Str() << "' onmouseover=\"this.src='" << f2.Str() <<
    "'\" onmouseout=\"this.src='" << f1.Str() << "'\"/>";
  m_impl->AddCell(ss.str());
  ss.str("");
  ss << "<img src='" << f2.Str() << "' onmouseover=\"this.src='" << f1.Str() <<
    "'\" onmouseout=\"this.src='" << f2.Str() << "'\"/>";
  m_impl->AddCell(ss.str());
}

std::string img_cell(const FileName& f){
  std::stringstream ss;
  ss << "<img src='" << f.Str() << "'\"/>";
  return ss.str();
}

void ImageTable::AddRow(const faint::utf8_string& label, const FileName& f1, const FileName& f2){
  AddRow(label.str(), f1, f2);
}

void ImageTable::AddRow(){
  m_impl->AddRow();
}

void ImageTable::AddCell(const std::string& cell){
  m_impl->AddCell(cell);
}

void ImageTable::AddCell(const utf8_string& cell){
  m_impl->AddCell(cell.str());
}

void ImageTable::AddCell(const FilePath& f){
  AddCell(f.StripPath());
}

void ImageTable::AddCell(const FileName& f){
  m_impl->AddCell(img_cell(f));
}

std::string ImageTable::ToHtml() const{
  return m_impl->ToHtml();
}

} // namespace