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

import org.modeshape.jcr.cache.NodeKey;
import org.modeshape.jcr.spi.index.provider.Filter;
import org.modeshape.jcr.spi.index.provider.IndexProvider;

/**
 * An index used by the query system to quickly provide the set of {@link NodeKey}s that satisfy a particular portion of a query.
 * <p>
 * Each time ModeShape uses this index, it calls the {@link #filter(IndexConstraints)} method with a set of
 * {@link IndexConstraints} to obtain an {@link org.modeshape.jcr.spi.index.provider.Filter.Results} instance that ModeShape will
 * then use to {@link org.modeshape.jcr.spi.index.provider.Filter.Results#getNextBatch(ResultWriter, int) access} the batches of
 * node keys that satisfy the constraints. Note that once an {@link org.modeshape.jcr.spi.index.provider.Filter.Results} is
 * obtained, it may be called zero or more times but will always be closed.
 * </p>
 *
 * @see IndexProvider#getIndex(String,String)
 * @author Randall Hauch (rhauch@redhat.com)
 */
public interface Index extends Filter {

    /**
     * Get the name of the {@link IndexProvider} that owns this index.
     *
     * @return the provider's {@link IndexProvider#getName() name}; never null
     */
    String getProviderName();

    /**
     * Get the name of this index.
     *
     * @return the index name; never null
     */
    String getName();

    /**
     * Return whether this index can use full-text search constraints. Such indexes may be used in some queries even if they are
     * not the lowest-cost option.
     *
     * @return true if this index can use full-text search constraints, or false otherwise.
     */
    boolean supportsFullTextConstraints();
}


text:
package com.itracker.android.data.roster;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

/**
 * Contains information about resources for specified bare address.
 *
 * @author alexander.ivanov
 */
class ResourceContainer {

    /**
     * List of available resources for its STRING-PREPed resources.
     */
    private final Map<String, ResourceItem> resourceItems;

    /**
     * Best resource.
     */
    private ResourceItem best;

    public ResourceContainer() {
        resourceItems = new HashMap<String, ResourceItem>();
        best = null;
    }

    /**
     * @return Best resource according priority. null can be
     * returned.
     */
    ResourceItem getBest() {
        return best;
    }

    /**
     * Update information about best resource.
     */
    void updateBest() {
        String bestKey = null;
        ResourceItem bestResource = null;
        for (Entry<String, ResourceItem> entry : resourceItems.entrySet()) {
            String key = entry.getKey();
            ResourceItem resource = entry.getValue();
            if (bestResource == null) {
                bestKey = key;
                bestResource = resource;
            } else {
                int result = resource.compareTo(bestResource);
                if (result > 0 || (result == 0 && key.compareTo(bestKey) > 0))
                    bestResource = resource;
            }
        }
        this.best = bestResource;
    }

    /**
     * @param resource
     * @return Resource item for specified resource name. null can
     * be returned.
     */
    ResourceItem get(String resource) {
        return resourceItems.get(resource);
    }

    /**
     * Adds new resource item.
     *
     * @param resource
     * @param resourceItem
     */
    void put(String resource, ResourceItem resourceItem) {
        resourceItems.put(resource, resourceItem);
    }

    /**
     * Removes resource item.
     *
     * @param resource
     */
    void remove(String resource) {
        resourceItems.remove(resource);
    }

    /**
     * @return Collection with available resources.
     */
    Collection<ResourceItem> getResourceItems() {
        return Collections.unmodifiableCollection(resourceItems.values());
    }

}

redpajama_set_name: RedPajamaGithub


text:
<form class="ui form">

Project information

        Project name
        <input name="projectName" [(ngModel)]="project.project.projectName" type="text">

        Project description
        <textarea name="projectDescription" [(ngModel)]="project.project.projectDescription" rows="7"></textarea>

Duration

        Starting date

            <input name="startDateDay" [(ngModel)]="project.project.startDay" placeholder="Day" type="number" min="1" max="31">

          <sm-select name="startDateMonth" [(model)]="project.project.startMonth">
            <option value="">Month</option>
            <option value="1">January</option>
            <option value="2">February</option>
            <option value="3">March</option>
            <option value="4">April</option>
            <option value="5">May</option>
            <option value="6">June</option>
            <option value="7">July</option>
            <option value="8">August</option>
            <option value="9">September</option>
            <option value="10">October</option>
            <option value="11">November</option>
            <option value="12">December</option>
          </sm-select>

            <input name="startDateYear" [(ngModel)]="project.project.startYear" placeholder="Year" type="number" min="1900" max="9999">

        Ending date

            <input name="endDateDay" [(ngModel)]="project.project.endDay" placeholder="Day" type="number" min="1" max="31">

          <sm-select name="endDateMonth" [(model)]="project.project.endMonth">
            <option value="">Month</option>
            <option value="1">January</option>
            <option value="2">February</option>
            <option value="3">March</option>
            <option value="4">April</option>
            <option value="5">May</option>
            <option value="6">June</option>
            <option value="7">July</option>
            <option value="8">August</option>
            <option value="9">September</option>
            <option value="10">October</option>
            <option value="11">November</option>
            <option value="12">December</option>
          </sm-select>

            <input name="endDateYear" [(ngModel)]="project.project.endYear" placeholder="Year" type="number" min="1900" max="9999">

Budget information

        Budget

            <sm-select name="budgetType" [(model)]="project.project.budgetType">
              <option value="">Budget Type</option>
              <option value="hourly">Hourly</option>
              <option value="weekly">Weekly</option>
              <option value="montly">Montly</option>
              <option value="project-based">Project-based</option>
            </sm-select>

              <input name="budget" placeholder="Amount" [(ngModel)]="project.project.budget" type="number">

        Payment triggers
        <sm-select name="paymentTrigger" [(model)]="project.project.paymentTrigger">
          <option value="">Trigger</option>
          <option value="default">Default</option>
          <option value="30days">30 days after</option>
          <option value="custom">Custom</option>
        </sm-select>

Payment method

        <sm-select name="paymentMethod" [(model)]="project.project.paymentMethod">
          <option value="">Payment method</option>
          <option value="invoice">Invoice</option>
          <option value="directdebit">Direct Debit</option>
        </sm-select>

        Additional information
        <textarea rows="4" name="paymentInfo" [(ngModel)]="project.project.paymentInfo"></textarea>

</form>

    <button class="ui yellow button" (click)="previousClicked.emit(undefined)">
      Previous Step
    </button>

    <button class="ui yellow button" (click)="nextClicked.emit(undefined)">
      Next Step
    </button>


text:
package io.airlift.drift.codec.recursion;

import io.airlift.drift.annotations.ThriftField;
import io.airlift.drift.annotations.ThriftStruct;

import java.util.Objects;

import static io.airlift.drift.annotations.ThriftField.Recursiveness;
import static io.airlift.drift.annotations.ThriftField.Requiredness;

@ThriftStruct
public class CoRecursiveHelper
{
    @ThriftField(value = 1, requiredness = Requiredness.OPTIONAL, isRecursive = Recursiveness.TRUE)
    public CoRecursive child;

    @ThriftField(2)
    public String data;

    @Override
    public boolean equals(Object o)
    {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CoRecursiveHelper that = (CoRecursiveHelper) o;
        return Objects.equals(child, that.child) &&
                Objects.equals(data, that.data);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(child, data);
    }
}


text:
<?php

namespace Asi\ClinicaBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Tipoexamen
 */
class Tipoexamen
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $nombre;

    /**
     * @var boolean
     */
    private $estadoactivacion;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $examen;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->examen = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Tipoexamen
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set estadoactivacion
     *
     * @param boolean $estadoactivacion
     * @return Tipoexamen
     */
    public function setEstadoactivacion($estadoactivacion)
    {
        $this->estadoactivacion = $estadoactivacion;

        return $this;
    }

    /**
     * Get estadoactivacion
     *
     * @return boolean
     */
    public function getEstadoactivacion()
    {
        return $this->estadoactivacion;
    }

    public function getEstadoActivacionString()
    {
        if ($this->estadoactivacion==1) {
            return 'Si';
        } else {
            return 'No';
        }
    }

    /**
     * Add examen
     *
     * @param \Asi\ClinicaBundle\Entity\Examen $examen
     * @return Tipoexamen
     */
    public function addExaman(\Asi\ClinicaBundle\Entity\Examen $examen)
    {
        $this->examen[] = $examen;

        return $this;
    }

    /**
     * Remove examen
     *
     * @param \Asi\ClinicaBundle\Entity\Examen $examen
     */
    public function removeExaman(\Asi\ClinicaBundle\Entity\Examen $examen)
    {
        $this->examen->removeElement($examen);
    }

    /**
     * Get examen
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getExamen()
    {
        return $this->examen;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="br.ifcibirama.dell_pc.javaisfun.Calculos6"
    android:background="@android:color/white"
    >

    <ImageButton
        android:id="@+id/imageButton70"
        android:layout_width="28dp"
        android:layout_height="31dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:background="@android:color/transparent"
        android:contentDescription="@string/menu"
        android:onClick="TextDialog"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.023"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.015"
        app:srcCompat="@drawable/backgreen" />

    <ImageButton
        android:id="@+id/imageButton71"
        android:layout_width="42dp"
        android:layout_height="38dp"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:background="@android:color/transparent"
        android:onClick="proximo"
        android:scaleType="fitXY"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.973"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0"
        app:srcCompat="@drawable/proximoverde" />

    <TextView
        android:id="@+id/textView188"
        android:layout_width="285dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="7dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-condensed"
        android:text="Escolha as opções abaixo na ordem correta para criar uma variável que receba como valor o resultado de uma soma entre N1 e N2:"
        android:textAlignment="center"
        android:textColor="@color/cinzinha"
        android:textSize="18sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.231"
        app:layout_constraintHorizontal_bias="0.508" />

    <TextView
        android:id="@+id/textView189"
        android:layout_width="249dp"
        android:layout_height="38dp"
        android:layout_marginBottom="7dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-condensed"
        android:text="Correto!"
        android:textAlignment="center"
        android:textColor="@color/aaaa"
        android:textSize="30sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.908"
        app:layout_constraintHorizontal_bias="0.505" />

    <TextView
        android:id="@+id/textView186"
        android:layout_width="249dp"
        android:layout_height="38dp"
        android:layout_marginBottom="7dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-condensed"
        android:text="Não foi dessa vez..."
        android:textAlignment="center"
        android:textColor="@color/cinzinha"
        android:textSize="30sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.505"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.908" />

    <TextView
        android:id="@+id/textView190"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="7dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-condensed"
        android:text="Segure arraste e solte..."
        android:textAlignment="center"
        android:textColor="@android:color/holo_green_light"
        android:textSize="18sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.502"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.137" />

    <TextView
        android:id="@+id/textView350"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="7dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-condensed"
        android:text="Que tal treinar um pouco?!"
        android:textAlignment="center"
        android:textColor="@color/aaaa"
        android:textSize="18sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.073"
        app:layout_constraintHorizontal_bias="0.503" />

    <ImageView
        android:id="@+id/imageView17"
        android:layout_width="330dp"
        android:layout_height="130dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:scaleType="fitXY"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.498"
        app:srcCompat="@drawable/telinha" />

    <Button
        android:id="@+id/button20"
        style="@style/Widget.AppCompat.Button.Colored"
        android:layout_width="300dp"
        android:layout_height="53dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:background="@color/aaaa"
        android:onClick="verif"
        android:text="Verificar"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.986" />

    <com.google.android.flexbox.FlexboxLayout
        android:id="@+id/flexTop"
        android:layout_width="320dp"
        android:layout_height="120dp"
        android:layout_marginBottom="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="8dp"
        app:alignContent="stretch"
        app:alignItems="stretch"
        app:flexWrap="wrap"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.498"

        >

    </com.google.android.flexbox.FlexboxLayout>

    <com.google.android.flexbox.FlexboxLayout
        android:id="@+id/flexDown"
        android:layout_width="320dp"
        android:layout_height="120dp"
        android:layout_marginBottom="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="8dp"
        app:alignContent="stretch"
        app:alignItems="stretch"
        android:background="@color/clarin"
        app:flexWrap="wrap"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.807">

        <Button
            android:id="@+id/button25"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"

            android:background="@android:color/holo_blue_dark"

            android:text="+" />

        <Button
            android:id="@+id/button21"
            android:layout_width="40dp"
            android:layout_height="wrap_content"

            android:layout_margin="8dp"

            android:background="@android:color/holo_blue_dark"
            android:text="n1" />

        <Button
            android:id="@+id/button28"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text="int" />

        <Button
            android:id="@+id/button24"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text=";" />

        <Button
            android:id="@+id/button23"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text="="

            />

        <Button
            android:id="@+id/button19"
            android:layout_width="60dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text="soma" />

        <Button
            android:id="@+id/button27"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text="-" />

        <Button
            android:id="@+id/button26"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"

            android:text="%"
            app:layout_constraintBottom_toBottomOf="parent" />

        <Button
            android:id="@+id/button22"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:background="@android:color/holo_blue_dark"
            android:onClick="moverN2"
            android:text="n2" />

    </com.google.android.flexbox.FlexboxLayout>

    <ImageView
        android:id="@+id/imageView59"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_marginBottom="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.783"
        app:srcCompat="@drawable/checkmark" />

</android.support.constraint.ConstraintLayout>


text:
package scala.collection.immutable

import java.util.concurrent.TimeUnit

import org.openjdk.jmh.annotations._

object ListBenchmark {
  case class Content(value: Int)
}

@BenchmarkMode(Array(Mode.AverageTime))
@Fork(2)
@Threads(1)
@Warmup(iterations = 10)
@Measurement(iterations = 10)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@State(Scope.Benchmark)
class ListBenchmark {
  import ListBenchmark._
  @Param(Array("0", "1", "10", "100", "1000"))
  var size: Int = _

  var values: List[Content] = _
  var mid: Content = _
  var last: Content = _
  var replacement: Content = _

  @Setup(Level.Trial) def initKeys(): Unit = {
    values = List.tabulate(size)(v => Content(v))
    mid = Content(size / 2)
    last = Content(Math.max(0,size -1))
    replacement = Content(size * 2 + 1)
  }

  @Benchmark def filter_includeAll: Any = {
    values.filter(v => true)
  }

  @Benchmark def filter_excludeAll: Any = {
    values.filter(_ => false)
  }

  @Benchmark def filter_exc_mid: Any = {
    values.filter(v => v.value != mid.value)
  }

  @Benchmark def filter_from_mid: Any = {
    values.filter(v => v.value <= mid.value)
  }

  @Benchmark def filter_exc_last: Any = {
    values.filter(v => v.value != last.value)
  }

  @Benchmark def filter_only_last: Any = {
    values.filter(v => v.value == last.value)
  }

  @Benchmark def mapConserve_identity: Any = {
    values.mapConserve(x => x)
  }

  @Benchmark def mapConserve_modifyAll: Any = {
    values.mapConserve(x => replacement)
  }
  @Benchmark def mapConserve_modifyMid: Any = {
    values.mapConserve(x => if (x == mid) replacement else x)
  }
}


text:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>注册-全民金纪人</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no, target-densitydpi=device-dpi">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link href="css/jquery.mobile-1.4.4.min.css" rel="stylesheet" type="text/css">
    <link href="css/my-app.css" rel="stylesheet" type="text/css">
    <link href="css/wap_style.css" rel="stylesheet" type="text/css">

                    <input name="" type="text" class="px" id="money1" value="" placeholder="姓名">

                    <input name="" type="text" class="px" id="s_money1" value="" placeholder="手机号码">

                    <input name="" class="px" id="password1" value="" type="password" placeholder="请设置6-8位数字密码">

                        <input name="" class="px" id="agree" type="checkbox" >我同意以上注册协议

提示

请输入正确的姓名以及电话,否则可能无法结佣。

                    注    册

©2013-2014 版权所有 中凯城市之光


text:
MapMatrix::MapMatrix() {}

int MapMatrix::size() const {
    return static_cast<int>(data_.size());
}

void MapMatrix::clear() {
    data_.clear();
}

void MapMatrix::resize(int n) {
    data_.resize(n, std::vector<bool>(n, false));
}

std::vector<bool>& MapMatrix::operator[](int n) {
    return data_[n];
}

bool MapMatrix::operator() (int x, int y) const {
    return data_[y][x];
}

bool MapMatrix::operator() (const Position& pos) const {
    return data_[pos.y][pos.x];
}

bool MapMatrix::IsInside(const Position& pos) const {
    return 0 <= pos.x && pos.x < static_cast<int>(data_.size())
        && 0 <= pos.y && pos.y < static_cast<int>(data_.size());
}


text:
title: February 2020
date: 2020/03/15 13:08
metadata:
    description: 'coreBOS work during February 2020.'
    keywords: 'CRM, vtiger, opensource, corebos'
    author: 'Joe Bordes'
header_image_file: February.png
header_image_height: 320
header_image_width: 560
taxonomy:
    category: blog
    tag: [development, 2020, functionality]
---

Another month that leaves me with the sensation of astonishment. LDS styling, Workflow and Document Generation enhancements mix in with fixes, new development features, and powerful user functionality. Simply incredible!

===

 ! Lightning Design System implementations

Luke implements a fantastic Page Header for coreBOS based on LDS and starts a wave of LDS changes throughout the whole application. **Thanks Luke!** The best I can do here is recommend you to upgrade and give it a try!

- adapt main detail view and listview blocks to page header with
- bring document listview content area in line with the rest
- bring export screen content area in line with the rest
- bring user edit view content area in line with the rest
- compensate for possible premenu
- don't show create button when it has no function or value
- get RSS and recyclebin in line with other content areas
- move hidden spinner to separate list to prevent round corner on hidden LI
- move save and cancel buttons from record body to page header
- some tweaking to try and solve the 15 rows problem
- start rewriting the dynamic page header part
- **Application_UI_CoverImage** global variable
- add missing variable in extensions
- don't start page header code when none is present
- fix double indentation of code
- fix return value when no premenu is present
- move custom event header below the page header
- replace accidentally removed lines
- sticky page header version without scroll jump
- warnings
- support new page header in BusinessMap testmap
- Integrations:
  - apply LDS to the home integration app launcher
  - LDS for each settings page
  - correct aria attribute name and eliminate unused HTML id
- apply LDS styling to GlobalSearch
- apply LDS to make Error Message visible with new background and eliminate obsolete HTML directive center
- apply LDS to Account/Contact hierarchy table
- apply page header and LDS to Settings: first step clean up and structure
- apply LDS to coreBOS Updater
- apply page header and LDS to CronTasks
- apply LDS styling to deduplication
- apply LDS to the home menu
- standardize picklist dependency cyclic error message
- additional LDS styling throughout the application
- Footer
  - apply LDS styling with modern CSS
  - set background so it doesn't blend with background image
  - cleanup and coreBOS Standard Recommendations
- Workflow:
  - popups and modals: LDS
  - apply LDS to the expression editor
  - apply page header and very basic LDS
  - add sorting arrows and LDS styling to list view

 ! Document Generation Enhancements

- add related modules to HelpDesk
- direct support for including ODT documents. Before this change, the `include` directive required an external call to an open office headless service. Now we directly include the documents without the need for the external service. You can only include OpenOffice (ODT) documents
- support for sorting records in the `foreach` directive
```
{foreach Timecontrol [title=MyTitle && tcunits>5] *date_start DESC*}
{foreach Timecontrol *date_start DESC*}
```
- eliminate warnings and apply coreBOS Standard code formatting
- fix the `include` directive inside foreach which was always loading the same document
- LDS adjustments
- use correct record id in GenXML
- optimization GenDoc:
  - calculate strtolower once inside the loop
  - move constant calculation outside the loop
  - use existing class properties instead of calculating again in Include
  - avoid external system call if not needed

 ! Workflow Enhancements

- we add an action menu

![Workflow Action Menu](WFActions.png)

- mass delete action
- export and import actions. **Yes!** We can now export workflows from one coreBOS and import them into another one.
- add `number_format` function with SQL support also
- `NOT` expression operator
- add `allrelatedare` expression function which permits us to search the values of a field on a related module and return true or false if the values of that field are all of the same given value
- change the workflow data table to Vaadin grid from BunnyJS. This was an evaluation which, although has gone well, will be changed again shortly
- parse and evaluate workflow expression. Now, when we are creating a workflow expression we can select a record and evaluate the expression to make sure it is correct

![Workflow Expression Evaluation](WFEEval.png)

- REST call Workflow task enhancements
  - support for URL encoded parameters using http_build which already encodes for us, so we do not encode and make sure we call http_build
  - support XML input type which encodes the field value
  - support for XML response
  - support multiple parameters in URL input type
  - support for getting OAuth token from the context
- permit selecting workflows from related lists and capture inputs
- evaluate the expression in the context of the workflow module
- cancel submit on create validation error.
- fix create from template SQL error
- eliminate warning on UpdateField tasks created before having launchrelwf
- validate module selected on create and preselect module when coming from settings
- record template from string was calling incorrect save method
- throw an exception if workflow expression function is not found instead of stopping execution

 ! Features and New Stuff

- we set the default operation to equal and add support for filtering on some user fields in the list view advanced search
- we enhance the Business Questions to support for filter conditions
- permit mass edit of one or more records in a DeDuplication group
- filter document selection to Internal documents only in Emails, so when you try to select an attachment you are shown only those that have a file
- field type restriction search in Global Search. We can now put a field type followed by a value and the search will be launched only in those types of fields, like 'phone::value', 'picklist::value'
- global variable **Inventory_Quantity_Precision** to define decimal places in inventory lines quantity which, for some reason is special. We also set the default value of the variable to the current user's preferences
- We add support to show record comments in the Tooltip. The number of comments is defined by the **ToolTip_NumberOfComments** global variable and they will scroll if too many are present

 ! Developer/Implementor enhancements

- we add more information and parameter support for Condition Business Map testing. You can now pass the `testrecord` parameter to set the record to evaluate with
- align validation exists search with underscore naming and global variable BusinessMap_, like most other business maps to support **BusinessMapping_Validations** global variable for user/role based validations
- base application changes to support **Warehouse** perspective
- new business action **listviewRow** which permits us to easily add actions to the list view action column:

`index.php?module=$MODULE$&action=DetailView&record=$RECORD$`

![ListViewRow Business Action](ListViewRowBA.png)

- method to get file path of a document attachment: **getAttachmentPath**
- GlobalVariable method **isAppliable** that returns true if the given global variable affects the given module and user
- add related_module parameter to **corebos.filter.inventory.getprice**
- **Inventory_Other_Modules** global variable for easier support of custom inventory modules (like [Massive Warehouse Movements](https://github.com/coreBOS/MassiveMovements.git))
- new utility function **getColumnnameByFieldname**
- refactor massEditRecords function so it permits us to mass edit any set of records. Use it to mass edit from deduplication screen and looking towards permitting this also on Business Questions
- refactor DeDup code to convert ID selection to a function so we can reuse it
- refactor getInventoryTaxType to support any module (custom modules)
- refactor MasEdit move mass edit HTML to file so it can be included and avoid duplicate code
- fix WebService Attachments functionality:
  - delete temporary attachments independently of FILES global variable and without emitting warnings if it cannot be deleted
  - unset $_FILES element after file upload
- support custom translation files in web service translation service
- **vtws_getWsIdForFilteredRecord** function which returns the web service ID of a record [based on a conditional search](https://corebos.com/documentation/doku.php?id=en:devel:querygenerator&noprocess=true)
- add new method **constructAdvancedSearchConditions** to Query Generator to get a coreBOS filter query string format. The result of this method can be fed directly to **addUserSearchConditions** to set query conditions as can be seen in the **vtws_getWsIdForFilteredRecord** method and [the unit test](https://github.com/tsolucio/coreBOSTests/blob/master/include/Webservices/UtilsTest.php#L99)
- better hooks support for (Issue  and Receipt cards
- **Tests:** this month (again) has seen a lot of activity in the unit tests project with a lot of new tests, even on external modules (chatwithme).

 ! coreBOS Standard Code Formatting, Security, and Optimizations

- coreBOS Standard code Formatting: quotes, spaces, and warnings: CustomView, Workflow, Duplicates, EMails, GenDoc, Global Variable, Home, Header and Page Header, Inventory, Products, Reports
- optimization eliminates variables and apply cbSR
- optimization change CSS import to link for quicker loading
- optimization avoid concatenation in Emails
- optimization move Global Search javascript from template to script and optimize function
- optimization make a direct call to Business Action to avoid a useless call to Vtiger_Link for ListViewRow hook
- optimization reduce translation calls in Reports
- optimization eliminate a variable for a direct parameter in SalesOrder
- optimize SQL and apply cbSR in Tooltip
- optimization Utils functions getUItypeByFieldName and getUItype
- avoid warnings by setting default values for custom Business Map validations
- eliminate warnings creating users from web service
- fix ternary operator ambiguity in PHP 7.4 in Reports
- update TCPDF to 6.3.5 for PHP 7.4 support
- use older PHP array reference format for better backward compatibility
- update ADODB to 5.20.16
- add more security checks when deleting user through web service
- simplify DateTime code
- eliminate duplicate HTML ID: detailview_utils_actions
- eliminate unnecessary concatenation and standardize SQL in Documents
- eliminate and fix comments in EMails
- change License year
- Reports:
  - eliminate obsolete Calendar references
  - eliminate unused and incorrect method getStdCriteriaByModule: we use the one in CustomView
  - eliminate unused parameter
- SeriviceWorker: update workbox to 5.0.0 and delete 4.3 files
- optimize looping operations in list view row Business Action
- eliminate obsolete calendar code: List View, Web service and Reports among others
- eliminate unused parameter from Reports method after eliminating calendar code which was the only one that used it
- eliminate obsolete code: formname_specific from ListView (after adding unit tests)
- delete useless comment in Picklist and fix method comment in Workflow
- eliminate unused and incorrect method getStdCriteriaByModule from Reports as we use the one in CustomView
- optimize validation query
- delete unused variable in Inventory code
- optimize ListView: eliminate parenttab, eliminate unnecessary condition, eliminate unused parameters and correct function parameter definitions
- eliminate obsolete code related to uitypes and duplicate code in ListViewUtils
- reduce translation calls in Reports
- fix ternary operator ambiguity in Reports for PHP 7.4 support
- refactor ListView: change variable name and use HTML encoded string where necessary
- update Mermaid library
- permit no-extra-boolean-cast in eslint continuous integration check

 ! Others

- set action to "save" in order to eliminate warning in RecurringInvoice
- add fully qualified column name to "order-by" SQL clause in RelatedList and Popup
- set currentModule to correctly retrieve related lists records
- fix error getting related product block and eliminate warnings while creating unit tests for Reports
- use the regular search when no autocomplete results are found.
- Tooltip and Home:keymetrics were incorrectly cutting UTF8 characters
- include create and revise in Webservice Upsert as they weren't loaded in some situations
- correct variable name in sendRecoverPassword
- avoid loading Pear Exception if it is already loaded
- avoid duplicate general.js loading in Account, Contact, and Layout Editor
- move BrowserVariables to the header of HTML page
- delete extra directory separator in ApplicationMessage
- correctly detect am/pm option in Calendar and DateTime field class. fix PM to 24 conversion error for 12:00 hours and support for incorrect 24 hour format hours
- correctly evaluate **ActivityReminder_Deactivated**
- eliminate obsolete references to the old calendar
- change obsolete calendar reference in CustomView for Workflows which now are starting to act like a normal module
- eliminate hidden field in Contacts form which conflicts with Reports To
- set address on contact capture: error using incorrect fields
- automatically set CronTask sequence on load. **orderTasks** method
- CustomView SQL from filter with advanced grouping conditions was joining incorrectly
- fix "send document by email" link functionality
- add missing closing div in GlobalSearch
- trim helpinfo from database to prevent javascript errors
- save correct discount_amount in InventoryDetails when discount_percent is checked
- fix partial Invoice line. We were losing relations with sales order line when moving invoice lines
- correctly move inventory module product lines when there are deleted lines
- Inventory:Price hook pass around parameters on search and page change
- load common detail view code before calculating email permissions in Leads detail view script
- fix incorrect order-by parameter name in LoginHistory and AuditTrail
- miniCalendar: avoid incorrect link redirection and apply LDS styling
- limit size of uitype 3314 modulelist for big selections
- add XSD feature for Business Map Validation element parameters
- set default map to "expression" in the condition expression editor
- users module does not have assigned user so we add a validation exception to permit inline edit
- constant translation effort:
  - use an existing label for group create error message
  - module standard labels for CronTask
  - Payments it_it

![February Insights](corebosgithub2002.png)

**Thanks for reading.**


text:
package com.bazaarvoice.jolt.common.tree;

import java.util.ArrayList;
import java.util.Collection;

/**
 * DataStructure used by a SpecTransform during it's parallel tree walk.
 *
 * Basically this is Stack that records the steps down the tree that have been taken.
 * For each level, there is a PathStep, which contains a pointer the data of that level,
 *  and a pointer to the LiteralPathElement matched at that level.
 *
 * At any given point in time, it represents where in the tree walk a Spec is operating.
 * It is primarily used to by the ShiftrLeafSpec and CardinalityLeafSpec as a reference
 * to lookup real values for output "&(1,1)" references.
 *
 * It is expected that as the SpecTransform navigates down the tree, MatchedElements will be added and then
 *  removed when that subtree has been walked.
 */
public class WalkedPath extends ArrayList<PathStep> {

    public WalkedPath() {
        super();
    }

    public WalkedPath(Collection<PathStep> c) {
        super(c);
    }

    public WalkedPath( Object treeRef, MatchedElement matchedElement ) {
        super();
        this.add( new PathStep( treeRef, matchedElement ) );
    }

    /**
     * Convenience method
     */
    public boolean add( Object treeRef, MatchedElement matchedElement ) {
        return super.add( new PathStep( treeRef, matchedElement ) );
    }

    public void removeLast() {
        remove(size() - 1);
    }

    /**
     * Method useful to "&", "&1", "&2", etc evaluation.
     */
    public PathStep elementFromEnd(int idxFromEnd) {
        if (isEmpty()) {
            return null;
        }
        return get(size() - 1 - idxFromEnd);
    }

    public PathStep lastElement() {
        return get(size() - 1);
    }
}


text:
external help file: Microsoft.Azure.Commands.LogicApp.dll-Help.xml
ms.assetid: C1F6BBF9-0DB5-46FD-B8A8-9029B0AB6166
online version:
schema: 2.0.0
---

# Get-AzureRmLogicAppTriggerHistory

## SYNOPSIS
Gets the history of triggers in a logic app.

## SYNTAX

```
Get-AzureRmLogicAppTriggerHistory -ResourceGroupName <String> -Name <String> -TriggerName <String>
 [-HistoryName <String>] [-InformationAction <ActionPreference>] [-InformationVariable <String>]
 [<CommonParameters>]
```

## DESCRIPTION
The **Get-AzureRmLogicAppTriggerHistory** cmdlet gets the history of triggers in a logic app in the Logic Apps feature.
This cmdlet returns a **WorkflowTriggerHistory** object.
Specify the logic app, resource group, and trigger.

This module supports dynamic parameters.
To use a dynamic parameter, type it in the command.
To discover the names of dynamic parameters, type a hyphen (-) after the cmdlet name, and then press the Tab key repeatedly to cycle through the available parameters.
If you omit a required template parameter, the cmdlet prompts you for the value.

## EXAMPLES

### Example 1: Get a trigger history of a logic app
```
PS C:\>Get-AzureRmLogicAppTriggerHistory -ResourceGroupName "Resourcegroup11" -Name "LogicApp03" -TriggerName "Trigger01" -HistoryName "08587489107387695768"
Code        : BadRequest
EndTime     : 1/13/2016 2:42:26 PM
Error       : {code, message}
Fired       : False
InputsLink  : https://flowprodcu02by01.blob.core.windows.net/flow3ea9ffd11c684c9f9f258b1a6ea5cb6020160113t000000zcontent/A7392_d1e831de68ac4ef89d19a40f05e663
              cb_httpTrigger:5Finputs:2Ejson?sv=2014-02-14&sr=b&sig=rASa1yg14P71ioIStAji5HJfTFCbSjD3LNt2Ypn%2Byg4%3D&se=2016-01-14T16%3A15%3A16Z&sp=r
Name        : 08587489107387695768
OutputsLink :
Run         :
StartTime   : 1/13/2016 2:42:26 PM
Status      : Failed
TrackingId  : f88a499b-f80f-4a28-9bbf-c4cc0d129700
Type        : Microsoft.Logic/workflows/triggers/histories
```

This command gets a specific logic app trigger history for a trigger in the logic app named LogicApp03.

### Example 2: Get trigger histories of a logic app
```
PS C:\>Get-AzureRmLogicAppTriggerHistory -ResourceGroupName "ResourceGroup11" -Name "LogicApp07" -TriggerName "Trigger01"
Code        : BadRequest
EndTime     : 1/13/2016 2:43:33 PM
Error       : {code, message}
Fired       : False
InputsLink  : https://flowprodcu02by01.blob.core.windows.net/flow3ea9ffd11c684c9f9f258b1a6ea5cb6020160113t000000zcontent/CAB46_60e2ad0f0e1947e8b5798716914c5d
              b6_httpTrigger:5Finputs:2Ejson?sv=2014-02-14&sr=b&sig=aoyjajRfk5tQucYE%2BW6h9Is%2BAHSE7AcojY%2FOag6DWRA%3D&se=2016-01-14T16%3A18%3A27Z&sp=r
Name        : 08587489106716457817
OutputsLink :
Run         :
StartTime   : 1/13/2016 2:43:33 PM
Status      : Failed
TrackingId  : c91a63f1-48b4-4eae-91eb-8f6dbfa9fe06
Type        : Microsoft.Logic/workflows/triggers/histories

Code        : BadRequest
EndTime     : 1/13/2016 2:42:26 PM
Error       : {code, message}
Fired       : False
InputsLink  : https://flowprodcu02by01.blob.core.windows.net/flow3ea9ffd11c684c9f9f258b1a6ea5cb6020160113t000000zcontent/A7392_d1e831de68ac4ef89d19a40f05e663
              cb_httpTrigger:5Finputs:2Ejson?sv=2014-02-14&sr=b&sig=XNBbA0FkBQmGPDd%2Be03J0Vsdj4aFRG9YK5YBJwzBbO0%3D&se=2016-01-14T16%3A18%3A27Z&sp=r
Name        : 08587489107387695768
OutputsLink :
Run         :
StartTime   : 1/13/2016 2:42:26 PM
Status      : Failed
TrackingId  : f88a499b-f80f-4a28-9bbf-c4cc0d129700
Type        : Microsoft.Logic/workflows/triggers/histories
```

This command gets the workflow trigger histories for a trigger in the logic app named LogicApp07.

## PARAMETERS

### -ResourceGroupName
Specifies the name of the resource group in which this cmdlet gets history.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
Specifies the name of the logic app for which this cmdlet gets trigger history.

```yaml
Type: String
Parameter Sets: (All)
Aliases: ResourceName

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -TriggerName
Specifies the name of the trigger for which this cmdlet gets history.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -HistoryName
Specifies the name of the history that this cmdlet gets.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationAction
Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationVariable
Specifies an information variable.

```yaml
Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### Microsoft.Azure.Management.Logic.Models.WorkflowTriggerHistory

## NOTES

## RELATED LINKS

[Get-AzureRmLogicAppRunHistory](./Get-AzureRmLogicAppRunHistory.md)

[Get-AzureRmLogicAppTrigger](./Get-AzureRmLogicAppTrigger.md)

[Start-AzureRmLogicApp](./Start-AzureRmLogicApp.md)


text:
Video

Fideo


text:
import 'source-map-support/register';
import dox from 'dox';
import path from 'path';
import swig from 'swig-templates';
import {
   and,
   deprecation,
   description,
   isPrivate,
   isFunction,
   isGlobal,
   isModule,
   isInjection,
   isDirective,
   not,
   getPath
} from './utilities';
import { buildCommentHierarchy } from './file-parser';

const LINK_MATCHER =
   /\{@link(plain)? ([\w-]+)?(?:#([\w]+))?\.?([\w]+)?(\(\))?( [^}]+)?\}/gi;

export function createMarkdownForFiles( files, options = {} ) {
   const warn = options.warn || ( ( filename, message ) => {
      // eslint-disable-next-line no-console
      console.warn( 'WARN (@ ' + filename + '): ' + message );
   } );
   const templates = createSwigTemplates();
   const symbolsToFilename = {};
   // eslint-disable-next-line no-console
   const duplicateModuleChecker = createDuplicateModuleChecker( options.warn || ( _ => console.warn( _ ) ) );

   const result = files
      .map( file => {
         const doxResults = dox
            .parseComments( file.sourceContent, {
               raw: true,
               skipSingleStart: true
            } )
            // filter out the copyright header
            .filter( jsDoc => !( description( jsDoc ).indexOf( 'Copyright' ) === 0 && jsDoc.line === 1 ) )
            .filter( not( isPrivate ) )
            .map( jsDoc => ({ ...jsDoc, code: undefined }) );

         const { moduleName, moduleHidden, commentHierarchy, symbols } =
            buildCommentHierarchy( doxResults, options );

         if( moduleName ) {
            symbolsToFilename[ moduleName ] = file.targetFilename;
            duplicateModuleChecker.register( moduleName, file.sourceFilename );
         }
         else if( !options.onlyPublicModules ) {
            warn( file.sourceFilename, 'no top-level module definition found (@module)' );
         }
         symbols.forEach( _ => {
            symbolsToFilename[ _ ] = file.targetFilename;
            if( moduleName ) {
               symbolsToFilename[ `${moduleName}#${_}` ] = file.targetFilename;
            }
         } );

         return { file, moduleName, moduleHidden, commentHierarchy, symbols };
      } )
      .filter( ({ file, moduleName, moduleHidden }) => {
         if( options.onlyPublicModules && ( !moduleName || moduleHidden ) ) {
            if( options.verbose ) {
               /* eslint-disable no-console */
               const name = file.sourceFilename;
               console.log( `Omitting file '${name}', because it defines no publicly visible module` );
               /* eslint-enable no-console */
            }
            return false;
         }

         return true;
      } )
      .map( ({ file, moduleName, commentHierarchy, symbols }) => {
         const transformers = createTransformers( moduleName, symbolsToFilename, symbols );

         const module = ( ( commentHierarchy.filter( isGlobal )[ 0 ] || {} ).children || [] )
            .filter( isModule )[ 0 ];

         // render Module members
         const moduleMembers = commentHierarchy
            .filter( isGlobal );
         const moduleMembersContent = moduleMembers
            .map( type =>
               ( type.children || [] )
                  .filter( not( isModule ) )
                  .map( member => ({ ...transformers, ...member, fullName: member.name }) )
                  .map( _ => isFunction( _ ) ? templates.function( _ ) : templates.property( _ ) )
                  .join( '\n\n' )
            )
            .join( '' );
         const moduleMembersToc = [].concat( ...moduleMembers
            .map( type =>
               ( type.children || [] )
                  .filter( not( isModule ) )
                  .map( member => ({
                     link: `#${member.name}`,
                     name: member.name + ( isFunction( member ) ? '()' : '' ) +
                        transformers._deprecationTitle( member )
                  }) )
            ) );

         // extract types / classes
         const types = commentHierarchy
            .filter( and( not( isGlobal ), not( isInjection ), not( isDirective ) ) )
            .map( type => detectAndTransformEs2015Class( type ) );

         // extract injectable services
         const injectables = commentHierarchy
            .filter( and( not( isGlobal ), isInjection ) );

         // extract directives
         const directives = commentHierarchy
            .filter( and( not( isGlobal ), isDirective ) );

         const typeWithChildren = types => renderTypesWithChildren( types, templates, transformers );

         return {
            ...file,
            markdown: reduceEmptyLines( templates.doc( {
               ...transformers,
               module,
               moduleMembersToc: templates.toc( { entries: moduleMembersToc } ).trim(),
               injectablesToc: renderTypesWithChildrenToc( injectables, templates.toc, transformers ),
               directivesToc: renderTypesWithChildrenToc( directives, templates.toc, transformers ),
               typesToc: renderTypesWithChildrenToc( types, templates.toc, transformers ),
               moduleMembers: moduleMembersContent,
               injectables: typeWithChildren( injectables ),
               directives: typeWithChildren( directives ),
               types: typeWithChildren( types )
            } ) )
         };
      } );

   duplicateModuleChecker.check();

   return result;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function detectAndTransformEs2015Class( type ) {
   const typeName = type.name;
   const classDefinition =
      type.children.find( child => child.name === typeName && getPath( child, 'dox.ctx.type' ) === 'class' );
   if( classDefinition ) {
      classDefinition.children = type.children.filter( child => child !== classDefinition );
      return classDefinition;
   }
   return type;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function createTransformers( moduleName, symbolsToFilename, localSymbols ) {
   const _replaceLinks = text => {
      return text.replace(
         LINK_MATCHER,
         ( _, $plain, $moduleName = '', $localItem, $localItemProp, $parens = '', $title = '' ) => {
            let link = '';
            link += $localItem ? `#${$localItem}` : '';
            link += $localItemProp ? `.${$localItemProp}` : '';

            const linkText = $title.trim() ? $title.trim() : $moduleName + link + $parens;
            if( $moduleName && $moduleName !== moduleName ) {
               link = `${symbolsToFilename[ $moduleName ] || '-unknown-'}${link}`;
            }
            if( $plain ) {
               return `[${linkText}](${link})`;
            }
            return `[\`${linkText}\`](${link})`;
         } );
   };
   const _renderType = type => {
      if( localSymbols.indexOf( type ) !== -1 ) {
         return `[\`${type}\`](#${type})`;
      }
      if( type in symbolsToFilename ) {
         return `[\`${type}\`](${symbolsToFilename[ type ]}#${type})`;
      }
      return '`' + type + '`';
   };
   const _renderTypes = obj => ( obj.types || [] ).map( _renderType ).join( ', ' );
   const _renderPropertyType = dox => {
      const types = ( dox.tags.filter( _ => _.type === 'type' )[ 0 ] || {} ).types || [];
      return _renderType( types[ 0 ] );
   };
   const _deprecationTitle = obj => deprecation( obj ) ? ' **(Deprecated)**' : '';
   const _deprecationText = obj => {
      const deprecationNotice = deprecation( obj );
      return deprecationNotice ? `\n\n**Deprecated:**\n\n> ${_replaceLinks(deprecationNotice)}\n\n` : '';
   };
   return {
      _replaceLinks,
      _renderType,
      _renderTypes,
      _renderPropertyType,
      _deprecationTitle,
      _deprecationText
   };
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function createSwigTemplates() {
   swig.setFilter( 'wrap', ( input, wrapper, condition ) =>
      condition === undefined || condition ? wrapper + input + wrapper : input
   );
   swig.setFilter( 'if', ( input, condition ) => condition ? input : '' );
   swig.setFilter( 'replaceLinks', ( input, condition ) => condition ? input : '' );
   swig.setDefaults( {
      autoescape: false,
      locals: {
         isFunction
      }
   } );

   const templateDir = templateName => path.join( __dirname, `../templates/${templateName}.md.tmpl` );
   return {
      doc: swig.compileFile( templateDir( 'doc_template' ) ),
      toc: swig.compileFile( templateDir( 'toc_template' ) ),
      type: swig.compileFile( templateDir( 'type_template' ) ),
      function: swig.compileFile( templateDir( 'function_template' ) ),
      property: swig.compileFile( templateDir( 'property_template' ) )
   };
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function renderTypesWithChildren( types, templates, locals ) {
   return types.map( type => {
      const members = ( type.children || [] )
         .map( member => {
            const renderData = ({ ...locals, ...member, fullName: `${type.name}.${member.name}` });
            return templates[ isFunction( member ) ? 'function' : 'property' ]( renderData );
         } )
         .join( '' );
      return { ...locals, ...type, members };
   } )
   .map( templates.type ).join( '' );
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function renderTypesWithChildrenToc( types, tocTemplate, transformers ) {
   const tocString = types.map( type =>
      ({
         name: type.name + transformers._deprecationTitle( type ),
         link: `#${type.name}`,
         children: ( type.children || [] )
            .map( member => {
               const commonPrefix = `${type.name}.${member.name}`;
               return {
                  link: `#${commonPrefix}`,
                  name: commonPrefix + ( isFunction( member ) ? '()' : '' ) +
                     transformers._deprecationTitle( member )
               };
            } )
      })
   );

   return tocTemplate( { entries: tocString } ).trim();
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function reduceEmptyLines( string ) {
   return string.replace( /(\n{2,})/g, '\n\n' ).replace( /(\n{2,})$/, '\n' );
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

function createDuplicateModuleChecker( warn ) {
   const knownModules = {};

   return {
      register( moduleName, filename ) {
         if( !( moduleName in knownModules ) ) {
            knownModules[ moduleName ] = [];
         }
         knownModules[ moduleName ].push( filename );
      },
      check() {
         Object.keys( knownModules ).forEach( moduleName => {
            const files = knownModules[ moduleName ];
            if( files.length >= 2 ) {
               warn( `Duplicate definition of module ${moduleName}. Found in these files:\n` +
                  `   - ${files.join( '\n   - ' )}` );
            }
         } );
      }
   };
}


text:
package org.apache.storm.command;

import java.util.List;
import org.apache.storm.generated.Nimbus;
import org.apache.storm.generated.TopologySummary;
import org.apache.storm.utils.NimbusClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ListTopologies {
    private static final Logger LOG = LoggerFactory.getLogger(ListTopologies.class);
    private static final String MSG_FORMAT = "%-20s %-10s %-10s %-12s %-12s %-20s\n";

    public static void main(String[] args) throws Exception {
        NimbusClient.withConfiguredClient(new NimbusClient.WithNimbus() {
            @Override
            public void run(Nimbus.Iface nimbus) throws Exception {
                List<TopologySummary> topologies = nimbus.getClusterInfo().get_topologies();
                if (topologies == null || topologies.isEmpty()) {
                    System.out.println("No topologies running.");
                } else {
                    System.out.printf(MSG_FORMAT, "Topology_name", "Status", "Num_tasks", "Num_workers", "Uptime_secs", "Topology_Id");
                    System.out.println("----------------------------------------------------------------------------------------");
                    for (TopologySummary topology : topologies) {
                        System.out.printf(MSG_FORMAT, topology.get_name(), topology.get_status(),
                                          topology.get_num_tasks(), topology.get_num_workers(),
                                          topology.get_uptime_secs(), topology.get_id());
                    }
                }
            }
        });
    }
}


text:
package org.apache.camel.component.zookeeper.cluster;

import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import org.apache.camel.RuntimeCamelException;
import org.apache.camel.cluster.CamelClusterMember;
import org.apache.camel.cluster.CamelClusterService;
import org.apache.camel.component.zookeeper.ZooKeeperCuratorConfiguration;
import org.apache.camel.support.cluster.AbstractCamelClusterView;
import org.apache.camel.support.task.BlockingTask;
import org.apache.camel.support.task.Tasks;
import org.apache.camel.support.task.budget.Budgets;
import org.apache.camel.support.task.budget.IterationBoundedBudget;
import org.apache.camel.util.ObjectHelper;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.leader.LeaderSelector;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListenerAdapter;
import org.apache.curator.framework.recipes.leader.Participant;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final class ZooKeeperClusterView extends AbstractCamelClusterView {
    private static final Logger LOGGER = LoggerFactory.getLogger(ZooKeeperClusterView.class);

    private final ZooKeeperCuratorConfiguration configuration;
    private final CuratorFramework client;
    private final CuratorLocalMember localMember;
    private volatile LeaderSelector leaderSelector;

    public ZooKeeperClusterView(CamelClusterService cluster, ZooKeeperCuratorConfiguration configuration,
                                CuratorFramework client, String namespace) {
        super(cluster, namespace);

        this.localMember = new CuratorLocalMember();
        this.configuration = configuration;
        this.client = client;
    }

    @Override
    public CamelClusterMember getLocalMember() {
        return this.localMember;
    }

    @Override
    public Optional<CamelClusterMember> getLeader() {
        if (leaderSelector == null || isStoppingOrStopped()) {
            return Optional.empty();
        }

        try {
            Participant participant = leaderSelector.getLeader();

            return ObjectHelper.equal(participant.getId(), localMember.getId())
                    ? Optional.of(localMember)
                    : Optional.of(new CuratorClusterMember(participant));
        } catch (KeeperException.NoNodeException e) {
            LOGGER.debug("Failed to get get master because node '{}' does not yet exist (error: '{}')",
                    getFullPath(),
                    e.getMessage());
            return Optional.empty();
        } catch (Exception e) {
            throw new RuntimeCamelException(e);
        }
    }

    @Override
    public List<CamelClusterMember> getMembers() {
        if (leaderSelector == null) {
            return Collections.emptyList();
        }

        try {
            return leaderSelector.getParticipants()
                    .stream()
                    .map(CuratorClusterMember::new)
                    .collect(Collectors.toList());
        } catch (KeeperException.NoNodeException e) {
            LOGGER.debug("Failed to get members because node '{}' does not yet exist (error: '{}')",
                    getFullPath(),
                    e.getMessage());
            return Collections.emptyList();
        } catch (Exception e) {
            throw new RuntimeCamelException(e);
        }
    }

    @Override
    protected void doStart() throws Exception {
        if (leaderSelector == null) {
            leaderSelector = new LeaderSelector(client, getFullPath(), new CamelLeaderElectionListener());
            leaderSelector.setId(getClusterService().getId());
            leaderSelector.start();
        } else {
            leaderSelector.requeue();
        }
    }

    @Override
    protected void doStop() throws Exception {
        if (leaderSelector != null) {
            leaderSelector.interruptLeadership();
            fireLeadershipChangedEvent(getLeader());
        }
    }

    @Override
    protected void doShutdown() throws Exception {
        if (leaderSelector != null) {
            leaderSelector.close();
        }
    }

    private String getFullPath() {
        return configuration.getBasePath() + "/" + getNamespace();
    }

    // ***********************************************
    //
    // ***********************************************

    private final class CamelLeaderElectionListener extends LeaderSelectorListenerAdapter {
        @Override
        public void takeLeadership(CuratorFramework curatorFramework) throws Exception {
            fireLeadershipChangedEvent(Optional.of(localMember));

            BlockingTask task = Tasks.foregroundTask().withBudget(Budgets.iterationBudget()
                    .withMaxIterations(IterationBoundedBudget.UNLIMITED_ITERATIONS)
                    .withInterval(Duration.ofSeconds(5))
                    .build())
                    .build();

            task.run(() -> !isRunAllowed());

            fireLeadershipChangedEvent(getLeader());
        }
    }

    private final class CuratorLocalMember implements CamelClusterMember {
        @Override
        public boolean isLeader() {
            return leaderSelector != null ? leaderSelector.hasLeadership() : false;
        }

        @Override
        public boolean isLocal() {
            return true;
        }

        @Override
        public String getId() {
            return getClusterService().getId();
        }
    }

    private final class CuratorClusterMember implements CamelClusterMember {
        private final Participant participant;

        CuratorClusterMember(Participant participant) {
            this.participant = participant;
        }

        @Override
        public String getId() {
            return participant.getId();
        }

        @Override
        public boolean isLocal() {
            return (participant.getId() != null)
                    ? ObjectHelper.equal(participant.getId(), localMember.getId())
                    : false;
        }

        @Override
        public boolean isLeader() {
            try {
                return leaderSelector.getLeader().equals(this.participant);
            } catch (Exception e) {
                LOGGER.debug("", e);
                return false;
            }
        }
    }
}


text:
namespace ee {
namespace ad_mob {
namespace {
// clang-format off
const std::string kPrefix                = "AdMobBridge";
const auto kInitialize                   = kPrefix + "Initialize";
const auto kGetEmulatorTestDeviceHash    = kPrefix + "GetEmulatorTestDeviceHash";
const auto kAddTestDevice                = kPrefix + "AddTestDevice";
const auto kGetBannerAdSize              = kPrefix + "GetBannerAdSize";
const auto kOpenTestSuite                = kPrefix + "OpenTestSuite";
const auto kCreateBannerAd               = kPrefix + "CreateBannerAd";
const auto kCreateNativeAd               = kPrefix + "CreateNativeAd";
const auto kCreateAppOpenAd              = kPrefix + "CreateAppOpenAd";
const auto kCreateInterstitialAd         = kPrefix + "CreateInterstitialAd";
const auto kCreateRewardedInterstitialAd = kPrefix + "CreateRewardedInterstitialAd";
const auto kCreateRewardedAd             = kPrefix + "CreateRewardedAd";
const auto kDestroyAd                    = kPrefix + "DestroyAd";
// clang-format on
} // namespace

using Self = Bridge;

Self::Bridge(IMessageBridge& bridge, ILogger& logger,
             const Destroyer& destroyer)
    : bridge_(bridge)
    , logger_(logger)
    , destroyer_(destroyer)
    , network_("ad_mob") {
    logger_.debug("%s", __PRETTY_FUNCTION__);
    auto&& mediation = ads::MediationManager::getInstance();
    displayer_ = mediation.getAdDisplayer();
}

Self::~Bridge() = default;

void Self::destroy() {
    logger_.debug("%s", __PRETTY_FUNCTION__);
    for (auto&& [key, value] : ads_) {
        value->destroy();
    }
    destroyer_();
}

Task<bool> Self::initialize() {
    auto response = co_await bridge_.callAsync(kInitialize);
    co_return core::toBool(response);
}

std::string Self::getEmulatorTestDeviceHash() const {
    return bridge_.call(kGetEmulatorTestDeviceHash);
}

void Self::addTestDevice(const std::string& hash) {
    bridge_.call(kAddTestDevice, hash);
}

std::pair<int, int> Self::getBannerAdSize(BannerAdSize adSize) {
    auto response = bridge_.call(kGetBannerAdSize,
                                 std::to_string(static_cast<int>(adSize)));
    auto json = nlohmann::json::parse(response);
    int width = json["width"];
    int height = json["height"];
    return std::pair(width, height);
}

void Self::openTestSuite() {
    bridge_.call(kOpenTestSuite);
}

std::shared_ptr<IBannerAd> Self::createBannerAd(const std::string& adId,
                                                BannerAdSize adSize) {
    logger_.debug("%s: id = %s size = %d", __PRETTY_FUNCTION__, adId.c_str(),
                  static_cast<int>(adSize));
    auto iter = ads_.find(adId);
    if (iter != ads_.cend()) {
        return std::dynamic_pointer_cast<IBannerAd>(iter->second);
    }
    nlohmann::json json;
    json["adId"] = adId;
    json["adSize"] = static_cast<int>(adSize);
    auto response = bridge_.call(kCreateBannerAd, json.dump());
    if (not core::toBool(response)) {
        logger_.error("%s: There was an error when attempt to create an ad.",
                      __PRETTY_FUNCTION__);
        assert(false);
        return nullptr;
    }
    auto size = getBannerAdSize(adSize);
    auto ad = std::make_shared<ads::GuardedBannerAd>(
        std::make_shared<ads::DefaultBannerAd>( //
            "AdMobBannerAd", bridge_, logger_,
            [this, adId] { //
                destroyAd(adId);
            },
            network_, adId, size));
    ads_.emplace(adId, ad);
    return ad;
}

std::shared_ptr<IBannerAd>
Self::createNativeAd(const std::string& adId, const std::string& layoutName,
                     const NativeAdLayout& identifiers) {
    logger_.debug("%s: id = %s", __PRETTY_FUNCTION__, adId.c_str());
    auto iter = ads_.find(adId);
    if (iter != ads_.cend()) {
        return std::dynamic_pointer_cast<IBannerAd>(iter->second);
    }
    nlohmann::json json;
    json["adId"] = adId;
    json["layoutName"] = layoutName;
    json["identifiers"] = identifiers.params_;
    auto&& response = bridge_.call(kCreateNativeAd, json.dump());
    if (not core::toBool(response)) {
        logger_.error("%s: There was an error when attempt to create an ad.",
                      __PRETTY_FUNCTION__);
        assert(false);
        return nullptr;
    }
    auto ad = std::make_shared<ads::GuardedBannerAd>(
        std::make_shared<ads::DefaultBannerAd>(
            "AdMobNativeAd", bridge_, logger_,
            [this, adId] { //
                destroyAd(adId);
            },
            network_, adId, std::pair(0, 0)));
    ads_.emplace(adId, ad);
    return ad;
}

std::shared_ptr<IFullScreenAd> Self::createAppOpenAd(const std::string& adId) {
    return createFullScreenAd(kCreateAppOpenAd, adId, [this, adId] {
        return std::make_shared<ads::DefaultFullScreenAd>(
            "AdMobAppOpenAd", bridge_, logger_, displayer_,
            [this, adId] { //
                return destroyAd(adId);
            },
            [](const std::string& message) { //
                return AdResult::Completed;
            },
            network_, adId);
    });
}

std::shared_ptr<IFullScreenAd>
Self::createInterstitialAd(const std::string& adId) {
    return createFullScreenAd(kCreateInterstitialAd, adId, [this, adId] {
        return std::make_shared<ads::DefaultFullScreenAd>(
            "AdMobInterstitialAd", bridge_, logger_, displayer_,
            [this, adId] { //
                return destroyAd(adId);
            },
            [](const std::string& message) { //
                return AdResult::Completed;
            },
            network_, adId);
    });
}

std::shared_ptr<IFullScreenAd>
Self::createRewardedInterstitialAd(const std::string& adId) {
    return createFullScreenAd(
        kCreateRewardedInterstitialAd, adId, [this, adId] {
            return std::make_shared<ads::DefaultFullScreenAd>(
                "AdMobRewardedInterstitialAd", bridge_, logger_, displayer_,
                [this, adId] { //
                    return destroyAd(adId);
                },
                [](const std::string& message) { //
                    return core::toBool(message) ? AdResult::Completed
                                                 : AdResult::Canceled;
                },
                network_, adId);
        });
}

std::shared_ptr<IFullScreenAd> Self::createRewardedAd(const std::string& adId) {
    return createFullScreenAd(kCreateRewardedAd, adId, [this, adId] {
        return std::make_shared<ads::DefaultFullScreenAd>(
            "AdMobRewardedAd", bridge_, logger_, displayer_,
            [this, adId] { //
                return destroyAd(adId);
            },
            [](const std::string& message) { //
                return core::toBool(message) ? AdResult::Completed
                                             : AdResult::Canceled;
            },
            network_, adId);
    });
}

std::shared_ptr<IFullScreenAd> Self::createFullScreenAd(
    const std::string& handlerId, const std::string& adId,
    const std::function<std::shared_ptr<IFullScreenAd>()>& creator) {
    logger_.debug("%s: id = %s", __PRETTY_FUNCTION__, adId.c_str());
    auto iter = ads_.find(adId);
    if (iter != ads_.cend()) {
        return std::dynamic_pointer_cast<IFullScreenAd>(iter->second);
    }
    auto response = bridge_.call(handlerId, adId);
    if (not core::toBool(response)) {
        logger_.error("%s: There was an error when attempt to create an ad.",
                      __PRETTY_FUNCTION__);
        assert(false);
        return nullptr;
    }
    auto ad = std::make_shared<ads::GuardedFullScreenAd>(creator());
    ads_.emplace(adId, ad);
    return ad;
}

bool Self::destroyAd(const std::string& adId) {
    logger_.debug("%s: id = %s", __PRETTY_FUNCTION__, adId.c_str());
    auto iter = ads_.find(adId);
    if (iter == ads_.cend()) {
        return false;
    }
    auto&& response = bridge_.call(kDestroyAd, adId);
    if (not core::toBool(response)) {
        logger_.error("%s: There was an error when attempt to destroy an ad.",
                      __PRETTY_FUNCTION__);
        assert(false);
        return false;
    }
    ads_.erase(iter);
    return true;
}
} // namespace ad_mob
} // namespace ee


text:
package ProjectPong;

import MorcoWrapper2D.*;

public class StartManager extends mw2_Script
{
	private int mWinCondition = 5;
	private mw2_Text mWinConditionText;
	private float mRadiusSmall;
	private float mRadiusBig;
	private mw2_Vector2 mOnScreenStart = new mw2_Vector2();
	private mw2_Vector2 mOnScreenPlus = new mw2_Vector2();
	private mw2_Vector2 mOnScreenMinus = new mw2_Vector2();
	private mw2_Audio mPaddleSound;
	private mw2_Audio mMusicSound;
	private mw2_Rect mButtonStart;

	@Override
	public void Start()
	{
		if (mw2_Globals.HasKey("WinCondition"))
		{
			mWinCondition = mw2_Globals.GetInt("WinCondition");
		}

		mw2_Scene scene = mw2_Application.GetScene();

		mWinConditionText = (mw2_Text) scene.FindObject("winValue");
		mWinConditionText.mText = "" + mWinCondition;

		mw2_Image buttonPlus = (mw2_Image) scene.FindObject("button_plus");
		mw2_Image buttonMinus = (mw2_Image) scene.FindObject("button_minus");
		mButtonStart = (mw2_Rect) scene.FindObject("button_start");

		mOnScreenPlus = scene.mCamera.WorldToScreen( buttonPlus.WorldPosition() );
		mOnScreenMinus = scene.mCamera.WorldToScreen( buttonMinus.WorldPosition() );
		mOnScreenStart = scene.mCamera.WorldToScreen( mButtonStart.WorldPosition() );

		mRadiusSmall = buttonPlus.mSize.x / 2;
		mRadiusBig = mButtonStart.mSize.x / 2;

		mPaddleSound = new mw2_Audio("../__Resources/Pong/sound_paddle.wav");
		mMusicSound = new mw2_Audio("../__Resources/Pong/sound_music.wav");
		mMusicSound.PlayLoop();
	}

	@Override
	public void Update(float deltaTime)
	{
		// rotate start button
		mButtonStart.RotateWorld(20);

		mw2_Vector2 mouse = mw2_Input.GetMousePos();

		// check mouse click
		if (mw2_Input.GetMouseBtnOnce(mw2_Input.Button.LEFT))
		{
			float xPlus = mOnScreenPlus.x - mouse.x;
			float yPlus = mOnScreenPlus.y - mouse.y;

			float xMinus = mOnScreenMinus.x - mouse.x;
			float yMinus = mOnScreenMinus.y - mouse.y;

			float xStart = mOnScreenStart.x - mouse.x;
			float yStart = mOnScreenStart.y - mouse.y;

			if (xPlus * xPlus + yPlus * yPlus <= mRadiusSmall * mRadiusSmall)
			{
				if (mWinCondition < 99)
				{
					mWinCondition += 1;
					mWinConditionText.mText = "" + mWinCondition;
				}
				mPaddleSound.PlayOnce();
			}
			else if (xMinus * xMinus + yMinus * yMinus <= mRadiusSmall * mRadiusSmall)
			{
				if (mWinCondition > 1)
				{
					mWinCondition -= 1;
					mWinConditionText.mText = "" + mWinCondition;
				}
				mPaddleSound.PlayOnce();
			}
			else if (xStart * xStart + yStart * yStart <= mRadiusBig * mRadiusBig)
			{
				mw2_Globals.SetInt("WinCondition", mWinCondition);
				mw2_Application.LoadScene( new GameScene(), new GameManager() );
			}
		}

		if (mw2_Input.GetKeyOnce(mw2_Input.Key.ESC))
		{
			mw2_Application.Exit();
		}
	}

	@Override
	public void Stop()
	{
		mMusicSound.Stop();
	}
}


text:
#include <QtCore/qglobal.h>
#include <QtCore/qpoint.h>
#include <QtCore/qstring.h>
#include <QtGui/qpolygon.h>
#include <QtCore/qstringbuilder.h>

#ifndef QSTYLEHELPER_P_H
#define QSTYLEHELPER_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

QT_BEGIN_NAMESPACE

class QPainter;
class QPixmap;
class QStyleOptionSlider;
class QStyleOption;

namespace QStyleHelper
{
    QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size);
    qreal dpiScaled(qreal value);
#ifndef QT_NO_DIAL
    qreal angle(const QPointF &p1, const QPointF &p2);
    QPolygonF calcLines(const QStyleOptionSlider *dial);
    int calcBigLineSize(int radius);
    void drawDial(const QStyleOptionSlider *dial, QPainter *painter);
#endif //QT_NO_DIAL
    void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
                     int left = 0, int top = 0, int right = 0,
                     int bottom = 0);
}

// internal helper. Converts an integer value to an unique string token
template <typename T>
        struct HexString
{
    inline HexString(const T t)
        : val(t)
    {}

    inline void write(QChar *&dest) const
    {
        const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
        const char *c = reinterpret_cast<const char *>(&val);
        for (uint i = 0; i < sizeof(T); ++i) {
            *dest++ = hexChars[*c & 0xf];
            *dest++ = hexChars[(*c & 0xf0) >> 4];
            ++c;
        }
    }
    const T val;
};

// specialization to enable fast concatenating of our string tokens to a string
template <typename T>
        struct QConcatenable<HexString<T> >
{
    typedef HexString<T> type;
    enum { ExactSize = true };
    static int size(const HexString<T> &) { return sizeof(T) * 2; }
    static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
    typedef QString ConvertTo;
};

QT_END_NAMESPACE

#endif // QSTYLEHELPER_P_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common"
 xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
 <info:identity>
   <info:name>SamplePacketDPDKSource</info:name>
   <info:description>SamplePacketDPDKSource</info:description>
   <info:version>1.0.0</info:version>
   <info:requiredProductVersion>4.1.1.4</info:requiredProductVersion>
 </info:identity>
 <info:dependencies/>
</info:toolkitInfoModel>


text:
FROM phusion/baseimage:0.9.16

ENV HOME /srv/app

RUN apt-get update && apt-get install -y python-pip python-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN adduser --disabled-password --gecos "" app

ADD ./requirements.txt /requirements.txt
RUN /usr/bin/pip install -r /requirements.txt

RUN mkdir -p /srv/app
ADD . /srv/app
RUN chown -R app: /srv/app

EXPOSE 8000
USER app
WORKDIR /srv/app

ENTRYPOINT /usr/local/bin/uwsgi --ini /srv/app/uwsgi.ini


text:
SecurityEventRecorderFactory* SecurityEventRecorderFactory::GetInstance() {
  return base::Singleton<SecurityEventRecorderFactory>::get();
}

// static
SecurityEventRecorder* SecurityEventRecorderFactory::GetForProfile(
    Profile* profile) {
  DCHECK(!profile->IsOffTheRecord());
  return static_cast<SecurityEventRecorder*>(
      GetInstance()->GetServiceForBrowserContext(profile, true));
}
SecurityEventRecorderFactory::SecurityEventRecorderFactory()
    : ProfileKeyedServiceFactory("SecurityEventRecorder") {
  DependsOn(ModelTypeStoreServiceFactory::GetInstance());
}

SecurityEventRecorderFactory::~SecurityEventRecorderFactory() {}

KeyedService* SecurityEventRecorderFactory::BuildServiceInstanceFor(
    content::BrowserContext* context) const {
  Profile* profile = static_cast<Profile*>(context);
  syncer::OnceModelTypeStoreFactory store_factory =
      ModelTypeStoreServiceFactory::GetForProfile(profile)->GetStoreFactory();

  auto change_processor =
      std::make_unique<syncer::ClientTagBasedModelTypeProcessor>(
          syncer::SECURITY_EVENTS,
          base::BindRepeating(&syncer::ReportUnrecoverableError,
                              chrome::GetChannel()));
  auto security_event_sync_bridge =
      std::make_unique<SecurityEventSyncBridgeImpl>(
          std::move(store_factory), std::move(change_processor));
  return new SecurityEventRecorderImpl(std::move(security_event_sync_bridge),
                                       base::DefaultClock::GetInstance());
}


text:
package io.ona.ziggy.util;

import static android.util.Log.*;

public class Log {
    public static void logVerbose(String message) {
        v("ZIGGY", message);
    }

    public static void logInfo(String message) {
        i("ZIGGY", message);
    }

    public static void logDebug(String message) {
        d("ZIGGY", message);
    }

    public static void logWarn(String message) {
        w("ZIGGY", message);
    }

    public static void logError(String message) {
        e("ZIGGY", message);
    }
}


text:
<?php

return array(

	/*
	|--------------------------------------------------------------------------
	| Dutch validation language file
	|--------------------------------------------------------------------------
	|
	*/

	"accepted"       => ":attribute moet geaccepteerd zijn.",
	"active_url"     => ":attribute is geen geldige URL.",
	"after"          => ":attribute moet een datum na :date zijn.",
	"alpha"          => ":attribute mag alleen letters bevatten.",
	"alpha_dash"     => ":attribute mag alleen letters, nummers, onderstreep(_) en strepen(-) bevatten.",
	"alpha_num"      => ":attribute mag alleen letters en nummers bevatten.",
	"array"          => ":attribute moet geselecteerde elementen bevatten.",
	"before"         => ":attribute moet een datum voor :date zijn.",
	"between"        => array(
		"numeric" => ":attribute moet tussen :min en :max zijn.",
		"file"    => ":attribute moet tussen :min en :max kilobytes zijn.",
		"string"  => ":attribute moet tussen :min en :max karakters zijn.",
	),
	"confirmed"      => ":attribute bevestiging komt niet overeen.",
	"count"          => ":attribute moet precies :count geselecteerde elementen bevatten.",
	"countbetween"   => ":attribute moet tussen :min en :max geselecteerde elementen bevatten.",
	"countmax"       => ":attribute moet minder dan :max geselecteerde elementen bevatten.",
	"countmin"       => ":attribute moet minimaal :min geselecteerde elementen bevatten.",
	"date_format"	 => ":attribute moet een geldige datum formaat bevatten.",
	"different"      => ":attribute en :other moeten verschillend zijn.",
	"email"          => ":attribute is geen geldig e-mailadres.",
	"exists"         => ":attribute bestaat niet.",
	"image"          => ":attribute moet een afbeelding zijn.",
	"in"             => ":attribute is ongeldig.",
	"integer"        => ":attribute moet een getal zijn.",
	"ip"             => ":attribute moet een geldig IP-adres zijn.",
	"match"          => "Het formaat van :attribute is ongeldig.",
	"max"            => array(
		"numeric" => ":attribute moet minder dan :max zijn.",
		"file"    => ":attribute moet minder dan :max kilobytes zijn.",
		"string"  => ":attribute moet minder dan :max karakters zijn.",
	),
	"mimes"          => ":attribute moet een bestand zijn van het bestandstype :values.",
	"min"            => array(
		"numeric" => ":attribute moet minimaal :min zijn.",
		"file"    => ":attribute moet minimaal :min kilobytes zijn.",
		"string"  => ":attribute moet minimaal :min karakters zijn.",
	),
	"not_in"         => "Het formaat van :attribute is ongeldig.",
	"numeric"        => ":attribute moet een nummer zijn.",
	"required"       => ":attribute is verplicht.",
	"required_with"  => ":attribute is verplicht i.c.m. :field",
	"same"           => ":attribute en :other moeten overeenkomen.",
	"size"           => array(
		"numeric" => ":attribute moet :size zijn.",
		"file"    => ":attribute moet :size kilobyte zijn.",
		"string"  => ":attribute moet :size characters zijn.",
	),
	"unique"         => ":attribute is al in gebruik.",
	"url"            => ":attribute is geen geldige URL.",

	/*
	|--------------------------------------------------------------------------
	| Custom Validation Language Lines
	|--------------------------------------------------------------------------
	|
	| Here you may specify custom validation messages for attributes using the
	| convention "attribute_rule" to name the lines. This helps keep your
	| custom validation clean and tidy.
	|
	| So, say you want to use a custom validation message when validating that
	| the "email" attribute is unique. Just add "email_unique" to this array
	| with your custom message. The Validator will handle the rest!
	|
	*/

	'custom' => array(),

	/*
	|--------------------------------------------------------------------------
	| Validation Attributes
	|--------------------------------------------------------------------------
	|
	| The following language lines are used to swap attribute place-holders
	| with something more reader friendly such as "E-Mail Address" instead
	| of "email". Your users will thank you.
	|
	| The Validator class will automatically search this array of lines it
	| is attempting to replace the :attribute place-holder in messages.
	| It's pretty slick. We think you'll like it.
	|
	*/

	'attributes' => array(),

);


text:
    <form enctype="multipart/form-data">
        <input id="title" type="text" placeholder="Document title"/>
        <input id="author" type="text" placeholder="Documents author"/>
        <input id="files" type="file" name="files" size=30 multiple/>
        <input id="annotations" type="text" placeholder="Document annotations separated by comma " />
        <button type="button"
                onclick="uploadDocument(
                    [...document.getElementById('files').files],
                    document.getElementById('title').value,
                    document.getElementById('author').value,
                    document.getElementById('annotations').value)">
            Press me to upload your document.
        </button>
    </form>
    <button onclick="getDocuments()">
        Press me to display basic information about all your documents.
    </button>

    <form enctype="multipart/form-data">
        <input type="text" id="ownerId" placeholder="owner-id"/>
        <input type="text" id="docId" placeholder="document-id"/>
        <button onclick="getDocument(
            document.getElementById('ownerId').value,
            document.getElementById('docId').value)">
            Press me to display the requested document.
        </button>
    </form>


text:
package persistence.specifications;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.springframework.data.jpa.domain.Specification;
import persistence.models.User;
import persistence.models.User_;
import web.models.datatables.FilterUser;

/**
 *
 * @author sergio
 */
public class UserFilterSpecification implements Specification<User> {

    private FilterUser filterUser;

    public UserFilterSpecification(FilterUser filterUser) {
        this.filterUser = filterUser;
    }

    @Override
    public Predicate toPredicate(Root<User> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
        List<Predicate> predicates = new ArrayList<>();
        // filter by user id
        if (filterUser.getId() != null) {
            predicates.add(cb.equal(root.get(User_.id), filterUser.getId()));
        }
        // filter by username
        if(filterUser.getUsername() != null && !filterUser.getUsername().isEmpty()){
            predicates.add(cb.like(cb.lower(root.get(User_.username)), "%" + filterUser.getUsername().toLowerCase() + "%"));
        }
        // filter by fullname
        if(filterUser.getFullname()!= null && !filterUser.getFullname().isEmpty()){
            predicates.add(cb.like(cb.lower(root.get(User_.fullName)), "%" + filterUser.getFullname().toLowerCase() + "%"));
        }
        // filter by last access from
        if(filterUser.getLastLoginAccessFrom() != null){
            predicates.add(cb.greaterThanOrEqualTo(root.get(User_.lastLoginAccess), filterUser.getLastLoginAccessFrom()));
        }
        // filter by last access to
        if(filterUser.getLastLoginAccessTo()!= null){
            predicates.add(cb.lessThanOrEqualTo(root.get(User_.lastLoginAccess), filterUser.getLastLoginAccessTo()));
        }
        // exclude current user
        if(filterUser.getCurrentUser() != null){
            predicates.add(cb.notEqual(root.get(User_.id), filterUser.getCurrentUser()));
        }
        return andTogether(predicates, cb);
    }

    private Predicate andTogether(List<Predicate> predicates, CriteriaBuilder cb) {
        return cb.and(predicates.toArray(new Predicate[0]));
    }
}