text:
package stroom.util.scheduler;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.IntStream;

/**
 * Class to figure out the next time we should fire based on a simple CRON
 * expression.
 *

 * E.g. 0 * * Every Hour 1,30 * * Every Half Hour
 */
public class SimpleCron {

    /**
     * Token to mean ANY time matches.
     */
    public static final String CRON_ANY = "*";
    private static final TimeZone UTC = TimeZone.getTimeZone("UTC");
    private final String expression;

    /**
     * List of 3 CRON parts.
     */
    private final List<CronPart> cronParts;

    private SimpleCron(final String expression) {
        this.expression = expression;

        if (expression == null) {
            throw new MalformedCronException("Cron expression cannot be null");
        }

        final String[] parts = expression.split(" ");
        if (parts.length != 3) {
            throw new MalformedCronException("Cron expression must contain 3 parts");
        }

        cronParts = new ArrayList<>(3);
        cronParts.add(new CronPart(Calendar.MINUTE, parts[0]));
        cronParts.add(new CronPart(Calendar.HOUR_OF_DAY, parts[1]));
        cronParts.add(new CronPart(Calendar.DAY_OF_MONTH, parts[2]));
    }

    /**
     * Factory method used to compile a cron expression and create a new
     * SimpleCron object. Note that any errors in the expression will result in
     * a MalformedCronException being thrown.
     *
     * @param expression The cron expression to compile into this SimpleCron object.
     */
    public static SimpleCron compile(final String expression) {
        return new SimpleCron(expression);
    }

    /**
     * Creates a new scheduler to be used with this cron object.
     */
    public Scheduler createScheduler() {
        return new SimpleCronScheduler(this);
    }

    /**
     * Move the supplied time forward or backward to get the previous and next
     * execution times.
     */
    private Long move(final long millis, final boolean forward) {
        final Calendar time = Calendar.getInstance();
        time.setTimeZone(UTC);
        time.setTimeInMillis(millis);
        // Wind back to start of minute
        time.set(Calendar.MILLISECOND, 0);
        time.set(Calendar.SECOND, 0);

        boolean hasRolled = false;

        // If we are going back in time then we will have already rolled by
        // resetting the millis and second parameters unless the time just
        // happened to be exactly the same after resetting these values.
        if (!forward) {
            if (time.getTimeInMillis() != millis) {
                hasRolled = true;
            }
        }

        // Loop through and try and roll
        for (int i = 0; i < cronParts.size(); i++) {
            hasRolled = move(i, time, hasRolled, forward);
        }

        return time.getTime().getTime();
    }

    /**
     * Try and move time until we have rolled OK. hasRolled only gets set to
     * false for the first order CRON.
     */
    private boolean move(final int cronIndex, final Calendar time, final boolean hasRolled, final boolean forward) {
        final CronPart cronEntry = cronParts.get(cronIndex);
        final int start = time.get(cronEntry.getCalendarType());

        // Should we roll (no if we have already rolled)
        boolean roll = !hasRolled;
        int value;
        do {
            // Move forward?
            if (roll) {
                if (forward) {
                    time.add(cronEntry.getCalendarType(), 1);
                } else {
                    time.add(cronEntry.getCalendarType(), -1);
                }

                // Reset lower order CRONS
                reset(cronIndex - 1, time, forward);
            } else {
                // Loop done once ... now OK to start rolling
                roll = true;
            }
            value = time.get(cronEntry.getCalendarType());

            // As soon as we have wrapped exit loop
            if (forward) {
                if (value < start) {
                    break;
                }
            } else {
                if (value > start) {
                    break;
                }
            }

            if (!cronEntry.hasMatches()) {
                // Match on ANY - Return as soon as we have rolled
                if (value != start || hasRolled) {
                    return true;
                }
            } else {
                // Return if new start is in our set
                final Integer match = cronEntry.match(value, forward);
                if (match != null) {
                    // Reset previous fields if we need to.
                    if (match != value) {
                        // Reset lower order CRONS
                        reset(cronIndex - 1, time, forward);
                    }

                    final int diff = match - value;
                    time.add(cronEntry.getCalendarType(), diff);

                    return true;
                }
            }
        } while (true);

        // Wrapped ... reset.
        reset(cronIndex, time, forward);
        return true;
    }

    /**
     * Used when the time wraps to set the time to the best CRON match. e.g. 2,8
     * for hours would move 0H to 2H.
     *

     * Also recurses into lower order CRON's.
     */
    private void reset(final int cronIndex, final Calendar time, final boolean forward) {
        // Do we have a CRON do to ?
        if (cronIndex >= 0) {
            final CronPart cronEntry = cronParts.get(cronIndex);
            if (forward) {
                if (cronEntry.hasMatches()) {
                    // Use the first CRON match
                    time.set(cronEntry.getCalendarType(), cronEntry.first());
                } else {
                    // Start will be fine.
                    time.set(cronEntry.getCalendarType(), 0);
                }
            } else {
                if (cronEntry.hasMatches()) {
                    // Use the last CRON match
                    time.set(cronEntry.getCalendarType(), cronEntry.last());
                } else {
                    // End will be fine.
                    if (cronEntry.getCalendarType() == Calendar.MINUTE) {
                        time.set(Calendar.MINUTE, 59);
                    } else if (cronEntry.getCalendarType() == Calendar.HOUR_OF_DAY) {
                        time.set(Calendar.HOUR_OF_DAY, 23);
                    } else if (cronEntry.getCalendarType() == Calendar.DAY_OF_MONTH) {
                        // We don't know how many days there are in the month so
                        // just keep subtracting months.
                        int month = 0;
                        do {
                            month = time.get(Calendar.DAY_OF_MONTH);
                            time.add(Calendar.DAY_OF_MONTH, -1);
                        } while (month != 0);
                    }
                }
            }

            // Recurse
            reset(cronIndex - 1, time, forward);
        }
    }

    /**
     * Given a time when should we run next.
     */
    public Long getNextTime(final Long millis) {
        return move(millis, true);
    }

    /**
     * Given a time when should we have last run.
     */
    public Long getLastTime(final Long millis) {
        return move(millis, false);
    }

    @Override
    public String toString() {
        return expression;
    }

    /**
     * Internal Class to hold CRON per calendar type.
     */
    private static class CronPart {

        private static final Pattern reNumericList = Pattern.compile("^(\\d+)(,\\d+)*$");
        private static final Pattern reInterval = Pattern.compile("^\\*\\/(\\d{1,2})$");
        private static final Pattern reRange = Pattern.compile("^(\\d+)-(\\d+)$");

        private final int calendarType;

        /**
         * CRON matches OR null if ANY match
         */
        private final int[] matches;

        public CronPart(final int calendarType, final String expression) {
            this.calendarType = calendarType;
            this.matches = buildMatches(expression);
        }

        /**
         * Build the CRON matches
         */
        @SuppressWarnings(value = "PZLA_PREFER_ZERO_LENGTH_ARRAYS") // private array ... designed to allow null
        private int[] buildMatches(final String expression) {
            if (CRON_ANY.equals(expression)) {
                return null;
            } else {
                // A comma-separated list of numeric values (e.g. 10,20,30)
                final Matcher numericListMatcher = reNumericList.matcher(expression);
                if (numericListMatcher.matches()) {
                    return buildMatchesFromList(expression);
                }

                // Expression is an interval like `*/10`
                final Matcher intervalMatcher = reInterval.matcher(expression);
                if (intervalMatcher.matches()) {
                    final int interval = Integer.parseInt(intervalMatcher.group(1));
                    return buildMatchesFromInterval(interval);
                }

                // A numeric range (e.g. 1-25)
                final Matcher rangeMatcher = reRange.matcher(expression);
                if (rangeMatcher.matches()) {
                    final int start = Integer.parseInt(rangeMatcher.group(1));
                    final int end = Integer.parseInt(rangeMatcher.group(2));
                    return buildMatchesFromRange(expression, start, end);
                }

                throw new MalformedCronException(
                    "Cron expression \"" + expression + "\" must be a list of comma-separated numbers," +
                            "an interval or a wildcard (*)");
            }
        }

        /**
         * Extract numeric values from a series of matches
         */
        private int[] buildMatchesFromList(final String expression) {
            return Arrays.stream(expression.split(",")).map(str -> {
                final int val = Integer.parseInt(str);

                switch (calendarType) {
                    case Calendar.MINUTE:
                        if (val < 0 || val > 59) {
                            throw new MalformedCronException(
                                    "Cron expression \"" + expression + "\" must be in the range 0-59 or *");
                        }
                        break;
                    case Calendar.HOUR_OF_DAY:
                        if (val < 0 || val > 23) {
                            throw new MalformedCronException(
                                    "Cron expression \"" + expression + "\" must be in the range 0-23 or *");
                        }
                        break;
                    case Calendar.DAY_OF_MONTH:
                        if (val < 1 || val > 31) {
                            throw new MalformedCronException(
                                    "Cron expression \"" + expression + "\" must be in the range 1-31 or *");
                        }
                        break;
                }

                return val;
            }).sorted().mapToInt(i -> i).toArray();
        }

        /**
         * Return a list of numbers, incrementing each iteration by the specified numeric interval
         */
        private int[] buildMatchesFromInterval(final int interval) {
            switch (calendarType) {
                case Calendar.MINUTE:
                    return IntStream.range(0, 59).filter(x -> x % interval == 0).toArray();
                case Calendar.HOUR_OF_DAY:
                    return IntStream.range(0, 23).filter(x -> x % interval == 0).toArray();
                case Calendar.DAY_OF_MONTH:
                    return IntStream.range(1, 31).filter(x -> x % interval == 0).toArray();
            }

            return null;
        }

        /**
         * Return a sequence of numbers between the specified start and end (inclusive), incrementing by one
         */
        private int[] buildMatchesFromRange(final String expression, final int start, final int end) {
            if (start > end) {
                throw new MalformedCronException(
                        "Cron expression range start (" + start + ") must be less than end (" + end + ")");
            }

            switch (calendarType) {
                case Calendar.MINUTE:
                    if (start < 0 || end > 59) {
                        throw new MalformedCronException(
                                "Cron expression \"" + expression + "\" must be in the range 0-59 or *");
                    }
                    return IntStream.range(start, end).toArray();
                case Calendar.HOUR_OF_DAY:
                    if (start < 0 || end > 23) {
                        throw new MalformedCronException(
                                "Cron expression \"" + expression + "\" must be in the range 0-23 or *");
                    }
                    return IntStream.range(start, end).toArray();
                case Calendar.DAY_OF_MONTH:
                    if (start < 1 || end > 31) {
                        throw new MalformedCronException(
                                "Cron expression \"" + expression + "\" must be in the range 1-31 or *");
                    }
                    return IntStream.range(start, end).toArray();
            }

            return null;
        }

        public int getCalendarType() {
            return calendarType;
        }

        public boolean hasMatches() {
            return matches != null && matches.length > 0;
        }

        public Integer match(final int value, final boolean forward) {
            if (forward) {
                for (int i = 0; i < matches.length; i++) {
                    if (matches[i] >= value) {
                        return matches[i];
                    }
                }
            } else {
                for (int i = matches.length - 1; i >= 0; i--) {
                    if (matches[i] <= value) {
                        return matches[i];
                    }
                }
            }

            return null;
        }

        public int first() {
            return matches[0];
        }

        public int last() {
            return matches[matches.length - 1];
        }
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/** servicePlanInfo. */
@Fluent
public final class MicrosoftGraphServicePlanInfo {
    /*
     * The object the service plan can be assigned to. Possible values:'User' - service plan can be assigned to
     * individual users.'Company' - service plan can be assigned to the entire tenant.
     */
    @JsonProperty(value = "appliesTo")
    private String appliesTo;

    /*
     * The provisioning status of the service plan. Possible values:'Success' - Service is fully provisioned.'Disabled'
     * - Service has been disabled.'PendingInput' - Service is not yet provisioned; awaiting service
     * confirmation.'PendingActivation' - Service is provisioned but requires explicit activation by administrator (for
     * example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a new service to the product SKU
     * and it has not been activated in the tenant, yet.
     */
    @JsonProperty(value = "provisioningStatus")
    private String provisioningStatus;

    /*
     * The unique identifier of the service plan.
     */
    @JsonProperty(value = "servicePlanId")
    private UUID servicePlanId;

    /*
     * The name of the service plan.
     */
    @JsonProperty(value = "servicePlanName")
    private String servicePlanName;

    /*
     * servicePlanInfo
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

    /** Creates an instance of MicrosoftGraphServicePlanInfo class. */
    public MicrosoftGraphServicePlanInfo() {
    }

    /**
     * Get the appliesTo property: The object the service plan can be assigned to. Possible values:'User' - service plan
     * can be assigned to individual users.'Company' - service plan can be assigned to the entire tenant.
     *
     * @return the appliesTo value.
     */
    public String appliesTo() {
        return this.appliesTo;
    }

    /**
     * Set the appliesTo property: The object the service plan can be assigned to. Possible values:'User' - service plan
     * can be assigned to individual users.'Company' - service plan can be assigned to the entire tenant.
     *
     * @param appliesTo the appliesTo value to set.
     * @return the MicrosoftGraphServicePlanInfo object itself.
     */
    public MicrosoftGraphServicePlanInfo withAppliesTo(String appliesTo) {
        this.appliesTo = appliesTo;
        return this;
    }

    /**
     * Get the provisioningStatus property: The provisioning status of the service plan. Possible values:'Success' -
     * Service is fully provisioned.'Disabled' - Service has been disabled.'PendingInput' - Service is not yet
     * provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit
     * activation by administrator (for example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a
     * new service to the product SKU and it has not been activated in the tenant, yet.
     *
     * @return the provisioningStatus value.
     */
    public String provisioningStatus() {
        return this.provisioningStatus;
    }

    /**
     * Set the provisioningStatus property: The provisioning status of the service plan. Possible values:'Success' -
     * Service is fully provisioned.'Disabled' - Service has been disabled.'PendingInput' - Service is not yet
     * provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit
     * activation by administrator (for example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a
     * new service to the product SKU and it has not been activated in the tenant, yet.
     *
     * @param provisioningStatus the provisioningStatus value to set.
     * @return the MicrosoftGraphServicePlanInfo object itself.
     */
    public MicrosoftGraphServicePlanInfo withProvisioningStatus(String provisioningStatus) {
        this.provisioningStatus = provisioningStatus;
        return this;
    }

    /**
     * Get the servicePlanId property: The unique identifier of the service plan.
     *
     * @return the servicePlanId value.
     */
    public UUID servicePlanId() {
        return this.servicePlanId;
    }

    /**
     * Set the servicePlanId property: The unique identifier of the service plan.
     *
     * @param servicePlanId the servicePlanId value to set.
     * @return the MicrosoftGraphServicePlanInfo object itself.
     */
    public MicrosoftGraphServicePlanInfo withServicePlanId(UUID servicePlanId) {
        this.servicePlanId = servicePlanId;
        return this;
    }

    /**
     * Get the servicePlanName property: The name of the service plan.
     *
     * @return the servicePlanName value.
     */
    public String servicePlanName() {
        return this.servicePlanName;
    }

    /**
     * Set the servicePlanName property: The name of the service plan.
     *
     * @param servicePlanName the servicePlanName value to set.
     * @return the MicrosoftGraphServicePlanInfo object itself.
     */
    public MicrosoftGraphServicePlanInfo withServicePlanName(String servicePlanName) {
        this.servicePlanName = servicePlanName;
        return this;
    }

    /**
     * Get the additionalProperties property: servicePlanInfo.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: servicePlanInfo.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the MicrosoftGraphServicePlanInfo object itself.
     */
    public MicrosoftGraphServicePlanInfo withAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void withAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}

redpajama_set_name: RedPajamaGithub


text:
class Player < ActiveRecord::Base
  belongs_to :game
  belongs_to :user
  has_many :owned_properties
  validates :name, presence: true
  validates :cash, presence: true
  validates_inclusion_of :in_jail, :in => [true, false]
  validates :position, presence: true
  after_initialize :init

  def init
    self.cash ||= 1500
    self.in_jail ||= false
    self.position ||= 0
  end
end


text:
'use strict';

var file = require('..');
var File = require('../lib/file');
var _ = require('lodash');

exports['file module'] = {
  'createEnv': function(test) {
    test.expect(6);
    var logger = { bar: 'foo' };
    var src = file.createEnv({
      write: false,
      encoding: 'usc2',
      logger: logger,
      base: 'src/'
    });

    test.equal(src.option('write'), false);
    test.equal(src.option('encoding'), 'usc2');
    test.equal(src.option('logger'), logger);
    test.equal(src.option('base'), 'src/');
    test.notEqual(src, file);
    test.ok(src instanceof File);
    test.done();
  }
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using MySql.Data.MySqlClient;
using System.Web.UI.WebControls;
using System.Data;
using System.Threading;
using AuditoriaParlamentar.Classes;

namespace AuditoriaParlamentar
{
    internal class Pesquisa
    {
        public const String PERIODO_MES_ATUAL = "Mês Atual";
        public const String PERIODO_MES_ANTERIOR = "Mês Anterior";
        public const String PERIODO_MES_ULT_4 = "Últimos 4 Meses";
        public const String PERIODO_ANO_ATUAL = "Ano Atual";
        public const String PERIODO_ANO_ANTERIOR = "Ano Anterior";
        public const String PERIODO_MANDATO_53 = "Legislatura 2007-2011";
        public const String PERIODO_MANDATO_54 = "Legislatura 2011-2015";
        public const String PERIODO_MANDATO_55 = "Legislatura 2015-2019";
        public const String PERIODO_INFORMAR = "Informar Período";
        public const String AGRUPAMENTO_PARLAMENTAR = "Por Parlamentar";
        public const String AGRUPAMENTO_FORNECEDOR = "Por Fornecedor";
        public const String AGRUPAMENTO_DESPESA = "Por Despesa";
        public const String AGRUPAMENTO_UF = "Por UF (Parlamentar)";
        public const String AGRUPAMENTO_PARTIDO = "Por Partido";
        public const String AGRUPAMENTO_DOCUMENTO = "Por Documento";

        public const Int32 INDEX_COLUNA_AUDITEI = 3;

        public static String AnoMesIni { get; set; }
        public static String AnoMesFim { get; set; }

        internal void Carregar(GridView grid, String userName, String documento, String periodo, String agrupamento, Boolean separarMes, String anoIni, String mesIni, String anoFim, String mesFim, ListItemCollection ItemsParlamentar, ListItemCollection ItemsDespesa, ListItemCollection ItemsFornecedor, ListItemCollection ItemsUF, ListItemCollection ItemsPartidos)
        {
            using(Banco banco = new Banco())
            {
                StringBuilder sqlCmd = new StringBuilder();
                StringBuilder sqlCampos = new StringBuilder();
                StringBuilder sqlFrom = new StringBuilder();
                StringBuilder sqlWhere = new StringBuilder();

                sqlFrom.Append("   FROM lancamentos");
                sqlWhere.Append(" WHERE lancamentos.ideCadastro > 0");

                switch (agrupamento)
                {
                    case AGRUPAMENTO_PARLAMENTAR:
                        sqlCampos.Append("   SELECT lancamentos.ideCadastro AS codigo,");
                        sqlCampos.Append("          lancamentos.txNomeParlamentar AS agrupamento,");
                        sqlCampos.Append("          lancamentos.sgUF,");
                        sqlCampos.Append("          lancamentos.sgPartido,");
                        sqlCampos.Append("          '' AS url,");

                        break;

                    case AGRUPAMENTO_DESPESA:
                        sqlCampos.Append("   SELECT lancamentos.numSubCota AS codigo,");
                        sqlCampos.Append("          despesas.txtDescricao AS agrupamento,");

                        sqlFrom.Append(", despesas");
                        sqlWhere.Append(" AND lancamentos.numSubCota = despesas.numSubCota");

                        break;

                    case AGRUPAMENTO_FORNECEDOR:
                        sqlCampos.Append("   SELECT lancamentos.txtCNPJCPF AS codigo,");
                        sqlCampos.Append("          SUBSTRING(IFNULL(fornecedores.txtbeneficiario, lancamentos.txtbeneficiario), 1, 50) AS txtbeneficiario,");
                        sqlCampos.Append("          lancamentos.txtCNPJCPF AS agrupamento,");
                        sqlCampos.Append("          CASE WHEN UserName IS NULL THEN '' ELSE 'Sim' END AS auditei,");
                        sqlCampos.Append("          fornecedores.DataUltimaNotaFiscal,");
                        sqlCampos.Append("          CASE WHEN doador = 1 THEN 'Sim' ELSE '' END AS doador,");

                        sqlFrom.Append(" LEFT JOIN fornecedores");
                        sqlFrom.Append("        ON fornecedores.txtCNPJCPF = lancamentos.txtCNPJCPF");
                        sqlFrom.Append(" LEFT JOIN fornecedores_visitado");
                        sqlFrom.Append("        ON fornecedores_visitado.txtCNPJCPF = lancamentos.txtCNPJCPF");
                        sqlFrom.Append("       AND fornecedores_visitado.UserName   = @UserName");

                        banco.AddParameter("UserName", System.Web.HttpContext.Current.User.Identity.Name);

                        break;

                    case AGRUPAMENTO_PARTIDO:
                        sqlCampos.Append("   SELECT lancamentos.sgPartido AS codigo,");
                        sqlCampos.Append("          lancamentos.sgPartido AS agrupamento,");

                        break;

                    case AGRUPAMENTO_UF:
                        sqlCampos.Append("   SELECT lancamentos.sgUF AS codigo,");
                        sqlCampos.Append("          lancamentos.sgUF AS agrupamento,");

                        break;

                    case AGRUPAMENTO_DOCUMENTO:
                        sqlCampos.Append("   SELECT CONCAT(lancamentos.txtNumero, '|', lancamentos.txtCNPJCPF) AS codigo,");
                        sqlCampos.Append("          lancamentos.txtNumero,");
                        sqlCampos.Append("          lancamentos.datEmissao,");
                        sqlCampos.Append("          lancamentos.txtCNPJCPF AS agrupamento,");
                        sqlCampos.Append("          SUBSTRING(IFNULL(fornecedores.txtbeneficiario, lancamentos.txtbeneficiario), 1, 50) AS txtbeneficiario,");
                        sqlCampos.Append("          parlamentares.nuDeputadoId,");
                        sqlCampos.Append("          lancamentos.numano,");
                        sqlCampos.Append("          lancamentos.ideDocumento,");

                        sqlFrom.Append(" LEFT JOIN fornecedores");
                        sqlFrom.Append("        ON fornecedores.txtCNPJCPF = lancamentos.txtCNPJCPF");
                        sqlFrom.Append(" LEFT JOIN parlamentares");
                        sqlFrom.Append("        ON parlamentares.ideCadastro = lancamentos.ideCadastro");

                        separarMes = false;

                        break;

                }

                DateTime dataIni = DateTime.Today;
                DateTime dataFim = DateTime.Today;

                switch (periodo)
                {
                    case PERIODO_MES_ATUAL:
                        sqlWhere.Append(" AND lancamentos.anoMes = @anoMes");
                        banco.AddParameter("anoMes", dataIni.ToString("yyyyMM"));
                        break;

                    case PERIODO_MES_ANTERIOR:
                        dataIni = dataIni.AddMonths(-1);
                        dataFim = dataIni.AddMonths(-1);
                        sqlWhere.Append(" AND lancamentos.anoMes = @anoMes");
                        banco.AddParameter("anoMes", dataIni.ToString("yyyyMM"));
                        break;

                    case PERIODO_MES_ULT_4:
                        dataIni = dataIni.AddMonths(-3);
                        sqlWhere.Append(" AND lancamentos.anoMes >= @anoMes");
                        banco.AddParameter("anoMes", dataIni.ToString("yyyyMM"));
                        break;

                    case PERIODO_ANO_ATUAL:
                        dataIni = new DateTime(dataIni.Year, 1, 1);
                        sqlWhere.Append(" AND lancamentos.anoMes >= @anoMes");
                        banco.AddParameter("anoMes", dataIni.ToString("yyyyMM"));
                        break;

                    case Pesquisa.PERIODO_MANDATO_53:
                        sqlWhere.Append(" AND lancamentos.anoMes BETWEEN 200702 AND 201101");
                        break;

                    case Pesquisa.PERIODO_MANDATO_54:
                        sqlWhere.Append(" AND lancamentos.anoMes BETWEEN 201102 AND 201501");
                        break;

                    case Pesquisa.PERIODO_MANDATO_55:
                        sqlWhere.Append(" AND lancamentos.anoMes BETWEEN 201502 AND 201901");
                        break;

                    case PERIODO_ANO_ANTERIOR:
                        dataIni = new DateTime(dataIni.Year, 1, 1).AddYears(-1);
                        dataFim = new DateTime(dataIni.Year, 12, 31);
                        sqlWhere.Append(" AND lancamentos.anoMes BETWEEN @anoMesIni AND @anoMesFim");
                        banco.AddParameter("anoMesIni", dataIni.ToString("yyyyMM"));
                        banco.AddParameter("anoMesFim", dataFim.ToString("yyyyMM"));
                        break;

                    case PERIODO_INFORMAR:
                        dataIni = new DateTime(Convert.ToInt32(anoIni), Convert.ToInt32(mesIni), 1);
                        dataFim = new DateTime(Convert.ToInt32(anoFim), Convert.ToInt32(mesFim), 1);
                        sqlWhere.Append(" AND lancamentos.anoMes BETWEEN @anoMesIni AND @anoMesFim");
                        banco.AddParameter("anoMesIni", dataIni.ToString("yyyyMM"));
                        banco.AddParameter("anoMesFim", dataFim.ToString("yyyyMM"));
                        break;
                }

                Int32 numMes = 0;

                if (separarMes == true)
                {
                    numMes = ((dataFim.Year - dataIni.Year) * 12) + dataFim.Month - dataIni.Month + 1;
                    DateTime dataIniTemp = new DateTime(dataIni.Year, dataIni.Month, 1);

                    for (Int32 i = 0; i < numMes; i++)
                    {
                        sqlCampos.Append("SUM(CASE WHEN anoMes = @AnoMes" + i.ToString() + " THEN vlrLiquido ELSE 0 END) AS '" + dataIniTemp.ToString("MM-yyyy") + "',");
                        banco.AddParameter("AnoMes" + i.ToString(), dataIniTemp.ToString("yyyyMM"));
                        dataIniTemp = dataIniTemp.AddMonths(1);
                    }
                }

                sqlCampos.Append(" SUM(lancamentos.vlrLiquido) AS vlrTotal");

                if (ItemsParlamentar != null)
                {
                    if (ItemsParlamentar.Count > 0)
                    {
                        if (ItemsParlamentar.Count == 1)
                        {
                            sqlWhere.Append(" AND lancamentos.ideCadastro = " + ItemsParlamentar[0].Value.ToString());
                        }
                        else
                        {
                            StringBuilder values = new StringBuilder();
                            for (Int32 i = 0; i < ItemsParlamentar.Count; i++)
                            {
                                if (i == 0)
                                    values.Append(ItemsParlamentar[i].Value.ToString());
                                else
                                    values.Append("," + ItemsParlamentar[i].Value.ToString());
                            }

                            sqlWhere.Append(" AND lancamentos.ideCadastro IN (" + values.ToString() + ")");
                        }
                    }
                }

                if (ItemsDespesa != null)
                {
                    if (ItemsDespesa.Count > 0)
                    {
                        if (ItemsDespesa.Count == 1)
                        {
                            sqlWhere.Append(" AND lancamentos.numSubCota = " + ItemsDespesa[0].Value.ToString());
                        }
                        else
                        {
                            StringBuilder values = new StringBuilder();
                            for (Int32 i = 0; i < ItemsDespesa.Count; i++)
                            {
                                if (i == 0)
                                    values.Append(ItemsDespesa[i].Value.ToString());
                                else
                                    values.Append("," + ItemsDespesa[i].Value.ToString());
                            }

                            sqlWhere.Append(" AND lancamentos.numSubCota IN (" + values.ToString() + ")");
                        }
                    }
                }

                if (ItemsFornecedor != null)
                {
                    if (ItemsFornecedor.Count > 0)
                    {
                        if (ItemsFornecedor.Count == 1)
                        {
                            sqlWhere.Append(" AND lancamentos.txtCNPJCPF = '" + ItemsFornecedor[0].Value.ToString() + "'");
                        }
                        else
                        {
                            StringBuilder values = new StringBuilder();
                            for (Int32 i = 0; i < ItemsFornecedor.Count; i++)
                            {
                                if (i == 0)
                                    values.Append("'" + ItemsFornecedor[i].Value.ToString() + "'");
                                else
                                    values.Append(",'" + ItemsFornecedor[i].Value.ToString() + "'");
                            }

                            sqlWhere.Append(" AND lancamentos.txtCNPJCPF IN (" + values.ToString() + ")");
                        }
                    }
                }

                if (ItemsUF != null)
                {
                    if (ItemsUF.Count > 0)
                    {
                        if (ItemsUF.Count == 1)
                        {
                            sqlWhere.Append(" AND lancamentos.sgUF = '" + ItemsUF[0].Value.ToString() + "'");
                        }
                        else
                        {
                            StringBuilder values = new StringBuilder();
                            for (Int32 i = 0; i < ItemsUF.Count; i++)
                            {
                                if (i == 0)
                                    values.Append("'" + ItemsUF[i].Value.ToString() + "'");
                                else
                                    values.Append(",'" + ItemsUF[i].Value.ToString() + "'");
                            }

                            sqlWhere.Append(" AND lancamentos.sgUF IN (" + values.ToString() + ")");
                        }
                    }
                }

                if (ItemsPartidos != null)
                {
                    if (ItemsPartidos.Count > 0)
                    {
                        if (ItemsPartidos.Count == 1)
                        {
                            sqlWhere.Append(" AND lancamentos.sgPartido = '" + ItemsPartidos[0].Value.ToString() + "'");
                        }
                        else
                        {
                            StringBuilder values = new StringBuilder();
                            for (Int32 i = 0; i < ItemsPartidos.Count; i++)
                            {
                                if (i == 0)
                                    values.Append("'" + ItemsPartidos[i].Value.ToString() + "'");
                                else
                                    values.Append(",'" + ItemsPartidos[i].Value.ToString() + "'");
                            }

                            sqlWhere.Append(" AND lancamentos.sgPartido IN (" + values.ToString() + ")");
                        }
                    }
                }

                if (documento!= null && documento != "")
                {
                    String[] valores = documento.Split('|');
                    sqlWhere.Append(" AND lancamentos.txtNumero  = '" + valores[0].Trim() + "'");
                    sqlWhere.Append(" AND lancamentos.txtCNPJCPF = '" + valores[1].Trim() + "'");
                }

                sqlCmd.Append(sqlCampos.ToString());
                sqlCmd.Append(sqlFrom.ToString());
                sqlCmd.Append(sqlWhere.ToString());

                switch (agrupamento)
                {
                    case AGRUPAMENTO_PARLAMENTAR:
                        sqlCmd.Append(" GROUP BY 1, 2, 3, 4, 5");

                        if (separarMes == true)
                            sqlCmd.Append(" ORDER BY " + (numMes + 6).ToString() + " DESC");
                        else
                            sqlCmd.Append(" ORDER BY 6 DESC");

                        break;

                    case AGRUPAMENTO_DESPESA:
                    case AGRUPAMENTO_PARTIDO:
                    case AGRUPAMENTO_UF:
                        sqlCmd.Append(" GROUP BY 1, 2");

                        if (separarMes == true)
                            sqlCmd.Append(" ORDER BY " + (numMes + 3).ToString() + " DESC");
                        else
                            sqlCmd.Append(" ORDER BY 3 DESC");

                        break;

                    case AGRUPAMENTO_FORNECEDOR:
                        sqlCmd.Append(" GROUP BY 1, 2, 3, 4, 5, 6");

                        if (separarMes == true)
                            sqlCmd.Append(" ORDER BY " + (numMes + 7).ToString() + " DESC");
                        else
                            sqlCmd.Append(" ORDER BY 7 DESC");

                        break;

                    case AGRUPAMENTO_DOCUMENTO:
                        sqlCmd.Append(" GROUP BY 1, 2, 3, 4, 5, 6, 7, 8");

                        //if (separarMes == true)
                        //    sqlCmd.Append(" ORDER BY " + (numMes + 6).ToString() + " DESC");
                        //else
                        //    sqlCmd.Append(" ORDER BY 6 DESC");

                        sqlCmd.Append(" ORDER BY lancamentos.datEmissao");

                        break;
                }

                sqlCmd.Append(" LIMIT 1000");

                DbEstatisticas.InsereEstatisticaPesquisa("DEPFEDERAL", agrupamento, periodo, userName, sqlCmd.ToString(), anoIni, mesIni, anoFim, mesFim);

                using (MySqlDataReader reader = banco.ExecuteReader(sqlCmd.ToString(), 300))
                {
                    DataTable table = new DataTable("agrupamento");
                    table.Load(reader);

                    if (agrupamento == AGRUPAMENTO_DOCUMENTO)
                    {
                        Int64 recibo = 0;

                        foreach (DataRow row in table.Rows)
                        {
                            if (Int64.TryParse(row[1].ToString(), out recibo))
                                row[1] = recibo.ToString("000000000");
                        }
                    }

                    FormataColunas(agrupamento, table);

                    grid.DataSource = table;
                    grid.DataBind();

                }
            }
        }

        private void FormataColunas(String agrupamento, DataTable table)
        {
            switch (agrupamento)
            {
                case AGRUPAMENTO_PARLAMENTAR:
                    table.Columns[1].ColumnName = "Parlamentar";
                    table.Columns[2].ColumnName = "UF";
                    table.Columns[3].ColumnName = "Partido";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;

                case AGRUPAMENTO_DESPESA:
                    table.Columns[1].ColumnName = "Despesa";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;

                case AGRUPAMENTO_FORNECEDOR:
                    table.Columns[1].ColumnName = "Razão Social";
                    table.Columns[2].ColumnName = "CNPJ/CPF";

                    //Setar a INDEX_COLUNA_AUDITEI
                    table.Columns[3].ColumnName = "Auditei?";

                    table.Columns[4].ColumnName = "Última NF";
                    table.Columns[5].ColumnName = "Doador?";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;

                case AGRUPAMENTO_PARTIDO:
                    table.Columns[1].ColumnName = "Partido";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;

                case AGRUPAMENTO_UF:
                    table.Columns[1].ColumnName = "UF";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;

                case AGRUPAMENTO_DOCUMENTO:
                    table.Columns[1].ColumnName = "NF/Recibo";
                    table.Columns[2].ColumnName = "Data Emissão";
                    table.Columns[3].ColumnName = "CNPJ/CPF";
                    table.Columns[4].ColumnName = "Razão Social/Nome";
                    table.Columns[table.Columns.Count - 1].ColumnName = "Valor Total";
                    break;
            }
        }

        internal void DocumentosFornecedor(GridView grid, String cnpj, String codParlamentar)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("    SELECT DISTINCT");
            sql.Append("           lancamentos.txNomeParlamentar,");
            sql.Append("           lancamentos.txtNumero,");
            sql.Append("           lancamentos.datEmissao,");
            sql.Append("           lancamentos.vlrDocumento,");
            sql.Append("           parlamentares.nuDeputadoId,");
            sql.Append("           lancamentos.numano,");
            sql.Append("           lancamentos.ideDocumento");
            sql.Append("      FROM lancamentos");
            sql.Append(" LEFT JOIN parlamentares");
            sql.Append("        ON parlamentares.ideCadastro = lancamentos.ideCadastro");
            sql.Append("     WHERE lancamentos.txtCNPJCPF    = @txtCNPJCPF");
            sql.Append("       AND lancamentos.ideCadastro   = @ideCadastro");
            sql.Append("  ORDER BY 1, 3 DESC");
            sql.Append("     LIMIT 1000");

            using (Banco banco = new Banco())
            {
                banco.AddParameter("txtCNPJCPF", cnpj);
                banco.AddParameter("ideCadastro", codParlamentar);

                using (MySqlDataReader reader = banco.ExecuteReader(sql.ToString(), 300))
                {
                    DataTable table = new DataTable("lancamentos");
                    table.Load(reader);

                    Int64 recibo = 0;

                    foreach (DataRow row in table.Rows)
                    {
                        if (Int64.TryParse(row[1].ToString(), out recibo))
                            row[1] = recibo.ToString("000000000");
                    }

                    table.Columns[0].ColumnName = "Deputado Federal";
                    table.Columns[1].ColumnName = "NF/Recibo";
                    table.Columns[2].ColumnName = "Data Emissão";
                    table.Columns[3].ColumnName = "Valor Documento";

                    grid.DataSource = table;
                    grid.DataBind();
                }
            }
        }
    }
}


text:
<?php

require_once dirname(__FILE__).'/../lib/Basesympal_adminActions.class.php';

/**
 * sympal_admin actions.
 *
 * @package    sfSympalAdminPlugin
 * @subpackage sympal_admin
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12534 2008-11-01 13:38:27Z Kris.Wallsmith $
 */
class sympal_adminActions extends Basesympal_adminActions
{
}


text:
#include "LocationObject.h"
#include "LocationState.h"
#include "IntVTime.h"

#include <vector>
#include <map>

#define SAMPLING_FREQ 20

using namespace std;

LocationObject::LocationObject( string locationName,
                                float transmissibility,
                                unsigned int latentDwellTime,
                                unsigned int incubatingDwellTime,
                                unsigned int infectiousDwellTime,
                                unsigned int asymptDwellTime,
                                float latentInfectivity,
                                float incubatingInfectivity,
                                float infectiousInfectivity,
                                float asymptInfectivity,
                                float probULU,
                                float probULV,
                                float probURV,
                                float probUIV,
                                float probUIU,
                                bool dataCaptureStatus,
                                unsigned int locStateRefreshInterval,
                                unsigned int locDiffusionTrigInterval,
                                vector <Person *> *personVec,
                                unsigned int travelTimeToHub,
                                unsigned int diseaseSeed,
                                unsigned int diffusionSeed) :
        locationName(locationName),
        personVec(personVec),
        dataCaptureStatus(dataCaptureStatus),
        countIntraLocDiseaseUpdate(0),
        locStateRefreshInterval(locStateRefreshInterval),
        locDiffusionTrigInterval(locDiffusionTrigInterval) {

    /* Create and seed the random number class */
    diseaseRandGen   = new RandomNumGen(diseaseSeed);
    diffusionRandGen = new RandomNumGen(diffusionSeed);

    /* Create the disease model */
    diseaseModel = new DiseaseModel(    transmissibility, latentDwellTime,
                                        incubatingDwellTime, infectiousDwellTime,
                                        asymptDwellTime, latentInfectivity,
                                        incubatingInfectivity, infectiousInfectivity,
                                        asymptInfectivity, probULU, probULV, probURV,
                                        probUIV, probUIU, diseaseRandGen );

    /* Create the diffusion network */
    diffusionNetwork = new DiffusionNetwork( diffusionRandGen, travelTimeToHub );
}

LocationObject::~LocationObject() {
    deallocateState(getState());

    delete personVec;
    delete diseaseRandGen;
    delete diffusionRandGen;
    delete diseaseModel;
    delete diffusionNetwork;
}

void LocationObject::initialize() {
    LocationState *myState = dynamic_cast<LocationState*>(getState());
    myState->populateLocation(personVec);

    /* Create and send the initial events */
    IntVTime currentTime = static_cast<const IntVTime&> (getSimulationTime());
    refreshLocStateEvent(currentTime);
    triggerDiffusionEvent(currentTime);
}

void LocationObject::finalize() {}

void LocationObject::executeProcess() {

    LocationState *myState = static_cast<LocationState*>(getState());
    IntVTime currentTime = dynamic_cast<const IntVTime&> (getSimulationTime());
    EpidemicEvent *recvEvent = NULL;
    SimulationObject *receiver = NULL;

    while(haveMoreEvents() == true) {

        recvEvent = (EpidemicEvent *) getEvent();
        if ( recvEvent != NULL ) {

            /* Check if the event was sent by the same location */
            if( recvEvent->getSender() == *(this->getObjectID()) ) {

                if( DISEASE == recvEvent->getDiseaseOrDiffusion() ) {
                    diseaseEventAndDataCapture( myState->getPersonMap(), currentTime );

                } else if( DIFFUSION == recvEvent->getDiseaseOrDiffusion() ){
                    migrateLocationEvent(currentTime, myState);
                    triggerDiffusionEvent(currentTime);

                } else {
                    cerr << "Invalid event at " << locationName << endl;
                    abort();
                }
            } else {
                int timeSpentInCurrState =
                        currentTime.getApproximateIntTime() -
                                            recvEvent->getTimeSpentInCurrState();
                ASSERT(timeSpentInCurrState >= 0);
                Person *person = new Person(recvEvent->getPID(),
                                            recvEvent->getSusceptibility(),
                                            recvEvent->getVaccinationStatus(),
                                            recvEvent->getInfectionState(),
                                            currentTime.getApproximateIntTime(),
                                            timeSpentInCurrState);
                (myState->getPersonMap())->insert(
                                std::pair <unsigned int, Person *> (recvEvent->getPID(), person) );
            }
        }
    }
}

State* LocationObject::allocateState() {
    return (new LocationState());
}

void LocationObject::deallocateState( const State *state ) {
    delete state;
}

void LocationObject::reclaimEvent(const Event *event) {
    delete event;
}

void LocationObject::refreshLocStateEvent( IntVTime currentTime ) {

    EpidemicEvent *refreshEvent = new EpidemicEvent(    currentTime,
                                                        currentTime + (int)locStateRefreshInterval,
                                                        this, this, NULL, DISEASE  );
    this->receiveEvent(refreshEvent);
}

void LocationObject::sendCapturedData( IntVTime currentTime,
                                       unsigned int uninfectedNum,
                                       unsigned int latentNum,
                                       unsigned int incubatingNum,
                                       unsigned int infectiousNum,
                                       unsigned int asymptNum,
                                       unsigned int recoveredNum ) {

    SimulationObject *receiver = getObjectHandle("writer");
    FileEvent *fileEvent = new FileEvent( currentTime, currentTime,
                                          this, receiver,
                                          locationName, countIntraLocDiseaseUpdate,
                                          uninfectedNum, latentNum, incubatingNum,
                                          infectiousNum, asymptNum, recoveredNum);
    receiver->receiveEvent(fileEvent);
}

void LocationObject::diseaseEventAndDataCapture( map <unsigned int, Person *> *personMap,
                                                 IntVTime currentTime ) {

    unsigned int uninfectedNum = 0, latentNum = 0, incubatingNum = 0,
                    infectiousNum = 0, asymptNum = 0, recoveredNum = 0;

    diseaseModel->diseaseReaction(  personMap,
                                    currentTime.getApproximateIntTime(),
                                    &uninfectedNum,
                                    &latentNum,
                                    &incubatingNum,
                                    &infectiousNum,
                                    &asymptNum,
                                    &recoveredNum );

    refreshLocStateEvent(currentTime);

    /* Send data to the file writer */
    if(dataCaptureStatus) {
        sendCapturedData( currentTime, uninfectedNum,
                          latentNum, incubatingNum,
                          infectiousNum, asymptNum,
                          recoveredNum );
    }

    countIntraLocDiseaseUpdate++;
}

void LocationObject::triggerDiffusionEvent( IntVTime currentTime ) {

    EpidemicEvent *diffusionEvent = new EpidemicEvent(  currentTime,
                                                        currentTime + (int)locDiffusionTrigInterval,
                                                        this, this, NULL, DIFFUSION  );
    this->receiveEvent(diffusionEvent);
}

void LocationObject::migrateLocationEvent(  IntVTime currentTime,
                                            LocationState *locationState  ) {

    /* Randomly decide whether to migrate any person */
    if( !diffusionRandGen->genRandNum(SAMPLING_FREQ) ) {

        /* Decide a random location */
        string selectedLocation = diffusionNetwork->getLocationName();
        if( "" != selectedLocation ) {

            int travelTime = (int) ( diffusionNetwork->travelTimeToChosenLoc(selectedLocation) );
            SimulationObject *receiver = getObjectHandle(selectedLocation);

            /* Decide a random person */
            Person *person = diffusionNetwork->getPerson( locationState->getPersonMap() );

            if(person) {
                EpidemicEvent *migrateLocEvent = new EpidemicEvent( currentTime,
                                                                    currentTime + travelTime,
                                                                    this,
                                                                    receiver,
                                                                    person,
                                                                    DIFFUSION );
                receiver->receiveEvent(migrateLocEvent);
                locationState->deletePersonFromLocation(person);
            }
        }
    }
}


text:
package base;

//the game engines functions by outputing data to one object that can both take input and be updated with the gamestate
public interface GameOutputable extends Updatable, InputResponder {

	public void setGame(Game game);

}


text:
(function () {
    /**
     * @class RWayTrie
     * @classdesc Data structure supporting String keys, for fast retrieval of values associated with string keys.
     * In comparison to a Map, has additional (fast) functions like list of keys with prefix
     * and listing all keys in sorted order. For large R the space requirement
     * for this DS is impractical (although in javascript arrays are sparse so its not the same)
     * , {@link TernarySearchTrie} can be more practical alternative.
     * [Reference: Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne]
     * @param R {Number} R is the alphabet size. For example when its known that string keys are made of ASCII chars
     * R can be set to  128.
     * @desc
     * #### Example -
     * ```js
     * var RWayTrie = require("dsjslib").RWayTrie
     * var rtrie=new RWayTrie(128)
     * ```
     */
    function RWayTrie(R) {
        if (!R || typeof R !== "number") {
            throw new Error("Invalid argument, R should be integer")
        }
        this.R = R;
        this.mkNode_ = function (value) {
            return {
                cPtrs : [],
                val : value || null
            }
        }
        this.root = this.mkNode_();

    }

    RWayTrie.prototype.putNode_ = function (key, val, node, pos) {
        if (pos === key.length) {
            node.val = val;
            return this;
        }
        var ptr = key.charCodeAt(pos);
        if (ptr > this.R) throw new Error("Character out of range " + ptr + " " + key.charAt(pos));
        if (!node.cPtrs[ptr])node.cPtrs[ptr] = this.mkNode_();
        return this.putNode_(key, val, node.cPtrs[ptr], ++pos);

    }
    /**
     * Insert a key value pair
     * @memberOf RWayTrie.prototype
     * @param key {String}
     * @param val {*}
     * @returns {RWayTrie} this
     */
    RWayTrie.prototype.put = function (key, val) {
        if (!(typeof key === 'string'))throw new Error("Only String keys are supported");
        if (!val)throw new Error("Null values are not supported");
        return this.putNode_(key, val, this.root, 0);
    }

    RWayTrie.prototype.getNode_ = function (key, node, pos) {
        var ptr = key.charCodeAt(pos);
        if (pos == key.length) {
            return node;
        }
        if (!node.cPtrs[ptr])return null;
        return this.getNode_(key, node.cPtrs[ptr], ++pos);

    }

    /**
     * Get value for a given key
     * @memberOf RWayTrie.prototype
     * @param key
     * @returns {*} value or null if key is not found
     */
    RWayTrie.prototype.get = function (key) {
        var node = this.getNode_(key, this.root, 0);
        return node && node.val;
    }

    /**
     * Return a list of all key, value pairs where
     * keys start with given prefix chars
     * @memberOf RWayTrie.prototype
     * @param prefix {String}
     * @return {Array} Array of objects {key:<key starting with prefix>,value:<v>}
     */
    RWayTrie.prototype.keysWithPrefix = function (prefix) {
        var keys = [];
        var startAtNode = this.getNode_(prefix, this.root, 0);
        if (startAtNode)this.keysWithPrefix_(startAtNode, prefix, keys);
        return keys;

    }

    /**
     *
     * @param node
     * @param collect
     * @param keys
     * @private
     */
    RWayTrie.prototype.keysWithPrefix_ = function (node, collect, keys) {
        if (node.val) {
            keys.push({key : collect, 'value' : node.val});
        }
        var that = this;
        node.cPtrs.forEach(function (e, i, arr) {
            var prefix = String.fromCharCode(i);
            that.keysWithPrefix_(e, (collect + prefix), keys);

        })

    }

    /**
     * Return a sorted list of all key value pairs
     * @memberOf RWayTrie.prototype
     * @returns {Array} Array of objects {key:<key >,value:<v>}
     */
    RWayTrie.prototype.entrySet = function () {
        var keys = [];
        this.keysWithPrefix_(this.root, "", keys);
        return keys;
    }

    RWayTrie.prototype.deleteNode_ = function (key, node, pos) {
        var ptr = key.charCodeAt(pos);
        if (pos === key.length) {
            node.val = null;
            return node;
        }
        if (!node.cPtrs[ptr])return null;
        var ret = this.deleteNode_(key, node.cPtrs[ptr], ++pos);
        if (ret && !ret.cPtrs.some(
            function (e) {
                return e
            }) &&
            !ret.val) {
            node.cPtrs.slice(ptr, 1);
            ret = null;
            return node;
        }
        return null;

    }
    /**
     * Delete a key value pair
     * @memberOf RWayTrie.prototype
     * @param key {String}
     */
    RWayTrie.prototype.delete = function (key) {
        return this.deleteNode_(key, this.root, 0);

    }

    module.exports = RWayTrie;
}());


text:
/*-----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 1999
 *
 * Prototypes for Hash.c
 *
 * -------------------------------------------------------------------------- */

#ifndef HASH_H
#define HASH_H

#include "BeginPrivate.h"

typedef struct hashtable HashTable; /* abstract */

/* Hash table access where the keys are StgWords */
HashTable * allocHashTable    ( void );
void *      lookupHashTable ( HashTable *table, StgWord key );
void        insertHashTable ( HashTable *table, StgWord key, void *data );
void *      removeHashTable ( HashTable *table, StgWord key, void *data );

int keyCountHashTable (HashTable *table);

/* Hash table access where the keys are C strings (the strings are
 * assumed to be allocated by the caller, and mustn't be deallocated
 * until the corresponding hash table entry has been removed).
 */
HashTable * allocStrHashTable ( void );

#define lookupStrHashTable(table, key)  \
   (lookupHashTable(table, (StgWord)key))

#define insertStrHashTable(table, key, data)  \
   (insertHashTable(table, (StgWord)key, data))

#define removeStrHashTable(table, key, data) \
   (removeHashTable(table, (StgWord)key, data))

/* Hash tables for arbitrary keys */
typedef int HashFunction(HashTable *table, StgWord key);
typedef int CompareFunction(StgWord key1, StgWord key2);
HashTable * allocHashTable_(HashFunction *hash, CompareFunction *compare);
int hashWord(HashTable *table, StgWord key);
int hashStr(HashTable *table, char *key);

/* Freeing hash tables
 */
void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) );

void exitHashTable ( void );

#include "EndPrivate.h"

#endif /* HASH_H */

// Local Variables:
// mode: C
// fill-column: 80
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End:


text:
module DeviseLdapNorm
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    class_option :user_model, :type => :string, :default => "user", :desc => "Model to update"
    class_option :update_model, :type => :boolean, :default => true, :desc => "Update model to change from database_authenticatable to ldap_authenticatable"
    class_option :add_rescue, :type => :boolean, :default => true, :desc => "Update Application Controller with resuce_from for DeviseLdapNorm::LdapException"
    class_option :advanced, :type => :boolean, :desc => "Add advanced config options to the devise initializer"

    def create_ldap_config
      copy_file "ldap.yml", "config/ldap.yml"
    end

    def create_default_devise_settings
      inject_into_file "config/initializers/devise.rb", default_devise_settings, :after => "Devise.setup do |config|\n"
    end

    def update_user_model
      gsub_file "app/models/#{options.user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable" if options.update_model?
    end

    def update_application_controller
      inject_into_class "app/controllers/application_controller.rb", ApplicationController, rescue_from_exception if options.add_rescue?
    end

    private

    def default_devise_settings
      settings = <<-eof
  # ==> LDAP Configuration
  # config.ldap_logger = true
  # config.ldap_create_user = false
  # config.ldap_update_password = true
  # config.ldap_config = "\#{Rails.root}/config/ldap.yml"
  # config.ldap_check_group_membership = false
  # config.ldap_check_group_membership_without_admin = false
  # config.ldap_check_attributes = false
  # config.ldap_use_admin_to_bind = false
  # config.ldap_ad_group_check = false

      eof
      if options.advanced?
        settings << <<-eof
  # ==> Advanced LDAP Configuration
  # config.ldap_auth_username_builder = Proc.new() {|attribute, login, ldap| "\#{attribute}=\#{login},\#{ldap.base}" }

        eof
      end

      settings
    end

    def rescue_from_exception
      <<-eof
  rescue_from DeviseLdapNorm::LdapException do |exception|
    render :text => exception, :status => 500
  end
      eof
    end

  end
end


text:
require 'spec_helper'

describe MonkeyParty::List, :vcr do
  let(:list_name) { "Testing" }
  let(:list) { MonkeyParty::List.find_by_name(list_name) }
  let(:subscriber) do
    MonkeyParty::Subscriber.new("auser@launchware.com")
  end

  describe "subscribing" do
    let(:bad_subscriber) do
      MonkeyParty::Subscriber.new("badEmail")
    end

    it "subscribes someone successfully" do
      subs = list.create_subscribers([subscriber], :double_optin => false)
      expect(subs[0]).to be_valid

      #clean up after yourself
      list.destroy_subscribers([subs[0]], :delete_member => true)
    end

    it "handles errors gracefully" do
      subs = list.create_subscribers([bad_subscriber])
      expect(subs[0]).to_not be_valid
    end

  end

  describe "unsubscribing" do
    after(:each) do
      list.destroy_subscribers([subscriber], :delete_member => true)
    end

    it 'should have valid subscribers' do
      subs = list.create_subscribers([subscriber], :double_optin => false)
      expect(subs[0]).to be_valid
      subs = list.destroy_subscribers([subscriber])
      expect(subs[0]).to be_valid
    end
  end
end


text:
package org.openehealth.ipf.commons.ihe.hl7v2.storage;

/**
 * Interface for storages of of HL7 v2 unsolicited fragmentation accumulators.
 *
 * @author Dmytro Rud
 */
public interface UnsolicitedFragmentationStorage {

    /**
     * Puts a fragment accumulator into the storage.
     * @param key
     *      Key consisting of MSH-14/DSC-1, MSH-3-1, MSH-3-2, MSH-3-3.
     * @param accumulator
     *      Accumulator to be stored.
     */
    void put(String key, StringBuilder accumulator);

    /**
     * Returns the fragment accumulator which corresponds to the given key
     * and removes it from the storage.
     * @param key
     *      Key consisting of MSH-14/DCS-1, MSH-3-1, MSH-3-2, MSH-3-3.
     * @return
     *      Accumulator or null when none found.
     */
    StringBuilder getAndRemove(String key);
}


text:
package scray.hdfs.io.index.format.raw

import java.io.InputStream
import com.typesafe.scalalogging.LazyLogging

import scray.hdfs.io.read.FileParameter;

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import com.google.common.util.concurrent.SettableFuture
import com.google.common.util.concurrent.ListenableFuture
import java.util.ArrayList
import org.apache.hadoop.security.UserGroupInformation
import java.security.PrivilegedAction

class RawFileReader(hdfsURL: String, hdfsConf: Configuration, user: String) extends LazyLogging {

  var dataReader: FileSystem = null; // scalastyle:off null
  val remoteUser: UserGroupInformation = UserGroupInformation.createRemoteUser(user)

  def this(hdfsURL: String, user: String) {
    this(hdfsURL, new Configuration, user)
  }

  if (getClass.getClassLoader != null) {
    hdfsConf.setClassLoader(getClass.getClassLoader)
  }

  def initReader() = {

    hdfsConf.set("fs.hdfs.impl", classOf[org.apache.hadoop.hdfs.DistributedFileSystem].getName);
    hdfsConf.set("fs.file.impl", classOf[org.apache.hadoop.fs.LocalFileSystem].getName);
    hdfsConf.set("dfs.client.use.datanode.hostname", "true");
    hdfsConf.set("fs.defaultFS", hdfsURL)

    remoteUser.doAs(new PrivilegedAction[Unit] {
      def run(): Unit = {
        dataReader = FileSystem.get(hdfsConf);
      }
    })
  }

  def read(path: String): InputStream = {
    if (dataReader == null) {
      logger.debug(s"Reader for path ${path} was not initialized. Will do it now")
      initReader
    }
    remoteUser.doAs(new PrivilegedAction[InputStream] {
      def run(): InputStream = {
        return dataReader.open(new Path(path))
      }
    })
  }

  def deleteFile(path: String) {
    if (dataReader == null) {
      logger.debug(s"Reader for path ${path} was not initialized. Will do it now")
      initReader
    }

    remoteUser.doAs(new PrivilegedAction[Unit] {
      def run(): Unit = {
        dataReader.delete(new Path(path), true)
      }
    })
  }

  def getFileList(path: String): ListenableFuture[java.util.List[FileParameter]] = {
    val fileList = SettableFuture.create[java.util.List[FileParameter]]();

    if (dataReader == null) {
      initReader
    }

    try {
      val fileIter = dataReader.listStatus(new Path(path)).iterator
      val fileParameters: java.util.List[FileParameter] = new ArrayList[FileParameter](100)

      while (fileIter.hasNext) {
        val currentFile = fileIter.next()

        currentFile.isDirectory()
        val fileParamteter = new FileParameter(currentFile.getLen, path, currentFile.getPath.getName, currentFile.getModificationTime, currentFile.isFile())
        fileParameters.add(fileParamteter)
      }
      fileList.set(fileParameters)
    } catch {
      case e: Throwable => {
        logger.error("Unable to get filelist")
        fileList.setException(e);
      }
    }

    return fileList;
  }
}


text:
package de.ioexception.me.http;

import java.util.Hashtable;

/**
 * @author Benjamin Erb
 */
public interface HttpResponse
{
	public byte[] getEntity();

	public int getStatusCode();

	public Hashtable getHeaders();
}


text:
describe('team.js test', function() {
	var $controller, $rootScope, controller, $scope;

	beforeEach( function() {
		module('teamform-team-app');
		inject(function(_$controller_,_$rootScope_,_$firebaseObject_,_$firebaseArray_) {
			$controller=_$controller_;
			$rootScope=_$rootScope_;
			$firebaseObject = _$firebaseObject_;
			$firebaseArray = _$firebaseArray_;
		});
	});
	describe('team.js Function tests', function() {
		beforeEach(function() {
			$scope=$rootScope.$new();
			controller = $controller('TeamCtrl', {$scope: $scope});
		});
		it('testing retreive', function() {
			expect($scope.refreshViewRequestsReceived()).toBeUndefined();
		});
	});
});


text:
class String
  # see if string has any content
  def blank?; self.length.zero?; end

  # strip space after :, remove newlines, replace multiple spaces with only one space, remove comments
  def strip_space!
    replace self.gsub(/:\s*/, ":").gsub(/\n/, "").gsub(/\s+/, " ").gsub(/(\/\*).*?(\*\/)/, "")
  end

  # remove newlines, insert space after comma, replace two spaces with one space after comma
  def strip_selector_space!
    replace self.gsub(/\n/, "").gsub(",", ", ").gsub(",  ", ", ")
  end

  # remove leading whitespace, remove end whitespace
  def strip_side_space!
    replace self.gsub(/^\s+/, "").gsub(/\s+$/, $/)
  end
end

class NilClass
  def blank?
    true
  end
end

class File
  # string output from file
  def self.path_to_string(path)
    File.new(path).read
  end

  # saves a string to a specified file path
  def self.string_to_file(string, path)
    directory = File.dirname(path)
    FileUtils.mkdir_p directory unless File.directory?(directory)
    File.open(path, "w") { |f| f << string }
  end
end


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>disabled</title>
</head>
<body>
    <!-- 1. Define some markup -->
    <button type="button">Select</button>
    <input disabled type="text" value="Lorem ipsum">

    <!-- 2. Include library -->
    <script src="../dist/select.js"></script>

    <!-- 3. Select! -->
    <script>
    var input = document.querySelector('input');
    var button = document.querySelector('button');

    button.addEventListener('click', function(e) {
        var selected = select(input);
        console.log(selected);
    });
    </script>
</body>
</html>


text:
Grouchy Robot Site

A webcomic theme for Jekyll based on my [Slim-Pickins](https://github.com/chrisanthropic/slim-pickins-jekyll-theme) Jekyll theming framework.

*All content included for the demo page is duplicated from my wife's [webcomic site](http://www.shamseecomic.com) and is availabe via Creative Commons.*

## Basic features include:

* Jekyll 3.0 compatible
* SASS
* Minimal Zurb Foundation 6 Integration
    * Responsive grid
    * Visibility classes
* Responsive navigation
* Responsive Comic Images (using SRCSET)
* Optional responsive full-width banner (using SRCSET)
* Sticky footer
* Thumbnail creation plugin
* **Javascript free**
* Custom Rakefile with tasks for deploying, minifying, and notifying search engines about updates
* image_optim plugin to optimize all images
* Basic SEO

### SASS
Includes the following variables for easy customization:

**Base Colors**

* $primary-color
* $secondary-color
* $complimentary-color
* $body-bg
* $body-font-color

**Links**

* $link-color
* $link-hover-color
* $link-visited-color

**Text**

* $base-font-family
* $base-font-size
* $small-font-size
* $base-line-height

**Primary Navbar Settings**

* $navbar-height
* $navbar-color
* $navbar-text-color
* $navbar-hover-color
* $navbar-active-color
* $navbar-font-size
* $navbar-font-family

**Socials Navbar Settings**

* $socials-font-color
* $socials-font-size

**Comic Settings**

* $comic-nav-background
* $comic-nav-height
* $comic-border-color
* $comic-border-width
* $comic-nav-color
* $comic-nav-hover
* $archive-border-color
* $archive-border-width
* $archive-hover-color
* $figcaption-background-color
* $figcaption-text-color

**Utility**

* $spacing-unit

**Footer**

* $footer-height
* $footer-color

### GRID
Uses minimal sass from Zurb Foundation:

* [grid](http://foundation.zurb.com/sites/docs/grid.html)

### NAVIGATION
A fully responsive navigation bar with the following features:

* 2 navigation areas
  * Left - Primary navigation
  * Right - Social media links
* Both navigation areas are populated using Jekyll 'data' files, nav.yml and socials.yml respectively
* Easily customizable text, link, and background colors using the supplied sass variables

### BANNER
This theme is configured with a 'wrap' of 1920px so banner images look best at that width.

First it checks a pages yaml frontmatter for the header image, if none is found then it checks for a site-wide default in your config.yml, if none is found then no banner image is displayed.

**Site-Wide**
You can set a site-wide default banner image by adding the following to your _config.yml:
  `header_image: "path/to/image.jpg"`

**Per Page**
You can also override it per page by adding the following code to a pages yaml front matter:
  `header_image: path/to/image.jpg`

### STICKY FOOTER
I like my footers to stay on the bottom of the page no matter what. You can easily edit the size and color using the supplied sass variables.

### JAVASCRIPT FREE
The only thing in the theme that uses Javascript is the optional use of google analytics.

### RAKEFILE
Includes the following custom tasks:

* *minify_html* - uses HTML_compressor to minify HTML
* *notify* - pings google and bing to notify them about changes to the site/sitemap

These 3 tasks have been bundled into custom build and deploy tasks

* *build* - runs `jekyll build` followed by `minify_html`
* *deploy* - runs `s3_website push` and then `notify`

### IMAGE_OPTIM PLUGIN

* Custom [image_optim](https://github.com/chrisanthropic/image_optim-jekyll-plugin) plugin will optimize all images in the /images folder and any subdirectories
  * Uses the original [image_optim](https://github.com/toy/image_optim)
* Cache file is created on the first run so that only updated/new images are optimized

## Basic Use

For things to work properly you'll need to do the following:

* **config.yml** - permalink settings of "permalink: /:categories/:title/" are expected
* **categories** - add "categories: name-of-comic" to your yml front matter for comics/posts. Add a single category that reflects the name of your comic.

**Front Page**

The main page will always show the most recent comic and will autopopulate the navigation for next/previous/archives.
You can disable the sidebar by adding "sidebar:false" to the yml frontmatter.

**Character Bios**

This page uses Jekyll's data feauture to populate the page.
It offers the following data inputs:

* Character Name
* Character Image
* Characater Bio

Edit _data/characters.yml to fit your needs and it will autopopulate the character bios page.

**Thumbnail Archive**

In order to use the thumbnail archive page you'll need to add "thumbnail: /path/to/thumb.jpg" to the yml front matter for your comic posts.

The _includes/category.html template will automatically pull the thumbnails from the posts and display them.

**About Page**
This page uses Jekyll's data feauture to populate the page. I feel like I'm abusing it's intended purposes, but it works nicely.

It offers the following data inputs for information about the comic:

* **pic:** "/path/to/image.jpg"
* **tagline:** "tagline of the comic."
* **blurb:** "Summary of the story. Displayed in italics."
* **misc:** "anything else you want to mention after the blurb."
* **important:** "listed at the end, in bold"
* **amazon:** "link to your comic on amazon"
* **comixology:** "link to your comic in comixology"
* **drivethru:** "link to your comic on DriveThruComics"
* **gumroad:** "link to your comic on gumroad"

It offer the following data inputs for information about the creators:

* **title:** "author/artist/cook/etc"
* **pic:** "/path/to/image.jpg"
* **info:** "bio stuff to make you sound interesting"
* **twitter:**
* **facebook:**
* **tumblr:**
* **googleplus:**
* **web:**

**Thumbnailer**

A thumbnailer plugin is icluded by default. You'll need to add this to your config.yml:

```
# Autogenerate thumbs for comics
mini_magick:

#Create Thumbs for the Archive Page
    thumbnail:
      source: images/comics/
      destination: /images/comics/thumbs
      resize: "182x280"

#Autogenerate smaller size for small screens
    small:
      source: images/comics/
      destination: /images/comics/small
      resize: "350x535"
```

This will create 2 sizes of 'thumbnails' from any images in the `/images/comics` directory:

* thumbs is used for the thumbnail archive page
* small is used for smaller sized screens instead of using the full sized image
  * this makes loading times faster and saves on bandwidth, it's the same technique we use for our banner image

**SEO**

* Google Analytics (optional)
  * just add your `google_universal_analytics` ID to the config.yml file
* Facebook Opengraph
  Fill out the following in your config.yml

  ```
    facebook_app_id:                      #enter your App ID
    facebook_locale: en_US
    facebook_page:                        #the URL of your Facebook Page
    facebook_image:			#enter a default image (at least 200x200px) to use here for posts/pages that don't have one.
  ```

* Twitter Cards
  Fill out the following in your config.yml

  ```
    twitter_user:
    twitter_card: true
    twitter_image: 			 #enter a default image (at least 200x200px) to use here for posts/pages that don't have one.
  ```

* Keywords
  You can set default sitewide keywords or keywords per post/page. Keywords will show up in the metadata of the page/post.
  * Sitewide: add `keywords: stuff, things, comics` to your config.yml
  * Per page/post: add `keywords: new stuff, other things, comics` to the frontmatter of your page/post

### Installation

For now it's best to start fresh or install the theme and then transfer over any old files (posts, images, etc) from your previous site.

* Git clone this repo, and cd into the directory.
* run `bundle install --binstubs --path=vendor` to install the required dependencies.
* Transfer over any old stuff.

* Edit your config.yml file
  * Change the title and description at a minimum.
* Update your navigation
  * edit the `_data/nav.yml` file as needed
* Update your social links
  * edit the `_data/socials.yml` file as needed
* Update your about page
  * edit the `_data/about.yml` file as needed
* Update your characters page
  * edit the `_data/characters.yml` file as needed
* For google analytics just add your google_universal_analytics ID to the _config.yml file

## Deploying
I use S3 to host my site and the [s3_website](https://github.com/laurilehmijoki/s3_website) plugin to deploy, if you don't do both of these, delete the `s3_website.yml` file and edit the deploy raketask to fit your needs.

If you plan on using S3 make sure you edit the configs:

* FIRST - add the s3_website.yml file to your gitignore so your credentials don't end up on the web.
* s3_website.yml
  * add your `s3_id`. `s3_secret`, and `s3_bucket`
* Update the Rakefile notify task to use your url
  * replace `site = "www.YOUR-URL.com"` with your actual url.

## MISC.
The comic posts included are duplicated from my wife's [webcomic site](http://www.shamseecomic.com) and are availabe via Creative Commons.


text:
angular.module('tuscany').factory('trip', [
	'$http',
	'auth',
function(
	$http,
	auth
){
	var trip = {};
	var REQUIRED_TRIP_FIELDS = ["name", "destination", "start_date", "transportation"];

	trip.get = function(id){
		return $http.get('/trips/' + id, { headers: auth.header }).then(function(res){
			return res.data;
		});
	};

	trip.getTrips = function(){
		return $http.get('/trips', { headers: auth.header });
	};

	trip.deleteTrip = function(trip){
		return $http.post('/trips/' + trip._id + '/delete', null, { headers: auth.header });
	};

	trip.updateTrip = function(id, updateObj){
		return $http.put('/trips/' + id + '/update', updateObj, { headers: auth.header });
	};

	trip.prettyDate = function(date){
		var d = new Date(date);
		return d.toDateString();
	};

	trip.createTrip = function(newTrip){
		return $http.post('/trips/create', newTrip, { headers: auth.header });
	};

	trip.verifyAllFieldsPresent = function(trip, mode){
		for(i = 0; i < REQUIRED_TRIP_FIELDS.length; i++){
			if(!(REQUIRED_TRIP_FIELDS[i] in trip) || !trip[REQUIRED_TRIP_FIELDS[i]]){
				return {valid: false, message: "Oops! You're missing field " + REQUIRED_TRIP_FIELDS[i]};
			}
		}
		if (!trip.same_day && !trip.end_date){
			return {valid: false, message: "Oops! You're missing a trip field"};
		}
		return {valid: true};
	};

	return trip;
}]);


text:
<?php

// Get our incoming string
$incoming_post = file_get_contents("php://input");
if(count($incoming_post)) {

    // Decode the JSON
    $json = json_decode($incoming_post);

    $body = $json->body;
    $to = $json->to;
    $from = $json->from;
    $id = $json->id;

    error_log("To   : " . $to, 0);
    error_log("From : " . $from, 0);
    error_log("Id   : " . $id, 0);
    error_log("Body : " . $body, 0);

    // To get the full detail, see the call to getMessageLookup in the 'demo_send.php' SDK file
}

// Always return a 200 code
http_response_code(200);


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape>
            <solid android:color="#ffffffff"/>
            <corners android:radius="2.0dp"/>
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <solid android:color="@color/simple_exo_style_color"/>
                <corners android:radius="2.0dip"/>
            </shape>
        </clip>
    </item>
</layer-list>


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
    <title>Hello World with React</title>