text:
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* Switches the .NET runtime version from 3.5 to something higher.
 *
 * Note that this should only be copied into a Unity project if using Unity 2017 or higher.
 * If it appears in an earlier version, it will cause a compiler error even if not being
 * used. Must be inside of an Editor folder anywhere in the Assets directory. After changing
 * runtimes, the editor must be restarted, and this does not appear to occur automatically.
 */

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;

[InitializeOnLoad]
public class RuntimeSwitcher {
  public static void SwitchToLatest(){
    PlayerSettings.scriptingRuntimeVersion = ScriptingRuntimeVersion.Latest;
  }
}

redpajama_set_name: RedPajamaGithub


text:
#include "misc.h"
#include "lf.h"
#include "table.h"

#include "filter.h"

#include "ld-decode.h"
#include "ld-insn.h"

#include "gen-model.h"

#ifndef NULL
#define NULL 0
#endif

void
gen_model_h (lf *file, insn_table *table)
{
  lf_print__this_file_is_empty (file, "suffering bit rot");
}

void
gen_model_c (lf *file, insn_table *table)
{
  lf_print__this_file_is_empty (file, "suffering bit rot");
}


text:
/**
 *
 * Dismisses the currently displayed alert dialog. For confirm() and prompt()
 * dialogs, this is equivalent to clicking the 'Cancel' button. For alert()
 * dialogs, this is equivalent to clicking the 'OK' button.
 *
 * <example>
    :alertDismiss.js
    // close a dialog box if is opened
    client.alertText( function( err, res ) {
        if ( res != null ) {
            this.alertDismiss()
        }
    });
 * </example>
 *
 * @see  https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/dismiss_alert
 * @type protocol
 *
 */

module.exports = function alertDismiss () {

    var requestOptions = {
        path: '/session/:sessionId/dismiss_alert',
        method: 'POST'
    };

    return this.requestHandler.create(requestOptions);

};


text:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>TodoExercice</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" type="text/css" href="./assets/css/todomvc-app.css">
  <link rel="stylesheet" type="text/css" href="./assets/css/todomvc-common.css">
  <link rel="stylesheet" type="text/css" href="./assets/css/global.css">
</head>
<body>
  <app-root>Loading...</app-root>
</body>
</html>


text:
package org.apache.skywalking.aop.server.receiver.mesh;

import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.oal.rt.CoreOALDefine;
import org.apache.skywalking.oap.server.core.oal.rt.OALEngineLoaderService;
import org.apache.skywalking.oap.server.core.server.GRPCHandlerRegister;
import org.apache.skywalking.oap.server.library.module.ModuleDefine;
import org.apache.skywalking.oap.server.library.module.ModuleProvider;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
import org.apache.skywalking.oap.server.receiver.sharing.server.SharingServerModule;
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;

public class MeshReceiverProvider extends ModuleProvider {
    @Override
    public String name() {
        return "default";
    }

    @Override
    public Class<? extends ModuleDefine> module() {
        return MeshReceiverModule.class;
    }

    @Override
    public ConfigCreator newConfigCreator() {
        return null;
    }

    @Override
    public void prepare() throws ServiceNotProvidedException, ModuleStartException {
    }

    @Override
    public void start() throws ServiceNotProvidedException, ModuleStartException {
        // load official analysis
        getManager().find(CoreModule.NAME)
                    .provider()
                    .getService(OALEngineLoaderService.class)
                    .load(CoreOALDefine.INSTANCE);

        getManager().find(CoreModule.NAME)
                    .provider()
                    .getService(OALEngineLoaderService.class)
                    .load(MeshOALDefine.INSTANCE);

        TelemetryDataDispatcher.init(getManager());
        GRPCHandlerRegister service = getManager().find(SharingServerModule.NAME)
                                                  .provider()
                                                  .getService(GRPCHandlerRegister.class);
        MeshGRPCHandler meshGRPCHandler = new MeshGRPCHandler(getManager());
        service.addHandler(meshGRPCHandler);
    }

    @Override
    public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {

    }

    @Override
    public String[] requiredModules() {
        return new String[] {
            TelemetryModule.NAME,
            CoreModule.NAME,
            SharingServerModule.NAME
        };
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2015 Google Inc. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/box"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="@dimen/spacing_normal"
    android:paddingLeft="@dimen/padding_normal"
    android:paddingRight="@dimen/padding_normal">

    <ImageView
        android:id="@+id/icon"
        android:layout_width="@dimen/social_icon_size"
        android:layout_height="@dimen/social_icon_size"
        android:layout_marginEnd="@dimen/padding_normal"
        android:layout_marginRight="@dimen/padding_normal"
        android:layout_marginTop="@dimen/spacing_normal"
        android:contentDescription="@null"
        android:layout_alignParentLeft="true"
        android:src="@drawable/ic_navview_my_schedule" />

    <TextView
        android:id="@+id/slot_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_normal"
        android:layout_toRightOf="@id/icon"
        android:ellipsize="end"
        android:textColor="@color/body_text_1"
        android:textSize="@dimen/text_size_medium"
        tools:text="@string/placeholder_session_title" />

    <TextView
        android:id="@+id/start_end_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_micro"
        android:layout_below="@id/slot_title"
        android:layout_toRightOf="@id/icon"
        android:gravity="bottom"
        android:textSize="@dimen/text_size_small"
        android:textColor="@color/body_text_2"/>

    <TextView
        android:id="@+id/slot_room"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/start_end_time"
        android:layout_toRightOf="@id/icon"
        android:textSize="@dimen/text_size_small" />

    <!-- "LIVE NOW" indicator -->
    <include
        layout="@layout/include_live_now_badge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_micro"
        android:layout_below="@id/slot_room"
        android:layout_toRightOf="@id/icon"
        android:visibility="gone" />

</RelativeLayout>


text:
package org.usergrid.mongo.commands;

import static org.usergrid.utils.MapUtils.entry;
import static org.usergrid.utils.MapUtils.map;

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;
import org.usergrid.management.ApplicationInfo;
import org.usergrid.mongo.MongoChannelHandler;
import org.usergrid.mongo.protocol.OpQuery;
import org.usergrid.mongo.protocol.OpReply;
import org.usergrid.persistence.EntityManager;
import org.usergrid.persistence.Identifier;
import org.usergrid.security.shiro.utils.SubjectUtils;

public class Collstats extends MongoCommand {

	@Override
	public OpReply execute(MongoChannelHandler handler,
			ChannelHandlerContext ctx, MessageEvent e, OpQuery opQuery) {
		ApplicationInfo application = SubjectUtils.getApplication(Identifier
				.from(opQuery.getDatabaseName()));
		OpReply reply = new OpReply(opQuery);
		if (application == null) {
			return reply;
		}
		EntityManager em = handler.getEmf().getEntityManager(
				application.getId());
		String collectionName = (String) opQuery.getQuery().get("collstats");
		long count = 0;
		try {
			count = em.getApplicationCollectionSize(collectionName);
		} catch (Exception e1) {
		}
		reply.addDocument(map(
				entry("ns", opQuery.getDatabaseName() + "." + collectionName),
				entry("count", count), entry("size", count * 40),
				entry("avgObjSize", 40.0), entry("storageSize", 8192),
				entry("numExtents", 1), entry("nindexes", 1),
				entry("lastExtentSize", 8192), entry("paddingFactor", 1.0),
				entry("flags", 1), entry("totalIndexSize", 8192),
				entry("indexSizes", map("_id_", 8192)), entry("ok", 1.0)));
		return reply;
	}

}


text:
import json
import ssl

# requests
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager

# keen exceptions
from keen import exceptions

# json
from requests.compat import json

__author__ = 'dkador'

class HTTPMethods(object):

    """ HTTP methods that can be used with Keen's API. """

    GET = 'get'
    POST = 'post'
    DELETE = 'delete'

class KeenAdapter(HTTPAdapter):

    """ Adapt :py:mod:`requests` to Keen IO. """

    def init_poolmanager(self, connections, maxsize, block=False):

        """ Initialize pool manager with forced TLSv1 support. """

        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

class KeenApi(object):
    """
    Responsible for communicating with the Keen API. Used by multiple
    persistence strategies or async processing.
    """

    # the default base URL of the Keen API
    base_url = "https://api.keen.io"
    # the default version of the Keen API
    api_version = "3.0"

    # self says it belongs to KeenApi/andOr is the object passed into KeenApi
    # __init__ create keenapi object whenever KeenApi class is invoked
    def __init__(self, project_id, write_key=None, read_key=None,
                 base_url=None, api_version=None, get_timeout=None, post_timeout=None,
                 master_key=None):
        """
        Initializes a KeenApi object

        :param project_id: the Keen project ID
        :param write_key: a Keen IO Scoped Key for Writes
        :param read_key: a Keen IO Scoped Key for Reads
        :param base_url: optional, set this to override where API requests
        are sent
        :param api_version: string, optional, set this to override what API
        version is used
        :param get_timeout: optional, the timeout on GET requests
        :param post_timeout: optional, the timeout on POST requests
        :param master_key: a Keen IO Master API Key, needed for deletes
        """
        # super? recreates the object with values passed into KeenApi
        super(KeenApi, self).__init__()
        self.project_id = project_id
        self.write_key = write_key
        self.read_key = read_key
        self.master_key = master_key
        if base_url:
            self.base_url = base_url
        if api_version:
            self.api_version = api_version
        self.get_timeout = get_timeout
        self.post_timeout = post_timeout
        self.session = self._create_session()

    def _create_session(self):

        """ Build a session that uses KeenAdapter for SSL """

        s = requests.Session()
        s.mount('https://', KeenAdapter())
        return s

    def fulfill(self, method, *args, **kwargs):

        """ Fulfill an HTTP request to Keen's API. """

        return getattr(self.session, method)(*args, **kwargs)

    def post_event(self, event):
        """
        Posts a single event to the Keen IO API. The write key must be set first.

        :param event: an Event to upload
        """
        if not self.write_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a write key to send events. "
                "Please set a 'write_key' when initializing the "
                "KeenApi object."
            )

        url = "{0}/{1}/projects/{2}/events/{3}".format(self.base_url, self.api_version,
                                                       self.project_id,
                                                       event.event_collection)
        headers = {"Content-Type": "application/json", "Authorization": self.write_key}
        payload = event.to_json()
        response = self.fulfill(HTTPMethods.POST, url, data=payload, headers=headers, timeout=self.post_timeout)
        self.error_handling(response)

    def post_events(self, events):

        """
        Posts a single event to the Keen IO API. The write key must be set first.

        :param events: an Event to upload
        """
        if not self.write_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a write key to send events. "
                "Please set a 'write_key' when initializing the "
                "KeenApi object."
            )

        url = "{0}/{1}/projects/{2}/events".format(self.base_url, self.api_version,
                                                   self.project_id)
        headers = {"Content-Type": "application/json", "Authorization": self.write_key}
        payload = json.dumps(events)
        response = self.fulfill(HTTPMethods.POST, url, data=payload, headers=headers, timeout=self.post_timeout)
        self.error_handling(response)

    def query(self, analysis_type, params, all_keys=False):
        """
        Performs a query using the Keen IO analysis API.  A read key must be set first.

        """
        if not self.read_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a read key to perform queries. "
                "Please set a 'read_key' when initializing the "
                "KeenApi object."
            )

        url = "{0}/{1}/projects/{2}/queries/{3}".format(self.base_url, self.api_version,
                                                        self.project_id, analysis_type)

        headers = {"Authorization": self.read_key}
        payload = params
        response = self.fulfill(HTTPMethods.GET, url, params=payload, headers=headers, timeout=self.get_timeout)
        self.error_handling(response)

        response = response.json()

        if not all_keys:
            response = response["result"]

        return response

    def delete_events(self, event_collection, params):
        """
        Deletes events via the Keen IO API. A master key must be set first.

        :param event_collection: string, the event collection from which event are being deleted

        """
        if not self.master_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a master key to run deletes. "
                "Please set a 'master_key' when initializing the KeenApi object."
            )

        url = "{0}/{1}/projects/{2}/events/{3}".format(self.base_url,
                                                       self.api_version,
                                                       self.project_id,
                                                       event_collection)
        headers = {"Content-Type": "application/json", "Authorization": self.master_key}
        response = self.fulfill(HTTPMethods.DELETE, url, params=params, headers=headers, timeout=self.post_timeout)

        self.error_handling(response)
        return True

    def get_collection(self, event_collection):
        """
        Extracts info about a collection using the Keen IO API. A master key must be set first.

        :param event_collection: the name of the collection to retrieve info for
        """
        if not self.master_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a master key to get event collection schema. "
                "Please set a 'master_key' when initializing the "
                "KeenApi object."
            )
        url = "{0}/{1}/projects/{2}/events/{3}".format(self.base_url, self.api_version,
                                                       self.project_id, event_collection)
        headers = {"Authorization": self.master_key}
        response = self.fulfill(HTTPMethods.GET, url, headers=headers, timeout=self.get_timeout)
        self.error_handling(response)

        return response.json()

    def get_all_collections(self):
        """
        Extracts schema for all collections using the Keen IO API. A master key must be set first.

        """
        if not self.master_key:
            raise exceptions.InvalidEnvironmentError(
                "The Keen IO API requires a master key to get event collection schema. "
                "Please set a 'master_key' when initializing the "
                "KeenApi object."
            )
        url = "{0}/{1}/projects/{2}/events".format(self.base_url, self.api_version,
                                                       self.project_id)
        headers = {"Authorization": self.master_key}
        response = self.fulfill(HTTPMethods.GET, url, headers=headers, timeout=self.get_timeout)
        self.error_handling(response)

        return response.json()

    def error_handling(self, res):
        """
        Helper function to do the error handling

        :params res: the response from a request
        """
        # making the error handling generic so if an status_code starting with 2 doesn't exist, we raise the error
        if res.status_code // 100 != 2:
            try:
                error = res.json()
            except json.JSONDecodeError:
                error = {
                    'message': 'The API did not respond with JSON, but: "{0}"'.format(res.text[:1000]),
                    "error_code": "InvalidResponseFormat"
                }
            raise exceptions.KeenApiError(error)


text:
The HELMMonomerService provides monomer and rule data as a REST service.
The Service has two reference implementations:
1. Using a SQLite database as the backend for the REST service
2. Using a MongoDB database as the backend for the REST service

The two different backends can be configured by the file config.txt in  HELMMonomerService/src/test/resources/org/helm/monomerservice/resources/.

## SQLite backend
```
loader.rules=org.helm.monomerservice.RuleLibrarySQLite
loader.monomers=org.helm.monomerservice.MonomerLibrarySQLite
```

The file MonomerLib2.0.db contains an example SQLite database.

## MongoDB backend
```
loader.rules=org.helm.monomerservice.RuleLibraryMongoDB
loader.monomers=org.helm.monomerservice.MonomerLibraryMongoDB
loader.hostname=localhost
loader.port=27017
loader.database=local
```

The files Monomers.json and Rules.json contain example monomers and rules. Data can be imported using the monogoimport tool:
```
mongoimport --db local --collection monomers --file Monomers.json --jsonArray

mongoimport --db local --collection rules --file Rules.json --jsonArray
```

## Swagger API description
There is a Swagger API description available for the API methods:
http://localhost:8080/HELM2MonomerService/
Change hostname and port in accordance to your local setup.


text:
import React, {PureComponent, ChangeEvent} from 'react'
import _ from 'lodash'

// Components
import {Input, FormElement, Grid} from '@influxdata/clockface'

// Utils
import {validateURI} from 'src/shared/utils/validateURI'

// Type
import {Columns, ComponentStatus, ComponentSize} from '@influxdata/clockface'

const VALIDATE_DEBOUNCE_MS = 350

interface Props {
  name: string
  autoFocus?: boolean
  value: string
  helpText: string
  onChange: (e: ChangeEvent<HTMLInputElement>) => void
}

interface State {
  status: ComponentStatus
}

class URIFormElement extends PureComponent<Props, State> {
  private debouncedValidate: (value: string) => void

  constructor(props) {
    super(props)
    this.state = {
      status: ComponentStatus.Default,
    }

    this.debouncedValidate = _.debounce(
      this.handleValidateURI,
      VALIDATE_DEBOUNCE_MS
    )
  }

  public render() {
    const {name, value, autoFocus, helpText} = this.props

    return (
      <Grid>
        <Grid.Row>
          <Grid.Column widthXS={Columns.Eight} offsetXS={Columns.Two}>
            <FormElement
              label={name}
              key={name}
              errorMessage={this.errorMessage}
              helpText={helpText}
            >
              <Input
                name={name}
                autoFocus={autoFocus}
                status={this.state.status}
                onChange={this.handleChange}
                size={ComponentSize.Medium}
                value={value}
              />
            </FormElement>
          </Grid.Column>
        </Grid.Row>
      </Grid>
    )
  }

  private get errorMessage(): string | null {
    const {status} = this.state

    if (status === ComponentStatus.Error) {
      return 'Must be a valid URI.'
    }
  }

  private handleChange = (e: ChangeEvent<HTMLInputElement>): void => {
    const {onChange} = this.props
    const {value} = e.target

    onChange(e)
    this.debouncedValidate(value)
  }

  private handleValidateURI = (value: string): void => {
    if (validateURI(value)) {
      this.setState({status: ComponentStatus.Valid})
    } else {
      this.setState({status: ComponentStatus.Error})
    }
  }
}

export default URIFormElement


text:
<?php

namespace Lib\SigningBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Entity\User as BaseUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
      * @ORM\Id
      * @ORM\Column(type="integer")
      * @ORM\GeneratedValue(strategy="AUTO")
    */
     protected $id;

     public function getId()
     {
         return $this -> id;
     }

     public function setId($id)
     {
         $this->id = $id;
     }

          /**
      * @ORM\Column(type="boolean", nullable=true)
      */
     protected $active = true;

     public function getActive()
     {
         return $this -> active;
     }

     public function setActive($active)
     {
         $this->active = $active;
     }

     /**
      * @ORM\Column(type="string", length=20)
      */
     protected $firstname;

     public function getFirstname()
     {
         return $this -> firstname;
     }

     public function setFirstname($firstname)
     {
         $this->firstname = $firstname;
     }

     /**
      * @ORM\Column(type="string", length=45)
      */
     protected $lastname;

     public function getLastname()
     {
         return $this -> lastname;
     }

     public function setLastname($lastname)
     {
         $this->lastname = $lastname;
     }

      /**
      * @ORM\Column(type="string", scale=20)
      */
     protected $phone;

     public function getPhone()
     {
         return $this -> phone;
     }

     public function setPhone($phone)
     {
         $this->phone = $phone;
     }

     /**
      * @ORM\Column(type="integer", scale=11)
      */
     protected $pesel;

     public function getPesel()
     {
         return $this -> pesel;
     }

     public function setPesel($pesel)
     {
         $this->pesel = $pesel;
     }

     /**
      * @ORM\Column(type="date")
      */
     protected $birthdate;

     public function getBirthdate()
     {
         if ($this->birthdate == null) return $this -> birthdate;
         else return $this -> birthdate -> format('d/m/Y');
     }

     public function setBirthdate($birthdate)
     {
         $time = strtotime($birthdate);
         $newformat = date('Y-m-d', $time);

         $this->birthdate = new \DateTime($newformat);
     }

     /**
      * @ORM\Column(type="integer", nullable=true)
      */
     protected $idAddress;

     public function getIdAddress()
     {
         return $this -> idAddress;
     }

     public function setIdAddress($idAddress)
     {
         $this->idAddress = $idAddress;
     }

    public function __constructconstruct()
    {
        parent::__construct();
    }
}


text:
package com.conventnunnery.mobbountyreloaded.managers;

import com.conventnunnery.mobbountyreloaded.MobBountyReloaded;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MobBountySettings {

    private final MobBountyReloaded plugin;
    private String G_LOCALE;
    private boolean G_KILLCACHE_USE;
    private long G_KILLCACHE_TIME_LIMIT;
    private boolean G_DEBUG;
    private boolean G_ALLOW_CREATIVE;
    private Map<String, String> L_MESSAGES;
    private Map<String, Double> M_ENVIRONMENT_MULTIPLIER;
    private double M_FORTUNE_MULTIPLIER;
    private Map<String, Double> M_BIOME_MULTIPLIER;
    private Map<String, Double> M_TIME_MULTIPLIER;
    private Map<String, Double> M_GROUP_MULTIPLIER;
    private Map<String, Double> M_USER_MULTIPLIER;
    private Map<String, Double> M_WORLD_MULTIPLIER;
    private Map<String, Map<String, String>> R_CREATURE_VALUES;
    private Map<String, Double> KS_KILLBONUSES;
    private List<String> KS_ALLOWED_CREATURES;

    public MobBountySettings(MobBountyReloaded plugin) {
        this.plugin = plugin;
        R_CREATURE_VALUES = new HashMap<String, Map<String, String>>();
        M_ENVIRONMENT_MULTIPLIER = new HashMap<String, Double>();
        M_TIME_MULTIPLIER = new HashMap<String, Double>();
        M_GROUP_MULTIPLIER = new HashMap<String, Double>();
        M_USER_MULTIPLIER = new HashMap<String, Double>();
        M_BIOME_MULTIPLIER = new HashMap<String, Double>();
        M_WORLD_MULTIPLIER = new HashMap<String, Double>();
        KS_KILLBONUSES = new HashMap<String, Double>();
        KS_ALLOWED_CREATURES = new ArrayList<String>();
        L_MESSAGES = new HashMap<String, String>();
        G_LOCALE = null;
        G_KILLCACHE_USE = false;
        G_KILLCACHE_TIME_LIMIT = 0;
        G_DEBUG = false;
        G_ALLOW_CREATIVE = false;
        M_FORTUNE_MULTIPLIER = 0;
        loadSettings();
    }

    public String getG_LOCALE() {
        return G_LOCALE;
    }

    public void setG_LOCALE(String g_LOCALE) {
        G_LOCALE = g_LOCALE;
    }

    public boolean isG_KILLCACHE_USE() {
        return G_KILLCACHE_USE;
    }

    public void setG_KILLCACHE_USE(boolean g_KILLCACHE_USE) {
        G_KILLCACHE_USE = g_KILLCACHE_USE;
    }

    public long getG_KILLCACHE_TIME_LIMIT() {
        return G_KILLCACHE_TIME_LIMIT;
    }

    public void setG_KILLCACHE_TIME_LIMIT(long g_KILLCACHE_TIME_LIMIT) {
        G_KILLCACHE_TIME_LIMIT = g_KILLCACHE_TIME_LIMIT;
    }

    public boolean isG_DEBUG() {
        return G_DEBUG;
    }

    public void setG_DEBUG(boolean g_DEBUG) {
        G_DEBUG = g_DEBUG;
    }

    public boolean isG_ALLOW_CREATIVE() {
        return G_ALLOW_CREATIVE;
    }

    public void setG_ALLOW_CREATIVE(boolean g_ALLOW_CREATIVE) {
        G_ALLOW_CREATIVE = g_ALLOW_CREATIVE;
    }

    public Map<String, String> getL_MESSAGES() {
        return L_MESSAGES;
    }

    public void setL_MESSAGES(Map<String, String> l_MESSAGES) {
        L_MESSAGES = l_MESSAGES;
    }

    public Map<String, Double> getM_ENVIRONMENT_MULTIPLIER() {
        return M_ENVIRONMENT_MULTIPLIER;
    }

    public void setM_ENVIRONMENT_MULTIPLIER(Map<String, Double> m_ENVIRONMENT_MULTIPLIER) {
        M_ENVIRONMENT_MULTIPLIER = m_ENVIRONMENT_MULTIPLIER;
    }

    public double getM_FORTUNE_MULTIPLIER() {
        return M_FORTUNE_MULTIPLIER;
    }

    public void setM_FORTUNE_MULTIPLIER(double m_FORTUNE_MULTIPLIER) {
        M_FORTUNE_MULTIPLIER = m_FORTUNE_MULTIPLIER;
    }

    public Map<String, Double> getM_BIOME_MULTIPLIER() {
        return M_BIOME_MULTIPLIER;
    }

    public void setM_BIOME_MULTIPLIER(Map<String, Double> m_BIOME_MULTIPLIER) {
        M_BIOME_MULTIPLIER = m_BIOME_MULTIPLIER;
    }

    public Map<String, Double> getM_TIME_MULTIPLIER() {
        return M_TIME_MULTIPLIER;
    }

    public void setM_TIME_MULTIPLIER(Map<String, Double> m_TIME_MULTIPLIER) {
        M_TIME_MULTIPLIER = m_TIME_MULTIPLIER;
    }

    public Map<String, Double> getM_GROUP_MULTIPLIER() {
        return M_GROUP_MULTIPLIER;
    }

    public void setM_GROUP_MULTIPLIER(Map<String, Double> m_GROUP_MULTIPLIER) {
        M_GROUP_MULTIPLIER = m_GROUP_MULTIPLIER;
    }

    public Map<String, Double> getM_USER_MULTIPLIER() {
        return M_USER_MULTIPLIER;
    }

    public void setM_USER_MULTIPLIER(Map<String, Double> m_USER_MULTIPLIER) {
        M_USER_MULTIPLIER = m_USER_MULTIPLIER;
    }

    public Map<String, Double> getM_WORLD_MULTIPLIER() {
        return M_WORLD_MULTIPLIER;
    }

    public void setM_WORLD_MULTIPLIER(Map<String, Double> m_WORLD_MULTIPLIER) {
        M_WORLD_MULTIPLIER = m_WORLD_MULTIPLIER;
    }

    public Map<String, Double> getKS_KILLBONUSES() {
        return KS_KILLBONUSES;
    }

    public void setKS_KILLBONUSES(Map<String, Double> KS_KILLBONUSES) {
        this.KS_KILLBONUSES = KS_KILLBONUSES;
    }

    public List<String> getKS_ALLOWED_CREATURES() {
        return KS_ALLOWED_CREATURES;
    }

    public void setKS_ALLOWED_CREATURES(List<String> KS_ALLOWED_CREATURES) {
        this.KS_ALLOWED_CREATURES = KS_ALLOWED_CREATURES;
    }

    public Map<String, Map<String, String>> getR_CREATURE_VALUES() {
        return R_CREATURE_VALUES;
    }

    public void setR_CREATURE_VALUES(Map<String, Map<String, String>> r_CREATURE_VALUES) {
        R_CREATURE_VALUES = r_CREATURE_VALUES;
    }

    public MobBountyReloaded getPlugin() {
        return plugin;
    }

    private void saveGeneralSettings() {
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL).set(
                "locale",
                G_LOCALE);
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL).set("killCache" +
                ".use",
                G_KILLCACHE_USE);
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .set("killCache.timeLimt", G_KILLCACHE_TIME_LIMIT);
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL).set(
                "debugMode", G_DEBUG);
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .set("creativeEarning.allow", G_ALLOW_CREATIVE);
    }

    private void saveKillstreakSettings() {
        for (Map.Entry<String, Double> entry : KS_KILLBONUSES.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.KILLSTREAK).set(
                    "KillBonus." + entry.getKey(), entry.getValue());
        }
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.KILLSTREAK)
                .set("allowedCreatures", KS_ALLOWED_CREATURES);
    }

    private void saveRewardSettings() {
        for (Map.Entry<String, Map<String, String>> entry : R_CREATURE_VALUES.entrySet()) {
            for (Map.Entry<String, String> entry1 : entry.getValue().entrySet()) {
                getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.REWARDS).set(
                        entry.getKey() + "." + entry1.getKey(),
                        entry1.getValue());
            }
        }
    }

    private void saveLocaleSettings() {
        for (Map.Entry<String, String> entry : L_MESSAGES.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.LOCALE).set(
                    G_LOCALE + "." + entry.getKey(),
                    entry.getValue().replace('\u00A7', '&'));
        }
    }

    private void saveMultiplierSettings() {
        getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                .set("fortuneToolsMultiplier", M_FORTUNE_MULTIPLIER);
        for (Map.Entry<String, Double> entry : M_BIOME_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("Biome." + entry.getKey(), entry.getValue());
        }
        for (Map.Entry<String, Double> entry : M_WORLD_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("World." + entry.getKey(), entry.getValue());
        }
        for (Map.Entry<String, Double> entry : M_USER_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("User." + entry.getKey(), entry.getValue());
        }
        for (Map.Entry<String, Double> entry : M_GROUP_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("Group." + entry.getKey(), entry.getValue());
        }
        for (Map.Entry<String, Double> entry : M_ENVIRONMENT_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("Environment." + entry.getKey(),
                            entry.getValue());
        }
        for (Map.Entry<String, Double> entry : M_TIME_MULTIPLIER.entrySet()) {
            getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS)
                    .set("Time." + entry.getKey(), entry.getValue());
        }
    }

    public void saveSettings() {
        saveGeneralSettings();
        saveKillstreakSettings();
        saveRewardSettings();
        saveLocaleSettings();
        saveMultiplierSettings();
    }

    private void loadGeneralSettings() {
        G_LOCALE = getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .getString("locale");
        G_KILLCACHE_USE = getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .getBoolean("killCache.use");
        G_KILLCACHE_TIME_LIMIT = getPlugin().getConfigManager()
                .getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .getLong("killCache.timeLimit");
        G_DEBUG = getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .getBoolean("debugMode");
        G_ALLOW_CREATIVE = getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile.GENERAL)
                .getBoolean("creativeEarning.allow");
    }

    private void loadKillstreakSettings() {
        KS_KILLBONUSES.clear();
        FileConfiguration fc = getPlugin().getConfigManager().getConfiguration(
                MobBountyConfigs.ConfigurationFile.KILLSTREAK);
        if (fc.isConfigurationSection("KillBonus")) {
            ConfigurationSection cs = fc.getConfigurationSection("KillBonus");
            for (String s : cs.getKeys(false)) {
                KS_KILLBONUSES.put(s, fc.getDouble(s.replace("'", "")));
            }
        }
        KS_ALLOWED_CREATURES.clear();
        KS_ALLOWED_CREATURES = getPlugin().getConfigManager().getConfiguration(MobBountyConfigs.ConfigurationFile
                .KILLSTREAK).getStringList("allowedCreatures");
    }

    private void loadLocaleSettings() {
        L_MESSAGES.clear();
        Set<String> keys = new HashSet<String>();
        FileConfiguration fc = getPlugin().getConfigManager().getConfiguration(
                MobBountyConfigs.ConfigurationFile.LOCALE);
        if (fc.isConfigurationSection(getG_LOCALE())) {
            ConfigurationSection cs = fc.getConfigurationSection(getG_LOCALE());
            keys = cs.getKeys(false);
        }
        else if (fc.isConfigurationSection("en")) {
            ConfigurationSection cs = fc.getConfigurationSection("en");
            keys = cs.getKeys(false);
        }
        for (String key : keys) {
            L_MESSAGES.put(key, getPlugin().getLocaleManager().getString(key));
        }
    }

    private void loadMultiplierSettings() {
        FileConfiguration mfc = getPlugin().getConfigManager()
                .getConfiguration(MobBountyConfigs.ConfigurationFile.MULTIPLIERS);
        M_FORTUNE_MULTIPLIER = mfc.getDouble("fortuneToolsMultiplier");
        M_ENVIRONMENT_MULTIPLIER.clear();
        M_TIME_MULTIPLIER.clear();
        M_GROUP_MULTIPLIER.clear();
        M_USER_MULTIPLIER.clear();
        M_BIOME_MULTIPLIER.clear();
        M_WORLD_MULTIPLIER.clear();
        if (mfc.isConfigurationSection("Environment")) {
            ConfigurationSection ecs = mfc
                    .getConfigurationSection("Environment");
            for (String s : ecs.getKeys(false)) {
                M_ENVIRONMENT_MULTIPLIER.put(s.toUpperCase(),
                        ecs.getDouble(s));
            }
        }
        if (mfc.isConfigurationSection("Time")) {
            ConfigurationSection tcs = mfc.getConfigurationSection("Time");
            for (String s : tcs.getKeys(false)) {
                M_TIME_MULTIPLIER.put(s, tcs.getDouble(s));
            }
        }
        if (mfc.isConfigurationSection("Group")) {
            ConfigurationSection gcs = mfc.getConfigurationSection("Group");
            for (String s : gcs.getKeys(false)) {
                M_GROUP_MULTIPLIER.put(s, gcs.getDouble(s));
            }
        }
        if (mfc.isConfigurationSection("User")) {
            ConfigurationSection ucs = mfc.getConfigurationSection("User");
            for (String s : ucs.getKeys(false)) {
                M_USER_MULTIPLIER.put(s, ucs.getDouble(s));
            }
        }
        if (mfc.isConfigurationSection("Biome")) {
            ConfigurationSection tbs = mfc.getConfigurationSection("Biome");
            for (String s : tbs.getKeys(false)) {
                M_TIME_MULTIPLIER.put(s, tbs.getDouble(s));
            }
        }
        if (mfc.isConfigurationSection("World")) {
            ConfigurationSection wcs = mfc.getConfigurationSection("World");
            for (String s : wcs.getKeys(false)) {
                M_WORLD_MULTIPLIER.put(s, wcs.getDouble(s));
            }
        }
    }

    private void loadRewardSettings() {
        R_CREATURE_VALUES.clear();
        FileConfiguration fc = getPlugin().getConfigManager().getConfiguration(
                MobBountyConfigs.ConfigurationFile.REWARDS);
        for (String s : fc.getKeys(false)) {
            Map<String, String> map = new HashMap<String, String>();
            if (!fc.isConfigurationSection(s)){
                continue;
            }
            ConfigurationSection cs = fc.getConfigurationSection(s);
            for (String s2 : cs.getKeys(false)) {
                if (cs.isConfigurationSection(s2)) { continue; }
                map.put(s2, cs.getString(s2));
            }
            R_CREATURE_VALUES.put(s, map);
        }
    }

    public void loadSettings() {
        loadGeneralSettings();
        loadLocaleSettings();
        loadRewardSettings();
        loadMultiplierSettings();
        loadKillstreakSettings();
    }

    public void setCreatureReward(String world, String entityType, String reward) {
        Map<String, String> map2 = R_CREATURE_VALUES.get(world);
        if (map2 == null) {
            map2 = new HashMap<String, String>();
        }
        map2.put(entityType, reward);
        R_CREATURE_VALUES.put(world, map2);
    }
}


text:
<component name="libraryTable">
  <library name="bcprov">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/libs/bcprov.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
<?php

namespace backend\modules\costom;

class Module extends \yii\base\Module
{
    public $controllerNamespace = 'backend\modules\costom\controllers';

    public function init()
    {
        parent::init();

        // custom initialization code goes here
    }
}


text:
<!doctype html>

  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />

    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">

<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />

  <meta name="keywords" content="Hexo, NexT" />

  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />

<meta name="description" content="Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick">
<meta property="og:type" content="article">
<meta property="og:title" content="Hello World">
<meta property="og:url" content="http://yoursite.com/2017/09/11/hello-world/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick">
<meta property="og:updated_time" content="2017-09-11T04:47:05.319Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hello World">
<meta name="twitter:description" content="Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick">

  <link rel="canonical" href="http://yoursite.com/2017/09/11/hello-world/"/>

  <title> Hello World | Hexo </title>

        Hexo

    <button>

    </button>

            Home

            Archives

            Tags

    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/09/11/hello-world/">

      <meta itemprop="name" content="John Doe">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">

      <meta itemprop="name" content="Hexo">

                Hello World

                Posted on

              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-09-11T12:47:05+08:00">
                2017-09-11
              </time>

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1

$ hexo new "My New Post"

More info: Writing

Run server

1

$ hexo server

More info: Server

Generate static files

1

$ hexo generate

More info: Generating

Deploy to remote sites

1

$ hexo deploy

More info: Deployment

            Table of Contents

            Overview

John Doe

                1
                posts

1. Quick Start

1.1. Create a new post

1.2. Run server

1.3. Generate static files

1.4. Deploy to remote sites

  ©
  2017

  John Doe

  Powered by Hexo

  Theme -

    NexT.Muse


text:
import { inject } from 'mobx-react/native'
import Event_ from 'constelation-event_'
import React from 'react'
import Text from 'constelation-text'
import View from 'constelation-view'

import type { Stores } from 'stores'

import Profile from './Profile'
import type { Props } from './Profile'

// }}}

class ProfileContainer extends React.Component {
  props: Props

  static navigationOptions = ({ navigation }) => ({
    headerTitle: 'Profile',
    headerRight: (
      <Event_
        pressEffect='opacity'
        onPress={() => navigation.navigate('ProfileDetail')} // eslint-disable-line react/jsx-no-bind
      >
        <View paddingRight={20}>
          <Text> Detail </Text>
        </View>
      </Event_>
    ),
  })

  render() {
    return (
      <Profile {...this.props} />
    )
  }
}

export default inject(
  ({ counter }: Stores) => ({
    value: counter.value,
    onIncreaseCounter: counter.increase,
  })
)(ProfileContainer)


text:
module Thrift
  class FramedTransport < BaseTransport
    def initialize(transport, read=true, write=true)
      @transport = transport
      @rbuf      = ''
      @wbuf      = ''
      @read      = read
      @write     = write
      @index      = 0
    end

    def open?
      @transport.open?
    end

    def open
      @transport.open
    end

    def close
      @transport.close
    end

    def read(sz)
      return @transport.read(sz) unless @read

      return '' if sz <= 0

      read_frame if @index >= @rbuf.length

      @index += sz
      @rbuf.slice(@index - sz, sz) || ''
    end

    def read_byte
      return @transport.read_byte() unless @read

      read_frame if @index >= @rbuf.length

      # The read buffer has some data now, read a single byte. Using get_string_byte() avoids
      # allocating a temp string of size 1 unnecessarily.
      @index += 1
      return ::Thrift::TransportUtils.get_string_byte(@rbuf, @index - 1)
    end

    def read_into_buffer(buffer, size)
      i = 0
      while i < size
        read_frame if @index >= @rbuf.length

        # The read buffer has some data now, so copy bytes over to the output buffer.
        byte = ::Thrift::TransportUtils.get_string_byte(@rbuf, @index)
        ::Thrift::TransportUtils.set_string_byte(buffer, i, byte)
        @index += 1
        i += 1
      end
      i
    end

    def write(buf,sz=nil)
      return @transport.write(buf) unless @write

      @wbuf << (sz ? buf[0...sz] : buf)
    end

    #
    # Writes the output buffer to the stream in the format of a 4-byte length
    # followed by the actual data.
    #
    def flush
      return @transport.flush unless @write

      out = [@wbuf.length].pack('N')
      out << @wbuf
      @transport.write(out)
      @transport.flush
      @wbuf = ''
    end

    private

    def read_frame
      sz = @transport.read_all(4).unpack('N').first

      @index = 0
      @rbuf = @transport.read_all(sz)
    end
  end

  class FramedTransportFactory < BaseTransportFactory
    def get_transport(transport)
      return FramedTransport.new(transport)
    end
  end
end


text:
'''Jamenson Compiler Front End
'''

from __future__ import absolute_import
from __future__ import with_statement

from hlab.pathutils import FilePath
from optparse import OptionParser

from .util import err, msg, vmsg, vemit, set_verbosity, get_prog_name, evaling_context
from ..compiler.util import timing
from ..compiler.block import BlockCompiler
from ..runtime.require import state as require_state
from ..runtime import state as runtime_state
from ..runtime.symbol import get_package, use_package
from ..runtime.compiled import write_code

def main():
    global config
    config = configure()
    if not config.nouser:
        #populate user package through side effects
        from ..core import user
    for target in config.targets:
        compile_target(target)

class vtiming(timing):

    def __init__(self, v, name):
        super(vtiming, self).__init__(name)
        self.v = v
        vemit(self.v, '%s: %s: ' % (get_prog_name(), self.name,))

    def emit(self):
        vemit(self.v, self.strtime + '\n')

def compile_target(target):
    dest = get_dest_path(target)
    with evaling_context(FilePath(target) if target != '-' else None, config.package):
        compiler = FrontEndCompiler.create(filename=target.abspath())
        vmsg(0, 'compiling %s', target)
        with timing() as time:
            code = compiler.construct_code()
        vmsg(1, 'elapsed time %s', time.strtime)
        write_code(code, dest)

def get_dest_path(target):
    base = target.basename()
    if base.endswith('.jms'):
        base = base.rsplit('.',1)[0]
    return target.sibling(base + '.jmc')

def configure():
    parser = OptionParser()
    parser = OptionParser(usage='%prog [OPTIONS] [TARGETS]',
                              epilog=__doc__,
                              add_help_option=False)
    parser.add_option('-?','--help',
                      action='help',
                      help='show this help message and exit')
    parser.add_option('-v','--verbose',
                      dest='verbosity',
                      default=0,
                      action='count',
                      help='increment extent of messages durring compiling')
    parser.add_option('-p','--package',
                      dest='package',
                      default=None,
                      action='store',
                      metavar='PACKAGE',
                      help='specify initial package for compiling')
    parser.add_option('--nouser',
                      dest='nouser',
                      default=False,
                      action='store_true',
                      help="don't populate user package")
    options,args = parser.parse_args()
    targets = []
    for arg in args:
        target = FilePath(arg)
        if not target.exists():
            msg('skipping non-existent file %s', target)
            continue
        targets.append(target)
    if not targets:
        msg('no targets specified')
    options.targets = targets
    set_verbosity(options.verbosity)
    return options

class FrontEndCompiler(BlockCompiler):

    def read_all_top_level_forms(self):
        vmsg(1, 'loading forms')
        with timing() as time:
            op = super(FrontEndCompiler, self).read_all_top_level_forms()
        vmsg(1, 'loaded forms in %s', time.strtime)
        return op

    def read_and_translate_form(self):
        self.stream.strip_whitespace()
        with vtiming(2, 'load %s.%d' % (self.stream.filename.basename(), self.stream.lineno)):
            return super(FrontEndCompiler, self).read_and_translate_form()

    def block_transform(self, top_expr):
        with vtiming(1, 'transforming top level expressions'):
            return super(FrontEndCompiler, self).block_transform(top_expr)

    def compile_top_expr(self, top_expr):
        with vtiming(1, 'generating code'):
            return super(FrontEndCompiler, self).compile_top_expr(top_expr)


text:
require 'rubygems'
require 'bundler/setup'

require 'wordpress_deploy'

def data_dir
  File.join(File.dirname(__FILE__), "data")
end

# Set shell to basic
$0 = "thor"
$thor_runner = true
ARGV.clear
Thor::Base.shell = Thor::Shell::Basic

RSpec.configure do |config|
  # == Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec

  # Reset the environment for each spec that is run
  config.before(:each) do
    WordpressDeploy::Config.root_dir    = data_dir
    WordpressDeploy::Config.wp_dir      = "."
    WordpressDeploy::Config.config_dir  = "."
    WordpressDeploy::Config.sql_dir     = "."
    WordpressDeploy::Config.logging     = false
  end

  config.before(:all) do
    WordpressDeploy::Environments.load
  end

  # Clean-up log files after each spec
  config.after(:all) do
    WordpressDeploy::Config.clean!
  end

end

RSpec::Matchers.define :be_salt do |expected|
  match do |actual|
    actual.instance_of? String
    actual.to_s.size === 64
  end
end


text:
using Microsoft.Xna.Framework;

namespace Nez.Farseer
{
	public class FSRopeJoint : FSJoint
	{
		FSRopeJointDef _jointDef = new FSRopeJointDef();

		#region Configuration

		public FSRopeJoint SetOwnerBodyAnchor(Vector2 ownerBodyAnchor)
		{
			_jointDef.OwnerBodyAnchor = ownerBodyAnchor;
			RecreateJoint();
			return this;
		}

		public FSRopeJoint SetOtherBodyAnchor(Vector2 otherBodyAnchor)
		{
			_jointDef.OtherBodyAnchor = otherBodyAnchor;
			RecreateJoint();
			return this;
		}

		public FSRopeJoint SetMaxLength(float maxLength)
		{
			_jointDef.MaxLength = maxLength;
			RecreateJoint();
			return this;
		}

		#endregion

		internal override FSJointDef GetJointDef()
		{
			InitializeJointDef(_jointDef);
			if (_jointDef.BodyA == null || _jointDef.BodyB == null)
				return null;

			return _jointDef;
		}
	}
}


text:
namespace csapex
{
template <typename I>
class RequestImplementation : public Request
{
protected:
    CLONABLE_IMPLEMENTATION_CONSTRUCTOR(I, 0);

protected:
    RequestImplementation(uint8_t id) : Request(id)
    {
    }
};

}  // namespace csapex

#endif  // REQUEST_IMPL_HPP


text:
<?php

namespace Google\Service\CloudSearch;

class AppsDynamiteSharedBackendUploadMetadata extends \Google\Model
{
  /**
   * @var string
   */
  public $blobPath;
  /**
   * @var string
   */
  public $contentName;
  /**
   * @var string
   */
  public $contentSize;
  /**
   * @var string
   */
  public $contentType;
  /**
   * @var string
   */
  public $dlpScanOutcome;
  protected $dlpScanSummaryType = DlpScanSummary::class;
  protected $dlpScanSummaryDataType = '';
  protected $groupIdType = GroupId::class;
  protected $groupIdDataType = '';
  protected $originalDimensionType = AppsDynamiteSharedDimension::class;
  protected $originalDimensionDataType = '';
  protected $quoteReplyMessageIdType = MessageId::class;
  protected $quoteReplyMessageIdDataType = '';
  /**
   * @var string
   */
  public $sha256;
  /**
   * @var string
   */
  public $uploadIp;
  /**
   * @var string
   */
  public $uploadTimestampUsec;
  /**
   * @var string
   */
  public $videoId;
  /**
   * @var string
   */
  public $videoThumbnailBlobId;
  /**
   * @var string
   */
  public $virusScanResult;

  /**
   * @param string
   */
  public function setBlobPath($blobPath)
  {
    $this->blobPath = $blobPath;
  }
  /**
   * @return string
   */
  public function getBlobPath()
  {
    return $this->blobPath;
  }
  /**
   * @param string
   */
  public function setContentName($contentName)
  {
    $this->contentName = $contentName;
  }
  /**
   * @return string
   */
  public function getContentName()
  {
    return $this->contentName;
  }
  /**
   * @param string
   */
  public function setContentSize($contentSize)
  {
    $this->contentSize = $contentSize;
  }
  /**
   * @return string
   */
  public function getContentSize()
  {
    return $this->contentSize;
  }
  /**
   * @param string
   */
  public function setContentType($contentType)
  {
    $this->contentType = $contentType;
  }
  /**
   * @return string
   */
  public function getContentType()
  {
    return $this->contentType;
  }
  /**
   * @param string
   */
  public function setDlpScanOutcome($dlpScanOutcome)
  {
    $this->dlpScanOutcome = $dlpScanOutcome;
  }
  /**
   * @return string
   */
  public function getDlpScanOutcome()
  {
    return $this->dlpScanOutcome;
  }
  /**
   * @param DlpScanSummary
   */
  public function setDlpScanSummary(DlpScanSummary $dlpScanSummary)
  {
    $this->dlpScanSummary = $dlpScanSummary;
  }
  /**
   * @return DlpScanSummary
   */
  public function getDlpScanSummary()
  {
    return $this->dlpScanSummary;
  }
  /**
   * @param GroupId
   */
  public function setGroupId(GroupId $groupId)
  {
    $this->groupId = $groupId;
  }
  /**
   * @return GroupId
   */
  public function getGroupId()
  {
    return $this->groupId;
  }
  /**
   * @param AppsDynamiteSharedDimension
   */
  public function setOriginalDimension(AppsDynamiteSharedDimension $originalDimension)
  {
    $this->originalDimension = $originalDimension;
  }
  /**
   * @return AppsDynamiteSharedDimension
   */
  public function getOriginalDimension()
  {
    return $this->originalDimension;
  }
  /**
   * @param MessageId
   */
  public function setQuoteReplyMessageId(MessageId $quoteReplyMessageId)
  {
    $this->quoteReplyMessageId = $quoteReplyMessageId;
  }
  /**
   * @return MessageId
   */
  public function getQuoteReplyMessageId()
  {
    return $this->quoteReplyMessageId;
  }
  /**
   * @param string
   */
  public function setSha256($sha256)
  {
    $this->sha256 = $sha256;
  }
  /**
   * @return string
   */
  public function getSha256()
  {
    return $this->sha256;
  }
  /**
   * @param string
   */
  public function setUploadIp($uploadIp)
  {
    $this->uploadIp = $uploadIp;
  }
  /**
   * @return string
   */
  public function getUploadIp()
  {
    return $this->uploadIp;
  }
  /**
   * @param string
   */
  public function setUploadTimestampUsec($uploadTimestampUsec)
  {
    $this->uploadTimestampUsec = $uploadTimestampUsec;
  }
  /**
   * @return string
   */
  public function getUploadTimestampUsec()
  {
    return $this->uploadTimestampUsec;
  }
  /**
   * @param string
   */
  public function setVideoId($videoId)
  {
    $this->videoId = $videoId;
  }
  /**
   * @return string
   */
  public function getVideoId()
  {
    return $this->videoId;
  }
  /**
   * @param string
   */
  public function setVideoThumbnailBlobId($videoThumbnailBlobId)
  {
    $this->videoThumbnailBlobId = $videoThumbnailBlobId;
  }
  /**
   * @return string
   */
  public function getVideoThumbnailBlobId()
  {
    return $this->videoThumbnailBlobId;
  }
  /**
   * @param string
   */
  public function setVirusScanResult($virusScanResult)
  {
    $this->virusScanResult = $virusScanResult;
  }
  /**
   * @return string
   */
  public function getVirusScanResult()
  {
    return $this->virusScanResult;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AppsDynamiteSharedBackendUploadMetadata::class, 'Google_Service_CloudSearch_AppsDynamiteSharedBackendUploadMetadata');


text:
Unreleased Changes
------------------

1.83.0 (2022-11-10)
------------------

* Feature - This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price.

1.82.0 (2022-11-07)
------------------

* Feature - This release adds support for two new attributes for attribute-based instance type selection - NetworkBandwidthGbps and AllowedInstanceTypes.

1.81.0 (2022-10-25)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.80.0 (2022-07-25)
------------------

* Feature - Documentation update for Amazon EC2 Auto Scaling.

1.79.0 (2022-04-19)
------------------

* Feature - EC2 Auto Scaling now adds default instance warm-up times for all scaling activities, health check replacements, and other replacement events in the Auto Scaling instance lifecycle.

1.78.0 (2022-02-24)
------------------

* Feature - You can now hibernate instances in a warm pool to stop instances without deleting their RAM contents. You can now also return instances to the warm pool on scale in, instead of always terminating capacity that you will need later.

1.77.0 (2022-02-03)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.76.0 (2021-12-21)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.75.0 (2021-11-30)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.74.0 (2021-11-26)
------------------

* Feature - Documentation updates for Amazon EC2 Auto Scaling.

1.73.0 (2021-11-24)
------------------

* Feature - Customers can now configure predictive scaling policies to proactively scale EC2 Auto Scaling groups based on any CloudWatch metrics that more accurately represent the load on the group than the four predefined metrics. They can also use math expressions to further customize the metrics.

1.72.0 (2021-11-04)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.71.0 (2021-10-27)
------------------

* Feature - This release adds support for attribute-based instance type selection, a new EC2 Auto Scaling feature that lets customers express their instance requirements as a set of attributes, such as vCPU, memory, and storage.

1.70.0 (2021-10-18)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.69.0 (2021-10-14)
------------------

* Feature - Amazon EC2 Auto Scaling now supports filtering describe Auto Scaling groups API using tags

1.68.0 (2021-09-01)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.67.0 (2021-08-05)
------------------

* Feature - EC2 Auto Scaling adds configuration checks and Launch Template validation to Instance Refresh.

1.66.0 (2021-07-30)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.65.0 (2021-07-28)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.64.0 (2021-06-30)
------------------

* Feature - Amazon EC2 Auto Scaling infrastructure improvements and optimizations.

1.63.0 (2021-06-04)
------------------

* Feature - Documentation updates for Amazon EC2 Auto Scaling

1.62.0 (2021-06-02)
------------------

* Feature - You can now launch EC2 instances with GP3 volumes when using Auto Scaling groups with Launch Configurations

1.61.0 (2021-05-19)
------------------

* Feature - With this release, customers can easily use Predictive Scaling as a policy directly through Amazon EC2 Auto Scaling configurations to proactively scale their applications ahead of predicted demand.

1.60.0 (2021-04-08)
------------------

* Feature - Amazon EC2 Auto Scaling announces Warm Pools that help applications to scale out faster by pre-initializing EC2 instances and save money by requiring fewer continuously running instances

1.59.0 (2021-03-18)
------------------

* Feature - Amazon EC2 Auto Scaling Instance Refresh now supports phased deployments.

1.58.0 (2021-03-10)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.57.0 (2021-03-09)
------------------

* Feature - EC2 Auto Scaling now supports setting a local time zone for cron expressions in scheduled actions, removing the need to adjust for Daylight Saving Time (DST)

1.56.0 (2021-03-08)
------------------

* Feature - Documentation updates for autoscaling for capacity-optimized-prioritized SpotAllocationStrategy

1.55.0 (2021-02-23)
------------------

* Feature - Adds a new optional IncludeDeletedGroups parameter to the DescribeScalingActivities API.

1.54.0 (2021-02-02)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.53.0 (2021-01-06)
------------------

* Feature - This update increases the number of instance types that can be added to the overrides within an mixed instances group configuration.

1.52.0 (2020-12-11)
------------------

* Feature - Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs.

1.51.0 (2020-11-23)
------------------

* Feature - Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs.

1.50.0 (2020-11-19)
------------------

* Feature - You can now create Auto Scaling groups with multiple launch templates using a mixed instances policy, making it easy to deploy an AMI with an architecture that is different from the rest of the group.

1.49.0 (2020-11-10)
------------------

* Feature - Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs.

1.48.0 (2020-11-04)
------------------

* Feature - Capacity Rebalance helps you manage and maintain workload availability during Spot interruptions by proactively augmenting your Auto Scaling group with a new instance before interrupting an old one.

1.47.0 (2020-09-30)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.46.0 (2020-09-15)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.45.0 (2020-08-25)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.44.0 (2020-07-28)
------------------

* Feature - Now you can enable Instance Metadata Service Version 2 (IMDSv2) or disable the instance metadata endpoint with Launch Configurations.

1.43.0 (2020-07-02)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.42.0 (2020-06-29)
------------------

* Feature - Documentation updates for Amazon EC2 Auto Scaling.

1.41.0 (2020-06-24)
------------------

* Feature - Documentation updates for Amazon EC2 Auto Scaling.

1.40.0 (2020-06-23)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.39.0 (2020-06-16)
------------------

* Feature - Introducing instance refresh, a feature that helps you update all instances in an Auto Scaling group in a rolling fashion (for example, to apply a new AMI or instance type). You can control the pace of the refresh by defining the percentage of the group that must remain running/healthy during the replacement process and the time for new instances to warm up between replacements.

1.38.1 (2020-06-11)
------------------

* Issue - Republish previous version with correct dependency on `aws-sdk-core`.

1.38.0 (2020-06-10)
------------------

* Issue - This version has been yanked. (#2327).
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.37.0 (2020-05-28)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.36.0 (2020-05-22)
------------------

* Feature - Documentation updates for Amazon EC2 Auto Scaling

1.35.0 (2020-05-07)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.34.0 (2020-04-20)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.33.0 (2020-03-09)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.32.0 (2020-02-19)
------------------

* Feature - Doc update for EC2 Auto Scaling: Add Enabled parameter for PutScalingPolicy

1.31.0 (2020-02-18)
------------------

* Feature - Amazon EC2 Auto Scaling now supports the ability to enable/disable target tracking, step scaling, and simple scaling policies.

1.30.0 (2019-11-19)
------------------

* Feature - Amazon EC2 Auto Scaling now supports Instance Weighting and Max Instance Lifetime. Instance Weighting allows specifying the capacity units for each instance type included in the MixedInstancesPolicy and how they would contribute to your application's performance. Max Instance Lifetime allows specifying the maximum length of time that an instance can be in service. If any instances are approaching this limit, Amazon EC2 Auto Scaling gradually replaces them.

1.29.0 (2019-10-23)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.28.0 (2019-08-12)
------------------

* Feature - Amazon EC2 Auto Scaling now supports a new Spot allocation strategy "capacity-optimized" that fulfills your request using Spot Instance pools that are optimally chosen based on the available Spot capacity.

1.27.0 (2019-07-25)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.26.0 (2019-07-17)
------------------

* Feature - Documentation updates for autoscaling

1.25.0 (2019-07-01)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.24.0 (2019-06-17)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

1.23.0 (2019-05-21)
------------------

* Feature - API update.

1.22.0 (2019-05-15)
------------------

* Feature - API update.

1.21.0 (2019-05-14)
------------------

* Feature - API update.

1.20.0 (2019-03-22)
------------------

* Feature - API update.

1.19.0 (2019-03-21)
------------------

* Feature - API update.

1.18.0 (2019-03-21)
------------------

* Feature - API update.

1.17.0 (2019-03-18)
------------------

* Feature - API update.

1.16.0 (2019-03-14)
------------------

* Feature - API update.

1.15.0 (2019-03-07)
------------------

* Feature - API update.

1.14.0 (2019-02-25)
------------------

* Feature - API update.

1.13.0 (2018-11-20)
------------------

* Feature - API update.

1.12.1 (2018-11-16)
------------------

* Issue - Update version dependency on `aws-sdk-core` to support endpoint discovery.

1.12.0 (2018-11-14)
------------------

* Feature - API update.

1.11.0 (2018-10-24)
------------------

* Feature - API update.

1.10.0 (2018-10-23)
------------------

* Feature - API update.

1.9.0 (2018-09-06)
------------------

* Feature - Adds code paths and plugins for future SDK instrumentation and telemetry.

1.8.0 (2018-09-05)
------------------

* Feature - API update.

1.7.0 (2018-08-14)
------------------

* Feature - API update.

1.6.0 (2018-06-26)
------------------

* Feature - API update.

1.5.0 (2018-02-20)
------------------

* Feature - API update.

1.4.0 (2017-11-30)
------------------

* Feature - API update.

1.3.0 (2017-09-14)
------------------

* Feature - API update.

1.2.0 (2017-09-13)
------------------

* Feature - API update.

1.1.0 (2017-09-11)
------------------

* Feature - API update.

* Issue - Update `aws-sdk-autoscaling` gemspec metadata.

1.0.0 (2017-08-29)
------------------

1.0.0.rc12 (2017-08-15)
------------------

* Feature - API update.

1.0.0.rc11 (2017-08-01)
------------------

* Feature - API update.

1.0.0.rc10 (2017-07-25)
------------------

* Feature - API update.

1.0.0.rc9 (2017-07-12)
------------------

* Feature - API update.

1.0.0.rc8 (2017-07-06)
------------------

* Feature - API update.

1.0.0.rc7 (2017-06-29)
------------------

* Feature - API update.

1.0.0.rc6 (2017-06-26)
------------------

* Feature - API update.

1.0.0.rc5 (2017-05-23)
------------------

* Feature - API update.

1.0.0.rc4 (2017-05-09)
------------------

* Feature - API update.

1.0.0.rc3 (2017-05-09)
------------------

* Feature - API update.

* Issue - Fix resource model load path

1.0.0.rc2 (2017-04-21)
------------------

* Feature - API update.

1.0.0.rc1 (2016-12-05)
------------------

* Feature - Initial preview release of the `aws-sdk-autoscaling` gem.


text:
package com.github.mauricio.async.db.postgresql

import org.specs2.mutable.Specification
import org.joda.time.LocalDate
import com.github.mauricio.async.db.util.Log
import com.github.mauricio.async.db.exceptions.InsufficientParametersException
import java.util.UUID
import com.github.mauricio.async.db.postgresql.exceptions.GenericDatabaseException

class PreparedStatementSpec extends Specification with DatabaseTestHelper {

  val log = Log.get[PreparedStatementSpec]

  val filler = List.fill(64)(" ").mkString("")

  val messagesCreate = """CREATE TEMP TABLE messages
                         (
                           id bigserial NOT NULL,
                           content character varying(255) NOT NULL,
                           moment date NULL,
                           CONSTRAINT bigserial_column_pkey PRIMARY KEY (id )
                         )"""
  val messagesInsert = s"INSERT INTO messages $filler (content,moment) VALUES (?,?) RETURNING id"
  val messagesInsertReverted = s"INSERT INTO messages $filler (moment,content) VALUES (?,?) RETURNING id"
  val messagesUpdate = "UPDATE messages SET content = ?, moment = ? WHERE id = ?"
  val messagesSelectOne = "SELECT id, content, moment FROM messages WHERE id = ?"
  val messagesSelectByMoment = "SELECT id, content, moment FROM messages WHERE moment = ?"
  val messagesSelectAll = "SELECT id, content, moment FROM messages"
  val messagesSelectEscaped = "SELECT id, content, moment FROM messages WHERE content LIKE '%??%' AND id > ?"

  "prepared statements" should {

    "support prepared statement with more than 64 characters" in {
      withHandler {
        handler =>

          val firstContent = "Some Moment"
          val secondContent = "Some Other Moment"
          val date = LocalDate.now()

          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, this.messagesInsert, Array(firstContent, date))
          executePreparedStatement(handler, this.messagesInsertReverted, Array(date, secondContent))

          val rows = executePreparedStatement(handler, this.messagesSelectAll).rows.get

          rows.length === 2

          rows(0)("id") === 1
          rows(0)("content") === firstContent
          rows(0)("moment") === date

          rows(1)("id") === 2
          rows(1)("content") === secondContent
          rows(1)("moment") === date

      }
    }

    "execute a prepared statement without any parameters multiple times" in {

      withHandler {
        handler =>
          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, "UPDATE messages SET content = content")
          executePreparedStatement(handler, "UPDATE messages SET content = content")
          ok
      }

    }

    "raise an exception if the parameter count is different from the given parameters count" in {

      withHandler {
        handler =>
          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, this.messagesSelectOne) must throwAn[InsufficientParametersException]
      }

    }

    "run two different prepared statements in sequence and get the right values" in {

      val create = """CREATE TEMP TABLE other_messages
                         (
                           id bigserial NOT NULL,
                           other_moment date NULL,
                           other_content character varying(255) NOT NULL,
                           CONSTRAINT other_messages_bigserial_column_pkey PRIMARY KEY (id )
                         )"""

      val select = "SELECT * FROM other_messages"
      val insert = "INSERT INTO other_messages (other_moment, other_content) VALUES (?, ?)"

      val moment = LocalDate.now()
      val otherMoment = LocalDate.now().minusDays(10)

      val message = "this is some message"
      val otherMessage = "this is some other message"

      withHandler {
        handler =>
          executeDdl(handler, this.messagesCreate)
          executeDdl(handler, create)

          foreach(1.until(4)) {
            x =>
              executePreparedStatement(handler, this.messagesInsert, Array(message, moment))
              executePreparedStatement(handler, insert, Array(otherMoment, otherMessage))

              val result = executePreparedStatement(handler, this.messagesSelectAll).rows.get
              result.size === x
              result.columnNames must contain(allOf("id", "content", "moment")).inOrder
              result(x - 1)("moment") === moment
              result(x - 1)("content") === message

              val otherResult = executePreparedStatement(handler, select).rows.get
              otherResult.size === x
              otherResult.columnNames must contain(allOf("id", "other_moment", "other_content")).inOrder
              otherResult(x - 1)("other_moment") === otherMoment
              otherResult(x - 1)("other_content") === otherMessage
          }

      }

    }

    "support prepared statement with Option parameters (Some/None)" in {
      withHandler {
        handler =>

          val firstContent = "Some Moment"
          val secondContent = "Some Other Moment"
          val date = LocalDate.now()

          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, this.messagesInsert, Array(Some(firstContent), None))
          executePreparedStatement(handler, this.messagesInsert, Array(Some(secondContent), Some(date)))

          val rows = executePreparedStatement(handler, this.messagesSelectAll).rows.get

          rows.length === 2

          rows(0)("id") === 1
          rows(0)("content") === firstContent
          rows(0)("moment") === null

          rows(1)("id") === 2
          rows(1)("content") === secondContent
          rows(1)("moment") === date
      }
    }

    "supports sending null first and then an actual value for the fields" in {
      withHandler {
        handler =>

          val firstContent = "Some Moment"
          val secondContent = "Some Other Moment"
          val date = LocalDate.now()

          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, this.messagesInsert, Array(firstContent, null))
          executePreparedStatement(handler, this.messagesInsert, Array(secondContent, date))

          val rows = executePreparedStatement(handler, this.messagesSelectByMoment, Array(null)).rows.get
          rows.size === 0

          /*
          PostgreSQL does not know how to handle NULL parameters for a query in a prepared statement,
          you have to use IS NULL if you want to make use of it.

          rows.length === 1

          rows(0)("id") === 1
          rows(0)("content") === firstContent
          rows(0)("moment") === null
          */

          val rowsWithoutNull = executePreparedStatement(handler, this.messagesSelectByMoment, Array(date)).rows.get
          rowsWithoutNull.size === 1
          rowsWithoutNull(0)("id") === 2
          rowsWithoutNull(0)("content") === secondContent
          rowsWithoutNull(0)("moment") === date
      }
    }

    "support prepared statement with escaped placeholders" in {
      withHandler {
        handler =>

          val firstContent = "Some? Moment"
          val secondContent = "Some Other Moment"
          val date = LocalDate.now()

          executeDdl(handler, this.messagesCreate)
          executePreparedStatement(handler, this.messagesInsert, Array(Some(firstContent), None))
          executePreparedStatement(handler, this.messagesInsert, Array(Some(secondContent), Some(date)))

          val rows = executePreparedStatement(handler, this.messagesSelectEscaped, Array(0)).rows.get

          rows.length === 1

          rows(0)("id") === 1
          rows(0)("content") === firstContent
          rows(0)("moment") === null

      }
    }

    "support handling of enum types" in {

      withHandler {
        handler =>
          val create = """CREATE TEMP TABLE messages
                         |(
                         |id bigserial NOT NULL,
                         |feeling example_mood,
                         |CONSTRAINT bigserial_column_pkey PRIMARY KEY (id )
                         |);""".stripMargin
          val insert = "INSERT INTO messages (feeling) VALUES (?) RETURNING id"
          val select = "SELECT * FROM messages"

          executeDdl(handler, create)

          executePreparedStatement(handler, insert, Array("sad"))

          val result = executePreparedStatement(handler, select).rows.get

          result.size === 1
          result(0)("id") === 1L
          result(0)("feeling") === "sad"
      }

    }

    "support handling JSON type" in {

      if ( System.getenv("TRAVIS") == null ) {
        withHandler {
          handler =>
            val create = """create temp table people
                           |(
                           |id bigserial primary key,
                           |addresses json,
                           |phones json
                           |);""".stripMargin

            val insert = "INSERT INTO people (addresses, phones) VALUES (?,?) RETURNING id"
            val select = "SELECT * FROM people"
            val addresses = """[ {"Home" : {"city" : "Tahoe", "state" : "CA"}} ]"""
            val phones = """[ "925-575-0415", "916-321-2233" ]"""

            executeDdl(handler, create)
            executePreparedStatement(handler, insert, Array(addresses, phones) )
            val result = executePreparedStatement(handler, select).rows.get

            result(0)("addresses") === addresses
            result(0)("phones") === phones
        }
        success
      } else {
        pending
      }
    }

    "support select bind value" in {
      withHandler {
        handler =>
          val string = "someString"
          val result = executePreparedStatement(handler, "SELECT CAST(? AS VARCHAR)", Array(string)).rows.get
          result(0)(0) === string
      }
    }

    "fail if prepared statement has more variables than it was given" in {
      withHandler {
        handler =>
          executeDdl(handler, messagesCreate)

          handler.sendPreparedStatement(
            "SELECT * FROM messages WHERE content = ? AND moment = ?",
            Array("some content")) must throwAn[InsufficientParametersException]
      }
    }

    "run prepared statement twice with bad and good values" in {
      withHandler {
        handler =>
          val content = "Some Moment"

          val query = "SELECT content FROM messages WHERE id = ?"

          executeDdl(handler, messagesCreate)
          executePreparedStatement(handler, this.messagesInsert, Array(Some(content), None))

          executePreparedStatement(handler, query, Array("undefined")) must throwA[GenericDatabaseException]
          val result = executePreparedStatement(handler, query, Array(1)).rows.get
          result(0)(0) === content
      }
    }

    "support UUID" in {
      if ( System.getenv("TRAVIS") == null ) {
        withHandler {
          handler =>
            val create = """create temp table uuids
                           |(
                           |id bigserial primary key,
                           |my_id uuid
                           |);""".stripMargin

            val insert = "INSERT INTO uuids (my_id) VALUES (?) RETURNING id"
            val select = "SELECT * FROM uuids"

            val uuid = UUID.randomUUID()

            executeDdl(handler, create)
            executePreparedStatement(handler, insert, Array(uuid) )
            val result = executePreparedStatement(handler, select).rows.get

            result(0)("my_id").asInstanceOf[UUID] === uuid
        }
        success
      } else {
        pending
      }
    }

    "support UUID array" in {
      if ( System.getenv("TRAVIS") == null ) {
        withHandler {
          handler =>
            val create = """create temp table uuids
                           |(
                           |id bigserial primary key,
                           |my_id uuid[]
                           |);""".stripMargin

            val insert = "INSERT INTO uuids (my_id) VALUES (?) RETURNING id"
            val select = "SELECT * FROM uuids"

            val uuid1 = UUID.randomUUID()
            val uuid2 = UUID.randomUUID()

            executeDdl(handler, create)
            executePreparedStatement(handler, insert, Array(Array(uuid1, uuid2)) )
            val result = executePreparedStatement(handler, select).rows.get

            result(0)("my_id").asInstanceOf[Seq[UUID]] === Seq(uuid1, uuid2)
        }
        success
      } else {
        pending
      }
    }

  }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Environments</title>
    <meta name="description" content="Environments">

          None
          Cubes
          Pyramids
          Cylinders
          Towers
          Mushrooms
          Trees
          Apparatus
          Torii

          None
          Checkerboard
          Squares
          Walker Noise


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Play video on presentation displays</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Chunyan Wang" href="mailto:chunyanx.wang@intel.com">
<link rel="help" href="http://www.w3.org/TR/2015/WD-presentation-api-20150701/#interface-navigatorpresentation">
<meta name="assert" content="Test checks that an example of playing video on presentation displays.">

Turn on 'Simulate Secondary Display' by 'Setting' app.

Make sure connect to an available network.

Test passes if the presentation display play a video after clicking the below button.

  <input id="btnPlay" type="button" onclick="startNewSession()" value="Play">


text:
function configure_submodules()
{
  git submodule init
  git submodule update
  git submodule status
}
function amalgamate_croaring()
{
  pushd .
  cd src
  # generates header files
  ../deps/CRoaring/amalgamation.sh
  popd
}
function configure_redis()
{
  pushd .
  cd deps/redis

  cd deps
  make hiredis jemalloc linenoise lua
  cd ..

  make
  popd
}
function configure_hiredis()
{
  cd deps/hiredis
  make
  cd -
}
function build()
{
  mkdir -p build
  cd build
  cmake ..
  make
  local LIB=$(find libredis-roaring*)

  cd ..
  mkdir -p dist
  cp "build/$LIB" dist
  cp deps/redis/redis.conf dist
  cp deps/redis/src/{redis-benchmark,redis-check-aof,redis-check-rdb,redis-cli,redis-sentinel,redis-server} dist
  echo "loadmodule $(pwd)/dist/$LIB" >> dist/redis.conf
}
function instructions()
{
  echo ""
  echo "Start redis server with redis-roaring:"
  echo "./dist/redis-server ./dist/redis.conf"
  echo "Connect to server:"
  echo "./dist/redis-cli"
}

configure_submodules
amalgamate_croaring
configure_redis
configure_hiredis
build
instructions


text:
package org.apache.click.control;

import org.apache.click.Context;

/**
 * Provides a decorator interface for delegating object rendering.
 *
 *
Decorator Example

 *
 * The following example illustrates how to render a email hyperlink in a
 * email table column.
 *
 *

 * Column column = new Column("email");
 *
 * column.setDecorator(new Decorator() {
 *     public String render(Object row, Context context) {
 *         Customer customer = (Customer) row;
 *         String email = customer.getEmail();
 *         String fullName = customer.getFullName();
 *         return "<a href='mailto:" + email + "'>" + fullName + "</a>";
 *     }
 * });
 *
 * table.addColumn(column);

 *
 * @see Column
 * @see Table
 */
public interface Decorator {

    /**
     * Returns a decorated string representation of the given object.
     *
     * @param object the object to render
     * @param context the request context
     * @return a decorated string representation of the given object
     */
    public String render(Object object, Context context);
}


text:
using System;
using System.Collections.Generic;
using Minalear;
using OpenTK;

namespace DongLife.Scenes.EndScenes
{
    public class GEND_TimeParadox : EndScene
    {
        private Texture2D shiaHead;
        private List<ShiaHead> shiaPositions;

        private float spawnTimer = 0f;
        private float crashTimer = 5000f;

        public GEND_TimeParadox() : base(
            "GEND_TimeParadox", true, "YOU CREATED A TIME PARADOX!")
        {
            shiaPositions = new List<ShiaHead>();
        }

        public override void Update(GameTime gameTime)
        {
            crashTimer -= (float)gameTime.ElapsedTime.TotalMilliseconds;
            if (crashTimer <= 0f)
                throw new TimeParadoxException("YOU CREATED A TIME PARADOX!");

            spawnTimer += (float)gameTime.ElapsedTime.TotalMilliseconds;
            if (spawnTimer > 450f)
            {
                spawnTimer = 0f;
                spawnNewShiaHead();
            }

            for (int i = 0; i < shiaPositions.Count; i++)
            {
                shiaPositions[i].Opacity = MathHelper.Clamp(
                    shiaPositions[i].Opacity + 0.1f * (float)gameTime.ElapsedTime.TotalMilliseconds,
                    0f, 1f);
            }

            base.Update(gameTime);
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            for (int i = 0; i < shiaPositions.Count; i++)
            {
                spriteBatch.Draw(shiaHead, shiaPositions[i].Position, new OpenTK.Graphics.Color4(1f, 1f, 1f, shiaPositions[i].Opacity));
            }
        }

        public override void LoadContent(ContentManager content)
        {
            shiaHead = content.LoadTexture2D(@"Textures/Props/shia_head.png");

            base.LoadContent(content);
        }
        public override void UnloadContent()
        {
            shiaHead.Dispose();

            base.UnloadContent();
        }

        private void spawnNewShiaHead()
        {
            ShiaHead head = new ShiaHead();
            head.Position = new Vector2(
                RNG.NextFloat(0, GameSettings.WindowWidth),
                RNG.NextFloat(0, GameSettings.WindowHeight));
            head.Opacity = 0f;

            shiaPositions.Add(head);
        }

        private class ShiaHead
        {
            public Vector2 Position;
            public float Opacity;
        }
    }

    public class TimeParadoxException : Exception
    {
        public TimeParadoxException() : base() { }
        public TimeParadoxException(string msg) : base(msg) { }
        public TimeParadoxException(string msg, Exception e) : base(msg, e) { }
    }
}


text:
package com.cspinformatique.kubik.kos.domain.notification.processor;

import java.util.HashMap;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.cspinformatique.kubik.server.model.kos.KosNotification.Type;

@Component
public class NotificationProcessors {
	@Resource
	private List<NotificationProcessor> notificationProcessorList;

	private HashMap<Type, NotificationProcessor> processorsMap;

	@PostConstruct
	public void init() {
		processorsMap = new HashMap<>();

		notificationProcessorList.forEach(processor -> processorsMap.put(processor.getType(), processor));
	}

	public NotificationProcessor getProcessor(Type type) {
		return processorsMap.get(type);
	}

}


text:
<?php

/**
 * TOP API: taobao.hanoi.datatemplate.delete request
 *
 * @author auto create
 * @since  1.0, 2013-09-13 16:51:03
 */
class Taobao_Request_HanoiDatatemplateDeleteRequest {
	/**
	 * APPName
	 **/
	private $appName;

	/**
	 * id:通过query服务接口得到ID
	 **/
	private $parameter;

	private $apiParas = array();

	public function setAppName($appName) {
		$this->appName = $appName;
		$this->apiParas["app_name"] = $appName;
	}

	public function getAppName() {
		return $this->appName;
	}

	public function setParameter($parameter) {
		$this->parameter = $parameter;
		$this->apiParas["parameter"] = $parameter;
	}

	public function getParameter() {
		return $this->parameter;
	}

	public function getApiMethodName() {
		return "taobao.hanoi.datatemplate.delete";
	}

	public function getApiParas() {
		return $this->apiParas;
	}

	public function check() {

		Taobao_RequestCheckUtil::checkNotNull($this->appName, "appName");
		Taobao_RequestCheckUtil::checkNotNull($this->parameter, "parameter");
	}

	public function putOtherTextParam($key, $value) {
		$this->apiParas[$key] = $value;
		$this->$key = $value;
	}
}


text:
@interface XWCollectionViewCell ()
@property (nonatomic, weak) UILabel *label;
@end

@implementation XWCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UILabel *label = [UILabel new];
        _label = label;
        [self.contentView addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(self);
        }];
    }
    return self;
}

- (void)setTitle:(NSString *)title{
    _title = title;
    _label.text = title;
}

@end