text:
<?php

final class DifferentialCreateRevisionConduitAPIMethod
  extends DifferentialConduitAPIMethod {

  public function getAPIMethodName() {
    return 'differential.createrevision';
  }

  public function getMethodDescription() {
    return pht('Create a new Differential revision.');
  }

  public function getMethodStatus() {
    return self::METHOD_STATUS_FROZEN;
  }

  public function getMethodStatusDescription() {
    return pht(
      'This method is frozen and will eventually be deprecated. New code '.
      'should use "differential.revision.edit" instead.');
  }

  protected function defineParamTypes() {
    return array(
      // TODO: Arcanist passes this; prevent fatals after D4191 until Conduit
      // version 7 or newer.
      'user'   => 'ignored',
      'diffid' => 'required diffid',
      'fields' => 'required dict',
    );
  }

  protected function defineReturnType() {
    return 'nonempty dict';
  }

  protected function defineErrorTypes() {
    return array(
      'ERR_BAD_DIFF' => pht('Bad diff ID.'),
    );
  }

  protected function execute(ConduitAPIRequest $request) {
    $viewer = $request->getUser();

    $diff = id(new DifferentialDiffQuery())
      ->setViewer($viewer)
      ->withIDs(array($request->getValue('diffid')))
      ->executeOne();
    if (!$diff) {
      throw new ConduitException('ERR_BAD_DIFF');
    }

    $revision = DifferentialRevision::initializeNewRevision($viewer);
    $revision->attachReviewers(array());

    $result = $this->applyFieldEdit(
      $request,
      $revision,
      $diff,
      $request->getValue('fields', array()),
      $message = null);

    $revision_id = $result['object']['id'];

    return array(
      'revisionid'  => $revision_id,
      'uri'         => PhabricatorEnv::getURI('/D'.$revision_id),
    );
  }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Caeoma periclymenatum Link

### Remarks
null

redpajama_set_name: RedPajamaGithub


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

001
002
005
006package org.jsimpledb.parse.func;
007
008import com.google.common.collect.Iterables;
009
010import java.util.regex.Matcher;
011
012import org.jsimpledb.JClass;
013import org.jsimpledb.JObject;
014import org.jsimpledb.JTransaction;
015import org.jsimpledb.SessionMode;
016import org.jsimpledb.core.UnknownTypeException;
017import org.jsimpledb.parse.ParseContext;
018import org.jsimpledb.parse.ParseException;
019import org.jsimpledb.parse.ParseSession;
020import org.jsimpledb.parse.expr.AbstractValue;
021import org.jsimpledb.parse.expr.EvalException;
022import org.jsimpledb.parse.expr.ExprParser;
023import org.jsimpledb.parse.expr.IdentNode;
024import org.jsimpledb.parse.expr.Node;
025import org.jsimpledb.parse.expr.Value;
026import org.jsimpledb.parse.util.ParseCastFunction;
027
028@Function(modes = SessionMode.JSIMPLEDB)
029public class InvertFunction extends AbstractFunction {
030
031    public InvertFunction() {
032        super("invert");
033    }
034
035    @Override
036    public String getHelpSummary() {
037        return "Inverts a path of references";
038    }
039
040    @Override
041    public String getUsage() {
042        return "invert(type.fields..., objects)";
043    }
044
045    @Override
046    public String getHelpDetail() {
047        return "The invert() function inverts a reference path. The first parameter is the reference path, in the form"
048          + " of type name followed by a dot-separated list of one or more reference fields. The second parameter is a"
049          + " collection of target objects. The return value is the set of all objects that refer to any of the target"
050          + " objects through the path of references. This function does not work when running in core API mode.";
051    }
052
053    @Override
054    public InvertInfo parseParams(final ParseSession session, final ParseContext ctx, final boolean complete) {
055
056        // Parse entire reference path
057        final int mark = ctx.getIndex();
058        final Matcher matcher = ctx.tryPattern(IdentNode.NAME_PATTERN + "\\s*(\\.\\s*" + IdentNode.NAME_PATTERN + "\\s*)*");
059        if (matcher == null)
060            throw new ParseException(ctx, "invalid reference path");
061        final String path = matcher.group().replaceAll("\\s+", "");
062        final int firstDot = path.indexOf('.');
063        if (firstDot == -1) {
064            ctx.setIndex(mark);
065            throw new ParseException(ctx, "invalid reference path");
066        }
067        final String typeName = path.substring(0, firstDot);
068        final String fieldPath = path.substring(firstDot + 1);
069
070        // Find start type
071        final JClass<?> jclass;
072        try {
073            jclass = session.getJSimpleDB().getJClass(session.getNameIndex().getSchemaObjectType(typeName).getStorageId());
074        } catch (UnknownTypeException e) {
075            ctx.setIndex(mark);
076            throw new ParseException(ctx, "invalid type `" + typeName + "': " + e.getMessage(), e);
077        }
078
079        // Verify reference path is valid (although we don't verify the last field in the path is a reference field here)
080        try {
081            session.getJSimpleDB().parseReferencePath(jclass.getType(), fieldPath);
082        } catch (IllegalArgumentException e) {
083            ctx.setIndex(mark);
084            throw new ParseException(ctx, "invalid path `" + fieldPath + "': " + e.getMessage(), e);
085        }
086
087        // Parase expression
088        ctx.skipWhitespace();
089        if (!ctx.tryLiteral(","))
090            throw new ParseException(ctx, "expected `,'").addCompletion(", ");
091        this.spaceParser.parse(ctx, complete);
092        final Node expr = new ExprParser().parse(session, ctx, complete);
093
094        // Finish parse
095        ctx.skipWhitespace();
096        if (!ctx.tryLiteral(")"))
097            throw new ParseException(ctx, "expected `)'").addCompletion(") ");
098
099        // Done
100        return new InvertInfo(jclass, fieldPath, expr);
101    }
102
103    @Override
104    public Value apply(ParseSession session, Object params) {
105        final InvertInfo info = (InvertInfo)params;
106        return new AbstractValue() {
107            @Override
108            public Object get(ParseSession session) {
109
110                // Evaluate expression
111                final Iterable<?> items = info.getExpr().evaluate(session).checkType(session, "invert()", Iterable.class);
112                final Iterable<JObject> jobjs = Iterables.transform(items, new ParseCastFunction<JObject>(JObject.class));
113
114                // Invert references to iterated objects
115                try {
116                    return JTransaction.getCurrent().invertReferencePath(info.getJClass().getType(), info.getFieldPath(), jobjs);
117                } catch (Exception e) {
118                    throw new EvalException("invert() failed: " + e, e);
119                }
120            }
121        };
122    }
123
124// InvertInfo
125
126    private static class InvertInfo {
127
128        private final JClass<?> jclass;
129        private final String fieldPath;
130        private final Node expr;
131
132        InvertInfo(JClass<?> jclass, String fieldPath, Node expr) {
133            this.jclass = jclass;
134            this.fieldPath = fieldPath;
135            this.expr = expr;
136        }
137
138        public JClass<?> getJClass() {
139            return this.jclass;
140        }
141
142        public String getFieldPath() {
143            return this.fieldPath;
144        }
145
146        public Node getExpr() {
147            return this.expr;
148        }
149    }
150}
151


text:
package com.jakewharton.smsbarrage.ui;

import android.app.Activity;

public class About extends Activity {

}


text:
/**
 * @author Mihai Şucan
 * @fileOverview Holds the pencil tool implementation.
 */

/**
 * @class The drawing pencil.
 *
 * @param {PaintWeb} app Reference to the main paint application object.
 */
pwlib.tools.pencil = function (app) {
  var _self         = this,
      clearInterval = app.win.clearInterval,
      context       = app.buffer.context,
      image         = app.image,
      mouse         = app.mouse,
      setInterval   = app.win.setInterval;

  /**
   * The interval ID used for running the pencil drawing operation every few
   * milliseconds.
   *
   * @private
   * @see PaintWeb.config.toolDrawDelay
   */
  var timer = null;

  /**
   * Holds the points needed to be drawn. Each point is added by the
   * mousemove event handler.
   *
   * @private
   * @type Array
   */
  var points = [];

  /**
   * Holds the last point on the <var>x</var> axis of the image, for the current
   * drawing operation.
   *
   * @private
   * @type Number
   */
  var x0 = 0;

  /**
   * Holds the last point on the <var>y</var> axis of the image, for the current
   * drawing operation.
   *
   * @private
   * @type Number
   */
  var y0 = 0;

  /**
   * Tool deactivation event handler.
   */
  this.deactivate = function () {
    if (timer) {
      clearInterval(timer);
      timer = null;
    }

    if (mouse.buttonDown) {
      context.clearRect(0, 0, image.width, image.height);
    }

    points = [];
  };

  /**
   * Initialize the drawing operation.
   */
  this.mousedown = function () {
    x0 = mouse.x;
    y0 = mouse.y;

    points = [];
    if (!timer) {
      timer = setInterval(_self.draw, app.config.toolDrawDelay);
    }

    return true;
  };

  /**
   * Save the mouse coordinates in the array.
   */
  this.mousemove = function () {
    if (mouse.buttonDown) {
      points.push(mouse.x, mouse.y);
    }
  };

  /**
   * Draw the points in the stack. This function is called every few
   * milliseconds.
   *
   * @see PaintWeb.config.toolDrawDelay
   */
  this.draw = function () {
    var i = 0, n = points.length;
    if (!n) {
      return;
    }

    context.beginPath();
    context.moveTo(x0, y0);

    while (i < n) {
      x0 = points[i++];
      y0 = points[i++];
      context.lineTo(x0, y0);
    }

    context.stroke();
    context.closePath();

    points = [];
  };

  /**
   * End the drawing operation, once the user releases the mouse button.
   */
  this.mouseup = function () {
    if (mouse.x == x0 && mouse.y == y0) {
      points.push(x0+1, y0+1);
    }

    if (timer) {
      clearInterval(timer);
      timer = null;
    }

    _self.draw();
    app.layerUpdate();

    return true;
  };

  /**
   * Allows the user to press Escape to cancel the drawing operation.
   *
   * @param {Event} ev The DOM Event object.
   *
   * @returns {Boolean} True if the drawing operation was cancelled, or false if
   * not.
   */
  this.keydown = function (ev) {
    if (!mouse.buttonDown || ev.kid_ != 'Escape') {
      return false;
    }

    if (timer) {
      clearInterval(timer);
      timer = null;
    }

    context.clearRect(0, 0, image.width, image.height);
    mouse.buttonDown = false;
    points = [];

    return true;
  };
};

// vim:set spell spl=en fo=wan1croqlt tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix:


text:
package at.outdated.bitcoin.exchange.mtgox.auth;

import java.util.Date;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: ebirn
 * Date: 03.05.13
 * Time: 10:47
 * To change this template use File | Settings | File Templates.
 */
public class Nonce {

    static long nonce = 0;
    static Random rnd = new Random();

    static {
        Date now = new Date();
        rnd.setSeed(now.getTime());

        nonce = rnd.nextInt(10000);
    }

    public static long next() {
        //nonce += increment();

        Date now = new Date();

        return now.getTime();
    }

    private static long increment() {
        return rnd.nextInt(1000);
    }

}


text:
/* Producr theme - MINT COLOR SCHEME */
/* #03ceb9 (mint), #35d37d (green), #f5a610 (orange), #68b5e6 (blue), #e37341 (peach), #ea5644 (red), #a564bf (violet), #a9927d (brown) */

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
a, .k-call-out em, .btn-link,
#menu-nav .sub-menu li a, #menu-nav .sub-menu li a:link, #menu-nav .sub-menu li a:visited,
#navigation-mobile li a, #navigation-mobile li a:link, #navigation-mobile li a:visited,
.product-box-hover .product-title a:link, .product-box-hover .product-title a:visited,
.k_mid_callout_color, .k-work-hours, .k-faq-wrap .panel-title a:hover, .k-faq-wrap .panel-title a:focus,
a.list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #03ceb9; }
/* ----- elements */
#k-head, #k-footer, .k-fancy-title-tit, .k-widget-title-tit, #k-sidebar-splitter span,
.btn-default, .label-default, .k-article-more, .k-article-prev-next,
.k-work-prev, .k-work-next,
.pagination > li > a:hover, .pagination > li > a:focus,
.pagination > .active > a, .pagination > .active > span,
.product-box-hover .product-box-link .product-box-overlay-icon, .k-team-text .tit,
.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus,
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus, .modal-header,
.k-user-feedback-wrap-inverse .k-user-feedback-box, .audioplayer-bar-played, .k-fancy-icon-wrap:hover .k-fancy-icon { background-color: #03ceb9 !important; }

.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { border-color: #03ceb9 !important; }

article .carousel, .k-article-featured-img, .notez, .mezage { border-bottom-color: #03ceb9 !important; }

.k-user-feedback-wrap-inverse .k-user-feedback-tit { border-top-color: #03ceb9 !important; }

.form-control:focus, textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus,
input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus,
input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus,
input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus,
.uneditable-input:focus { border-color: #03ceb9 !important; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #03ceb9 !important; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #03ceb9 !important; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px #03ceb9 !important; }

.k-fancy-icon:after { box-shadow: 0 0 0 5px #03ceb9; }


text:
import java.util.stream.Collectors;
import java.util.stream.Stream;

class Test {
  boolean anyMatch(Stream<String> stream) {
    return stream.peek(System.out::println).collect(Collectors.toList()).stream().anyMatch(s -> s.length() > 1);
  }
}


text:
package com.linkedin.playparseq.trace.controllers

import com.linkedin.parseq.{Engine, GraphvizEngine, HttpResponse, Task}
import com.linkedin.playparseq.s.PlayParSeqImplicits._
import com.linkedin.playparseq.utils.PlayParSeqHelper
import controllers.Assets
import java.io.ByteArrayInputStream
import java.nio.file.{Files, Path}
import javax.inject.{Inject, Singleton}
import javax.servlet.http.HttpServletResponse
import org.apache.commons.io.FileUtils
import play.api.Configuration
import play.api.Logger
import play.api.inject.ApplicationLifecycle
import play.api.mvc.{Action, AnyContent, BaseController, ControllerComponents, Result}
import scala.concurrent.{ExecutionContext, Future}
import scala.sys.process
import scala.util.{Failure, Success, Try}

/**
 * The class ParSeqTraceViewer is a Controller to generate ParSeq Trace page with dot file and manage all the ParSeq
 * Trace resources.
 *
 * @param engine The injected ParSeq Engine component
 * @param applicationLifecycle The injected ApplicationLifeCycle component
 * @param configuration The injected Configuration component
 * @param assets The injected Assets Controller
 * @param controllerComponents The injected Controller component
 * @param executionContext The injected [[ExecutionContext]] component
 * @author Yinan Ding (yding@linkedin.com)
 */
@Singleton
class ParSeqTraceViewer @Inject()(engine: Engine, applicationLifecycle: ApplicationLifecycle, configuration: Configuration, assets: Assets, val controllerComponents: ControllerComponents)(implicit executionContext: ExecutionContext) extends PlayParSeqHelper with BaseController {

  /**
   * A happy logger.
   */
  private val logger = Logger(classOf[ParSeqTraceViewer])

  /**
   * The field cachePath is the file path of the ParSeq Trace cache directory.
   */
  private lazy val cachePath: Path = Files.createTempDirectory("cache")

  /**
   * The field graphvizEngine is for generating graphviz files.
   */
  private lazy val graphvizEngine: GraphvizEngine = new GraphvizEngine(getDotLocation, cachePath, getCacheSize, getTimeoutMilliseconds, getParallelLevel, getDelayMilliseconds, getProcessQueueSize)

  /**
   * The field setup is for starting the GraphvizEngine and hooking cleanup to application lifecycle.
   */
  private lazy val setup = {
    // Start the GraphvizEngine
    graphvizEngine.start()
    // Add stop hook
    applicationLifecycle.addStopHook(() => Future {
      // Stop the GraphvizEngine
      graphvizEngine.stop()
      // Clear cache directory
      FileUtils.deleteDirectory(cachePath.toFile)
    })
  }

  /**
   * The method at returns the ParSeq Trace resource file.
   *
   * @param file The file name
   * @return The Action
   */
  def at(file: String): Action[AnyContent] = {
    setup
    if (file.startsWith("cache")) {
      // Cache file
      Action {
        Ok.sendFile(cachePath.resolve(file.split("/")(1)).toFile)
      }
    } else {
      // Resource file
      assets.at("/tracevis", file)
    }
  }

  /**
   * The method dot generates graphviz files and returns the build response as result.
   *
   * @return The Action
   */
  def dot: Action[AnyContent] = Action.async(request => {
    // Get hash value
    val hash = request.getQueryString("hash").orNull
    // Get body info
    val body = request.body.asText.map((b) => new ByteArrayInputStream(b.getBytes)).orNull
    // Build files
    val task: Task[Result] = graphvizEngine.build(hash, body).map((response: HttpResponse) => {
      // Generate Result
      response.getStatus.intValue match {
        case HttpServletResponse.SC_OK => Ok(response.getBody)
        case HttpServletResponse.SC_BAD_GATEWAY => BadRequest(response.getBody)
        case _ => InternalServerError(response.getBody)
      }
    })
    // Run task
    val result = bindTaskToFuture(task)
    engine.run(task)
    result
  })

  /**
   * The methods getDotLocation gets the file path of the dot from conf file, otherwise it will get from the system.
   *
   * @return The file path
   */
  private[this] def getDotLocation: String = configuration.getOptional[String]("parseq.trace.docLocation").getOrElse(Try {
    System.getProperty("os.name").toLowerCase match {
      case u if u.indexOf("mac") >= 0 || u.indexOf("nix") >= 0 || u.indexOf("nux") >= 0 || u.indexOf("aix") >= 0 => process.stringToProcess("which dot").!!.trim
      case w if w.indexOf("win") >= 0 => process.stringToProcess("where dot").!!.trim
      case _ => null
    }
  } match {
    case Success(value) => value
    case Failure(_) => logger.error("No executable for dot found. See http://www.graphviz.org."); null
  })

  /**
   * The method getCacheSize gets the number of cache items in the GraphvizEngine from conf file, otherwise it will
   * generate a default value, which is 1024.
   *
   * @return The number of cache
   */
  private[this] def getCacheSize: Int = configuration.getOptional[Int]("parseq.trace.cacheSize").getOrElse(1024)

  /**
   * The method getTimeoutSeconds gets the timeout of the GraphvizEngine execution in the unit of milliseconds from conf
   * file, otherwise it will generate a default value, which is 5000.
   *
   * @return The timeout in milliseconds
   */
  private[this] def getTimeoutMilliseconds: Long = configuration.getOptional[Long]("parseq.trace.timeoutMilliseconds").getOrElse(5000)

  /**
   * The method getParallelLevel gets the maximum of the GraphvizEngine's parallel level from conf file, otherwise it
   * will generate a default value, which is the number of available processors.
   *
   * @return The parallel level
   */
  private[this] def getParallelLevel: Int = configuration.getOptional[Int]("parseq.trace.parallelLevel").getOrElse(Runtime.getRuntime.availableProcessors)

  /**
   * The method getDelayMilliseconds gets the delay time between different executions of the GraphvizEngine in the unit
   * of milliseconds from conf file, otherwise it will generate a default value, which is 5.
   *
   * @return The delay time in milliseconds
   */
  private[this] def getDelayMilliseconds: Long = configuration.getOptional[Long]("parseq.trace.delayMilliseconds").getOrElse(5)

  /**
   * The method getProcessQueueSize gets the size of the GraphvizEngine's process queue from conf file, otherwise it
   * will generate a default value, which is 1000.
   *
   * @return The size of process queue
   */
  private[this] def getProcessQueueSize: Int = configuration.getOptional[Int]("parseq.trace.processQueueSize").getOrElse(1000)

}


text:
package com.rackspace.prefs

import com.mchange.v2.c3p0.ComboPooledDataSource
import com.rackspace.prefs.model.InitDbTrait
import org.junit.runner.RunWith
import org.scalatest.FunSuiteLike
import org.scalatest.junit.JUnitRunner
import org.scalatra.test.scalatest.ScalatraSuite

import scala.slick.jdbc.JdbcBackend._
import scala.util.parsing.json.JSON

/**
 * Created by shin4590 on 3/5/15.
 */
@RunWith(classOf[JUnitRunner])
class StatusTest extends ScalatraSuite with FunSuiteLike with InitDbTrait {

    val db = Database.forDataSource(new ComboPooledDataSource)

    override def beforeAll {
        super.beforeAll
        clearData(db)
    }

    test("should get 200: GET /status") {
        addServlet(new PreferencesService(db), "/*")
        get("/status") {
            status should equal (200)
            val countConversionFunc = {input: String => new Integer(input)}
            JSON.perThreadNumberParser = countConversionFunc
            val prefStatus = JSON.parseFull(body)
            val statusMap = prefStatus.get.asInstanceOf[Map[String, Int]]
            statusMap.get("metadata-count").get should be > (0)
            info(body)
        }
    }

    // this needs to be the last test run, cuz it's going to drop
    // the Preferences Metadata table
    test("should get 500: GET /status when metadata table does not exist") {
        dropMetadata(db)
        try {
            get("/status") {
                status should equal(500)
                info(body)
            }
        } finally {
            createMetadata(db)
        }
    }
}


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

<link href="doc-style.css" type="text/css" rel="StyleSheet">

		Local Properties

Managed Object Types	Data Object Types	All Properties	All Methods

Data Object - NetIpConfigSpecIpAddressSpec

Property of

NetIpConfigSpec

Extends

DynamicData

Since

vSphere API 4.1

Data Object
                  Description

         Provides for configuration of IP Addresses.

Properties

	          Name

	          Type

	          Description

ipAddress	xsd:string

         IPv4 address is specified using
  dotted decimal notation.  For example, "192.0.2.1".
  IPv6 addresses are 128-bit addresses specified as
  eight fields of up to four hexadecimal digits.
  A colon separates each field (:). For example,
  2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the
  symbol '::' to represent multiple 16-bit groups of
  contiguous 0's only once in an address as described in RFC 2373.

operation	xsd:string

         Requires one of: "add" and "remove" or "change"
 See HostConfigChangeOperation.

prefixLength	xsd:int

         Denotes the length of a generic Internet network address
 prefix.
 The prefix length for IPv4 the value range is 0-32.
 For IPv6 prefixLength is a decimal value range 0-128.
 A value of n corresponds to an IP address mask
 that has n contiguous 1-bits from the most significant
 bit (MSB), with all other bits set to 0.
 A value of zero is valid only if the calling context defines
 it.

						Properties inherited from DynamicData

dynamicProperty, dynamicType

Show WSDL type definition

<textarea cols="20" rows="10" name="wsdl-textarea" wrap="off" readonly="1" id="wsdl-textarea">         <complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="NetIpConfigSpecIpAddressSpec">
            <complexContent>
               <extension base="vim25:DynamicData">
                  <sequence>
                     <element name="ipAddress" type="xsd:string"/>
                     <element name="prefixLength" type="xsd:int"/>
                     <element name="operation" type="xsd:string"/>
                  </sequence>
               </extension>
            </complexContent>
         </complexType></textarea>

Top of page		Local Properties

Managed Object Types	Data Object Types	All Properties	All Methods


text:
/**
 * https://jarvis.corp.linkedin.com/codesearch/result/?name=Locale.pdsc&path=models%2Fmodels%2Fsrc%2Fmain%2Fpegasus%2Fcom%2Flinkedin%2Fcommon&reponame=netrepo%2Fmodels#Locale
 */
export interface ILocale {
  // A lowercase two-letter language code as defined by ISO-639.
  language: string;
  // An uppercase two-letter country code as defined by ISO-3166.
  country?: string;
  // Vendor or browser-specific code.
  variant?: string;
}


text:
package nl.uu.trafficmas.tests.roadNetwork;

import static org.junit.Assert.assertEquals;

import java.util.HashSet;
import java.util.Set;

import nl.uu.trafficmas.roadnetwork.Edge;
import nl.uu.trafficmas.roadnetwork.Node;
import nl.uu.trafficmas.roadnetwork.Road;
import nl.uu.trafficmas.roadnetwork.RoadNetwork;

import org.junit.Test;

public class AddEdgeTest {

	@Test
	public void addEdge() {
		RoadNetwork rn = new RoadNetwork();

		Node node = new Node("test",5,5);
		Road road = new Road("r",5.0,null,1);
		rn.addNode(node);
		Edge edge = new Edge(node,node,road);
		rn.addEdge(edge);
		assertEquals(1,rn.getEdges().length);
		assertEquals(rn.getEdges()[0], edge);

		Node node2 = new Node("test2",5,5);
		rn.addEdge(node, node2, road);

		Set<Edge> edgeSet = new HashSet<Edge>();
		for(Edge e: rn.getEdges()) {
			edgeSet.add(e);
		}

		assertEquals(rn.getEdges().length, 2);

		assertEquals(true, edgeSet.contains(edge));
		assertEquals(true, edgeSet.contains(new Edge(node, node2, road)));
	}

}


text:
<tool id="biom_subset_table" name="Subset" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>a BIOM table</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="exit_code">
        <![CDATA[
            biom subset-table
              --input-json-fp '$input_json_fp'
              --output-fp '$output_fp'
              --axis '$axis'
              --ids '$ids'
        ]]>
    </command>
    <inputs>
        <param name="input_json_fp" argument="--input-json-fp" type="data" format="biom1" label="BIOM table to subset" />
        <param argument="--axis" type="select" label="The axis to subset over">
            <option value="sample" selected="True">Sample</option>
            <option value="observation">Observation</option>
        </param>
        <param argument="--ids" type="data" format="txt,tabular" label="file containing a single column of IDs to retain" />
    </inputs>
    <outputs>
        <data format="biom1" name="output_fp"/>
    </outputs>
    <tests>
        <test>
            <param name="input_json_fp" value="input_abundance_1.biom1" />
            <param name="axis" value="sample" />
            <param name="ids" value="sample_subsetting" />
            <output name="output_fp" file="subset_samples.biom" ftype="biom1" compare="sim_size"/>
        </test>
        <test>
            <param name="input_json_fp" value="input_abundance_1.biom1" />
            <param name="axis" value="observation" />
            <param name="ids" value="observation_subsetting" />
            <output name="output_fp" file="subset_observations.biom" ftype="biom1" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
Subset a BIOM table, over either observations or samples, without fully parsing it. This command is intended to assist in working with very large tables when tight on memory, or as a lightweight way to subset a full table. Currently, it is possible to produce tables with rows or columns (observations or samples) that are fully zeroed.
    ]]></help>
    <expand macro="citations" />
</tool>


text:
<?php namespace CodeIgniter\Events;

define('EVENT_PRIORITY_LOW', 200);
define('EVENT_PRIORITY_NORMAL', 100);
define('EVENT_PRIORITY_HIGH', 10);

/**
 * Events
 */
class Events
{

	/**
	 * The list of listeners.
	 *
	 * @var array
	 */
	protected static $listeners = [];

	/**
	 * Flag to let us know if we've read from the Config file
	 * and have all of the defined events.
	 *
	 * @var bool
	 */
	protected static $haveReadFromFile = false;

	/**
	 * The path to the file containing the events to load in.
	 *
	 * @var string
	 */
	protected static $eventsFile;

	/**
	 * If true, events will not actually be fired.
	 * Useful during testing.
	 *
	 * @var bool
	 */
	protected static $simulate = false;

	/**
	 * Stores information about the events
	 * for display in the debug toolbar.
	 * @var array
	 */
	protected static $performanceLog = [];

	//--------------------------------------------------------------------

	/**
	 * Ensures that we have a events file ready.
	 *
	 * @param string|null $file
	 */
	public static function initialize(string $file = null)
	{
		// Don't overwrite anything....
		if ( ! empty(self::$eventsFile))
		{
			return;
		}

		// Default value
		if (empty($file))
		{
			$file = APPPATH . 'Config/Events.php';
		}

		self::$eventsFile = $file;
	}

	//--------------------------------------------------------------------

	/**
	 * Registers an action to happen on an event. The action can be any sort
	 * of callable:
	 *
	 *  Events::on('create', 'myFunction');               // procedural function
	 *  Events::on('create', ['myClass', 'myMethod']);    // Class::method
	 *  Events::on('create', [$myInstance, 'myMethod']);  // Method on an existing instance
	 *  Events::on('create', function() {});              // Closure
	 *
	 * @param          $event_name
	 * @param callable $callback
	 * @param int      $priority
	 */
	public static function on($event_name, callable $callback, $priority = EVENT_PRIORITY_NORMAL)
	{
		if ( ! isset(self::$listeners[$event_name]))
		{
			self::$listeners[$event_name] = [
				true, // If there's only 1 item, it's sorted.
				[$priority],
				[$callback],
			];
		}
		else
		{
			self::$listeners[$event_name][0] = false; // Not sorted
			self::$listeners[$event_name][1][] = $priority;
			self::$listeners[$event_name][2][] = $callback;
		}
	}

	//--------------------------------------------------------------------

	/**
	 * Runs through all subscribed methods running them one at a time,
	 * until either:
	 *  a) All subscribers have finished or
	 *  b) a method returns false, at which point execution of subscribers stops.
	 *
	 * @param $eventName
	 * @param $arguments
	 *
	 * @return bool
	 */
	public static function trigger($eventName, ...$arguments): bool
	{
		// Read in our Config/events file so that we have them all!
		if ( ! self::$haveReadFromFile)
		{
			self::initialize();

			if (is_file(self::$eventsFile))
			{
				include self::$eventsFile;
			}
			self::$haveReadFromFile = true;
		}

		$listeners = self::listeners($eventName);

		foreach ($listeners as $listener)
		{
			$start = microtime(true);

			$result = static::$simulate === false
				? $listener(...$arguments)
				: true;

			if (CI_DEBUG)
			{
				static::$performanceLog[] = [
					'start' => $start,
					'end' => microtime(true),
					'event' => strtolower($eventName)
				];
			}

			if ($result === false)
			{
				return false;
			}
		}

		return true;
	}

	//--------------------------------------------------------------------

	/**
	 * Returns an array of listeners for a single event. They are
	 * sorted by priority.
	 *
	 * If the listener could not be found, returns FALSE, or TRUE if
	 * it was removed.
	 *
	 * @param $event_name
	 *
	 * @return array
	 */
	public static function listeners($event_name): array
	{
		if ( ! isset(self::$listeners[$event_name]))
		{
			return [];
		}

		// The list is not sorted
		if ( ! self::$listeners[$event_name][0])
		{
			// Sort it!
			array_multisort(self::$listeners[$event_name][1], SORT_NUMERIC, self::$listeners[$event_name][2]);

			// Mark it as sorted already!
			self::$listeners[$event_name][0] = true;
		}

		return self::$listeners[$event_name][2];
	}

	//--------------------------------------------------------------------

	/**
	 * Removes a single listener from an event.
	 *
	 * If the listener couldn't be found, returns FALSE, else TRUE if
	 * it was removed.
	 *
	 * @param          $event_name
	 * @param callable $listener
	 *
	 * @return bool
	 */
	public static function removeListener($event_name, callable $listener): bool
	{
		if ( ! isset(self::$listeners[$event_name]))
		{
			return false;
		}

		foreach (self::$listeners[$event_name][2] as $index => $check)
		{
			if ($check === $listener)
			{
				unset(self::$listeners[$event_name][1][$index]);
				unset(self::$listeners[$event_name][2][$index]);

				return true;
			}
		}

		return false;
	}

	//--------------------------------------------------------------------

	/**
	 * Removes all listeners.
	 *
	 * If the event_name is specified, only listeners for that event will be
	 * removed, otherwise all listeners for all events are removed.
	 *
	 * @param null $event_name
	 */
	public static function removeAllListeners($event_name = null)
	{
		if ( ! is_null($event_name))
		{
			unset(self::$listeners[$event_name]);
		}
		else
		{
			self::$listeners = [];
		}
	}

	//--------------------------------------------------------------------

	/**
	 * Sets the path to the file that routes are read from.
	 *
	 * @param string $path
	 */
	public function setFile(string $path)
	{
		self::$eventsFile = $path;
	}

	//--------------------------------------------------------------------

	/**
	 * Turns simulation on or off. When on, events will not be triggered,
	 * simply logged. Useful during testing when you don't actually want
	 * the tests to run.
	 *
	 * @param bool $choice
	 */
	public static function simulate(bool $choice = true)
	{
		static::$simulate = $choice;
	}

	//--------------------------------------------------------------------

	/**
	 * Getter for the performance log records.
	 *
	 * @return array
	 */
	public static function getPerformanceLogs()
	{
		return static::$performanceLog;
	}

	//--------------------------------------------------------------------

}


text:
namespace Microsoft.Azure.CognitiveServices.Vision.Face
{
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for PersonGroupPerson.
    /// </summary>
    public static partial class PersonGroupPersonExtensions
    {
            /// <summary>
            /// Create a new person in a specified person group.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='name'>
            /// User defined name, maximum length is 128.
            /// </param>
            /// <param name='userData'>
            /// User specified data. Length should not exceed 16KB.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<Person> CreateAsync(this IPersonGroupPerson operations, string personGroupId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(personGroupId, name, userData, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// List all persons in a person group, and retrieve person information
            /// (including personId, name, userData and persistedFaceIds of registered
            /// faces of the person).
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='start'>
            /// Starting person id to return (used to list a range of persons).
            /// </param>
            /// <param name='top'>
            /// Number of persons to return starting with the person id indicated by the
            /// 'start' parameter.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IList<Person>> ListAsync(this IPersonGroupPerson operations, string personGroupId, string start = default(string), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(personGroupId, start, top, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Delete an existing person from a person group. All stored person data, and
            /// face features in the person entry will be deleted.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(personGroupId, personId, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Retrieve a person's information, including registered persisted faces, name
            /// and userData.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<Person> GetAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(personGroupId, personId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Update name or userData of a person.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='name'>
            /// User defined name, maximum length is 128.
            /// </param>
            /// <param name='userData'>
            /// User specified data. Length should not exceed 16KB.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task UpdateAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, string name = default(string), string userData = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.UpdateWithHttpMessagesAsync(personGroupId, personId, name, userData, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Delete a face from a person. Relative feature for the persisted face will
            /// also be deleted.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='persistedFaceId'>
            /// Id referencing a particular persistedFaceId of an existing face.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteFaceAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, System.Guid persistedFaceId, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteFaceWithHttpMessagesAsync(personGroupId, personId, persistedFaceId, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Retrieve information about a persisted face (specified by persistedFaceId,
            /// personId and its belonging personGroupId).
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='persistedFaceId'>
            /// Id referencing a particular persistedFaceId of an existing face.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<PersistedFace> GetFaceAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, System.Guid persistedFaceId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetFaceWithHttpMessagesAsync(personGroupId, personId, persistedFaceId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Update a person persisted face's userData field.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='persistedFaceId'>
            /// Id referencing a particular persistedFaceId of an existing face.
            /// </param>
            /// <param name='userData'>
            /// User-provided data attached to the face. The size limit is 1KB.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task UpdateFaceAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, System.Guid persistedFaceId, string userData = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.UpdateFaceWithHttpMessagesAsync(personGroupId, personId, persistedFaceId, userData, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Add a representative face to a person for identification. The input face is
            /// specified as an image with a targetFace rectangle.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='url'>
            /// Publicly reachable URL of an image
            /// </param>
            /// <param name='userData'>
            /// User-specified data about the face for any purpose. The maximum length is
            /// 1KB.
            /// </param>
            /// <param name='targetFace'>
            /// A face rectangle to specify the target face to be added to a person in the
            /// format of "targetFace=left,top,width,height". E.g.
            /// "targetFace=10,10,100,100". If there is more than one face in the image,
            /// targetFace is required to specify which face to add. No targetFace means
            /// there is only one face detected in the entire image.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<PersistedFace> AddFaceFromUrlAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AddFaceFromUrlWithHttpMessagesAsync(personGroupId, personId, url, userData, targetFace, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Add a representative face to a person for identification. The input face is
            /// specified as an image with a targetFace rectangle.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='personGroupId'>
            /// Id referencing a particular person group.
            /// </param>
            /// <param name='personId'>
            /// Id referencing a particular person.
            /// </param>
            /// <param name='image'>
            /// An image stream.
            /// </param>
            /// <param name='userData'>
            /// User-specified data about the face for any purpose. The maximum length is
            /// 1KB.
            /// </param>
            /// <param name='targetFace'>
            /// A face rectangle to specify the target face to be added to a person in the
            /// format of "targetFace=left,top,width,height". E.g.
            /// "targetFace=10,10,100,100". If there is more than one face in the image,
            /// targetFace is required to specify which face to add. No targetFace means
            /// there is only one face detected in the entire image.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<PersistedFace> AddFaceFromStreamAsync(this IPersonGroupPerson operations, string personGroupId, System.Guid personId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.AddFaceFromStreamWithHttpMessagesAsync(personGroupId, personId, image, userData, targetFace, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @constructor
 * @param {!Element} element
 * @param {!Array.<string>} transferTypes
 * @param {string} messageText
 * @param {function(!DataTransfer)} handleDrop
 */
WebInspector.DropTarget = function(element, transferTypes, messageText, handleDrop)
{
    element.addEventListener("dragenter", this._onDragEnter.bind(this), true);
    element.addEventListener("dragover", this._onDragOver.bind(this), true);
    this._element = element;
    this._transferTypes = transferTypes;
    this._messageText = messageText;
    this._handleDrop = handleDrop;
    this._enabled = true;
}

WebInspector.DropTarget.Types = {
    Files: "Files",
    URIList: "text/uri-list"
}

WebInspector.DropTarget.prototype = {
    /**
     * @param {boolean} enabled
     */
    setEnabled: function(enabled)
    {
        this._enabled = enabled;
    },

    /**
     * @param {!Event} event
     */
    _onDragEnter: function(event)
    {
        if (this._enabled && this._hasMatchingType(event))
            event.consume(true);
    },

    /**
     * @param {!Event} event
     * @return {boolean}
     */
    _hasMatchingType: function(event)
    {
        for (var type of this._transferTypes) {
            if (event.dataTransfer.types.indexOf(type) !== -1)
                return true;
        }
        return false;
    },

    /**
     * @param {!Event} event
     */
    _onDragOver: function(event)
    {
        if (!this._enabled || !this._hasMatchingType(event))
            return;
        event.dataTransfer.dropEffect = "copy";
        event.consume(true);
        if (this._dragMaskElement)
            return;
        this._dragMaskElement = this._element.createChild("div", "");
        var shadowRoot = WebInspector.createShadowRootWithCoreStyles(this._dragMaskElement, "ui/dropTarget.css");
        shadowRoot.createChild("div", "drop-target-message").textContent = this._messageText;
        this._dragMaskElement.addEventListener("drop", this._onDrop.bind(this), true);
        this._dragMaskElement.addEventListener("dragleave", this._onDragLeave.bind(this), true);
    },

    /**
     * @param {!Event} event
     */
    _onDrop: function(event)
    {
        event.consume(true);
        this._removeMask();
        if (this._enabled)
            this._handleDrop(event.dataTransfer);
    },

    /**
     * @param {!Event} event
     */
    _onDragLeave: function(event)
    {
        event.consume(true);
        this._removeMask();
    },

    _removeMask: function()
    {
        this._dragMaskElement.remove();
        delete this._dragMaskElement;
    }
}


text:
<?php

namespace Symfony\Component\Security\Http\RememberMe;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;

/**
 * Adds remember-me cookies to the Response.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 *
 * @final
 */
class ResponseListener implements EventSubscriberInterface
{
    /**
     * This attribute name can be used by the implementation if it needs to set
     * a cookie on the Request when there is no actual Response, yet.
     */
    public const COOKIE_ATTR_NAME = '_security_remember_me_cookie';

    public function onKernelResponse(ResponseEvent $event)
    {
        if (!$event->isMainRequest()) {
            return;
        }

        $request = $event->getRequest();
        $response = $event->getResponse();

        if ($request->attributes->has(self::COOKIE_ATTR_NAME)) {
            $response->headers->setCookie($request->attributes->get(self::COOKIE_ATTR_NAME));
        }
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents(): array
    {
        return [KernelEvents::RESPONSE => 'onKernelResponse'];
    }
}


text:
import VNode from 'core/vdom/vnode'
import { renderAttr } from './attrs'
import { isDef, isUndef, extend, toString } from 'shared/util'
import { propsToAttrMap, isRenderableAttr } from '../util'
import type { VNodeWithData } from 'types/vnode'

export default function renderDOMProps(node: VNodeWithData): string {
  let props = node.data.domProps
  let res = ''

  let parent = node.parent
  while (isDef(parent)) {
    if (parent.data && parent.data.domProps) {
      props = extend(extend({}, props), parent.data.domProps)
    }
    parent = parent.parent
  }

  if (isUndef(props)) {
    return res
  }

  const attrs = node.data.attrs
  for (const key in props) {
    if (key === 'innerHTML') {
      setText(node, props[key], true)
    } else if (key === 'textContent') {
      setText(node, props[key], false)
    } else if (key === 'value' && node.tag === 'textarea') {
      setText(node, toString(props[key]), false)
    } else {
      // $flow-disable-line (WTF?)
      const attr = propsToAttrMap[key] || key.toLowerCase()
      if (
        isRenderableAttr(attr) &&
        // avoid rendering double-bound props/attrs twice
        !(isDef(attrs) && isDef(attrs[attr]))
      ) {
        res += renderAttr(attr, props[key])
      }
    }
  }
  return res
}

function setText(node, text, raw) {
  const child = new VNode(undefined, undefined, undefined, text)
  child.raw = raw
  node.children = [child]
}


text:
Memories of writing a parser for man pages
======

I generally enjoy being bored, but sometimes enough is enough—that was the case a Sunday afternoon of 2015 when I decided to start an open source project to overcome my boredom.

In my quest for ideas, I stumbled upon a request to build a ["Man page viewer built with web standards"][1] by [Mathias Bynens][2] and without thinking too much, I started coding a man page parser in JavaScript, which after a lot of back and forths, ended up being [Jroff][3].

Back then, I was familiar with manual pages as a concept and used them a fair amount of times, but that was all I knew, I had no idea how they were generated or if there was a standard in place. Two years later, here are some thoughts on the matter.

### How man pages are written

The first thing that surprised me at the time, was the notion that manpages at their core are just plain text files stored somewhere in the system (you can check this directory using the `manpath` command).

This files not only contain the documentation, but also formatting information using a typesetting system from the 1970s called `troff`.

> troff, and its GNU implementation groff, are programs that process a textual description of a document to produce typeset versions suitable for printing. **It's more 'What you describe is what you get' rather than WYSIWYG.**
>
> — extracted from [troff.org][4]

If you are totally unfamiliar with typesetting formats, you can think of them as Markdown on steroids, but in exchange for the flexibility you have a more complex syntax:

![groff-compressor][5]

The `groff` file can be written manually, or generated from other formats such as Markdown, Latex, HTML, and so on with many different tools.

Why `groff` and man pages are tied together has to do with history, the format has [mutated along time][6], and his lineage is composed of a chain of similarly-named programs: RUNOFF > roff > nroff > troff > groff.

But this doesn't necessarily mean that `groff` is strictly related to man pages, it's a general-purpose format that has been used to [write books][7] and even for [phototypesetting][8].

Moreover, It's worth noting that `groff` can also call a postprocessor to convert its intermediate output to a final format, which is not necessarily ascii for terminal display! some of the supported formats are: TeX DVI, HTML, Canon, HP LaserJet4 compatible, PostScript, utf8 and many more.

### Macros

Other of the cool features of the format is its extensibility, you can write macros that enhance the basic functionalities.

With the vast history of *nix systems, there are several macro packages that group useful macros together for specific functionalities according to the output that you want to generate, examples of macro packages are `man`, `mdoc`, `mom`, `ms`, `mm`, and the list goes on.

Manual pages are conventionally written using `man` and `mdoc`.

You can easily distinguish native `groff` commands from macros by the way standard `groff` packages capitalize their macro names. For `man`, each macro's name is uppercased, like .PP, .TH, .SH, etc. For `mdoc`, only the first letter is uppercased: .Pp, .Dt, .Sh.

![groff-example][9]

### Challenges

Whether you are considering to write your own `groff` parser, or just curious, these are some of the problems that I have found more challenging.

#### Context-sensitive grammar

Formally, `groff` has a context-free grammar, unfortunately, since macros describe opaque bodies of tokens, the set of macros in a package may not itself implement a context-free grammar.

This kept me away (for good or bad) from the parser generators that were available at the time.

#### Nested macros

Most of the macros in `mdoc` are callable, this roughly means that macros can be used as arguments of other macros, for example, consider this:

  * The macro `Fl` (Flag) adds a dash to its argument, so `Fl s` produces `-s`
  * The macro `Ar` (Argument) provides facilities to define arguments
  * The `Op` (Optional) macro wraps its argument in brackets, as this is the standard idiom to define something as optional.
  * The following combination `.Op Fl s Ar file` produces `[-s file]` because `Op` macros can be nested.

#### Lack of beginner-friendly resources

Something that really confused me was the lack of a canonical, well defined and clear source to look at, there's a lot of information in the web which assumes a lot about the reader that it takes time to grasp.

### Interesting macros

To wrap up, I will offer to you a very short list of macros that I found interesting while developing jroff:

**man**

  * TH: when writing manual pages with `man` macros, your first line that is not a comment must be this macro, it accepts five parameters: title section date source manual
  * BI: bold alternating with italics (especially useful for function specifications)
  * BR: bold alternating with Roman (especially useful for referring to other manual pages)

**mdoc**

  * .Dd, .Dt, .Os: similar to how `man` macros require the `.TH` the `mdoc` macros require these three macros, in that particular order. Their initials stand for: Document date, Document title and Operating system.
  * .Bl, .It, .El: these three macros are used to create list, their names are self-explanatory: Begin list, Item and End list.

--------------------------------------------------------------------------------

via: https://monades.roperzh.com/memories-writing-parser-man-pages/

作者:[Roberto Dip][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
选题:[lujun9972](https://github.com/lujun9972)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]:https://monades.roperzh.com
[1]:https://github.com/h5bp/lazyweb-requests/issues/114
[2]:https://mathiasbynens.be/
[3]:jroff
[4]:https://www.troff.org/
[5]:https://user-images.githubusercontent.com/4419992/37868021-2e74027c-2f7f-11e8-894b-80829ce39435.gif
[6]:https://manpages.bsd.lv/history.html
[7]:https://rkrishnan.org/posts/2016-03-07-how-is-gopl-typeset.html
[8]:https://en.wikipedia.org/wiki/Phototypesetting
[9]:https://user-images.githubusercontent.com/4419992/37866838-e602ad78-2f6e-11e8-97a9-2a4494c766ae.jpg


text:
using OpenProtocolInterpreter.Converters;
using System;
using System.Collections.Generic;
using System.Linq;

namespace OpenProtocolInterpreter.ParameterSet
{
    /// <summary>
    /// Set Parameter set batch size
    /// <para>This message gives the possibility to set the batch size of a parameter set at run time.</para>
    /// <para>Message sent by: Integrator</para>
    /// <para>
    ///     Answer: <see cref="Communication.Mid0005"/> Command accepted or
    ///     <see cref="Communication.Mid0004"/> Command error, Invalid data
    /// </para>
    /// </summary>
    public class Mid0019 : Mid, IParameterSet, IIntegrator
    {
        private readonly IValueConverter<int> _intConverter;
        private const int LAST_REVISION = 1;
        public const int MID = 19;

        public int ParameterSetId
        {
            get => GetField(1,(int)DataFields.PARAMETER_SET_ID).GetValue(_intConverter.Convert);
            set => GetField(1,(int)DataFields.PARAMETER_SET_ID).SetValue(_intConverter.Convert, value);
        }
        public int BatchSize
        {
            get => GetField(1,(int)DataFields.BATCH_SIZE).GetValue(_intConverter.Convert);
            set => GetField(1,(int)DataFields.BATCH_SIZE).SetValue(_intConverter.Convert, value);
        }

        public Mid0019() : this(new Header()
        {
            Mid = MID,
            Revision = LAST_REVISION
        })
        {
        }

        public Mid0019(Header header) : base(header)
        {
            _intConverter = new Int32Converter();
        }

        /// <summary>
        /// Revision 1 Constructor
        /// </summary>
        /// <param name="parameterSetId">Three ASCII digits, range 000-999</param>
        /// <param name="batchSize">Two ASCII digits, range 01-99</param>
        public Mid0019(int parameterSetId, int batchSize) : this()
        {
            ParameterSetId = parameterSetId;
            BatchSize = batchSize;
        }

        protected override Dictionary<int, List<DataField>> RegisterDatafields()
        {
            return new Dictionary<int, List<DataField>>()
            {
                {
                    1, new List<DataField>()
                            {
                                new DataField((int)DataFields.PARAMETER_SET_ID, 20, 3, '0', DataField.PaddingOrientations.LEFT_PADDED, false),
                                new DataField((int)DataFields.BATCH_SIZE, 23, 2, '0', DataField.PaddingOrientations.LEFT_PADDED, false),
                            }
                }
            };
        }

        /// <summary>
        /// Validate all fields size
        /// </summary>
        public bool Validate(out IEnumerable<string> errors)
        {
            List<string> failed = new List<string>();
            if (ParameterSetId < 0 || ParameterSetId > 999)
                failed.Add(new ArgumentOutOfRangeException(nameof(ParameterSetId), "Range: 000-999").Message);
            if (BatchSize < 0 || BatchSize > 99)
                failed.Add(new ArgumentOutOfRangeException(nameof(BatchSize), "Range: 00-99").Message);

            errors = failed;
            return errors.Any();
        }

        public enum DataFields
        {
            PARAMETER_SET_ID,
            BATCH_SIZE
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using MOE.Common.Models;
using SPM.Filters;

namespace SPM.Controllers
{
    public class ApproachesController : Controller
    {
        //private MOE.Common.Models.SPM db = new MOE.Common.Models.SPM();
        MOE.Common.Models.Repositories.IApproachRepository approachRepository =
                    MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
        MOE.Common.Models.Repositories.ISignalsRepository signalRepository =
            MOE.Common.Models.Repositories.SignalsRepositoryFactory.Create();
        MOE.Common.Models.Repositories.IDirectionTypeRepository directionRepository =
                MOE.Common.Models.Repositories.DirectionTypeRepositoryFactory.Create();
        // GET: Signals/Copy
        [Authorize(Roles = "Admin")]
        public ActionResult Copy(int approachID)
        {
            ViewBag.DirectionType = new SelectList(directionRepository.GetAllDirections(), "DirectionTypeID", "Abbreviation");
            MOE.Common.Models.Repositories.IApproachRepository approachRepository =
                MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
            MOE.Common.Models.Approach approachToCopy = approachRepository.GetApproachByApproachID(approachID);

            Approach newApproach = MOE.Common.Models.Approach.CopyApproach(approachID);
            return PartialView("Create",newApproach);
        }

        // GET: RouteSignals/Create
         [Authorize(Roles = "Admin")]
        public ActionResult Create(string id)
        {
            Approach approach = new Approach();
            approach.SignalID = id;
            approach.DirectionTypeID = 1;
            approach.ApproachID = 0;
            ViewBag.DirectionType = new SelectList(directionRepository.GetAllDirections(), "DirectionTypeID", "Abbreviation");
            return PartialView(approach);
        }

        // POST: RouteSignals/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateJsonAntiForgeryToken]
        [Authorize(Roles = "Admin")]
        public ActionResult Create([Bind(Include = "SignalId,DirectionTypeID,Description,MPH,DecisionPoint,MovementDelay")] Approach approach)
        {

            ViewBag.DirectionType = new SelectList(directionRepository.GetAllDirections(), "DirectionTypeID", "Abbreviation");
            if (ModelState.IsValid)
            {

                approachRepository.AddOrUpdate(approach);
                approach.Signal = signalRepository.GetLatestVersionOfSignalBySignalID(approach.SignalID);
                return PartialView("~/Views/Signals/EditorTemplates/Approach.cshtml", approach);
            }
            return PartialView(approach);
        }

        // GET: RouteSignals/Delete/5
         [Authorize(Roles = "Admin, Configuration")]
        public ActionResult Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Approach approach = approachRepository.GetApproachByApproachID(id.Value);
            if (approach == null)
            {
                return HttpNotFound();
            }
            return View(approach);
        }

        // POST: RouteSignals/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateJsonAntiForgeryToken]
        [Authorize(Roles = "Admin, Configuration")]
        public void DeleteConfirmed(int id)
        {
            approachRepository.Remove(id);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
            }
            base.Dispose(disposing);
        }
    }
}


text:
<?php
namespace Golpilolz\SiteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @ORM\Table(name="photo")
 * @ORM\HasLifecycleCallbacks
 */
class Photo
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(name="url", type="string", length=255)
     */
    private $url;

    /**
     * @ORM\Column(name="alt", type="string", length=255)
     */
    private $alt;

    /**
     * @ORM\ManyToOne(targetEntity="Golpilolz\SiteBundle\Entity\Album")
     * @ORM\JoinColumn(nullable=false)
     */
    private $album;

    private $file;

    private $tempFilename;

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

    /**
     * Set url
     *
     * @param string $url
     * @return Photo
     */
    public function setUrl($url)
    {
        $this->url = $url;

        return $this;
    }

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

    /**
     * Set alt
     *
     * @param string $alt
     * @return Photo
     */
    public function setAlt($alt)
    {
        $this->alt = $alt;

        return $this;
    }

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

    // On modifie le setter de File, pour prendre en compte l'upload d'un fichier lorsqu'il en existe déjà un autre
    public function setFile(UploadedFile $file)
    {
        $this->file = $file;

        // On vérifie si on avait déjà un fichier pour cette entité
        if (null !== $this->url) {
            // On sauvegarde l'extension du fichier pour le supprimer plus tard
            $this->tempFilename = $this->url;

            // On réinitialise les valeurs des attributs url et alt
            $this->url = null;
            $this->alt = null;
        }
    }

    public function getFile()
    {
        return $this->file;
    }

    /**
     * @ORM\PrePersist()
     * @ORM\PreUpdate()
     */
    public function preUpload()
    {
        // Si jamais il n'y a pas de fichier (champ facultatif)
        if (null === $this->file) {
            return;
        }

        // Le nom du fichier est son id, on doit juste stocker également son extension
        // Pour faire propre, on devrait renommer cet attribut en « extension », plutôt que « url »
        $this->url = $this->file->guessExtension();

        // Et on génère l'attribut alt de la balise <img>, à la valeur du nom du fichier sur le PC de l'internaute
        $this->alt = $this->file->getClientOriginalName();
    }

    /**
     * @ORM\PostPersist()
     * @ORM\PostUpdate()
     */
    public function upload()
    {
        // Si jamais il n'y a pas de fichier (champ facultatif)
        if (null === $this->file) {
            return;
        }

        // Si on avait un ancien fichier, on le supprime
        if (null !== $this->tempFilename) {
            $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;
            if (file_exists($oldFile)) {
                unlink($oldFile);
            }
        }

        // On déplace le fichier envoyé dans le répertoire de notre choix
        $this->file->move(
            $this->getUploadRootDir(), // Le répertoire de destination
            $this->id.'.'.$this->url   // Le nom du fichier à créer, ici « id.extension »
        );
    }

    /**
     * @ORM\PreRemove()
     */
    public function preRemoveUpload()
    {
        // On sauvegarde temporairement le nom du fichier, car il dépend de l'id
        $this->tempFilename = $this->getUploadRootDir().'/'.$this->id.'.'.$this->url;
    }

    /**
     * @ORM\PostRemove()
     */
    public function removeUpload()
    {
        // En PostRemove, on n'a pas accès à l'id, on utilise notre nom sauvegardé
        if (file_exists($this->tempFilename)) {
            // On supprime le fichier
            unlink($this->tempFilename);
        }
    }

    public function getUploadDir()
    {
        // On retourne le chemin relatif vers l'image pour un navigateur
        return 'uploads/img';
    }

    protected function getUploadRootDir()
    {
        // On retourne le chemin relatif vers l'image pour notre code PHP
        return __DIR__.'/../../../../web/'.$this->getUploadDir();
    }

    public function getWebPath()
    {
        return $this->getUploadDir().'/'.$this->getId().'.'.$this->getUrl();
    }

    /**
     * Set album
     *
     * @param \Golpilolz\SiteBundle\Entity\Album $album
     * @return Photo
     */
    public function setAlbum(\Golpilolz\SiteBundle\Entity\Album $album)
    {
        $this->album = $album;

        return $this;
    }

    /**
     * Get album
     *
     * @return \Golpilolz\SiteBundle\Entity\Album
     */
    public function getAlbum()
    {
        return $this->album;
    }
}


text:
package org.kuali.coeus.s2sgen.impl.generate;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public @interface FormGenerator {

    /**
     * See {@link org.springframework.stereotype.Component#value()} for details.
     */
    String value() default "";
}


text:
#ifndef VP9_ENCODER_VP9_AQ_COMPLEXITY_H_
#define VP9_ENCODER_VP9_AQ_COMPLEXITY_H_

#ifdef __cplusplus
extern "C" {
#endif

struct VP9_COMP;
struct macroblock;

// Select a segment for the current SB64.
void vp9_select_in_frame_q_segment(struct VP9_COMP *cpi, struct macroblock *x,
                                   BLOCK_SIZE bs,
                                   int mi_row, int mi_col,
                                   int output_enabled, int projected_rate);

// This function sets up a set of segments with delta Q values around
// the baseline frame quantizer.
void vp9_setup_in_frame_q_adj(struct VP9_COMP *cpi);

#ifdef __cplusplus
}  // extern "C"
#endif

#endif  // VP9_ENCODER_VP9_AQ_COMPLEXITY_H_


text:
namespace Higgs.Core
{
    public interface IValue<out T>
    {
// ReSharper disable UnusedMemberInSuper.Global
        T Value
        {
            get;
        }
// ReSharper restore UnusedMemberInSuper.Global
    }
}


text:
package com.terremark.api;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *

 * Java class for CreateRnatAssociation complex type.
 *

 * The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CreateRnatAssociation">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="PublicIp" type="{}Reference"/>
 *         <element name="IpAddress" type="{}Reference"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CreateRnatAssociation", propOrder = {"publicIp", "ipAddress"})
@javax.xml.bind.annotation.XmlRootElement(name = "CreateRnatAssociation")
public final class CreateRnatAssociation extends ToStringGenerator {

    @XmlElement(name = "PublicIp", required = true, nillable = true)
    protected Reference publicIp;
    @XmlElement(name = "IpAddress", required = true, nillable = true)
    protected Reference ipAddress;

    /**
     * Gets the value of the publicIp property.
     *
     * @return possible object is {@link Reference }
     */
    public Reference getPublicIp() {
        return publicIp;
    }

    /**
     * Sets the value of the publicIp property.
     *
     * @param value allowed object is {@link Reference }
     */
    public void setPublicIp(final Reference value) {
        this.publicIp = value;
    }

    /**
     * Gets the value of the ipAddress property.
     *
     * @return possible object is {@link Reference }
     */
    public Reference getIpAddress() {
        return ipAddress;
    }

    /**
     * Sets the value of the ipAddress property.
     *
     * @param value allowed object is {@link Reference }
     */
    public void setIpAddress(final Reference value) {
        this.ipAddress = value;
    }
}


text:
"Evaluate me to view the SplitJoin documentation:"

self showDocumentation

"CHANGES LOG:
- merged implementations by Keith Hodges (Join) and Damiena Pollet
  and Oscar Nierstrasz (RubyShards) into SplitJoin package
- moved all extension methods to *splitjoin method category
- merged all tests into SplitJoinTest
- fixed protocol in SequenceableCollection to splitOn: and joinUsing:
  and split: join: for splitters and joiners
- added Object>>joinTo: aStream and SequenceableCollection>>joinTo: aStream
  to support joining of either sequences or sequences of sequences
- prepared some documentation
- added systematic tests for all split/join cases
- added Object>>join:
- prepared split/join tests for all 16 cases
- prepares split+join tests for 4 standard cases
- reviewed/merged old tests
- changed splitjoin tests to use different joiner
- added separate test for split+join=id cases
- adapted documentation -- join result type is type of joiner or array or string
- fix split tests to check result asOrderedCollection
- added split tests for OrderedCollection and SortedCollection
- new join: method for OrderedCollection and SortedCollection
  (uses appendTo: in Object and SequenceableCollection)
- reviewed all split: implementations -- removed unnecessary helper methods
- check boundary conditions -- split on empty sequence ...
"


text:
package org.tomitribe.crest.cmds.targets;

import static java.util.Locale.ROOT;

import org.tomitribe.crest.contexts.DefaultsContext;
import org.tomitribe.crest.contexts.EnvDefaultsContext;
import org.tomitribe.crest.contexts.SystemPropertiesDefaultsContext;
import org.tomitribe.crest.lang.Substitutor;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.Set;

/**
 * @version $Revision$ $Date$
 */
public class Substitution {

    private static final Map<String, DefaultsContext> DEFAULTS_JVM_CONTEXTS = new HashMap<String, DefaultsContext>() {{
        put("env.", new EnvDefaultsContext());
        put("sys.", new SystemPropertiesDefaultsContext());
        for (final DefaultsContext defaultsContext : ServiceLoader.load(DefaultsContext.class)) {
            put(defaultsContext.getClass().getSimpleName().toLowerCase(ROOT), defaultsContext);
        }
    }};

    private Substitution() {
        // no-op
    }

    public static String format(final Target target, final Method method, final String input, final DefaultsContext df) {
        return format(target, method, input, df, new HashSet<String>());
    }

    private static String format(final Target target, final Method method, final String input,
                                 final DefaultsContext df, final Set<String> seen) {
        if (!seen.add(input)) {
            throw new IllegalStateException("Circular reference in " + input);
        }

        return new Substitutor() {
            @Override
            protected String getOrDefault(final String varName, final String varDefaultValue) {
                for (final Map.Entry<String, DefaultsContext> ctx : DEFAULTS_JVM_CONTEXTS.entrySet()) {
                    if (varName.startsWith(ctx.getKey())) {
                        final String value = ctx.getValue().find(target, method, varName.substring(ctx.getKey().length()));
                        if (value != null) {
                            return value;
                        }
                    }
                }
                final String value = df.find(target, method, varName);
                return value == null ? varDefaultValue : value;
            }
        }.replace(input);
    }
}