text:
..
      Copyright 2014 Mirantis, Inc.

      Licensed under the Apache License, Version 2.0 (the "License"); you may
      not use this file except in compliance with the License. You may obtain
      a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
      License for the specific language governing permissions and limitations
      under the License.

========================
Upload Image Into Glance
========================

To deploy applications with Murano, virtual machine images should be uploaded into Glance in a special way - *murano_image_info* property should be set

1. Use the glance image-create command to import your disk image to
   Glance:

   ::

       >$ glance image-create --name <NAME>  --is-public true --disk-format qcow2 --container-format bare --file <IMAGE_FILE> --property <IMAGE_METADATA>

Replace the command line arguments to glance image-create with the
appropriate values for your environment and disk image:

*  Replace **<NAME>** with the name that users will refer to the disk
   image by. E.g. '**ws-2012-std**\ '

*  Replace **<IMAGE\_FILE>** with the local path to the image file to
   upload. E.g. '**ws-2012-std.qcow2**\ '.

*  Replace **<IMAGE\_METADATA>** with the following property string

   ::

       murano_image_info='{"title": "Windows 2012 Standart Edition", "type": "windows.2012"}'

   where

   *  title - user-friendly description of the image
   *  type - is a image type, for example 'windows.2012'

2. To update metadata of the existing image run the command:

    ::

    >$ glance image-update <IMAGE-ID> --property <IMAGE_MATADATA>

*  Replace **<IMAGE-ID>** with image id from the previous command
   output.

*  Replace **<IMAGE\_METADATA>** with murano\_image\_info property, e.g.

   ::

       murano_image_info='{"title": "Windows 2012 Standart Edition", "type": "windows.2012"}'

**Warning**

    The value of the **--property** argument named
    **murano\_image\_info** is a JSON string. Only double quotes are
    valid in JSON, so please type the string exactly as in the example
    above.

**Note**

Already existing image could be marked in a simple way in Horizon UI with Murano dashboard installed. Navigate to *Murano -> Manage -> Images -> Mark Image* and fill up a form:

-  **Image** - ws-2012-std

-  **Title** - My Prepared Image

-  **Type** - Windows Server 2012

After these steps desired image can be chosen in application creation wizard.


text:
 Server Configurations

 Site Configuration

                        Name: {{ config('site.name') }}

                        Version: {{ config('site.version') }}

                 {{ config('database.default') }} Database Configuration

                        Driver: {{ config('database.connections.' . config('database.default') . '.driver') }}

                        Database: {{ config('database.connections.' . config('database.default') . '.database') }}

                        Username: {{ config('database.connections.' . config('database.default') . '.username') }}

                        Password: {{ substr(config('database.connections.' . config('database.default') . '.password'), 0, 1) }}
                        ****
                        {{ substr(config('database.connections.' . config('database.default') . '.password'), strlen(config('database.connections.' . config('database.default') . '.password')) - 1, 1) }}

redpajama_set_name: RedPajamaGithub


text:
run as
runas /user:sdnlab\homerjs powershell

whoami

get-vm -computername xxxx

enter-pssession -ComputerName xxxxx

 enter-pssession -ComputerName xxxx -ConfigurationName HyperOpsJea


text:
var verymodel  = require('verymodel');
var Padlock    = require('padlock').Padlock;
var keylib     = require('./lib/keys');
var underscore = require('underscore');
var getDBPath  = require('./lib/dbpool');
var indexes = require('./lib/indexes');
var base = require('./lib/base');
var children = require('./lib/children');
var foreign = require('./lib/foreign');

var model_cache = {};

function makeModelLevely(mf) {
    mf.options.savelock = new Padlock();

    mf.getBucketDB = function (bucket) {
        if (mf.options.dbdir.substr(-1) !== '/') {
            mf.options.dbdir += '/';
        }
        return getDBPath(mf.options.dbdir + bucket + '.db');
    };

    if (mf.options.dbdir) {
        mf.options.db = mf.getBucketDB(mf.options.bucket || 'defaultbucket');
    }

    //for historical reasons, support prefix and name
    if (!mf.options.name) {
        mf.options.name = mf.options.prefix;
    }

    if (typeof mf.options.name !== 'string') {
        throw new Error("Model factories must include a prefix option.");
    }

    mf.addDefinition({
        key: {
            derive: function () {
                var value;
                if (this.__verymeta.data.key) return this.__verymeta.data.key;
                if (this.__verymeta.parent) {
                    value = keylib.joinChild(mf, keylib.joinSep(mf, ('__child__', this.__verymeta.parent.key)), this.__verymeta.prefix, undefined);
                } else {
                    value = this.__verymeta.prefix + (this.__verymeta.sep || '!');
                }
                if (!this.keyname) {
                    return '';
                }
                value += this.keyname;
                return value;
            },
            private: !mf.options.includeKey,
        },
        keyname: {
            private: !mf.options.includeKey,
        },
        vclock: {
            private: true,
        },
    });

    mf.handleOpts = function (name, opts, callback) {
        if (typeof callback === 'undefined') {
            opts = {cb: opts};
        } else {
            opts.cb = callback;
        }
        if (opts.bucket && mf.options.dbdir) {
            opts.db = mf.getBucketDB(opts.bucket);
        } else if (!opts.db) {
            opts.db = mf.options.db;
        }
        if (opts.db.isRiak && !opts.bucket) {
            opts.bucket = mf.options.bucket || 'default';
        }
        if (typeof opts.cb !== 'function') {
            throw Error('The last argument in ' + name + 'must be a function');
        }
        if (!opts.db) {
            throw new Error("Model factories must include a db option of a levelup instance with valueEncoding of json.");
        }
        if (opts.db.isClosed() && !opts.bucket.isRiak) {
            mf.options.db = opts.db = mf.getBucketDB(mf.options.bucket || 'defaultbucket');
        }
        if (typeof opts.depth === 'undefined') {
            opts.depth = 5;
        }
        opts.prefix = opts.prefix || mf.options.name;
        return opts;
    };

    indexes(mf);
    base(mf);
    children(mf);
    foreign(mf);

    mf.bucket = function (bucket) {
        var opts = underscore.clone(mf.options);
        opts.bucket = bucket;
        return new VeryLevelModel(mf.definition, opts);
    };

    return mf;
}

function VeryLevelModel() {
    verymodel.VeryModel.apply(this, arguments);
    makeModelLevely(this);
}

VeryLevelModel.prototype = Object.create(verymodel.VeryModel.prototype);

module.exports = {
    Model: VeryLevelModel,
};


text:
require 'docker'
require 'securerandom'
require_relative 'compose_port'
require_relative '../utils/compose_utils'

class ComposeContainer
  attr_reader :attributes, :container, :dependencies

  def initialize(hash_attributes)
    @attributes = {
      label: hash_attributes[:label],
      name: hash_attributes[:name].nil? ? hash_attributes[:label] : hash_attributes[:name],
      image: ComposeUtils.format_image(hash_attributes[:image]),
      build: hash_attributes[:build],
      links: ComposeUtils.format_links(hash_attributes[:links]),
      ports: prepare_ports(hash_attributes[:ports]),
      volumes: hash_attributes[:volumes],
      command: ComposeUtils.format_command(hash_attributes[:command]),
      environment: prepare_environment(hash_attributes[:environment]),
      labels: prepare_labels(hash_attributes[:labels])
    }.reject{ |key, value| value.nil? }

    # Docker client variables
    @internal_image = nil
    @container = nil
    @dependencies = []
  end

  private

  #
  # Download or build an image
  #
  def prepare_image
    has_image_or_build_arg = @attributes.key?(:image) || @attributes.key?(:build)

    raise ArgumentError.new('No Image or Build command provided') unless has_image_or_build_arg

    # Build or pull image
    if @attributes.key?(:image)
      @internal_image = @attributes[:image]

      unless image_exists(@internal_image)
        Docker::Image.create('fromImage' => @internal_image)
      end
    elsif @attributes.key?(:build)
      @internal_image = SecureRandom.hex # Random name for image
      Docker::Image.build_from_dir(@attributes[:build], {t: @internal_image})
    end
  end

  #
  # Start a new container with parameters informed in object construction
  #
  def prepare_container
    # Prepare attributes
    port_bindings = prepare_port_bindings
    links = prepare_links
    volumes = prepare_volumes
    volume_binds = @attributes[:volumes] && @attributes[:volumes].reject { |volume| volume.split(':').one? }

    # Exposed ports are port bindings with an empty hash as value
    exposed_ports = {}
    port_bindings.each {|k, v| exposed_ports[k] = {}}

    container_config = {
      Image: @internal_image,
      Cmd: @attributes[:command],
      Env: @attributes[:environment],
      Volumes: volumes,
      ExposedPorts: exposed_ports,
      Labels: @attributes[:labels],
      HostConfig: {
        Binds: volume_binds,
        Links: links,
        PortBindings: port_bindings
      }
    }

    query_params = { 'name' => @attributes[:name] }

    params = container_config.merge(query_params)
    @container = Docker::Container.create(params)
  end

  #
  # Prepare port binding attribute based on ports
  # received from compose file
  #
  def prepare_port_bindings
    port_bindings = {}

    return port_bindings if @attributes[:ports].nil?

    @attributes[:ports].each do |port|
      port_bindings["#{port.container_port}/tcp"] = [{
        "HostIp" => port.host_ip || '',
        "HostPort" => port.host_port || ''
      }]
    end

    port_bindings
  end

  #
  # Prepare link entries based on
  # attributes received from compose
  #
  def prepare_links
    links = []

    @dependencies.each do |dependency|
      link_name = @attributes[:links][dependency.attributes[:label]]
      links << "#{dependency.stats['Id']}:#{link_name}"
    end

    links
  end

  #
  # Transforms an array of [(host:)container(:accessmode)] to a hash
  # required by the Docker api.
  #
  def prepare_volumes
    return unless @attributes[:volumes]

    volumes = {}

    @attributes[:volumes].each do |volume|
      parts = volume.split(':')

      if parts.one?
        volumes[parts[0]] = {}
      else
        volumes[parts[1]] = { parts[0] => parts[2] || 'rw' }
      end
    end

    volumes
  end

  #
  # Process each port entry in docker compose file and
  # create structure recognized by docker client
  #
  def prepare_ports(port_entries)
    ports = []

    if port_entries.nil?
      return nil
    end

    port_entries.each do |port_entry|
      ports.push(ComposeUtils.format_port(port_entry))
    end

    ports
  end

  #
  # Forces the environment structure to use the array format.
  #
  def prepare_environment(env_entries)
    return env_entries unless env_entries.is_a?(Hash)
    env_entries.to_a.map { |x| x.join('=') }
  end

  #
  # Forces the labels structure to use the hash format.
  #
  def prepare_labels(labels)
    return labels unless labels.is_a?(Array)
    Hash[labels.map { |label| label.split('=') }]
  end

  #
  # Check if a given image already exists in host
  #
  def image_exists(image_name)
    Docker::Image.exist?(image_name)
  end

  public

  #
  # Start the container and its dependencies
  #
  def start
    # Start dependencies
    @dependencies.each do |dependency|
      dependency.start unless dependency.running?
    end

    # Create a container object
    if @container.nil?
      prepare_image
      prepare_container
    end

    @container.start unless @container.nil?
  end

  #
  # Stop the container
  #
  def stop
    @container.stop unless @container.nil?
  end

  #
  # Kill the container
  #
  def kill
    @container.kill unless @container.nil?
  end

  #
  # Delete the container
  #
  def delete
    @container.delete(:force => true) unless @container.nil?
    @container = nil
  end

  #
  # Add a dependency to this container
  # (i.e. a container that must be started before this one)
  #
  def add_dependency(dependency)
    @dependencies << dependency
  end

  #
  # Return container statistics
  #
  def stats
    @container.json
  end

  #
  # Check if a container is already running or not
  #
  def running?
    @container.nil? ? false : self.stats['State']['Running']
  end

  #
  # Check if the container exists or not
  #
  def exist?
    !@container.nil?
  end
end


text:
#import <iWorkImport/TSCH3DImageTextureTiling.h>

@interface TSCH3DImageTextureTiling (PersistenceAdditions)
+ (id)instanceWithArchive:(const struct Chart3DImageTextureTilingArchive *)arg1 unarchiver:(id)arg2;
- (void)saveToArchive:(struct Chart3DImageTextureTilingArchive *)arg1 archiver:(id)arg2;
- (id)initWithArchive:(const struct Chart3DImageTextureTilingArchive *)arg1 unarchiver:(id)arg2;
@end


text:
<!DOCTYPE>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>交易记录</title>
<link rel="stylesheet" href="css/common.css" />


text:
<?xml version="1.0"?>
<config title="Configure Arizona Build">
  <quickpicks width="300" selectorspanel="expanded"
              label="What do you want to build?">
    <quickpick label="I want Bellingham installer (debug)">
      <set selector="Product" choice="Bellingham_HB"/>
      <set selector="Hardware support" choice="Yes"/>
    </quickpick>
    <quickpick label="I want Ottawa installer (debug)">
      <set selector="Product" choice="Ottawa_HB"/>
      <set selector="Hardware support" choice="Yes"/>
    </quickpick>
  </quickpicks>

  <layout type="vstack" color="SkyBlue">
    <layout type="hstack">
      <layout type="hstack" group="simple" label="Product options" bordercolor="red">
        <selector name="Product"/>
        <selector name="Hardware support" color="blue"/>
      </layout>
      <layout type="hstack" group="simple" label="Build configuration"
              BorderColor="Blue">
        <selector name="Platform"/>
        <selector name="Configuration"/>
      </layout>
    </layout>
    <layout type="uniformgrid" rows="1" columns="6" group="expander"
            expander="expanded"
            BorderColor="red"
            label="Extra options" >
      <selector name="Build target"/>
      <selector name="What to build?"/>
      <selector name="Precompiled headers"/>
      <selector name="Toolset Platform"/>
      <selector name="Visual Studio"/>
      <layout type="vstack" color="pink" bordercolor="Teal">
        <selector name="Cache resources" color="Gray" bordercolor="Silver"/>
        <selector name="Concurrent build"/>
        <selector name="Log build"/>
        <selector name="Detailed summary"/>
      </layout>
    </layout>
  </layout>

  <!--<layout type="vstack">
    <layout type="hstack">
      <selector name="Product"/>
      <selector name="Hardware support"/>
      <selector name="Platform"/>
      <selector name="Configuration"/>
    </layout>
    <layout type="hstack">
      <selector name="Build target"/>
      <selector name="What to build?"/>
      <selector name="Precompiled headers"/>
      <selector name="Toolset Platform"/>
      <selector name="Visual Studio"/>
      <layout type="vstack">
        <selector name="Cache resources"/>
        <selector name="Concurrent build"/>
        <selector name="Log build"/>
        <selector name="Detailed summary"/>
      </layout>
    </layout>
  </layout>-->

  <selector name="Product" color="red" bordercolor="green">
    <choice name="Bellingham_HB" label="Bellingham">
        <var name="PrinterArchitecture">Bellingham_HB</var>
    </choice>
    <choice name="Ottawa_HB" label="Ottawa">
        <var name="PrinterArchitecture">Ottawa_HB</var>
    </choice>
  </selector>
  <selector name="Hardware support" default="Yes">
    <choice name="Yes">
        <var name="HardwareSupport">true</var>
        <var name="SIM_MODE">false</var>
        <var name="hw_filename_part">hw</var>
    </choice>
    <choice name="HWIF simulation">
        <var name="HardwareSupport">true</var>
        <var name="SIM_MODE">true</var>
        <var name="hw_filename_part">hws</var>
    </choice>
    <choice name="JC Simulation">
        <var name="HardwareSupport">false</var>
        <var name="SIM_MODE">false</var>
        <var name="hw_filename_part">sim</var>
    </choice>
  </selector>
  <selector name="Platform" default="x64">
    <choice name="Win32">
        <var name="Platform">Win32</var>
    </choice>
    <choice name="x64">
        <var name="Platform">x64</var>
    </choice>
  </selector>
  <selector name="Configuration" default="Debug">
    <choice id="debug" name="Debug">
        <var name="Configuration">Debug</var>
    </choice>
    <choice id="release" name="Release">
        <var name="Configuration">Release</var>
    </choice>
  </selector>
  <selector name="Build target" default="Installer">
    <choice name="BuildConfig">
        <var name="Target">BuildConfig</var>
    </choice>
    <choice name="Build">
        <var name="Target">Build</var>
    </choice>
    <choice name="Rebuild">
        <var name="Target">Rebuild</var>
    </choice>
    <choice name="CreateInstallerLayout">
        <var name="Target">CreateInstallerLayout</var>
    </choice>
    <choice name="Installer">
        <var name="Target">Installer</var>
    </choice>
  </selector>
  <selector name="What to build?" default="Everything">
    <choice name="Engine only">
        <var name="Project">engine.proj</var>
        <var name="ProjectName">engine</var>
    </choice>
    <choice name="GUI only">
        <var name="Project">gui\gui.proj</var>
        <var name="ProjectName">gui</var>
    </choice>
    <choice name="Everything">
        <var name="Project">Product.proj</var>
      <var name="ProjectName">all</var>
    </choice>
  </selector>
  <selector name="Precompiled headers" default="Use">
    <choice name="Use">
        <var name="UsePrecompiledHeaders">Yes</var>
        <var name="pch">pch</var>
    </choice>
    <choice name="Do not use">
        <var name="UsePrecompiledHeaders">No</var>
        <var name="pch">nopch</var>
    </choice>
  </selector>
  <selector name="Toolset Platform" default="x64">
    <choice name="x86">
        <var name="ToolsetPlatform">x86</var>
    </choice>
    <choice name="x86 cross x64">
        <var name="ToolsetPlatform">x86_amd64</var>
    </choice>
    <choice name="x64">
        <var name="ToolsetPlatform">x64</var>
    </choice>
  </selector>
  <selector name="Visual Studio" default="2013 (12.0)">
    <choice name="2008 (9.0)">
        <var name="MSVCVER">9.0</var>
        <var name="VSVER">2008</var>
        <var name="MSBUILD_WORKAROUND">set VC_PROJECT_ENGINE_NOT_USING_REGISTRY_FOR_INIT=1</var>
        <var name="NOREUSE_WORKAROUND">/nr:false</var>
    </choice>
    <choice name="2013 (12.0)">
        <var name="MSVCVER">12.0</var>
        <var name="VSVER">2013</var>
    </choice>
  </selector>
  <selector name="Cache resources" default="true" type="checkbox">
    <choice name="true">
        <var name="CacheResources">true</var>
    </choice>
    <choice name="false">
        <var name="CacheResources">false</var>
    </choice>
  </selector>
  <selector name="Concurrent build" default="true" type="checkbox">
    <choice name="true">
        <var name="multiprocessor_build">/m</var>
    </choice>
    <choice name="false">
    </choice>
  </selector>
  <selector name="Log build" default="true" type="checkbox">
    <choice name="true">
        <var name="LogToFile" evaluate="true">/fl /flp:LogFile=${Configuration}_msbuild.log</var>
    </choice>
  </selector>
  <selector name="Detailed summary" default="false" type="checkbox">
    <choice name="true">
        <var name="detailed_summary">/ds</var>
    </choice>
    <choice name="false">
    </choice>
  </selector>
  <templates>
    <template name="Build script"
              filename="${Target}_${ProjectName}_${PrinterArchitecture}_${hw_filename_part}_${Platform}_${Configuration}_vs${VSVER}_${pch}.cmd"
              runnable="true"
              runexecutable="cmd.exe"
              runcommandline="/K "{0}""
              runbuttontext="Build">
      <![CDATA[@echo off
setlocal
${MSBUILD_WORKAROUND}
set VCVARSALL_BAT=%ProgramFiles%\Microsoft Visual Studio ${MSVCVER}\VC\vcvarsall.bat
if not "%ProgramFiles(x86)%"=="" set VCVARSALL_BAT=%ProgramFiles(x86)%\Microsoft Visual Studio ${MSVCVER}\VC\vcvarsall.bat
call "%VCVARSALL_BAT%" ${ToolsetPlatform}
msbuild ${multiprocessor_build} ${LogToFile} ${detailed_summary} /p:PrinterArchitecture=${PrinterArchitecture} ..\${Project}  /p:HardwareSupport=${HardwareSupport} /p:Configuration=${Configuration} /p:Platform=${Platform} /p:UsePrecompiledHeaders=${UsePrecompiledHeaders} /p:UsePrecompressedResources=${CacheResources} /p:VisualStudioVersion=${VSVER} ${NOREUSE_WORKAROUND} /t:${Target}
endlocal
]]>
    </template>
  </templates>
</config>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <attr name="textSize" format="dimension" />
    <attr name="textColor" format="color" />
    <attr name="startAngle" format="integer"/>
    <attr name="duration" format="integer"/>

    <attr name="direction" >
        <enum name="left" value="1"/>
        <enum name="right" value="2"/>
        <enum name="above" value="3"/>
        <enum name="below" value="4"/>

    </attr>

    <declare-styleable name="DragBubbleView">
        <attr name="bubbleRadius" format="dimension" />
        <attr name="bubbleColor" format="color" />
        <attr name="text" format="string" />
        <attr name="textSize" />
        <attr name="textColor" />

    </declare-styleable>

    <!--
            max                 最大进度
            startAngle             进度从圆环的哪个角度开始走
            backColor             圆环内部的填充色
            roundColor             圆环的颜色
            roundProgressColor  圆环进度的颜色
            roundWidth             圆环宽度
            textColor             中心文字的颜色
            textSize             中心文字的大小
            textIsDisplayable     中心文字是否显示
            src                   中心显示图片
            style = 0/1          进度的风格,实心或者空心
         -->
    <declare-styleable name="CirclePlayProgress">
        <attr name="max" format="integer" />
        <attr name="startAngle" />
        <attr name="backColor" format="color"/>
        <attr name="roundColor" format="color"/>
        <attr name="roundProgressColor" format="color"/>
        <attr name="roundWidth" format="dimension"/>
        <attr name="textColor"/>
        <attr name="textSize"/>
        <attr name="textIsDisplayable" format="boolean"/>
        <attr name="src" format="reference" />
        <attr name="type" >
            <enum name="STROKE" value="0"/>
            <enum name="FILL" value="1"/>
        </attr>
    </declare-styleable>
    <declare-styleable name="VoicePlayingView">
        <attr name="arcColor" format="color"/>
        <attr name="arcStrokeWidth" format="integer"/>
        <attr name="toRightDistance" format="dimension" />
        <attr name="toLeftDistance" format="dimension" />
        <attr name="direction" />
        <attr name="duration" />
        <attr name="url" format="string"/>
        <attr name="textSize" />
        <attr name="textColor" />
    </declare-styleable>

</resources>


text:
#ifndef __XFS_H__
#define __XFS_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <xfs/archiver.h>

struct xfs_path_t {
	char * path;
	void * mhandle;
	int writable;
	struct xfs_archiver_t * archiver;
	struct list_head list;
};

struct xfs_context_t {
	struct xfs_path_t mounts;
	spinlock_t lock;
};

struct xfs_file_t {
	struct xfs_context_t * ctx;
	struct xfs_path_t * path;
	void * fhandle;
};

bool_t xfs_mount(struct xfs_context_t * ctx, const char * path, int writable);
bool_t xfs_umount(struct xfs_context_t * ctx, const char * path);
void xfs_walk(struct xfs_context_t * ctx, const char * name, xfs_walk_callback_t cb, void * data);
bool_t xfs_isdir(struct xfs_context_t * ctx, const char * name);
bool_t xfs_isfile(struct xfs_context_t * ctx, const char * name);
bool_t xfs_mkdir(struct xfs_context_t * ctx, const char * name);
bool_t xfs_remove(struct xfs_context_t * ctx, const char * name);
struct xfs_file_t * xfs_open_read(struct xfs_context_t * ctx, const char * name);
struct xfs_file_t * xfs_open_write(struct xfs_context_t * ctx, const char * name);
struct xfs_file_t * xfs_open_append(struct xfs_context_t * ctx, const char * name);
s64_t xfs_read(struct xfs_file_t * file, void * buf, s64_t size);
s64_t xfs_write(struct xfs_file_t * file, void * buf, s64_t size);
s64_t xfs_seek(struct xfs_file_t * file, s64_t offset);
s64_t xfs_tell(struct xfs_file_t * file);
s64_t xfs_length(struct xfs_file_t * file);
void xfs_close(struct xfs_file_t * file);

struct xfs_context_t * xfs_alloc(const char * path, int userdata);
void xfs_free(struct xfs_context_t * ctx);

#ifdef __cplusplus
}
#endif

#endif /* __XFS_H__ */


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="keywords" content="" />
<meta name="description" content="" />
{META}
<title>{SITENAME} • {L_MCP} • {L_UCP} • {PAGE_TITLE}</title>

	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" />
	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&t={S_TOPIC_ID}" />

<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />

<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />

	<link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />

{$MG_WRAP_BEGIN}

				{SITE_LOGO_IMG}

{SITENAME}

{SITE_DESCRIPTION}

{L_SKIP}

				<form action="{U_SEARCH}" method="get" id="search">
				<fieldset>
					<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="{SEARCH_WORDS}{L_SEARCH_MINI}" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
					<input class="button2" value="{L_SEARCH}" type="submit" />

					{L_SEARCH_ADV} {S_SEARCH_HIDDEN_FIELDS}
				</fieldset>
				</form>

				{L_INFORMATION}: {L_BOARD_DISABLED}


text:
module Events
  class DataSourceDeleted < Base
    has_targets :data_source
    has_activities :actor, :global
  end
end


text:
package com.sleekbyte.tailor.utils;

import static org.junit.Assert.assertEquals;

import com.sleekbyte.tailor.common.YamlConfiguration;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;

/**
 * Tests for {@link YamlConfigurationFileManager}.
 */
@RunWith(MockitoJUnitRunner.class)
public final class YamlConfigurationFileManagerTest {

    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    @Test(expected = IOException.class)
    public void testParseConfigurationFileEmptyFolder() throws IOException {
        YamlConfigurationFileManager.getConfiguration(Optional.of(folder.getRoot().getPath()));
    }

    @Test
    public void testParseConfigurationFileValidConfigFile() throws IOException {
        YamlConfiguration config = YamlConfigurationFileManager
                .getConfiguration(Optional.of(createConfigFile(".tailor.yml").toString()))
                .orElse(new YamlConfiguration());

        Set<String> actualIncludeList = config.getInclude();
        Set<String> actualExcludeList = config.getExclude();
        Set<String> expectedIncludeList = new HashSet<>(Arrays.asList("Source"));
        Set<String> expectedExcludeList = new HashSet<>(Arrays.asList("Carthage", "Pods"));
        assertEquals(expectedIncludeList, actualIncludeList);
        assertEquals(expectedExcludeList, actualExcludeList);
    }

    private File createConfigFile(String fileName) throws IOException {
        File configFile = folder.newFile(fileName);
        Writer streamWriter = new OutputStreamWriter(new FileOutputStream(configFile), Charset.forName("UTF-8"));
        PrintWriter printWriter = new PrintWriter(streamWriter);
        printWriter.println("include:");
        printWriter.println("  - Source");
        printWriter.println("exclude:");
        printWriter.println("  - Carthage");
        printWriter.println("  - Pods");
        streamWriter.close();
        printWriter.close();
        return configFile;
    }

}


text:
package com.abetterway2feel.fixturefinder.config;

import com.abetterway2feel.fixturefinder.domain.CacheSettings;
import com.abetterway2feel.fixturefinder.domain.Competition;
import com.abetterway2feel.fixturefinder.domain.Location;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;

import java.time.Clock;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;

@Profile("behaviour-test")
@SpringBootConfiguration
public class BehaviourTestConfig {

    @Bean
    public CacheSettings provideCacheSettings() {
        return new CacheSettings(50, 5, TimeUnit.MINUTES);
    }

    @Bean
    public Set<Competition> getSupportedLiveScorecompetitions() {
        Set<Competition> supportedCompetitions = new HashSet<>();
        supportedCompetitions.addAll(Location.ENGLAND.buildStandardDomesticsFor("FA Cup", "Premier League", "Championship"));
        supportedCompetitions.addAll(Location.SCOTLAND.buildStandardDomesticsFor("Scottish Cup","Premiership", "Championship"));

        return supportedCompetitions;
    }

    @Bean
    public Clock provideClock() {
        return Clock.fixed(LocalDate.of(2017, 4, 9).atStartOfDay().toInstant(ZoneOffset.UTC), ZoneOffset.UTC);
    }

}


text:
package net.daw.bean.implementation;

import com.google.gson.annotations.Expose;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import net.daw.bean.publicinterface.GenericBean;
import net.daw.helper.statics.EncodingUtilHelper;

public class UsuarioBean implements GenericBean{

    @Expose
    private Integer id;
    @Expose
    private String login = "";
    @Expose
    private String password = "";
    @Expose
    private String descripcion = "";

    public UsuarioBean() {
        this.id = 0;
    }

    public UsuarioBean(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

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

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String toJson(Boolean expand) {
        String strJson = "{";
        strJson += "id:" + id + ",";
        strJson += "login:" + EncodingUtilHelper.quotate(login) + ",";
        strJson += "password:" + EncodingUtilHelper.quotate(password) + ",";
        strJson += "descripcion:" + EncodingUtilHelper.quotate(descripcion) + ",";
        strJson += "}";
        return strJson;
    }

    public String getColumns() {
        String strColumns = "";
        strColumns += "id,";
         strColumns += "login,";
        strColumns += "password,";
        strColumns += "descripcion";

        return strColumns;
    }

    @Override
    public String getValues() {
        String strColumns = "";
        strColumns += EncodingUtilHelper.quotate(login)+ ",";
        strColumns += EncodingUtilHelper.quotate(password) + ",";
        strColumns += EncodingUtilHelper.quotate(descripcion) + ",";
        strColumns += descripcion;

        return strColumns;
    }

    @Override
    public String toPairs() {
        String strPairs = "";
        strPairs += "id=" + id + ",";
        strPairs += "login=" + EncodingUtilHelper.quotate(login) + ",";
        strPairs += "password=" + EncodingUtilHelper.quotate(password) + ",";
        strPairs += "descripcion=" + EncodingUtilHelper.quotate(descripcion);

        return strPairs;
    }

    @Override
    public UsuarioBean fill(ResultSet oResultSet, Connection pooledConnection, Integer expand) throws SQLException, Exception {
        this.setId(oResultSet.getInt("id"));
        this.setLogin(oResultSet.getString("login"));
        this.setPassword(oResultSet.getString("password"));
        this.setDescripcion(oResultSet.getString("descripcion"));
        return this;

    }

}


text:
package tchannel

import "github.com/uber/tchannel-go/relay"

// RelayHost is the interface used to create RelayCalls when the relay
// receives an incoming call.
type RelayHost interface {
	// SetChannels is called on creation of the channel. It's used to set a
	// channel reference which can be used to get references to *Peer.
	SetChannel(ch *Channel)

	// Start starts a new RelayCall given the call frame and connection.
	// It may return a call and an error, in which case the caller will
	// call Failed/End on the RelayCall.
	Start(relay.CallFrame, *relay.Conn) (RelayCall, error)
}

// RelayCall abstracts away peer selection, stats, and any other business
// logic from the underlying relay implementation. A RelayCall may not
// have a destination if there was an error during peer selection
// (which should be returned from start).
type RelayCall interface {
	// Destination returns the selected peer (if there was no error from Start).
	Destination() (peer *Peer, ok bool)

	// SentBytes is called when a frame is sent to the destination peer.
	SentBytes(uint16)

	// ReceivedBytes is called when a frame is received from the destination peer.
	ReceivedBytes(uint16)

	// CallResponse is called when a call response frame is received from the destination peer
	CallResponse(relay.RespFrame)

	// The call succeeded (possibly after retrying).
	Succeeded()

	// The call failed.
	Failed(reason string)

	// End stats collection for this RPC. Will be called exactly once.
	End()
}


text:
'use strict'

const _ = require('lodash')
const body = require('koa-body')
const co = require('co')
const ejs = require('koa-ejs')
const compress = require('koa-compress')
const conditional = require('koa-conditional-get')
const Config = require('hello-config')
const cors = require('kcors')
const defaultsDeep = require('lodash.defaultsdeep')
const etag = require('koa-etag')
const favicon = require('koa-favicon')
const helmet = require('koa-helmet')
const i18n = require('koa-i18n')
const json = require('koa-json')
const Koa = require('koa')
const Knex = require('knex')
const locale = require('koa-locale')
const logger = require('koa-morgan')
const merge = require('lodash.merge')
const middleware = require('./middleware')
const Model = require('./model')
const path = require('path')
const responseTime = require('koa-response-time')
const serve = require('koa-static')

class App extends Koa {
  /**
   * Creates an `App` instance
   *
   * @param {Object} options - Configuration for the app
   * @returns {App} - An `App` instance
   */
  constructor (options) {
    super()

    let config = new Config(_defaults(options))
    this.context.config = config

    /**
     * Add the `responseTime` middleware via `koa-response-time`
     */
    if (_isEnabled(config.responseTime)) {
      this.use(responseTime())
    }

    /**
     * Add the `morgan` logger if the logger option is enabled via `koa-morgan`
     */
    if (_isEnabled(config.logger)) {
      this.use(logger(config.logger.format, config.logger))
    }

    /**
     * Add the requestId middleware
     */
    if (_isEnabled(config.requestId)) {
      this.use(middleware.requestId)
    }

    /**
     * Add security headers via the `koa-helmet` module
     */
    if (_isEnabled(config.helmet)) {
      this.use(helmet(config.helmet))
    }

    /**
     * Add the CORS middleware via `kcors`
     */
    if (_isEnabled(config.cors)) {
      this.use(cors(config.cors))
    }

    /**
     * Add the gzip middleware via `koa-compress`
     */
    if (_isEnabled(config.compress)) {
      this.use(compress(config.compress))
    }

    /**
     * Add ETag and If-Modified-Since support via `koa-conditional-get`, `koa-etag`
     */
    if (_isEnabled(config.etag)) {
      this.use(conditional())
      this.use(etag())
    }

    /**
     * Enable body parsing via `koa-body`
     */
    if (_isEnabled(config.body)) {
      this.use(body(config.body))
    }

    /**
     * Enable JSON responses via `koa-json`
     */
    if (_isEnabled(config.json)) {
      this.use(json(config.json))
    }

    /**
     * If we pass in a db connection, attempt to connect to it
     */
    if (config.db) {
      this.context.db = new Knex(config.db)
      Model.knex(this.context.db)
    }

    /**
     * Public folder, favicon rendering
     */
    if (config.public && config.public.root && _isEnabled(config.public)) {
      this.use(favicon(path.join(config.public.root, 'favicon.ico')))
      this.use(serve(config.public.root, config.public))
    }

    /**
     * Internationalization (i18n)
     */
    if (config.i18n) {
      locale(this)
      this.use(i18n(this, _.defaults(config.i18n, {
        indent: 2,
        extension: '.json'
      })))
    }

    /**
     * View rendering with ejs
     */
    if (config.views && config.views.enabled) {
      ejs(this, {
        cache: config.views.cache,
        root: config.views.root,
        viewExt: 'ejs',
        layout: 'layouts/application'
      })
      this.context.render = co.wrap(this.context.render)
    }
  }
}

/**
 * Set default values for the `config` param if not set
 *
 * @private
 * @param {Object} [config] - The config to use (optional)
 * @returns {Object} - The config object with default values
 */
function _defaults (config) {
  let values = require('./defaults/default')

  try {
    values = merge(values, require(`./defaults/${process.env.NODE_ENV}`))
  } catch (e) { }

  return defaultsDeep(config, values)
}

/**
 * Determine if a middleware is enabled in the configuration.  Middleware
 * can be disabled by setting the key to false, or by setting key.enabled = false
 *
 * @private
 * @param {String} middleware - The middleware to check if enabled
 * @returns {Boolean} whether the feature is enabled or not
 */
function _isEnabled (middleware) {
  if (middleware === false) {
    return false
  }

  return !(middleware && middleware.enabled === false)
}

module.exports = App


text:
//
//  ForgetPwdController.h
//  YiYiProject
//
//  Created by lichaowei on 14/12/13.
//  Copyright (c) 2014年 lcw. All rights reserved.
//

#import <UIKit/UIKit.h>
/**
 *  忘记密码
 */

#import "MyViewController.h"
@interface ForgetPwdController : MyViewController
@property (strong, nonatomic) IBOutlet UITextField *phoneTF;
@property (strong, nonatomic) IBOutlet UITextField *securityTF;
@property (strong, nonatomic) IBOutlet UITextField *passwordTF;
@property (strong, nonatomic) IBOutlet UITextField *secondPassword;
@property (strong, nonatomic) IBOutlet UIButton *codeButton;
@property (strong, nonatomic) IBOutlet UILabel *codeLabel;

- (IBAction)clickToCommit:(id)sender;

@end


text:
require 'spec_helper'

describe 'trove::quota' do

  describe 'with default parameters' do
    it 'contains default values' do
      is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
        :value => 5)
      is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
        :value => 5)
      is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
        :value => 20)
      is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
        :value => 50)
      is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
        :value => 'trove.quota.quota.DbQuotaDriver')
    end
  end

  describe 'with overridden parameters' do
    let :params do
      { :max_instances_per_user   => 10,
        :max_accepted_volume_size => 10,
        :max_volumes_per_user => 100,
        :max_backups_per_user => 100,
      }
    end
    it 'contains overrided values' do
      is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
        :value => 10)
      is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
        :value => 10)
      is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
        :value => 100)
      is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
        :value => 100)
    end
  end
end


text:
#include "tensorflow/compiler/xla/service/hlo_reachability.h"

namespace xla {

HloReachabilityMap::HloReachabilityMap(
    absl::Span<const HloInstruction* const> instructions)
    : size_(instructions.size()) {
  bit_vectors_.reserve(size_);
  for (const HloInstruction* hlo : instructions) {
    indices_[hlo] = bit_vectors_.size();
    bit_vectors_.emplace_back(size_);
  }
  CHECK_EQ(size_, indices_.size());  // instructions should be unique
}

bool HloReachabilityMap::SetReachabilityToUnion(
    absl::Span<const HloInstruction* const> inputs,
    const HloInstruction* instruction) {
  BitVector& bit_vector = GetBitVector(instruction);
  tmp_bit_vector_ = bit_vector;
  SetReachabilityToUnionHelper(inputs, instruction, &bit_vector);
  return bit_vector != tmp_bit_vector_;
}

void HloReachabilityMap::FastSetReachabilityToUnion(
    absl::Span<const HloInstruction* const> inputs,
    const HloInstruction* instruction) {
  SetReachabilityToUnionHelper(inputs, instruction, &GetBitVector(instruction));
}

void HloReachabilityMap::SetReachabilityToUnionHelper(
    absl::Span<const HloInstruction* const> inputs,
    const HloInstruction* instruction, BitVector* bit_vector) {
  // If instruction is part of inputs, don't reset the bit_vector.
  if (std::find(inputs.begin(), inputs.end(), instruction) == inputs.end()) {
    bit_vector->SetToZero();
  }
  bit_vector->Set(GetIndex(instruction));
  for (const HloInstruction* input : inputs) {
    bit_vector->OrWith(GetBitVector(input));
  }
}

void HloReachabilityMap::SetReachable(const HloInstruction* a,
                                      const HloInstruction* b) {
  GetBitVector(b).Set(GetIndex(a));
}

bool HloReachabilityMap::IsReachable(const HloInstruction* a,
                                     const HloInstruction* b) const {
  return GetBitVector(b).Get(GetIndex(a));
}

bool HloReachabilityMap::IsConnected(const HloInstruction* a,
                                     const HloInstruction* b) const {
  return IsReachable(a, b) || IsReachable(b, a);
}

}  // namespace xla


text:
package org.jitsi.impl.neomedia.jmfext.media.protocol;

import java.io.*;

import javax.media.*;
import javax.media.control.*;
import javax.media.protocol.*;

/**
 * Provides a base implementation of <tt>PullBufferStream</tt> for video in
 * order to facilitate implementers by taking care of boilerplate in the most
 * common cases.
 *
 * @author Lyubomir Marinov
 */
public abstract class AbstractVideoPullBufferStream
        <T extends PullBufferDataSource>
    extends AbstractPullBufferStream<T>
{

    /**
     * The output frame rate of this <tt>AbstractVideoPullBufferStream</tt>
     * which has been specified by {@link #frameRateControl} and depending on
     * which {@link #minimumVideoFrameInterval} has been calculated.
     */
    private float frameRate;

    /**
     * The <tt>FrameRateControl</tt> which gets and sets the output frame rate
     * of this <tt>AbstractVideoPullBufferStream</tt>.
     */
    private FrameRateControl frameRateControl;

    /**
     * The minimum interval in milliseconds between consecutive video frames
     * i.e. the reverse of {@link #frameRate}.
     */
    private long minimumVideoFrameInterval;

    /**
     * Initializes a new <tt>AbstractVideoPullBufferStream</tt> instance which
     * is to have its <tt>Format</tt>-related information abstracted by a
     * specific <tt>FormatControl</tt>.
     *
     * @param dataSource the <tt>PullBufferDataSource</tt> which is creating the
     * new instance so that it becomes one of its <tt>streams</tt>
     * @param formatControl the <tt>FormatControl</tt> which is to abstract the
     * <tt>Format</tt>-related information of the new instance
     */
    protected AbstractVideoPullBufferStream(
            T dataSource,
            FormatControl formatControl)
    {
        super(dataSource, formatControl);
    }

    /**
     * Blocks and reads into a <tt>Buffer</tt> from this
     * <tt>PullBufferStream</tt>.
     *
     * @param buffer the <tt>Buffer</tt> this <tt>PullBufferStream</tt> is to
     * read into
     * @throws IOException if an I/O error occurs while this
     * <tt>PullBufferStream</tt> reads into the specified <tt>Buffer</tt>
     */
    protected abstract void doRead(Buffer buffer)
        throws IOException;

    /**
     * Blocks and reads into a <tt>Buffer</tt> from this
     * <tt>PullBufferStream</tt>.
     *
     * @param buffer the <tt>Buffer</tt> this <tt>PullBufferStream</tt> is to
     * read into
     * @throws IOException if an I/O error occurs while this
     * <tt>PullBufferStream</tt> reads into the specified <tt>Buffer</tt>
     */
    public void read(Buffer buffer)
        throws IOException
    {
        FrameRateControl frameRateControl = this.frameRateControl;

        if (frameRateControl != null)
        {
            float frameRate = frameRateControl.getFrameRate();

            if (frameRate > 0)
            {
                if (this.frameRate != frameRate)
                {
                    minimumVideoFrameInterval = (long) (1000 / frameRate);
                    this.frameRate = frameRate;
                }
                if (minimumVideoFrameInterval > 0)
                {
                    long startTime = System.currentTimeMillis();

                    doRead(buffer);

                    if (!buffer.isDiscard())
                    {
                        boolean interrupted = false;

                        while (true)
                        {
                            // Sleep to respect the frame rate as much as possible.
                            long sleep
                                = minimumVideoFrameInterval
                                    - (System.currentTimeMillis() - startTime);

                            if (sleep > 0)
                            {
                                try
                                {
                                    Thread.sleep(sleep);
                                }
                                catch (InterruptedException ie)
                                {
                                    interrupted = true;
                                }
                            }
                            else
                            {
                                // Yield a little bit to not use all the whole CPU.
                                Thread.yield();
                                break;
                            }
                        }
                        if (interrupted)
                            Thread.currentThread().interrupt();
                    }

                    // We've executed #doRead(Buffer).
                    return;
                }
            }
        }

        // If there is no frame rate to be respected, just #doRead(Buffer).
        doRead(buffer);
    }

    /**
     * Starts the transfer of media data from this
     * <tt>AbstractBufferStream</tt>.
     *
     * @throws IOException if anything goes wrong while starting the transfer of
     * media data from this <tt>AbstractBufferStream</tt>
     * @see AbstractBufferStream#start()
     */
    @Override
    public void start()
        throws IOException
    {
        super.start();

        frameRateControl
            = (FrameRateControl)
                dataSource.getControl(FrameRateControl.class.getName());
    }

    /**
     * Stops the transfer of media data from this <tt>AbstractBufferStream</tt>.
     *
     * @throws IOException if anything goes wrong while stopping the transfer of
     * media data from this <tt>AbstractBufferStream</tt>
     * @see AbstractBufferStream#stop()
     */
    @Override
    public void stop()
        throws IOException
    {
        super.stop();

        frameRateControl = null;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
        xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
        jcr:primaryType="nt:unstructured"
        sling:resourceType="composum/nodes/browser/query/export"
        jcr:title="TSV file (tab separated)"
        jcr:description="a simple tab separated text file; see /libs/composum/nodes/browser/query/export/tsv"
        group="TXT"
        order="{Long}60"
        exportType="composum/nodes/browser/query/export/tsv"
        properties="[path;Path,jcr:title;Title,jcr:primaryType;Primary Type,sling:resourceType;Resource Type]"
        filename="query-export.tsv"/>


text:
// Package cmdutil exports shared logic for implementing command-line
// subcommands using the github.com/google/subcommands package.
package cmdutil

import (
	"context"
	"flag"
	"fmt"
	"log"
	"strings"

	"github.com/google/subcommands"
)

// Info implements the methods of the subcommands.Command interface that handle
// the command name and documentation. It also provides a noop default SetFlags
// method and a default Execute method that prints its usage and exits.
type Info struct {
	name     string
	synopsis string
	usage    string
}

// NewInfo constructs an Info that reports the specified arguments for command
// name, brief synopsis, and usage.
func NewInfo(name, synopsis, usage string) Info {
	if !strings.HasSuffix(usage, "\n") {
		usage += "\n"
	}
	return Info{name: name, synopsis: synopsis, usage: usage}
}

// Name implements part of subcommands.Command.
func (i Info) Name() string { return i.name }

// Synopsis implements part of subcommands.Command.
func (i Info) Synopsis() string { return i.synopsis }

// Usage implements part of subcommands.Command.
func (i Info) Usage() string { return i.usage + "\nOptions:\n" }

// SetFlags implements part of subcommands.Command.
func (i Info) SetFlags(*flag.FlagSet) {}

// Execute implements part of subcommands.Command.
// It prints the usage string to stdout and returns success.
func (i Info) Execute(context.Context, *flag.FlagSet, ...interface{}) subcommands.ExitStatus {
	fmt.Print(i.usage) // the undecorated usage string
	return subcommands.ExitSuccess
}

// Fail logs an error message and returns subcommands.ExitFailure.
func (i Info) Fail(msg string, args ...interface{}) subcommands.ExitStatus {
	log.Output(1, fmt.Sprintf(msg, args...))
	return subcommands.ExitFailure
}


text:
Centreon Status for Google Chrome™
==================================

Centreon Status is simple extension for Google Chrome™ that helps you watch
over your Centron instance.

Features
--------
- Support Centreon Broker or NDOUtils
- Show summary overview (pollers, hosts and services status)
- Show alert counter status (critical, warning, unreachable, unknown or ok)
- Ability to set data refresh interval

Contributors
------------
- Jorge Morgado (centreon-status (at) morgado (dot) ch)
- Based on the IcingaChromedStatus plugin (https://github.com/kepi/IcingaChromedStatus)

License
-------
This extension is released under [MIT License](http://en.wikipedia.org/wiki/MIT_License).


text:
/*************************************************************************/
/*  animation_blend_space_2d.cpp                                         */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "animation_blend_space_2d.h"
#include "core/math/delaunay.h"

void AnimationNodeBlendSpace2D::get_parameter_list(List<PropertyInfo> *r_list) const {
	r_list->push_back(PropertyInfo(Variant::VECTOR2, blend_position));
	r_list->push_back(PropertyInfo(Variant::INT, closest, PROPERTY_HINT_NONE, "", 0));
	r_list->push_back(PropertyInfo(Variant::REAL, length_internal, PROPERTY_HINT_NONE, "", 0));
}
Variant AnimationNodeBlendSpace2D::get_parameter_default_value(const StringName &p_parameter) const {
	if (p_parameter == closest) {
		return -1;
	} else if (p_parameter == length_internal) {
		return 0;
	} else {
		return Vector2();
	}
}

void AnimationNodeBlendSpace2D::get_child_nodes(List<ChildNode> *r_child_nodes) {
	for (int i = 0; i < blend_points_used; i++) {
		ChildNode cn;
		cn.name = itos(i);
		cn.node = blend_points[i].node;
		r_child_nodes->push_back(cn);
	}
}

void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_node, const Vector2 &p_position, int p_at_index) {
	ERR_FAIL_COND(blend_points_used >= MAX_BLEND_POINTS);
	ERR_FAIL_COND(p_node.is_null());
	ERR_FAIL_COND(p_at_index < -1 || p_at_index > blend_points_used);

	if (p_at_index == -1 || p_at_index == blend_points_used) {
		p_at_index = blend_points_used;
	} else {
		for (int i = blend_points_used - 1; i > p_at_index; i--) {
			blend_points[i] = blend_points[i - 1];
		}
		for (int i = 0; i < triangles.size(); i++) {
			for (int j = 0; j < 3; j++) {
				if (triangles[i].points[j] >= p_at_index) {
					triangles.write[i].points[j]++;
				}
			}
		}
	}
	blend_points[p_at_index].node = p_node;
	blend_points[p_at_index].position = p_position;

	blend_points[p_at_index].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
	blend_points_used++;

	_queue_auto_triangles();

	emit_signal("tree_changed");
}

void AnimationNodeBlendSpace2D::set_blend_point_position(int p_point, const Vector2 &p_position) {
	ERR_FAIL_INDEX(p_point, blend_points_used);
	blend_points[p_point].position = p_position;
	_queue_auto_triangles();
}
void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref<AnimationRootNode> &p_node) {
	ERR_FAIL_INDEX(p_point, blend_points_used);
	ERR_FAIL_COND(p_node.is_null());

	if (blend_points[p_point].node.is_valid()) {
		blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed");
	}
	blend_points[p_point].node = p_node;
	blend_points[p_point].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);

	emit_signal("tree_changed");
}
Vector2 AnimationNodeBlendSpace2D::get_blend_point_position(int p_point) const {
	ERR_FAIL_INDEX_V(p_point, blend_points_used, Vector2());
	return blend_points[p_point].position;
}
Ref<AnimationRootNode> AnimationNodeBlendSpace2D::get_blend_point_node(int p_point) const {
	ERR_FAIL_INDEX_V(p_point, blend_points_used, Ref<AnimationRootNode>());
	return blend_points[p_point].node;
}
void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) {
	ERR_FAIL_INDEX(p_point, blend_points_used);

	ERR_FAIL_COND(blend_points[p_point].node.is_null());
	blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed");

	for (int i = 0; i < triangles.size(); i++) {
		bool erase = false;
		for (int j = 0; j < 3; j++) {
			if (triangles[i].points[j] == p_point) {
				erase = true;
				break;
			} else if (triangles[i].points[j] > p_point) {
				triangles.write[i].points[j]--;
			}
		}
		if (erase) {
			triangles.remove(i);

			i--;
		}
	}

	for (int i = p_point; i < blend_points_used - 1; i++) {
		blend_points[i] = blend_points[i + 1];
	}
	blend_points_used--;
	emit_signal("tree_changed");
}

int AnimationNodeBlendSpace2D::get_blend_point_count() const {
	return blend_points_used;
}

bool AnimationNodeBlendSpace2D::has_triangle(int p_x, int p_y, int p_z) const {
	ERR_FAIL_INDEX_V(p_x, blend_points_used, false);
	ERR_FAIL_INDEX_V(p_y, blend_points_used, false);
	ERR_FAIL_INDEX_V(p_z, blend_points_used, false);

	BlendTriangle t;
	t.points[0] = p_x;
	t.points[1] = p_y;
	t.points[2] = p_z;

	SortArray<int> sort;
	sort.sort(t.points, 3);

	for (int i = 0; i < triangles.size(); i++) {
		bool all_equal = true;
		for (int j = 0; j < 3; j++) {
			if (triangles[i].points[j] != t.points[j]) {
				all_equal = false;
				break;
			}
		}
		if (all_equal) {
			return true;
		}
	}

	return false;
}

void AnimationNodeBlendSpace2D::add_triangle(int p_x, int p_y, int p_z, int p_at_index) {
	ERR_FAIL_INDEX(p_x, blend_points_used);
	ERR_FAIL_INDEX(p_y, blend_points_used);
	ERR_FAIL_INDEX(p_z, blend_points_used);

	_update_triangles();

	BlendTriangle t;
	t.points[0] = p_x;
	t.points[1] = p_y;
	t.points[2] = p_z;

	SortArray<int> sort;
	sort.sort(t.points, 3);

	for (int i = 0; i < triangles.size(); i++) {
		bool all_equal = true;
		for (int j = 0; j < 3; j++) {
			if (triangles[i].points[j] != t.points[j]) {
				all_equal = false;
				break;
			}
		}
		ERR_FAIL_COND(all_equal);
	}

	if (p_at_index == -1 || p_at_index == triangles.size()) {
		triangles.push_back(t);
	} else {
		triangles.insert(p_at_index, t);
	}
}
int AnimationNodeBlendSpace2D::get_triangle_point(int p_triangle, int p_point) {
	_update_triangles();

	ERR_FAIL_INDEX_V(p_point, 3, -1);
	ERR_FAIL_INDEX_V(p_triangle, triangles.size(), -1);
	return triangles[p_triangle].points[p_point];
}
void AnimationNodeBlendSpace2D::remove_triangle(int p_triangle) {
	ERR_FAIL_INDEX(p_triangle, triangles.size());

	triangles.remove(p_triangle);
}

int AnimationNodeBlendSpace2D::get_triangle_count() const {
	return triangles.size();
}

void AnimationNodeBlendSpace2D::set_min_space(const Vector2 &p_min) {
	min_space = p_min;
	if (min_space.x >= max_space.x) {
		min_space.x = max_space.x - 1;
	}
	if (min_space.y >= max_space.y) {
		min_space.y = max_space.y - 1;
	}
}
Vector2 AnimationNodeBlendSpace2D::get_min_space() const {
	return min_space;
}

void AnimationNodeBlendSpace2D::set_max_space(const Vector2 &p_max) {
	max_space = p_max;
	if (max_space.x <= min_space.x) {
		max_space.x = min_space.x + 1;
	}
	if (max_space.y <= min_space.y) {
		max_space.y = min_space.y + 1;
	}
}
Vector2 AnimationNodeBlendSpace2D::get_max_space() const {
	return max_space;
}

void AnimationNodeBlendSpace2D::set_snap(const Vector2 &p_snap) {
	snap = p_snap;
}
Vector2 AnimationNodeBlendSpace2D::get_snap() const {
	return snap;
}

void AnimationNodeBlendSpace2D::set_x_label(const String &p_label) {
	x_label = p_label;
}
String AnimationNodeBlendSpace2D::get_x_label() const {
	return x_label;
}

void AnimationNodeBlendSpace2D::set_y_label(const String &p_label) {
	y_label = p_label;
}
String AnimationNodeBlendSpace2D::get_y_label() const {
	return y_label;
}

void AnimationNodeBlendSpace2D::_add_blend_point(int p_index, const Ref<AnimationRootNode> &p_node) {
	if (p_index == blend_points_used) {
		add_blend_point(p_node, Vector2());
	} else {
		set_blend_point_node(p_index, p_node);
	}
}

void AnimationNodeBlendSpace2D::_set_triangles(const Vector<int> &p_triangles) {
	if (auto_triangles) {
		return;
	}
	ERR_FAIL_COND(p_triangles.size() % 3 != 0);
	for (int i = 0; i < p_triangles.size(); i += 3) {
		add_triangle(p_triangles[i + 0], p_triangles[i + 1], p_triangles[i + 2]);
	}
}

Vector<int> AnimationNodeBlendSpace2D::_get_triangles() const {
	Vector<int> t;
	if (auto_triangles && trianges_dirty) {
		return t;
	}

	t.resize(triangles.size() * 3);
	for (int i = 0; i < triangles.size(); i++) {
		t.write[i * 3 + 0] = triangles[i].points[0];
		t.write[i * 3 + 1] = triangles[i].points[1];
		t.write[i * 3 + 2] = triangles[i].points[2];
	}
	return t;
}

void AnimationNodeBlendSpace2D::_queue_auto_triangles() {
	if (!auto_triangles || trianges_dirty) {
		return;
	}

	trianges_dirty = true;
	call_deferred("_update_triangles");
}

void AnimationNodeBlendSpace2D::_update_triangles() {
	if (!auto_triangles || !trianges_dirty) {
		return;
	}

	trianges_dirty = false;
	triangles.clear();
	if (blend_points_used < 3) {
		emit_signal("triangles_updated");
		return;
	}

	Vector<Vector2> points;
	points.resize(blend_points_used);
	for (int i = 0; i < blend_points_used; i++) {
		points.write[i] = blend_points[i].position;
	}

	Vector<Delaunay2D::Triangle> triangles = Delaunay2D::triangulate(points);

	for (int i = 0; i < triangles.size(); i++) {
		add_triangle(triangles[i].points[0], triangles[i].points[1], triangles[i].points[2]);
	}
	emit_signal("triangles_updated");
}

Vector2 AnimationNodeBlendSpace2D::get_closest_point(const Vector2 &p_point) {
	_update_triangles();

	if (triangles.size() == 0) {
		return Vector2();
	}

	Vector2 best_point;
	bool first = true;

	for (int i = 0; i < triangles.size(); i++) {
		Vector2 points[3];
		for (int j = 0; j < 3; j++) {
			points[j] = get_blend_point_position(get_triangle_point(i, j));
		}

		if (Geometry::is_point_in_triangle(p_point, points[0], points[1], points[2])) {
			return p_point;
		}

		for (int j = 0; j < 3; j++) {
			Vector2 s[2] = {
				points[j],
				points[(j + 1) % 3]
			};
			Vector2 closest = Geometry::get_closest_point_to_segment_2d(p_point, s);
			if (first || closest.distance_to(p_point) < best_point.distance_to(p_point)) {
				best_point = closest;
				first = false;
			}
		}
	}

	return best_point;
}

void AnimationNodeBlendSpace2D::_blend_triangle(const Vector2 &p_pos, const Vector2 *p_points, float *r_weights) {
	if (p_pos.distance_squared_to(p_points[0]) < CMP_EPSILON2) {
		r_weights[0] = 1;
		r_weights[1] = 0;
		r_weights[2] = 0;
		return;
	}
	if (p_pos.distance_squared_to(p_points[1]) < CMP_EPSILON2) {
		r_weights[0] = 0;
		r_weights[1] = 1;
		r_weights[2] = 0;
		return;
	}
	if (p_pos.distance_squared_to(p_points[2]) < CMP_EPSILON2) {
		r_weights[0] = 0;
		r_weights[1] = 0;
		r_weights[2] = 1;
		return;
	}

	Vector2 v0 = p_points[1] - p_points[0];
	Vector2 v1 = p_points[2] - p_points[0];
	Vector2 v2 = p_pos - p_points[0];

	float d00 = v0.dot(v0);
	float d01 = v0.dot(v1);
	float d11 = v1.dot(v1);
	float d20 = v2.dot(v0);
	float d21 = v2.dot(v1);
	float denom = (d00 * d11 - d01 * d01);
	if (denom == 0) {
		r_weights[0] = 1;
		r_weights[1] = 0;
		r_weights[2] = 0;
		return;
	}
	float v = (d11 * d20 - d01 * d21) / denom;
	float w = (d00 * d21 - d01 * d20) / denom;
	float u = 1.0f - v - w;

	r_weights[0] = u;
	r_weights[1] = v;
	r_weights[2] = w;
}

float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
	_update_triangles();

	Vector2 blend_pos = get_parameter(blend_position);
	int closest = get_parameter(this->closest);
	float length_internal = get_parameter(this->length_internal);
	float mind = 0; //time of min distance point

	if (blend_mode == BLEND_MODE_INTERPOLATED) {
		if (triangles.size() == 0) {
			return 0;
		}

		Vector2 best_point;
		bool first = true;
		int blend_triangle = -1;
		float blend_weights[3] = { 0, 0, 0 };

		for (int i = 0; i < triangles.size(); i++) {
			Vector2 points[3];
			for (int j = 0; j < 3; j++) {
				points[j] = get_blend_point_position(get_triangle_point(i, j));
			}

			if (Geometry::is_point_in_triangle(blend_pos, points[0], points[1], points[2])) {
				blend_triangle = i;
				_blend_triangle(blend_pos, points, blend_weights);
				break;
			}

			for (int j = 0; j < 3; j++) {
				Vector2 s[2] = {
					points[j],
					points[(j + 1) % 3]
				};
				Vector2 closest2 = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
				if (first || closest2.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
					best_point = closest2;
					blend_triangle = i;
					first = false;
					float d = s[0].distance_to(s[1]);
					if (d == 0.0) {
						blend_weights[j] = 1.0;
						blend_weights[(j + 1) % 3] = 0.0;
						blend_weights[(j + 2) % 3] = 0.0;
					} else {
						float c = s[0].distance_to(closest2) / d;

						blend_weights[j] = 1.0 - c;
						blend_weights[(j + 1) % 3] = c;
						blend_weights[(j + 2) % 3] = 0.0;
					}
				}
			}
		}

		ERR_FAIL_COND_V(blend_triangle == -1, 0); //should never reach here

		int triangle_points[3];
		for (int j = 0; j < 3; j++) {
			triangle_points[j] = get_triangle_point(blend_triangle, j);
		}

		first = true;

		for (int i = 0; i < blend_points_used; i++) {
			bool found = false;
			for (int j = 0; j < 3; j++) {
				if (i == triangle_points[j]) {
					//blend with the given weight
					float t = blend_node(blend_points[i].name, blend_points[i].node, p_time, p_seek, blend_weights[j], FILTER_IGNORE, false);
					if (first || t < mind) {
						mind = t;
						first = false;
					}
					found = true;
					break;
				}
			}

			if (!found) {
				//ignore
				blend_node(blend_points[i].name, blend_points[i].node, p_time, p_seek, 0, FILTER_IGNORE, false);
			}
		}
	} else {
		int new_closest = -1;
		float new_closest_dist = 1e20;

		for (int i = 0; i < blend_points_used; i++) {
			float d = blend_points[i].position.distance_squared_to(blend_pos);
			if (d < new_closest_dist) {
				new_closest = i;
				new_closest_dist = d;
			}
		}

		if (new_closest != closest && new_closest != -1) {
			float from = 0;
			if (blend_mode == BLEND_MODE_DISCRETE_CARRY && closest != -1) {
				//see how much animation remains
				from = length_internal - blend_node(blend_points[closest].name, blend_points[closest].node, p_time, false, 0.0, FILTER_IGNORE, false);
			}

			mind = blend_node(blend_points[new_closest].name, blend_points[new_closest].node, from, true, 1.0, FILTER_IGNORE, false);
			length_internal = from + mind;

			closest = new_closest;

		} else {
			mind = blend_node(blend_points[closest].name, blend_points[closest].node, p_time, p_seek, 1.0, FILTER_IGNORE, false);
		}
	}

	set_parameter(this->closest, closest);
	set_parameter(this->length_internal, length_internal);
	return mind;
}

String AnimationNodeBlendSpace2D::get_caption() const {
	return "BlendSpace2D";
}

void AnimationNodeBlendSpace2D::_validate_property(PropertyInfo &property) const {
	if (auto_triangles && property.name == "triangles") {
		property.usage = 0;
	}
	if (property.name.begins_with("blend_point_")) {
		String left = property.name.get_slicec('/', 0);
		int idx = left.get_slicec('_', 2).to_int();
		if (idx >= blend_points_used) {
			property.usage = 0;
		}
	}
	AnimationRootNode::_validate_property(property);
}

void AnimationNodeBlendSpace2D::set_auto_triangles(bool p_enable) {
	if (auto_triangles == p_enable) {
		return;
	}

	auto_triangles = p_enable;
	_queue_auto_triangles();
}

bool AnimationNodeBlendSpace2D::get_auto_triangles() const {
	return auto_triangles;
}

Ref<AnimationNode> AnimationNodeBlendSpace2D::get_child_by_name(const StringName &p_name) {
	return get_blend_point_node(p_name.operator String().to_int());
}

void AnimationNodeBlendSpace2D::_tree_changed() {
	emit_signal("tree_changed");
}

void AnimationNodeBlendSpace2D::set_blend_mode(BlendMode p_blend_mode) {
	blend_mode = p_blend_mode;
}

AnimationNodeBlendSpace2D::BlendMode AnimationNodeBlendSpace2D::get_blend_mode() const {
	return blend_mode;
}

void AnimationNodeBlendSpace2D::_bind_methods() {
	ClassDB::bind_method(D_METHOD("add_blend_point", "node", "pos", "at_index"), &AnimationNodeBlendSpace2D::add_blend_point, DEFVAL(-1));
	ClassDB::bind_method(D_METHOD("set_blend_point_position", "point", "pos"), &AnimationNodeBlendSpace2D::set_blend_point_position);
	ClassDB::bind_method(D_METHOD("get_blend_point_position", "point"), &AnimationNodeBlendSpace2D::get_blend_point_position);
	ClassDB::bind_method(D_METHOD("set_blend_point_node", "point", "node"), &AnimationNodeBlendSpace2D::set_blend_point_node);
	ClassDB::bind_method(D_METHOD("get_blend_point_node", "point"), &AnimationNodeBlendSpace2D::get_blend_point_node);
	ClassDB::bind_method(D_METHOD("remove_blend_point", "point"), &AnimationNodeBlendSpace2D::remove_blend_point);
	ClassDB::bind_method(D_METHOD("get_blend_point_count"), &AnimationNodeBlendSpace2D::get_blend_point_count);

	ClassDB::bind_method(D_METHOD("add_triangle", "x", "y", "z", "at_index"), &AnimationNodeBlendSpace2D::add_triangle, DEFVAL(-1));
	ClassDB::bind_method(D_METHOD("get_triangle_point", "triangle", "point"), &AnimationNodeBlendSpace2D::get_triangle_point);
	ClassDB::bind_method(D_METHOD("remove_triangle", "triangle"), &AnimationNodeBlendSpace2D::remove_triangle);
	ClassDB::bind_method(D_METHOD("get_triangle_count"), &AnimationNodeBlendSpace2D::get_triangle_count);

	ClassDB::bind_method(D_METHOD("set_min_space", "min_space"), &AnimationNodeBlendSpace2D::set_min_space);
	ClassDB::bind_method(D_METHOD("get_min_space"), &AnimationNodeBlendSpace2D::get_min_space);

	ClassDB::bind_method(D_METHOD("set_max_space", "max_space"), &AnimationNodeBlendSpace2D::set_max_space);
	ClassDB::bind_method(D_METHOD("get_max_space"), &AnimationNodeBlendSpace2D::get_max_space);

	ClassDB::bind_method(D_METHOD("set_snap", "snap"), &AnimationNodeBlendSpace2D::set_snap);
	ClassDB::bind_method(D_METHOD("get_snap"), &AnimationNodeBlendSpace2D::get_snap);

	ClassDB::bind_method(D_METHOD("set_x_label", "text"), &AnimationNodeBlendSpace2D::set_x_label);
	ClassDB::bind_method(D_METHOD("get_x_label"), &AnimationNodeBlendSpace2D::get_x_label);

	ClassDB::bind_method(D_METHOD("set_y_label", "text"), &AnimationNodeBlendSpace2D::set_y_label);
	ClassDB::bind_method(D_METHOD("get_y_label"), &AnimationNodeBlendSpace2D::get_y_label);

	ClassDB::bind_method(D_METHOD("_add_blend_point", "index", "node"), &AnimationNodeBlendSpace2D::_add_blend_point);

	ClassDB::bind_method(D_METHOD("_set_triangles", "triangles"), &AnimationNodeBlendSpace2D::_set_triangles);
	ClassDB::bind_method(D_METHOD("_get_triangles"), &AnimationNodeBlendSpace2D::_get_triangles);

	ClassDB::bind_method(D_METHOD("set_auto_triangles", "enable"), &AnimationNodeBlendSpace2D::set_auto_triangles);
	ClassDB::bind_method(D_METHOD("get_auto_triangles"), &AnimationNodeBlendSpace2D::get_auto_triangles);

	ClassDB::bind_method(D_METHOD("set_blend_mode", "mode"), &AnimationNodeBlendSpace2D::set_blend_mode);
	ClassDB::bind_method(D_METHOD("get_blend_mode"), &AnimationNodeBlendSpace2D::get_blend_mode);

	ClassDB::bind_method(D_METHOD("_tree_changed"), &AnimationNodeBlendSpace2D::_tree_changed);
	ClassDB::bind_method(D_METHOD("_update_triangles"), &AnimationNodeBlendSpace2D::_update_triangles);

	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_auto_triangles", "get_auto_triangles");

	for (int i = 0; i < MAX_BLEND_POINTS; i++) {
		ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "blend_point_" + itos(i) + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_add_blend_point", "get_blend_point_node", i);
		ADD_PROPERTYI(PropertyInfo(Variant::VECTOR2, "blend_point_" + itos(i) + "/pos", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_blend_point_position", "get_blend_point_position", i);
	}

	ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_triangles", "_get_triangles");

	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "min_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_min_space", "get_min_space");
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "max_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_max_space", "get_max_space");
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "snap", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_snap", "get_snap");
	ADD_PROPERTY(PropertyInfo(Variant::STRING, "x_label", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_x_label", "get_x_label");
	ADD_PROPERTY(PropertyInfo(Variant::STRING, "y_label", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_y_label", "get_y_label");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "blend_mode", PROPERTY_HINT_ENUM, "Interpolated,Discrete,Carry", PROPERTY_USAGE_NOEDITOR), "set_blend_mode", "get_blend_mode");

	ADD_SIGNAL(MethodInfo("triangles_updated"));
	BIND_ENUM_CONSTANT(BLEND_MODE_INTERPOLATED);
	BIND_ENUM_CONSTANT(BLEND_MODE_DISCRETE);
	BIND_ENUM_CONSTANT(BLEND_MODE_DISCRETE_CARRY);
}

AnimationNodeBlendSpace2D::AnimationNodeBlendSpace2D() {
	for (int i = 0; i < MAX_BLEND_POINTS; i++) {
		blend_points[i].name = itos(i);
	}
	auto_triangles = true;
	blend_points_used = 0;
	max_space = Vector2(1, 1);
	min_space = Vector2(-1, -1);
	snap = Vector2(0.1, 0.1);
	x_label = "x";
	y_label = "y";
	trianges_dirty = false;
	blend_position = "blend_position";
	closest = "closest";
	length_internal = "length_internal";
	blend_mode = BLEND_MODE_INTERPOLATED;
}

AnimationNodeBlendSpace2D::~AnimationNodeBlendSpace2D() {
}


text:
var Walk = require('./walk.js');
var TestSuite = require('./testsuite.js');
var Logger = require('../util/logger.js');
var Reporter = require('./reporter.js');
var path = require('path');
var Q = require('q');

var globalResults;
var currentTestSuite;
var finishCallback;

function processListener() {
  process.on('exit', function (code) {
    var exitCode = code;

    if (exitCode === 0 && globalResults && (globalResults.errors > 0 || globalResults.failed > 0)) {
      exitCode = 1;
    }

    process.exit(exitCode);
  });

  process.on('uncaughtException', function (err) {
    if (currentTestSuite) {
      var testCase = currentTestSuite.getCurrentTestCase();
      if (testCase/* && testCase.running*/) {
        testCase.catchHandler(err);
        return;
      }
    }

    if (finishCallback) {
      finishCallback(err);
    } else {
      console.log(err);
    }
  });
}

function Runner(testSource, opts, additionalOpts, doneCb) {
  this.testSource = testSource || [];
  this.options = opts;
  this.additionalOpts = additionalOpts;
  this.doneCb = doneCb || function() {};
  this.globalStartTime = new Date().getTime();
  this.currentTestSuite = null;
  globalResults = this.globalResults = {
    passed : 0,
    failed : 0,
    errors : 0,
    skipped : 0,
    tests : 0,
    errmessages : [],
    modules : {}
  };

  this.setOptions();
}

Runner.setFinishCallback = function(cb) {
  finishCallback = cb;
};

Runner.prototype.setOptions = function() {
  this.options.parallelMode = process.env.__NIGHTWATCH_PARALLEL_MODE == '1';
  if (this.options.parallelMode) {
    this.options.currentEnv = process.env.__NIGHTWATCH_ENV_KEY;
  }
  this.options.live_output = this.additionalOpts.live_output;
  this.options.detailed_output = this.additionalOpts.detailed_output;
  this.options.start_session = this.additionalOpts.start_session;
  this.options.report_prefix = '';
  this.options.test_worker = this.additionalOpts.test_worker;
};

Runner.prototype.runTestModule = function(modulePath, fullPaths) {
  try {
    currentTestSuite = this.currentTestSuite = new TestSuite(modulePath, fullPaths, this.options, this.additionalOpts, this.doneCb);
  } catch (err) {
    this.doneCb(err);
    return null;
  }

  var moduleKey = this.currentTestSuite.getReportKey();

  this.globalResults.modules[moduleKey] = {
    completed : {},
    skipped : null,
    time : null,
    timestamp : null,
    group : this.currentTestSuite.getGroupName()
  };

  return this.currentTestSuite
    .on('testcase:finished', function(results, errors, time) {
      var tests = this.globalResults.modules[moduleKey].completed[this.currentTestSuite.currentTest] = {
        passed  : results.passed,
        failed  : results.failed,
        errors  : results.errors,
        skipped : results.skipped,
        assertions  : [].concat(results.tests),
        timeMs : time,
        time : (time/1000).toPrecision(4),
        stackTrace : results.stackTrace
      };

      if (Array.isArray(errors) && errors.length) {
        this.globalResults.errmessages = this.globalResults.errmessages.concat(errors);
      }

      this.globalResults.passed += results.passed;
      this.globalResults.failed += results.failed;
      this.globalResults.errors += results.errors;
      this.globalResults.skipped += results.skipped;
      this.globalResults.tests += results.tests.length;

      this.globalResults.assertions = this.globalResults.tests;

      if (this.options.output && this.options.detailed_output &&
        (this.options.modulesNo > 1 || results.tests !== this.globalResults.tests || results.steps.length > 1)
      ) {
        this.currentTestSuite.printResult(time);
      } else if (this.options.output && !this.options.detailed_output) {

        var error = (results.failed > 0 || results.errors > 0) ? new Error('') : null;
        console.log(Reporter.getTestOutput(error, this.currentTestSuite.currentTest, time));

        if (error !== null) {
          Reporter.printAssertions(tests);
        }
      }

    }.bind(this))
    .run()
    .then(function onTestSuiteResolved(testResults) {
      var testSuiteResult = this.globalResults.modules[moduleKey];
      testSuiteResult.skipped = testResults.steps;
      testSuiteResult.timestamp = testResults.timestamp;
      testSuiteResult.time = (testResults.time/1000).toPrecision(4);
      testSuiteResult.tests = Object.keys(testSuiteResult.completed).length + (testSuiteResult.skipped && testSuiteResult.skipped.length || 0);

      var failures = 0;
      var errors = testResults.errors || 0;
      Object.keys(testSuiteResult.completed).forEach(function(item) {
        if (testSuiteResult.completed[item].failed > 0) {
          failures++;
        }
      });

      testSuiteResult.errmessages = testResults.errmessages || [];
      testSuiteResult.failures = failures;
      testSuiteResult.errors = errors;
      if (typeof process.send == 'function') {
        process.send(JSON.stringify({
          type: 'testsuite_finished',
          itemKey: process.env.__NIGHTWATCH_ENV_LABEL,
          moduleKey: moduleKey,
          results: this.globalResults.modules[moduleKey],
          errmessages: testSuiteResult.errmessages,
          passed: this.globalResults.passed,
          failed: this.globalResults.failed,
          errors: this.globalResults.errors,
          skipped: this.globalResults.skipped,
          tests: this.globalResults.tests
        }));
      }

      return testResults;
    }.bind(this));
};

Runner.readPaths = function(testSource, opts, cb) {
  var deferred = Q.defer();
  cb = cb || function() {};

  if (typeof testSource == 'string') {
    testSource = [testSource];
  }

  var fullPaths = testSource.map(function (p) {
    if (p.indexOf(process.cwd()) === 0 || path.resolve(p) === p) {
      return p;
    }

    return path.join(process.cwd(), p);
  });

  if (fullPaths.length === 0) {
    throw new Error('No source folder defined. Check configuration.');
  }

  var errorMessage = ['No tests defined! using source folder:', fullPaths];
  if (opts.tag_filter) {
    errorMessage.push('; using tags:', opts.tag_filter);
  }

  Walk.readPaths(fullPaths, function (err, modules) {
    if (err) {
      if (err.code == 'ENOENT') {
        var error = new Error('Cannot read source folder: ' + err.path);
        cb(error, false);
        deferred.reject(error);
        return;
      }
      cb(err, false);
      deferred.reject(err);
      return;
    }

    opts.modulesNo = modules.length;

    if (modules.length === 0) {
      var error2 = new Error(errorMessage.join(' '));
      cb(error2);
      deferred.reject(error2);
      return;
    }

    cb(null, modules, fullPaths);
    deferred.resolve([modules, fullPaths]);
  }, opts);

  return deferred.promise;
};

Runner.prototype.run = function runner() {
  var deferred = Q.defer();
  var self = this;

  finishCallback = this.doneCb;

  Runner.readPaths(this.testSource, this.options)
    .spread(function(modulePaths, fullPaths) {

      (function runNextModule() {
        var modulePath = modulePaths.shift();
        var promise = self.runTestModule(modulePath, fullPaths);

        if (promise === null) {
          deferred.resolve();
          return;
        }

        promise.then(function(testResults) {
          if (modulePaths.length) {
            setImmediate(runNextModule);
          } else {
            var reporter = new Reporter(self.globalResults, testResults, self.globalStartTime, {
              output_folder : self.additionalOpts.output_folder,
              filename_prefix : self.options.report_prefix,
              globals : self.options.globals,
              reporter : self.additionalOpts.reporter,
              start_session : self.options.start_session
            });

            if (self.options.output) {
              reporter.printTotalResults(self.globalResults, testResults);
            }

            reporter.save().then(function() {
              reporter.globalReporter(self.options.globals)(self.globalResults, function() {
                try {
                  self.doneCb(null, self.globalResults);
                  deferred.resolve(self.globalResults);
                } catch (err) {
                  deferred.reject(err);
                }
              });
            }, function(err) {
              console.log(Logger.colors.yellow('Output folder doesn\'t exist and cannot be created.'));
              console.log(err.stack);
              self.doneCb(null);
              deferred.resolve();
            });
          }
        }, function(err) {
          self.doneCb(err, self.globalResults);
        }).catch(function(err) {
          deferred.reject(err);
        });
      })();
    })
    .catch(function(err) {
      self.doneCb(err, false);
    })
    .catch(function(err) {
      deferred.reject(err);
    });

  return deferred.promise;
};

processListener();

module.exports = Runner;


text:
run: Calculator
	java Calculator
Calculator: Calculator_java
	javac *.java
Calculator_java: calculator.jj
	javacc calculator.jj
clean:
	rm -f *.class *.java


text:
\clearpage
\phantomsection
\addcontentsline{toc}{subsection}{distpatchaddr}
\label{vars:dispatchaddr}
\subsection*{dispatchaddr:}

\subsubsection*{Description}

The \verb|dispatchaddr| variable is \emph{only} available on Darwin kernels
at the time of this writing.


text:
/*
 Create a function that:
 *   **Takes** an array of animals
 *   Each animal has propeties `name`, `species` and `legsCount`
 *   **groups** the animals by `species`
 *   the groups are sorted by `species` descending
 *   **sorts** them ascending by `legsCount`
 *	if two animals have the same number of legs sort them by name
 *   **prints** them to the console in the format:
 ```
 ----------- (number of dashes is equal to the length of the GROUP_1_NAME + 1)
 GROUP_1_NAME:
 ----------- (number of dashes is equal to the length of the GROUP_1_NAME + 1)
 NAME has LEGS_COUNT legs //for the first animal in group 1
 NAME has LEGS_COUNT legs //for the second animal in group 1
 ----------- (number of dashes is equal to the length of the GROUP_2_NAME + 1)
 GROUP_2_NAME:
 ----------- (number of dashes is equal to the length of the GROUP_2_NAME + 1)
 NAME has LEGS_COUNT legs //for the first animal in the group 2
 NAME has LEGS_COUNT legs //for the second animal in the group 2
 NAME has LEGS_COUNT legs //for the third animal in the group 2
 NAME has LEGS_COUNT legs //for the fourth animal in the group 2
 ```
 *   **Use underscore.js for all operations**
 */

function solve(){
 return function (animals) {
  var speciesOfAnimals = _.chain(animals)
      .sortBy('species')
      .reverse()
      .groupBy(function(a){
       return a.species;
      })
      .value();

  _.each(speciesOfAnimals, function(groupOfAnimals, group) {
   var numberOfLegs = _.chain(groupOfAnimals)
       .sortBy('legsCount')
       .sortBy(numberOfLegs, 'name')
       .value();

   console.log(Array(group.length + 2).join('-'));
   console.log(group + ':');
   console.log(Array(group.length + 2).join('-'));

   _.each(numberOfLegs, function(animal) {
    console.log(animal.name + ' has ' + animal.legsCount + ' legs');
   })
  });
 }
}
module.exports = solve;


text:
CREATE ALIAS GETUTCDATE AS $$

Timestamp getUtcDate() {
  return new Timestamp(System.currentTimeMillis());
}
$$;


text:
    sim_settings_and_status(scope=visualization);

Computing plot range across frames...

Computing plot range across frames...


text:
using System;
using System.Collections.Generic;
using System.IO;

namespace Semmle.Extraction.CIL
{
    /// <summary>
    /// An entity that needs to be populated during extraction.
    /// This assigns a key and optionally extracts its contents.
    /// </summary>
    internal abstract class LabelledEntity : Extraction.LabelledEntity, IExtractedEntity
    {
        public override Context Context => (Context)base.Context;

        protected LabelledEntity(Context cx) : base(cx)
        {
        }

        public override Microsoft.CodeAnalysis.Location ReportingLocation => throw new NotImplementedException();

        public void Extract(Context cx2)
        {
            cx2.Populate(this);
        }

        public override string ToString()
        {
            using var writer = new EscapingTextWriter();
            WriteQuotedId(writer);
            return writer.ToString();
        }

        public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;

        public abstract IEnumerable<IExtractionProduct> Contents { get; }
    }
}


text:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" height="0px">
  <defs>
    <filter id="dropshadow" height="130%" width="130%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="3"/>
      <feOffset dx="3" dy="3" result="offsetblur"/>
      <feComponentTransfer>
        <feFuncA type="linear" slope="1"/>
      </feComponentTransfer>
      <feMerge>
        <feMergeNode/>
        <feMergeNode in="SourceGraphic"/>
      </feMerge>
    </filter>
  </defs>
</svg>


text:
using EA4S.API;
using System.Collections.Generic;

namespace EA4S
{
    /// <summary>
    /// Handles the logic to launch minigames with the correct configuration.
    /// </summary>
    public class MiniGameLauncher
    {
        private QuestionPacksGenerator questionPacksGenerator;
        private TeacherAI teacher;

        public MiniGameLauncher(TeacherAI _teacher)
        {
            teacher = _teacher;
            questionPacksGenerator = new QuestionPacksGenerator();
        }

        public void LaunchGame(MiniGameCode miniGameCode)
        {
            float difficulty = teacher.GetCurrentDifficulty(miniGameCode);
            GameConfiguration configuration = new GameConfiguration(difficulty);
            MiniGameAPI.Instance.StartGame(miniGameCode, configuration);
        }

        public List<IQuestionPack> RetrieveQuestionPacks(IQuestionBuilder builder)
        {
            return questionPacksGenerator.GenerateQuestionPacks(builder);
        }

    }

}


text:
/* Use of this source code is governed by a BSD-style */
/* license that can be found in the LICENSE file. */

.vanadium-solarized-light {
  background-color: var(--codebox-color);
  color: var(--text-base00);
}

.vanadium-solarized-light .ace_gutter {
  background-color: color(var(--codebox-color) shade(5%));
  color: var(--text-base1);
}

.vanadium-solarized-light .ace_print-margin {
  width: 1px;
  background-color: color(var(--text-base1) tint(20%));
}

.vanadium-solarized-light .ace_cursor {
  color: var(--text-base03);
}

.vanadium-solarized-light .ace_marker-layer .ace_selection {
  background-color: color(var(--text-base2) shade(5%));
  color: var(--text-base1);
}

.vanadium-solarized-light.ace_multiselect .ace_selection.ace_start {
  box-shadow: 0 0 3px 0px magenta;
  border-radius: 2px;
}

.vanadium-solarized-light .ace_marker-layer .ace_step {
  background-color: magenta;
}

.vanadium-solarized-light .ace_marker-layer .ace_bracket {
  margin: -1px 0 0 -1px;
  border: 1px solid var(--text-base1);
}

.vanadium-solarized-light .ace_marker-layer .ace_active-line {
  background-color: color(var(--codebox-color) shade(5%));
}
.vanadium-solarized-light .ace_gutter-active-line {
  background-color : color(var(--text-base2) shade(5%));
}
.vanadium-solarized-light .ace_marker-layer .ace_selected-word {
  border: 1px solid var(--text-base2);
}

.vanadium-solarized-light .ace_invisible {
  color: color(var(--text-base1) tint(20%));
}

.vanadium-solarized-light .ace_keyword,
.vanadium-solarized-light .ace_meta,
.vanadium-solarized-light .ace_support.ace_class,
.vanadium-solarized-light .ace_support.ace_type {
  color: var(--text-green);
}
.vanadium-solarized-light .ace_constant.ace_character,
.vanadium-solarized-light .ace_constant.ace_other {
  color: var(--text-red);
}
.vanadium-solarized-light .ace_constant.ace_language {
  color: var(--text-yellow);
}
.vanadium-solarized-light .ace_constant.ace_numeric {
  color: var(--text-magenta);
}
.vanadium-solarized-light .ace_fold {
  background-color: var(--text-blue);
  border-color: var(--text-magenta);
}
.vanadium-solarized-light .ace_entity.ace_name.ace_function,
.vanadium-solarized-light .ace_entity.ace_name.ace_tag,
.vanadium-solarized-light .ace_support.ace_function,
.vanadium-solarized-light .ace_variable,
.vanadium-solarized-light .ace_variable.ace_language {
  color: var(--text-cyan);
}

.vanadium-solarized-light .ace_identifier {
  color: var(--text-base01);
}

.vanadium-solarized-light .ace_storage {
  color: var(--text-green);
}
.vanadium-solarized-light .ace_string {
  color: var(--text-blue);
}
.vanadium-solarized-light .ace_string.ace_regexp {
  color: var(--text-red);
}
.vanadium-solarized-light .ace_comment,
.vanadium-solarized-light .ace_entity.ace_other.ace_attribute-name {
  color: var(--text-base1);
}
.vanadium-solarized-light .ace_indent-guide {
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y
}