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

<title>Uses of Interface org.w3c.dom.events.Event (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.w3c.dom.events.Event

Packages that use Event

Package
Description

org.w3c.dom.events

org.w3c.dom.ls

Uses of Event in org.w3c.dom.events

Subinterfaces of Event in org.w3c.dom.events

Modifier and Type
Interface and Description

interface
MouseEvent

The MouseEvent interface provides specific contextual
 information associated with Mouse events.

interface
MutationEvent

The MutationEvent interface provides specific contextual
 information associated with Mutation events.

interface
UIEvent

The UIEvent interface provides specific contextual information
 associated with User Interface events.

Methods in org.w3c.dom.events that return Event

Modifier and Type
Method and Description

Event
DocumentEvent.createEvent(String eventType)

Methods in org.w3c.dom.events with parameters of type Event

Modifier and Type
Method and Description

boolean
EventTarget.dispatchEvent(Event evt)

This method allows the dispatch of events into the implementations
 event model.

void
EventListener.handleEvent(Event evt)

This method is called whenever an event occurs of the type for which
 the  EventListener interface was registered.

Uses of Event in org.w3c.dom.ls

Subinterfaces of Event in org.w3c.dom.ls

Modifier and Type
Interface and Description

interface
LSLoadEvent

This interface represents a load event object that signals the completion
 of a document load.

interface
LSProgressEvent

This interface represents a progress event object that notifies the
 application about progress as a document is parsed.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
package io.fabric8.collector.git;

import io.fabric8.collector.NamespaceName;
import io.fabric8.collector.elasticsearch.EmbeddedElasticsearchTestSupport;
import io.fabric8.collector.git.elasticsearch.GitElasticsearchClient;
import io.fabric8.utils.Files;
import org.eclipse.jgit.api.Git;
import org.junit.Test;

import java.io.File;
import java.io.IOException;

import static io.fabric8.collector.git.GitHelpers.gitFromGitFolder;
import static org.junit.Assert.assertEquals;

/**
 */
public class GitCollectorTest extends EmbeddedElasticsearchTestSupport {
    protected int commitLimit = 2;
    protected String gitUrl = "https://github.com/jstrachan/test-git-collector.git";
    protected String branch = "master";
    protected NamespaceName namespaceName = new NamespaceName("default", "myapp");
    protected long pollPeriod = 4 * 1000;

    @Test
    public void testCollectionPopulatesElasticSearch() throws Exception {
        GitElasticsearchClient elasticsearchClient = new GitElasticsearchClient("http://127.0.0.1/", elasticsearchPort, null, null);
        File cloneFolder = new File(getBaseDir(), "target/test-git-clone/sample");
        Files.recursiveDelete(cloneFolder);
        cloneFolder.getParentFile().mkdirs();

        GitBuildConfigProcessor processor = new GitBuildConfigProcessor(elasticsearchClient, cloneFolder, commitLimit);

        assertProcessGitrepoCommits(processor, 2, true);
        assertProcessGitrepoCommits(processor, 2, true);
        assertProcessGitrepoCommits(processor, 1, true);
        assertProcessGitrepoCommits(processor, 0, true);

        // now lets make a commit and check we get a new item pushed to ES
        File projectDir = new File(cloneFolder, namespaceName.getNamespace() + "/" + namespaceName.getName());

        Files.writeToFile(new File(projectDir, "README.md"), "Dummy-commit!".getBytes());
        Git git = gitFromGitFolder(new File(projectDir, ".git"));
        git.commit().setMessage("Dummy test commit").call();

        System.out.println("Just done a commit!");

        assertProcessGitrepoCommits(processor, 1, true);
        assertProcessGitrepoCommits(processor, 0, true);
    }

    protected void assertProcessGitrepoCommits(GitBuildConfigProcessor processor, int expectedCount, boolean sleep) throws IOException, InterruptedException {
        int actual = processor.processGitRepo(namespaceName, gitUrl, branch);
        System.out.println("Processed " + actual + " commit(s)");
        assertEquals("number of commits", expectedCount, actual);
        if (sleep) {
            Thread.sleep(pollPeriod);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
namespace P03_SalesDatabase.Data.Models
{
    using System.Collections.Generic;

    public class Store
    {
        public Store()
        {
            this.Sales = new List<Sale>();
        }

        public int StoreId { get; set; }

        public string Name { get; set; }

        public ICollection<Sale> Sales { get; set; }
    }
}


text:
import React from 'react';
import ButtonWithOptions from 'wix-style-react/ButtonWithOptions';
import {Close} from '../../src/Icons/dist/index';

const style = {
  display: 'inline-block',
  padding: '0 5px 0',
  width: '200px',
  lineHeight: '22px',
  marginBottom: '350px'
};

const options = [
  {id: '0', value: 'First option'},
  {id: '1', value: 'Second option'},
  {id: '2', value: 'Third option', disabled: true},
  {id: '3', value: 'Fourth option'},
  {id: '4', value: 'Fifth option'},
  {id: '5', value: 'Very long option text jldlkasj ldk jsalkdjsal kdjaklsjdlkasj dklasj'}
];

const createOptions = options => options.map(option => {
  const {value, ...props} = option;
  return <ButtonWithOptions.Option key={option.id} {...props}>{value}</ButtonWithOptions.Option>;
});

class ControlledInputWithOptions extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      value: '',
      selectedId: -1
    };
  }

  render() {
    const onSelect = option => {
      const value = option.value;
      this.setState({
        value,
        selectedId: option.id
      });

      console.log(`Selected option id=${JSON.stringify(option)}, value=${value}`);
    };

    const predicate = element =>
      this.state.value ?
      element.value.toLowerCase().indexOf(this.state.value.toLowerCase()) !== -1 :
      true;

    return (
      <ButtonWithOptions
        selectedId={this.state.selectedId}
        value={this.state.value}
        onSelect={onSelect}
        >
        <ButtonWithOptions.Button
          height="medium"
          theme="icon-standard"
          >
          <Close size="12px"/>
        </ButtonWithOptions.Button>
        {createOptions(options.filter(predicate))}
      </ButtonWithOptions>
    );
  }
}

export default () =>
  <div className="ltr" style={style}>
    <ControlledInputWithOptions/>
  </div>;


text:
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */
#if !defined INC_PUBNUB_HELPER
#define	INC_PUBNUB_HELPER

#include "pubnub_api_types.h"

/** @file pubnub_helper.h

    This is a set of "Helper" functions of the Pubnub client library.
    You don't need this to work with Pubnub client, but they may come
    in handy.
*/

/** Possible (known) publish results (outcomes) in the description
    received from Pubnub.
 */
enum pubnub_publish_res {
  /** Publish succeeded, message sent on the channel */
  PNPUB_SENT,
  /** Publish failed, the message had invalid JSON */
  PNPUB_INVALID_JSON,
  /** Publish failed, the channel had an invalid character in the name */
  PNPUB_INVALID_CHAR_IN_CHAN_NAME,
  /** The publishing quota for this account was exceeded */
  PNPUB_ACCOUNT_QUOTA_EXCEEDED,
  /** Publish failed, but we were not able to parse the error description */
  PNPUB_UNKNOWN_ERROR,
};

/** Parses the given publish @p result. You usually obtain this with
    pubnub_last_publish_result().
 */
enum pubnub_publish_res pubnub_parse_publish_result(char const *result);

/** Returns a string (in English) describing a Pubnub result enum value
    @p e.
 */
char const* pubnub_res_2_string(enum pubnub_res e);

#endif /* defined INC_PUBNUB_HELPER */


text:
<?php
/**
 * Created by PhpStorm.
 * User: Giansalex
 * Date: 16/07/2017
 * Time: 21:03.
 */

declare(strict_types=1);

namespace Greenter\Model\Company;

/**
 * Class Company.
 */
class Company
{
    /**
     * @var string|null
     */
    private $ruc;

    /**
     * @var string|null
     */
    private $razonSocial;

    /**
     * @var string|null
     */
    private $nombreComercial;

    /**
     * @var Address|null
     */
    private $address;

    /**
     * @var string|null
     */
    private $email;

    /**
     * @var string|null
     */
    private $telephone;

    /**
     * @return string|null
     */
    public function getRuc(): ?string
    {
        return $this->ruc;
    }

    /**
     * @param string|null $ruc
     *
     * @return Company
     */
    public function setRuc(?string $ruc): Company
    {
        $this->ruc = $ruc;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getRazonSocial(): ?string
    {
        return $this->razonSocial;
    }

    /**
     * @param string|null $razonSocial
     *
     * @return Company
     */
    public function setRazonSocial(?string $razonSocial): Company
    {
        $this->razonSocial = $razonSocial;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getNombreComercial(): ?string
    {
        return $this->nombreComercial;
    }

    /**
     * @param string|null $nombreComercial
     *
     * @return Company
     */
    public function setNombreComercial(?string $nombreComercial): Company
    {
        $this->nombreComercial = $nombreComercial;

        return $this;
    }

    /**
     * @return Address|null
     */
    public function getAddress(): ?Address
    {
        return $this->address;
    }

    /**
     * @param Address|null $address
     *
     * @return Company
     */
    public function setAddress(?Address $address): Company
    {
        $this->address = $address;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getEmail(): ?string
    {
        return $this->email;
    }

    /**
     * @param string|null $email
     *
     * @return Company
     */
    public function setEmail(?string $email): Company
    {
        $this->email = $email;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getTelephone(): ?string
    {
        return $this->telephone;
    }

    /**
     * @param string|null $telephone
     *
     * @return Company
     */
    public function setTelephone(?string $telephone): Company
    {
        $this->telephone = $telephone;

        return $this;
    }
}


text:
package org.unipop.rest.schema;

import com.mashape.unirest.http.exceptions.UnirestException;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.request.BaseRequest;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.json.JSONArray;
import org.json.JSONObject;
import org.unipop.query.predicates.PredicateQuery;
import org.unipop.query.predicates.PredicatesHolder;
import org.unipop.query.search.SearchQuery;
import org.unipop.rest.RestSchema;
import org.unipop.rest.util.MatcherHolder;
import org.unipop.rest.util.PredicatesTranslator;
import org.unipop.rest.util.TemplateHolder;
import org.unipop.schema.element.AbstractElementSchema;
import org.unipop.schema.property.PropertySchema;
import org.unipop.structure.UniGraph;

import java.util.*;
import java.util.stream.Collectors;

/**
 * Created by sbarzilay on 24/11/16.
 */
public abstract class AbstractRestSchema<E extends Element> extends AbstractElementSchema<E> implements RestSchema<E> {

    protected String baseUrl;
    protected String resource;
    protected TemplateHolder templateHolder;
    protected String resultPath;
    protected JSONObject opTranslator;
    protected int maxResultSize;
    protected List<Map<String, Object>> bulk;
    protected int bulkSize;
    protected MatcherHolder complexTranslator;
    protected boolean valuesToString;

    public AbstractRestSchema(JSONObject configuration, UniGraph graph, String url, TemplateHolder templateHolder, String resultPath, JSONObject opTranslator, int maxResultSize, MatcherHolder complexTranslator, boolean valuesToString) {
        super(configuration, graph);
        this.resource = configuration.optString("resource");
        this.templateHolder = templateHolder;
        this.baseUrl = url;
        this.resultPath = resultPath;
        this.opTranslator = opTranslator;
        this.maxResultSize = maxResultSize;
        this.bulk = new ArrayList<>();
        this.bulkSize = 1000;
        this.complexTranslator = complexTranslator;
        this.valuesToString = valuesToString;
    }

    public AbstractRestSchema(JSONObject configuration, UniGraph graph, String url, String resource, TemplateHolder templateHolder, String resultPath, JSONObject opTranslator, int maxResultSize, MatcherHolder complexTranslator, boolean valuesToString) {
        super(configuration, graph);
        this.resource = resource;
        this.templateHolder = templateHolder;
        this.baseUrl = url;
        this.resultPath = resultPath;
        this.opTranslator = opTranslator;
        this.maxResultSize = maxResultSize;
        this.bulk = new ArrayList<>();
        this.bulkSize = 1000;
        this.complexTranslator = complexTranslator;
        this.valuesToString = valuesToString;
    }

    @Override
    public BaseRequest getSearch(SearchQuery<E> query) {
        int limit = query.getOrders() == null || query.getOrders().size() > 0 ? -1 : query.getLimit();
        return createSearch(this.toPredicates(query.getPredicates()), limit);
    }

    protected BaseRequest createSearch(PredicatesHolder predicatesHolder, int limit) {
        if (limit == -1)
            limit = maxResultSize;
        else
            limit = Math.min(maxResultSize, limit);
        Map<String, Object> predicates = PredicatesTranslator.translate(predicatesHolder, opTranslator, complexTranslator, valuesToString, limit);

        Map<String, Object> urlMap = new HashMap<>();
        urlMap.put("resource", resource);
        BaseRequest request = templateHolder.getSearch().execute(baseUrl, urlMap, predicates);

        try {
            if (bulk.size() > 0)
                runBulk();
            if (templateHolder.isCommit())
                templateHolder.getCommit().execute(baseUrl, urlMap, predicates).asJson();
        } catch (UnirestException e) {
            e.printStackTrace();
        }

        return request;
    }

    protected Set<String> toFields() {
        Set<String> keys = propertySchemas.stream().map(PropertySchema::getKey).collect(Collectors.toSet());
        return toFields(keys);
    }

    @Override
    public List<E> parseResults(HttpResponse<JsonNode> result, PredicateQuery query) {
        String[] path = resultPath.split("\\.");
        JSONObject object = result.getBody().getObject();
        JSONArray results = null;
        for (int i = 0; i < path.length; i++) {
            if (i == path.length - 1)
                results = object.getJSONArray(path[i]);
            else
                object = object.getJSONObject(path[i]);
        }
        List<E> elements = new ArrayList<>();
        for (int i = 0; i < results.length(); i++) {
            JSONObject jsonResult = results.getJSONObject(i);

            Set<String> fields = toFields();
            Map<String, Object> fieldsMap = new HashMap<>();
            fields.forEach(field -> {
                String[] fieldPath = field.split("\\.");
                Object data = jsonResult;
                for (String key : fieldPath) {
                    if (data instanceof JSONObject)
                        data = ((JSONObject) data).opt(key);
                }
                if (data != null) {
                    if (!NumberUtils.isNumber(data.toString()))
                        fieldsMap.put(field, data);
                    else {
                        Number number = NumberUtils.createNumber(data.toString());
                        if (number instanceof Float)
                            number = Double.parseDouble(data.toString());
                        fieldsMap.put(field, number);
                    }
                }
            });
            E element = create(fieldsMap);
            if (element != null && query.test(element, query.getPredicates()))
                elements.add(element);
        }
        return elements;
    }

    protected abstract E create(Map<String, Object> fields);

    private void runBulk(){
        BaseRequest bulk = templateHolder.getBulk().execute(baseUrl, Collections.singletonMap("resource", this.resource), Collections.singletonMap("bulk", this.bulk));
        try {
            bulk.asJson();
            this.bulk.clear();
        } catch (UnirestException e) {
            e.printStackTrace();
        }
    }

    @Override
    public BaseRequest addElement(E element) throws NoSuchElementException{
        Map<String, Object> fields = toFields(element);
        if (fields == null) throw new NoSuchElementException();
        Map<String, Object> stringObjectMap = fields
                .entrySet().stream()
                .map(entry -> {
                    String[] split = entry.getKey().split("\\.");
                    return new HashMap.SimpleEntry<>(split[split.length - 1], entry.getValue());
                }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
        Map<String, Object> urlMap = new HashMap<>();
        urlMap.putAll(stringObjectMap);
        urlMap.put("resource", resource);
        return insertElement(urlMap, stringObjectMap);
    }

    protected BaseRequest insertElement(Map<String, Object> urlMap, Map<String, Object> object){
        if (templateHolder.isBulk()){
            Map<String, Object> insert = new HashMap<>();
            insert.put("object", Collections.singletonMap("prop", object.entrySet()));
            insert.put("url", urlMap);
            bulk.add(insert);
            if (bulk.size() >= bulkSize)
                runBulk();
            return null;
        }

        if (templateHolder.isAdd())
            return templateHolder.getAdd().execute(baseUrl, urlMap, Collections.singletonMap("prop", object.entrySet()));
        return null;
    }

    @Override
    public BaseRequest delete(E element) {
        if(templateHolder.isDelete()) {
            Map<String, Object> fields = toFields(element);
            if (fields == null) throw new NoSuchElementException();
            Map<String, Object> stringObjectMap = fields
                    .entrySet().stream()
                    .map(entry -> {
                        String[] split = entry.getKey().split("\\.");
                        return new HashMap.SimpleEntry<>(split[split.length - 1], entry.getValue());
                    }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
            Map<String, Object> urlMap = new HashMap<>();
            urlMap.putAll(stringObjectMap);
            urlMap.put("resource", this.resource);
            return templateHolder.getDelete().execute(baseUrl, urlMap, element);
        }
        return null;
    }
}


text:
Imports MySql.Data.MySqlClient

Public Class AsyncLoad

    Private Delegate Sub FillFridDelegate(ByVal reader As MySqlDataReader)

    Private Delegate Sub DisplayStatusDelegate(ByVal Text As String)

    Private isExecuting As Boolean

    Private connection As MySqlConnection

    Private Sub DisplayStatus(ByVal Text As String)
        Me.Label1.Text = Text
    End Sub

    Private Sub FillGrid(ByVal reader As MySqlDataReader)
        Try
            ListProduits.Items.Clear()
            While reader.Read
                Dim item As New ListViewItem(reader.GetValue(0).ToString)
                item.SubItems.Add(reader.GetValue(1).ToString)
                item.SubItems.Add(reader.GetValue(2).ToString)
                If CDbl(reader.GetValue(2)) = 0 Then
                    item.BackColor = Color.OrangeRed
                    item.ForeColor = Color.White
                Else
                    item.BackColor = Color.Orange
                End If

                ListProduits.Items.Add(item)
            End While
        Catch ex As Exception
            DisplayStatus(String.Format("Exception : {0}", ex.Message))
        Finally
            If Not reader Is Nothing Then
                reader.Close()
            End If
        End Try
    End Sub

    Private Sub HandleCallback(ByVal result As IAsyncResult)

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If isExecuting Then
            MessageBox.Show(Me, "En cours d'execution attendre que la lecture finisse")
        Else
            Dim command As MySqlCommand
            Try
                DisplayStatus("connection.....")
                command = Database.GetCommand
                command.CommandText = "SELECT id, libelle, qte FROM test"
                DisplayStatus("Exection en cours")
                isExecuting = True

                Dim reader = command.BeginExecuteReader

            Catch ex As Exception

            End Try
        End If
    End Sub
End Class


text:
import articleRepository from '../domain/repositories/article-repository'

const sortByDescendingNumberWithIntegerKey = (list, key) => list.sort((objectA, objectB) => {
  if (parseInt(objectA[key], 10) > parseInt(objectB[key], 10)) {
    return -1
  }
  if (parseInt(objectA[key], 10) < parseInt(objectB[key], 10)) {
    return 1
  }
  return 0
})

async function getAllArticles(limit) {
  if (limit === '0') {
    return articleRepository.getAll()
  }
  // better would be to use findAll order, but dropboxId is a string!!
  const allArticles = await articleRepository.getAll(limit)
  const selectLastUntil = sortByDescendingNumberWithIntegerKey(allArticles, 'dropboxId')
  return selectLastUntil.slice(0, limit)
}

export default {
  getAllArticles,
}


text:
<?php

namespace Laminas\Code\Reflection\DocBlock\Tag;

use function explode;
use function preg_match;
use function rtrim;

class PropertyTag implements TagInterface, PhpDocTypedTagInterface
{
    /**
     * @var array
     */
    protected $types = [];

    /**
     * @var string
     */
    protected $propertyName;

    /**
     * @var string
     */
    protected $description;

    /**
     * @return string
     */
    public function getName()
    {
        return 'property';
    }

    /**
     * Initializer
     *
     * @param  string $tagDocblockLine
     */
    public function initialize($tagDocblockLine)
    {
        $match = [];
        if (! preg_match('#^(.+)?(\$[\S]+)[\s]*(.*)$#m', $tagDocblockLine, $match)) {
            return;
        }

        if ($match[1] !== '') {
            $this->types = explode('|', rtrim($match[1]));
        }

        if ($match[2] !== '') {
            $this->propertyName = $match[2];
        }

        if ($match[3] !== '') {
            $this->description = $match[3];
        }
    }

    /**
     * @return null|string
     * @deprecated 2.0.4 use getTypes instead
     */
    public function getType()
    {
        if (empty($this->types)) {
            return;
        }

        return $this->types[0];
    }

    public function getTypes()
    {
        return $this->types;
    }

    /**
     * @return null|string
     */
    public function getPropertyName()
    {
        return $this->propertyName;
    }

    /**
     * @return null|string
     */
    public function getDescription()
    {
        return $this->description;
    }

    public function __toString()
    {
        return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
    }
}


text:
package com.reallymany.trapgrid;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

import au.com.bytecode.opencsv.CSVReader;

public class SimulationRunner {
	int numberOfSimulations;
	TrapGrid tg;
	int numberOfDays;
	int numberOfFlies;
	double diffCoeff;
	double stepSize;
	int stepsPerDay;
	double turnAngleStdev;
	boolean useMDD;
	Random rng;
	public ArrayList<SimulationResultsHolder> allResults;
	boolean outbreakLocationsProvided;
	String outbreakFile;
	ArrayList<Outbreak> outbreaks;

	public SimulationRunner(TrapGrid tg, int numDays, int numFlies, double diffC,
			double stepSize, int stepsPerDay, double turnAngleStdev, boolean useMDD, long seed, int numSims) {
		this.tg = tg;
		this.numberOfDays = numDays;
		this.numberOfFlies = numFlies;
		this.diffCoeff = diffC;
		this.stepSize = stepSize;
		this.stepsPerDay = stepsPerDay;
		this.turnAngleStdev = turnAngleStdev;
		this.useMDD = useMDD;
		this.rng = new Random(seed);
		this.numberOfSimulations = numSims;
		allResults = new ArrayList<SimulationResultsHolder>();
		outbreakLocationsProvided = false;
	}

	public SimulationRunner(TrapGrid tg, String outbreakFile, int numDays, int numFlies, double diffCoeff,
			double stepSize, int stepsPerDay, double turnAngleStdev, boolean useMDD, long seed) {
		this.tg = tg;
		this.numberOfDays = numDays;
		this.outbreakFile = outbreakFile;
		this.numberOfFlies = numFlies;
		this.diffCoeff = diffCoeff;
		this.stepSize = stepSize;
		this.stepsPerDay = stepsPerDay;
		this.turnAngleStdev = turnAngleStdev;
		this.useMDD = useMDD;
		this.rng = new Random(seed);
		allResults = new ArrayList<SimulationResultsHolder>();
		outbreakLocationsProvided = true;
	}

	Simulation createSimulation(TrapGrid t, Outbreak f) {
		return new Simulation(t, f, numberOfDays);
	}

	Outbreak createRandomOutbreak(TrapGrid tg, long s) {
		boolean useRandomLocation = true;
		double xMax = tg.xMax;
		double yMax = tg.yMax;
		Outbreak f = new Outbreak(xMax, yMax, numberOfFlies, diffCoeff, stepSize, stepsPerDay, turnAngleStdev, useMDD, s, useRandomLocation);
		return f;
	}

	public void runSimulations() {
		if (! outbreakLocationsProvided) {
			for (int i=0; i<numberOfSimulations; i++) {
				long nextLong = rng.nextLong();
				Outbreak ob = createRandomOutbreak(tg, nextLong);
				Simulation sim = createSimulation(tg, ob);
				SimulationResultsHolder oneResult = sim.runSimulation();
				allResults.add(oneResult);
			}
		} else {
			try {
				this.outbreaks = createOutbreaksFromFile(outbreakFile);
			} catch (IOException e) {
				System.err.println("Error trying to read outbreak file");
				e.printStackTrace();
				System.exit(-1);
			}
			for (Outbreak ob : this.outbreaks) {
				Simulation sim = createSimulation(tg, ob);
				SimulationResultsHolder oneResult = sim.runSimulation();
				allResults.add(oneResult);
			}
		}
	}

	public ArrayList<Outbreak> createOutbreaksFromFile(String filename) throws IOException {
		ArrayList<Outbreak> myOutbreaks = new ArrayList<Outbreak>();
		boolean useRandomLocation = false;
		try {
			CSVReader reader = new CSVReader(new FileReader(filename), '\t');
			String[] nextLine;
			while ((nextLine = reader.readNext()) != null) {
				if (nextLine.length == 2) {
					double x = Double.parseDouble(nextLine[0]);
					double y = Double.parseDouble(nextLine[1]);
					long nextLong = rng.nextLong();
					Outbreak ob = new Outbreak(x, y, numberOfFlies, diffCoeff, stepSize,
							stepsPerDay, turnAngleStdev, useMDD, nextLong, useRandomLocation);
					myOutbreaks.add(ob);
				} else {
					System.err.println("Invalid input! TrapGrid file must have 3 values per line (x, y, lambda).");
					reader.close();
					throw new IOException();
				}
			}
			reader.close();
			return myOutbreaks;
		} catch (FileNotFoundException e) {
			System.err.println("Input file " + filename + " not found");
			e.printStackTrace();
			throw new FileNotFoundException();
		}
	}

}


text:
var models  = require('../../../../models'),
    Promise = require('bluebird'),

    frontendClient  = require('../fixtures').models.Client[1];

module.exports = function addGhostFrontendClient(options, logInfo) {
    return models.Client.findOne({slug: frontendClient.slug}).then(function (client) {
        if (!client) {
            logInfo('Add ghost-frontend client fixture');
            return models.Client.add(frontendClient, options);
        }
        return Promise.resolve();
    });
};


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using System.Linq;
using System.Management.Automation;
using System.Security.Cryptography.X509Certificates;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions
{
    /// <summary>
    /// Set Microsoft Azure Service Extension.
    /// </summary>
    [Cmdlet(VerbsCommon.Set, "AzureServiceExtension", DefaultParameterSetName = SetExtensionParameterSetName), OutputType(typeof(ManagementOperationContext))]
    public class SetAzureServiceExtensionCommand : BaseAzureServiceExtensionCmdlet
    {
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ServiceNameHelpMessage)]
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ServiceNameHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string ServiceName
        {
            get;
            set;
        }

        [Parameter(Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.SlotHelpMessage)]
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.SlotHelpMessage)]
        [ValidateSet(DeploymentSlotType.Production, DeploymentSlotType.Staging, IgnoreCase = true)]
        public override string Slot
        {
            get;
            set;
        }

        [Parameter(Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.RoleHelpMessage)]
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.RoleHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string[] Role
        {
            get;
            set;
        }

        [Parameter(Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.X509CertificateHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override X509Certificate2 X509Certificate
        {
            get;
            set;
        }

        [Parameter(Position = 3, ValueFromPipelineByPropertyName = true, Mandatory = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.CertificateThumbprintHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string CertificateThumbprint
        {
            get;
            set;
        }

        [Parameter(Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ThumbprintAlgorithmHelpMessage)]
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ThumbprintAlgorithmHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string ThumbprintAlgorithm
        {
            get;
            set;
        }

        [Parameter(Position = 5, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ExtensionNameHelpMessage)]
        [Parameter(Position = 5, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ExtensionNameHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string ExtensionName
        {
            get;
            set;
        }

        [Parameter(Position = 6, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ProviderNamespaceHelpMessage)]
        [Parameter(Position = 6, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.ProviderNamespaceHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string ProviderNamespace
        {
            get;
            set;
        }

        [Parameter(Position = 7, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.PublicConfigurationHelpMessage)]
        [Parameter(Position = 7, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.PublicConfigurationHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string PublicConfiguration
        {
            get;
            set;
        }

        [Parameter(Position = 8, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.PrivateConfigurationHelpMessage)]
        [Parameter(Position = 8, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.PrivateConfigurationHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string PrivateConfiguration
        {
            get;
            set;
        }

        [Parameter(Position = 9, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.VersionHelpMessage)]
        [Parameter(Position = 9, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = SetExtensionUsingThumbprintParameterSetName, HelpMessage = ExtensionParameterPropertyHelper.VersionHelpMessage)]
        [ValidateNotNullOrEmpty]
        public override string Version
        {
            get;
            set;
        }

        protected override void ValidateParameters()
        {
            base.ValidateParameters();
            ValidateService();
            ValidateDeployment();
            ValidateRoles();
            ValidateThumbprint(true);
            ValidateConfiguration();
        }

        public void ExecuteCommand()
        {
            ValidateParameters();
            ExtensionConfigurationInput context = new ExtensionConfigurationInput
            {
                ProviderNameSpace = ProviderNamespace,
                Type = ExtensionName,
                CertificateThumbprint = CertificateThumbprint,
                ThumbprintAlgorithm = ThumbprintAlgorithm,
                X509Certificate = X509Certificate,
                PublicConfiguration = PublicConfiguration,
                PrivateConfiguration = PrivateConfiguration,
                Version = Version,
                Roles = new ExtensionRoleList(Role != null && Role.Any() ? Role.Select(r => new ExtensionRole(r)) : Enumerable.Repeat(new ExtensionRole(), 1))
            };
            var extConfig = ExtensionManager.InstallExtension(context, Slot, Deployment.ExtensionConfiguration);
            ChangeDeployment(extConfig);
        }

        protected override void OnProcessRecord()
        {
            ExecuteCommand();
        }
    }
}


text:
{% load 'adminmedia' %}
{% extends "admin/base.html" %}

{% block title %}{{ title }} | {{ _('Django site admin') }}{% endblock %}
{% block branding %}

{{ _('Django administration') }}

{% endblock %}

{% block navglobal %}{% endblock %}


text:
import * as React from 'react';

import Layout from '../components/Layout';
import Root from '../components/Root';

const Indexpage = () => {
  return (
    <Layout>
      <Root></Root>
    </Layout>
  )
}

export default Indexpage


text:
#include "phd.h"

#ifdef GUIDE_ONSTEPGUIDER

ScopeOnStepGuider::ScopeOnStepGuider(void)
{
    m_Name =  "On StepGuider";
}

ScopeOnStepGuider::~ScopeOnStepGuider(void)
{
}

bool ScopeOnStepGuider::Connect(void)
{
    bool bError = false;

    try
    {
        if (!pSecondaryMount)
        {
            throw ERROR_INFO("ScopeOnStepGuider::ScopeOnStepGuider() called with pSecondaryMount == NULL");
        }

        bError = ScopeOnboardST4::ConnectOnboardST4(dynamic_cast<StepGuider *>(pMount));
    }
    catch (wxString Msg)
    {
        POSSIBLY_UNUSED(Msg);
        bError = true;
    }

    return bError;
}

bool ScopeOnStepGuider::RequiresStepGuider(void)
{
    return true;
}

bool ScopeOnStepGuider::HasNonGuiMove(void)
{
    return true;
}

#endif // GUIDE_ONSTEPGUIDER


text:
Takes a list of https://open.spotify... urls and turns them into a csv file of artist/album/track name.

## Usage
1. Select tracks in Spotify
2. Hit Ctrl-C / Apple-C to copy track urls
3. Paste them into a text file (e.g. urls.txt)
4. Run spotify-track-list.rb -i urls.txt -o tracks.csv
5. Now you have all the artist/album/track name info in tracks.csv

## Problems?
If you get errors about nokogiri, run "gem install nokogiri"


text:
package cromwell.engine.workflow.tokens

import common.assertion.CromwellTimeoutSpec
import cromwell.core.JobToken.JobTokenType
import cromwell.engine.workflow.tokens.UnhoggableTokenPool.{HogLimitExceeded, TokenHoggingLease, TokenTypeExhausted, TokensAvailable}
import org.scalatest.concurrent.Eventually
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.concurrent.duration._

class UnhoggableTokenPoolSpec extends AnyFlatSpec with CromwellTimeoutSpec with Matchers with Eventually {

  override val patienceConfig = PatienceConfig(timeout = scaled(5.seconds), interval = scaled(1.second))
  implicit val patience = patienceConfig

  val hogLimitingTokenTypeToHogLimit = List(
    JobTokenType("backend", Some(150), 2) -> 75,
    JobTokenType("backend", Some(150), 75) -> 2,
    JobTokenType("backend", Some(150), 150) -> 1
  )

  val tokenTypeToHogLimit = List(
    JobTokenType("backend", Some(150), 1) -> None,
    JobTokenType("backend", Some(150), 200) -> Some(1),
    JobTokenType("backend", None, 1) -> None,
    JobTokenType("backend", None, 150) -> None
  ) ++ (hogLimitingTokenTypeToHogLimit map { case (k,v) => (k, Some(v)) })

  tokenTypeToHogLimit foreach { case (tokenType, expectedHogLimit) =>
    it should s"correctly calculate hogLimit for $tokenType as $expectedHogLimit" in {
      val pool = new UnhoggableTokenPool(tokenType)
      pool.hogLimitOption should be(expectedHogLimit)
    }
  }

  hogLimitingTokenTypeToHogLimit foreach { case (tokenType, hogLimit) =>
    it should s"enforce the hogLimit of $hogLimit for ${tokenType.hogFactor} groups for $tokenType" in {
      val pool = new UnhoggableTokenPool(tokenType)

      (0 until tokenType.hogFactor) foreach { hogGroupNumber =>
        val hogGroup = s"hogGroup$hogGroupNumber"
        // Step one: hog as many tokens as the group is able!:
        (0 until hogLimit) foreach { index =>
          pool.tryAcquire(hogGroup) match {
            case _: TokenHoggingLease => // great!
            case TokenTypeExhausted => fail(s"Unhoggable token pool ran out after $index tokens distributed to $hogGroupNumber")
            case HogLimitExceeded => fail(s"Unhoggable token pool making unfounded accusations of hogging after $index tokens distributed to $hogGroupNumber")
          }

          val acquiredTokensForGroup = index + 1

          val poolState = pool.poolState
          poolState.leased should be(hogGroupNumber * hogLimit + acquiredTokensForGroup)

          val hogGroupState = poolState.hogGroups.get.find(_.hogGroup == hogGroup).get
          hogGroupState.used should be(acquiredTokensForGroup)
          hogGroupState.atLimit should be(acquiredTokensForGroup == hogLimit)
        }

        // Step two: one more is too many...
        val nextAcquisition = pool.tryAcquire(hogGroup)
        val poolState = pool.poolState

        if (hogGroupNumber != tokenType.hogFactor - 1) {
          // While the overall token type is not full we get the hog limit push-back:
          nextAcquisition should be(HogLimitExceeded)
          pool.available("other") should be(UnhoggableTokenPool.TokensAvailable)
          poolState.available should be(true)

        } else {
          // The final time, the entire token type is used up so we get this instead:
          nextAcquisition should be(TokenTypeExhausted)
          pool.available("other") should be(UnhoggableTokenPool.TokenTypeExhausted)
          poolState.available should be(false)
        }
      }
    }
  }

  it should "allow tokens to be returned" in {
    // A pool distributing tokens with a hogLimit of 2:
    val hogLimitPool = new UnhoggableTokenPool(JobTokenType("backend", Some(150), 75))

    // Use all the "group1" tokens:
    val lease1 = hogLimitPool.tryAcquire("group1").asInstanceOf[TokenHoggingLease]
    val lease2 = hogLimitPool.tryAcquire("group1").asInstanceOf[TokenHoggingLease]
    hogLimitPool.available("group1") shouldBe HogLimitExceeded
    hogLimitPool.tryAcquire("group1") should be(HogLimitExceeded)

    lease1.release()
    eventually { hogLimitPool.available("group1") shouldBe TokensAvailable }
    hogLimitPool.tryAcquire("group1") match {
      case _: TokenHoggingLease => // Great!
      case other => fail(s"expected lease but got $other")
    }
    hogLimitPool.tryAcquire("group1") should be(HogLimitExceeded)

    lease2.release()
    eventually { hogLimitPool.available("group1") shouldBe TokensAvailable }
    hogLimitPool.tryAcquire("group1") match {
      case _: TokenHoggingLease => // Great!
      case other => fail(s"expected lease but got $other")
    }
    hogLimitPool.tryAcquire("group1") should be(HogLimitExceeded)
  }

}


text:
module Renalware
  log "Adding System User" do
    Renalware::User.find_or_create_by!(given_name: "System", family_name: "User") do |user|
      user.username = Renalware::SystemUser.username
      user.password = "P!#{SecureRandom.hex(20)}"
      user.email = "systemuser@renalware.net"
      user.approved = true
      user.signature = "System User"
    end
  end
end


text:
PALETTE_GLOBAL HOBJECT hFontPalette;
PALETTE_GLOBAL HOBJECT hColorPalette;
PALETTE_GLOBAL HWND hwndFontPalette;
PALETTE_GLOBAL HWND hwndColorPalette;

//Function for handling font changes.
void FontPalProc(void);
void ColorPalProc(void);


text:
package org.openbel.framework.api;

import org.openbel.framework.api.Kam.KamNode;
import org.openbel.framework.common.enums.FunctionEnum;

/**
 * This interface describes the absolute minimum needed to represent a KAM node.
 * <p>
 * This interface provides a small and simple contract for the sufficient
 * conditions to be a KAM node.
 * </p>
 *
 * @since 3.0.0
 * @see KamNode
 */
public interface SimpleKAMNode {

    /**
     * Returns the database identifier for this node.
     *
     * @return int
     */
    public int getID();

    /**
     * Returns the node's function.
     *
     * @return {@link FunctionEnum}
     */
    public FunctionEnum getFunction();

    /**
     * Returns the node's label.
     *
     * @return {@link String}
     */
    public String getLabel();

}


text:
require 'spec_helper'

describe 'Resource' do
  before do
    visit '/foo/resources/foo_resource'
  end

  it do
    page.should have_content('{"hello":"world"}')
  end
end


text:
<?php

namespace Embera\Providers;

/**
 * The mixcloud.com Provider
 * @link http://www.mixcloud.com/developers/documentation/
 * @link http://www.mixcloud.com
 */
class MixCloud extends \Embera\Adapters\Service
{
    /** inline {@inheritdoc} */
    protected $apiUrl = 'http://www.mixcloud.com/oembed/?format=json';

    /** inline {@inheritdoc} */
    protected function validateUrl()
    {
        // Urls with this words/pattern dont work
        $this->url->invalidPattern('mixcloud\.com/(?:categories|advertise|developers)/(?:[^/]+)/?$');

        return (preg_match('~mixcloud\.com/(?:[^/]+)/(?:[^/]+)/?$~i', $this->url));
    }
}

?>


text:
namespace extensions {

class Extension;

// The PermissionSet is an immutable class that encapsulates an
// extension's permissions. The class exposes set operations for combining and
// manipulating the permissions.
class PermissionSet
    : public base::RefCountedThreadSafe<PermissionSet> {
 public:
  // Creates an empty permission set (e.g. default permissions).
  PermissionSet();

  // Creates a new permission set based on the |extension| manifest data, and
  // the api and host permissions (|apis| and |hosts|). The effective hosts
  // of the newly created permission set will be inferred from the |extension|
  // manifest, |apis| and |hosts|.
  PermissionSet(const extensions::Extension* extension,
                const APIPermissionSet& apis,
                const URLPatternSet& explicit_hosts);

  // Creates a new permission set based on the specified data.
  PermissionSet(const APIPermissionSet& apis,
                const URLPatternSet& explicit_hosts,
                const URLPatternSet& scriptable_hosts);

  // Creates a new permission set equal to |set1| - |set2|, passing ownership of
  // the new set to the caller.
  static PermissionSet* CreateDifference(
      const PermissionSet* set1, const PermissionSet* set2);

  // Creates a new permission set equal to the intersection of |set1| and
  // |set2|, passing ownership of the new set to the caller.
  static PermissionSet* CreateIntersection(
      const PermissionSet* set1, const PermissionSet* set2);

  // Creates a new permission set equal to the union of |set1| and |set2|.
  // Passes ownership of the new set to the caller.
  static PermissionSet* CreateUnion(
      const PermissionSet* set1, const PermissionSet* set2);

  bool operator==(const PermissionSet& rhs) const;

  // Returns true if |set| is a subset of this.
  bool Contains(const PermissionSet& set) const;

  // Gets the API permissions in this set as a set of strings.
  std::set<std::string> GetAPIsAsStrings() const;

  // Gets the API permissions in this set, plus any that have implicit access
  // (such as APIs that require no permissions, or APIs with functions that
  // require no permissions).
  // TODO(kalman): return scoped_ptr to avoid copying.
  std::set<std::string> GetAPIsWithAnyAccessAsStrings() const;

  // Returns whether this namespace has any functions which the extension has
  // permission to use.  For example, even though the extension may not have
  // the "tabs" permission, "tabs.create" requires no permissions so
  // HasAnyAPIPermission("tabs") will return true.
  bool HasAnyAccessToAPI(const std::string& api_name) const;

  // Gets a list of the distinct hosts for displaying to the user.
  // NOTE: do not use this for comparing permissions, since this disgards some
  // information.
  std::set<std::string> GetDistinctHostsForDisplay() const;

  // Gets the localized permission messages that represent this set.
  PermissionMessages GetPermissionMessages() const;

  // Gets the localized permission messages that represent this set (represented
  // as strings).
  std::vector<string16> GetWarningMessages() const;

  // Returns true if this is an empty set (e.g., the default permission set).
  bool IsEmpty() const;

  // Returns true if the set has the specified API permission.
  bool HasAPIPermission(APIPermission::ID permission) const;

  // Returns true if the permissions in this set grant access to the specified
  // |function_name|.
  bool HasAccessToFunction(const std::string& function_name) const;

  // Returns true if this includes permission to access |origin|.
  bool HasExplicitAccessToOrigin(const GURL& origin) const;

  // Returns true if this permission set includes access to script |url|.
  bool HasScriptableAccessToURL(const GURL& url) const;

  // Returns true if this permission set includes effective access to all
  // origins.
  bool HasEffectiveAccessToAllHosts() const;

  // Returns true if this permission set includes effective access to |url|.
  bool HasEffectiveAccessToURL(const GURL& url) const;

  // Returns ture if this permission set effectively represents full access
  // (e.g. native code).
  bool HasEffectiveFullAccess() const;

  // Returns true if |permissions| has a greater privilege level than this
  // permission set (e.g., this permission set has less permissions).
  bool HasLessPrivilegesThan(const PermissionSet* permissions) const;

  const APIPermissionSet& apis() const { return apis_; }

  const URLPatternSet& effective_hosts() const { return effective_hosts_; }

  const URLPatternSet& explicit_hosts() const { return explicit_hosts_; }

  const URLPatternSet& scriptable_hosts() const { return scriptable_hosts_; }

 private:
  FRIEND_TEST_ALL_PREFIXES(PermissionsTest, HasLessHostPrivilegesThan);
  FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetWarningMessages_AudioVideo);
  friend class base::RefCountedThreadSafe<PermissionSet>;

  ~PermissionSet();

  static std::set<std::string> GetDistinctHosts(
      const URLPatternSet& host_patterns,
      bool include_rcd,
      bool exclude_file_scheme);

  // Initializes the set based on |extension|'s manifest data.
  void InitImplicitExtensionPermissions(const extensions::Extension* extension);

  // Adds permissions implied independently of other context.
  void InitImplicitPermissions();

  // Initializes the effective host permission based on the data in this set.
  void InitEffectiveHosts();

  // Gets the permission messages for the API permissions.
  std::set<PermissionMessage> GetSimplePermissionMessages() const;

  // Returns true if |permissions| has an elevated API privilege level than
  // this set.
  bool HasLessAPIPrivilegesThan(
      const PermissionSet* permissions) const;

  // Returns true if |permissions| has more host permissions compared to this
  // set.
  bool HasLessHostPrivilegesThan(
      const PermissionSet* permissions) const;

  // The api list is used when deciding if an extension can access certain
  // extension APIs and features.
  APIPermissionSet apis_;

  // The list of hosts that can be accessed directly from the extension.
  // TODO(jstritar): Rename to "hosts_"?
  URLPatternSet explicit_hosts_;

  // The list of hosts that can be scripted by content scripts.
  // TODO(jstritar): Rename to "user_script_hosts_"?
  URLPatternSet scriptable_hosts_;

  // The list of hosts this effectively grants access to.
  URLPatternSet effective_hosts_;
};

}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_


text:
TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'zk_utils'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install zk_utils

## Usage

    require 'zk_utils'

    z = ZkUtils.new("localhost:2181")

    z.ls("/", :r => true).each do | node |
        p node
    end

    z.delete("/test", :r => true)

## Contributing

1. Fork it ( http://github.com/<my-github-username>/zk_utils/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<?php

//Hooks
AcidHook::call('routes');
AcidHook::call('routes_web');

// Page d'actualités avec X Params Facultatif
AcidRouter::addRoute('news', new AcidRoute('@news',array('controller'=>'NewsController'),1));

//AcidRouter::addRoute('page',new AcidRoute('page/:page_key',array('controller'=>'PageController'),1));
//AcidRouter::addRoute('allpage',new AcidRoute('@page',array('controller'=>'PageController','action'=>'listAction')));

// Route Contact de base, sans parametre
AcidRouter::addRoute('contact', new AcidRoute('@contact',array('controller'=>'ContactController')));

// Route Gallery
AcidRouter::addRoute('gallery', new AcidRoute('@gallery',array('controller'=>'GalleryController')));

// Route Account
AcidRouter::addRoute('userspace',new AcidRoute('@account',array('controller'=>'UserspaceController'),1));

//Route Politique sur les données
AcidRouter::addRoute('policy', new AcidRoute('@policy',array('controller'=>'PolicyController')));

// Routes d'accès au fichiers dynamics sitemap.xml / robots.txt
AcidRouter::addRoute('sitemap', new AcidRoute('sitemap.xml',array('controller'=>'SitemapController')));
AcidRouter::addRoute('robots',new AcidRoute('robots.txt',array('controller'=>'RobotsController','action'=>'index')));

// Routes RSS
AcidRouter::addRoute('rss',new AcidRoute('@rss',array('controller'=>'RssController','action'=>'index')));

// Route vers la page search
AcidRouter::addRoute('searchPage', new AcidRoute('@search',array('controller'=>'SearchController'),1));

// Redirections
//AcidRouter::addRoute('srcRedirect', new AcidRoute('src/:version',array('controller'=>'RedirectController','action'=>'src'),1));

//Par défault : affichage d'une page
AcidRouter::addRoute('page',new AcidRoute(':page_key',array('controller'=>'PageController'),1));

//Si pas de page définie, affichage de la home
AcidRouter::addDefaultRoute('index',new AcidRoute('default',array('controller'=>'IndexController','action'=>'index')));


text:
package com.asyncj.core.api.article.mpsclatency;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Aliaksei Papou
 * @since 23.11.13
 */
public class Train {

    private static int trainCapacity;
    private final long[] goodsArray;
    public AtomicInteger stationIndex = new AtomicInteger();
    private int index;

    public Train(int trainCapacity) {
        this.trainCapacity = trainCapacity;
        goodsArray = new long[trainCapacity];
    }

    public int goodsCount() {
        return index;
    }

    public void addGoods(long i) {
        goodsArray[index++] = i;
    }

    public long getGoods(int i) {
        index--;
        return goodsArray[i];
    }

    public int getCapacity() {
        return trainCapacity;
    }

}


text:
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

namespace RestLess.Tests.Interfaces
{
    [Header("X-DoLess", "Rest")]
    [Header("X-DoLess-Scope", "Interface")]
    [Header("X-DoLess-ApiKey", "apiKey", true)]
    public interface IApi06
    {
        [Get("api/posts")]
        Task<HttpResponseMessage> GetInterfaceHeaderAsync();

        [Header("X-DoLess-Scope", "Method")]
        [Get("api/posts")]
        Task<HttpResponseMessage> GetMethodHeaderAsync();

        [Header("X-DoLess-Scope", "Method")]
        [Get("api/posts")]
        Task<HttpResponseMessage> GetParameterHeaderAsync([HeaderValue("X-DoLess-Scope")]string header);
    }
}


text:
Vectrexy is a [Vectrex](https://en.wikipedia.org/wiki/Vectrex) emulator programmed in C++.

This project is open source and available on GitHub: https://github.com/amaiorano/vectrexy

## Download Latest Build

### Build status ![master branch status](https://github.com/amaiorano/vectrexy/actions/workflows/ci.yml/badge.svg?branch=master)

* [Vectrexy for Windows 64-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-windows-x64.zip)

* [Vectrexy for Windows 32-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-windows-x86.zip)

* [Vectrexy for Linux 64-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-ubuntu-x64.zip)

\
[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com)

Package repository hosting is graciously provided by  [Cloudsmith](https://cloudsmith.com).
Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that
enables your organization to create, store and share packages in any format, to any place, with total
confidence.

## Twitch Development

I regularly stream part of the development on Twitch [right here](https://www.twitch.tv/daroou2). Follow me to know when I'm streaming!

## Compatibility

See the [Vectrexy Compatibility List](docs/vectrexy-compatilibity-list.md) for the list of games that Vectrexy can run.

## Controls

| Devices     | Player 1  | Player 2  |
| ----------- | --------- | --------- |
| No gamepads | Keyboard  | N/A       |
| 1 gamepad   | Gamepad 1 | Keyboard  |
| 2 gamepads  | Gamepad 1 | Gamepad 2 |

Keyboard key bindings: ASDF + Arrow keys

## Overlays

The Vectrex display is black & white, so to add color, each game cartridge came with a transparent colored overlay that would be slotted in front of the screen. For emulation purposes, you should be able to find png files for these overlays. If you place these png file in the `data/overlays` folder, Vectrexy will attempt to match the rom's file name to the overlay name using "fuzzy" string matching (in other words, the file names do not need to match exactly).

## What's a Vectrex and why did you write this emulator?

The Vectrex is a really cool and unique video game console that was released in 1982. What made it unique was that it came with its own screen and displayed vector-based graphics, rather than the typical sprite/raster based graphics of most game consoles. My uncle had gotten me a Vectrex when I was only 8 years old, and I still have it, and it's still awesome.

## Credits

Although the emulator core is written by me, Antonio Maiorano (Daroou2), it makes use of third party libraries, and is packaged with overlays created by other people. I hope I've got everyone covered here; if not, please let me know and I'll be happy to correct this list.

- Overlays: THK-Hyperspin, Gigapig-Hyperspin, Nosh01-GitHub, and other unknown authors.
- FastBoot and SkipBoot bios roms: Franck Chevassu, author of the exellent Vectrex emulator, [ParaJVE](http://www.vectrex.fr/ParaJVE/)
- SDL2: [SDL2 Credits](https://www.libsdl.org/credits.php)
- GLEW: [GLEW authors](https://github.com/nigels-com/glew#authors)
- GLM: [G-Truc Creations](http://www.g-truc.net/)
- stb: [Sean Barrett (Nothings)](http://nothings.org/)
- Dear ImGui: [omar (ocornut)](http://www.miracleworld.net/)
- linenoise: [Salvatore Sanfilippo (antirez)](http://invece.org/)
- noc: [Guillaume Chereau](https://blog.noctua-software.com/)

## Building the code

### Windows

Install:
* [CMake](https://cmake.org/)
* [Visual Studio](https://www.visualstudio.com/downloads/)

Clone and build vectrexy using CMake:
```bash
git clone --recursive https://github.com/amaiorano/vectrexy.git
cd vectrexy
mkdir build && cd build
cmake ..
cmake --build .
```

### Ubuntu

Install:
* [CMake](https://cmake.org/)
* gcc 8 or higher

Install a compiler and some Linux-specific libs we depend on:
```bash
sudo apt-get install g++-8 libgtk2.0-dev
```

SDL2 has many dependencies, some of which you may need to install:
```
# SDL static lib dependencies (see https://hg.libsdl.org/SDL/file/default/docs/README-linux.md)
# Alternatively, you can just 'apt-get libsdl2-dev' to build against the dynamic library

sudo apt-get install build-essential mercurial make cmake autoconf automake libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev libsndio-dev
```

Clone and build vectrexy using CMake:
```bash
git clone --recursive https://github.com/amaiorano/vectrexy.git
cd vectrexy
mkdir build && cd build
cmake ..
cmake --build .
```

### Extra CMake Build Args

Use ```-D<VAR_NAME>=<VALUE>``` from the CMake CLI, or use cmake-gui to set these.

#### BUILD_SHARED_LIBS=on|off (Default: off)

If enabled, builds a DLL/.so version.

**NOTE**: On Windows, vcpkg's "static" triplets (e.g. x64-windows-static) create static libs that link against the static CRT (/MT), while CMake generates shared library builds that link against the dynamic CRT (/MD). Thus, when building, the linker will emit: `LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library`. You can ignore this for the most part; however, you can fix this warning by creating a custom vcpkg triplet, e.g. x64-windows-static-md.cmake, that is a copy of x64-windows-static.cmake, except with `set(VCPKG_CRT_LINKAGE dynamic)`. If you use this triplet to build dependencies with vcpkg, and specify it as CMake's `VCPKG_TARGET_TRIPLET`, all libraries will use the dynamic CRT, and no warning will be emitted by the linker.

#### DEBUG_UI=on|off (Default: on)

If enabled, the in-game debug UI can be displayed. Mostly useful for development.

#### ENGINE_TYPE=null|sdl (Default: sdl)

The type of engine to use. By default, SDL is used. If "null" is specified, the emulator will execute without any audio or visuals; however, the debugger will work, which can be useful for testing the emulator, or as a starting point for a new engine type.

## Contributing

As the emulator is still in early stages of development, I generally won't be looking at or accepting pull requests. Once the project has matured enough, this will likely change. If you wish, [follow my stream](https://www.twitch.tv/daroou2) and make suggestions in chat instead.


text:
var async = require('async');
var naan = require('naan');
var _ = require('underscore');
var util = require('util');

module.exports = {
  /**
   * Create a new relationship between two nodes. Maps to
   * POST node/<startNodeId>/relationship
   */
  create: function(startNode, type, endNode, properties, callback) {
    if (typeof properties === 'function') {
      callback = properties;
      properties = null;
    }

    if (Array.isArray(startNode)) {
      var txn = this._safeBatch();
      var args = [ type, endNode, properties ];
      async.map(startNode, naan.ecurry(txn.rel.create, args, [1,2,3]),
          function(err, rels) {
            if (!err && Array.isArray(endNode))
              return callback(err, _.flatten(rels));
            callback(err, rels);
          });
      return this._safeBatchCommit(txn);
    } else if (Array.isArray(endNode)) {
      var txn = this._safeBatch();
      var args = [ startNode, type, properties ];
      async.map(endNode, naan.ecurry(txn.rel.create, args, [0,1,3]), callback);
      return this._safeBatchCommit(txn);
    }

    var startNodeId = this._getId(startNode),
        endNodeId = this._getId(endNode);

    if (!this._isValidId(startNodeId) ||
        !this._isValidId(endNodeId)) {
      return callback(new Error("Invalid ID"));
    }

    var request = {
      to: this._location('node', endNodeId),
      type: type,
    };

    if (properties) {
      request['data'] = properties;
    }

    var endpoint = util.format('%s/relationships', this._nodeRoot(startNodeId));
    var op = this.operation(endpoint, 'POST', request);
    this.call(op, function(err, rel) {
      if (err) {
        callback(err);
      } else {
        callback(null, this._createRelationshipObject(rel));
      }
    });
  },

  /**
   * Update the properties of a given relationship. Maps to
   * PUT relationship/<id>/properties
   */
  update: function(rel, key, val, callback) {
    if (typeof key == 'function') {
      callback = key;
      key = val = undefined;
    }

    if (Array.isArray(rel)) {
      var txn = this._safeBatch();
      var args = [key, val];
      async.map(rel, naan.ecurry(txn.rel.update, args, [1, 2]), callback);
      return this._safeBatchCommit(txn);
    }

    var id = this._getId(rel);

    if (!this._isValidId(id)) {
      return callback(new Error("Invalid ID"));
    }

    var endpoint = util.format('%s/properties', this._relRoot(id));
    if (key) endpoint += '/' + key;

    var op = this.operation(endpoint, 'PUT', key ? val : rel.properties);
    this.call(op, function(err) {
      callback(err);
    });
  },

  read: function(id, callback) {
    if (Array.isArray(id)) {
      var txn = this._safeBatch();
      async.map(id, txn.rel.read, callback);
      return this._safeBatchCommit(txn);
    }

    id = this._getId(id);

    if (!this._isValidId(id)) {
      return callback(new Error("Invalid ID"));
    }

    var endpoint = this._relRoot(id);
    var op = this.operation(endpoint);
    this.call(op, function(err, rel) {
      if (err) {
        callback(err);
      } else {
        callback(null, this._createRelationshipObject(rel));
      }
    });
  },

  delete: function(id, callback) {
    if (Array.isArray(id)) {
      var txn = this._safeBatch();
      async.map(id, txn.rel.delete, callback);
      return this._safeBatchCommit(txn);
    }

    id = this._getId(id);

    if (!this._isValidId(id)) {
      return callback(new Error("Invalid ID"));
    }

    var endpoint = this._relRoot(id);
    var op = this.operation(endpoint, 'DELETE');
    this.call(op, function(err, rel) {
      callback(err);
    });
  }
};


text:
<!doctype html>

  <title>History | Ebean</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="shortcut icon" href="/images/favicon.ico">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Source+Sans+Pro|Ubuntu&display=swap">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="stylesheet" href="/css/reset3.css">
  <link rel="stylesheet" href="/css/site3.css">
  <link rel="stylesheet" href="/css/pygments3.css">

          Documentation / Features / History

    Getting started

    Introduction

    Documentation

    Best practice

    Query

    Persist

    Transactions

    Mapping

    DDL & Migrations

    Logging

    Testing

    Database platforms

    Multiple databases

    Kotlin

Tuning

    Features

    L2 Cache

    Elasticsearch

    @DbJson

    Soft Delete

    Encryption

    @WhoModified / @WhoCreated

    SQL2011 History

    ChangeLog

    Read auditing

    Event Listening

    Getting help

      API Javadoc

    Videos

    Upgrading

    Releases

<form action="https://www.google.com/search" method="get" class="inline-form">
  <input type="hidden" name="as_sitesearch" value="ebean.io">

      <input class="frm" name="q" id="searchinput" type="text" placeholder="Search... (press 's' to focus)" data-placeholder-focus="Search... (use '↑', '↓' and '⏎' to select results)" data-placeholder-blur="Search... (press 's' to focus)" autocomplete="off">

        <button class="frm" type="submit"></button>

Docs Documentation

And 101 more...

</form>

Videos

Introduction

      Walk through the @History / SQL2011 support with Oracle and Postgres

Comparison to Hibernate Envers

      Comparison with the approach taken by Hibernate Envers

Overview

    SQL2011 introduced temporal extensions to SQL
    including AS OF SYSTEM TIME and VERSIONS BETWEEN SYSTEM TIME.

    Ebean has support for this extension to SQL. The support for this falls into 2 general cases where some
    databases have SQL2011 support built in (Oracle, DB2, MS SQL Server 2016) or where it is not built
    in (Postgres, MySql) and Ebean generates history tables/triggers/views to support the feature.

Current support in Ebean

Oracle via Total recall

Postgres via Triggers/history table

MySql via Triggers/history table

H2 via Triggers/history table

History tables

    For Postgres, MySql and H2 (and in general databases that don't have SQL2011 support built in) Ebean generates
    DDL for History tables and associated triggers and views. This is a common "Temporal database design" approach
    that has been used for some time and not specific to Ebean. For example, this approach is already implemented
    as a Postgres extension - arkhipov/temporal_tables.

    In general the history table approach results in:

A "history" table created that has the same (or very similar) structure as the "base table"

The "history" table does not have constraints by default (no primary key, foreign key or indexes)

2 extra columns added to the base table and history table for "effective start" and "effective end" timestamp range.
      Postgres has a timestamp range type so that is preferred to 2 separate columns for the Postgres implementation.

A view is used to union all combine the "base table" and the "history table" to simplify history queries

Triggers are used on update and delete to copy the existing row data from the "base table" to the associated
      "history table"

Schema changes to the "base table" (add column etc) result in mirrored changes to the "history table" and
      potentially updates to the associated triggers

See also:

clarkdave blog post - historical-records-with-postgresql

Postgresql Wiki - SQL2011Temporal

Postgres extension - arkhipov/temporal_tables

Compared to Change Log

Transactional

    With @History changes are transactional and have the associated guarantees - changes can't be missed or lost.

Not bypassed

    With @History the database handles all changes. If other frameworks (not Ebean) or stored procedures or raw JDBC
    is used to update the database all these changes are captured by the database triggers. Although Ebean makes it
    easier to query and generate the appropriate DDL the capturing of changes is a database function and not strictly
    tied to Ebean or application code.

Easy to query

    With @History it is easy to query and view the data "As of" a given timestamp and view the versions and historic
    changes for a given bean/row. This is also possible with Change log but requires more work (loading the change log
    into say ElasticSearch and creating appropriate queries to return as of and version type data).

DB Overhead

    A downside to @History relative to using Change log is that it does introduce extra costs to the database in terms
    of storage (history tables taking storage space) and in terms of impact to response time as updates and deletes
    now also copy data into the history tables.

    The approach with Oracle Total Recall reduces the impact to response time by processing the copy of data from redo
    into the history tables in the background and in batch and that probably means it can generally be used more widely
    (on more base tables) than the traditional trigger based approach.

Schema changes

    A downside to @History relative to using Change log is that schema changes (like adding a column) can mean more
    work / complexity as changes need to also be reflected in associated history tables and triggers. The DB migration
    support in Ebean mitigates this by generating all the appropriate changes to history tables and triggers etc.

@History

    Add the @History annotation to the entity beans that you want history support on. In the
    case of Postgres and MySql this means that Ebean will generate DDL (triggers, views etc) to support
    history on the underlying tables. For Oracle adding @History implies that the table has had flashback
    archive already assigned to the table.

@HistoryExclude

    Add the @HistoryExclude annotation on entity bean properties that should be excluded from
    history. This is expected to be used on large text or blob columns where there can be a relatively high
    storage cost associated with keeping the history values and excluding these columns is desired.

ManyToMany intersection

    In the case of intersection (bridge) tables for ManyToMany relationships by default the intersection
    tables also have history. That is, if @History is put on an entity bean then by default
    the intersection tables for @ManyToMany properties have history support (associated history
    tables, views and triggers).

    To exclude history from intersection tables @HistoryExclude should be put on the @ManyToMany
    property.

As of query

    A Timestamp can be used with Query.asOf(Timestamp) and Ebean will generate the query
    such that the returning object graph represents the state as of the given timestamp. More accurately
    for tables with history the query returns rows representing the table as of the given timestamp and for
    other tables included in the query the rows returned represent 'current values'.

// asOf some time in the past like 1 hour ago, 1 week ago, 1 month ago etc
Timestamp asOf = ...;

Customer customer =
    Customer.find.query()
        .asOf(asOf)
        .fetch("billingAddress")
        .where().eq("name", "jim")
        .findOne();

Scenario: Customer and Address both have history

    In the above query if both Customer Address have history then both the customer data and
    address data will be returned 'As of' the given timestamp.

Scenario: Customer has history but Address does not

    In the above query if Customer has history but Address does not then the customer data will be returned
    'As of' the given timestamp but the address data will be returned using 'current data'.

Scenario: Address lazy loaded

    The AS OF timestamp is propagated to all secondary queries including lazy loading queries.
    That is, the AS OF timestamp applies to the entire object graph loaded by and not just the
    "origin query". If Address is lazy loaded and Address has history the address data will also be 'as of'
    the original timestamp.

Versions between

    Query.findVersionsBetween() is used to return a list of versions for a given object
    over time. The version beans returned contain a "diff" to the prior version as well as the
    effective start and effective end timestamps.

Timestamp start = ...;
Timestamp end = ...;

List<Version<Customer>> customerVersions =
    Customer.find.query()
      .where()
      .idEq(42)
      .findVersionsBetween(start, end);

for (Version<Customer> customerVersion : customerVersions) {
  Customer bean = customerVersion.getBean();
  Map<String, ValuePair> diff = customerVersion.getDiff();
  Timestamp effectiveStart = customerVersion.getStart();
  Timestamp effectiveEnd = customerVersion.getEnd();
}

Who and When

    It is generally expected that the entity beans should contain @WhoCreated, @WhoModified,
    @WhenCreated and @WhenModified properties.

/**
 * Common properties used by many entity beans.
 */
@MappedSuperclass
public class BaseModel {

  @Id
  Long id;

  @Version
  Long version;

  @WhenCreated
  Timestamp whenCreated;

  @WhenModified
  Timestamp whenModified;

  @WhoCreated
  String whoCreated;

  @WhoModified
  String whoModified;
  ...

@History
@Entity
@Table(name="customer")
public class Customer extends BaseModel {

  @Size(max = 100)
  String name;
  ...

Postgres

    Postgres has an existing arkhipov/temporal_tables extension
    and Postgres/Ebean users could use this extension. By default Ebean does not use this extension but instead generates
    similar triggers. The difference between using arkhipov/temporal_tables or not comes down to DDL generation.
    Ultimately it would be good for Ebean to support DDL generation for arkhipov/temporal_tables but that
    isn't built into Ebean yet.

    The other notable aspect of history support in Postgres is that we can make use of the timestamp range type with
    expected benefits in terms on indexing performance relative to using 2 separate timestamp columns.

MySql

    There is a concern with MySql in the case where DDL changes need to be applied to a production database.
    In the case where Triggers need to change due to a schema change (like add column) MySql has no
    'create or replace trigger' and instead a table lock needs to be held to drop and create the trigger.
    Holding a table lock in a production database might be a problem and restrict schema changes.

Oracle

    Rob's View: Oracle Total recall has some nice advantages over the explicit trigger/history table approach.
    The main advantages being:

Performance : low foreground cost
      - History table population occurs in the background and results in a much lower overhead/impact
      on foreground response time

Performance : batch processing
      - History table population can be processed in batch reducing the overhead/impact for many small updates

Admin : reduced DDL
      - Table alterations (add columns etc) are handled automatically reducing the admin costs of maintaining
     triggers/views/history tables.


text:
<?php
/* Prototype  : proto string get_parent_class([mixed object])
 * Description: Retrieves the parent class name for object or class or current scope.
 * Source code: Zend/zend_builtin_functions.c
 * Alias to functions:
 */

//  Note: basic use cases in Zend/tests/010.phpt

echo "*** Testing get_parent_class() : variation ***\n";

class caseSensitivityTest {}
class caseSensitivityTestChild extends caseSensitivityTest {}

var_dump(get_parent_class('CasesensitivitytestCHILD'));
var_dump(get_parent_class(new CasesensitivitytestCHILD));

echo "Done";
?>


text:
package shards

import (
	"bytes"
	"encoding/gob"
	"hash/fnv"
	"sort"
)

// Shard is a set of byte blobs.
//
// It represents s single shard of a sharded set.
type Shard map[string]struct{}

// ParseShard deserializes a shard (serialized with Serialize).
func ParseShard(blob []byte) (Shard, error) {
	var sorted []string
	dec := gob.NewDecoder(bytes.NewReader(blob))
	if err := dec.Decode(&sorted); err != nil {
		return nil, err
	}
	shard := make(Shard, len(sorted))
	for _, blob := range sorted {
		shard[blob] = struct{}{}
	}
	return shard, nil
}

// Serialize serializes the shard to a byte buffer.
func (s Shard) Serialize() []byte {
	sorted := make([]string, 0, len(s))
	for blob := range s {
		sorted = append(sorted, blob)
	}
	sort.Strings(sorted)
	out := bytes.Buffer{}
	enc := gob.NewEncoder(&out)
	err := enc.Encode(sorted)
	if err != nil {
		panic("impossible error when encoding []string")
	}
	return out.Bytes()
}

// Set is an array of shards (representing a single sharded set).
//
// The size of the array is number of shards in the set. Allocate it using
// regular make(...).
type Set []Shard

// Insert adds a blob into the sharded set.
func (s Set) Insert(blob []byte) {
	shard := &s[ShardIndex(blob, len(s))]
	if *shard == nil {
		*shard = make(Shard)
	}
	(*shard)[string(blob)] = struct{}{}
}

// ShardIndex returns an index of a shard to use when storing given blob.
func ShardIndex(member []byte, shardCount int) int {
	hash := fnv.New32()
	hash.Write(member)
	return int(hash.Sum32() % uint32(shardCount))
}


text:
package eu.thog.opengb.api;

/**
 * Represent the implementation of an Opcode
 * Created by thog on 3/27/16.
 */
public interface IOpcodeHandler
{
    void execute();
}


text:
class Team < ActiveRecord::Base

  serialize :scores, JSON

  after_initialize :setup_defaults

  validates :name, presence: true

  before_save :store_total

  def score_for(hole)
    scores[hole-1]
  end

  def front_nine
    scores[0..8].coercive_sum
  end

  def back_nine
    scores[9..17].coercive_sum
  end

  def total
    scores.coercive_sum
  end

private

  def setup_defaults
    self.scores ||= Array.new(18, nil)
  end

  def store_total
    write_attribute :total, total
  end

end


text:
<?php namespace Dmyers\Activity;

class Activity extends \Eloquent
{

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'activity';
	protected $guarded = array('id');

	public static function boot()
	{
		parent::boot();

		// todo fire some events!

		/*Activity::creating(function($event) {
			// fire events
		});*/
	}

	public function getDoerAttribute()
	{
		return \User::find($this->doer_id);
	}

	public function getVictimAttribute()
	{
		return \User::find($this->victim_id);
	}

	public function getItemAttribute()
	{
		if (empty($this->item_type)) {
			return null;
		}

		// todo fix this to be right
		$model = '\\'.\Str::upper($this->item_type);

		return $model::find($this->item_id);
	}

	public function getDateAttribute()
	{
		return $this->created_at;
	}

	// todo how to aggregate/combine multiples together

	public static function renderFeed($activity, $view = 'laravel-activity::feed')
	{
		return \View::make($view)->with('feed', $activity);
	}

	// todo figure out how to push/clone feeds

	public function pushFeed()
	{

	}
}


text:
class LocationsController < ApplicationController
  respond_to :json

  def index
    respond_with Location.all
  end
end


text:
<idea-plugin>
  <extensionPoints>
    <extensionPoint name="myExtension" interface="ExtensionPoint"/>
  </extensionPoints>
    <extensions defaultExtensionNs="com.intellij">
        <myExtension implementation="MyExtensionPoint"/>
    </extensions>
</idea-plugin>


text:
  <TITLE>
  EMBOSS: acdvalid
  </TITLE>

acdvalid

    Function

    Description

acdvalid processes an ACD file and reports any errors or warnings caused by incorrect, deprecated or obsolete syntax.  The tests go above and beyond those of acdc and acdtrace.  It highlights ACD syntax that might cause problems to third-party parsing software which wrap the EMBOSS applications.

acdvalid validates the ACD file, testing many features which will not prevent an application from running, but will create problems for the interfaces, whether on the command-line or some other type.

    Usage

    Command line arguments

The first parameter is the name of the program to compile.

All other command line parameters and qualifiers are defined for that
program - see the documentation for the program of choice.

    Input file format

The input is whatever the chosen application reads.

    Output file format

The output file is empty, but any format available to the specified
program can be used.

    Data files

Acdvalid will use any data files specified in the ACD file of the
specified program, but will ignore any data files that are only used
directly by the program's code.

    Notes

acdvalid does not have its own options, but takes a single parameter which is the name of the EMBOSS application that is being testsed.  It is invoked by specifying the name of the application to be tested along with any command-line options after the name of the utility application itself:

acdvalid ApplicationName Options

acdvalid will run the command line interface of any EMBOSS program by reading its ACD file and processing the command line and user responses in exactly the same way as if the true program itself were running.  The application proper is <emphasis>not</emphasis> run; it is only the ACD file that is read.Any command-line options for the application being called can be specified. The user is prompted for any required values for application parameters and any input files are read. Output files can be specified in any available format however they will be empty (the application code is not called so there will be no output).

acdvalid will use any data files specified in the ACD file of the specified program, but will ignore any data files that are only used directly by the program's code.  EMBOSS data files are distributed with the application and stored in the standard EMBOSS data directory (see EMBOSS Users Manual for further information).

acdvalid generates both error and warning messages.  If the message is an "Error" then the ACD file will not work and requires fixing.  Most of the messages from acdvalid are "Warnings" and do not prevent a program from running, however it is still worth trying to fix the problem.

Although the warning messages are only advisory, as many warnings as possible are fixed for any application in the main release. Further validation tests will be added in future releases so it is worth running acdvalid on all local ACD files with each new version of EMBOSS

    References

    Warnings

None.

    Diagnostic Error Messages

    Exit status

It exits with status 0.

    Known bugs

None.

    Author(s)

    History

    Target users

    Comments


text:
package jodd.petite.fixtures.tst;

import jodd.petite.meta.PetiteDestroyMethod;
import jodd.petite.meta.PetiteInject;
import jodd.petite.meta.PetiteInitMethod;

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

public class Boo {

	public List<String> orders = new ArrayList<>();

	@PetiteInject
	private Foo foo;

	public Foo getFoo() {
		return foo;
	}

	public void setFoo(Foo foo) {
		foo.counter++;
		this.foo = foo;
	}

	private int count;
	private int count2;

	public int getCount() {
		return count;
	}
	public int getCount2() {
		return count2;
	}

	@PetiteInitMethod
	void init() {
		count++;
		orders.add("init");
	}

	@PetiteInitMethod(order = 100)
	void third() {
		orders.add("third");
	}

	@PetiteInitMethod(order = -1)
	void last() {
		orders.add("last");
	}

	@PetiteInitMethod(order = -2)
	void beforeLast() {
		orders.add("beforeLast");
	}

	@PetiteInitMethod(order = 1)
	void first() {
		orders.add("first");
	}

	@PetiteInitMethod(order = 2)
	void second() {
		orders.add("second");
	}

	@PetiteDestroyMethod
	void ciao() {
		count2++;
	}
	@PetiteDestroyMethod
	void buy() {
		count2++;
	}

	@PetiteInject
	public final Zoo zoo = null;

}


text:
using CoBuilder.Service.Interfaces;

namespace CoBuilder.Service.Domain
{
    public interface IWorkplace : Core.Domain.IWorkplace, IEntity
    {
        IProductsSet Products { get; }
    }
}


text:
<map>
  <entry>
    <string>plugin_config_props</string>
    <list>
      <org.lockss.daemon.ConfigParamDescr>
        <key>base_url</key>
        <displayName>Base URL</displayName>
        <description>Usually of the form http://<journal-name>.com/</description>
        <type>3</type>
        <size>40</size>
        <definitional>true</definitional>
        <defaultOnly>false</defaultOnly>
      </org.lockss.daemon.ConfigParamDescr>
    </list>
  </entry>
  <entry>
    <string>au_name</string>
    <string>"EDUCatt - Analisi linguistica e letteraria"</string>
  </entry>
  <entry>
    <string>au_start_url</string>
    <string>"%sindex.asp", base_url</string>
  </entry>
  <entry>
    <string>au_def_pause_time</string>
    <long>6000</long>
  </entry>
  <entry>
    <string>au_def_new_content_crawl</string>
    <long>1209600000</long>
  </entry>
  <entry>
    <string>plugin_name</string>
    <string>EDUCatt - Analisi linguistica e letteraria</string>
  </entry>
  <entry>
    <string>plugin_notes</string>
    <string>EDUCatt - Analisi linguistica e letteraria.
Check manifest page http://www.educatt.it/libri/all/index.asp
Crawler dalla URL http://www.educatt.it/libri/all/ALL_Fascicoli.asp
 e dalla URL  http://www.educatt.it/libri/all/ALLPDF/</string>
  </entry>
  <entry>
    <string>plugin_identifier</string>
    <string>EDUCatt.Analisi.Ling.Lett</string>
  </entry>
  <entry>
    <string>au_crawlrules</string>
    <list>
      <string>4,"^%s", base_url</string>
      <string>1,"%sindex\.asp", base_url</string>
      <string>1,"^http://static\.unicatt\.it/files/css/.*"</string>
      <string>1,"^http://www\.educatt\.it/libri/all/.*"</string>
      <string>1,"%sALL_.*\.asp", base_url</string>
      <string>1,"%sALLPDF/[0-9]+.*\.pdf", base_url</string>
      <string>1,"%s$", base_url</string>
    </list>
  </entry>
</map>


text:
set -e
docker-compose up -d
webpack
nodemon ./bin/vimes -- -i ~/surfdrive/DANS/target/flattened/


text:
<Group id="services">
<title>Services</title>
<description>
The best protection against vulnerable software is running less software. This section describes how to review
the software which Red Hat Enterprise Linux installs on a system and disable software which is not needed. It
then enumerates the software packages installed on a default RHEL6 system and provides guidance about which
ones can be safely disabled.

RHEL6 provides a convenient minimal install option that essentially installs the bare necessities for a functional
system. When building RHEL6 servers it is highly recommended to select the minimal packages and then build up
the system from there.
</description>
</Group>


text:
namespace Photon.Enums
{
    public enum GameType
    {
        Singleplayer = 0,
        NotInRoom = 3,
        Multiplayer = 4
    }
}


text:
    UNL Home
    CIC Website
    Big Ten Website


text:
<?php

declare(strict_types=1);

namespace CheckoutCom\Magento2\Model\InstantPurchase;

use CheckoutCom\Magento2\Model\Service\VaultHandlerService;
use Magento\Customer\CustomerData\SectionSourceInterface;
use Magento\Customer\Model\Address;
use Magento\Customer\Model\Session;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\InstantPurchase\Model\InstantPurchaseInterface;
use Magento\InstantPurchase\Model\InstantPurchaseOption;
use Magento\InstantPurchase\Model\Ui\CustomerAddressesFormatter;
use Magento\InstantPurchase\Model\Ui\PaymentTokenFormatter;
use Magento\InstantPurchase\Model\Ui\ShippingMethodFormatter;
use Magento\Quote\Api\Data\ShippingMethodInterface;
use Magento\Store\Model\StoreManagerInterface;

/**
 * Class CustomerData
 */
class CustomerData implements SectionSourceInterface
{
    /**
     * $storeManager field
     *
     * @var StoreManagerInterface $storeManager
     */
    private $storeManager;
    /**
     * $instantPurchase field
     *
     * @var InstantPurchaseInterface $instantPurchase
     */
    private $instantPurchase;
    /**
     * $customerSession field
     *
     * @var Session $customerSession
     */
    private $customerSession;
    /**
     * $customerAddressesFormatter field
     *
     * @var CustomerAddressesFormatter $customerAddressesFormatter
     */
    private $customerAddressesFormatter;
    /**
     * $shippingMethodFormatter field
     *
     * @var ShippingMethodFormatter $shippingMethodFormatter
     */
    private $shippingMethodFormatter;
    /**
     * $vaultHandler field
     *
     * @var VaultHandlerService $vaultHandler
     */
    private $vaultHandler;
    /**
     * $availabilityChecker field
     *
     * @var AvailabilityChecker $availabilityChecker
     */
    private $availabilityChecker;
    /**
     * $paymentTokenFormatter field
     *
     * @var PaymentTokenFormatter $paymentTokenFormatter
     */
    private $paymentTokenFormatter;
    /**
     * $paymentToken field
     *
     * @var array|mixed $paymentToken
     */
    private $paymentToken;
    /**
     * $instantPurchaseOption field
     *
     * @var InstantPurchaseOption $instantPurchaseOption
     */
    private $instantPurchaseOption;
    /**
     * $shippingAddress field
     *
     * @var Address $shippingAddress
     */
    private $shippingAddress;
    /**
     * $billingAddress field
     *
     * @var Address $billingAddress
     */
    private $billingAddress;
    /**
     * $shippingMethod field
     *
     * @var ShippingMethodInterface $shippingMethod
     */
    private $shippingMethod;

    /**
     * CustomerData constructor
     *
     * @param StoreManagerInterface      $storeManager
     * @param InstantPurchaseInterface   $instantPurchase
     * @param Session                    $customerSession
     * @param TokenFormatter             $paymentTokenFormatter
     * @param CustomerAddressesFormatter $customerAddressesFormatter
     * @param ShippingMethodFormatter    $shippingMethodFormatter
     * @param VaultHandlerService        $vaultHandler
     * @param AvailabilityChecker        $availabilityChecker
     */
    public function __construct(
        StoreManagerInterface $storeManager,
        InstantPurchaseInterface $instantPurchase,
        Session $customerSession,
        TokenFormatter $paymentTokenFormatter,
        CustomerAddressesFormatter $customerAddressesFormatter,
        ShippingMethodFormatter $shippingMethodFormatter,
        VaultHandlerService $vaultHandler,
        AvailabilityChecker $availabilityChecker
    ) {
        $this->storeManager               = $storeManager;
        $this->instantPurchase            = $instantPurchase;
        $this->customerSession            = $customerSession;
        $this->customerAddressesFormatter = $customerAddressesFormatter;
        $this->shippingMethodFormatter    = $shippingMethodFormatter;
        $this->vaultHandler               = $vaultHandler;
        $this->availabilityChecker        = $availabilityChecker;
        $this->paymentTokenFormatter      = $paymentTokenFormatter;
    }

    /**
     * {@inheritDoc}
     *
     * @return mixed[]|mixed[][]
     * @throws LocalizedException
     */
    public function getSectionData(): array
    {
        // Set the instant purchase availability
        $data = ['available' => $this->isAvailable()];
        if (!$this->isAvailable()) {
            return $data;
        }

        // Prepare the required data
        $this->prepareData();

        // Check if the option can be displayed
        if (!$this->canDisplay()) {
            return $data;
        }

        // Build the instant purchase data
        $data += [
            'paymentToken'    => [
                'publicHash' => $this->paymentToken->getPublicHash(),
                'summary'    => $this->paymentTokenFormatter->formatPaymentToken($this->paymentToken),
            ],
            'shippingAddress' => [
                'id'      => $this->shippingAddress->getId(),
                'summary' => $this->customerAddressesFormatter->format($this->shippingAddress),
            ],
            'billingAddress'  => [
                'id'      => $this->billingAddress->getId(),
                'summary' => $this->customerAddressesFormatter->format($this->billingAddress),
            ],
            'shippingMethod'  => [
                'carrier' => $this->shippingMethod->getCarrierCode(),
                'method'  => $this->shippingMethod->getMethodCode(),
                'summary' => $this->shippingMethodFormatter->format($this->shippingMethod),
            ],
        ];

        return $data;
    }

    /**
     * Prepare the data needed for instant purchase
     *
     * @return void
     * @throws LocalizedException
     */
    public function prepareData(): void
    {
        // Get the  payment token
        $this->paymentToken = $this->vaultHandler->getLastSavedCard();

        // Get the instant purchase option
        $this->instantPurchaseOption = $this->loadOption();

        // Get the shipping and billing data
        if ($this->instantPurchaseOption) {
            $this->shippingAddress = $this->instantPurchaseOption->getShippingAddress();
            $this->billingAddress  = $this->instantPurchaseOption->getBillingAddress();
            $this->shippingMethod  = $this->instantPurchaseOption->getShippingMethod();
        }
    }

    /**
     * Load the instant purchase option
     *
     * @return InstantPurchaseOption
     * @throws NoSuchEntityException
     */
    public function loadOption(): InstantPurchaseOption
    {
        return $this->instantPurchase->getOption(
            $this->storeManager->getStore(),
            $this->customerSession->getCustomer()
        );
    }

    /**
     * Checks if the instant purchase option is available
     *
     * @return bool
     */
    public function isAvailable(): bool
    {
        return $this->availabilityChecker->isAvailable();
    }

    /**
     * Checks if the instant purchase option can be displayed
     *
     * @return bool
     */
    protected function canDisplay(): bool
    {
        return $this->customerSession->isLoggedIn(
            ) && !empty($this->paymentToken) && $this->instantPurchaseOption && $this->shippingAddress && $this->billingAddress && $this->shippingMethod;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 473 (1898)

#### Original name
Valsa campsospora Mont.

### Remarks
null