text:
<?php

/**
 * Sugar runtime engine.
 *
 * @category   Template
 * @package    Sugar
 * @subpackage Runtime
 * @author     Sean Middleditch <sean@mojodo.com>
 * @copyright  2008-2009 Mojodo, Inc. and contributors
 * @license    http://opensource.org/licenses/mit-license.php MIT
 * @version    SVN: $Id$
 * @link       http://php-sugar.net
 * @access     private
 */
final class Sugar_Runtime {
    /**@#+*/
    /** Opcodes */
    const OP_LPRINT = 1;
    const OP_EPRINT = 2;
    const OP_RPRINT = 3;
    const OP_PUSH = 4;
    const OP_LOOKUP = 5;
    const OP_ASSIGN = 6;
    const OP_INSERT = 7;
    const OP_NEGATE = 8;
    const OP_NOT = 9;
    const OP_CONCAT = 10;
    const OP_ADD = 11;
    const OP_MULTIPLY = 12;
    const OP_SUBTRACT = 13;
    const OP_DIVIDE = 14;
    const OP_MODULUS = 15;
    const OP_EQ = 16;
    const OP_NE = 17;
    const OP_OR = 18;
    const OP_AND = 19;
    const OP_LT = 20;
    const OP_LTE = 21;
    const OP_GT = 22;
    const OP_GTE = 23;
    const OP_IN = 24;
    const OP_NOT_IN = 25;
    const OP_CALL = 26;
    const OP_METHOD = 27;
    const OP_MODIFY = 28;
    const OP_IF = 29;
    const OP_RANGE = 30;
    const OP_FOREACH = 31;
    const OP_WHILE = 32;
    const OP_NOCACHE = 33;
    const OP_DEREF = 34;
    const OP_MAKE_ARRAY = 35;
    /**@#-*/

    /**
     * Sugar instance
     *
     * @var Sugar
     */
    private $_sugar;

    /**
     * Cache handler.
     *
     * @var Sugar_Cache
     */
    private $_cache;

    /**
     * Constructor
     *
     * @param Sugar       $sugar Sugar Instance
     */
    public function __construct(Sugar $sugar)
    {
        $this->_sugar = $sugar;
    }

    /**
     * Converts a PHP value into something nice for a user to see.  Mainly
     * this is intended for arrays, objects, and boolean values, which are
     * not natively user-visible formats.
     *
     * @param mixed $value Value to convert.
     *
     * @return string User-visible rendition of the value.
     */
    private static function _valueToString($value)
    {
        if (is_bool($value)) {
            return $value?'true':'false';
        } elseif (is_array($value)) {
            return Sugar_Util_Json($value);
        } else {
            return (string)$value;
        }
    }

    /**
     * Display output, either to the cache handler or to the PHP
     * output stream.
     *
     * @param Sugar_Cache $cache Cache handler (or null for no caching).
     * @param string             $output       Output.
     *
     * @return bool True on success.
     */
    private static function _display($cache, $output)
    {
        if ($cache) {
            return $cache->addOutput($output);
        } else {
            echo $output;
            return true;
        }
    }

    /**
     * Executes the given bytecode.
     *
     * @param Sugar_Context  $context Context to execute with
     * @param Sugar          $sugar   Sugar instance
     * @param Sugar_Data     $date    Variable data
     * @param Sugar_Cache    $cache   Caching handler
     * @param Sugar_Compiled $code    Compiled template being executed
     * @param array          $opcodes Opcodes being executed
     * @param array          $code    Bytecode to execute.
     * @param array          $stack   Stack
     *
     * @return mixed Last value on stack.
     * @throws Sugar_Exception_Runtime when the user has provided code that
     * cannot be executed, such as attempting to call a function that does
     * not exist.
     */
    private static function _execute(Sugar_Context $context, Sugar $sugar,
        Sugar_Data $data, $cache, Sugar_Compiled $code, array $opcodes,
        array &$stack
    ) {
        // execute opcodes
        for ($i = 0; $i < count($opcodes); ++$i) {
            // get current opcode
            $opcode = $opcodes[$i];
            switch($opcode) {
            case Sugar_Runtime::OP_LPRINT:
                self::_display($cache, $opcodes[++$i]);
                break;
            case Sugar_Runtime::OP_EPRINT:
                $v1 = array_pop($stack);
                self::_display($cache, $sugar->escape(self::_valueToString($v1)));
                break;
            case Sugar_Runtime::OP_RPRINT:
                $v1 = array_pop($stack);
                self::_display($cache, self::_valueToString($v1));
                break;
            case Sugar_Runtime::OP_PUSH:
                $v1 = $opcodes[++$i];
                $stack []= $v1;
                break;
            case Sugar_Runtime::OP_LOOKUP:
                $name = strtolower($opcodes[++$i]);
                $stack []= $data->get($name);
                break;
            case Sugar_Runtime::OP_ASSIGN:
                $name = $opcodes[++$i];
                $v1 = array_pop($stack);
                $data->set($name, $v1);
                break;
            case Sugar_Runtime::OP_INSERT:
                $name = $opcodes[++$i];
                $section = $code->getSection($name);
                if ($section !== false) {
                    self::_execute($context, $sugar, $data, $cache, $code, $section, $stack);
                } else {
                    throw new Sugar_Exception_Runtime(
                        $debug_file,
                        $debug_line,
                        'unknown section `'.$name.'`'
                    );
                }
                break;
            case Sugar_Runtime::OP_NEGATE:
                $v1 = array_pop($stack);
                $stack []= -$v1;
                break;
            case Sugar_Runtime::OP_NOT:
                $v1 = array_pop($stack);
                $stack []= !$v1;
                break;
            case Sugar_Runtime::OP_CONCAT:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= $v1 . $v2;
                break;
            case Sugar_Runtime::OP_ADD:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                if (is_numeric($v1) && is_numeric($v2)) {
                    $stack []= $v1 + $v2;
                } elseif (is_array($v1) && is_array($v2)) {
                    $stack []= array_merge($v1, $v2);
                } else {
                    $stack []= $v1 . $v2;
                }
                break;
            case Sugar_Runtime::OP_MULTIPLY:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= $v1 * $v2;
                break;
            case Sugar_Runtime::OP_SUBTRACT:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= $v1 - $v2;
                break;
            case Sugar_Runtime::OP_DIVIDE:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                if ($v2 == 0) {
                    $stack []= null;
                } else {
                    $stack []= $v1 / $v2;
                }
                break;
            case Sugar_Runtime::OP_MODULUS:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                if ($v2 == 0) {
                    $stack []= null;
                } else {
                    $stack []= $v1 % $v2;
                }
                break;
            case Sugar_Runtime::OP_EQ:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 == $v2);
                break;
            case Sugar_Runtime::OP_NE:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 != $v2);
                break;
            case Sugar_Runtime::OP_OR:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 || $v2);
                break;
            case Sugar_Runtime::OP_AND:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 && $v2);
                break;
            case Sugar_Runtime::OP_LT:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 < $v2);
                break;
            case Sugar_Runtime::OP_LTE:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 <= $v2);
                break;
            case Sugar_Runtime::OP_GT:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 > $v2);
                break;
            case Sugar_Runtime::OP_GTE:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= ($v1 >= $v2);
                break;
            case Sugar_Runtime::OP_IN:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= (is_array($v2) && in_array($v1, $v2));
                break;
            case Sugar_Runtime::OP_NOT_IN:
                $v2 = array_pop($stack);
                $v1 = array_pop($stack);
                $stack []= (is_array($v2) && !in_array($v1, $v2));
                break;
            case Sugar_Runtime::OP_CALL:
                $func = $opcodes[++$i];
                $args = $opcodes[++$i];
                $debug_file = $opcodes[++$i];
                $debug_line = $opcodes[++$i];

                // lookup function
                $plugin = $sugar->getPlugin('function', $func);
                if (!$plugin) {
                    throw new Sugar_Exception_Runtime(
                        $debug_file,
                        $debug_line,
                        'unknown function `'.$func.'`'
                    );
                }

                // compile args
                $params = array();
                foreach ($args as $name=>$pcode) {
                    $params[$name] = self::_execute($context, $sugar, $data, $cache, $code, $pcode, $stack);
                }

                // exception net
                try {
                    // call function, using appropriate method
                    $ret = $plugin->invoke($params, $context);
                } catch (Exception $e) {
                    $sugar->handleError($e);
                    $ret = null;
                }

                // process return value
                $stack []= $ret;
                break;
            case Sugar_Runtime::OP_METHOD:
                $obj = array_pop($stack);
                $func = $opcodes[++$i];
                $args = $opcodes[++$i];
                $debug_file = $opcodes[++$i];
                $debug_line = $opcodes[++$i];

                // ensure the object is an object and that the method is a method
                if (!is_object($obj)) {
                    throw new Sugar_Exception_Runtime(
                        $debug_file,
                        $debug_line,
                        'method call on non-object type `'.gettype($obj).'`'
                    );
                }

                if (!method_exists($obj, $func)) {
                    throw new Sugar_Exception_Runtime(
                        $debug_file,
                        $debug_line,
                        'unknown method `'.$func.'` on type `'.gettype($obj).'`'
                    );
                }

                // compile args
                $params = array();
                foreach ($args as $pcode) {
                    $params [] = self::_execute($context, $sugar, $data, $cache, $code, $pcode, $stack);
                }

                // perform ACL checking on the method call
                if (!is_null($sugar->methodAcl)) {
                    $check = call_user_func(
                        $sugar->methodAcl,
                        $sugar,
                        $obj,
                        $func,
                        $params,
                        $context
                    );

                    if (!$check) {
                        throw new Sugar_Exception_Runtime(
                            $debug_file,
                            $debug_line,
                            'method call to `'.$func.'` on type `'.
                                gettype($obj).'` blocked by ACL'
                        );
                    }
                }

                // exception net
                try {
                    // invoke method
                    $stack []= @call_user_func_array(array($obj, $func), $params);
                } catch (Exception $e) {
                    $sugar->handleError($e);
                    $stack []= null;
                }
                break;
            case Sugar_Runtime::OP_MODIFY:
                $name = $opcodes[++$i];
                $args = $opcodes[++$i];
                $value = array_pop($stack);

                // lookup function
                $plugin = $sugar->getPlugin('modifier', $name);
                if (!$plugin) {
                    throw new Sugar_Exception_Runtime(
                        'FIXME',
                        1,
                        'unknown modifier `'.$name.'`'
                    );
                }

                // compile args
                $params = array();
                foreach ($args as $pcode) {
                    $params []= self::_execute($context, $sugar, $data, $cache, $code, $pcode, $stack);
                }

                // exception net
                try {
                    // invoke the modifier
                    $ret = $plugin->invoke($value, $params, $context);
                } catch (Exception $e) {
                    $sugar->handleError($e);
                    $ret = null;
                }

                // store return value
                $stack []= $ret;
                break;
            case Sugar_Runtime::OP_IF:
                $clauses = $opcodes[++$i];
                foreach ($clauses as $clause) {
                    if ($clause[0] === false || self::_execute($context, $sugar, $data, $cache, $code, $clause[0], $stack)) {
                        self::_execute($context, $sugar, $data, $cache, $code, $clause[1], $stack);
                        break;
                    }
                }
                break;
            case Sugar_Runtime::OP_RANGE:
                $step = array_pop($stack);
                $upper = array_pop($stack);
                $lower = array_pop($stack);
                $name = $opcodes[++$i];
                $block = $opcodes[++$i];

                // if step is 0, fail
                if ($step === 0) {
                    throw new Sugar_Exception ('step of 0 in range loop');
                }

                // iterate
                $index = $lower;
                while (($step < 0 && $index >= $upper)
                    || ($step > 0 && $index <= $upper)
                ) {
                    $data->set($name, $index);
                    self::_execute($context, $sugar, $data, $cache, $code, $block, $stack);
                    $index += $step;
                }
                break;
            case Sugar_Runtime::OP_FOREACH:
                $array = array_pop($stack);
                $key = $opcodes[++$i];
                $name = $opcodes[++$i];
                $block = $opcodes[++$i];
                if (is_array($array) || is_object($array)) {
                    foreach ($array as $k=>$v) {
                        if ($key) {
                            $data->set($key, $k);
                        }
                        $data->set($name, $v);
                        self::_execute($context, $sugar, $data, $cache, $code, $block, $stack);
                    }
                }
                break;
            case Sugar_Runtime::OP_WHILE:
                $test = $opcodes[++$i];
                $block = $opcodes[++$i];
                while (self::_execute($context, $sugar, $data, $cache, $code, $test, $stack)) {
                    self::_execute($context, $sugar, $data, $cache, $code, $block, $stack);
                }
                break;
            case Sugar_Runtime::OP_NOCACHE:
                $block = $opcodes[++$i];
                if ($cache) {
                    $cache->addBlock($block);
                } else {
                    self::_execute($context, $sugar, $data, $cache, $code, $block, $stack);
                }
                break;
            case Sugar_Runtime::OP_DEREF:
                $index = array_pop($stack);
                $obj = array_pop($stack);
                if (is_array($obj) && isset($obj[$index])) {
                    $stack []= $obj[$index];
                } elseif (is_object($obj) && isset($obj->$index)) {
                    $stack []= $obj->$index;
                } else {
                    $stack []= null;
                }
                break;
            case Sugar_Runtime::OP_MAKE_ARRAY:
                $elems = $opcodes[++$i];
                $array = array();
                foreach ($elems as $elem) {
                    $array []= self::_execute($context, $sugar, $data, $cache, $code, $elem, $stack);
                }
                $stack []= $array;
                break;
            default:
                throw new Sugar_Exception(
                    'internal error: unknown opcode `'.$opcode.'`'
                );
            }
        }

        return empty($stack) ? null : array_pop($stack);
    }

    /**
     * Display a template (top-level call)
     *
     * @param Sugar_Template $template Template to display
     * @param Sugar_Data     $data     Top-level variable scope
     */
    public function execute(Sugar_Template $template, Sugar_Data $data)
    {
        // stack used for execution
        $stack = array();

        // context used for execution
        $context = new Sugar_Context($this->_sugar, $template, $data, $this);

        try {
            // if we are to be cached, check for an existing cache and use that if
            // it exists and is up to date
            if (!$this->_sugar->debug && !is_null($template->cacheId)) {
                $code = $this->_sugar->getLoader()->getCached($template);
                if ($code !== false) {
                    // add to existing cache, if any
                    if ($this->_cache) {
                        $this->_cache->addRef($template);
                    }

                    // execute cached code
                    self::_execute($context, $this->_sugar, $data, $this->_cache, $code, $code->getSection('main'), $stack);
                    return true;
                }
            }

            // if we are to be cached and aren't alrady running inside an existing
            // cache handler instance, create a new one
            if (!$this->_cache && !is_null($template->cacheId)) {
                /**
                 * Cache handler.
                 */
                include_once $GLOBALS['__sugar_rootdir'].'/Sugar/Cache.php';

                // create cache
                $this->_cache = new Sugar_Cache($this->_sugar);
                $startCache = true;
            } else {
                $startCache = false;
            }

            // add template code to cache's reference
            if ($this->_cache) {
                $this->_cache->addRef($template);
            }

            // load compiled template
            $code = $this->_sugar->getLoader()->getCompiled($template);

            // if we have an inherited template, load it and merge it with our data
            $inherit = $template->getInherit();
            if (!$inherit) {
                $inherit = $code->getInherit();
            }
            if ($inherit) {
                // load compiled parent (inherited template)
                $parent = $this->_sugar->getTemplate($inherit, $template->cacheId);
                if ($parent === false) {
                    throw new Sugar_Exception_Usage('inherited template not found: '.$inherit);
                }
                $pcode = $this->_sugar->getLoader()->getCompiled($parent);

                // merge code
                $pcode->mergeChild($code);
                $code = $pcode;
                unset($pcode);
            }

            // execute our compiled template
            self::_execute($context, $this->_sugar, $data, $this->_cache, $code, $code->getSection('main'), $stack);

            // clean up the cache handler and display the uncachable data if
            // and only if we created the cache handler
            if ($startCache) {
                $code = $this->_cache->getOutput();
                $this->_cache = null;

                // attempt to save cache
                $this->_sugar->cache->store($template, Sugar::CACHE_HTML, $code);

                // save cache in loader
                $this->_sugar->getLoader()->setCached($template, $code);

                // display cache
                self::_execute($context, $this->_sugar, $data, $this->_cache, $code, $code->getSection('main'), $stack);
            }

            return true;
        } catch (Sugar_Exception $e) {
            $template->_sugar->handleError($e);
            return false;
        }
    }
}

// vim: set expandtab shiftwidth=4 tabstop=4 :
?>


text:
import React, { Component } from 'react'
import PropTypes from 'prop-types'

export default class Greeting extends Component {
  constructor (props, context) {
    super(props, context)
    const appName = context.store.getState().appName
    this.state = {
      appName: appName
    }
  }

  render () {
    return
Welcome {this.props.name} to {this.state.appName}
;
  }
}

Greeting.propTypes = {
  name: PropTypes.string.isRequired
}

Greeting.contextTypes = {
  store: PropTypes.object
}

redpajama_set_name: RedPajamaGithub


text:
package com.hazelcast.collection.impl.common;

import com.hazelcast.collection.ItemEvent;
import com.hazelcast.core.ItemEventType;
import com.hazelcast.cluster.Member;
import com.hazelcast.internal.serialization.Data;
import com.hazelcast.internal.serialization.SerializationService;

import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectOutputStream;

/**
 * An {@link ItemEvent} that is able to store a {@link Data}.
 */
public class DataAwareItemEvent<E> extends ItemEvent<E> {

    private static final long serialVersionUID = 1;

    private final transient Data dataItem;
    private final transient SerializationService serializationService;

    public DataAwareItemEvent(String name, ItemEventType itemEventType, Data dataItem, Member member,
                              SerializationService serializationService) {
        super(name, itemEventType, null, member);
        this.dataItem = dataItem;
        this.serializationService = serializationService;
    }

    @Override
    public E getItem() {
        if (item == null && dataItem != null) {
            item = serializationService.toObject(dataItem);
        }
        return item;
    }

    public Data getItemData() {
        return dataItem;
    }

    private void writeObject(ObjectOutputStream out) throws IOException {
        throw new NotSerializableException();
    }
}


text:
class Ngircd < Formula
  desc "Next generation IRC daemon"
  homepage "http://ngircd.barton.de"
  url "http://ngircd.barton.de/pub/ngircd/ngircd-23.tar.gz"
  mirror "http://ngircd.mirror.3rz.org/pub/ngircd/ngircd-23.tar.gz"
  sha256 "99b8b67a975a9ae9b81c96bdee02133a10f515c718825d34cedcb64f1fc95e73"

  bottle do
    sha256 "5ca03cd4c4b96553c0be0361311baad578ed5f33b0b70e510b2d503f2f5354b9" => :el_capitan
    sha256 "32286cf3a53887c07293cc0d712aadd5ed7dc567d2f90bc3c9768d247d09061a" => :yosemite
    sha256 "b8a848cce3bde15ed760b3c93065b5914dcd222cee5c11c4401e7901c929246e" => :mavericks
  end

  option "with-iconv", "Enable character conversion using libiconv."
  option "with-pam", "Enable user authentication using PAM."
  option "with-sniffer", "Enable IRC traffic sniffer (also enables additional debug output)."
  option "with-debug", "Enable additional debug output."

  # Older Formula used the next option by default, so keep it unless
  # deactivated by the user:
  option "without-ident", "Disable 'IDENT' ('AUTH') protocol support."

  depends_on "libident" if build.with? "ident"
  depends_on "openssl"

  def install
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --sysconfdir=#{HOMEBREW_PREFIX}/etc
      --enable-ipv6
      --with-openssl
    ]

    args << "--with-iconv" if build.with? "iconv"
    args << "--with-ident" if build.with? "ident"
    args << "--with-pam" if build.with? "pam"
    args << "--enable-debug" if build.with? "debug"
    args << "--enable-sniffer" if build.with? "sniffer"

    system "./configure", *args
    system "make", "install"

    prefix.install "contrib/MacOSX/de.barton.ngircd.plist.tmpl" => "de.barton.ngircd.plist"
    (prefix+"de.barton.ngircd.plist").chmod 0644

    inreplace prefix+"de.barton.ngircd.plist" do |s|
      s.gsub! ":SBINDIR:", sbin
      s.gsub! "/Library/Logs/ngIRCd.log", var/"Logs/ngIRCd.log"
    end
  end

  test do
    # Exits non-zero, so test version and match Author's name supplied.
    assert_match /Alexander/, pipe_output("#{sbin}/ngircd -V 2>&1")
  end
end


text:
using System;
using System.Collections.Specialized;

namespace DotNetOpenAuth.AspNet.Clients
{
    public static class UriHelper
    {
        public static string NormalizeHexEncoding(this string url)
        {
            var array = url.ToCharArray();
            for (var i = 0; i < array.Length - 2; i++)
            {
                if (array[i] != '%') continue;

                array[i + 1] = Char.ToUpperInvariant(array[i + 1]);
                array[i + 2] = Char.ToUpperInvariant(array[i + 2]);
                i += 2;
            }
            return new string(array);
        }

        public static string GetProviderNameFromQueryString(NameValueCollection queryString)
        {
            var result = queryString["__provider__"];
            //commented out stuff
            return result;
        }
    }
}


text:
package us.gov.dod.standard.ssrf._3_1;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.*;
import us.gov.dod.standard.ssrf.SSRF;
import us.gov.dod.standard.ssrf._3_1.allotment.Project;
import us.gov.dod.standard.ssrf._3_1.fedeployment.AtWaypoint;
import us.gov.dod.standard.ssrf._3_1.metadata.domains.*;
import us.gov.dod.standard.ssrf._3_1.metadata.lists.ListCCL;
import us.gov.dod.standard.ssrf._3_1.metadata.lists.ListCFD;

/**
 * FEDeployment describes the deployment of a force element to a location. Each
 * deployment has a period of time for which the deployment is valid described
 * by the start and end date/time.
 *

 * Sub-Elements are {@link AtWaypoint}, {@link Project}
 *

 * Example:
 *

 * <FEDeployment cls="U">
 *   <Serial cls="U">NLD::FD:123</Serial>
 *   <EntryDateTime cls="U">2011-12-25T00:00:00Z</EntryDateTime>
 *   <FERef cls="U">NLD::FE:222</FERef>
 *   <Type cls="U">Location-Current</Type>
 *   <Months cls="U">1-2</Months>
 *   <Years cls="U">2012</Years>
 *   <LocationRef cls="U">NLD::LO:333</LocationRef>
 * </FEDeployment>
 *

 *
 * @author Key Bridge LLC <developer@keybridge.ch>
 * @version 3.1.0, 03/30/2015
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FEDeployment", propOrder = {
  "feRef",
  "type",
  "num",
  "seconds",
  "minutes",
  "hours",
  "daysOfMonth",
  "months",
  "daysOfWeek",
  "years",
  "duration",
  "locationRef",
  "project",
  "atWaypoint"
})
public class FEDeployment extends Common<FEDeployment> {

  /**
   * FERef - Force Element Serial (Required)
   *

   * The dataset identifier of the ForceElement being deployed.
   *

   * Format is pattern (S29)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "FERef", required = true)
  private Serial feRef;
  /**
   * Type - Deployment Type (Required)
   *

   * The type of deployment.
   *

   * Format is L:CFD
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Type", required = true)
  private TString type;
  /**
   * Num - Number of deployed Force Elements (Optional)
   *

   * The quantity of Force Element referenced in FERef.
   *

   * Format is UN(6)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Num", required = false)
  private UN6 num;
  /**
   * Seconds - Seconds (Optional)
   *

   * The seconds of hour [0-59] that the Force element is planned for
   * deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Seconds", required = false)
  private MinSec seconds;
  /**
   * Minutes - Minutes (Optional)
   *

   * The minutes of an hour [0-59] that the Force element is planned for
   * deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Minutes", required = false)
  private MinSec minutes;
  /**
   * Hours - Hours (Optional)
   *

   * The hours of a day [0-23] (UTC time) that the Force element is planned for
   * deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Hours", required = false)
  private Hours hours;
  /**
   * DaysOfMonth - Days Of Month (Optional)
   *

   * The day of month [1-31] that the Force element is planned for deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "DaysOfMonth", required = false)
  private DaysOfMonth daysOfMonth;
  /**
   * Months - Months (Optional)
   *

   * The month of year [1-12] that the Force element is planned for deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Months", required = false)
  private Months months;
  /**
   * DaysOfWeek - Days Of Week (Optional)
   *

   * The weekday [0-7 where 0 and 7 are for Sunday, 1 for Monday, etc] that the
   * Force element is planned for deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "DaysOfWeek", required = false)
  private DaysOfWeek daysOfWeek;
  /**
   * Years - Years (Optional)
   *

   * The 4-digit year [1900..2100] that the Force element is planned for
   * deployment.
   *

   * Format is pattern (S40)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Years", required = false)
  private Years years;
  /**
   * Duration - Duration (Optional)
   *

   * The number of minutes for which an event will live. Examples: Hours data
   * item: 8 = one value: 08h00Z 5,6,9 = multiple values: 05h00Z, 06h00Z, 09h00Z
   * 5-8 = range between 05h00Z and 08h00Z, inclusive star/2 = every 2nd hour,
   * starting at midnight: 00h00Z, 02h00Z, 04h00Z, etc. 3-12/3 = every 3rd hour
   * between 0300 and 1200, inclusive: 03h00Z, 06h00Z, 09h00Z, and 12h00Z
   *

   * Transmission for 2 minutes every 10 minutes from 0900 to 1700 every weekday
   * for the year 2007: <Minutes>star/10</Minutes>
   * <Hours>9-17</Hours> <DaysofWeek>0-4</DaysofWeek>
   * <Years>2007</Years> <Duration>2</Duration>
   *

   * On the 5-minute mark, every 3rd hour, Monday-Friday
   * <Minutes>5</Minutes> <Hours>star/3</Hours>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   * On the 20 and 50-minute marks, every hour, every month except June,
   * Monday-Friday <Minutes>20,50</Minutes>
   * <Months>1-5,7-12</Months>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   * Format is UN(4) (min)
   *

   * Attribute group TimeFrame (Optional)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Duration", required = false)
  private Duration_UN4 duration;
  /**
   * LocationRef - Location Reference (Optional)
   *

   * The serial of the referenced Location.
   *

   * Format is pattern (S29)
   *
   * @since 3.1.0
   */
  @XmlElement(name = "LocationRef", required = false)
  private Serial locationRef;
  /**
   * Project (Optional)
   *

   * Project provides the Project, OPLAN, COMPLAN or Exercise name, or any other
   * project name associated to the dataset.
   *
   * @since 3.1.0
   */
  @XmlElement(name = "Project")
  private Set<Project> project;
  /**
   * AtWayPoint (Optional)
   *

   * AtWayPoint defines a point in time at which a Force Element is at a given
   * waypoint along a route.
   *
   * @since 3.1.0
   */
  @XmlElement(name = "AtWaypoint")
  private Set<AtWaypoint> atWaypoint;

  /**
   * No arg constructor. Initializes the Common required fields.
   */
  public FEDeployment() {
    super();
  }

  /**
   * Get the dataset identifier of the ForceElement being deployed..
   *
   * @return a {@link Serial} instance
   * @since 3.1.0
   */
  public Serial getFERef() {
    return feRef;
  }

  /**
   * Set the dataset identifier of the ForceElement being deployed..
   *
   * @param value a {@link Serial} instance
   * @since 3.1.0
   */
  public void setFERef(Serial value) {
    this.feRef = value;
  }

  /**
   * Determine if the FERef is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetFERef() {
    return (this.feRef != null ? this.feRef.isSetValue() : false);
  }

  /**
   * Get the type of deployment..
   *
   * @return the Type value in a {@link TString} data type
   * @since 3.1.0
   */
  public TString getType() {
    return type;
  }

  /**
   * Set the type of deployment..
   *
   * @param value the Type value in a {@link TString} data type
   * @since 3.1.0
   */
  public void setType(TString value) {
    this.type = value;
  }

  /**
   * Determine if the Type is configured.
   *

   * If configured this method also inspects the {@link TString} wrapped value.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetType() {
    return (this.type != null ? this.type.isSetValue() : false);
  }

  /**
   * Get the quantity of Force Element referenced in FERef..
   *
   * @return a {@link UN6} instance
   * @since 3.1.0
   */
  public UN6 getNum() {
    return num;
  }

  /**
   * Set the quantity of Force Element referenced in FERef..
   *
   * @param value a {@link UN6} instance
   * @since 3.1.0
   */
  public void setNum(UN6 value) {
    this.num = value;
  }

  /**
   * Determine if the Num is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetNum() {
    return (this.num != null ? this.num.isSetValue() : false);
  }

  /**
   * Get the seconds of hour [0-59] that the Force element is planned for
   * deployment..
   *
   * @return a {@link MinSec} instance
   * @since 3.1.0
   */
  public MinSec getSeconds() {
    return seconds;
  }

  /**
   * Set the seconds of hour [0-59] that the Force element is planned for
   * deployment..
   *
   * @param value a {@link MinSec} instance
   * @since 3.1.0
   */
  public void setSeconds(MinSec value) {
    this.seconds = value;
  }

  /**
   * Determine if the Seconds is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetSeconds() {
    return (this.seconds != null ? this.seconds.isSetValue() : false);
  }

  /**
   * Get the minutes of an hour [0-59] that the Force element is planned for
   * deployment..
   *
   * @return a {@link MinSec} instance
   * @since 3.1.0
   */
  public MinSec getMinutes() {
    return minutes;
  }

  /**
   * Set the minutes of an hour [0-59] that the Force element is planned for
   * deployment..
   *
   * @param value a {@link MinSec} instance
   * @since 3.1.0
   */
  public void setMinutes(MinSec value) {
    this.minutes = value;
  }

  /**
   * Determine if the Minutes is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetMinutes() {
    return (this.minutes != null ? this.minutes.isSetValue() : false);
  }

  /**
   * Get the hours of a day [0-23] (UTC time) that the Force element is planned
   * for deployment..
   *
   * @return a {@link Hours} instance
   * @since 3.1.0
   */
  public Hours getHours() {
    return hours;
  }

  /**
   * Set the hours of a day [0-23] (UTC time) that the Force element is planned
   * for deployment..
   *
   * @param value a {@link Hours} instance
   * @since 3.1.0
   */
  public void setHours(Hours value) {
    this.hours = value;
  }

  /**
   * Determine if the Hours is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetHours() {
    return (this.hours != null ? this.hours.isSetValue() : false);
  }

  /**
   * Get the day of month [1-31] that the Force element is planned for
   * deployment..
   *
   * @return a {@link DaysOfMonth} instance
   * @since 3.1.0
   */
  public DaysOfMonth getDaysOfMonth() {
    return daysOfMonth;
  }

  /**
   * Set the day of month [1-31] that the Force element is planned for
   * deployment..
   *
   * @param value a {@link DaysOfMonth} instance
   * @since 3.1.0
   */
  public void setDaysOfMonth(DaysOfMonth value) {
    this.daysOfMonth = value;
  }

  /**
   * Determine if the DaysOfMonth is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetDaysOfMonth() {
    return (this.daysOfMonth != null ? this.daysOfMonth.isSetValue() : false);
  }

  /**
   * Get the month of year [1-12] that the Force element is planned for
   * deployment..
   *
   * @return a {@link Months} instance
   * @since 3.1.0
   */
  public Months getMonths() {
    return months;
  }

  /**
   * Set the month of year [1-12] that the Force element is planned for
   * deployment..
   *
   * @param value a {@link Months} instance
   * @since 3.1.0
   */
  public void setMonths(Months value) {
    this.months = value;
  }

  /**
   * Determine if the Months is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetMonths() {
    return (this.months != null ? this.months.isSetValue() : false);
  }

  /**
   * Get the weekday [0-7 where 0 and 7 are for Sunday, 1 for Monday, etc] that
   * the Force element is planned for deployment..
   *
   * @return a {@link DaysOfWeek} instance
   * @since 3.1.0
   */
  public DaysOfWeek getDaysOfWeek() {
    return daysOfWeek;
  }

  /**
   * Set the weekday [0-7 where 0 and 7 are for Sunday, 1 for Monday, etc] that
   * the Force element is planned for deployment..
   *
   * @param value a {@link DaysOfWeek} instance
   * @since 3.1.0
   */
  public void setDaysOfWeek(DaysOfWeek value) {
    this.daysOfWeek = value;
  }

  /**
   * Determine if the DaysOfWeek is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetDaysOfWeek() {
    return (this.daysOfWeek != null ? this.daysOfWeek.isSetValue() : false);
  }

  /**
   * Get the 4-digit year [1900..2100] that the Force element is planned for
   * deployment..
   *
   * @return a {@link Years} instance
   * @since 3.1.0
   */
  public Years getYears() {
    return years;
  }

  /**
   * Set the 4-digit year [1900..2100] that the Force element is planned for
   * deployment..
   *
   * @param value a {@link Years} instance
   * @since 3.1.0
   */
  public void setYears(Years value) {
    this.years = value;
  }

  /**
   * Determine if the Years is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetYears() {
    return (this.years != null ? this.years.isSetValue() : false);
  }

  /**
   * Get the number of minutes for which an event will live. Examples: Hours
   * data item: 8 = one value: 08h00Z 5,6,9 = multiple values: 05h00Z, 06h00Z,
   * 09h00Z 5-8 = range between 05h00Z and 08h00Z, inclusive star/2 = every 2nd
   * hour, starting at midnight: 00h00Z, 02h00Z, 04h00Z, etc. 3-12/3 = every 3rd
   * hour between 0300 and 1200, inclusive: 03h00Z, 06h00Z, 09h00Z, and 12h00Z
   *

   * Transmission for 2 minutes every 10 minutes from 0900 to 1700 every weekday
   * for the year 2007:
   *

   * <Minutes>star/10</Minutes>
   * <Hours>9-17</Hours>
   * <DaysofWeek>0-4</DaysofWeek>
   * <Years>2007</Years>
   * <Duration>2</Duration>
   *

   *

   * On the 5-minute mark, every 3rd hour, Monday-Friday:
   *

   * <Minutes>5</Minutes>
   * <Hours>star/3</Hours>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   *

   * On the 20 and 50-minute marks, every hour, every month except June, Monday-Friday:
   *

   * <Minutes>20,50</Minutes>
   * <Months>1-5,7-12</Months>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   * @return a {@link Duration_UN4} instance
   * @since 3.1.0
   */
  public Duration_UN4 getDuration() {
    return duration;
  }

  /**
   * Set the number of minutes for which an event will live. Examples: Hours
   * data item: 8 = one value: 08h00Z 5,6,9 = multiple values: 05h00Z, 06h00Z,
   * 09h00Z 5-8 = range between 05h00Z and 08h00Z, inclusive star/2 = every 2nd
   * hour, starting at midnight: 00h00Z, 02h00Z, 04h00Z, etc. 3-12/3 = every 3rd
   * hour between 0300 and 1200, inclusive: 03h00Z, 06h00Z, 09h00Z, and 12h00Z
   *

   * Transmission for 2 minutes every 10 minutes from 0900 to 1700 every weekday
   * for the year 2007:
   *

   * <Minutes>star/10</Minutes>
   * <Hours>9-17</Hours>
   * <DaysofWeek>0-4</DaysofWeek>
   * <Years>2007</Years>
   * <Duration>2</Duration>
   *

   *

   * On the 5-minute mark, every 3rd hour, Monday-Friday:
   *

   * <Minutes>5</Minutes>
   * <Hours>star/3</Hours>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   *

   * On the 20 and 50-minute marks, every hour, every month except June, Monday-Friday:
   *

   * <Minutes>20,50</Minutes>
   * <Months>1-5,7-12</Months>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   *
   * @param value a {@link Duration_UN4} instance
   * @since 3.1.0
   */
  public void setDuration(Duration_UN4 value) {
    this.duration = value;
  }

  /**
   * Determine if the Duration is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetDuration() {
    return (this.duration != null ? this.duration.isSetValue() : false);
  }

  /**
   * Get the serial of the referenced Location..
   *
   * @return a {@link Serial} instance
   * @since 3.1.0
   */
  public Serial getLocationRef() {
    return locationRef;
  }

  /**
   * Set the serial of the referenced Location..
   *
   * @param value a {@link Serial} instance
   * @since 3.1.0
   */
  public void setLocationRef(Serial value) {
    this.locationRef = value;
  }

  /**
   * Determine if the LocationRef is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetLocationRef() {
    return (this.locationRef != null ? this.locationRef.isSetValue() : false);
  }

  /**
   * Get the Project
   *

   * Complex element Project provides the Project, OPLAN, COMPLAN or Exercise
   * name, or any other project name associated to the dataset..
   *
   * @return a {@link Project} instance
   * @since 3.1.0
   */
  public Set<Project> getProject() {
    if (project == null) {
      project = new HashSet<>();
    }
    return this.project;
  }

  /**
   * Determine if the Project is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetProject() {
    return ((this.project != null) && (!this.project.isEmpty()));
  }

  /**
   * Clear the Project field. This sets the field to null.
   */
  public void unsetProject() {
    this.project = null;
  }

  /**
   * Get the AtWayPoint
   *

   * Complex element AtWayPoint defines a point in time at which a Force Element
   * is at a given waypoint along a route..
   *
   * @return a {@link AtWaypoint} instance
   * @since 3.1.0
   */
  public Set<AtWaypoint> getAtWaypoint() {
    if (atWaypoint == null) {
      atWaypoint = new HashSet<>();
    }
    return this.atWaypoint;
  }

  /**
   * Determine if the AtWaypoint is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetAtWaypoint() {
    return ((this.atWaypoint != null) && (!this.atWaypoint.isEmpty()));
  }

  /**
   * Clear the AtWaypoint field. This sets the field to null.
   */
  public void unsetAtWaypoint() {
    this.atWaypoint = null;
  }

  /**
   * Set the dataset identifier of the ForceElement being deployed.
   *
   * @param value An instances of type {@link Serial}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withFERef(Serial value) {
    setFERef(value);
    return this;
  }

  /**
   * Set the type of deployment.
   *
   * @param value An instances of type {@link ListCFD}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withType(ListCFD value) {
    setType(new TString(value.value()));
    return this;
  }

  /**
   * Set the quantity of Force Element referenced in FERef.
   *
   * @param value An instances of type {@link Integer}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withNum(Integer value) {
    setNum(new UN6(value));
    return this;
  }

  /**
   * Set the seconds of hour [0-59] that the Force element is planned for
   * deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withSeconds(String value) {
    setSeconds(new MinSec(value));
    return this;
  }

  /**
   * Set the minutes of an hour [0-59] that the Force element is planned for
   * deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withMinutes(String value) {
    setMinutes(new MinSec(value));
    return this;
  }

  /**
   * Set the hours of a day [0-23] (UTC time) that the Force element is planned
   * for deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withHours(String value) {
    setHours(new Hours(value));
    return this;
  }

  /**
   * Set the day of month [1-31] that the Force element is planned for
   * deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withDaysOfMonth(String value) {
    setDaysOfMonth(new DaysOfMonth(value));
    return this;
  }

  /**
   * Set the month of year [1-12] that the Force element is planned for
   * deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withMonths(String value) {
    setMonths(new Months(value));
    return this;
  }

  /**
   * Set the weekday [0-7 where 0 and 7 are for Sunday, 1 for Monday, etc] that
   * the Force element is planned for deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withDaysOfWeek(String value) {
    setDaysOfWeek(new DaysOfWeek(value));
    return this;
  }

  /**
   * Set the 4-digit year [1900..2100] that the Force element is planned for
   * deployment.
   *
   * @param value An instances of type {@link String}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withYears(String value) {
    setYears(new Years(value));
    return this;
  }

  /**
   * Set the number of minutes for which an event will live. Examples: Hours
   * data item: 8 = one value: 08h00Z 5,6,9 = multiple values: 05h00Z, 06h00Z,
   * 09h00Z 5-8 = range between 05h00Z and 08h00Z, inclusive star/2 = every 2nd
   * hour, starting at midnight: 00h00Z, 02h00Z, 04h00Z, etc. 3-12/3 = every 3rd
   * hour between 0300 and 1200, inclusive: 03h00Z, 06h00Z, 09h00Z, and 12h00Z
   *

   * Transmission for 2 minutes every 10 minutes from 0900 to 1700 every weekday
   * for the year 2007:
   *

   * <Minutes>star/10</Minutes>
   * <Hours>9-17</Hours>
   * <DaysofWeek>0-4</DaysofWeek>
   * <Years>2007</Years>
   * <Duration>2</Duration>
   *

   *

   * On the 5-minute mark, every 3rd hour, Monday-Friday:
   *

   * <Minutes>5</Minutes>
   * <Hours>star/3</Hours>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   *

   * On the 20 and 50-minute marks, every hour, every month except June, Monday-Friday:
   *

   * <Minutes>20,50</Minutes>
   * <Months>1-5,7-12</Months>
   * <DaysofWeek>1-5</DaysofWeek>
   *

   *
   * @param value An instances of type {@link Integer}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withDuration(Integer value) {
    setDuration(new Duration_UN4(value));
    return this;
  }

  /**
   * Set the serial of the referenced Location.
   *
   * @param value An instances of type {@link Serial}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withLocationRef(Serial value) {
    setLocationRef(value);
    return this;
  }

  /**
   * Set the Project
   *

   * Complex element Project provides the Project, OPLAN, COMPLAN or Exercise
   * name, or any other project name associated to the dataset.
   *
   * @param values One or more instances of type {@link Project}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withProject(Project... values) {
    if (values != null) {
      getProject().addAll(Arrays.asList(values));
    }
    return this;
  }

  /**
   * Set the Project
   *

   * Complex element Project provides the Project, OPLAN, COMPLAN or Exercise
   * name, or any other project name associated to the dataset.
   *
   * @param values A collection of {@link Project} instances
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withProject(Collection<Project> values) {
    if (values != null) {
      getProject().addAll(values);
    }
    return this;
  }

  /**
   * Set the AtWayPoint
   *

   * Complex element AtWayPoint defines a point in time at which a Force Element
   * is at a given waypoint along a route.
   *
   * @param values One or more instances of type {@link AtWaypoint}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withAtWaypoint(AtWaypoint... values) {
    if (values != null) {
      getAtWaypoint().addAll(Arrays.asList(values));
    }
    return this;
  }

  /**
   * Set the AtWayPoint
   *

   * Complex element AtWayPoint defines a point in time at which a Force Element
   * is at a given waypoint along a route.
   *
   * @param values A collection of {@link AtWaypoint} instances
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withAtWaypoint(Collection<AtWaypoint> values) {
    if (values != null) {
      getAtWaypoint().addAll(values);
    }
    return this;
  }

  /**
   * Get a string representation of this FEDeployment instance configuration.
   *
   * @return The current object instance configuration as a non-null String
   */
  @Override
  public String toString() {
    return "\n  FEDeployment {"
           + (atWaypoint != null ? " atWaypoint [" + atWaypoint + "]" : "")
           + (daysOfMonth != null ? " daysOfMonth [" + daysOfMonth + "]" : "")
           + (daysOfWeek != null ? " daysOfWeek [" + daysOfWeek + "]" : "")
           + (duration != null ? " duration [" + duration + "]" : "")
           + (feRef != null ? " feRef [" + feRef + "]" : "")
           + (hours != null ? " hours [" + hours + "]" : "")
           + (locationRef != null ? " locationRef [" + locationRef + "]" : "")
           + (minutes != null ? " minutes [" + minutes + "]" : "")
           + (months != null ? " months [" + months + "]" : "")
           + (num != null ? " num [" + num + "]" : "")
           + (project != null ? " project [" + project + "]" : "")
           + (seconds != null ? " seconds [" + seconds + "]" : "")
           + (type != null ? " type [" + type + "]" : "")
           + (years != null ? " years [" + years + "]" : "")
           + super.toString();
  }

  /**
   * Determine if the required fields in this SSRF data type instance are set.
   *

   * {@link FEDeployment} requires
   * {@link ListCCL cls}, {@link Serial serial}, {@link DT entryDateTime}
   * and {@link Serial FERef}, {@link TString Type}.
   *

   * Note that this method only checks for the presence of required information;
   * this method does not validate the information format.
   *
   * @return TRUE if required fields are set, otherwise FALSE
   */
  @Override
  public boolean isSet() {
    return super.isSet() && isSetFERef() && isSetType();
  }

  //<editor-fold defaultstate="collapsed" desc="SSRF Referenced Object Instances">
  /**
   * FERef - Force Element Serial (Required)
   *

   * The dataset identifier of the ForceElement being deployed.
   *

   * Format is pattern (S29)
   *
   * @since 3.1.0
   */
  @XmlTransient
  private ForceElement forceElement;

  /**
   * Get the dataset identifier of the ForceElement being deployed..
   *
   * @return a {@link ForceElement} instance
   * @since 3.1.0
   */
  public ForceElement getForceElement() {
    return forceElement;
  }

  /**
   * Determine if the forceElement field is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetForceElement() {
    return this.forceElement != null;
  }

  /**
   * Set the dataset identifier of the ForceElement being deployed.
   *
   * @param value An instances of type {@link ForceElement}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withForceElement(ForceElement value) {
    this.forceElement = value;
    return this;
  }

  /**
   * US:LocationRef - Plan Location Serial (Optional)
   *

   * The unique reference serial of an existing Location dataset.
   *

   * Format is pattern (S29)
   *
   * @since 3.1.0
   */
  @XmlTransient
  private Location location;

  /**
   * Get the unique reference serial of an existing Location dataset..
   *
   * @return a {@link Location} instance
   * @since 3.1.0
   */
  public Location getLocation() {
    return location;
  }

  /**
   * Determine if the location field is configured.
   *
   * @return TRUE if the field is set, FALSE if the field is null
   */
  public boolean isSetLocation() {
    return this.location != null;
  }

  /**
   * Set the unique reference serial of an existing Location dataset.
   *
   * @param value An instances of type {@link Location}.
   * @return The current FEDeployment object instance.
   * @since 3.1.0
   */
  public FEDeployment withLocation(Location value) {
    this.location = value;
    return this;
  }

  /**
   * Update the SSRF data type references in this FEDeployment record.
   *

   * This method builds the exported {@link #feRef} field with values from the
   * transient {@link #forceElement} field. This method should typically be
   * called after the FEDeployment is configured and (optionally) before
   * exporting an SSRF message.
   *
   * @since 3.1.0
   */
  @Override
  public void prepare() {
    super.prepare();
    this.feRef = forceElement != null ? forceElement.getSerial() : this.feRef;
    this.locationRef = location != null ? location.getSerial() : this.locationRef;
  }

  /**
   * Update the SSRF data type references in this FEDeployment record after
   * loading from XML.
   *

   * This method builds the transient {@link #forceElement} with values from the
   * imported {@link #feRef} field. This method should typically be called after
   * the FEDeployment is imported from XML. * @param root the SSRF root
   * instance.
   *
   * @since 3.1.0
   */
  @Override
  public void postLoad(SSRF root) {
    if (feRef == null || !feRef.isSetValue()) {
      return;
    }
    for (ForceElement instance : root.getForceElement()) {
      if (feRef.equals(instance.getSerial())) {
        forceElement = instance;
        return;
      }
    }
    if (locationRef == null || !locationRef.isSetValue()) {
      return;
    }
    for (Location instance : root.getLocation()) {
      if (locationRef.equals(instance.getSerial())) {
        location = instance;
        return;
      }
    }
  }//</editor-fold>

}


text:
#include <peelo/io/filepath.hpp>

namespace peelo
{
    static void parse(const string&, set<filename>&);

#if defined(_WIN32)
    const rune filepath::separator(';');
#else
    const rune filepath::separator(':');
#endif

    filepath::filepath() {}

    filepath::filepath(const filepath& that)
        : m_filenames(that.m_filenames) {}

    filepath::filepath(const set<filename>& filenames)
        : m_filenames(filenames) {}

    filepath::filepath(const string& str)
    {
        parse(str, m_filenames);
    }

    bool filepath::is_separator(const rune& r)
    {
        return r == ':' || r == ';';
    }

    filepath& filepath::assign(const filepath& that)
    {
        m_filenames = that.m_filenames;

        return *this;
    }

    filepath& filepath::assign(const set<filename>& filenames)
    {
        m_filenames = filenames;

        return *this;
    }

    filepath& filepath::assign(const string& str)
    {
        m_filenames.clear();
        parse(str, m_filenames);

        return *this;
    }

    bool filepath::equals(const filepath& that) const
    {
        return m_filenames == that.m_filenames;
    }

    static void parse(const string& source, set<filename>& filenames)
    {
        string::size_type begin = 0;
        string::size_type end = 0;

        if (source.empty())
        {
            return;
        }
        for (string::size_type i = 0; i < source.length(); ++i)
        {
            if (source[i] == filepath::separator)
            {
                if (end - begin > 0)
                {
                    string str = source.substr(begin, end - begin);

                    if (!str.empty() && !str.is_space())
                    {
                        filenames.insert(str);
                    }
                }
                begin = end = i + 1;
            } else {
                ++end;
            }
        }
        if (end - begin > 0)
        {
            string str = source.substr(begin, end - begin);

            if (!str.empty() && !str.is_space())
            {
                filenames.insert(str);
            }
        }
    }

    std::ostream& operator<<(std::ostream& os, const class filepath& filepath)
    {
        const set<filename>& filenames = filepath.filenames();

        for (set<filename>::const_iterator i = filenames.begin();
             i != filenames.end();
             ++i)
        {
            if (i != filenames.begin())
            {
                os << filepath::separator;
            }
            os << *i;
        }

        return os;
    }

    std::wostream& operator<<(std::wostream& os, const class filepath& filepath)
    {
        const set<filename>& filenames = filepath.filenames();

        for (set<filename>::const_iterator i = filenames.begin();
             i != filenames.end();
             ++i)
        {
            if (i != filenames.begin())
            {
                os << filepath::separator;
            }
            os << *i;
        }

        return os;
    }
}


text:
[![Build Status][travis-image]][travis-url]
[![NPM package][npm-image]][npm-url]
[![Dependency Status][depstat-image]][depstat-url]
[![License][license-image]][license-url]

# webpack-espower-loader

Power Assert instrumentor module for webpack.

## Description

`webpack-espower-loader` is a webpack loader module for [power-assert](https://github.com/power-assert-js/power-assert).
`webpack-espower-loader` applies [espower](http://github.com/power-assert-js/espower) to target sources through webpack loader chain.

Pull-requests, issue reports and patches are always welcomed.

See [power-assert](https://github.com/power-assert-js/power-assert) project for more documentation.

## FAQ

#### webpack-espower-loader does not work with babel-loader!

webpack-espower-loader does not work with [babel-loader](https://github.com/babel/babel-loader) due to the change of transpiled code since babel 5.0. Please use [babel-plugin-espower](https://github.com/power-assert-js/babel-plugin-espower) with babel-loader.

## Installation

Install `power-assert` and `webpack-espower-loader` via npm:

```console
$ npm install --save-dev webpack-espower-loader
```

## Caution

For webpack3 or lower, you need to use [the 1.x release of webpack-espower-loader](https://github.com/power-assert-js/webpack-espower-loader/tree/1.x).

```
$ npm install --save-dev webpack-espower-loader@1.0.2
```

## Usage

Configure `webpack.config.js` to apply `webpack-espower-loader` through webpack loader transformation chain. Options are passed through to espower.
If not passed, default options (Same as [espower.defaultOptions()](https://github.com/power-assert-js/espower#var-options--espowerdefaultoptions)) will be used.

```js
{
    module: {
        exprContextCritical: false,
        rules: [{
            test: /_test\.js$/,
            use: [{
                loader: "webpack-espower-loader",
                options: {
                    patterns: [
                        'assert(value, [message])',
                        'assert.ok(value, [message])',
                        'assert.equal(actual, expected, [message])',
                        'assert.notEqual(actual, expected, [message])',
                        'assert.strictEqual(actual, expected, [message])',
                        'assert.notStrictEqual(actual, expected, [message])',
                        'assert.deepEqual(actual, expected, [message])',
                        'assert.notDeepEqual(actual, expected, [message])'
                    ]
                }
            }]
        }]
    }
}
```

## Changelog

See [CHANGELOG.md](https://github.com/power-assert-js/webpack-espower-loader/blob/master/CHANGELOG.md).

## Author

* [zoncoen (Kenta Mori)](https://github.com/zoncoen)

## Contributors

* [twada (Takuto Wada)](https://github.com/twada)
* [chrisfarms (Chris Farmiloe)](https://github.com/chrisfarms)

## License

Licensed under the MIT license. See [LICENSE](https://github.com/power-assert-js/webpack-espower-loader/blob/master/LICENSE).

[travis-url]: https://travis-ci.org/power-assert-js/webpack-espower-loader
[travis-image]: https://secure.travis-ci.org/power-assert-js/webpack-espower-loader.svg?branch=master

[npm-url]: https://npmjs.org/package/webpack-espower-loader
[npm-image]: https://badge.fury.io/js/webpack-espower-loader.svg

[depstat-url]: https://gemnasium.com/power-assert-js/webpack-espower-loader
[depstat-image]: https://gemnasium.com/power-assert-js/webpack-espower-loader.svg

[license-url]: https://github.com/power-assert-js/webpack-espower-loader/blob/master/LICENSE
[license-image]: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat


text:
package org.doxu.iota.board;

import org.doxu.iota.Card;
import org.doxu.iota.Location;

public interface BoardView {

    void init();

    /**
     * Returns the location of the card on the board or null if the card isn't
     * on the board.
     *
     * @param card Card o search for.
     * @return Location of the card or null if it isn't on the board.
     */
    Location findCard(Card card);

    Card getCard(Location location);

    void applyCard(Location location, Card card);

    BoardBounds getBounds();
}


text:
// Generated by CoffeeScript 1.6.3
var Route, exports;

Route = (function() {
  function Route(pattern, view) {
    var re_str;
    this.pattern = pattern;
    this.view = view;
    re_str = this.pattern.replace(/\?/g, '([^/]+)').replace(/\*/g, '(.*)');
    this.re = new RegExp("^" + re_str + "$");
  }

  Route.prototype.reverse = function(params) {
    return this.pattern.replace(/[\?\*]/, function() {
      return params.shift();
    });
  };

  Route.prototype.match = function(url) {
    var params;
    if (params = url.match(this.re)) {
      return params.slice(1);
    }
  };

  return Route;

})();

exports = module.exports = Route;

/*
//@ sourceMappingURL=route.map
*/


text:
published: false
layout: showcase/spotlight
title: "Digg.com"
description: "Featuring a fast hamburger menu and a clean layout, Digg works amazingly well on mobile."
published_on: 2015-03-24
updated_on: 2015-03-24
authors:
  - pbakaus
tags:
  - reader
  - news

showcase:
  scores:
    pagespeed:
      speed: 57
      ux: 97
    webpagetest:
      value: 8291
      result: http://www.webpagetest.org/result/150115_EM_TMG/
  link: http://digg.com
  developer: Digg
  our_views:
    good: |
      Digg's mobile presentation is really what one could call 'no fuzz'. They focus on their core experience, and while the layout is clean and simple, they got all of their basic functionality covered. The reduction makes the layout blazing fast, as well as the expandable Hamburger menu.
    bad: |
      Digg blocks user zooming which is a no-no nowadays. We'd love to see them add a [manifest](/web/fundamentals/engage-and-retain/simplified-app-installs) so that you can install the web app on Android, as well as [theme-color support](/web/fundamentals/design-and-ui/browser-customization/theme-color).

related-guides:
-
    title: "Web App Manifest"
    href: fundamentals/engage-and-retain/simplified-app-installs
    section:
      id: stickyness
      title: "Add To Home Screen"
      href: fundamentals/engage-and-retain/simplified-app-installs
-
    title: "Theme Color"
    href: fundamentals/design-and-ui/browser-customization/theme-color
    section:
      id: stickyness
      title: "Browser Customization"
      href: fundamentals/design-and-ui/browser-customization
---


text:
FString FPendingLatentAction::GetDescription() const
{
	return TEXT("Not implemented");
}
#endif

/////////////////////////////////////////////////////
// FLatentActionManager

void FLatentActionManager::AddNewAction(UObject* InActionObject, int32 UUID, FPendingLatentAction* NewAction)
{
	auto& ObjectActionListPtr = ObjectToActionListMap.FindOrAdd(InActionObject);
	if (!ObjectActionListPtr.Get())
	{
		ObjectActionListPtr = MakeShareable(new FActionList());
	}
	ObjectActionListPtr->Add(UUID, NewAction);
}

void FLatentActionManager::RemoveActionsForObject(TWeakObjectPtr<UObject> InObject)
{
	auto ObjectActionList = GetActionListForObject(InObject);
	if (ObjectActionList)
	{
		auto& ActionToRemoveListPtr = ActionsToRemoveMap.FindOrAdd(InObject);
		if (!ActionToRemoveListPtr.IsValid())
		{
			ActionToRemoveListPtr = MakeShareable(new TArray<FUuidAndAction>());
		}

		for (FActionList::TConstIterator It(*ObjectActionList); It; ++It)
		{
			ActionToRemoveListPtr->Add(*It);
		}
	}
}

void FLatentActionManager::ProcessLatentActions(UObject* InObject, float DeltaTime)
{
	for (FActionsForObject::TIterator It(ActionsToRemoveMap); It; ++It)
	{
		auto ActionList = GetActionListForObject(It.Key());
		auto ActionToRemoveListPtr = It.Value();
		if (ActionToRemoveListPtr.IsValid() && ActionList)
		{
			for (auto PendingActionToKill : *ActionToRemoveListPtr)
			{
				const int32 RemovedNum = ActionList->RemoveSingle(PendingActionToKill.Key, PendingActionToKill.Value);
				auto Action = PendingActionToKill.Value;
				if (RemovedNum && Action)
				{
					Action->NotifyActionAborted();
					delete Action;
				}
			}
		}
	}
	ActionsToRemoveMap.Empty();

	//@TODO: K2: Very inefficient code right now
	if (InObject != NULL)
	{
		if (!ProcessedThisFrame.Contains(InObject))
		{
			if (FActionList* ObjectActionList = GetActionListForObject(InObject))
			{
				TickLatentActionForObject(DeltaTime, *ObjectActionList, InObject);
				ProcessedThisFrame.Add(InObject);
			}
		}
	}
	else
	{
		for (FObjectToActionListMap::TIterator ObjIt(ObjectToActionListMap); ObjIt; ++ObjIt)
		{
			TWeakObjectPtr<UObject> WeakPtr = ObjIt.Key();
			UObject* Object = WeakPtr.Get();
			auto ObjectActionListPtr = ObjIt.Value().Get();
			check(ObjectActionListPtr);
			FActionList& ObjectActionList = *ObjectActionListPtr;

			if (Object != NULL)
			{
				// Tick all outstanding actions for this object
				if (ObjectActionList.Num() > 0)
				{
					if (!ProcessedThisFrame.Contains(Object))
					{
						TickLatentActionForObject(DeltaTime, ObjectActionList, Object);
						ensure(ObjectActionListPtr == ObjIt.Value().Get());
						ProcessedThisFrame.Add(Object);
					}
				}
			}
			else
			{
				// Terminate all outstanding actions for this object, which has been GCed
				for (TMultiMap<int32, FPendingLatentAction*>::TConstIterator It(ObjectActionList); It; ++It)
				{
					FPendingLatentAction* Action = It.Value();
					Action->NotifyObjectDestroyed();
					delete Action;
				}
				ObjectActionList.Empty();
			}

			// Remove the entry if there are no pending actions remaining for this object (or if the object was NULLed and cleaned up)
			if (ObjectActionList.Num() == 0)
			{
				ObjIt.RemoveCurrent();
			}
		}
	}
}

void FLatentActionManager::TickLatentActionForObject(float DeltaTime, FActionList& ObjectActionList, UObject* InObject)
{
	typedef TPair<int32, FPendingLatentAction*> FActionListPair;
	TArray<FActionListPair, TInlineAllocator<4>> ItemsToRemove;

	FLatentResponse Response(DeltaTime);
	for (TMultiMap<int32, FPendingLatentAction*>::TConstIterator It(ObjectActionList); It; ++It)
	{
		FPendingLatentAction* Action = It.Value();

		Response.bRemoveAction = false;

		Action->UpdateOperation(Response);

		if (Response.bRemoveAction)
		{
			new (ItemsToRemove) FActionListPair(TPairInitializer<int32, FPendingLatentAction*>(It.Key(), Action));
		}
	}

	// Remove any items that were deleted
	for (int32 i = 0; i < ItemsToRemove.Num(); ++i)
	{
		const FActionListPair& ItemPair = ItemsToRemove[i];
		const int32 ItemIndex = ItemPair.Key;
		FPendingLatentAction* DyingAction = ItemPair.Value;
		ObjectActionList.Remove(ItemIndex, DyingAction);
		delete DyingAction;
	}

	// Trigger any pending execution links
	for (int32 i = 0; i < Response.LinksToExecute.Num(); ++i)
	{
		FLatentResponse::FExecutionInfo& LinkInfo = Response.LinksToExecute[i];
		if (LinkInfo.LinkID != INDEX_NONE)
		{
			if (UObject* CallbackTarget = LinkInfo.CallbackTarget.Get())
			{
				check(CallbackTarget == InObject);

				if (UFunction* ExecutionFunction = CallbackTarget->FindFunction(LinkInfo.ExecutionFunction))
				{
					CallbackTarget->ProcessEvent(ExecutionFunction, &(LinkInfo.LinkID));
				}
				else
				{
					UE_LOG(LogScript, Warning, TEXT("FLatentActionManager::ProcessLatentActions: Could not find latent action resume point named '%s' on '%s' called by '%s'"),
						*LinkInfo.ExecutionFunction.ToString(), *(CallbackTarget->GetPathName()), *(InObject->GetPathName()));
				}
			}
			else
			{
				UE_LOG(LogScript, Warning, TEXT("FLatentActionManager::ProcessLatentActions: CallbackTarget is None."));
			}
		}
	}
}

#if WITH_EDITOR

FString FLatentActionManager::GetDescription(UObject* InObject, int32 UUID) const
{
	check(InObject);

	FString Description = *NSLOCTEXT("LatentActionManager", "NoPendingActions", "No Pending Actions").ToString();

	const FLatentActionManager::FActionList* ObjectActionList = GetActionListForObject(InObject);
	if ((ObjectActionList != NULL) && (ObjectActionList->Num() > 0))
	{
		TArray<FPendingLatentAction*> Actions;
		ObjectActionList->MultiFind(UUID, Actions);

		const int32 PendingActions = Actions.Num();

		// See if there are pending actions
		if (PendingActions > 0)
		{
			FPendingLatentAction* PrimaryAction = Actions[0];
			FString ActionDesc = PrimaryAction->GetDescription();

			Description = (PendingActions > 1)
				? FString::Printf( *NSLOCTEXT("LatentActionManager", "NumPendingActions", "%d Pending Actions: %s").ToString(), PendingActions, *ActionDesc)
				: ActionDesc;
		}
	}
	return Description;
}
void FLatentActionManager::GetActiveUUIDs(UObject* InObject, TSet<int32>& UUIDList) const
{
	check(InObject);

	const FLatentActionManager::FActionList* ObjectActionList = GetActionListForObject(InObject);
	if ((ObjectActionList != NULL) && (ObjectActionList->Num() > 0))
	{
		for (TMultiMap<int32, FPendingLatentAction*>::TConstIterator It(*ObjectActionList); It; ++It)
		{
			UUIDList.Add(It.Key());
		}
	}
}

#endif


text:
namespace content {

class SynchronousCompositorClient;
class WebContents;

// Android wrapper around WebContents that provides safer passage from java and
// back to native and provides java with a means of communicating with its
// native counterpart.
class CONTENT_EXPORT WebContentsAndroid
    : public base::SupportsUserData::Data {
 public:
  static bool Register(JNIEnv* env);

  explicit WebContentsAndroid(WebContents* web_contents);
  ~WebContentsAndroid() override;

  WebContents* web_contents() const { return web_contents_; }

  base::android::ScopedJavaLocalRef<jobject> GetJavaObject();

  // Methods called from Java
  base::android::ScopedJavaLocalRef<jstring> GetTitle(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj) const;
  base::android::ScopedJavaLocalRef<jstring> GetVisibleURL(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj) const;

  bool IsLoading(JNIEnv* env,
                 const base::android::JavaParamRef<jobject>& obj) const;
  bool IsLoadingToDifferentDocument(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj) const;

  void Stop(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void Cut(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void Copy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void Paste(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void Replace(JNIEnv* env,
               const base::android::JavaParamRef<jobject>& obj,
               const base::android::JavaParamRef<jstring>& jstr);
  void SelectAll(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void Unselect(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  jint GetBackgroundColor(JNIEnv* env,
                          const base::android::JavaParamRef<jobject>& obj);
  base::android::ScopedJavaLocalRef<jstring> GetURL(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>&) const;
  base::android::ScopedJavaLocalRef<jstring> GetLastCommittedURL(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>&) const;
  jboolean IsIncognito(JNIEnv* env,
                       const base::android::JavaParamRef<jobject>& obj);

  void ResumeLoadingCreatedWebContents(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj);

  void OnHide(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void OnShow(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
  void ReleaseMediaPlayers(JNIEnv* env,
                           const base::android::JavaParamRef<jobject>& jobj);

  void ShowInterstitialPage(JNIEnv* env,
                            const base::android::JavaParamRef<jobject>& obj,
                            const base::android::JavaParamRef<jstring>& jurl,
                            jlong delegate_ptr);
  jboolean IsShowingInterstitialPage(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj);
  jboolean FocusLocationBarByDefault(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj);
  jboolean IsRenderWidgetHostViewReady(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj);
  void ExitFullscreen(JNIEnv* env,
                      const base::android::JavaParamRef<jobject>& obj);
  void UpdateTopControlsState(JNIEnv* env,
                              const base::android::JavaParamRef<jobject>& obj,
                              bool enable_hiding,
                              bool enable_showing,
                              bool animate);
  void ShowImeIfNeeded(JNIEnv* env,
                       const base::android::JavaParamRef<jobject>& obj);
  void ScrollFocusedEditableNodeIntoView(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj);
  void SelectWordAroundCaret(JNIEnv* env,
                             const base::android::JavaParamRef<jobject>& obj);
  void AdjustSelectionByCharacterOffset(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      jint start_adjust,
      jint end_adjust);
  void InsertCSS(JNIEnv* env,
                 const base::android::JavaParamRef<jobject>& jobj,
                 const base::android::JavaParamRef<jstring>& jcss);
  void EvaluateJavaScript(JNIEnv* env,
                          const base::android::JavaParamRef<jobject>& obj,
                          const base::android::JavaParamRef<jstring>& script,
                          const base::android::JavaParamRef<jobject>& callback);
  void EvaluateJavaScriptForTests(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& script,
      const base::android::JavaParamRef<jobject>& callback);

  void AddMessageToDevToolsConsole(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& jobj,
      jint level,
      const base::android::JavaParamRef<jstring>& message);

  void SendMessageToFrame(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& frame_name,
      const base::android::JavaParamRef<jstring>& message,
      const base::android::JavaParamRef<jstring>& target_origin);

  jboolean HasAccessedInitialDocument(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& jobj);

  jint GetThemeColor(JNIEnv* env,
                     const base::android::JavaParamRef<jobject>& obj);

  void RequestAccessibilitySnapshot(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jobject>& callback,
      jfloat y_offset,
      jfloat x_scroll);

  void ResumeMediaSession(JNIEnv* env,
                          const base::android::JavaParamRef<jobject>& obj);
  void SuspendMediaSession(JNIEnv* env,
                           const base::android::JavaParamRef<jobject>& obj);
  void StopMediaSession(JNIEnv* env,
                        const base::android::JavaParamRef<jobject>& obj);

  base::android::ScopedJavaLocalRef<jstring> GetEncoding(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj) const;

  // Relay the access from Java layer to GetScaledContentBitmap through JNI.
  void GetContentBitmap(JNIEnv* env,
                        const base::android::JavaParamRef<jobject>& obj,
                        const base::android::JavaParamRef<jobject>& jcallback,
                        const base::android::JavaParamRef<jobject>& color_type,
                        jfloat scale,
                        jfloat x,
                        jfloat y,
                        jfloat width,
                        jfloat height);

  void OnContextMenuClosed(JNIEnv* env,
                           const base::android::JavaParamRef<jobject>& obj);

  void set_synchronous_compositor_client(SynchronousCompositorClient* client) {
    synchronous_compositor_client_ = client;
  }
  SynchronousCompositorClient* synchronous_compositor_client() const {
    return synchronous_compositor_client_;
  }

 private:
  RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid();

  void OnFinishGetContentBitmap(
      base::android::ScopedJavaGlobalRef<jobject>* obj,
      base::android::ScopedJavaGlobalRef<jobject>* callback,
      const SkBitmap& bitmap,
      ReadbackResponse response);

  WebContents* web_contents_;
  NavigationControllerAndroid navigation_controller_;
  base::android::ScopedJavaGlobalRef<jobject> obj_;
  SynchronousCompositorClient* synchronous_compositor_client_;

  base::WeakPtrFactory<WebContentsAndroid> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid);
};

}  // namespace content

#endif  // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_


text:
import sys
import time

import redis

HISTORY_CMD_KEY = "lehome:cmd_history_list"

r = redis.Redis(host='localhost', port=6379)

print "dbsize:", r.dbsize()
print "num of keys:", r.keys()
print "volume:", r.get("lehome:last_volume")

historys = r.lrange(HISTORY_CMD_KEY, 0, -1)
print "history size:", len(historys)

# r.delete(HISTORY_CMD_KEY)

# for i in range(1, 10):
#     print historys[-i]

look_up_dict = {}
for item in historys:
    item = item.split(":")
    stmp = int(item[0])
    cmd = item[1]
    if cmd not in look_up_dict:
        look_up_dict[cmd] = {'count': 0}
    look_up_dict[cmd]['count'] = look_up_dict[cmd]['count'] + 1
print look_up_dict


text:
module ExLintSpec (main, spec) where

import ExLint
import Test.Hspec

main :: IO ()
main = hspec spec

spec :: Spec
spec = return ()


text:
@implementation YPInterceptor

- (void)networkManager:(YPNetworkManager *)networkManager willHandleResponse:(YPNetworkResponse *)responseObject{
    responseObject.responseObject = @{@"hello":@"world"};
}

- (void)networkManager:(YPNetworkManager *)networkManager didHandleResponse:(YPNetworkResponse *)responseObject{
    NSLog(@"%@",responseObject);
}

@end


text:
#include <gtest/gtest.h>

#include <osquery/core.h>
#include <osquery/flags.h>
#include <osquery/logger.h>

namespace osquery {

DECLARE_string(logger_plugin);

class LoggerTests : public testing::Test {
 public:
  void SetUp() {
    logging_status_ = FLAGS_disable_logging;
    FLAGS_disable_logging = false;

    log_lines.clear();
    status_messages.clear();
    statuses_logged = 0;
    last_status = {O_INFO, "", -1, ""};
  }

  void TearDown() { FLAGS_disable_logging = logging_status_; }

  // Track lines emitted to logString
  static std::vector<std::string> log_lines;

  // Track the results of init
  static StatusLogLine last_status;
  static std::vector<std::string> status_messages;

  // Count calls to logStatus
  static int statuses_logged;
  // Count added and removed snapshot rows
  static int snapshot_rows_added;
  static int snapshot_rows_removed;
  // Count the added health status rows
  static int health_status_rows;

 private:
  /// Save the status of logging before running tests, restore afterward.
  bool logging_status_;
};

std::vector<std::string> LoggerTests::log_lines;
StatusLogLine LoggerTests::last_status;
std::vector<std::string> LoggerTests::status_messages;
int LoggerTests::statuses_logged = 0;
int LoggerTests::snapshot_rows_added = 0;
int LoggerTests::snapshot_rows_removed = 0;
int LoggerTests::health_status_rows = 0;

class TestLoggerPlugin : public LoggerPlugin {
 public:
  TestLoggerPlugin() {}

  Status logString(const std::string& s) {
    LoggerTests::log_lines.push_back(s);
    return Status(0, s);
  }

  Status init(const std::string& name, const std::vector<StatusLogLine>& log) {
    for (const auto& status : log) {
      LoggerTests::status_messages.push_back(status.message);
    }

    if (log.size() > 0) {
      LoggerTests::last_status = log.back();
    }

    if (name == "RETURN_FAILURE") {
      return Status(1, "OK");
    } else {
      return Status(0, "OK");
    }
  }

  Status logStatus(const std::vector<StatusLogLine>& log) {
    ++LoggerTests::statuses_logged;
    return Status(0, "OK");
  }

  Status logSnapshot(const std::string& s) {
    LoggerTests::snapshot_rows_added += 1;
    LoggerTests::snapshot_rows_removed += 0;
    return Status(0, "OK");
  }

  Status logHealth(const std::string& s) {
    LoggerTests::health_status_rows += 1;
    return Status(0, "OK");
  }

  virtual ~TestLoggerPlugin() {}
};

TEST_F(LoggerTests, test_plugin) {
  Registry::add<TestLoggerPlugin>("logger", "test");
  Registry::setUp();

  auto s = Registry::call("logger", "test", {{"string", "foobar"}});
  EXPECT_TRUE(s.ok());
  EXPECT_EQ(LoggerTests::log_lines.back(), "foobar");
}

TEST_F(LoggerTests, test_logger_init) {
  // Expect the logger to have been registered from the first test.
  EXPECT_TRUE(Registry::exists("logger", "test"));
  EXPECT_TRUE(Registry::setActive("logger", "test").ok());

  initStatusLogger("logger_test");
  // This will be printed to stdout.
  LOG(WARNING) << "Logger test is generating a warning status (1)";
  initLogger("logger_test");

  // The warning message will have been buffered and sent to the active logger
  // which is test.
  EXPECT_EQ(LoggerTests::status_messages.size(), 1U);

  // The logStatus API should NOT have been called. It will only be used if
  // (1) The active logger's init returns success within initLogger and
  // (2) for status logs generated after initLogger is called.
  EXPECT_EQ(LoggerTests::statuses_logged, 0);
}

TEST_F(LoggerTests, test_logger_log_status) {
  // This will be printed to stdout.
  LOG(WARNING) << "Logger test is generating a warning status (2)";

  // The second warning status will be sent to the logger plugin.
  EXPECT_EQ(LoggerTests::statuses_logged, 1);
}

TEST_F(LoggerTests, test_logger_variations) {
  // Init the logger for a second time, this should only be done for testing.
  // This time we'll trigger the init method to fail and prevent additional
  // status messages from trigger logStatus.
  initLogger("RETURN_FAILURE");

  // This will be printed to stdout.
  LOG(WARNING) << "Logger test is generating a warning status (3)";

  // Since the initLogger call triggered a failed init, meaning the logger
  // does NOT handle Glog logs, there will be no statuses logged.
  EXPECT_EQ(LoggerTests::statuses_logged, 0);
}

TEST_F(LoggerTests, test_logger_snapshots) {
  // A snapshot query should not include removed items.
  QueryLogItem item;
  item.name = "test_query";
  item.identifier = "unknown_test_host";
  item.time = 0;
  item.calendar_time = "no_time";

  // Add a fake set of results.
  item.results.added.push_back({{"test_column", "test_value"}});
  logSnapshotQuery(item);

  // Expect the plugin to optionally handle snapshot logging.
  EXPECT_EQ(LoggerTests::snapshot_rows_added, 1);

  // Add the same item as a health status log item.
  logHealthStatus(item);
  EXPECT_EQ(LoggerTests::health_status_rows, 1);
}
}


text:
====================
Driver Session Tests
====================

.. contents::

----

Introduction
============

The YAML and JSON files in this directory are platform-independent tests
meant to exercise a driver's implementation of sessions. These tests utilize the
`Unified Test Format <../../unified-test-format/unified-test-format.rst>`__.

Several prose tests, which are not easily expressed in YAML, are also presented
in the Driver Sessions Spec. Those tests will need to be manually implemented
by each driver.

Snapshot session tests
======================
Snapshot sessions tests require server of version 5.0 or higher and
replica set or a sharded cluster deployment.
Default snapshot history window on the server is 5 minutes. Running the test in debug mode, or in any other slow configuration
may lead to `SnapshotTooOld` errors. Drivers can work around this issue by increasing the server's `minSnapshotHistoryWindowInSeconds` parameter, for example:

.. code:: python

    client.admin.command('setParameter', 1, minSnapshotHistoryWindowInSeconds=60)

Prose tests
```````````

1. Setting both ``snapshot`` and ``causalConsistency`` to true is not allowed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* ``client.startSession(snapshot = true, causalConsistency = true)``
* Assert that an error was raised by driver

Changelog
=========

:2019-05-15: Initial version.
:2021-06-15: Added snapshot-session tests. Introduced legacy and unified folders.
:2021-07-30: Use numbering for prose test
:2022-02-11: Convert legacy tests to unified format


text:
import {Component, Inject} from '@angular/core';

import { Store } from '@ngrx/store';
import { IModel, IModelLayer } from '../../store/model/model.reducer';

import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';

@Component({
  selector: 'your-dialog-selector',
  template: `

Models

{{item.name}}

  `
})
export class SelectModelComponent {
  models$: Store<IModel[]>;

  constructor(public dialogRef: MatDialogRef<SelectModelComponent>, @Inject(MAT_DIALOG_DATA) public data: {models$: Store<IModel[]>}) { }

  selectModel(model: IModel): void{
    this.dialogRef.close(model);
  }
}


text:
require 'compass/import-once/activate'
# Require any additional compass plugins here.

http_path 		= "../"
css_dir 		= "../css"
sass_dir 		= "sass"
images_dir 		= "../img"
javascripts_dir = "../js"
fonts_dir		= "../fonts"

output_style 	= :compressed
line_comments 	= false


text:
package com.android.server;

public class TwilightCalculator
{
  // Fields

  public static final int DAY = 0;

  public static final int NIGHT = 1;

  public long mSunset;

  public long mSunrise;

  public int mState;

  // Constructors

  public TwilightCalculator(){
  }
  // Methods

  public void calculateTwilight(long arg1, double arg2, double arg3){
  }
}


text:
template <typename Span, size_t Offset, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
    LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
    LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count))));
    auto s1 = sp.template subspan<Offset, Count>();
    auto s2 = sp.subspan(Offset, Count);
    using S1 = decltype(s1);
    using S2 = decltype(s2);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
    static_assert(S1::extent == Count);
    static_assert(S2::extent == std::dynamic_extent, "");
    return
        s1.data() == s2.data()
     && s1.size() == s2.size()
     && std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
}

template <typename Span, size_t Offset>
constexpr bool testConstexprSpan(Span sp)
{
    LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
    LIBCPP_ASSERT((noexcept(sp.subspan(Offset))));
    auto s1 = sp.template subspan<Offset>();
    auto s2 = sp.subspan(Offset);
    using S1 = decltype(s1);
    using S2 = decltype(s2);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
    static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), "");
    static_assert(S2::extent == std::dynamic_extent, "");
    return
        s1.data() == s2.data()
     && s1.size() == s2.size()
     && std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end());
}

template <typename Span, size_t Offset, size_t Count>
void testRuntimeSpan(Span sp)
{
    LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
    LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count))));
    auto s1 = sp.template subspan<Offset, Count>();
    auto s2 = sp.subspan(Offset, Count);
    using S1 = decltype(s1);
    using S2 = decltype(s2);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
    static_assert(S1::extent == Count);
    static_assert(S2::extent == std::dynamic_extent, "");
    assert(s1.data() == s2.data());
    assert(s1.size() == s2.size());
    assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset));
}

template <typename Span, size_t Offset>
void testRuntimeSpan(Span sp)
{
    LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
    LIBCPP_ASSERT((noexcept(sp.subspan(Offset))));
    auto s1 = sp.template subspan<Offset>();
    auto s2 = sp.subspan(Offset);
    using S1 = decltype(s1);
    using S2 = decltype(s2);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type);
    ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type);
    static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), "");
    static_assert(S2::extent == std::dynamic_extent, "");
    assert(s1.data() == s2.data());
    assert(s1.size() == s2.size());
    assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end()));
}

constexpr int carr1[] = {1,2,3,4};
          int  arr1[] = {5,6,7};

int main(int, char**)
{
    {
    using Sp = std::span<const int>;
    static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");

    static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), "");

    static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), "");
    }

    {
    using Sp = std::span<const int, 4>;

    static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), "");

    static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), "");
    }

    {
    using Sp = std::span<const int>;
    static_assert(testConstexprSpan<Sp, 0>(Sp{}), "");

    static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
    }

    {
    using Sp = std::span<const int, 4>;

    static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), "");

    static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), "");
    static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), "");
    }

    {
    using Sp = std::span<int>;
    testRuntimeSpan<Sp, 0>(Sp{});

    testRuntimeSpan<Sp, 0, 3>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 0>(Sp{arr1});

    testRuntimeSpan<Sp, 1, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 2, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 3, 0>(Sp{arr1});
    }

    {
    using Sp = std::span<int, 3>;

    testRuntimeSpan<Sp, 0, 3>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 0, 0>(Sp{arr1});

    testRuntimeSpan<Sp, 1, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 2, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 3, 0>(Sp{arr1});
    }

    {
    using Sp = std::span<int>;
    testRuntimeSpan<Sp, 0>(Sp{});

    testRuntimeSpan<Sp, 0>(Sp{arr1});
    testRuntimeSpan<Sp, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 3>(Sp{arr1});
    }

    {
    using Sp = std::span<int, 3>;

    testRuntimeSpan<Sp, 0>(Sp{arr1});
    testRuntimeSpan<Sp, 1>(Sp{arr1});
    testRuntimeSpan<Sp, 2>(Sp{arr1});
    testRuntimeSpan<Sp, 3>(Sp{arr1});
    }

  return 0;
}


text:
package io.enmasse.systemtest.condition;

import java.util.function.Predicate;
import java.util.stream.Stream;

public enum MultinodeCluster {
    YES(v -> v > 1),
    NO(v -> v == 0),
    WHATEVER(v -> true);

    private final Predicate<Integer> nodeChecker;

    MultinodeCluster(Predicate<Integer> nodeChecker) {
        this.nodeChecker = nodeChecker;
    }

    public static MultinodeCluster isMultinode(int nodeCount) {
        return Stream.of(MultinodeCluster.values())
                .filter(v -> v.nodeChecker.test(nodeCount))
                .findFirst()
                .orElse(NO);
    }
}


text:
import Data.List(genericIndex, genericLength)
import Data.List.Ordered(minus)
import Euler(allPrimes, primeFactors)

nn = 4

findSeqFactors n = matchSeq findFactors
    where matchSeq [] = error "matchSeq: empty"
          matchSeq (x:xs) = if xs `genericIndex` (n-2) == x+n-1
                            then x else matchSeq xs
          findFactors = filter hasFactors $ [2..] `minus` allPrimes
          hasFactors x = (genericLength $ primeFactors x) == n

main = putStrLn $ show $ findSeqFactors nn