text:
<?php

/**
 * @namespace
 */
namespace Zend\GData\GApps\Extension;
use Zend\GData\App;

/**
 * Represents the apps:login element used by the Apps data API. This
 * class is used to describe properties of a user, and is usually contained
 * within instances of Zene_Gdata_GApps_UserEntry or any other class
 * which is linked to a particular username.
 *
 * @uses       \Zend\GData\App\InvalidArgumentException
 * @uses       \Zend\GData\Extension
 * @uses       \Zend\GData\GApps
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage GApps
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Login extends \Zend\GData\Extension
{

    protected $_rootNamespace = 'apps';
    protected $_rootElement = 'login';

    /**
     * The username for this user. This is used as the user's email address
     * and when logging in to Google Apps-hosted services.
     *
     * @var string
     */
    protected $_username = null;

    /**
     * The password for the user. May be in cleartext or as an SHA-1
     * digest, depending on the value of _hashFunctionName.
     *
     * @var string
     */
    protected $_password = null;

    /**
     * Specifies whether the password stored in _password is in cleartext
     * or is an SHA-1 digest of a password. If the password is cleartext,
     * then this should be null. If the password is an SHA-1 digest, then
     * this should be set to 'SHA-1'.
     *
     * At the time of writing, no other hash functions are supported
     *
     * @var string
     */
    protected $_hashFunctionName = null;

    /**
     * True if the user has administrative rights for this domain, false
     * otherwise.
     *
     * @var boolean
     */
    protected $_admin = null;

    /**
     * True if the user has agreed to the terms of service for Google Apps,
     * false otherwise.
     *
     * @var boolean.
     */
    protected $_agreedToTerms = null;

    /**
     * True if this user has been suspended, false otherwise.
     *
     * @var boolean
     */
    protected $_suspended = null;

    /**
     * True if the user will be required to change their password at
     * their next login, false otherwise.
     *
     * @var boolean
     */
    protected $_changePasswordAtNextLogin = null;

    /**
     * Constructs a new Zend_Gdata_GApps_Extension_Login object.
     *
     * @param string $username (optional) The username to be used for this
     *          login.
     * @param string $password (optional) The password to be used for this
     *          login.
     * @param string $hashFunctionName (optional) The name of the hash
     *          function used to protect the password, or null if no
     *          has function has been applied. As of this writing,
     *          the only valid values are 'SHA-1' or null.
     * @param boolean $admin (optional) Whether the user is an administrator
     *          or not.
     * @param boolean $suspended (optional) Whether this login is suspended or not.
     * @param boolean $changePasswordAtNextLogin (optional) Whether
     *          the user is required to change their password at their
     *          next login.
     * @param boolean $agreedToTerms (optional) Whether the user has
     *          agreed to the terms of service.
     */
    public function __construct($username = null, $password = null,
        $hashFunctionName = null, $admin = null, $suspended = null,
        $changePasswordAtNextLogin = null, $agreedToTerms = null)
    {
        $this->registerAllNamespaces(\Zend\GData\GApps::$namespaces);
        parent::__construct();
        $this->_username = $username;
        $this->_password = $password;
        $this->_hashFunctionName = $hashFunctionName;
        $this->_admin = $admin;
        $this->_agreedToTerms = $agreedToTerms;
        $this->_suspended = $suspended;
        $this->_changePasswordAtNextLogin = $changePasswordAtNextLogin;
    }

    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for sending to the server upon updates, or
     * for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     * child properties.
     */
    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
    {
        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
        if ($this->_username !== null) {
            $element->setAttribute('userName', $this->_username);
        }
        if ($this->_password !== null) {
            $element->setAttribute('password', $this->_password);
        }
        if ($this->_hashFunctionName !== null) {
            $element->setAttribute('hashFunctionName', $this->_hashFunctionName);
        }
        if ($this->_admin !== null) {
            $element->setAttribute('admin', ($this->_admin ? "true" : "false"));
        }
        if ($this->_agreedToTerms !== null) {
            $element->setAttribute('agreedToTerms', ($this->_agreedToTerms ? "true" : "false"));
        }
        if ($this->_suspended !== null) {
            $element->setAttribute('suspended', ($this->_suspended ? "true" : "false"));
        }
        if ($this->_changePasswordAtNextLogin !== null) {
            $element->setAttribute('changePasswordAtNextLogin', ($this->_changePasswordAtNextLogin ? "true" : "false"));
        }

        return $element;
    }

    /**
     * Given a DOMNode representing an attribute, tries to map the data into
     * instance members.  If no mapping is defined, the name and value are
     * stored in an array.
     *
     * @param DOMNode $attribute The DOMNode attribute needed to be handled
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'userName':
            $this->_username = $attribute->nodeValue;
            break;
        case 'password':
            $this->_password = $attribute->nodeValue;
            break;
        case 'hashFunctionName':
            $this->_hashFunctionName = $attribute->nodeValue;
            break;
        case 'admin':
            if ($attribute->nodeValue == "true") {
                $this->_admin = true;
            }
            else if ($attribute->nodeValue == "false") {
                $this->_admin = false;
            }
            else {
                throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#admin.");
            }
            break;
        case 'agreedToTerms':
            if ($attribute->nodeValue == "true") {
                $this->_agreedToTerms = true;
            }
            else if ($attribute->nodeValue == "false") {
                $this->_agreedToTerms = false;
            }
            else {
                throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#agreedToTerms.");
            }
            break;
        case 'suspended':
            if ($attribute->nodeValue == "true") {
                $this->_suspended = true;
            }
            else if ($attribute->nodeValue == "false") {
                $this->_suspended = false;
            }
            else {
                throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#suspended.");
            }
            break;
        case 'changePasswordAtNextLogin':
            if ($attribute->nodeValue == "true") {
                $this->_changePasswordAtNextLogin = true;
            }
            else if ($attribute->nodeValue == "false") {
                $this->_changePasswordAtNextLogin = false;
            }
            else {
                throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#changePasswordAtNextLogin.");
            }
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }

    /**
     * Get the value for this element's username attribute.
     *
     * @see setUsername
     * @return string The attribute being modified.
     */
    public function getUsername()
    {
        return $this->_username;
    }

    /**
     * Set the value for this element's username attribute. This string
     * is used to uniquely identify the user in this domian and is used
     * to form this user's email address.
     *
     * @param string $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     */
    public function setUsername($value)
    {
        $this->_username = $value;
        return $this;
    }

    /**
     * Get the value for this element's password attribute.
     *
     * @see setPassword
     * @return string The requested attribute.
     */
    public function getPassword()
    {
        return $this->_password;
    }

    /**
     * Set the value for this element's password attribute. As of this
     * writing, this can be either be provided as plaintext or hashed using
     * the SHA-1 algorithm for protection. If using a hash function,
     * this must be indicated by calling setHashFunctionName().
     *
     * @param string $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     */
    public function setPassword($value)
    {
        $this->_password = $value;
        return $this;
    }

    /**
     * Get the value for this element's hashFunctionName attribute.
     *
     * @see setHashFunctionName
     * @return string The requested attribute.
     */
    public function getHashFunctionName()
    {
        return $this->_hashFunctionName;
    }

    /**
     * Set the value for this element's hashFunctionName attribute. This
     * indicates whether the password supplied with setPassword() is in
     * plaintext or has had a hash function applied to it. If null,
     * plaintext is assumed. As of this writing, the only valid hash
     * function is 'SHA-1'.
     *
     * @param string $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     */
    public function setHashFunctionName($value)
    {
        $this->_hashFunctionName = $value;
        return $this;
    }

    /**
     * Get the value for this element's admin attribute.
     *
     * @see setAdmin
     * @return boolean The requested attribute.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function getAdmin()
    {
        if (!(is_bool($this->_admin))) {
            throw new App\InvalidArgumentException('Expected boolean for admin.');
        }
        return $this->_admin;
    }

    /**
     * Set the value for this element's admin attribute. This indicates
     * whether this user is an administrator for this domain.
     *
     * @param boolean $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function setAdmin($value)
    {
        if (!(is_bool($value))) {
            throw new App\InvalidArgumentException('Expected boolean for $value.');
        }
        $this->_admin = $value;
        return $this;
    }

    /**
     * Get the value for this element's agreedToTerms attribute.
     *
     * @see setAgreedToTerms
     * @return boolean The requested attribute.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function getAgreedToTerms()
    {
        if (!(is_bool($this->_agreedToTerms))) {
            throw new App\InvalidArgumentException('Expected boolean for agreedToTerms.');
        }
        return $this->_agreedToTerms;
    }

    /**
     * Set the value for this element's agreedToTerms attribute. This
     * indicates whether this user has agreed to the terms of service.
     *
     * @param boolean $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function setAgreedToTerms($value)
    {
        if (!(is_bool($value))) {
            throw new App\InvalidArgumentException('Expected boolean for $value.');
        }
        $this->_agreedToTerms = $value;
        return $this;
    }

    /**
     * Get the value for this element's suspended attribute.
     *
     * @see setSuspended
     * @return boolean The requested attribute.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function getSuspended()
    {
        if (!(is_bool($this->_suspended))) {
            throw new App\InvalidArgumentException('Expected boolean for suspended.');
        }
        return $this->_suspended;
    }

    /**
     * Set the value for this element's suspended attribute. If true, the
     * user will not be able to login to this domain until unsuspended.
     *
     * @param boolean $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function setSuspended($value)
    {
        if (!(is_bool($value))) {
            throw new App\InvalidArgumentException('Expected boolean for $value.');
        }
        $this->_suspended = $value;
        return $this;
    }

    /**
     * Get the value for this element's changePasswordAtNextLogin attribute.
     *
     * @see setChangePasswordAtNextLogin
     * @return boolean The requested attribute.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function getChangePasswordAtNextLogin()
    {
        if (!(is_bool($this->_changePasswordAtNextLogin))) {
            throw new App\InvalidArgumentException('Expected boolean for changePasswordAtNextLogin.');
        }
        return $this->_changePasswordAtNextLogin;
    }

    /**
     * Set the value for this element's changePasswordAtNextLogin attribute.
     * If true, the user will be forced to set a new password the next
     * time they login.
     *
     * @param boolean $value The desired value for this attribute.
     * @return \Zend\GData\GApps\Extension\Login Provides a fluent interface.
     * @throws \Zend\GData\App\InvalidArgumentException
     */
    public function setChangePasswordAtNextLogin($value)
    {
        if (!(is_bool($value))) {
            throw new App\InvalidArgumentException('Expected boolean for $value.');
        }
        $this->_changePasswordAtNextLogin = $value;
        return $this;
    }

    /**
     * Magic toString method allows using this directly via echo
     * Works best in PHP >= 4.2.0
     */
    public function __toString()
    {
        return "Username: " . $this->getUsername() .
            "\nPassword: " . (($this->getPassword() === null) ? "NOT SET" : "SET") .
            "\nPassword Hash Function: " . $this->getHashFunctionName() .
            "\nAdministrator: " . ($this->getAdmin() ? "Yes" : "No") .
            "\nAgreed To Terms: " . ($this->getAgreedToTerms() ? "Yes" : "No") .
            "\nSuspended: " . ($this->getSuspended() ? "Yes" : "No");
    }
}


text:
.phpdebugbar .phpdebugbar-widgets-config {
    font-family: monospace;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-container {
    padding: 8px 8px 8px 16px;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-container:hover {
    background-color: #fafafa;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-container:first-child {
    margin-top: 8px;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-classname {
    text-decoration: underline;
}

.phpdebugbar-widgets-config .phpdebugbar-widgets-value {
    background-color: #fff;
    border: 1px solid #ddd;
    margin-top: 8px;
    padding: 7px;
}

.phpdebugbar-widgets-config .phpdebugbar-badge {
    margin-left: 5px;
    font-size: 11px;
    line-height: 14px;
    padding: 1px 7px;
    background: #005A92;
    border-radius: 4px;
    color: #fff;
    float: right;
}

redpajama_set_name: RedPajamaGithub


text:
import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics';
import {
  addModuleImportToRootModule,
  getAppModulePath,
  getProjectFromWorkspace,
  getProjectMainFile,
  getProjectStyleFile,
  hasNgModuleImport,
} from '@angular/cdk/schematics';
import {getWorkspace} from '@schematics/angular/utility/config';
import {addFontsToIndex} from './fonts/material-fonts';
import {Schema} from './schema';
import {addThemeToAppStyles, addTypographyClass} from './theming/theming';

/** Name of the Angular module that enables Angular browser animations. */
const browserAnimationsModuleName = 'BrowserAnimationsModule';

/** Name of the module that switches Angular animations to a noop implementation. */
const noopAnimationsModuleName = 'NoopAnimationsModule';

/**
 * Scaffolds the basics of a Angular Material application, this includes:
 *  - Add Packages to package.json
 *  - Adds pre-built themes to styles.ext
 *  - Adds Browser Animation to app.module
 */
export default function(options: Schema): Rule {
  return (host: Tree, context: SchematicContext) => {
    const workspace = getWorkspace(host);
    const project = getProjectFromWorkspace(workspace, options.project);

    if (project.projectType === 'application') {
      return chain([
        addAnimationsModule(options),
        addThemeToAppStyles(options),
        addFontsToIndex(options),
        addMaterialAppStyles(options),
        addTypographyClass(options),
      ]);
    }
    context.logger.warn(
        'Angular Material has been set up in your workspace. There is no additional setup ' +
        'required for consuming Angular Material in your library project.\n\n' +
        'If you intended to run the schematic on a different project, pass the `--project` ' +
        'option.');
    return host;
  };
}

/**
 * Adds an animation module to the root module of the specified project. In case the "animations"
 * option is set to false, we still add the `NoopAnimationsModule` because otherwise various
 * components of Angular Material will throw an exception.
 */
function addAnimationsModule(options: Schema) {
  return (host: Tree, context: SchematicContext) => {
    const workspace = getWorkspace(host);
    const project = getProjectFromWorkspace(workspace, options.project);
    const appModulePath = getAppModulePath(host, getProjectMainFile(project));

    if (options.animations) {
      // In case the project explicitly uses the NoopAnimationsModule, we should print a warning
      // message that makes the user aware of the fact that we won't automatically set up
      // animations. If we would add the BrowserAnimationsModule while the NoopAnimationsModule
      // is already configured, we would cause unexpected behavior and runtime exceptions.
      if (hasNgModuleImport(host, appModulePath, noopAnimationsModuleName)) {
        context.logger.error(
            `Could not set up "${browserAnimationsModuleName}" ` +
            `because "${noopAnimationsModuleName}" is already imported.`);
        context.logger.info(`Please manually set up browser animations.`);
        return;
      }

      addModuleImportToRootModule(host, browserAnimationsModuleName,
          '@angular/platform-browser/animations', project);
    } else if (!hasNgModuleImport(host, appModulePath, browserAnimationsModuleName)) {
      // Do not add the NoopAnimationsModule module if the project already explicitly uses
      // the BrowserAnimationsModule.
      addModuleImportToRootModule(host, noopAnimationsModuleName,
        '@angular/platform-browser/animations', project);
    }

    return host;
  };
}

/**
 * Adds custom Material styles to the project style file. The custom CSS sets up the Roboto font
 * and reset the default browser body margin.
 */
function addMaterialAppStyles(options: Schema) {
  return (host: Tree, context: SchematicContext) => {
    const workspace = getWorkspace(host);
    const project = getProjectFromWorkspace(workspace, options.project);
    const styleFilePath = getProjectStyleFile(project);
    const logger = context.logger;

    if (!styleFilePath) {
      logger.error(`Could not find the default style file for this project.`);
      logger.info(`Please consider manually setting up the Roboto font in your CSS.`);
      return;
    }

    const buffer = host.read(styleFilePath);

    if (!buffer) {
      logger.error(`Could not read the default style file within the project ` +
        `(${styleFilePath})`);
      logger.info(`Please consider manually setting up the Robot font.`);
      return;
    }

    const htmlContent = buffer.toString();
    const insertion = '\n' +
      `html, body { height: 100%; }\n` +
      `body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }\n`;

    if (htmlContent.includes(insertion)) {
      return;
    }

    const recorder = host.beginUpdate(styleFilePath);

    recorder.insertLeft(htmlContent.length, insertion);
    host.commitUpdate(recorder);
  };
}


text:
package example.service;

import example.repo.Customer105Repository;

import org.springframework.stereotype.Service;

@Service
public class Customer105Service {
	public Customer105Service(Customer105Repository repo) {}
}


text:
<!--
  Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
  <title>Indexed Database Property Test</title>

  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>

  <script type="text/javascript;version=1.7">
    function testSteps()
    {
      const name = window.location.pathname;

      // Needs to be enough to saturate the thread pool.
      const SYNC_REQUEST_COUNT = 25;

      let request = indexedDB.open(name, 1);
      request.onerror = errorHandler;
      request.onupgradeneeded = grabEventAndContinueHandler;
      request.onsuccess = grabEventAndContinueHandler;
      let event = yield;

      let db = event.target.result;
      db.onerror = errorHandler;

      is(event.target.transaction.mode, "versionchange", "Correct mode");

      let objectStore = db.createObjectStore("foo", { autoIncrement: true });

      request = objectStore.add({});
      request.onerror = errorHandler;
      request.onsuccess = grabEventAndContinueHandler;
      event = yield;

      let key = event.target.result;
      ok(key, "Got a key");

      yield;

      let continueReading = true;
      let readerCount = 0;
      let writerCount = 0;
      let callbackCount = 0;

      // Generate a bunch of reads right away without returning to the event
      // loop.
      info("Generating " + SYNC_REQUEST_COUNT + " readonly requests");

      for (let i = 0; i < SYNC_REQUEST_COUNT; i++) {
        readerCount++;
        let request = db.transaction("foo").objectStore("foo").get(key);
        request.onsuccess = function(event) {
          is(event.target.transaction.mode, "readonly", "Correct mode");
          callbackCount++;
        };
      }

      while (continueReading) {
        readerCount++;
        info("Generating additional readonly request (" + readerCount + ")");
        let request = db.transaction("foo").objectStore("foo").get(key);
        request.onsuccess = function(event) {
          callbackCount++;
          info("Received readonly request callback (" + callbackCount + ")");
          is(event.target.transaction.mode, "readonly", "Correct mode");
          if (callbackCount == SYNC_REQUEST_COUNT) {
            writerCount++;
            info("Generating 1 readwrite request with " + readerCount +
                 " previous readonly requests");
            let request = db.transaction("foo", "readwrite")
                            .objectStore("foo")
                            .add({}, readerCount);
            request.onsuccess = function(event) {
              callbackCount++;
              info("Received readwrite request callback (" + callbackCount + ")");
              is(event.target.transaction.mode, "readwrite", "Correct mode");
              is(event.target.result, callbackCount,
                 "write callback came before later reads");
            }
          }
          else if (callbackCount == SYNC_REQUEST_COUNT + 5) {
            continueReading = false;
          }
        };

        setTimeout(function() { testGenerator.next(); }, writerCount ? 1000 : 100);
        yield;
      }

      while (callbackCount < (readerCount + writerCount)) {
        executeSoon(function() { testGenerator.next(); });
        yield;
      }

      is(callbackCount, readerCount + writerCount, "All requests accounted for");

      finishTest();
      yield;
    }
  </script>
  <script type="text/javascript;version=1.7" src="helpers.js"></script>

</head>

<body onload="runTest();"></body>

</html>


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>narrange-console</name>
    </assembly>
    <members>
        <member name="T:NArrange.ConsoleApplication.CommandArguments">
            <summary>
            Command arguments class for the NArrange console application.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.UnixSwitch">
            <summary>
            Unix flag/switch prefix character.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.WindowsSwitch">
            <summary>
            Windows flag/switch prefix character.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._backup">
            <summary>
            Perform backup.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._configuration">
            <summary>
            Configuration file.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._input">
            <summary>
            Input file or directory.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._output">
            <summary>
            Output file or directory.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._restore">
            <summary>
            Perform restore.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments._trace">
            <summary>
            Trace logging.
            </summary>
        </member>
        <member name="M:NArrange.ConsoleApplication.CommandArguments.#ctor">
            <summary>
            Do not allow creation.
            </summary>
        </member>
        <member name="M:NArrange.ConsoleApplication.CommandArguments.Parse(System.String[])">
            <summary>
            Parses command arguments from an array of strings.
            </summary>
            <param name="args">String array arguments</param>
            <returns>A CommandArguments instance</returns>'=
            <exception cref="T:System.ArgumentException"/>
        </member>
        <member name="M:NArrange.ConsoleApplication.CommandArguments.OnParseError(System.String)">
            <summary>
            Called when a parsing error occurs.
            </summary>
            <param name="invalidFlag">Invalid flag text.</param>
        </member>
        <member name="M:NArrange.ConsoleApplication.CommandArguments.OnParseError">
            <summary>
            Called when a parsing error occurs.
            </summary>
        </member>
        <member name="M:NArrange.ConsoleApplication.CommandArguments.ParseFlag(System.String)">
            <summary>
            Parses a command argument flag from a text string.
            </summary>
            <param name="flagString">Command argument flag text.</param>
            <returns>Command argument flag.</returns>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Backup">
            <summary>
            Gets a value indicating whether or not a backup should be performed.
            </summary>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Configuration">
            <summary>
            Gets the configuration file.
            </summary>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Input">
            <summary>
            Gets the input file.
            </summary>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Output">
            <summary>
            Gets the output file.
            </summary>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Restore">
            <summary>
            Gets a value indicating whether or not a restore should be performed.
            </summary>
        </member>
        <member name="P:NArrange.ConsoleApplication.CommandArguments.Trace">
            <summary>
            Gets a value indicating whether or not tracing should be performed.
            </summary>
        </member>
        <member name="T:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag">
            <summary>
            Enumeration that defines the valid command argument flags
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag.Unknown">
            <summary>
            Unknown command argument.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag.Configuration">
            <summary>
            Configuration file.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag.Backup">
            <summary>
            Perform backup.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag.Restore">
            <summary>
            Perform restore.
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.CommandArguments.CommandArgumentFlag.Trace">
            <summary>
            Trace logging.
            </summary>
        </member>
        <member name="T:NArrange.ConsoleApplication.Program">
            <summary>
            NArrange console application
            </summary>
        </member>
        <member name="F:NArrange.ConsoleApplication.Program.Fail">
            <summary>
            Execution error code.
            </summary>
        </member>
        <member name="M:NArrange.ConsoleApplication.Program.GetCopyrightText">
            <summary>
            Gets the copyright text.
            </summary>
            <returns>Application copyright text.</returns>
        </member>
        <member name="M:NArrange.ConsoleApplication.Program.GetUsageText">
            <summary>
            Gets usage information text.
            </summary>
            <returns>Application usage text.</returns>
        </member>
        <member name="M:NArrange.ConsoleApplication.Program.Main(System.String[])">
            <summary>
            Application entry point.
            </summary>
            <param name="args">Command argument strings.</param>
        </member>
        <member name="M:NArrange.ConsoleApplication.Program.Run(NArrange.Core.ILogger,NArrange.ConsoleApplication.CommandArguments)">
            <summary>
            Runs NArrange using the specified arguments.
            </summary>
            <param name="logger">Logger for messages.</param>
            <param name="commandArgs">Command arguments.</param>
            <returns>True if succesful, otherwise false.</returns>
        </member>
        <member name="M:NArrange.ConsoleApplication.Program.WriteUsage">
            <summary>
            Writes usage information to the console.
            </summary>
        </member>
    </members>
</doc>


text:
status: publish
layout: page
tags:
  - dem
  - lidar
  - elevation
author:
  display_name: Rick Kelson
  email: rkelson@utah.gov
published: true
date: 2019-04-22 15:30:30
title: 2016 Kanab Utah LiDAR Elevation Data
categories: []
---

![Sample]({% link images/lidar_kanab_2016.png %}){: .flex .flex--center .outline }

[![Project area map]({% link images/lidar_kanab_2016_coverage_sm.png %} "click for map")]({% link images/lidar_kanab_2016_coverage.png %}){:.inline-text-right}

{%- capture contact -%}
{%- include contact.html subject=page.title contact=site.data.contacts.elevation text='or by request from' -%}
{%- endcapture -%}
In 2016 the Natural Resource Conservation Service (NRCS) acquired LiDAR around Fredonia, AZ that covers [~150 square miles]({% link images/lidar_kanab_2016_coverage.png %}) of Utah with 8 points per meter Quality Level 1 LiDAR and includes Kanab, UT. The .5 meter resolution bare earth DEMs and first-return/highest-hit DSMs in .img format have a 10.0cm vertical RMSE accuracy and are available for download. The LAS point clouds, classified to ground, low, medium, and high vegetation, are available from [The National Map](https://apps.nationalmap.gov/downloader) {{ contact }} This elevation data was collected between October and December, 2016 and has a UTM NAD83 (2011) zone 12 north meters NAVD88(GEOID12) projection.

      {% include fa_icon.html download=true class="svg-inline--fa fa-w-16" %} Retrieve 2016 Bare Earth DEMs and First Return DSMs via Interactive Map

    {% include fa_icon.html download=true class="svg-inline--fa fa-w-16" %} Download project Reports and Metadata

    {% include fa_icon.html download=true class="svg-inline--fa fa-w-16" %} Download shapefiles of project area, tile indices, and breaklines

The naming convention for the tiles are based off the [U.S. National Grid (USNG)](https://www.fgdc.gov/usng/how-to-read-usng/index_html).

This elevation data has a UTM NAD83 (2011) zone 12 north meters NAVD88(GEOID12) projection.

{% include contact.html subject=page.title contact=site.data.contacts.elevation %}


text:
local is_array = require "dromozoa.json.is_array"
local utf8 = require "dromozoa.utf8"

local concat = table.concat
local format = string.format

local function encoder()
  local self = {
    _buffer = {};
  }

  function self:write(value)
    local buffer = self._buffer
    buffer[#buffer + 1] = value
  end

  function self:encode_string(value)
    local buffer = self._buffer
    buffer[#buffer + 1] = [["]]
    for p, c in utf8.codes(tostring(value)) do
      if c == 0x22 then
        buffer[#buffer + 1] = [[\"]]
      elseif c == 0x5C then
        buffer[#buffer + 1] = [[\\]]
      elseif c == 0x2F then
        buffer[#buffer + 1] = [[\/]]
      elseif c == 0x08 then
        buffer[#buffer + 1] = [[\b]]
      elseif c == 0x0C then
        buffer[#buffer + 1] = [[\f]]
      elseif c == 0x0A then
        buffer[#buffer + 1] = [[\n]]
      elseif c == 0x0D then
        buffer[#buffer + 1] = [[\r]]
      elseif c == 0x09 then
        buffer[#buffer + 1] = [[\t]]
      elseif c < 0x20 then
        buffer[#buffer + 1] = format([[\u%04X]], c)
      else
        buffer[#buffer + 1] = utf8.char(c)
      end
    end
    buffer[#buffer + 1] = [["]]
  end

  function self:encode_value(value, depth)
    if depth > 16 then
      error "too much recursion"
    end

    local t = type(value)
    if t == "number" then
      self:write(format("%.17g", value))
    elseif t == "string" then
      self:encode_string(value)
    elseif t == "boolean" then
      if value then
        self:write("true")
      else
        self:write("false")
      end
    elseif t == "table" then
      local size = is_array(value)
      if size == nil then
        self:write("{")
        local k, v = next(value)
        self:encode_string(k)
        self:write(":")
        self:encode_value(v, depth + 1)
        for k, v in next, value, k do
          self:write(",")
          self:encode_string(k)
          self:write(":")
          self:encode_value(v, depth + 1)
        end
        self:write("}")
      elseif size == 0 then
        self:write("[]")
      else
        self:write("[")
        self:encode_value(value[1], depth + 1)
        for i = 2, size do
          self:write(",")
          self:encode_value(value[i], depth + 1)
        end
        self:write("]")
      end
    else
      self:write("null")
    end
  end

  function self:encode(value)
    self:encode_value(value, 0)
    return concat(self._buffer)
  end

  return self
end

local function stack()
  local self = {
    _data = {};
    _size = 0;
  }

  function self:push(value)
    self._size = self._size + 1
    self._data[self._size] = value
  end

  function self:pop()
    assert(self._size > 0)
    local value = self._data[self._size]
    self._size = self._size - 1
    return value
  end

  function self:top()
    assert(self._size > 0)
    return self._data[self._size]
  end

  function self:size()
    return self._size
  end

  return self
end

local function decoder(s)
  local self = {
    _s = s;
    _i = 1;
    _stack = stack();
  }

  function self:scan(pattern)
    local i, j, a, b = self._s:find("^" .. pattern, self._i)
    if j == nil then
      return false
    else
      self._i = j + 1
      self._1 = a
      self._2 = b
      return true
    end
  end

  function self:scan_whitespace()
    return self:scan("[ \t\n\r]+")
  end

  function self:die()
    error("decode error at position " .. self._i)
  end

  function self:decode()
    self:decode_value()
    self:scan_whitespace()
    if self._stack:size() == 1 and self._i == #self._s + 1 then
      return self._stack:top()
    else
      self:die()
    end
  end

  function self:decode_value()
    self:scan_whitespace()
    if self:decode_literal()
    or self:decode_object()
    or self:decode_array()
    or self:decode_number()
    or self:decode_string() then
      return true
    else
      return false
    end
  end

  function self:decode_literal()
    if self:scan("true") then
      self._stack:push(true)
      return true
    elseif self:scan("false") then
      self._stack:push(false)
      return true
    elseif self:scan("null") then
      self._stack:push(nil)
      return true
    else
      return false
    end
  end

  function self:decode_object()
    if self:scan("{") then
      self._stack:push({})
      self:scan_whitespace()
      if self:scan("}") then
        return true
      end
      while self._i < #self._s do
        self:scan_whitespace()
        if not self:decode_string() then
          self:die()
        end
        self:scan_whitespace()
        if not self:scan(":") then
          self:die()
        end
        self:scan_whitespace()
        if not self:decode_value() then
          self:die()
        end
        self:scan_whitespace()
        if not self:scan("([,}])") then
          self:die()
        end
        local v = self._stack:pop()
        local n = self._stack:pop()
        self._stack:top()[n] = v
        if self._1 == "}" then
          return true
        end
      end
      self:die()
    else
      return false
    end
  end

  function self:decode_array()
    if self:scan("%[") then
      self._stack:push({})
      self:scan_whitespace()
      if self:scan("%]") then
        return true
      end
      local i = 1
      while self._i <= #self._s do
        self:scan_whitespace()
        if not self:decode_value() then
          self:die()
        end
        self:scan_whitespace()
        if not self:scan("([,%]])") then
          self:die()
        end
        local v = self._stack:pop()
        self._stack:top()[i] = v
        i = i + 1
        if self._1 == "]" then
          return true
        end
      end
      self:die()
    else
      return false
    end
  end

  function self:decode_number()
    local i = self._i
    if self:scan("%-?0") or self:scan("%-?[1-9]%d*") then
      self:scan("%.%d*")
      self:scan("[eE][%+%-]?%d+")
      self._stack:push(tonumber(self._s:sub(i, self._i - 1)))
      return true
    else
      return false
    end
  end

  function self:decode_string()
    if self:scan([["]]) then
      local buffer = {}
      while self._i <= #self._s do
        if self:scan([[([^"\]+)]]) then
          buffer[#buffer + 1] = self._1
        end
        if self:scan([["]]) then
          self._stack:push(concat(buffer))
          return true
        elseif self:scan([[\(["\/])]]) then
          buffer[#buffer + 1] = self._1
        elseif self:scan([[\b]]) then
          buffer[#buffer + 1] = "\b"
        elseif self:scan([[\f]]) then
          buffer[#buffer + 1] = "\f"
        elseif self:scan([[\n]]) then
          buffer[#buffer + 1] = "\n"
        elseif self:scan([[\r]]) then
          buffer[#buffer + 1] = "\r"
        elseif self:scan([[\t]]) then
          buffer[#buffer + 1] = "\t"
        elseif self:scan([[\u([Dd][89ABab]%x%x)\u([Dd][C-Fc-f]%x%x)]]) then
          local a = tonumber(self._1, 16) % 0x0400 * 0x0400
          local b = tonumber(self._2, 16) % 0x0400
          buffer[#buffer + 1] = utf8.char(a + b + 0x010000)
        elseif self:scan([[\u(%x%x%x%x)]]) then
          buffer[#buffer + 1] = utf8.char(tonumber(self._1, 16))
        else
          self:die()
        end
      end
      return true
    else
      return false
    end
  end

  return self
end

local function encode(value)
  return encoder():encode(value)
end

local function decode(s)
  return decoder(s):decode()
end

return {
  decode = decode;
  encode = encode;
}


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

  <parent>
    <groupId>com.hubspot.nebula</groupId>
    <artifactId>Nebula</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>NebulaService</artifactId>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
    <repository>
      <id>repo.codahale.com</id>
      <url>http://repo.codahale.com/</url>
    </repository>
  </repositories>

  <dependencies>

    <dependency>
      <groupId>com.hubspot.nebula</groupId>
      <artifactId>NebulaData</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>

    <dependency>
      <groupId>com.hubspot.dropwizard</groupId>
      <artifactId>dropwizard-guice</artifactId>
      <version>0.7.0.2</version>
    </dependency>

      <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.29</version>
      </dependency>

    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-migrations</artifactId>
      <version>${dropwizard.version}</version>
    </dependency>

    <dependency>
      <groupId>com.hubspot.jackson</groupId>
      <artifactId>jackson-jaxrs-propertyfiltering</artifactId>
      <version>0.5.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>${java.abi}</source>
          <target>${java.abi}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <outputDirectory />
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${java.abi}</version>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>com.hubspot.nebula.NebulaService</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- You'll probably want to remove this for your project. I'm just
          using it here so that dropwizard-example doesn't get deployed as a library. -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <skip>true</skip>
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
package com.opengamma.core.historicaltimeseries.impl;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertNull;

import java.util.Random;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
import org.threeten.bp.LocalDate;

import com.opengamma.core.historicaltimeseries.HistoricalTimeSeries;
import com.opengamma.id.UniqueId;
import com.opengamma.timeseries.date.localdate.ImmutableLocalDateDoubleTimeSeries;
import com.opengamma.timeseries.date.localdate.LocalDateDoubleEntryIterator;
import com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeriesBuilder;
import com.opengamma.util.monitor.OperationTimer;
import com.opengamma.util.test.AbstractRedisTestCase;
import com.opengamma.util.test.TestGroup;

/**
 * Test.
 */
@Test(groups = TestGroup.INTEGRATION, enabled = false)
public class RedisSimulationSeriesSourceTest extends AbstractRedisTestCase {
  private static final Logger LOGGER = LoggerFactory.getLogger(RedisSimulationSeriesSourceTest.class);

  /**
   *
   */
  public void basicOperation() {
    final LocalDate simulationSeriesDate = LocalDate.of(2013, 4, 24);
    final RedisSimulationSeriesSource simulationSource = new RedisSimulationSeriesSource(getJedisPool(), getRedisPrefix());
    simulationSource.setCurrentSimulationExecutionDate(simulationSeriesDate);
    final UniqueId id = generateId(5);
    HistoricalTimeSeries hts = null;

    hts = simulationSource.getHistoricalTimeSeries(id, null, false, null, false);
    assertNull(hts);

    final LocalDateDoubleTimeSeriesBuilder timeSeriesBuilder = ImmutableLocalDateDoubleTimeSeries.builder();
    for (int i = 1; i < 30; i++) {
      timeSeriesBuilder.put(LocalDate.of(2013, 4, i), i);
    }
    simulationSource.updateTimeSeries(id, simulationSeriesDate, timeSeriesBuilder.build());

    hts = simulationSource.getHistoricalTimeSeries(id, null, false, null, false);
    assertNotNull(hts);
    assertEquals(id, hts.getUniqueId());
    assertEquals(29, hts.getTimeSeries().size());
    final LocalDateDoubleEntryIterator iterator = hts.getTimeSeries().iterator();
    int i = 1;
    while (iterator.hasNext()) {
      iterator.next();
      assertEquals(LocalDate.of(2013, 4, i), iterator.currentTime());
      assertEquals(i, iterator.currentValueFast(), 0.001);
      i++;
    }

    hts = simulationSource.getHistoricalTimeSeries(generateId(6), null, false, null, false);
    assertNull(hts);

    simulationSource.setCurrentSimulationExecutionDate(LocalDate.of(2013, 4, 25));
    hts = simulationSource.getHistoricalTimeSeries(id, null, false, null, false);
    assertNull(hts);

  }

  private static UniqueId generateId(final int x) {
    return UniqueId.of("TEST", Integer.toString(x));
  }

  /**
   *
   */
  public void clearSpecificDate() {
    final RedisSimulationSeriesSource simulationSource = new RedisSimulationSeriesSource(getJedisPool(), getRedisPrefix());
    LocalDate simulationSeriesDate = LocalDate.now();
    HistoricalTimeSeries hts = null;

    final int numDaysHistory = 5;
    for (int i = 0; i < numDaysHistory; i++) {
      writeOneSimulationSeriesDate(simulationSource, simulationSeriesDate, 5);
      simulationSeriesDate = simulationSeriesDate.minusDays(1);
    }

    simulationSeriesDate = simulationSeriesDate.plusDays(1);
    simulationSource.setCurrentSimulationExecutionDate(simulationSeriesDate);
    hts = simulationSource.getHistoricalTimeSeries(generateId(3), null, false, null, false);
    assertNotNull(hts);

    simulationSource.clearExecutionDate(simulationSeriesDate);
    hts = simulationSource.getHistoricalTimeSeries(generateId(3), null, false, null, false);
    assertNull(hts);

    simulationSource.setCurrentSimulationExecutionDate(simulationSeriesDate.plusDays(1));
    hts = simulationSource.getHistoricalTimeSeries(generateId(3), null, false, null, false);
    assertNotNull(hts);
  }

  /**
   *
   */
  @Test(enabled = false)
  public void largePerformanceTest() {
    final RedisSimulationSeriesSource simulationSource = new RedisSimulationSeriesSource(getJedisPool());
    LocalDate simulationSeriesDate = LocalDate.now();

    final int numDaysHistory = 20;
    for (int i = 0; i < numDaysHistory; i++) {
      // 20 points, 10 curves
      writeOneSimulationSeriesDate(simulationSource, simulationSeriesDate, 20 * 10);
      simulationSeriesDate = simulationSeriesDate.minusDays(1);
    }

    final OperationTimer timer = new OperationTimer(LOGGER, "Loading TS");
    final Random random = new Random();
    for (int i = 0; i < 1000; i++) {
      final LocalDate seriesDate = simulationSeriesDate.minusDays(random.nextInt(numDaysHistory));
      final UniqueId id = generateId(random.nextInt(1260));
      simulationSource.setCurrentSimulationExecutionDate(seriesDate);
      simulationSource.getHistoricalTimeSeries(id, null, false, null, false);
    }
    System.out.println("Loading 1000 TS took " + timer.finished());
  }

  private static void writeOneSimulationSeriesDate(final RedisSimulationSeriesSource simulationSource, final LocalDate simulationSeriesDate,
      final int nSeries) {
    final OperationTimer timer = new OperationTimer(LOGGER, "Storing many time series");

    // 20 points, 10 curves
    for (int i = 0; i < nSeries; i++) {
      performanceWriteOneSeries(simulationSource, generateId(i), simulationSeriesDate);
    }

    System.out.println("Writing " + nSeries + " series took " + timer.finished());
  }

  private static void performanceWriteOneSeries(final RedisSimulationSeriesSource source, final UniqueId id, final LocalDate simulationSeriesDate) {
    LocalDate valueDate = LocalDate.now();
    final LocalDateDoubleTimeSeriesBuilder seriesBuilder = ImmutableLocalDateDoubleTimeSeries.builder();
    for (int i = 1; i <= 1260; i++) {
      seriesBuilder.put(valueDate, i);
      valueDate = valueDate.minusDays(1);
    }
    source.updateTimeSeries(id, simulationSeriesDate, seriesBuilder.build());
  }

}


text:
/*
 * Flip API
 *
 * Description
 *
 * API version: 2.0.1
 * Contact: cloudsupport@telestream.net
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package flip

type CreateVideoBody struct {

	// An URL pointing to a source file.
	SourceUrl string `json:"source_url,omitempty"`

	// Comma-separated list of profile names or IDs to be used during encoding. Alternatively, specify none so no encodings are created yet.
	Profiles string `json:"profiles,omitempty"`

	// Arbitrary string stored along the Video object.
	Payload string `json:"payload,omitempty"`

	// String-encoded JSON describing profiles pipeline.
	Pipeline string `json:"pipeline,omitempty"`

	// A list of urls pointing to remote subtitle files.
	SubtitleFiles []string `json:"subtitle_files,omitempty"`

	ExtraFiles map[string][]string `json:"extra_files,omitempty"`

	ExtraVariables map[string]string `json:"extra_variables,omitempty"`

	PathFormat string `json:"path_format,omitempty"`

	// Clip ends at a specific time (timecode).
	ClipEnd string `json:"clip_end,omitempty"`

	// A clip's duration.
	ClipLength string `json:"clip_length,omitempty"`

	// Clip starts at a specific offset.
	ClipOffset string `json:"clip_offset,omitempty"`

	StartingTimecode string `json:"starting_timecode,omitempty"`

	// An individual store_id for this video processing. If provided will replace store_id from cloud factory but must match underlying cloud provider and region.
	StoreId string `json:"store_id,omitempty"`
}


text:
from tornado.web import authenticated
from tornado.escape import json_encode
import logging
from collections import defaultdict

from amgut.connections import ag_data
from amgut.lib.mail import send_email
from amgut.handlers.base_handlers import BaseHandler
from amgut import media_locale, text_locale

# login code modified from https://gist.github.com/guillaumevincent/4771570
class AuthBasehandler(BaseHandler):
    def set_current_user(self, user=None):
        if user is not None:
            self.set_secure_cookie("skid", json_encode(user))
        else:
            self.clear_cookie("skid")

class AuthRegisterHandoutHandler(AuthBasehandler):
    """User Creation"""

    def get(self):
        kit_counts = ag_data.getMapMarkers()
        countries = ag_data.get_countries()

        # defaults entries dict to be empty
        entries = defaultdict(str)
        self.render("register_user.html", kit_counts=kit_counts,
                    loginerror='', countries=countries, entries=entries)

    def post(self):
        # Check handout
        skid = self.get_argument("kit_id").strip()
        password = self.get_argument("password")

        is_handout = ag_data.handoutCheck(skid, password)
        if not is_handout:
            kit_counts = ag_data.getMapMarkers()
            countries = ag_data.get_countries()
            entries = {'kit_id': self.get_argument('kit_id'),
                       'email': self.get_argument('email'),
                       'email2': self.get_argument('email2'),
                       'participantname': self.get_argument('participantname'),
                       'address': self.get_argument('address'),
                       'city': self.get_argument('city'),
                       'state': self.get_argument('state'),
                       'zip': self.get_argument('zip'),
                       'country': self.get_argument('country')}
            self.render("register_user.html", kit_counts=kit_counts,
                        loginerror='', countries=countries, entries=entries)
            return

        # Register handout
        tl = text_locale['handlers']
        info = {
            "email": self.get_argument("email"),
            "participantname": self.get_argument("participantname")
        }
        for info_column in ("address", "city", "state", "zip", "country"):
            # Make sure that all fields were entered
            info[info_column] = self.get_argument(info_column, None)

        # create the user if needed
        ag_login_id = ag_data.addAGLogin(
            info['email'], info['participantname'], info['address'],
            info['city'], info['state'], info['zip'], info['country'])
        # Create the kit and add the kit to the user
        success = ag_data.registerHandoutKit(ag_login_id, skid)
        if not success:
            self.redirect(media_locale['SITEBASE'] + '/db_error/?err=regkit')
            return

        # log user in since registered successfully
        self.set_current_user(skid)
        self.redirect(media_locale['SITEBASE'] + "/authed/portal/")

        kitinfo = ag_data.getAGKitDetails(skid)

        # Email the verification code
        # send email after redirect since it takes so long
        subject = tl['AUTH_SUBJECT']
        addendum = ''
        if skid.startswith('PGP_'):
            addendum = tl['AUTH_REGISTER_PGP']

        body = tl['AUTH_REGISTER_BODY'].format(
            kitinfo['kit_verification_code'], addendum)
        try:
            send_email(body, subject, recipient=info['email'],
                       sender=media_locale['HELP_EMAIL'])
        except BaseException:
            logging.exception('Error on skid %s:' % skid)

class AuthLoginHandler(AuthBasehandler):
    """user login, no page necessary"""

    def get(self, *args, **kwargs):
        self.redirect(media_locale['SITEBASE'] + "/")

    def post(self):
        skid = self.get_argument("skid", "").strip()
        password = self.get_argument("password", "")
        tl = text_locale['handlers']

        is_handout = ag_data.handoutCheck(skid, password)
        if is_handout:
            # have them register themselves
            self.redirect(media_locale['SITEBASE'] + '/?loginerror=' +
                          tl['REGISTER_KIT'])
            return

        login = ag_data.authenticateWebAppUser(skid, password)
        if login:
            # everything good so log in
            self.set_current_user(skid)
            default_redirect = media_locale['SITEBASE'] + '/authed/portal/'
            self.redirect(self.get_argument('next', default_redirect))
            return
        else:
            msg = tl['INVALID_KITID']
            kit_counts = ag_data.getMapMarkers()
            self.render("index.html", user=None, loginerror=msg,
                        kit_counts=kit_counts)
            return

class AuthLogoutHandler(AuthBasehandler):
    """Logout handler, no page necessary"""
    @authenticated
    def get(self):
        self.set_current_user()
        self.redirect(media_locale['SITEBASE'] + "/")


text:
import * as uuid from 'uuid';
import * as vscode from 'vscode';
import { TestRunner, TestRunType } from '../testRunner';
import {
  TestCaseInfo,
  TestExecutionInfo,
  TestFileInfo,
  TestInfoKind,
  TestType
} from '../types';
import { FORCE_LWC_TEST_DEBUG_LOG_NAME } from '../types/constants';
import { isLwcJestTest } from '../utils';

import { telemetryService } from '../../telemetry';
import { workspaceService } from '../workspace/workspaceService';

const debugSessionStartTimes = new Map<string, [number, number]>();

/**
 * Create a VS Code debug configuration for LWC Jest tests.
 * @param command LWC test runner executable
 * @param args CLI arguments
 * @param cwd current working directory
 */
export function getDebugConfiguration(
  command: string,
  args: string[],
  cwd: string
): vscode.DebugConfiguration {
  const sfdxDebugSessionId = uuid.v4();
  const debugConfiguration: vscode.DebugConfiguration = {
    sfdxDebugSessionId,
    type: 'node',
    request: 'launch',
    name: 'Debug LWC test(s)',
    cwd,
    runtimeExecutable: command,
    args,
    resolveSourceMapLocations: ['**', '!**/node_modules/**'],
    console: 'integratedTerminal',
    internalConsoleOptions: 'openOnSessionStart',
    port: 9229,
    disableOptimisticBPs: true
  };
  return debugConfiguration;
}

/**
 * Start a debug session with provided test execution information
 * @param testExecutionInfo test execution information
 */
export async function forceLwcTestDebug(testExecutionInfo: TestExecutionInfo) {
  const testRunner = new TestRunner(testExecutionInfo, TestRunType.DEBUG);
  const shellExecutionInfo = testRunner.getShellExecutionInfo();
  if (shellExecutionInfo) {
    const {
      command,
      args,
      workspaceFolder,
      testResultFsPath
    } = shellExecutionInfo;
    testRunner.startWatchingTestResults(testResultFsPath);
    const debugConfiguration = getDebugConfiguration(
      command,
      args,
      workspaceFolder.uri.fsPath
    );
    await vscode.debug.startDebugging(workspaceFolder, debugConfiguration);
  }
}

/**
 * Debug an individual test case
 * @param data a test explorer node or information provided by code lens
 */
export async function forceLwcTestCaseDebug(data: {
  testExecutionInfo: TestCaseInfo;
}) {
  const { testExecutionInfo } = data;
  await forceLwcTestDebug(testExecutionInfo);
}

/**
 * Debug a test file
 * @param data a test explorer node
 */
export async function forceLwcTestFileDebug(data: {
  testExecutionInfo: TestExecutionInfo;
}) {
  const { testExecutionInfo } = data;
  await forceLwcTestDebug(testExecutionInfo);
}

/**
 * Debug the test of currently focused editor
 */
export async function forceLwcTestDebugActiveTextEditorTest() {
  const { activeTextEditor } = vscode.window;
  if (activeTextEditor && isLwcJestTest(activeTextEditor.document)) {
    const testExecutionInfo: TestFileInfo = {
      kind: TestInfoKind.TEST_FILE,
      testType: TestType.LWC,
      testUri: activeTextEditor.document.uri
    };
    await forceLwcTestFileDebug({ testExecutionInfo });
  }
}

/**
 * Log the start time of debug session
 * @param session debug session
 */
export function handleDidStartDebugSession(session: vscode.DebugSession) {
  const { configuration } = session;
  const { sfdxDebugSessionId } = configuration;
  const startTime = process.hrtime();
  debugSessionStartTimes.set(sfdxDebugSessionId, startTime);
}

/**
 * Send telemetry event if applicable when debug session ends
 * @param session debug session
 */
export function handleDidTerminateDebugSession(session: vscode.DebugSession) {
  const { configuration } = session;
  const startTime = debugSessionStartTimes.get(
    configuration.sfdxDebugSessionId
  );
  if (Array.isArray(startTime)) {
    telemetryService.sendCommandEvent(
      FORCE_LWC_TEST_DEBUG_LOG_NAME,
      startTime,
      {
        workspaceType: workspaceService.getCurrentWorkspaceTypeForTelemetry()
      }
    );
  }
}


text:
title: Send
category: send
mailchimp: true
description: Upload a list and schedule your email.
order: 5
---


text:
SUFFIXES:

default: dist

include environment.mk

JAVA_SOURCES := $(shell find $(SRC_DIR) -name *.java)

JAVA_SOURCES_MANIFEST = $(BUILD_DIR)/java_sources.mf
OBJC_SOURCES_MANIFEST = $(BUILD_DIR)/objc_sources.mf

SOURCEPATH = $(SRC_DIR)
INCLUDE_DIRS = $(GEN_OBJC_DIR)

J2OBJCC := $(ARCH_BIN_DIR)/j2objcc -c $(INCLUDE_DIRS:%=-I%)

TRANSLATE_JAVA_FULL = $(JAVA_SOURCES)
TRANSLATE_JAVA_RELATIVE = $(JAVA_SOURCES:$(SRC_DIR)/%=%)
TRANSLATE_ARGS = -q --batch-translate-max=300 \
    -sourcepath $(SOURCEPATH) -encoding UTF-8 -J-Xmx2G
include $(J2OBJC_ROOT)/make/translate.mk

FAT_LIB_NAME = xalan
FAT_LIB_SOURCES_RELATIVE = $(TRANSLATE_SOURCES:$(GEN_OBJC_DIR)/%=%)
FAT_LIB_SOURCE_DIRS = $(GEN_OBJC_DIR)
FAT_LIB_COMPILE = $(J2OBJCC)
include $(J2OBJC_ROOT)/make/fat_lib.mk

PUBLIC_JAVA_SOURCES = \
    $(shell cd $(SRC_DIR) && find org -name *.java | xargs egrep -l "^(public|protected) ")

STATIC_FRAMEWORK_RESOURCE_FILES = \
	org/apache/xalan/res/XSLTInfo.properties \
	org/apache/xml/serializer/Encodings.properties \
	org/apache/xml/serializer/HTMLEntities.properties \
	org/apache/xml/serializer/output_html.properties \
	org/apache/xml/serializer/output_text.properties \
	org/apache/xml/serializer/output_unknown.properties \
	org/apache/xml/serializer/output_xml.properties \
	org/apache/xml/serializer/XMLEntities.properties

STATIC_FRAMEWORK_NAME = Xalan
STATIC_FRAMEWORK_PUBLIC_HEADERS = $(PUBLIC_JAVA_SOURCES:%.java=$(GEN_OBJC_DIR)/%.h)
include $(J2OBJC_ROOT)/make/static_framework.mk

fat_lib_dependencies: jre_emul_dist

JAR = $(BUILD_DIR)/j2objc_xalan.jar
DIST_JAR = $(DIST_JAR_DIR)/j2objc_xalan.jar

XALAN_LICENSE = NOTICE
XALAN_LICENSE_DIST = $(DIST_LICENSE_DIR)/apache_xalan_license.txt

dist: $(FAT_LIBS_DIST) $(DIST_JAR) $(XALAN_LICENSE_DIST)
	@tar cf - -C $(GEN_OBJC_DIR) $(TRANSLATE_HEADERS:$(GEN_OBJC_DIR)/%=%) \
	    | tar xfp - -C $(ARCH_INCLUDE_DIR)

test: $(FAT_LIBS)
	@$(MAKE) -f tests.mk test

clean:
	@rm -rf $(BUILD_DIR) $(FAT_LIBS_DIST) $(ARCH_INCLUDE_DIR)/com/google/common $(DIST_JAR)
	@rm -rf $(XALAN_LICENSE_DIST)
	@rm -rf $(STATIC_FRAMEWORK_DIR)

java: $(DIST_JAR)

$(JAR): $(JAVA_SOURCES) | $(BUILD_DIR) java_deps_dist annotations_dist
	@echo "building j2objc_xalan.jar"
	@stage_dir=`mktemp -d -t j2objc-xalan`; \
	$(JAVAC) -sourcepath $(SOURCEPATH) -encoding UTF-8 \
	    -d $$stage_dir -source 1.7 -target 1.7 -bootclasspath $(DIST_JAR_DIR)/jre_emul.jar $^; \
	jar cf $@ -C $$stage_dir .; \
	rm -rf $$stage_dir

$(DIST_JAR): $(JAR) | $(DIST_JAR_DIR)
	@install -m 0644 $< $@

$(XALAN_LICENSE_DIST): $(XALAN_LICENSE)
	@mkdir -p $(@D)
	@install -m 0644 $< $@

$(JAVA_SOURCES_MANIFEST): $(JAVA_SOURCES) | $(BUILD_DIR)
	@echo "Building $$(basename $@)"
	@if [ -e $@ ]; then rm $@; fi
	@files='$^' && for i in $$files; do echo $$i >> $@; done

java_sources_manifest: $(JAVA_SOURCES_MANIFEST)
	@:

$(OBJC_SOURCES_MANIFEST): $(TRANSLATE_JAVA_FULL) | $(BUILD_DIR)
	@echo "Building $$(basename $@)"
	@if [ -e $@ ]; then rm $@; fi
	@files='$(sort $(TRANSLATE_OBJC))' && for i in $$files; do \
	  echo $$i >> $@; \
	done

objc_sources_manifest: $(OBJC_SOURCES_MANIFEST)
	@:

find_cycles: $(JAVA_SOURCES_MANIFEST) | cycle_finder_dist jre_emul_java_manifest
	$(DIST_DIR)/cycle_finder -sourcepath $(SOURCEPATH) \
	  -w ../jre_emul/cycle_whitelist.txt -w cycle_whitelist \
	  -s ../jre_emul/$(BUILD_DIR_NAME)/java_sources.mf -s $(JAVA_SOURCES_MANIFEST)


text:
var program = require('commander');
var stream = require('stream');
var irc = require('irc');
var child_process = require('child_process');
var readline = require('readline');
var pkg = JSON.parse(require('fs').readFileSync("./package.json"));

program
  .version([pkg.name, pkg.version].join(' - '))
  .option('-i --irc-server <server>', 'Set the irc server to connect to')
  .option('-n --nick <nick>', 'Set the irc nick [ircpipe]', 'ircpipe')
  .option('-p --port <num>', 'Set the port [6667]', parseInt, 6667)
  .option('-c --channel <channel>', 'Set the channel to join [#ircpipe]', '#ircpipe')
  .option('-s --ssl', 'Use ssl')
  .parse(process.argv);

var client = new irc.Client(program.ircServer, program.nick, {
  userName: 'ircpipes',
  realName: 'ircpipes: github.com/euank/ircpipes',
  port: program.port,
  debug: false,
  showErrors: false,
  autoRejoin: true,
  autoConnect: false,
  channels: [],
  secure: program.ssl,
  selfSigned: true,
  floodProtection: false,
  floodProtectionDelay: 0,
  stripColors: true
});

client.connect(function(){
  client.join(program.channel, function(){
    var child = child_process.spawn(program.args[0],program.args.slice(1), {cwd: process.cwd(),env: process.env});
    child.on('close', function(code) {
        client.disconnect("Exited with code: " + code);
    });

    child.stdout.on('data', function(chunk) {
      client.say(program.channel, chunk);
    });
    child.stderr.on('data', function(chunk) {
      client.say(program.channel, chunk);
    });

    client.on('message', function(nick, to, text, message) {
      if(to.toLowerCase() !== program.channel.toLowerCase()) return;
      child.stdin.write(text);
    });
  });
});


text:
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1276898">


text:
using Lucene.Net.Search.Spell;
using Lucene.Net.Store;
using Lucene.Net.Support;
using Lucene.Net.Support.IO;
using Lucene.Net.Util;
using System;
using System.Collections.Generic;
using System.IO;

namespace Lucene.Net.Search.Suggest
{

    /// <summary>
    /// This wrapper buffers incoming elements and makes sure they are sorted based on given comparer.
    /// <para/>
    /// @lucene.experimental
    /// </summary>
    public class SortedTermFreqEnumeratorWrapper : ITermFreqEnumerator
    {
        private readonly ITermFreqEnumerator source;
        private FileInfo tempInput;
        private FileInfo tempSorted;
        private readonly OfflineSorter.ByteSequencesReader reader;
        private readonly IComparer<BytesRef> comparer;
        private bool done = false;

        private long weight;
        private readonly BytesRef scratch = new BytesRef();
        private BytesRef current;

        /// <summary>
        /// Creates a new sorted wrapper, using <see cref="BytesRef.UTF8SortedAsUnicodeComparer"/>
        /// for sorting.
        /// </summary>
        public SortedTermFreqEnumeratorWrapper(ITermFreqEnumerator source)
            : this(source, BytesRef.UTF8SortedAsUnicodeComparer)
        { }

        /// <summary>
        /// Creates a new sorted wrapper, sorting by BytesRef
        /// (ascending) then cost (ascending).
        /// </summary>
        public SortedTermFreqEnumeratorWrapper(ITermFreqEnumerator source, IComparer<BytesRef> comparer)
        {
            this.source = source;
            this.comparer = comparer;
            this.reader = Sort();
            this.tieBreakByCostComparer = Comparer<BytesRef>.Create((left, right) =>
            {
                BytesRef leftScratch = new BytesRef();
                BytesRef rightScratch = new BytesRef();

                ByteArrayDataInput input = new ByteArrayDataInput();
                // Make shallow copy in case decode changes the BytesRef:
                leftScratch.Bytes = left.Bytes;
                leftScratch.Offset = left.Offset;
                leftScratch.Length = left.Length;
                rightScratch.Bytes = right.Bytes;
                rightScratch.Offset = right.Offset;
                rightScratch.Length = right.Length;
                long leftCost = Decode(leftScratch, input);
                long rightCost = Decode(rightScratch, input);
                int cmp = comparer.Compare(leftScratch, rightScratch);
                if (cmp != 0)
                {
                    return cmp;
                }
                return leftCost.CompareTo(rightCost);
            });
        }

        public virtual IComparer<BytesRef> Comparer => comparer;

        public virtual BytesRef Current => current;

        public virtual bool MoveNext()
        {
            if (done) return false;
            bool success = false;
            try
            {
                var input = new ByteArrayDataInput();
                if (reader.Read(scratch))
                {
                    weight = Decode(scratch, input);
                    success = true;
                    current = scratch;
                    return true;
                }
                Close();
                success = done = true;
                current = null;
                return false;
            }
            finally
            {
                if (!success)
                {
                    done = true;
                    Close();
                }
            }
        }

        public virtual long Weight => weight;

        /// <summary>
        /// Sortes by BytesRef (ascending) then cost (ascending).
        /// </summary>
        private readonly IComparer<BytesRef> tieBreakByCostComparer;

        private OfflineSorter.ByteSequencesReader Sort()
        {
            string prefix = this.GetType().Name;
            DirectoryInfo directory = OfflineSorter.GetDefaultTempDir();
            tempInput = FileSupport.CreateTempFile(prefix, ".input", directory);
            tempSorted = FileSupport.CreateTempFile(prefix, ".sorted", directory);

            var writer = new OfflineSorter.ByteSequencesWriter(tempInput);
            bool success = false;
            try
            {
                byte[] buffer = Arrays.Empty<byte>();
                ByteArrayDataOutput output = new ByteArrayDataOutput(buffer);

                while (source.MoveNext())
                {
                    Encode(writer, output, buffer, source.Current, source.Weight);
                }
                writer.Dispose();
                (new OfflineSorter(tieBreakByCostComparer)).Sort(tempInput, tempSorted);
                OfflineSorter.ByteSequencesReader reader = new OfflineSorter.ByteSequencesReader(tempSorted);
                success = true;
                return reader;

            }
            finally
            {
                if (success)
                {
                    IOUtils.Dispose(writer);
                }
                else
                {
                    try
                    {
                        IOUtils.DisposeWhileHandlingException(writer);
                    }
                    finally
                    {
                        Close();
                    }
                }
            }
        }

        private void Close()
        {
            IOUtils.Dispose(reader);
            if (tempInput != null)
            {
                tempInput.Delete();
            }
            if (tempSorted != null)
            {
                tempSorted.Delete();
            }
        }

        /// <summary>
        /// encodes an entry (bytes+weight) to the provided writer
        /// </summary>
        protected internal virtual void Encode(OfflineSorter.ByteSequencesWriter writer,
            ByteArrayDataOutput output, byte[] buffer, BytesRef spare, long weight)
        {
            if (spare.Length + 8 >= buffer.Length)
            {
                buffer = ArrayUtil.Grow(buffer, spare.Length + 8);
            }
            output.Reset(buffer);
            output.WriteBytes(spare.Bytes, spare.Offset, spare.Length);
            output.WriteInt64(weight);
            writer.Write(buffer, 0, output.Position);
        }

        /// <summary>
        /// decodes the weight at the current position </summary>
        protected internal virtual long Decode(BytesRef scratch, ByteArrayDataInput tmpInput)
        {
            tmpInput.Reset(scratch.Bytes);
            tmpInput.SkipBytes(scratch.Length - 8); // suggestion
            scratch.Length -= 8; // long
            return tmpInput.ReadInt64();
        }
    }
}


text:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>

#include <glib.h>
#include <dbus/dbus.h>
#include <gdbus/gdbus.h>

#include "lib/uuid.h"
#include "src/adapter.h"
#include "src/device.h"
#include "src/profile.h"
#include "src/service.h"

#include "log.h"
#include "error.h"
#include "avctp.h"
#include "control.h"
#include "sdpd.h"
#include "glib-helper.h"
#include "dbus-common.h"

static GSList *devices = NULL;

struct control {
	struct btd_device *dev;
	struct avctp *session;
	struct btd_service *target;
	struct btd_service *remote;
	unsigned int avctp_id;
};

static void state_changed(struct btd_device *dev, avctp_state_t old_state,
				avctp_state_t new_state, void *user_data)
{
	struct control *control = user_data;
	DBusConnection *conn = btd_get_dbus_connection();
	const char *path = device_get_path(dev);

	switch (new_state) {
	case AVCTP_STATE_DISCONNECTED:
		control->session = NULL;

		g_dbus_emit_property_changed(conn, path,
					AUDIO_CONTROL_INTERFACE, "Connected");

		break;
	case AVCTP_STATE_CONNECTING:
		if (control->session)
			break;

		control->session = avctp_get(dev);

		break;
	case AVCTP_STATE_CONNECTED:
		g_dbus_emit_property_changed(conn, path,
					AUDIO_CONTROL_INTERFACE, "Connected");
		break;
	default:
		return;
	}
}

int control_connect(struct btd_service *service)
{
	struct control *control = btd_service_get_user_data(service);

	if (control->session)
		return -EALREADY;

	control->session = avctp_connect(control->dev);
	if (!control->session)
		return -EIO;

	return 0;
}

int control_disconnect(struct btd_service *service)
{
	struct control *control = btd_service_get_user_data(service);

	if (!control->session)
		return -ENOTCONN;

	avctp_disconnect(control->session);

	return 0;
}

static DBusMessage *key_pressed(DBusConnection *conn, DBusMessage *msg,
						uint8_t op, void *data)
{
	struct control *control = data;
	int err;

	if (!control->session)
		return btd_error_not_connected(msg);

	if (!control->target)
		return btd_error_not_supported(msg);

	err = avctp_send_passthrough(control->session, op);
	if (err < 0)
		return btd_error_failed(msg, strerror(-err));

	return dbus_message_new_method_return(msg);
}

static DBusMessage *control_volume_up(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_VOLUME_UP, data);
}

static DBusMessage *control_volume_down(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_VOLUME_DOWN, data);
}

static DBusMessage *control_play(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_PLAY, data);
}

static DBusMessage *control_pause(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_PAUSE, data);
}

static DBusMessage *control_stop(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_STOP, data);
}

static DBusMessage *control_next(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_FORWARD, data);
}

static DBusMessage *control_previous(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_BACKWARD, data);
}

static DBusMessage *control_fast_forward(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_FAST_FORWARD, data);
}

static DBusMessage *control_rewind(DBusConnection *conn, DBusMessage *msg,
								void *data)
{
	return key_pressed(conn, msg, AVC_REWIND, data);
}

static gboolean control_property_get_connected(
					const GDBusPropertyTable *property,
					DBusMessageIter *iter, void *data)
{
	struct control *control = data;
	dbus_bool_t value = (control->session != NULL);

	dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);

	return TRUE;
}

static const GDBusMethodTable control_methods[] = {
	{ GDBUS_METHOD("Play", NULL, NULL, control_play) },
	{ GDBUS_METHOD("Pause", NULL, NULL, control_pause) },
	{ GDBUS_METHOD("Stop", NULL, NULL, control_stop) },
	{ GDBUS_METHOD("Next", NULL, NULL, control_next) },
	{ GDBUS_METHOD("Previous", NULL, NULL, control_previous) },
	{ GDBUS_METHOD("VolumeUp", NULL, NULL, control_volume_up) },
	{ GDBUS_METHOD("VolumeDown", NULL, NULL, control_volume_down) },
	{ GDBUS_METHOD("FastForward", NULL, NULL, control_fast_forward) },
	{ GDBUS_METHOD("Rewind", NULL, NULL, control_rewind) },
	{ }
};

static const GDBusPropertyTable control_properties[] = {
	{ "Connected", "b", control_property_get_connected },
	{ }
};

static void path_unregister(void *data)
{
	struct control *control = data;

	DBG("Unregistered interface %s on path %s",  AUDIO_CONTROL_INTERFACE,
						device_get_path(control->dev));

	if (control->session)
		avctp_disconnect(control->session);

	avctp_remove_state_cb(control->avctp_id);

	if (control->target)
		btd_service_unref(control->target);

	if (control->remote)
		btd_service_unref(control->remote);

	devices = g_slist_remove(devices, control);
	g_free(control);
}

void control_unregister(struct btd_service *service)
{
	struct btd_device *dev = btd_service_get_device(service);

	g_dbus_unregister_interface(btd_get_dbus_connection(),
						device_get_path(dev),
						AUDIO_CONTROL_INTERFACE);
}

static struct control *find_control(struct btd_device *dev)
{
	GSList *l;

	for (l = devices; l; l = l->next) {
		struct control *control = l->data;

		if (control->dev == dev)
			return control;
	}

	return NULL;
}

static struct control *control_init(struct btd_service *service)
{
	struct control *control;
	struct btd_device *dev = btd_service_get_device(service);

	control = find_control(dev);
	if (control != NULL)
		return control;

	control = g_new0(struct control, 1);

	if (!g_dbus_register_interface(btd_get_dbus_connection(),
					device_get_path(dev),
					AUDIO_CONTROL_INTERFACE,
					control_methods, NULL,
					control_properties, control,
					path_unregister)) {
		g_free(control);
		return NULL;
	}

	DBG("Registered interface %s on path %s", AUDIO_CONTROL_INTERFACE,
							device_get_path(dev));

	control->dev = dev;
	control->avctp_id = avctp_add_state_cb(dev, state_changed, control);
	devices = g_slist_prepend(devices, control);

	return control;
}

int control_init_target(struct btd_service *service)
{
	struct control *control;

	control = control_init(service);
	if (control == NULL)
		return -EINVAL;

	control->target = btd_service_ref(service);

	btd_service_set_user_data(service, control);

	return 0;
}

int control_init_remote(struct btd_service *service)
{
	struct control *control;

	control = control_init(service);
	if (control == NULL)
		return -EINVAL;

	control->remote = btd_service_ref(service);

	btd_service_set_user_data(service, control);

	return 0;
}

gboolean control_is_active(struct btd_service *service)
{
	struct control *control = btd_service_get_user_data(service);

	if (control && control->session)
		return TRUE;

	return FALSE;
}


text:
Stack where the stream was allocated.

```csharp
public string AllocationStack { get; }
```

## See Also

* class [StreamDoubleDisposedEventArgs](../RecyclableMemoryStreamManager.StreamDoubleDisposedEventArgs.md)
* namespace [Microsoft.IO](../../Microsoft.IO.RecyclableMemoryStream.md)

<!-- DO NOT EDIT: generated by xmldocmd for Microsoft.IO.RecyclableMemoryStream.dll -->


text:
ARG PHP_VERSION

FROM php:$PHP_VERSION-fpm-alpine

# build time dependencies
ENV PHPIZE_DEPS \
    autoconf \
    cmake \
    file \
    g++ \
    gcc \
    libc-dev \
    pcre-dev \
    make \
    git \
    pkgconf \
    re2c \
    libxml2-dev \
    oniguruma-dev

# Use a more local mirror as the CDN is sometimes terribly slow
RUN echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v3.11/main > /etc/apk/repositories; \
    echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v3.11/community >> /etc/apk/repositories

# persistent dependencies
# inspired by https://github.com/prooph/docker-files/blob/master/php/7.1-fpm
RUN set -ex \
       &&  apk add --no-cache \
        bash \
        mysql-client \
        gzip \
        icu \
        libzip-dev \
        freetype-dev \
        libjpeg-turbo-dev \
        libpng-dev \
        icu-dev

RUN set -ex \
    && apk add --no-cache --virtual .build-deps \
        $PHPIZE_DEPS \
    && docker-php-ext-configure bcmath --enable-bcmath \
    && docker-php-ext-configure gd \
        #--with-gd \
        #--with-freetype-dir=/usr/include \
        #--with-png-dir=/usr/include \
        #--with-jpeg-dir=/usr/include \
    && docker-php-ext-configure intl --enable-intl  \
    && docker-php-ext-configure pcntl --enable-pcntl \
    && docker-php-ext-configure pdo_mysql --with-pdo-mysql \
    && docker-php-ext-configure mbstring --enable-mbstring \
    && docker-php-ext-configure soap --enable-soap \
    && docker-php-ext-configure xml --enable-xml \
    && docker-php-ext-configure zip \
    #--enable-zip --with-libzip \
    && docker-php-ext-install \
        bcmath \
        gd \
        intl \
        pcntl \
        pdo_mysql \
        mbstring \
        soap \
        xml \
        zip \
    && pecl install -o -f redis \
    && rm -rf /tmp/pear \
    && docker-php-ext-enable redis \
    && apk del .build-deps
#    && pecl install xdebug-2.6.0 \
#    && docker-php-ext-enable xdebug \

COPY installComposer.sh /installComposer.sh
RUN sh /installComposer.sh


text:
import classnames from 'classnames';

export const RATING_NAMES = {
  '1': 'Favorite',
  '0': 'TBD',
  '-1': 'Hidden',
};

function isRating(ratingKey: string): ratingKey is keyof typeof RATING_NAMES {
  return ratingKey in RATING_NAMES;
}

function getRatingIconClass(rating: number, selected?: boolean) {
  if (rating === -1) {
    return 'bi-eye-slash';
  }

  if (rating === 1) {
    return selected ? 'bi-star-fill' : 'bi-star';
  }

  return '';
}

function getRatingColorClass(rating: number, selected?: boolean) {
  if (rating === -1) {
    return selected ? 'text-danger' : 'text-secondary text-hover-danger';
  }

  if (rating === 1) {
    return selected ? 'text-warning' : 'text-secondary text-hover-warning';
  }

  return '';
}

export type EventRatingIconProps = {
  rating: number;
  size?: number;
  selected?: boolean;
  useColors?: boolean;
  overrideElementSize?: boolean;
};

function EventRatingIcon({
  rating,
  selected,
  useColors,
  size: providedSize,
  overrideElementSize,
}: EventRatingIconProps): JSX.Element {
  const size = providedSize ?? 1.0;
  const ratingKey = `${rating}`;

  return (
    <i
      className={classnames(
        getRatingIconClass(rating, selected),
        useColors ? getRatingColorClass(rating, selected) : null,
      )}
      style={{
        fontSize: `${size}rem`,
        width: overrideElementSize ? `${size}rem` : undefined,
        height: overrideElementSize ? `${size}rem` : undefined,
      }}
    >
      {isRating(ratingKey) && RATING_NAMES[ratingKey]}

  );
}

export default EventRatingIcon;


text:
cask "biglybt" do
  version "3.1.0.0"
  sha256 "491be0e2dd7cd903d094e671aa7e2b7797332addbd60d962e79eb731110a968a"

  url "https://github.com/BiglySoftware/BiglyBT/releases/download/v#{version}/GitHub_BiglyBT_Installer.dmg",
      verified: "github.com/BiglySoftware/BiglyBT/"
  name "biglybt"
  desc "Bittorrent client based on the Azureus open source project"
  homepage "https://www.biglybt.com/"

  depends_on macos: ">= :el_capitan"

  preflight do
    system_command "#{staged_path}/BiglyBT Installer.app/Contents/MacOS/JavaApplicationStub",
                   args:         [
                     "-dir", "#{appdir}/BiglyBT",
                     "-q",
                     "-Dinstall4j.suppressStdout=true",
                     "-Dinstall4j.debug=false",
                     "-VcreateDesktopLinkAction$Boolean=false",
                     "-VaddToDockAction$Boolean=false"
                   ],
                   print_stderr: false
  end

  uninstall delete: "#{appdir}/BiglyBT"

  zap trash: [
    "~/Library/Application Support/BiglyBT",
    "~/Library/Preferences/com.biglybt.plist",
    "~/Library/Saved Application State/com.biglybt.savedState",
  ]

  caveats do
    depends_on_java "8+"
  end
end