text:
qingctl controls the QingYuan cluster manager

### Synopsis

qingctl controls the QingYuan cluster manager.

Find more information at https://github.com/qingyuancloud/QingYuan.

```
qingctl
```

### Options

```
      --alsologtostderr=false: log to standard error as well as files
      --api-version="": The API version to use when talking to the server
      --certificate-authority="": Path to a cert. file for the certificate authority.
      --client-certificate="": Path to a client key file for TLS.
      --client-key="": Path to a client key file for TLS.
      --cluster="": The name of the qingconfig cluster to use
      --context="": The name of the qingconfig context to use
  -h, --help=false: help for qingctl
      --insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
      --qingconfig="": Path to the qingconfig file to use for CLI requests.
      --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
      --log-dir=: If non-empty, write log files in this directory
      --log-flush-frequency=5s: Maximum number of seconds between log flushes
      --logtostderr=true: log to standard error instead of files
      --match-server-version=false: Require server version to match client version
      --namespace="": If present, the namespace scope for this CLI request.
      --password="": Password for basic authentication to the API server.
  -s, --server="": The address and port of the QingYuan API server
      --stderrthreshold=2: logs at or above this threshold go to stderr
      --token="": Bearer token for authentication to the API server.
      --user="": The name of the qingconfig user to use
      --username="": Username for basic authentication to the API server.
      --v=0: log level for V logs
      --validate=false: If true, use a schema to validate the input before sending it
      --vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```

### SEE ALSO
* [qingctl api-versions](qingctl_api-versions.md)	 - Print available API versions.
* [qingctl cluster-info](qingctl_cluster-info.md)	 - Display cluster info
* [qingctl config](qingctl_config.md)	 - config modifies qingconfig files
* [qingctl create](qingctl_create.md)	 - Create a resource by filename or stdin
* [qingctl delete](qingctl_delete.md)	 - Delete a resource by filename, stdin, resource and ID, or by resources and label selector.
* [qingctl describe](qingctl_describe.md)	 - Show details of a specific resource
* [qingctl exec](qingctl_exec.md)	 - Execute a command in a container.
* [qingctl expose](qingctl_expose.md)	 - Take a replicated application and expose it as QingYuan Service
* [qingctl get](qingctl_get.md)	 - Display one or many resources
* [qingctl label](qingctl_label.md)	 - Update the labels on a resource
* [qingctl logs](qingctl_logs.md)	 - Print the logs for a container in a pod.
* [qingctl namespace](qingctl_namespace.md)	 - SUPERCEDED: Set and view the current QingYuan namespace
* [qingctl port-forward](qingctl_port-forward.md)	 - Forward one or more local ports to a pod.
* [qingctl proxy](qingctl_proxy.md)	 - Run a proxy to the QingYuan API server
* [qingctl rolling-update](qingctl_rolling-update.md)	 - Perform a rolling update of the given ReplicationController.
* [qingctl run](qingctl_run.md)	 - Run a particular image on the cluster.
* [qingctl scale](qingctl_scale.md)	 - Set a new size for a Replication Controller.
* [qingctl stop](qingctl_stop.md)	 - Gracefully shut down a resource by id or filename.
* [qingctl update](qingctl_update.md)	 - Update a resource by filename or stdin.
* [qingctl version](qingctl_version.md)	 - Print the client and server version information.

###### Auto generated by spf13/cobra at 2015-05-22 14:24:30.1784975 +0000 UTC

[![Analytics](https://qingyuan-site.appspot.com/UA-36037335-10/GitHub/docs/qingctl.md?pixel)]()


text:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE jmxetric-config [
   <!ELEMENT jmxetric-config (sample|ganglia|jvm)*>
   <!ELEMENT sample (mbean)*>
      <!ATTLIST sample delay CDATA #REQUIRED>
      <!ATTLIST sample initialdelay CDATA "0">
   <!ELEMENT mbean (attribute)*>
      <!ATTLIST mbean name CDATA #REQUIRED>
      <!ATTLIST mbean pname CDATA #REQUIRED>
   <!ELEMENT attribute (composite*)>
      <!ATTLIST attribute name CDATA #REQUIRED>
      <!ATTLIST attribute type CDATA "" >
      <!ATTLIST attribute units CDATA "" >
      <!ATTLIST attribute pname CDATA "" >
      <!ATTLIST attribute slope CDATA "both" >
   <!ELEMENT composite EMPTY>
      <!ATTLIST composite name CDATA #REQUIRED>
      <!ATTLIST composite type CDATA "" >
      <!ATTLIST composite units CDATA "" >
      <!ATTLIST composite pname CDATA "" >
      <!ATTLIST composite slope CDATA "both" >
   <!ELEMENT ganglia EMPTY>
      <!ATTLIST ganglia hostname CDATA #REQUIRED>
      <!ATTLIST ganglia port CDATA #REQUIRED>
      <!ATTLIST ganglia mode CDATA #REQUIRED>
      <!ATTLIST ganglia wireformat31x CDATA #REQUIRED>
   <!ELEMENT jvm EMPTY>
      <!ATTLIST jvm process CDATA "">
]>

<jmxetric-config>

    <!--
     ~ ************************************************************************
     ~ <jvm process="ProcessName"/>
     ~   A name that is prefixed to the metric name before publication (so that
     ~   metrics from different JVMs on the same host can be determined).
     ~   If the "process" name is specified in -javaagent arguments,
     ~   it overrides this specification.
     ~
     ~ <sample initialdelay="0" delay="60">
     ~   In seconds. default initialdelay=0. default delay=60.
     ~
     ~ Support types:
     ~   string|int8|uint8|int16|uint16|int32|uint32|float|double
     ~   for a long type, use double here.
     ~
     ~  The composite within a attribute should implement CompositeData.
     ~ ************************************************************************
     -->

	<jvm process="ProcessName"/>

	<sample initialdelay="10" delay="60">

		<mbean name="java.lang:type=Memory" pname="Memory">
			<attribute name="HeapMemoryUsage">
				<composite name="init" pname="Heap_init" type="int32" units="bytes"/>
				<composite name="committed" pname="Heap_committed" type="int32" units="bytes"/>
				<composite name="used" pname="Heap_used" type="int32" units="bytes" />
				<composite name="max" pname="Heap_max" type="int32" units="bytes" />
			</attribute>
			<attribute name="NonHeapMemoryUsage" >
				<composite name="init" pname="NonHeap_init" type="int32"  units="bytes" />
				<composite name="committed" pname="NonHeap_committed" type="int32" units="bytes" />
				<composite name="used" pname="NonHeap_used" type="int32" units="bytes" />
				<composite name="max" pname="NonHeap_max" type="int32" units="bytes" />
			</attribute>
		</mbean>

		<mbean name="java.lang:type=Threading" pname="Threading" >
			<attribute name="ThreadCount" type="int16" />
			<attribute name="DaemonThreadCount" type="int16" />
		</mbean>

		<mbean name="java.lang:type=OperatingSystem" pname="OS" >
			<attribute name="ProcessCpuTime" type="int32" slope="positive"/>
		</mbean>

	</sample>

	<!--
     ~ ************************************************************************
     ~ Specify the configuration of ganglia gmond. These attributes can also
     ~ be defined in -javaagent arguments in java commandline. e.g:
     ~ -javaagent:/full/path/to/jmxetric.jar=host=239.2.11.70,port=8649,
     ~ mode=multicast,wireformat31x=true,config=/full/path/to/jmxetric.xml.
     ~ But, if they are specified in -javaagent arguments, following attributes
     ~ will be overrided.
     ~
     ~ hostname,port: The multicast address that is used to publish metrics
     ~                to the ganglia gmond.
     ~ mode:          The UDP addressing mode, either multicast or unicast
     ~                (default multicast).
     ~ wireformat31x: True if the ganglia v3.1.x wire format should be used
     ~                (default false).
     ~ ************************************************************************
     -->
	<ganglia hostname="localhost" port="8649" mode="multicast" wireformat31x="true" />

</jmxetric-config>

redpajama_set_name: RedPajamaGithub


text:
nom: Lentinellus flabelliformis
date: 2017-03-25 00:00:00
image: https://c1.staticflickr.com/9/8192/8084204057_9ff65926da_n.jpg
image-originale: https://www.flickr.com/photos/kaufholtz/8084204057/in/photolist-dwGgDp-djnDe7-djnEdz
album-flickr:
  - 72157675222116356

details:
  nom-francais: Lentin en éventail
  domaine: Eucaryote
  regne: Fungi
  phylum: Basidiomycota
  sous-phylum: Agaricomycotina
  classe: Agaricomycetes
  sous-classe: Incertae sedis
  ordre: Russulales
  famille: Auriscalpiaceae
  genre: Lentinellus
  espece: Lentinellus flabelliformis (Bolton) S. Ito
  litterature: Ito, S. 1955. Mycological Flora of Japan. Basidiomycetes. 2(4):1-450

collections:
  - fongarium: cKc0021
    date: 13 octobre 2012
    planche:
      numero: cKc0021-0002
      miniature: https://c1.staticflickr.com/9/8058/8223633205_b17927e549_n.jpg
      originale: https://www.flickr.com/photos/kaufholtz/8223633205/in/photolist-dwGgDp-djnDe7-djnEdz
    geolocalisation: 46°54'03.96"N 71°10'40.83"O
    elevation: 145 m
    determinee:
    confirmee: Claude Kaufholtz-Couture

description:
  acanthocytes:
  acanthophyses:
  aiguillons:
  aleurioconidies:
  anamorphe:
  anamorphe-conidien:
  anneau:
  apothecie:
  arete-lamellaire:
  arthroconidies:
  articles:
  ascome:
  ascospores:
  asques:
  asterohyphidies:
  avertissement:
  base-du-pied:
  base-sterile:
  base-stipitiforme:
  basides:
  basidiospores: |
    subglobuleuses à largement ellipsoïdes, finement échinulées, à paroi mince, avec fin apicule, sans pore germinatif, à contenu uniguttulé à pluriguttulé, hyalines, fortement amyloïdes, cyanophiles
    5,6 x 4,5 µm en moyenne; Q moyen = 1,2; N = 35
    (Piximètre, formule statistique; mesures issues d'une sporée, dans le NaCl iso 0,9%)
  basidioles:
  basidiome:
  bibliographies:
  biotopes: pousse en touffes sur branches ou bois morts de feuillus
  boucles: présentes
  brachybasidioles:
  calicule:
  capillitium:
  capitule:
  caulobasides:
  caulocystides:
  caulocystides-medianes:
  caulocystides-sommitales:
  cellules-hymeniales-diverticulees:
  cellules-hymeniales-en-brosses:
  cellules-marginales-paracystides:
  cellules-peritheciales:
  cellules-stromatiques:
  chair: mince, ± tenace, flexible, blanchâtre, concolore à la surface du pileus ou parfois brun foncé
  chancre:
  cheilocystides: dispersées à nombreuses, fusiformes, souvent atténuées vers l'apex, à paroi mince, hyalines, (25) 30-42 (55) x (4) 5-7 µm, émergentes sur ⅓-½ de leur longueur totale
  cheilomacrocystides:
  chlamydospores:
  chrysocystides:
  circumcystides:
  clavules:
  columelle:
  commentaires:
  conidies:
  conidiome:
  conidiophores:
  consistance:
  contexte:
  cordons-myceliens:
  cordons-rhizomorphiques:
  cortex:
  cortex-caulinaire:
  cortex-du-pied-et-du-bulbe:
  cortex-peridial:
  cortex-sclerotial:
  cortine:
  couches-de-tubes:
  coupe-sterile:
  cristaux:
  cristaux-d-oxalate:
  cuticule:
  cutis:
  cycle:
  cystides:
  cystides-hymeniales:
  cystides-intermediaires:
  cystidioles:
  dendrohyphydies:
  depots-de-pigment-interhyphal:
  dermatocystides-caulocystides-et-pileipellis:
  derniere-correction:
  dicaryophyses:
  dichophyses:
  disque-basal:
  distribution: rare à occassionnel
  elateres:
  elements-acanthophyses:
  elements-cystidioides:
  elements-hyphoides:
  elements-setoides:
  elements-steriles:
  elements-sur-les-cotes:
  elements-velaires:
  endoperidium:
  especes-identification:
  especes-semblables:
  excipulum:
  excipulum-medullaire-superieur:
  excipulum-medullaire-moyen:
  excipulum-medullaire-inferieur:
  excipulum-ectal:
  exhalaison: indistincte ou légèrement aromatique, fruitée à poivrée
  exhalaison-de-la-chair:
  exhalaison-des-lames:
  exoperidium:
  extremites-hyphales:
  face-externe:
  face-poroïde:
  feutrage-basal:
  fragments-sporaux:
  glebe:
  gleocystides:
  gleocystides-hymeniales:
  gleocystides-subhymeniales:
  granules-calcaires:
  groupe:
  hymenium:
  hymenocystides:
  hymenophore:
  hyphes:
  hyphes-de-la-chair:
  hyphes-de-l-anneau:
  hyphes-du-pied:
  hyphes-glebales:
  hyphes-gleopleres:
  hyphes-hymeniales:
  hyphes-ligatives:
  hyphes-oleiferes: présentes
  hyphes-pectinees:
  hyphes-primordiales:
  hyphes-setales:
  hyphes-squelettiques:
  hyphes-skeletoligative:
  hyphes-subiculaires:
  hyphes-tramales:
  hyphes-vesiculaires:
  hyphidies:
  hyphique:
  hypobasides:
  hypoderme:
  hypoge:
  hypophylle:
  hypothalle:
  hypothece:
  hysterothece:
  lames: décurrentes, larges, serrées à subespacées, crème pâle, fortement dentelées-érodées
  lamprocystides:
  lamprocheilocystides:
  lampropleurocystides:
  lamprocaulocystides:
  latex:
  leptocystides:
  macrocystides:
  macropleurocystides:
  marge:
  marge-et-face-externe:
  mediostrate:
  medulla:
  medulla-caulinaire:
  medulla-clavariale:
  medulla-clavulaire:
  microconidies:
  mode-de-croissance: souvent cespiteux, grégaire ou en amas imbriqués
  mycelium-basal:
  myxocarpe:
  nouvelle-espece:
  note-taxonomique:
  oeuf:
  paracapillitium:
  paraphyses:
  parasite:
  paroi-peritheciale:
  peridiole:
  peridiopellis:
  peridium:
  peritheces:
  phenologie: d'août à octobre
  phialoconidies:
  pieds-steriles:
  pigments:
  pileipellis:
  pileitrame:
  pileocystides:
  pileus: 27 mm Ø, polymorphe, pétaloïde-arrondi, flabelliforme, à infundibuliforme, convexe puis convexe-étalé, ± circulaire, mince, lisse, subglabre, finement strié radialement vers l'intérieur et parfois fendu, hygrophane, rosâtre-vineux à cannelle brunâtre au frais, parfois avec plaques peu définies et stries radiales brun foncé à cannelle orangé, puis blanchâtre et gris jaunâtre à brun vers le pourtour, tan à brun foncé au sec, à marge enroulée à incurvée au début, puis droite, légèrement striée, souvent légèrement crénelée
  plasmode:
  pleurocystides:
  poils:
  poils-basaux:
  poils-caulinaires:
  poils-du-cortex:
  poils-externes:
  poils-lateraux-et-caulinaires:
  poils-marginaux:
  poils-mycelien-basaux:
  poils-peridiaux:
  poils-peritheciaux:
  poils-pileiques:
  pores:
  premiere-mention:
  pseudocapillitium:
  pseudocolumelle:
  pseudocystides:
  pseudo-peridioles:
  publications:
  publications-microscopiques: |
    Kaufholtz-Couture, Claude. Étude des caractères microscopiques des champignons de la classe des Basidiomycètes, Module 1, les basidiospores, ouvrage collectif sous la direction de, 2e édition, Québec, 2016.
    Kaufholtz-Couture, Claude. Étude des caractères microscopiques des champignons de la classe des Basidiomycètes, Module 2, les basides, les hyménocystides et les trames lamellaires, ouvrage collectif sous la direction de, 2e édition, Québec, 2016.
    Kaufholtz-Couture, Claude. Étude des caractères microscopiques des champignons de la classe des Basidiomycètes, Module 3, les pileipellis, les stipitipellis, les dermatocystides, les voiles partiels et les acantocytes, ouvrage collectif sous la direction de, 2e édition, Québec, 2016.
    Kaufholtz-Couture, Claude. Étude des caractères microscopiques des champignons de la classe des Basidiomycètes, Module 4, la chair ou le contexte, les hyphes spécialisées, le système hyphal et les pigments, ouvrage collectif sous la direction de, 2e édition, Québec, 2016.
  reactions-macrochimiques:
  receptacle:
  remarques:
  repartition:
  rhizomorphes:
  sac-sporifere:
  saveur: légèrement farineuse-poivrée, parfois ± amère
  sclerocystides:
  sclerote:
  soies:
  soies-hymeniales:
  sporee: blanche
  spherocytes:
  sporocystes:
  stipe: < 1 mm de largeur, 11 mm de longueur, absent ou très court, centré, excentré à latéral, à obclavé, lisse à subglabre, côtelé par les lames décurrentes, chamois rosé, brun grisâtre, brun foncé, brun pourpré foncé à brun-noir, parfois avec fin mycélium basal cotonneux à laineux brun grisâtre à vineux et/ou délicats rhizomorphes aplatis, palmés aux ramifications
  stipitipellis:
  stipititrame:
  stroma:
  subhymenium:
  subiculum:
  substrat:
  synonymie: |
    Agaricus flabelliformis Bolton, An History of Fungusses, Growing about Halifax App.:157, t. 157 (1791)
    Lentinus flabelliformis (Bolton) Fr., Systema Orbis Vegetabilis 1:78 (1825)
    Hemicybe flabelliformis (Bolton) P. Karst., Bidrag till Kännedom av Finlands Natur och Folk 32:250 (1879)
    Lentinus flabellinus Quél., Flore mycologique de la France et des pays limitrophes:326 (1888)
    Pocillaria flabelliformis (Bolton) Kuntze, Revisio generum plantarum 2:866 (1891)
    Lentinellus flabellinus (Quél.) Konrad & Maubl., Icones Selectae Fungorum Fasc. 7:pl. 315 (1937)
    Lentinus omphalodes f. flabelliformis (Bolton) Pilát, Annales Mycologici 39 (1):83 (1941)
    Lentinus omphalodes var. flabelliformis (Bolton) Pilát, Atlas des Champignons de l'Europe V, Monographie des espèces européennes du genre Lentinus Fr.:36 (1946)
    Lentinus scoticus Berk. & Broome, Annals and Magazine of Natural History 15:30 (1875)
    Lentinus piceinus Peck, Bulletin of the New York State Museum 150:33 (1911)
    Lentinus omphalodes f. apoda Pilát, Atlas des Champignons de l'Europe V, Monographie des espèces européennes du genre Lentinus Fr.:36 (1946)
  systeme-hyphal:
  textura:
  tomentum-caulinaire:
  tomentum-pileique:
  trame-hymenophorale:
  trame-lamellaire:
  trame-tubulaire:
  type:
  typique:
  voile:
  voile-general:
  voile-partiel:
  volve:
  zone-perihymeniale:
---


text:
package com.intellij.openapi.editor;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.impl.DocumentImpl;
import com.intellij.testFramework.LightPlatformTestCase;
import com.intellij.util.IncorrectOperationException;

public class DocumentTest extends LightPlatformTestCase {
  public void testCorrectlyAddingAndRemovingListeners() throws Exception {
    new WriteCommandAction.Simple(getProject()) {
      @Override
      protected void run() throws Throwable {
        final Document doc = new DocumentImpl("");
        final StringBuilder b = new StringBuilder();
        doc.addDocumentListener(new DocumentAdapter() {
          @Override
          public void beforeDocumentChange(DocumentEvent e) {
            b.append("before1 ");
          }

          @Override
          public void documentChanged(DocumentEvent e) {
            b.append("after1 ");
          }
        });

        doc.addDocumentListener(new DocumentAdapter() {
          @Override
          public void beforeDocumentChange(DocumentEvent event) {
            doc.removeDocumentListener(this);
          }
        });
        doc.addDocumentListener(new DocumentAdapter() {
          @Override
          public void documentChanged(DocumentEvent e) {
            doc.removeDocumentListener(this);
          }
        });

        doc.addDocumentListener(new DocumentAdapter() {
          @Override
          public void beforeDocumentChange(DocumentEvent e) {
            b.append("before2 ");
          }

          @Override
          public void documentChanged(DocumentEvent e) {
            b.append("after2 ");
          }
        });

        doc.setText("foo");
        assertEquals("before2 before1 after1 after2 ", b.toString());
      }
    }.execute().throwException();
  }

  public void testModificationInsideCommandAssertion() {
    CommandProcessor commandProcessor = CommandProcessor.getInstance();
    assertTrue(!commandProcessor.isUndoTransparentActionInProgress() &&
               commandProcessor.getCurrentCommand() == null);

    final Document doc = new DocumentImpl("xxx");

    mustThrow(() -> doc.insertString(1, "x"));
    mustThrow(() -> doc.deleteString(1, 2));
    mustThrow(() -> doc.replaceString(1, 2, "s"));
    WriteCommandAction.runWriteCommandAction(getProject(), () -> doc.insertString(1, "s"));
    WriteCommandAction.runWriteCommandAction(getProject(), () -> doc.deleteString(1, 2));
    WriteCommandAction.runWriteCommandAction(getProject(), () -> doc.replaceString(1, 2, "xxx"));
    WriteCommandAction.runWriteCommandAction(getProject(), () -> doc.setText("sss"));

    DocumentImpl console = new DocumentImpl("xxxx", true);
    // need no stinking command
    console.insertString(1,"s");
    console.deleteString(1, 2);
    console.replaceString(1, 2, "xxx");
    console.setText("sss");

  }

  public void testEmptyDocumentLineCount() {
    WriteCommandAction.runWriteCommandAction(ourProject, () -> {
      DocumentImpl document = new DocumentImpl("");
      assertEquals(0, document.getLineCount());
      document.insertString(0, "a");
      assertEquals(1, document.getLineCount());
      document.deleteString(0, 1);
      assertEquals(0, document.getLineCount());
    });
  }

  private static void mustThrow(Runnable runnable) {
    try {
      ApplicationManager.getApplication().runWriteAction(runnable);
      fail("Must throw IncorrectOperationException");
    }
    catch (IncorrectOperationException e) {
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.EnhancedPatternLayout">
            <param name="ConversionPattern" value="[%d] %5p %c{1} %L: %m%n"/>
        </layout>
    </appender>

    <category name="org.apache.hadoop">
        <priority value="warn"/>
    </category>
    <category name="hsqldb">
        <priority value="warn"/>
    </category>
    <category name="org.apache.orc">
        <priority value="warn"/>
    </category>

    <!--<category name="org.locationtech.geomesa.fs">
        <priority value="debug"/>
    </category>-->

    <!-- un-comment the following line to enable verbose log messages
         from the index query-planner; this can be helpful in debugging
         query plans -->
    <!--
    <category name="org.locationtech.geomesa.index.utils.Explainer">
        <priority value="trace"/>
    </category>
    -->

    <root>
        <priority value="info"/>
        <appender-ref ref="CONSOLE" />
    </root>
</log4j:configuration>


text:
public class WaterBender : Bender
{
    private float waterClarity;

    public WaterBender(string name, int power,float waterClarity) : base(name, power)
    {
        this.WaterClarity = waterClarity;
    }

    public float WaterClarity
    {
        get { return this.waterClarity; }
        set { this.waterClarity = value; }
    }

    public override float BenderPower()
    {
        return Power * WaterClarity;
    }

    public override string ToString()
    {
        return base.ToString() + $"Water Clarity: {this.WaterClarity:f2}";
    }
}


text:
package org.techdraw.sheets.api;

import java.util.Collection;
import java.util.Map;

/**
 * @author Miroslav Kravec
 */
public class PartGroup {
    public Collection<BoxedElement> children;
    public Map<String, String> metadata;

    public PartGroup() {
    }

    public PartGroup(Collection<BoxedElement> children, Map<String, String> metadata) {
        this.children = children;
        this.metadata = metadata;
    }
}


text:
package org.cyclops.fluidconverters.proxy;

import net.minecraftforge.common.MinecraftForge;
import org.cyclops.cyclopscore.init.ModBase;
import org.cyclops.cyclopscore.proxy.ClientProxyComponent;
import org.cyclops.fluidconverters.FluidConverters;
import org.cyclops.fluidconverters.event.TextureStitchEventHook;

/**
 * Proxy for the client side.
 *
 * @author rubensworks
 *
 */
public class ClientProxy extends ClientProxyComponent {

	public ClientProxy() {
		super(new CommonProxy());
	}

	@Override
	public ModBase getMod() {
		return FluidConverters._instance;
	}

	@Override
	public void registerEventHooks() {
		super.registerEventHooks();
		MinecraftForge.EVENT_BUS.register(new TextureStitchEventHook());
	}
}


text:
#ifndef CAELUM__CAMERA_BOUND_ELEMENT_H
#define CAELUM__CAMERA_BOUND_ELEMENT_H

#include "CaelumPrerequisites.h"

namespace Caelum
{
    /** A camera-bound element.
     *
     *	This should be used as a base class for domes which follow the camera.
     *  It is only meant to be used inside Caelum.
     *
     *  By default this class work in autoradius mode; where it automatically
     *  resizes itself for camera near/far clipping radius. It will correctly
     *  handle infinite far clip planes.
     *
     *  This is meant to be used with depth_check and depth_write off.
     *  Trying to place an object "as far as possible" causes precision
     *  troubles; and was removed in version 0.4.
     *
     *  If far clip distance is finite the radius will be (near + far) / 2.
     *  If far clip distance is infinite (0) the radius will be 10 * near/
     */
    class CAELUM_EXPORT CameraBoundElement
    {
	private:
		/// Defines if the element has an automatic "far" radius or not.
		bool mAutoRadius;

	public:
        /** Constructor. Sets auto radius to true.
         */
        CameraBoundElement();

		/// Virtual Destructor.
		virtual ~CameraBoundElement ();

		/** Notify new camera conditions.
		 *  This method notifies that a new camera is about to be used, so
         *  this element can follow it or perform other operations.
         *  The default implementation calls setRadius if in autoRadius mode.
		 *  @param cam The new camera.
		 */
		virtual void notifyCameraChanged (Ogre::Camera *cam) = 0;

		/** Forces the "far" size of the element to a specific radius.
         *
         *  If greater than zero this disables AutoRadius mode and forces a
         *  fixed radius. If this is negative or zero the radius is set
         *  automatically in notifyCameraChanged.
         *
         *  AutoRadius is turned on by default.
         *
		 *  @param radius The positive radius of the element, or a
         *          negative/zero value for AutoRadius mode.
		 */
        void forceFarRadius (Ogre::Real radius);

        /** Checks if this element is in auto-radius mode.
         *  While in autoradius mode the element is automatically resized fit
         *  between the near and far radius.
         */
        bool getAutoRadius () const;

        /** Re-enable auto-radius; if disabled.
         *  Auto-radius is on by default; but can be disabled. This function
         *  can turn it back on.
         */
        void setAutoRadius ();

        /** Camera distances multiplier for the far clipping distance.
         *  This threshold will be multiplied with the far clipping distance,
         *  if the camera doesn't use an infinite far clipping plane.
         */
        static const Ogre::Real CAMERA_FAR_DISTANCE_MULTIPLIER;

        /** Camera distances multiplier for the near clipping distance.
         *  This threshold will be multiplied with the near clipping distance,
         *  if the camera does use an infinite far clipping plane.
         */
        static const Ogre::Real CAMERA_NEAR_DISTANCE_MULTIPLIER;

    protected:
        /** Abstract method to set the radius for this elements
         *  Derived classes should override this and resize their domes.
         *  The actual radius for the dome is controlled in the base class.
         */
        virtual void setFarRadius (Ogre::Real radius);
    };
}

#endif // CAELUM__CAMERA_BOUND_ELEMENT_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>fi.uef.cs.caao</groupId>
        <artifactId>databases</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>mysql</artifactId>
    <name>mysql</name>

</project>


text:
package org.vizzini.swingui.game.boardgame;

import org.junit.Test;
import org.vizzini.core.game.Agent;
import org.vizzini.example.boardgame.reversi.ReversiActionGenerator;
import org.vizzini.example.boardgame.reversi.ReversiGameInjector;
import org.vizzini.swingui.game.boardgame.reversi.ReversiAgentFactory;

/**
 * Provides tests for the NewAgentDialog class.
 */
public final class MyTestNewAgentDialog
{
    /**
     * Test the setVisible method.
     */
    @Test
    public void setVisible()
    {
        final ReversiGameInjector injector = new ReversiGameInjector();
        final ReversiActionGenerator actionGenerator = injector.injectActionGenerator();
        final AgentFactory agentFactory = new ReversiAgentFactory(actionGenerator);
        final NewAgentDialog dialog = new NewAgentDialog(null, agentFactory);

        dialog.getDialog().setVisible(true);

        // Modal dialog blocks here until done.

        final Agent firstAgent = dialog.getFirstAgent();
        System.out.println("firstAgent = " + firstAgent);

        final Agent secondAgent = dialog.getSecondAgent();
        System.out.println("secondAgent = " + secondAgent);
    }
}


text:
namespace safe_browsing {

// Strips the filename from the |url|.
std::string SanitizeURLWithoutFilename(const std::string url);

}  // namespace safe_browsing

#endif  // CHROME_BROWSER_SAFE_BROWSING_EXTENSION_TELEMETRY_EXTENSION_SIGNAL_UTIL_H_


text:
package uk.gov.hmrc.ct.ct600.v2

import uk.gov.hmrc.ct.box.{Calculated, CtBoxIdentifier, CtInteger}
import uk.gov.hmrc.ct.ct600.v2.retriever.CT600BoxRetriever

case class B18(value: Int) extends CtBoxIdentifier(name = " Net chargeable gains") with CtInteger

object B18 extends Calculated[B18, CT600BoxRetriever] {

  override def calculate(fieldValueRetriever: CT600BoxRetriever): B18 = {
//    B18(fieldValueRetriever.retrieveB16() - fieldValueRetriever.retrieveB17())
    ???
  }
}


text:
public class Machine{
	private String couleur;
	private Avant pavant;
	private Arriere parriere;
	public Machine(String couleur, Avant pavant, Arriere parriere){
		this.couleur = couleur;
		this.pavant = pavant;
		this.parriere = parriere;
	}
	public String toString(){
		return "Machine a schtroumpfer de couleur "+couleur+
				"\navec partie avant :\n "+pavant.toString()+
				"\net partir arriere \n"+parriere.toString();
	}

	public void setCouleur (String c){
		this.couleur = c;

	}

    public Machine clone (){
		Machine copie = new Machine(this.couleur, pavant.clone(), parriere.clone());
    	return copie;
	}

}


text:
/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <nuttx/config.h>

#include <assert.h>

#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>

#include "nxfe.h"
#include "nxtk_internal.h"

/****************************************************************************
 * Pre-Processor Definitions
 ****************************************************************************/

/****************************************************************************
 * Private Types
 ****************************************************************************/

/****************************************************************************
 * Private Data
 ****************************************************************************/

/****************************************************************************
 * Public Data
 ****************************************************************************/

/****************************************************************************
 * Private Functions
 ****************************************************************************/

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/****************************************************************************
 * Name: nxtk_toolbarbounds
 *
 * Description:
 *   Return a bounding box that contains the toolbar in the coordinates of
 *   the containing, framed window.  For example, the recturned  origin
 *  (rect.pt1) is the offset toolbar in the framed window.
 *
 *   NOTE: This function is unsafe in the case of the multi-user NX server
 *   where the width of the window may be being changed asynchronously!  It
 *   may return the old size in this case.
 *
 * Input Parameters:
 *   hfwnd  - The handle returned by nxtk_openwindow
 *   bounds - User provided location in which to return the bounding box.
 *
 * Return:
 *   OK on success; ERROR on failure with errno set appropriately
 *
 ****************************************************************************/

int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds)
{
  FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd;

  DEBUGASSERT(hfwnd && bounds);

  /* Offset the rectangle by subtracting the current position of the window. */

  nxgl_rectoffset(bounds, &fwnd->tbrect,
                  -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
  return OK;
}


text:
package org.apereo.cas.authentication;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apereo.cas.services.MultifactorAuthenticationProvider;
import org.apereo.cas.services.RegisteredService;
import org.apereo.cas.services.RegisteredServiceMultifactorPolicy;
import org.apereo.cas.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.OrderComparator;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import lombok.Getter;

/**
 * The {@link DefaultAuthenticationContextValidator} is responsible for evaluating an authentication
 * object to see whether it satisfied a requested authentication context.
 *
 * @author Misagh Moayyed
 * @since 4.3
 */
@Slf4j
@Getter
public class DefaultAuthenticationContextValidator implements AuthenticationContextValidator {

    private final String authenticationContextAttribute;

    private final String globalFailureMode;

    private final String mfaTrustedAuthnAttributeName;

    @Autowired
    private ConfigurableApplicationContext applicationContext;

    public DefaultAuthenticationContextValidator(final String contextAttribute, final String failureMode, final String authnAttributeName) {
        this.authenticationContextAttribute = contextAttribute;
        this.globalFailureMode = failureMode;
        this.mfaTrustedAuthnAttributeName = authnAttributeName;
    }

    /**
     * {@inheritDoc}
     * If the authentication event is established as part trusted/device browser
     * such that MFA was skipped, allow for validation to execute successfully.
     * If authentication event did bypass MFA, let for allow for validation to execute successfully.
     *
     * @param authentication   the authentication
     * @param requestedContext the requested context
     * @param service          the service
     * @return true if the context can be successfully validated.
     */
    @Override
    public Pair<Boolean, Optional<MultifactorAuthenticationProvider>> validate(final Authentication authentication,
                                                                               final String requestedContext, final RegisteredService service) {
        final Map<String, Object> attrs = authentication.getAttributes();
        final Object ctxAttr = attrs.get(this.authenticationContextAttribute);
        final Collection<Object> contexts = CollectionUtils.toCollection(ctxAttr);
        LOGGER.debug("Attempting to match requested authentication context [{}] against [{}]", requestedContext, contexts);
        final Map<String, MultifactorAuthenticationProvider> providerMap =
            MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(this.applicationContext);
        if (providerMap == null) {
            LOGGER.debug("No multifactor authentication providers are configured");
            return Pair.of(Boolean.FALSE, Optional.empty());
        }
        final Optional<MultifactorAuthenticationProvider> requestedProvider = locateRequestedProvider(providerMap.values(), requestedContext);
        if (!requestedProvider.isPresent()) {
            LOGGER.debug("Requested authentication provider cannot be recognized.");
            return Pair.of(Boolean.FALSE, Optional.empty());
        }
        if (contexts.stream().filter(ctx -> ctx.toString().equals(requestedContext)).count() > 0) {
            LOGGER.debug("Requested authentication context [{}] is satisfied", requestedContext);
            return Pair.of(Boolean.TRUE, requestedProvider);
        }
        if (StringUtils.isNotBlank(this.mfaTrustedAuthnAttributeName) && attrs.containsKey(this.mfaTrustedAuthnAttributeName)) {
            LOGGER.debug("Requested authentication context [{}] is satisfied since device is already trusted", requestedContext);
            return Pair.of(Boolean.TRUE, requestedProvider);
        }
        if (attrs.containsKey(MultifactorAuthenticationProviderBypass.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA)
            && attrs.containsKey(MultifactorAuthenticationProviderBypass.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA_PROVIDER)) {
            final boolean isBypass = Boolean.class.cast(attrs.get(MultifactorAuthenticationProviderBypass.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA));
            final String bypassedId = attrs.get(MultifactorAuthenticationProviderBypass.AUTHENTICATION_ATTRIBUTE_BYPASS_MFA_PROVIDER).toString();
            LOGGER.debug("Found multifactor authentication bypass attributes for provider [{}]", bypassedId);
            if (isBypass && StringUtils.equals(bypassedId, requestedContext)) {
                LOGGER.debug("Requested authentication context [{}] is satisfied given mfa was bypassed for the authentication attempt", requestedContext);
                return Pair.of(Boolean.TRUE, requestedProvider);
            }
            LOGGER.debug("Either multifactor authentication was not bypassed or the requested context [{}] does not match the bypassed provider [{}]",
                requestedProvider, bypassedId);
        }
        final Collection<MultifactorAuthenticationProvider> satisfiedProviders = getSatisfiedAuthenticationProviders(authentication, providerMap.values());
        if (satisfiedProviders == null) {
            LOGGER.warn("No satisfied multifactor authentication providers are recorded in the current authentication context.");
            return Pair.of(Boolean.FALSE, requestedProvider);
        }
        if (!satisfiedProviders.isEmpty()) {
            final MultifactorAuthenticationProvider[] providers = satisfiedProviders.toArray(new MultifactorAuthenticationProvider[] {});
            OrderComparator.sortIfNecessary(providers);
            final Optional<MultifactorAuthenticationProvider> result = Arrays.stream(providers).filter(provider -> {
                final MultifactorAuthenticationProvider p = requestedProvider.get();
                return provider.equals(p) || provider.getOrder() >= p.getOrder();
            }).findFirst();
            if (result.isPresent()) {
                LOGGER.debug("Current provider [{}] already satisfies the authentication requirements of [{}]; proceed with flow normally.",
                    result.get(), requestedProvider);
                return Pair.of(Boolean.TRUE, requestedProvider);
            }
        }
        LOGGER.debug("No multifactor providers could be located to satisfy the requested context for [{}]", requestedProvider);
        final RegisteredServiceMultifactorPolicy.FailureModes mode = getMultifactorFailureModeForService(service);
        if (mode == RegisteredServiceMultifactorPolicy.FailureModes.PHANTOM) {
            if (!requestedProvider.get().isAvailable(service)) {
                LOGGER.debug("Service [{}] is configured to use a [{}] failure mode for multifactor authentication policy. "
                    + "Since provider [{}] is unavailable at the moment, CAS will knowingly allow [{}] as a satisfied criteria "
                    + "of the present authentication context", service.getServiceId(), mode, requestedProvider, requestedContext);
                return Pair.of(Boolean.TRUE, requestedProvider);
            }
        }
        if (mode == RegisteredServiceMultifactorPolicy.FailureModes.OPEN) {
            if (!requestedProvider.get().isAvailable(service)) {
                LOGGER.debug("Service [{}] is configured to use a [{}] failure mode for multifactor authentication policy and "
                    + "since provider [{}] is unavailable at the moment, CAS will consider the authentication satisfied "
                    + "without the presence of [{}]", service.getServiceId(), mode, requestedProvider, requestedContext);
                return Pair.of(Boolean.TRUE, satisfiedProviders.stream().findFirst());
            }
        }
        return Pair.of(Boolean.FALSE, requestedProvider);
    }

    private Collection<MultifactorAuthenticationProvider> getSatisfiedAuthenticationProviders(final Authentication authentication,
                                                                                final Collection<MultifactorAuthenticationProvider> providers) {
        final Collection<Object> contexts = CollectionUtils.toCollection(authentication.getAttributes().get(this.authenticationContextAttribute));
        if (contexts == null || contexts.isEmpty()) {
            LOGGER.debug("No authentication context could be determined based on authentication attribute [{}]", this.authenticationContextAttribute);
            return null;
        }
        contexts.stream().forEach(context -> providers.removeIf(provider -> !provider.getId().equals(context)));
        LOGGER.debug("Found [{}] providers that may satisfy the context", providers.size());
        return providers;
    }

    private static Optional<MultifactorAuthenticationProvider> locateRequestedProvider(
        final Collection<MultifactorAuthenticationProvider> providersArray, final String requestedProvider) {
        return providersArray.stream().filter(provider -> provider.getId().equals(requestedProvider)).findFirst();
    }

    private RegisteredServiceMultifactorPolicy.FailureModes getMultifactorFailureModeForService(final RegisteredService service) {
        final RegisteredServiceMultifactorPolicy policy = service.getMultifactorPolicy();
        if (policy == null || policy.getFailureMode() == null) {
            return RegisteredServiceMultifactorPolicy.FailureModes.valueOf(this.globalFailureMode);
        }
        return policy.getFailureMode();
    }
}


text:
package com.jpattern.service.log.event;

import com.jpattern.service.log.IExecutor;

/**
 *
 * @author Francesco Cina'
 *
 * 09/apr/2010
 */
public class TraceEvent extends AEvent {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	public static String EVENT_NAME = "TRACE";
	private IMessage message;

	public TraceEvent() {
		super( EVENT_NAME );
	}

	public void execute(IExecutor executor) {
		executor.execute(this);
	}

	public IMessage getMessage() {
		if (message == null) {
			return new NullMessage();
		}
		return message;
	}

	public synchronized void fireMessage(IMessage message) {
		if ( !isIgnoredPath( message.getClassName() ) ) {
			this.message = message;
			fire();
		}
	}

}


text:
One of the trickiest and most subtle aspects of regions is dealing
with higher-ranked things which include bound region variables, such
as function types. I strongly suggest that if you want to understand
the situation, you read this paper (which is, admittedly, very long,
but you don't have to read the whole thing):

http://research.microsoft.com/en-us/um/people/simonpj/papers/higher-rank/

Although my explanation will never compete with SPJ's (for one thing,
his is approximately 100 pages), I will attempt to explain the basic
problem and also how we solve it. Note that the paper only discusses
subtyping, not the computation of LUB/GLB.

The problem we are addressing is that there is a kind of subtyping
between functions with bound region parameters. Consider, for
example, whether the following relation holds:

    for<'a> fn(&'a isize) <: for<'b> fn(&'b isize)? (Yes, a => b)

The answer is that of course it does. These two types are basically
the same, except that in one we used the name `a` and one we used
the name `b`.

In the examples that follow, it becomes very important to know whether
a lifetime is bound in a function type (that is, is a lifetime
parameter) or appears free (is defined in some outer scope).
Therefore, from now on I will always write the bindings explicitly,
using the Rust syntax `for<'a> fn(&'a isize)` to indicate that `a` is a
lifetime parameter.

Now let's consider two more function types. Here, we assume that the
`'b` lifetime is defined somewhere outside and hence is not a lifetime
parameter bound by the function type (it "appears free"):

    for<'a> fn(&'a isize) <: fn(&'b isize)? (Yes, a => b)

This subtyping relation does in fact hold. To see why, you have to
consider what subtyping means. One way to look at `T1 <: T2` is to
say that it means that it is always ok to treat an instance of `T1` as
if it had the type `T2`. So, with our functions, it is always ok to
treat a function that can take pointers with any lifetime as if it
were a function that can only take a pointer with the specific
lifetime `'b`. After all, `'b` is a lifetime, after all, and
the function can take values of any lifetime.

You can also look at subtyping as the *is a* relationship. This amounts
to the same thing: a function that accepts pointers with any lifetime
*is a* function that accepts pointers with some specific lifetime.

So, what if we reverse the order of the two function types, like this:

    fn(&'b isize) <: for<'a> fn(&'a isize)? (No)

Does the subtyping relationship still hold?  The answer of course is
no. In this case, the function accepts *only the lifetime `'b`*,
so it is not reasonable to treat it as if it were a function that
accepted any lifetime.

What about these two examples:

    for<'a,'b> fn(&'a isize, &'b isize) <: for<'a>    fn(&'a isize, &'a isize)? (Yes)
    for<'a>    fn(&'a isize, &'a isize) <: for<'a,'b> fn(&'a isize, &'b isize)? (No)

Here, it is true that functions which take two pointers with any two
lifetimes can be treated as if they only accepted two pointers with
the same lifetime, but not the reverse.

## The algorithm

Here is the algorithm we use to perform the subtyping check:

1. Replace all bound regions in the subtype with new variables
2. Replace all bound regions in the supertype with placeholder
   equivalents. A "placeholder" region is just a new fresh region
   name.
3. Check that the parameter and return types match as normal
4. Ensure that no placeholder regions 'leak' into region variables
   visible from "the outside"

Let's walk through some examples and see how this algorithm plays out.

#### First example

We'll start with the first example, which was:

    1. for<'a> fn(&'a T) <: for<'b> fn(&'b T)?        Yes: a -> b

After steps 1 and 2 of the algorithm we will have replaced the types
like so:

    1. fn(&'A T) <: fn(&'x T)?

Here the upper case `&A` indicates a *region variable*, that is, a
region whose value is being inferred by the system. I also replaced
`&b` with `&x`---I'll use letters late in the alphabet (`x`, `y`, `z`)
to indicate placeholder region names. We can assume they don't appear
elsewhere. Note that neither the sub- nor the supertype bind any
region names anymore (as indicated by the absence of `<` and `>`).

The next step is to check that the parameter types match. Because
parameters are contravariant, this means that we check whether:

    &'x T <: &'A T

Region pointers are contravariant so this implies that

    &A <= &x

must hold, where `<=` is the subregion relationship. Processing
*this* constrain simply adds a constraint into our graph that `&A <=
&x` and is considered successful (it can, for example, be satisfied by
choosing the value `&x` for `&A`).

So far we have encountered no error, so the subtype check succeeds.

#### The third example

Now let's look first at the third example, which was:

    3. fn(&'a T)    <: for<'b> fn(&'b T)?        No!

After steps 1 and 2 of the algorithm we will have replaced the types
like so:

    3. fn(&'a T) <: fn(&'x T)?

This looks pretty much the same as before, except that on the LHS
`'a` was not bound, and hence was left as-is and not replaced with
a variable. The next step is again to check that the parameter types
match. This will ultimately require (as before) that `'a` <= `&x`
must hold: but this does not hold. `self` and `x` are both distinct
free regions. So the subtype check fails.

#### Checking for placeholder leaks

You may be wondering about that mysterious last step in the algorithm.
So far it has not been relevant. The purpose of that last step is to
catch something like *this*:

    for<'a> fn() -> fn(&'a T) <: fn() -> for<'b> fn(&'b T)?   No.

Here the function types are the same but for where the binding occurs.
The subtype returns a function that expects a value in precisely one
region. The supertype returns a function that expects a value in any
region. If we allow an instance of the subtype to be used where the
supertype is expected, then, someone could call the fn and think that
the return value has type `fn<b>(&'b T)` when it really has type
`fn(&'a T)` (this is case #3, above). Bad.

So let's step through what happens when we perform this subtype check.
We first replace the bound regions in the subtype (the supertype has
no bound regions). This gives us:

    fn() -> fn(&'A T) <: fn() -> for<'b> fn(&'b T)?

Now we compare the return types, which are covariant, and hence we have:

    fn(&'A T) <: for<'b> fn(&'b T)?

Here we replace the bound region in the supertype with a placeholder to yield:

    fn(&'A T) <: fn(&'x T)?

And then proceed to compare the argument types:

    &'x T <: &'A T
    'A <= 'x

Finally, this is where it gets interesting!  This is where an error
*should* be reported. But in fact this will not happen. The reason why
is that `A` is a variable: we will infer that its value is the fresh
region `x` and think that everything is happy. In fact, this behavior
is *necessary*, it was key to the first example we walked through.

The difference between this example and the first one is that the variable
`A` already existed at the point where the placeholders were added. In
the first example, you had two functions:

    for<'a> fn(&'a T) <: for<'b> fn(&'b T)

and hence `&A` and `&x` were created "together". In general, the
intention of the placeholder names is that they are supposed to be
fresh names that could never be equal to anything from the outside.
But when inference comes into play, we might not be respecting this
rule.

So the way we solve this is to add a fourth step that examines the
constraints that refer to placeholder names. Basically, consider a
non-directed version of the constraint graph. Let `Tainted(x)` be the
set of all things reachable from a placeholder variable `x`.
`Tainted(x)` should not contain any regions that existed before the
step at which the placeholders were created. So this case here
would fail because `&x` was created alone, but is relatable to `&A`.

## Computing the LUB and GLB

The paper I pointed you at is written for Haskell. It does not
therefore considering subtyping and in particular does not consider
LUB or GLB computation. We have to consider this. Here is the
algorithm I implemented.

First though, let's discuss what we are trying to compute in more
detail. The LUB is basically the "common supertype" and the GLB is
"common subtype"; one catch is that the LUB should be the
*most-specific* common supertype and the GLB should be *most general*
common subtype (as opposed to any common supertype or any common
subtype).

Anyway, to help clarify, here is a table containing some function
pairs and their LUB/GLB (for conciseness, in this table, I'm just
including the lifetimes here, not the rest of the types, and I'm
writing `fn<>` instead of `for<> fn`):

```
Type 1                Type 2                LUB                    GLB
fn<'a>('a)            fn('X)                fn('X)                 fn<'a>('a)
fn('a)                fn('X)                --                     fn<'a>('a)
fn<'a,'b>('a, 'b)     fn<'x>('x, 'x)        fn<'a>('a, 'a)         fn<'a,'b>('a, 'b)
fn<'a,'b>('a, 'b, 'a) fn<'x,'y>('x, 'y, 'y) fn<'a>('a, 'a, 'a)     fn<'a,'b,'c>('a,'b,'c)
```

### Conventions

I use lower-case letters (e.g., `&a`) for bound regions and upper-case
letters for free regions (`&A`).  Region variables written with a
dollar-sign (e.g., `$a`).  I will try to remember to enumerate the
bound-regions on the fn type as well (e.g., `for<'a> fn(&a)`).

### High-level summary

Both the LUB and the GLB algorithms work in a similar fashion.  They
begin by replacing all bound regions (on both sides) with fresh region
inference variables.  Therefore, both functions are converted to types
that contain only free regions.  We can then compute the LUB/GLB in a
straightforward way, as described in `combine.rs`.  This results in an
interim type T.  The algorithms then examine the regions that appear
in T and try to, in some cases, replace them with bound regions to
yield the final result.

To decide whether to replace a region `R` that appears in `T` with
a bound region, the algorithms make use of two bits of
information.  First is a set `V` that contains all region
variables created as part of the LUB/GLB computation (roughly; see
`region_vars_confined_to_snapshot()` for full details). `V` will
contain the region variables created to replace the bound regions
in the input types, but it also contains 'intermediate' variables
created to represent the LUB/GLB of individual regions.
Basically, when asked to compute the LUB/GLB of a region variable
with another region, the inferencer cannot oblige immediately
since the values of that variables are not known.  Therefore, it
creates a new variable that is related to the two regions.  For
example, the LUB of two variables `$x` and `$y` is a fresh
variable `$z` that is constrained such that `$x <= $z` and `$y <=
$z`.  So `V` will contain these intermediate variables as well.

The other important factor in deciding how to replace a region in T is
the function `Tainted($r)` which, for a region variable, identifies
all regions that the region variable is related to in some way
(`Tainted()` made an appearance in the subtype computation as well).

### LUB

The LUB algorithm proceeds in three steps:

1. Replace all bound regions (on both sides) with fresh region
   inference variables.
2. Compute the LUB "as normal", meaning compute the GLB of each
   pair of argument types and the LUB of the return types and
   so forth.  Combine those to a new function type `F`.
3. Replace each region `R` that appears in `F` as follows:
   - Let `V` be the set of variables created during the LUB
     computational steps 1 and 2, as described in the previous section.
   - If `R` is not in `V`, replace `R` with itself.
   - If `Tainted(R)` contains a region that is not in `V`,
     replace `R` with itself.
   - Otherwise, select the earliest variable in `Tainted(R)` that originates
     from the left-hand side and replace `R` with the bound region that
     this variable was a replacement for.

So, let's work through the simplest example: `fn(&A)` and `for<'a> fn(&a)`.
In this case, `&a` will be replaced with `$a` and the interim LUB type
`fn($b)` will be computed, where `$b=GLB(&A,$a)`.  Therefore, `V =
{$a, $b}` and `Tainted($b) = { $b, $a, &A }`.  When we go to replace
`$b`, we find that since `&A \in Tainted($b)` is not a member of `V`,
we leave `$b` as is.  When region inference happens, `$b` will be
resolved to `&A`, as we wanted.

Let's look at a more complex one: `fn(&a, &b)` and `fn(&x, &x)`.  In
this case, we'll end up with a (pre-replacement) LUB type of `fn(&g,
&h)` and a graph that looks like:

```
     $a        $b     *--$x
       \        \    /  /
        \        $h-*  /
         $g-----------*
```

Here `$g` and `$h` are fresh variables that are created to represent
the LUB/GLB of things requiring inference.  This means that `V` and
`Tainted` will look like:

```
V = {$a, $b, $g, $h, $x}
Tainted($g) = Tainted($h) = { $a, $b, $h, $g, $x }
```

Therefore we replace both `$g` and `$h` with `$a`, and end up
with the type `fn(&a, &a)`.

### GLB

The procedure for computing the GLB is similar.  The difference lies
in computing the replacements for the various variables. For each
region `R` that appears in the type `F`, we again compute `Tainted(R)`
and examine the results:

1. If `R` is not in `V`, it is not replaced.
2. Else, if `Tainted(R)` contains only variables in `V`, and it
   contains exactly one variable from the LHS and one variable from
   the RHS, then `R` can be mapped to the bound version of the
   variable from the LHS.
3. Else, if `Tainted(R)` contains no variable from the LHS and no
   variable from the RHS, then `R` can be mapped to itself.
4. Else, `R` is mapped to a fresh bound variable.

These rules are pretty complex.  Let's look at some examples to see
how they play out.

Out first example was `fn(&a)` and `fn(&X)`.  In this case, `&a` will
be replaced with `$a` and we will ultimately compute a
(pre-replacement) GLB type of `fn($g)` where `$g=LUB($a,&X)`.
Therefore, `V={$a,$g}` and `Tainted($g)={$g,$a,&X}.  To find the
replacement for `$g` we consult the rules above:
- Rule (1) does not apply because `$g \in V`
- Rule (2) does not apply because `&X \in Tainted($g)`
- Rule (3) does not apply because `$a \in Tainted($g)`
- Hence, by rule (4), we replace `$g` with a fresh bound variable `&z`.
So our final result is `fn(&z)`, which is correct.

The next example is `fn(&A)` and `fn(&Z)`. In this case, we will again
have a (pre-replacement) GLB of `fn(&g)`, where `$g = LUB(&A,&Z)`.
Therefore, `V={$g}` and `Tainted($g) = {$g, &A, &Z}`.  In this case,
by rule (3), `$g` is mapped to itself, and hence the result is
`fn($g)`.  This result is correct (in this case, at least), but it is
indicative of a case that *can* lead us into concluding that there is
no GLB when in fact a GLB does exist.  See the section "Questionable
Results" below for more details.

The next example is `fn(&a, &b)` and `fn(&c, &c)`. In this case, as
before, we'll end up with `F=fn($g, $h)` where `Tainted($g) =
Tainted($h) = {$g, $h, $a, $b, $c}`.  Only rule (4) applies and hence
we'll select fresh bound variables `y` and `z` and wind up with
`fn(&y, &z)`.

For the last example, let's consider what may seem trivial, but is
not: `fn(&a, &a)` and `fn(&b, &b)`.  In this case, we'll get `F=fn($g,
$h)` where `Tainted($g) = {$g, $a, $x}` and `Tainted($h) = {$h, $a,
$x}`.  Both of these sets contain exactly one bound variable from each
side, so we'll map them both to `&a`, resulting in `fn(&a, &a)`, which
is the desired result.

### Shortcomings and correctness

You may be wondering whether this algorithm is correct.  The answer is
"sort of".  There are definitely cases where they fail to compute a
result even though a correct result exists.  I believe, though, that
if they succeed, then the result is valid, and I will attempt to
convince you.  The basic argument is that the "pre-replacement" step
computes a set of constraints.  The replacements, then, attempt to
satisfy those constraints, using bound identifiers where needed.

For now I will briefly go over the cases for LUB/GLB and identify
their intent:

- LUB:
  - The region variables that are substituted in place of bound regions
    are intended to collect constraints on those bound regions.
  - If Tainted(R) contains only values in V, then this region is unconstrained
    and can therefore be generalized, otherwise it cannot.
- GLB:
  - The region variables that are substituted in place of bound regions
    are intended to collect constraints on those bound regions.
  - If Tainted(R) contains exactly one variable from each side, and
    only variables in V, that indicates that those two bound regions
    must be equated.
  - Otherwise, if Tainted(R) references any variables from left or right
    side, then it is trying to combine a bound region with a free one or
    multiple bound regions, so we need to select fresh bound regions.

Sorry this is more of a shorthand to myself.  I will try to write up something
more convincing in the future.

#### Where are the algorithms wrong?

- The pre-replacement computation can fail even though using a
  bound-region would have succeeded.
- We will compute GLB(fn(fn($a)), fn(fn($b))) as fn($c) where $c is the
  GLB of $a and $b.  But if inference finds that $a and $b must be mapped
  to regions without a GLB, then this is effectively a failure to compute
  the GLB.  However, the result `fn<$c>(fn($c))` is a valid GLB.


text:
app.controller('MallCtrl', function($scope, $http) {
//	$http.get('/reception/goods/consumer/list').success(function(response){
//		if(response.status == 1){
//			$scope.goodsList = response.contents.goodsList
//		}
//		$scope.coverList = new Array();
//		for(item in response.contents.goodsList) {
//			var id = response.contents.goodsList[item].goodsId;
//			console.log(JSON.stringify(response.contents.goodsList));
//			var url = "/reception/goods/" + id + "/cover";
//			$http.get(url).success(function(response){
//				if(response.status == 1) {
//					$scope.coverList.push("http://commander.qingair.net/reception" + response.contents.cover.path);
//				}else {
//					$scope.coverList.push("http://www.runoob.com/try/demo_source/41D5vU4I1NL.jpg");
//				}
//			});
//		}
//	});
//	$scope.goodsDetail = function(){alert('aaa')}
//	window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx67fcdc4fa58f7578&redirect_uri=https%3A%2F%2Fwww.yuncaogangmu.com%2Fcommodity%2Fviewlist&response_type=code&scope=snsapi_base&state=view#wechat_redirect'
	$scope.linkCopy= function(){
		$("#shop_link").focus();
		$("#shop_link").select();
	}
})


text:
class SiteStates(object):
    PUBLISHED = 0
    INVALIDATED = 1
    UNPUBLISHED = 2
    ARCHIVED = 3


text:
require 'rails_helper'

describe 'budget edit' do

  before do
    @user = FactoryGirl.create(:user)
    @budget = FactoryGirl.create(:budget, user: @user)

  end

  it 'allows users to edit budget details' do
    login_as(@user, :scope => :user)
    visit edit_budget_path(@budget)

    expect(page).to have_field("Name", with: "My Budget")
    expect(page).to have_field("budget[categories_attributes][0][title]", with: "Food")

    fill_in "Name", with: ""
    fill_in "budget[categories_attributes][0][title]", with: ""
    fill_in "budget[categories_attributes][1][title]", with: "Labor"
    click_button "Update Budget"

    expect(page).to have_content("Please enter valid information.")
    expect(page).to have_content("Name can't be blank")
    expect(page).to have_field("budget[categories_attributes][0][title]", with: "Food")
    expect(page).to have_field("budget[categories_attributes][1][title]", with: "Labor")

    fill_in "Name", with: "House Construction Project"
    fill_in "budget[categories_attributes][0][title]", with: "Materials"
    fill_in "budget[categories_attributes][1][title]", with: "Labor"

    click_button "Update Budget"
    expect(page).to have_content("House Construction Project")
    expect(Budget.last.categories.count).to eq(2)
    expect(page).to_not have_content("Please enter valid information.")
  end

  it 'does not allow users to edit budgets that do not belong to them' do
    other_user = FactoryGirl.create(:user, email: "otheruser@user.com")
    login_as(other_user, :scope => :user)
    visit edit_budget_path(@budget)

    expect(page).to have_content("You don't have access to that budget.")
  end

end


text:
// Header for CMailboxInfoTable class

#ifndef __CMAILBOXINFOTABLE__MULBERRY__
#define __CMAILBOXINFOTABLE__MULBERRY__

#include "CMailboxTable.h"

#include "CMatchItem.h"

// Panes

// Messages

// Resources
const	ResIDT		RidL_CMailboxBtns = 1000;

// Classes
class CMailboxInfoView;
class CMbox;
class CMessage;
class CDragIt;

class CMailboxInfoTable : public CMailboxTable
{
	friend class CMailboxInfoWindow;
	friend class CMailboxInfoView;

public:
	enum { class_ID = 'MbLi' };

	enum
	{
		eSelectBy_Seen = 1,
		eSelectBy_Unseen,
		eSelectBy_Important,
		eSelectBy_Unimportant,
		eSelectBy_Answered,
		eSelectBy_Unanswered,
		eSelectBy_Deleted,
		eSelectBy_Undeleted,
		eSelectBy_Draft,
		eSelectBy_NotDraft,
		eSelectBy_Separator1,
		eSelectBy_Match,
		eSelectBy_NonMatch,
		eSelectBy_Separator2,
		eSelectBy_Label1,
		eSelectBy_Label2,
		eSelectBy_Label3,
		eSelectBy_Label4,
		eSelectBy_Label5,
		eSelectBy_Label6,
		eSelectBy_Label7,
		eSelectBy_Label8
	};

					CMailboxInfoTable();
					CMailboxInfoTable(LStream *inStream);
	virtual 		~CMailboxInfoTable();

private:
			void	InitInfoTable(void);					// Do common init

protected:
	CMailboxInfoView*	mInfoTableView;						// Owning view
	CMatchItem			mMatch;								// Matching for this pane
	bool				mSearchResults;						// Displaying search results
	unsigned long		mLastTyping;						// Time of last typed character
	char				mLastChar;							// Last characters typed

	virtual void	FinishCreateSelf(void);					// Get details of sub-panes
public:
	virtual Boolean		HandleKeyPress(const EventRecord &inKeyEvent);
	virtual Boolean		ObeyCommand(CommandT inCommand, void *ioParam = nil);
	virtual void		FindCommandStatus(CommandT inCommand,
											Boolean &outEnabled,
											Boolean &outUsesMark,
											UInt16 &outMark,
											Str255 outName);

	virtual	void	GetTooltipText(cdstring& txt, const STableCell &inCell);				// Get text for current tooltip cell

protected:
	virtual void	DoSingleClick(unsigned long row, unsigned long col, const CKeyModifiers& mods);					// Single click on a message

	void	DoNewLetter(bool option_key);				// Display a new draft

	void	SelectClearMessages(void);					// Select messages marked to be cleared (seen but not deleted)
	void	SelectByRow(const ulvector& rows);			// Select all messages in specified rows
	void	SelectNextNew(bool shift = true);			// Select next new message
	void	DoRollover(bool ask = true);				// Rollover to next recent
	void	CycleTabs(bool forward);					// Cycle to next/previous tab

	void	OnFileClose();								// Close it
	bool	CanFileClose() const;						// Should File:Close be active

	void	OnMailboxProperties(void);					// Properties of mailbox

	void	OnMailboxPunt(void);						// Punt unseen in mailbox

	void	OnMailboxSynchronise();						// Synchronise
	void	OnMailboxClearDisconnect();					// Clear disconnected cache

	void	OnMailboxSubscribe(void);					// Subscribe to mailbox
	void	OnMailboxUnsubscribe(void);					// Unsubscribe from mailbox

	void	OnMailboxCheck(void);						// Check for new mail

	void	OnMailboxGotoMessage();						// Select a specific message
	void	OnMailboxCacheAll();						// Cache all messages in mailbox
	void	OnMailboxUpdateMatch();						// Update current match state

	void	OnSearchMailbox();							// Do mailbox search
	void	OnSearchAgainMailbox();						// Do mailbox search again
	void	OnNextSearchMailbox();						// Recycle to next search mbox

	void	DoApplyRuleMailbox(long index);					// Apply rules
	void	OnApplyRuleMailboxToolbar(const char* name);	// Apply rules toolbar item
	void	OnMakeRuleMailbox();							// Make rule

	void	FindFlagCommandStatus(Boolean &outEnabled,
									Boolean &outUsesMark,
									UInt16 &outMark,
									NMessage::EFlags flag);

	void	DoMessageReply(EReplyTo reply_to,
									bool option_key);			// Reply to selected messages
	bool	ReplyMessage(TableIndexT row,
									EReplyTo* reply_to,
									bool* option_key);			// Reply to specified message

	void	DoMessageForward(bool option_key);			// Forward selected messages
	bool	ForwardMessage(TableIndexT row,				// Forward specified message
							bool* option_key);

	void	OnMessageBounce(void);						// Bounce selected messages
	bool	BounceMessage(TableIndexT row);				// Bounce specified message

	void	OnMessageReject(void);						// Reject selected messages
	bool	RejectMessage(TableIndexT row);				// Reject specified message

	void	OnMessageSendAgain(void);					// Send again selected messages
	bool	SendAgainMessage(TableIndexT row);			// Send again specified message

	void	OnMessageCreateDigest(void);				// Digest selected messages

	void	ResetSearch();								// Reset search UI items from mailbox
	void	OnMatchButton(bool option_key);				// Change match mode
	void	SetMatch(NMbox::EViewMode mbox_mode,		// Set match mode and criteria
						CSearchItem* spec,
						bool is_search,
						bool force_automatch = false);

	void	SetCurrentMatch(const CMatchItem& match)
		{ mMatch = match; }
	CMatchItem	GetCurrentMatch() const
		{ return mMatch; }

	void	OnSelectPopup(long select);						// Change view selection

	void	OnThreadSelectAll();
	void	OnThreadMarkSeen();
	void	OnThreadMarkImportant();
	void	OnThreadMarkDeleted();
	void	DoThreadFlag(NMessage::EFlags flag);
	void	OnThreadSkip();

	void	OnMatchUnseen();
	void	OnMatchImportant();
	void	OnMatchDeleted();
	void	OnMatchSentToday();
	void	OnMatchFrom();
	void	OnMatchSubject();
	void	OnMatchDate();
	void	DoMatch(const CMatchItem& match);

	virtual void		ResizeFrameBy(
								SInt16		inWidthDelta,
								SInt16		inHeightDelta,
								Boolean		inRefresh);

public:
	virtual	void	InitPos(void);								// Set initial position

	virtual void	Refresh();								// Update button & captions as well
	virtual void	RefreshSelection();						// Update button & captions as well
	virtual void	RefreshRow(const TableIndexT aRow);		// Update button & captions as well

	virtual void	DoSelectionChanged(void);

protected:
	virtual void	UpdateItems(void);							// Update after possible change

	void	UpdateState(void);						// Update buttons
	void	UpdateCaptions(void);					// Update number captions
	void	UpdateCacheIncrement();					// Update cache increment

// Drag methods
	virtual Boolean	ItemIsAcceptable(DragReference inDragRef,
								ItemReference inItemRef);				// Check its suitable
};

#endif


text:
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd "$SCRIPT_DIR"

which wstest
if [ $? != 0 ]; then
  echo "Run 'pip install autobahntestsuite', maybe with 'sudo'."
  exit 1
fi
which jq
if [ $? != 0 ]; then
  echo "Run 'brew install jq'"
  exit 1
fi

trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT

set -ex

wstest -m fuzzingserver -s fuzzingserver-config.json &
sleep 2 # wait for wstest to start

java -jar target/okhttp-ws-tests-*-jar-with-dependencies.jar

jq '.[] as $in | $in | keys[] | . + " " + $in[.].behavior' target/fuzzingserver-report/index.json > target/fuzzingserver-actual.txt

diff fuzzingserver-expected.txt target/fuzzingserver-actual.txt


text:
package model.facebook

import com.byteslounge.slickrepo.meta.Entity

case class FacebookAuth(id: Option[String], displayName: String, userId: Int) extends Entity[FacebookAuth, String] {

  override def withId(id: String): FacebookAuth = this.copy(id = Some(id))
}


text:
package com.tpb.hn.data;

import android.support.annotation.NonNull;

import com.tpb.hn.helpers.Formatter;
import com.tpb.hn.helpers.Util;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;

/**
 * Created by theo on 25/11/16.
 */

public class Item implements Comparable<Item> {
    private static final String TAG = Item.class.getSimpleName();

    private int id;
    private String by;
    private int parent;
    private int score;
    private boolean deleted;
    private long time;
    private String title;
    private String text;
    private boolean dead;
    private int[] kids;
    private String url;
    private int[] parts;
    private int descendants;
    private boolean isComment;
    private boolean isSaved;

    private boolean viewed;
    private boolean isNew;
    private String parsedText;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public String getBy() {
        return by;
    }

    public void setBy(String by) {
        this.by = by;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public boolean isDead() {
        return dead;
    }

    public void setDead(boolean dead) {
        this.dead = dead;
    }

    public int getParent() {
        return parent;
    }

    public void setParent(int parent) {
        this.parent = parent;
    }

    public int[] getKids() {
        return kids;
    }

    public void setKids(int[] kids) {
        this.kids = kids;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int[] getParts() {
        return parts;
    }

    public void setParts(int[] parts) {
        this.parts = parts;
    }

    public int getDescendants() {
        return descendants;
    }

    public void setDescendants(int descendants) {
        this.descendants = descendants;
    }

    public boolean isViewed() {
        return viewed;
    }

    public void setViewed(boolean viewed) {
        this.viewed = viewed;
    }

    public boolean isNew() {
        return isNew;
    }

    public void setNew(boolean aNew) {
        isNew = aNew;
    }

    public String getParsedText() {
        return parsedText;
    }

    public void setParsedText(String parsedText) {
        this.parsedText = parsedText;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isComment() {
        return isComment;
    }

    public void setComment(boolean comment) {
        isComment = comment;
    }

    public boolean isSaved() {
        return isSaved;
    }

    public void setSaved(boolean saved) {
        isSaved = saved;
    }

    public String getFormattedURL() {
        try {
            return "(" + new URL(url).getHost() + ")";
        } catch(MalformedURLException mue) {
            return "";
        }
    }

    public String getInfo() {
        String info = score + Util.pluralise(" point", score) + " | ";
        if(descendants > 0) {
            info += descendants + Util.pluralise(" comment", descendants) + " | ";
        }
        return info + Formatter.timeAgo(time);
    }

    public String getFormattedBy() {
        return "By " + by;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Item) {
            final Item i = (Item) obj;
            return id == i.id &&
                    (text != null && i.text != null && text.equals(i.text)) &&
                    (kids != null && i.kids != null && kids.length == i.kids.length) &&
                    score == i.score &&
                    (parts != null && i.parts != null && parts.length == i.parts.length) &&
                    descendants == i.descendants &&
                    deleted == i.deleted;
        }
        return false;
    }

    @Override
    public String toString() {
        return "Item{" +
                "id=" + id +
                ", deleted=" + deleted +
                ", by='" + by + '\'' +
                ", time=" + time +
                ", title='" + title + '\'' +
                ", text='" + text + '\'' +
                ", dead=" + dead +
                ", parent=" + parent +
                ", kids=" + Arrays.toString(kids) +
                ", url='" + url + '\'' +
                ", score=" + score +
                ", parts=" + Arrays.toString(parts) +
                ", descendants=" + descendants +
                ", viewed=" + viewed +
                ", isNew=" + isNew +
                ", parsedText=" + parsedText +
                '}';
    }

    @Override
    public int compareTo(@NonNull Item item) {
        return time > item.time ? 1 : 0;
    }
}


text:
package org.springframework.security.authentication.token;

import org.springframework.security.authentication.ApiAuthenticationToken;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;

import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

/**
 * A service managing access tokens {@link ApiAuthenticationToken}. It provides facilities
 * to generate, extract, store and remove access tokens.
 *
 * @author maamria
 *         <p>
 *         13/10/15.
 */
public interface TokenService {

    /**
     * Generates an {@link ApiAuthenticationToken} for the principal.
     * @param principal principal, not null
     * @param expiration expiry
     * @return token
     */
    ApiAuthenticationToken generateAccessToken(UserDetails principal, int expiration);

    /**
     * Extracts an {@link ApiAuthenticationToken} from the request.
     * @param request request, not null
     * @return access token, can be null if a token could not be extracted for whatever reason
     */
    ApiAuthenticationToken extractAccessToken(HttpServletRequest request);

    /**
     * Loads a {@link UserDetails} corresponding to the access token.
     * @param tokenValue access token, not null
     * @return corresponding {@link UserDetails}
     * @throws TokenNotFoundException if token not found
     */
    UserDetails loadUserByToken(String tokenValue) throws TokenNotFoundException;

    /**
     * Stores the token for the given principal.
     * @param tokenValue access token, not null
     * @param principal principal, not null
     */
    void storeToken(String tokenValue, UserDetails principal);

    /**
     * Removes the token.
     * @param tokenValue access token, not null
     * @throws TokenNotFoundException if the token cannot be found
     */
    void removeToken(String tokenValue) throws TokenNotFoundException;

    /**
     * Renders token, and writes it to the response. This should strive to adhere to content negotation.
     * @param response response
     * @param apiAuthenticationToken token
     */
    void renderToken(ServletResponse response, ApiAuthenticationToken apiAuthenticationToken) throws AuthenticationException;
}


text:
function program()
  solveHeatEquation(.01,500);
end


text:
package org.protempa.backend.ksb.protege;

import edu.stanford.smi.protege.model.Instance;
import org.protempa.KnowledgeSourceReadException;
import org.protempa.PropositionDefinition;
import org.protempa.backend.ksb.KnowledgeSourceBackend;

/**
 * @author Andrew Post
 */
interface PropositionConverter {

    /**
     * Convert and add the given Protege parameter instance to the given
     * PROTEMPA knowledge base, if it hasn't already been added to the PROTEMPA
     * knowledge base.
     *
     * @param protegeProposition
     *            the Protege proposition {@link Instance}.
     * @param backend
     *            the Protege {@link KnowledgeSourceBackend}.
     * @throws KnowledgeSourceReadException if an error occurred reading the
     * Protege knowledge base.
     */
    PropositionDefinition convert(Instance protegeProposition,
            ProtegeKnowledgeSourceBackend backend)
            throws KnowledgeSourceReadException;

    String getClsName();
}


text:
/// <reference path='types/gruntjs/gruntjs.d.ts' />
var getData = require('./test/dynamic-one-data');

function setupGrunt(grunt) {
    grunt.initConfig({
        pkg: 'package.json',
        'script-template': {
            'static-array-test': {
                src: 'test/static-array-template.ts',
                dest: 'temp/static-array.ts',
                data: ['One', 'Two', 'Three']
            },
            'static-object-test': {
                src: 'test/static-object-template.ts',
                dest: 'temp/static-object.ts',
                data: { title: 'Static Object Title', values: ['a', 'b', 'c'] }
            },
            'dynamic-one-test': {
                src: 'test/dynamic-one-template.ts',
                dest: 'temp/dynamic-one.ts',
                data: getData
            }
        },
        clean: {
            tests: ['temp']
        },
        'jasmine_node': {
            'tests': ['test/']
        }
    });

    grunt.loadTasks('tasks');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-jasmine-node');

    grunt.registerTask('default', ['clean', 'script-template', 'jasmine_node']);
}

module.exports = setupGrunt;
//# sourceMappingURL=Gruntfile.js.map


text:
#include "Creature.h"
#include <DPE/ResourceManager.h>

#include <random>
#include <ctime>

Creature::Creature()
{

}

Creature::~Creature()
{
}

void Creature::update(CreatureState turnState,
	const float & progressThroughTurn,
	const int & turnsSinceStart,
	const std::vector<std::vector<int>>& map,
	std::vector<std::vector<int>>& entMap,
	std::vector<BadGuy*>& badGuys,
	Player & player)
{
	if (turnState == CreatureState::IDLE) {
		//idle animation
		onIdle(progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
	}
	else {
		if (Random::equals(progressThroughTurn, 0.0) && turnsSinceStart == 0)
			onBeginSequence(progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
		if (Random::equals(progressThroughTurn, 0.0))
			onBeginTurn(progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
		performTurn(turnState, progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
	}
}

void Creature::performTurn(CreatureState turnState,
	const float& progressThroughTurn,
	const int& turnsSinceStart,
	const std::vector<std::vector<int>>& map,
	std::vector<std::vector<int>>& entMap,
	std::vector<BadGuy*>& badGuys,
	Player& player)
{
	if(turnState == CreatureState::WAITING) {
		//wait
	}
	else if (turnState == CreatureState::FIGHTING) {
		onAttack(progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
	}
	else if (turnState == CreatureState::MOVING) {
		onMove(progressThroughTurn, turnsSinceStart, map, entMap, badGuys, player);
	}
}

void Creature::onMove(const float & progressThroughTurn, const int & turnsSinceStart, const std::vector<std::vector<int>>& map, std::vector<std::vector<int>>& entMap, std::vector<BadGuy*>& badGuys, Player & player)
{
	Node nodeOne = m_path[turnsSinceStart];
	if (turnsSinceStart + 1 == m_path.size())
		return;
	Node nodeTwo = m_path[turnsSinceStart];
	moveTowardsTile(nodeOne.getPosition(), nodeTwo.getPosition(), map, entMap, progressThroughTurn);
}

void Creature::setTarget(const std::vector<std::vector<int>>& map, std::vector<std::vector<int>>& entMap, glm::vec2 target)
{
	glm::vec2 startTile = m_position;
	startTile.x = (startTile.x - TILE_SIZE / 2.0f)/TILE_SIZE;
	startTile.y = (startTile.y - TILE_SIZE / 2.0f)/TILE_SIZE;

	glm::vec2 targetPosition;
	targetPosition.x = (target.x - TILE_SIZE / 2.0f) / TILE_SIZE;
	targetPosition.y = (target.y - TILE_SIZE / 2.0f) / TILE_SIZE;

	m_path = m_pathFinder.pathBetweenPoints(startTile, targetPosition, map);
}

void Creature::moveTowardsTile(const glm::vec2 & nodePosOne, const glm::vec2 & nodePosTwo, const std::vector<std::vector<int>>& map, std::vector<std::vector<int>>& entmap, int fractionBetweenTwo)
{
	glm::vec2 startPos = nodePosOne;
	startPos.x = startPos.x*TILE_SIZE+TILE_SIZE/2.0f;
	startPos.y = startPos.x*TILE_SIZE+TILE_SIZE / 2.0f;

	glm::vec2 endPos = nodePosTwo;
	endPos.x = endPos.x*TILE_SIZE + TILE_SIZE / 2.0f;
	endPos.y = endPos.x*TILE_SIZE + TILE_SIZE / 2.0f;

	m_position.x = (endPos.x - startPos.x)*fractionBetweenTwo + startPos.x;
	m_position.y = (endPos.y - startPos.y)*fractionBetweenTwo + startPos.y;
}

void Creature::draw(DPE::SpriteBatch & m_spriteBatch)
{
	glm::vec4 uvRect = m_tileSheet.getUVs(m_animTile);

	if (m_direction == 2) {
		uvRect.x += 1.0f / m_tileSheet.dims.x;
		uvRect.z *= -1;
	}

	m_spriteBatch.draw(glm::vec4(m_position.x-TILE_SIZE/2.0f, m_position.y - TILE_SIZE / 2.0f, TILE_SIZE, TILE_SIZE), uvRect, m_tileSheet.texture.id, 0.0f, DPE::ColorRGBA8(255, 255, 255, 255));
}

void Creature::applyDamage(const int & damage)
{
	//that's a lot of damage
	m_health -= damage;

	//check if over max health
	if (m_health > m_maxHealth)
		m_health = m_maxHealth;
}

/*bool Creature::moveToNextTile(std::vector<Node>& path, const std::vector<std::vector<int>>& map, std::vector<std::vector<int>>& entmap, float deltaTime)
{	/*
	//increment animTime
	m_animTime += deltaTime;

	//the position prior to the move
	glm::vec2 calcPos;

	if (floor(m_animTime) < path.size()) {
		calcPos.x = path[floor(m_animTime)].getPosition().x * TILE_SIZE + TILE_SIZE / 2;
		calcPos.y = path[floor(m_animTime)].getPosition().y * TILE_SIZE + TILE_SIZE / 2;
	}

	//close/open door if needed
	if (floor(m_animTime) - 1 > -1) {
		glm::vec2 prevPos = path[floor(m_animTime) - 1].getPosition();
		//check if tile door
		if(map[prevPos.y][prevPos.x] == 2)
			entmap[prevPos.y][prevPos.x] = 0;

		glm::vec2 currentPos = path[floor(m_animTime)].getPosition();
		//check if tile door
		if (map[currentPos.y][currentPos.x] == 2)
			entmap[currentPos.y][currentPos.x] = 1;
	}

	//get next tile for gradiation between tiles
	if (ceil(m_animTime) < path.size()) {
		m_nextPosition.x = path[ceil(m_animTime)].getPosition().x * TILE_SIZE + TILE_SIZE / 2;
		m_nextPosition.y = path[ceil(m_animTime)].getPosition().y * TILE_SIZE + TILE_SIZE / 2;
	}else {
		//reached end
		path.clear();
		//tecnically an itermiediate
		//set to nextPosition
		m_position.x = m_nextPosition.x;
		m_position.y = m_nextPosition.y;

		//reset animation
		m_animTime = 0.0;
		m_animTile = 0;
		return true;
	}

	//calculate which direction to face
	if (m_nextPosition.x < calcPos.x) {
		//left
		m_direction = 2;
	}
	else if (m_nextPosition.x > calcPos.x) {
		//right
		m_direction = 1;
	}

	//the time into the current movement
	double currentTileTime = m_animTime - floor(m_animTime);

	//calculate movement gradient if not intermediate
	if (Random::equals(m_animTime, floor(m_animTime))&&deltaTime>0.0f) {
		m_position.x = calcPos.x;
		m_position.y = calcPos.y;
		return true;
	}
	else {
		//difference between current tile and next pos
		glm::vec2 difference;

		difference.x = m_nextPosition.x - calcPos.x;
		difference.y = m_nextPosition.y - calcPos.y;

		// add the multiply difference by currentTileTime
		calcPos.x += difference.x * currentTileTime;
		calcPos.y += difference.y * currentTileTime;

		m_position.x = calcPos.x;
		m_position.y = calcPos.y;
	}

	//calculate which fram the character is at
	//also check if its animating
	if ((int)(currentTileTime * 10) % (int)m_animSpeed == 0 && !Random::equals(deltaTime, 0.0))
		m_animTile += 1;
	else if (Random::equals(deltaTime, 0.0))
		m_animTile = 0;

	if (m_animTile > 2)
		m_animTile = 0;

	return false;

	//return false;
}*/

bool Creature::seesPoint(const std::vector<std::vector<int>>& map, const std::vector<std::vector<int>>& entmap, glm::vec2 end)
{
	//calculate creatureslocation
	glm::ivec2 currentPos;
	currentPos.x = std::round((m_position.x - TILE_SIZE / 2.0f) / TILE_SIZE);
	currentPos.y = std::round((m_position.y - TILE_SIZE / 2.0f) / TILE_SIZE);

	glm::ivec2 goal;
	goal.x = std::round((end.x - TILE_SIZE / 2.0f) / TILE_SIZE);
	goal.y = std::round((end.y - TILE_SIZE / 2.0f) / TILE_SIZE);

	return visionThing.canSeePoint(map, entmap, currentPos, goal);
}


text:
package com.twitter.finagle.http

import com.twitter.util.Base64StringEncoder
import java.nio.charset.StandardCharsets
import scala.collection.JavaConversions._

object ProxyCredentials {
  def apply(credentials: java.util.Map[String, String]): Option[ProxyCredentials] =
    apply(credentials.toMap)

  def apply(credentials: Map[String, String]): Option[ProxyCredentials] = {
    for {
      user <- credentials.get("http_proxy_user")
      pass <- credentials.get("http_proxy_pass")
    } yield {
      ProxyCredentials(user, pass)
    }
  }
}

case class ProxyCredentials(username: String, password: String) {
  lazy val basicAuthorization: String = {
    val bytes = "%s:%s".format(username, password).getBytes(StandardCharsets.UTF_8)
    "Basic " + Base64StringEncoder.encode(bytes)
  }
}


text:
//
//  UIView+Rounded.h
//  UIView+Rounded
//
//  Created by Quentin Hayot on 05/05/2015.
//  Copyright (c) 2015 Quentin Hayot. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Rounded)

/**-----------------------------------------------------------------------------
 * @name UIView+Rounded
 * -----------------------------------------------------------------------------
 */

/** Round the view's corners
 *
 * Round the view's corners and set an optional border.
 *
 * @param cornerRadius The radius of the corners
 * @param borderWidth The width of the border (set 0.0f for no border)
 * @param borderColor The color of the border
 */
-(void)roundWithCornerRadius:(float)cornerRadius andBorderWidth:(float)borderWidth andBorderColor:(UIColor*)color;

/** Make a circular view
 *
 * Make a view circular and set an optional border.
 * If your view is not square, it won't be a perfect circle.
 *
 * @param borderWidth The width of the border (set 0.0f for no border)
 * @param borderColor The color of the border
 */
-(void)circleWithBorderWidth:(float)borderWidth andBorderColor:(UIColor*)color;

@end


text:
ACCEPTED

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

#### Published in
null

#### Original name
Dimorphandra ferruginea Ducke

### Remarks
null


text:
/**
 * @since 2021-06-24
 * @author vivaxy
 */
import * as Y from 'yjs';

const TEXT_KEY = 'text-key';

const docA = new Y.Doc();
const textA = docA.getText(TEXT_KEY);
textA.insert(0, 'ABC');
const docB = new Y.Doc();
const textB = docB.getText(TEXT_KEY);
Y.applyUpdate(docB, Y.encodeStateAsUpdate(docA));
const snapshot1 = Y.snapshot(docB);
textB.delete(1, 1);
const snapshot2 = Y.snapshot(docB);
textB.insert(1, 'T');
const snapshot3 = Y.snapshot(docB);
console.log(
  'snapshot with deleteSet and stateMap',
  snapshot1,
  snapshot2,
  snapshot3,
);


text:
namespace scheduler {

SingleThreadIdleTaskRunner::SingleThreadIdleTaskRunner(
    scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner,
    scoped_refptr<base::SingleThreadTaskRunner> after_wakeup_task_runner,
    Delegate* delegate,
    const char* tracing_category)
    : idle_priority_task_runner_(idle_priority_task_runner),
      after_wakeup_task_runner_(after_wakeup_task_runner),
      delegate_(delegate),
      tracing_category_(tracing_category),
      blame_context_(nullptr),
      weak_factory_(this) {
  DCHECK(!idle_priority_task_runner_ ||
         idle_priority_task_runner_->RunsTasksOnCurrentThread());
  DCHECK(!after_wakeup_task_runner_ ||
         after_wakeup_task_runner_->RunsTasksOnCurrentThread());
  weak_scheduler_ptr_ = weak_factory_.GetWeakPtr();
}

SingleThreadIdleTaskRunner::~SingleThreadIdleTaskRunner() {
}

SingleThreadIdleTaskRunner::Delegate::Delegate() {
}

SingleThreadIdleTaskRunner::Delegate::~Delegate() {
}

bool SingleThreadIdleTaskRunner::RunsTasksOnCurrentThread() const {
  return idle_priority_task_runner_->RunsTasksOnCurrentThread();
}

void SingleThreadIdleTaskRunner::PostIdleTask(
    const tracked_objects::Location& from_here,
    const IdleTask& idle_task) {
  delegate_->OnIdleTaskPosted();
  idle_priority_task_runner_->PostTask(
      from_here, base::Bind(&SingleThreadIdleTaskRunner::RunTask,
                            weak_scheduler_ptr_, idle_task));
}

void SingleThreadIdleTaskRunner::PostNonNestableIdleTask(
    const tracked_objects::Location& from_here,
    const IdleTask& idle_task) {
  delegate_->OnIdleTaskPosted();
  idle_priority_task_runner_->PostNonNestableTask(
      from_here, base::Bind(&SingleThreadIdleTaskRunner::RunTask,
                            weak_scheduler_ptr_, idle_task));
}

void SingleThreadIdleTaskRunner::PostIdleTaskAfterWakeup(
    const tracked_objects::Location& from_here,
    const IdleTask& idle_task) {
  // Don't signal posting of idle task to the delegate here, wait until the
  // after-wakeup task posts the real idle task.
  after_wakeup_task_runner_->PostTask(
      FROM_HERE, base::Bind(&SingleThreadIdleTaskRunner::PostIdleTask,
                            weak_scheduler_ptr_, from_here, idle_task));
}

void SingleThreadIdleTaskRunner::RunTask(IdleTask idle_task) {
  base::TimeTicks deadline = delegate_->WillProcessIdleTask();
  TRACE_EVENT1(tracing_category_, "SingleThreadIdleTaskRunner::RunTask",
               "allotted_time_ms",
               (deadline - base::TimeTicks::Now()).InMillisecondsF());
  if (blame_context_)
    blame_context_->Enter();
  idle_task.Run(deadline);
  if (blame_context_)
    blame_context_->Leave();
  delegate_->DidProcessIdleTask();
}

void SingleThreadIdleTaskRunner::SetBlameContext(
    base::trace_event::BlameContext* blame_context) {
  blame_context_ = blame_context;
}

}  // namespace scheduler


text:
package org.wso2.andes.kernel;

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

/**
 * AndesMessage represents the messages handled by Andes.
 * Metadata and content chunks are referred from this
 */
public class AndesMessage {

    /**
     * Metadata for AndesMessage
     */
    private AndesMessageMetadata metadata;

    /**
     * Content is divided into chunks and referred from this list
     */
    private List<AndesMessagePart> contentChunkList;

    public AndesMessage(AndesMessageMetadata metadata) {
        this.metadata = metadata;
        contentChunkList = new ArrayList<>();
    }

    /**
     * Get metadata of a message
     */
    public AndesMessageMetadata getMetadata() {
        return metadata;
    }

    /**
     * Set metadata of a message
     */
    public void setMetadata(AndesMessageMetadata metadata) {
        this.metadata = metadata;
    }

    /**
     * Get content chunk list
     */
    public List<AndesMessagePart> getContentChunkList() {
        return contentChunkList;
    }

    public void addMessagePart(AndesMessagePart messagePart) {
        contentChunkList.add(messagePart);
    }

    /**
     * Set content chunk list of the message
     * @param chunkList List of {@link org.wso2.andes.kernel.AndesMessagePart}
     */
    public void setChunkList(List<AndesMessagePart> chunkList) {
        this.contentChunkList = chunkList;
    }
}


text:
class CreateLibraryBooks < ActiveRecord::Migration[5.1]
  def change
    create_table :library_books do |t|
      t.integer :library_id
      t.integer :book_id

      t.timestamps
    end
  end
end