text:
<?php

namespace IPS\core\modules\setup\upgrade;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Upgrader: Login
 */
class _login extends \IPS\Dispatcher\Controller
{
	/**
	 * Show login form and/or process login form
	 *
	 * @todo	[Upgrade] Will also need to account for things in the input (e.g. password) that would be replaced, like & to &
	 * @return	void
	 */
	public function manage()
	{
		/* Clear previous session data */
		if( !isset( \IPS\Request::i()->sessionCheck ) AND count( $_SESSION ) )
		{
			foreach( $_SESSION as $k => $v )
			{
				unset( $_SESSION[ $k ] );
			}
		}

		/* Store a session variable and then check it on the next page load to make sure PHP sessions are working */
		if( !isset( \IPS\Request::i()->sessionCheck ) )
		{
			$_SESSION['sessionCheck'] = TRUE;
			\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setQueryString( 'sessionCheck', 1 ), NULL, 307 ); // 307 instructs the browser to resubmit the form as a POST request maintaining all the values from before
		}
		else
		{
			if( !isset( $_SESSION['sessionCheck'] ) OR !$_SESSION['sessionCheck'] )
			{
				\IPS\Output::i()->error( 'session_check_fail', '5C289/1', 500, '' );
			}
		}

		/* Are we automatically logging in? */
		if ( isset( \IPS\Request::i()->adsess ) )
		{
			$session = \IPS\Db::i()->select( '*', 'core_sys_cp_sessions', array( 'session_id=?',  \IPS\Request::i()->adsess ) )->first();
			$member = $session['session_member_id'] ? \IPS\Member::load( $session['session_member_id'] ) : new \IPS\Member;
			if ( $member->member_id and $this->_memberHasUpgradePermission( $member ) and ( !\IPS\Settings::i()->match_ipaddress or ( $session['session_ip_address'] === \IPS\Request::i()->ipAddress() ) ) )
			{
				$_SESSION['uniqueKey']	= \IPS\Login::generateRandomString();
				\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
			}
		}

		$login = new \IPS\Login( \IPS\Http\Url::internal( "controller=login&start=1&sessionCheck=1", NULL, NULL, NULL, \IPS\Settings::i()->logins_over_https ) );
		$login->flagOptions	= FALSE;

		/* < 4.0.0 */
		$legacy = FALSE;
		if( \IPS\Db::i()->checkForTable( 'login_methods' ) )
		{
			$legacy = TRUE;
		}

		/* Restoring a part finished upgrade means no log in hander rows even though table has been renamed */
		if ( \IPS\Db::i()->checkForTable( 'core_login_handlers' ) )
		{
			$legacy = FALSE;

			if ( ! \IPS\Db::i()->select( 'COUNT(*)', 'core_login_handlers' )->first() )
			{
				$legacy = TRUE;
			}
		}

		if ( $legacy === TRUE )
		{
			/* Force internal only as we don't have the framework installed (JS/templates, etc) at this point to run external log in modules */
			\IPS\Login\LoginAbstract::$databaseTable = 'login_methods';

			$login::$allHandlers['internal'] = \IPS\Login\LoginAbstract::constructFromData( array (
				'login_key'      => 'Upgrade',
				'login_enabled'  => 1,
				'login_settings' => '{"auth_types":"3"}',
				'login_order'    => 1,
				'login_acp'      => 1
			) );

			$login::$handlers = $login::$allHandlers;
		}

		$handlers = \IPS\Login::handlers();

		/* Process */
		$error = NULL;
		try
		{
			$member = $login->authenticate();
			if ( $member !== NULL )
			{
				/* Check permission */
				if ( !$this->_memberHasUpgradePermission( $member ) )
				{
					throw new \DomainException('login_upgrader_no_permission');
				}

				/* Create a unique session key and redirect */
				$_SESSION['uniqueKey']	= \IPS\Login::generateRandomString();

				\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
			}
		}
		catch ( \Exception $e )
		{
			$error = $e->getMessage();
		}

		/* Output */
		\IPS\Output::i()->title		= \IPS\Member::loggedIn()->language()->addToStack('login');
		\IPS\Output::i()->output 	.= \IPS\Theme::i()->getTemplate( 'forms' )->login( $login->forms( TRUE ), $error );
	}

	/**
	 * Can member log into upgrader?
	 *
	 * @param	\IPS\Member	$member	The member
	 * @return	bool
	 */
	protected function _memberHasUpgradePermission( \IPS\Member $member )
	{
		/* 4.x */
		if ( \IPS\Db::i()->checkForTable( 'core_admin_permission_rows' ) )
		{
			/* This permission was added in 4.1.6, so if we have it, use it */
			if ( \IPS\Application::load('core')->long_version > 101021 )
			{
				return $member->hasAcpRestriction( 'core', 'overview', 'upgrade_manage' );
			}
			/* Otherwise, let them in if they're an admin */
			else
			{
				return $member->isAdmin();
			}
		}
		/* 3.x */
		else
		{
			/* Does our primary group have permission? */
			$admin = (bool) \IPS\Db::i()->select( 'g_access_cp', 'groups', array( 'g_id=?', $member->member_group_id ) )->first();

			if( $admin )
			{
				return TRUE;
			}

			/* Check secondary groups as well */
			if( $member->mgroup_others )
			{
				/* In some versions we stored as ",1,2," with trailing/preceeding commas, so account for that */
				foreach( explode( ',', trim( $member->mgroup_others, ',' ) ) as $group )
				{
					try
					{
						$admin = (bool) \IPS\Db::i()->select( 'g_access_cp', 'groups', array( 'g_id=?', $group ) )->first();

						if( $admin )
						{
							return TRUE;
						}
					}
					/* It is possible the user has an old group that no longer exists defined as a secondary group */
					catch( \UnderflowException $e ){}
				}
			}

			/* Still here? No permission */
			return FALSE;
		}
	}
}


text:
require 'geo_pattern'

module Jekyll
  module GeoPatterns
    VALID_KEYS = %w(:base_color :color :generator :text)
    VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/

    # from a string of options, construct a hash, without using `eval`
    def self.extract_options( input, context )
      opts = {}
      markup = input

      while match = VALID_SYNTAX.match(markup) do
        markup = markup[match.end(0)..-1]

        value = if match[2]
          match[2].gsub(/\\"/, '"')
        elsif match[3]
          match[3].gsub(/\\'/, "'")
        elsif match[4]
          context[match[4]]
        end

        opts[match[1].to_sym] = value
      end
      GeoPatterns.scrub_options(opts, context)
    end

    def self.scrub_options(opts, context)
      opts.each do |opt, value|
        next if value.nil? # ignore properties that have no corresponding value

        value.gsub! /"|'/, ""

        if value =~ /^(\w+?(\.[\w]+)*)/i
          context_val = GeoPatterns.look_up(context, $1)
          opts[opt] = context_val unless context_val.nil?
        end
      end
      opts
    end

    # set it up such that variables, like `post.title`, are still processed
    def self.look_up(context, name)
      lookup = context

      name.split(".").each do |value|
        lookup = lookup[value]
      end

      lookup
    end

    class Base64GeoPattern < Liquid::Tag
      def initialize(tag_name, text, tokens)
        super
        @text = text
      end

      def render(context)
        opts = GeoPatterns.extract_options(@text, context)

        raise ArgumentError, "You must have the :text property passed in" if opts[:text].nil?

        GeoPattern.generate(opts[:text], opts).base64_string
      end
    end

    class SVGGeoPattern < Liquid::Tag
      def initialize(tag_name, text, tokens)
        super
        @text = text
      end

      def render(context)
        opts = GeoPatterns.extract_options(@text, context)

        raise ArgumentError, "You must have the :text property passed in" if opts[:text].nil?

        GeoPattern.generate(opts[:text], opts).svg_string
      end
    end

    class UriImageGeoPattern < Liquid::Tag
      def initialize(tag_name, text, tokens)
        super
        @text = text
      end

      def render(context)
        opts = GeoPatterns.extract_options(@text, context)

        raise ArgumentError, "You must have the :text property passed in" if opts[:text].nil?

        GeoPattern.generate(opts[:text], opts).uri_image
      end
    end
  end
end

Liquid::Template.register_tag('base64_geo_pattern', Jekyll::GeoPatterns::Base64GeoPattern)
Liquid::Template.register_tag('svg_geo_pattern', Jekyll::GeoPatterns::SVGGeoPattern)
Liquid::Template.register_tag('uri_geo_pattern', Jekyll::GeoPatterns::UriImageGeoPattern)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

<TITLE>Manpage of PIDOF</TITLE>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/main.css" type="text/css">

linux manpages

{"type":"documentation"}

PIDOF

Section: Linux System Administrator's Manual (8)
Updated: 01 Sep 1998
Index
Return to Main Contents

NAME

pidof -- find the process ID of a running program.

SYNOPSIS

pidof

[-s]

[-c]

[-x]

[-o

omitpid]

[-o

omitpid..]

program

[program..]

DESCRIPTION

Pidof

finds the process id's (pids) of the named programs. It prints those
id's on the standard output. This program is on some systems used in
run-level change scripts, especially when the system has a
System-V like rc structure. In that case these scripts are
located in /etc/rc?.d, where ? is the runlevel. If the system has
a
start-stop-daemon

(8) program that should be used instead.

OPTIONS

-s

Single shot - this instructs the program to only return one pid.

-c

Only return process ids that are running with the same root directory.
This option is ignored for non-root users, as they will be unable to check
the current root directory of processes they do not own.

-x

Scripts too - this causes the program to also return process id's of
shells running the named scripts.

-o omitpid

Tells pidof to omit processes with that process id. The special
pid %PPID can be used to name the parent process of the pidof
program, in other words the calling shell or shell script.

EXIT STATUS

0

At least one program was found with the requested name.

1

No program was found with the requested name.

NOTES

pidof is actually the same program as killall5;
the program behaves according to the name under which it is called.

When pidof is invoked with a full pathname to the program it
should find the pid of, it is reasonably safe. Otherwise it is possible
that it returns pids of running programs that happen to have the same name
as the program you're after but are actually other programs. Note that
that the executable name of running processes is calculated with
readlink(2),

so symbolic links to executables will also match.

SEE ALSO

shutdown(8),

init(8),

halt(8),

reboot(8),

killall5(8)

AUTHOR

Miquel van Smoorenburg, miquels@cistron.nl

Index

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

EXIT STATUS

NOTES

SEE ALSO

AUTHOR

This document was created by
man2html,
using the manual pages.

Time: 05:34:28 GMT, December 24, 2015


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfWork;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;

namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.InfGMLSupport
{

    /// <summary>
    /// The default implementation of the GmlPosition class
    /// </summary>
    [XmlNamespaceAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#InfGMLSupport")]
    [XmlNamespacePrefixAttribute("cimInfGMLSupport")]
    [ModelRepresentationClassAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfGMLSupport/Gml" +
        "Position")]
    [DebuggerDisplayAttribute("GmlPosition {UUID}")]
    public partial class GmlPosition : PositionPoint, IGmlPosition, IModelElement
    {

        private static IClass _classInstance;

        /// <summary>
        /// Gets the Class model for this type
        /// </summary>
        public new static IClass ClassInstance
        {
            get
            {
                if ((_classInstance == null))
                {
                    _classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfGMLSupport/Gml" +
                            "Position")));
                }
                return _classInstance;
            }
        }

        /// <summary>
        /// Gets the Class for this model element
        /// </summary>
        public override IClass GetClass()
        {
            if ((_classInstance == null))
            {
                _classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfGMLSupport/Gml" +
                        "Position")));
            }
            return _classInstance;
        }
    }
}


text:
using System;
using System.Threading.Tasks;
using Toggl.Phoebe.Data.Json;

namespace Toggl.Phoebe.Net
{
    public interface IReportsClient
    {
        Task<ReportJson> GetReports (DateTime startDate, DateTime endDate, long workspaceId);

        void CancelRequest ();

        bool IsCancellationRequested { get; }
    }
}


text:
package com.selbie.wrek.metaproxy;

import java.io.IOException;
import java.io.OutputStream;

public class MetadataStreamFilter
{
    public final static String TAG = MetadataStreamFilter.class.getSimpleName();

    enum State
    {
        Data,         // reading mp3 bytes
        MetaSizeByte, // next byte read will be used to compute _metaTotal
        MetaData      // reading metadata bytes
    }

    private IMetadataCallback _callback;

    private OutputStream _outputstream;

    private State _state = State.Data;

    private int _metaInterval;
    private int _dataCount;

    private byte [] _metaBuffer; // temp buffer for holding meta data
    private int _metaCount;      // how many bytes have been written to the metaBuffer;
    private int _metaTotal;      // how many total metadata bytes we are expecting to read

    private static final int MAX_METABUFFER_SIZE = 16*255;

    private String _latestMetaData;  // is null when there is no new metadata to be consumed

    public MetadataStreamFilter()
    {
        // The metadata length is computed by reading the length byte from the stream and multiplying by 16
        // Hence, the largest metabuffer size can only be 16*255 bytes
        _metaBuffer = new byte[MAX_METABUFFER_SIZE];
        init(0,null, null);
    }

    public void init(int interval, OutputStream outputstream, IMetadataCallback callback)
    {
        _metaCount = 0;
        _metaTotal = 0;

        _outputstream = outputstream;
        _metaInterval = interval;
        _dataCount = 0;

        _state = State.Data;

        _latestMetaData = null;

        _callback = callback;
    }

    public void write(byte [] buffer, int offset, int count) throws IOException
    {
        while (count > 0)
        {
            if (_state == State.Data)
            {
                int toWrite = _metaInterval - _dataCount;
                if ((_metaInterval == 0) || (toWrite > count))
                {
                    toWrite = count;
                }

                writeToOutputStream(buffer, offset, toWrite);
                offset += toWrite;
                count -= toWrite;
            }
            else if (_state == State.MetaSizeByte)
            {
                // consume exactly 1 byte, and compute the amount of meta bytes to follow
                _metaCount = 0;

                byte b = buffer[offset];
                int b_int = b & 0xff; // treat byte as unsigned and upcast to int

                _metaTotal = (b_int * 16);
                offset++;
                count--;

                assert(_metaTotal >= 0);
                assert(_metaTotal <= MAX_METABUFFER_SIZE);

                if (_metaTotal == 0)
                {
                    _state = State.Data;
                }
                else
                {
                    _state = State.MetaData;
                }
            }
            else if (_state == State.MetaData)
            {
                int toWrite = _metaTotal - _metaCount;
                if (toWrite > count)
                {
                    toWrite = count;
                }
                processMetaData(buffer, offset, toWrite);
                offset += toWrite;
                count -= toWrite;
            }
        } // while
    } // write method

    // returns the latest metadata string generated from the last write call (if any). Subsequent calls return null until new metadata is written
    public String getLatestMetadata()
    {
        String result = _latestMetaData;
        _latestMetaData = null;
        return result;
    }

    private void writeToOutputStream(byte [] buffer, int offset, int count) throws IOException
    {
        assert (_state == State.Data);

        _outputstream.write(buffer, offset, count);

        if (_metaInterval != 0)
        {
            _dataCount += count;

            assert(_dataCount <= _metaInterval);
            assert(_state == State.Data);

            if (_dataCount == _metaInterval)
            {
                _dataCount = 0;
                _state = State.MetaSizeByte;
            }
        }
    }

    private void processMetaData(byte [] buffer, int offset, int count)
    {

        assert (_state == State.MetaData);

        System.arraycopy(buffer, offset, _metaBuffer, _metaCount, count);
        _metaCount += count;

        assert(_metaCount <= _metaTotal);

        if (_metaCount == _metaTotal)
        {
            int metaLength = 0;

            // The icy metadata is in 16-byte chunks - padded with zero bytes.
            // The null bytes just generate noise in the conversion to string.
            // So we ignore those in the conversion
            for (int x = 0; x < _metaTotal; x++)
            {
                if (_metaBuffer[x] != 0)
                {
                    metaLength++;
                }
                else
                {
                    break;
                }
            }

            _latestMetaData = new String(_metaBuffer, 0, metaLength);
            _state = State.Data;
            _dataCount = 0;
            _metaTotal = 0;
            _metaCount = 0;

            if (_callback != null)
            {
                _callback.onNewMetadataAvailable(_latestMetaData);
            }
        }
    }
}


text:
layout: bidder
title: ViewdeosDX Client
description: Prebid.js ViewDeos Bidder Adapter
pbjs: true
pbs: false
biddercode: viewdeosDX
media_types: banner,video
gdpr_supported: true
gvl_id: 924
---

Note that for Prebid Server, use "viewdeos" bidder code.

### Bid params

{: .table .table-bordered .table-striped }
| Name  | Scope    | Description                     | Example  | Type      |
|-------|----------|---------------------------------|----------|-----------|
| `aid` | required | The source ID from member zone | `350975` | `integer` |
| `outstream` | optional | Oustream player settings object | `{"audio_setting":"on","video_controls":"show"}` | `object` |

#### Oustream settings object

{: .table .table-bordered .table-striped }
| Name  | Scope    | Description                     | Example  | Type      |
|-------|----------|---------------------------------|----------|-----------|
| `type` | optional | allows to set the outstream type to one of inread/inbanner/interstitial/slider  | `'inbanner'` | `string` |
| `audio_setting` | optional | allows to set audio settings, set to one of: on/muted/hover  | `'hover'` | `string` |
| `video_controls` | optional |  enables or disables the visibility of controls, set to one of: show/hide/hover | `'show'` | `string` |
| `close_button_options` | optional |  allows to choose when/if it is needed to show the "close" button, set to one of: delay/not_show/based_on | `'delay'` | `string` |
| `view_out_action` | optional |  allows to apply the action type to an outstream unit when it is out of the visible zone, set to one of: jump/detach/continue_playing_muted/close/continue_playing/pause | `'pause'` | `string` |
| `default_volume` | optional | allows to set the volume of outstream video ad 0-100 | `45` | `integer` |
| `percent_visible_before_show` | optional | allows to setup visible percentage of an outstream unit to play 0-100 | `60` | `integer` |
| `is_countdown_show` | optional | allows to enable/disable a countdown before the "close" button appears 0 - is enabled 1 - is disabled | `1` | `integer` |
| `countdown_time` | optional | allows to set up how long the countdown will last and show it to the user. | `5` | `integer` |
| `close_button_delay` | optional | allows to set a delay before showing close button | `5` | `integer` |
| `disengagement_delay` | optional | allows to set a delay before actions selected in desangagement_method parameter | `5` | `integer` |
| `disengagement_method` | optional | is applicable solely to Interstitial units allowing determine the actions that can be applied to the player, set to one of: close_button/detach_button/no/auto_detach | `'close_button'` | `string` |
| `event_for_expand` | optional | allows to select when outstream unit should be expanded, set to one of: on_start_ad/on_load_ad | `'on_load_ad'` | `string` |
| `detach_location_on page` | optional | allows to select the location where you want the detached player to be placed, set to one of: bottom_right/fullscreen/bottom_left/center_left/center_right/top_right/top_left | `'top_left'` | `string` |
| `animation_mode` | optional | allows to control your outstream unit's animation mode on the webpage, set to one of: ease/ease_in/ease_out/step_start/linear | `'ease'` | `string` |
| `detach_width` | optional | detached player's width in pixels | `300` | `integer` |
| `detach_height` | optional | detached player's height in pixels | `200` | `integer` |

### Test Parameters
```
    var adUnits = [

      // Video instream adUnit
      {
        code: 'div-test-div',
        mediaTypes: {
          video: {
            playerSize:[640, 480],
            context: 'instream'
          }
        },
        bids: [{
          bidder: 'viewdeosDX',
          params: {
            aid: 331133
          }
        }]
      },

      // Video outstream adUnit
      {
        code: 'outstream-test-div',
        mediaTypes: {
          video: {
            playerSize:[640, 480],
            context: 'outstream'
          }
        },
        bids: [{
          bidder: 'viewdeosDX',
          params: {
            aid: 331133
          }
        }]
      },

      // Banner adUnit
      {
        code: 'div-test-div',
        mediaTypes: {
          banner: {
            sizes:[[300, 250]]
          }
        },
        bids: [{
          bidder: 'viewdeosDX',
          params: {
            aid: 350975
          }
        }]
      }
    ];
```


text:
/* @flow */

import type { Cursor, Measure, Clipboard } from './stateTypes';

export const getNextNote = (
  measures: Array<Measure>,
  { stringIndex, measureIndex, noteIndex }: Cursor
): Cursor => {
  if (noteIndex >= measures[measureIndex].notes.length - 1) {
    return { measureIndex: measureIndex + 1, noteIndex: 0, stringIndex };
  } else {
    return { measureIndex, noteIndex: noteIndex + 1, stringIndex };
  }
};

export const getPrevNote = (
  measures: Array<Measure>,
  { stringIndex, measureIndex, noteIndex }: Cursor
): Cursor => {
  if (measureIndex === 0 && noteIndex === 0) {
    return { measureIndex, noteIndex, stringIndex };
  } else if (noteIndex === 0) {
    let prevMeasure = measures[measureIndex - 1];
    if (prevMeasure.notes.length > 0) {
      return {
        measureIndex: measureIndex - 1,
        noteIndex: measures[measureIndex - 1].notes.length - 1,
        stringIndex
      };
    } else {
      return { measureIndex: measureIndex - 1, noteIndex: 0, stringIndex };
    }
  } else {
    return { measureIndex, noteIndex: noteIndex - 1, stringIndex };
  }
};

export const getUpperString = (
  stringIndex: number,
  stringCount: number
): number => {
  return stringIndex === stringCount - 1 ? 0 : stringIndex + 1;
};

export const getLowerString = (
  stringIndex: number,
  stringCount: number
): number => {
  return stringIndex === 0 ? stringCount - 1 : stringIndex - 1;
};

export const cursorAfterCutting = (
  measures: Array<Measure>,
  selectRange: any,
  oldCursor: Cursor
): Cursor => {
  const firstMeasureIndex = parseInt(Object.keys(selectRange)[0]);

  let measureIndex = firstMeasureIndex;
  let noteIndex;
  if (selectRange[firstMeasureIndex] === 'all') {
    const lastMeasure = Object.keys(selectRange)[
      Object.keys(selectRange).length - 1
    ];
    if (parseInt(lastMeasure) === measures.length - 1) {
      measureIndex = firstMeasureIndex === 0 ? 0 : firstMeasureIndex - 1;
    }
    if (Object.keys(selectRange).length === 1) {
      noteIndex = 0;
    }
  }

  if (noteIndex === undefined) {
    noteIndex =
      Object.keys(selectRange).length > 1 ? 0 : selectRange[measureIndex][0];
  }

  return {
    ...oldCursor,
    noteIndex: noteIndex === 0 ? 0 : noteIndex - 1,
    measureIndex
  };
};

export const cursorAfterPasting = (
  measures: Array<Measure>,
  clipboard: Clipboard,
  oldCursor: Cursor
): Cursor => {
  if (Array.isArray(clipboard.notes)) {
    return {
      ...oldCursor,
      noteIndex: oldCursor.noteIndex + clipboard.notes.length
    };
  } else if (!Array.isArray(clipboard)) {
    if (
      oldCursor.noteIndex ===
      measures[oldCursor.measureIndex].notes.length - 1
    ) {
      return { ...oldCursor, noteIndex: oldCursor.noteIndex + 1 };
    } else {
      return getNextNote(measures, oldCursor);
    }
  } else {
    return {
      ...oldCursor,
      measureIndex: oldCursor.measureIndex + clipboard.length,
      noteIndex: 0
    };
  }
};

export const getNotesFromSelection = (
  measures: Array<Measure>,
  { measureIndex, noteIndex }: Cursor,
  selectRange: Object
): Array<Object> | Object => {
  if (selectRange) {
    if (
      Object.keys(selectRange).length === 1 &&
      selectRange[Object.keys(selectRange)[0]] !== 'all'
    ) {
      const measureIndex = Object.keys(selectRange)[0];
      const measure = measures[parseInt(measureIndex)];
      const notes = measure.notes.filter((_, i) => {
        if (selectRange[measureIndex].indexOf(i) !== -1) {
          return true;
        }
        return false;
      });
      return { notes };
    }

    return measures.reduce((accum, measure, i) => {
      if (Array.isArray(selectRange[i])) {
        const range = selectRange[i];
        const notes = measure.notes.filter((_, j) => {
          return range.indexOf(j) !== -1;
        });
        accum.push({ ...measure, notes });
        return accum;
      } else if (selectRange[i] === 'all') {
        accum.push(measure);
        return accum;
      }
      return accum;
    }, []);
  } else {
    return measures[measureIndex].notes[noteIndex];
  }
};


text:
package com.github.edgar615.gateway.http.loadbalance;

import io.vertx.core.json.JsonObject;

class LoadBalanceOptionsConverter {

    static void fromJson(JsonObject json, LoadBalanceOptions obj) {
        if (json.getValue("strategy") instanceof JsonObject) {
            addStrategy(json.getJsonObject("strategy"), obj);
        }
    }

    static void toJson(LoadBalanceOptions obj, JsonObject json) {
        putStrategy(obj, json);
    }

    private static void putStrategy(LoadBalanceOptions obj, JsonObject json) {
        JsonObject strategy = new JsonObject();
        obj.getStrategies().forEach((k, v) -> {
            String strategyName = null;
            if (v instanceof RandomStrategy) {
                strategyName = "random";
            }
            if (v instanceof RoundRobinStrategy) {
                strategyName = "round_robin";
            }
            if (v instanceof WeightRoundbinStrategy) {
                strategyName = "weight_round_robin";
            }
            if (v instanceof StickyStrategy) {
                strategyName = "sticky";
            }
            if (v instanceof LastConnectionStrategy) {
                strategyName = "last_conn";
            }
            if (strategyName != null) {
                strategy.put(k, strategyName);
            }
        });
        json.put("strategy", strategy);
    }

    private static void addStrategy(JsonObject strategyConfig, LoadBalanceOptions obj) {
        for (String name : strategyConfig.fieldNames()) {
            if (strategyConfig.getValue(name) instanceof String) {
                String strategyName = strategyConfig.getString(name);
                ChooseStrategy strategy = ChooseStrategy.roundRobin();
                if ("random".equalsIgnoreCase(strategyName)) {
                    strategy = ChooseStrategy.random();
                }
                if ("round_robin".equalsIgnoreCase(strategyName)) {
                    strategy = ChooseStrategy.roundRobin();
                }
                if ("sticky".equalsIgnoreCase(strategyName)) {
                    strategy = ChooseStrategy.sticky(ChooseStrategy.roundRobin());
                }
                if ("weight_round_robin".equalsIgnoreCase(strategyName)) {
                    strategy = ChooseStrategy.weightRoundRobin();
                }
                if ("last_conn".equalsIgnoreCase(strategyName)) {
                    strategy = ChooseStrategy.lastConnection();
                }
                obj.addStrategy(name, strategy);
            }
        }
    }
}


text:
<?php

defined('BASEPATH') or exit('No direct script access allowed');

class Contract extends Clients_controller
{

    public function index($id, $hash)
    {
        check_contract_restrictions($id, $hash);
        $contract = $this->contracts_model->get($id);

        if (!$contract) {
            show_404();
        }

        if (!is_client_logged_in()) {
            load_client_language($contract->client);
        }

        if ($this->input->post()) {
            $action = $this->input->post('action');

            switch ($action) {
            case 'contract_pdf':
                    $pdf = contract_pdf($contract);
                    $pdf->Output(slug_it($contract->subject . '-' . get_option('companyname')) . '.pdf', 'D');

                    break;
            case 'sign_contract':
                    process_digital_signature_image($this->input->post('signature', false), CONTRACTS_UPLOADS_FOLDER . $id);
                    $this->db->where('id', $id);
                    $this->db->update('tblcontracts', array_merge(get_acceptance_info_array(), [
                        'signed' => 1,
                    ]));

                    // Notify contract creator that customer signed the contract
                    send_contract_signed_notification_to_staff($id);

                    set_alert('success', _l('document_signed_successfully'));
                    redirect($_SERVER['HTTP_REFERER']);

            break;
             case 'contract_comment':
                    // comment is blank
                    if (!$this->input->post('content')) {
                        redirect($this->uri->uri_string());
                    }
                    $data                = $this->input->post();
                    $data['contract_id'] = $id;
                    $this->contracts_model->add_comment($data, true);
                    redirect($this->uri->uri_string() . '?tab=discussion');

                    break;
            }
        }

        // $this->use_footer     = false;
        $this->use_navigation = false;
        $this->use_submenu    = false;

        $data['title']     = $contract->subject;
        $data['contract']  = do_action('contract_html_pdf_data', $contract);
        $data['bodyclass'] = 'contract contract-view';

        $data['identity_confirmation_enabled'] = true;
        $data['bodyclass'] .= ' identity-confirmation';

        $data['comments'] = $this->contracts_model->get_comments($id);
        //add_views_tracking('proposal', $id);
        do_action('contract_html_viewed', $id);
        $this->app_css->remove('reset-css','customers-area-default');
        $data                      = do_action('contract_customers_area_view_data', $data);
        $this->data                = $data;
        no_index_customers_area();
        $this->view = 'contracthtml';
        $this->layout();
    }
}


text:
var crisper = require('gulp-crisper');
var lazypipe = require('lazypipe');
var polyclean = require('polyclean');
var rename = require('gulp-rename');
var vulcanize = require('gulp-vulcanize');
var gutil = require('gulp-util');
var htmlmin = require('gulp-htmlmin');
var gulpIf = require('gulp-if');

// Inline html imports, scripts and css also remove html comments
var htmlPipe = lazypipe().pipe(vulcanize, {
    inlineScripts: true,
    inlineCss: true,
    stripComments: true
});

// Remove whitespace from inline css. REMOVED DUE TO ISSUE WITH CSS MIXINS
//.pipe(polyclean.cleanCss);

// Remove javascript whitespace
var leftAlign = polyclean.leftAlignJs;

// Minimize javascript with uglifyjs
var uglify = polyclean.uglifyJs;

module.exports = function (opts) {
    opts = opts || {};
    var crush = opts.maximumCrush;
    var suffix = '';

    if (opts.suffix === false || opts.suffix === "") {
        suffix = '';
    } else if (typeof opts.suffix === 'string') {
        suffix = '.' + opts.suffix.split('.').join('');
    }

    var pipe = htmlPipe

    // Switch between cleaning or minimizing javascript
    .pipe(crush ? uglify : leftAlign)

    // Minimize html with htmlmin if crush === true
    .pipe(function() {
        return gulpIf(crush, htmlmin({
            collapseWhitespace: true,
            removeComments: true
        }));
    })

    // Rename files with an infix suffix, if defined
    .pipe(rename, function(path) {
        path.basename += suffix;
    })

    // Split the javascript out into separate HTML and JavaScript files for CSP compliance
    .pipe(crisper)();

    // Have to handle errors ourselves, thanks gulp >:(
    pipe.on('error', function (error) {
        gutil.log(error.toString());
        process.exit(1);
    });

    return pipe;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/vn.mbm.phimp.me"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardCornerRadius="@dimen/size_2"
        android:id="@+id/message_card"
        >
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <TextView
                    android:id="@+id/text_dialog_title"
                    android:layout_width="match_parent"
                    android:textColor="@color/md_dark_primary_text"
                    android:layout_height="wrap_content"
                    android:background="@color/md_red_500"
                    android:padding="@dimen/big_spacing"
                    android:text=""
                    android:textSize="@dimen/sub_big_text"
                    android:textStyle="bold" />
                <RelativeLayout
                    android:id="@+id/text_dialog_rl"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical"
                    >
                    <TextView
                        android:id="@+id/text_dialog_message"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingTop="@dimen/sub_big_spacing"
                        android:paddingEnd="@dimen/sub_big_spacing"
                        android:paddingStart="@dimen/sub_big_spacing"
                        android:text="null"
                        android:singleLine="false"
                        android:textSize="@dimen/medium_text"
                        />
                </RelativeLayout>
            </LinearLayout>
        </ScrollView>
    </androidx.cardview.widget.CardView>
</LinearLayout>


text:
LuaModule::LuaModule(lua_State* pLuaState, const string& filePath)
	:m_pLuaState(pLuaState), m_bLoadSuccessed(false), m_luaFilePath()
{
	m_luaFilePath = filePath;
	int iError = luaL_loadfile(pLuaState, filePath.c_str());
	if (iError == 0) {
		m_bLoadSuccessed = true;
	} else {
		m_bLoadSuccessed = false;
		ERR("LuaModule error: load lua file failed, error code: {}, file: {}", iError, filePath);
	}
}

bool LuaModule::Run()
{
	if (m_bLoadSuccessed){
		int iError = lua_pcall(m_pLuaState, 0, 0, 0);
		if (iError != 0) {
			ERR("LuaModule Run error:  error code: {}", iError);
		}
	}
	return false;
}


text:
namespace blink {
namespace {

// This alias mimics the definition of VideoCaptureDeliverFrameCB.
using VideoCaptureDeliverFrameInternalCallback =
    WTF::CrossThreadFunction<void(scoped_refptr<media::VideoFrame> video_frame,
                                  base::TimeTicks estimated_capture_time)>;

// Mimics blink::EncodedVideoFrameCB
using EncodedVideoFrameInternalCallback =
    WTF::CrossThreadFunction<void(scoped_refptr<EncodedVideoFrame> frame,
                                  base::TimeTicks estimated_capture_time)>;

}  // namespace

// MediaStreamVideoTrack::FrameDeliverer is a helper class used for registering
// VideoCaptureDeliverFrameCB/EncodedVideoFrameCB callbacks on the main render
// thread to receive video frames on the IO-thread. Frames are only delivered to
// the sinks if the track is enabled. If the track is disabled, a black frame is
// instead forwarded to the sinks at the same frame rate. A disabled track does
// not forward data to encoded sinks.
class MediaStreamVideoTrack::FrameDeliverer
    : public WTF::ThreadSafeRefCounted<FrameDeliverer> {
 public:
  using VideoSinkId = WebMediaStreamSink*;

  FrameDeliverer(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
                 base::WeakPtr<MediaStreamVideoTrack> media_stream_video_track,
                 bool enabled);

  // Sets whether the track is enabled or not. If getting enabled and encoded
  // output is enabled, the deliverer will wait until the next key frame before
  // it resumes producing encoded data.
  void SetEnabled(bool enabled, bool await_key_frame);

  // Add |callback| to receive video frames on the IO-thread.
  // Must be called on the main render thread.
  void AddCallback(VideoSinkId id, VideoCaptureDeliverFrameCB callback);

  // Add |callback| to receive encoded video frames on the IO-thread.
  // Must be called on the main render thread.
  void AddEncodedCallback(VideoSinkId id, EncodedVideoFrameCB callback);

  // Removes |callback| associated with |id| from receiving video frames if |id|
  // has been added. It is ok to call RemoveCallback even if the |id| has not
  // been added. Note that the added callback will be reset on the main thread.
  // Must be called on the main render thread.
  void RemoveCallback(VideoSinkId id);

  // Removes encoded callback associated with |id| from receiving video frames
  // if |id| has been added. It is ok to call RemoveEncodedCallback even if the
  // |id| has not been added. Note that the added callback will be reset on the
  // main thread. Must be called on the main render thread.
  void RemoveEncodedCallback(VideoSinkId id);

  // Triggers all registered callbacks with |frame| and |estimated_capture_time|
  // as parameters. Must be called on the IO-thread.
  void DeliverFrameOnIO(scoped_refptr<media::VideoFrame> frame,
                        base::TimeTicks estimated_capture_time);

  // Triggers all encoded callbacks with |frame| and |estimated_capture_time|.
  // Must be called on the IO-thread.
  void DeliverEncodedVideoFrameOnIO(scoped_refptr<EncodedVideoFrame> frame,
                                    base::TimeTicks estimated_capture_time);

 private:
  friend class WTF::ThreadSafeRefCounted<FrameDeliverer>;
  virtual ~FrameDeliverer();
  void AddCallbackOnIO(VideoSinkId id,
                       VideoCaptureDeliverFrameInternalCallback callback);
  void RemoveCallbackOnIO(
      VideoSinkId id,
      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);

  void AddEncodedCallbackOnIO(VideoSinkId id,
                              EncodedVideoFrameInternalCallback callback);
  void RemoveEncodedCallbackOnIO(
      VideoSinkId id,
      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);

  void SetEnabledOnIO(bool enabled, bool await_key_frame);

  // Returns a black frame where the size and time stamp is set to the same as
  // as in |reference_frame|.
  scoped_refptr<media::VideoFrame> GetBlackFrame(
      const media::VideoFrame& reference_frame);

  // Used to DCHECK that AddCallback and RemoveCallback are called on the main
  // Render Thread.
  THREAD_CHECKER(main_render_thread_checker_);
  const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
  // Can be null in testing.
  scoped_refptr<base::SingleThreadTaskRunner> main_render_task_runner_;

  base::WeakPtr<MediaStreamVideoTrack> media_stream_video_track_;

  bool enabled_;
  scoped_refptr<media::VideoFrame> black_frame_;
  bool emit_frame_drop_events_;

  using VideoIdCallbackPair =
      std::pair<VideoSinkId, VideoCaptureDeliverFrameInternalCallback>;
  Vector<VideoIdCallbackPair> callbacks_;
  HashMap<VideoSinkId, EncodedVideoFrameInternalCallback> encoded_callbacks_;
  bool await_next_key_frame_;

  DISALLOW_COPY_AND_ASSIGN(FrameDeliverer);
};

MediaStreamVideoTrack::FrameDeliverer::FrameDeliverer(
    scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
    base::WeakPtr<MediaStreamVideoTrack> media_stream_video_track,
    bool enabled)
    : io_task_runner_(std::move(io_task_runner)),
      media_stream_video_track_(media_stream_video_track),
      enabled_(enabled),
      emit_frame_drop_events_(true),
      await_next_key_frame_(false) {
  DCHECK(io_task_runner_.get());

  WebLocalFrame* web_frame = WebLocalFrame::FrameForCurrentContext();
  if (web_frame) {
    main_render_task_runner_ =
        web_frame->GetTaskRunner(TaskType::kInternalMedia);
  }
}

MediaStreamVideoTrack::FrameDeliverer::~FrameDeliverer() {
  DCHECK(callbacks_.IsEmpty());
}

void MediaStreamVideoTrack::FrameDeliverer::AddCallback(
    VideoSinkId id,
    VideoCaptureDeliverFrameCB callback) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  PostCrossThreadTask(
      *io_task_runner_, FROM_HERE,
      CrossThreadBindOnce(
          &FrameDeliverer::AddCallbackOnIO, WrapRefCounted(this),
          WTF::CrossThreadUnretained(id),
          WTF::Passed(CrossThreadBindRepeating(std::move(callback)))));
}

void MediaStreamVideoTrack::FrameDeliverer::AddCallbackOnIO(
    VideoSinkId id,
    VideoCaptureDeliverFrameInternalCallback callback) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  callbacks_.push_back(std::make_pair(id, std::move(callback)));
}

void MediaStreamVideoTrack::FrameDeliverer::AddEncodedCallback(
    VideoSinkId id,
    EncodedVideoFrameCB callback) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  PostCrossThreadTask(
      *io_task_runner_, FROM_HERE,
      CrossThreadBindOnce(
          &FrameDeliverer::AddEncodedCallbackOnIO, WrapRefCounted(this),
          WTF::CrossThreadUnretained(id),
          WTF::Passed(CrossThreadBindRepeating(std::move(callback)))));
}

void MediaStreamVideoTrack::FrameDeliverer::AddEncodedCallbackOnIO(
    VideoSinkId id,
    EncodedVideoFrameInternalCallback callback) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  encoded_callbacks_.insert(id, std::move(callback));
}

void MediaStreamVideoTrack::FrameDeliverer::RemoveCallback(VideoSinkId id) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  PostCrossThreadTask(
      *io_task_runner_, FROM_HERE,
      CrossThreadBindOnce(&FrameDeliverer::RemoveCallbackOnIO,
                          WrapRefCounted(this), WTF::CrossThreadUnretained(id),
                          Thread::Current()->GetTaskRunner()));
}

void MediaStreamVideoTrack::FrameDeliverer::RemoveCallbackOnIO(
    VideoSinkId id,
    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  auto* it = callbacks_.begin();
  for (; it != callbacks_.end(); ++it) {
    if (it->first == id) {
      // Callback destruction needs to happen on the specified task runner.
      PostCrossThreadTask(
          *task_runner, FROM_HERE,
          CrossThreadBindOnce(
              [](VideoCaptureDeliverFrameInternalCallback callback) {},
              std::move(it->second)));
      callbacks_.erase(it);
      return;
    }
  }
}

void MediaStreamVideoTrack::FrameDeliverer::RemoveEncodedCallback(
    VideoSinkId id) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  PostCrossThreadTask(
      *io_task_runner_, FROM_HERE,
      CrossThreadBindOnce(&FrameDeliverer::RemoveEncodedCallbackOnIO,
                          WrapRefCounted(this), WTF::CrossThreadUnretained(id),
                          Thread::Current()->GetTaskRunner()));
}

void MediaStreamVideoTrack::FrameDeliverer::RemoveEncodedCallbackOnIO(
    VideoSinkId id,
    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());

  // Callback destruction needs to happen on the specified task runner.
  auto it = encoded_callbacks_.find(id);
  if (it == encoded_callbacks_.end()) {
    return;
  }
  PostCrossThreadTask(
      *task_runner, FROM_HERE,
      CrossThreadBindOnce([](EncodedVideoFrameInternalCallback callback) {},
                          std::move(it->value)));
  encoded_callbacks_.erase(it);
}

void MediaStreamVideoTrack::FrameDeliverer::SetEnabled(bool enabled,
                                                       bool await_key_frame) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  PostCrossThreadTask(
      *io_task_runner_, FROM_HERE,
      CrossThreadBindOnce(&FrameDeliverer::SetEnabledOnIO, WrapRefCounted(this),
                          enabled, await_key_frame));
}

void MediaStreamVideoTrack::FrameDeliverer::SetEnabledOnIO(
    bool enabled,
    bool await_key_frame) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  if (enabled != enabled_) {
    enabled_ = enabled;
    emit_frame_drop_events_ = true;
  }
  if (enabled_) {
    black_frame_ = nullptr;
    await_next_key_frame_ = await_key_frame;
  }
}

void MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO(
    scoped_refptr<media::VideoFrame> frame,
    base::TimeTicks estimated_capture_time) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  if (!enabled_ && main_render_task_runner_ && emit_frame_drop_events_) {
    emit_frame_drop_events_ = false;

    // TODO(crbug.com/964947): A weak ptr instance of MediaStreamVideoTrack is
    // passed to FrameDeliverer in order to avoid the re-binding the instance of
    // a WTF::CrossThreadFunction.
    PostCrossThreadTask(
        *main_render_task_runner_, FROM_HERE,
        CrossThreadBindOnce(
            &MediaStreamVideoTrack::OnFrameDropped, media_stream_video_track_,
            media::VideoCaptureFrameDropReason::
                kVideoTrackFrameDelivererNotEnabledReplacingWithBlackFrame));
  }
  auto video_frame = enabled_ ? std::move(frame) : GetBlackFrame(*frame);
  for (const auto& entry : callbacks_)
    entry.second.Run(video_frame, estimated_capture_time);
}

void MediaStreamVideoTrack::FrameDeliverer::DeliverEncodedVideoFrameOnIO(
    scoped_refptr<EncodedVideoFrame> frame,
    base::TimeTicks estimated_capture_time) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  if (!enabled_) {
    return;
  }
  if (await_next_key_frame_ && !frame->IsKeyFrame()) {
    return;
  }
  await_next_key_frame_ = false;
  for (const auto& entry : encoded_callbacks_.Values()) {
    entry.Run(frame, estimated_capture_time);
  }
}

scoped_refptr<media::VideoFrame>
MediaStreamVideoTrack::FrameDeliverer::GetBlackFrame(
    const media::VideoFrame& reference_frame) {
  DCHECK(io_task_runner_->BelongsToCurrentThread());
  if (!black_frame_.get() ||
      black_frame_->natural_size() != reference_frame.natural_size()) {
    black_frame_ =
        media::VideoFrame::CreateBlackFrame(reference_frame.natural_size());
  }

  // Wrap |black_frame_| so we get a fresh timestamp we can modify. Frames
  // returned from this function may still be in use.
  scoped_refptr<media::VideoFrame> wrapped_black_frame =
      media::VideoFrame::WrapVideoFrame(black_frame_, black_frame_->format(),
                                        black_frame_->visible_rect(),
                                        black_frame_->natural_size());
  if (!wrapped_black_frame)
    return nullptr;

  wrapped_black_frame->set_timestamp(reference_frame.timestamp());
  base::TimeTicks reference_time;
  if (reference_frame.metadata()->GetTimeTicks(
          media::VideoFrameMetadata::REFERENCE_TIME, &reference_time)) {
    wrapped_black_frame->metadata()->SetTimeTicks(
        media::VideoFrameMetadata::REFERENCE_TIME, reference_time);
  }

  return wrapped_black_frame;
}

// static
WebMediaStreamTrack MediaStreamVideoTrack::CreateVideoTrack(
    MediaStreamVideoSource* source,
    MediaStreamVideoSource::ConstraintsOnceCallback callback,
    bool enabled) {
  WebMediaStreamTrack track;
  track.Initialize(source->Owner());
  track.SetPlatformTrack(std::make_unique<MediaStreamVideoTrack>(
      source, std::move(callback), enabled));
  return track;
}

// static
WebMediaStreamTrack MediaStreamVideoTrack::CreateVideoTrack(
    const WebString& id,
    MediaStreamVideoSource* source,
    MediaStreamVideoSource::ConstraintsOnceCallback callback,
    bool enabled) {
  WebMediaStreamTrack track;
  track.Initialize(id, source->Owner());
  track.SetPlatformTrack(std::make_unique<MediaStreamVideoTrack>(
      source, std::move(callback), enabled));
  return track;
}

// static
WebMediaStreamTrack MediaStreamVideoTrack::CreateVideoTrack(
    MediaStreamVideoSource* source,
    const VideoTrackAdapterSettings& adapter_settings,
    const base::Optional<bool>& noise_reduction,
    bool is_screencast,
    const base::Optional<double>& min_frame_rate,
    MediaStreamVideoSource::ConstraintsOnceCallback callback,
    bool enabled) {
  WebMediaStreamTrack track;
  track.Initialize(source->Owner());
  track.SetPlatformTrack(std::make_unique<MediaStreamVideoTrack>(
      source, adapter_settings, noise_reduction, is_screencast, min_frame_rate,
      std::move(callback), enabled));
  return track;
}

// static
MediaStreamVideoTrack* MediaStreamVideoTrack::GetVideoTrack(
    const WebMediaStreamTrack& track) {
  if (track.IsNull() ||
      track.Source().GetType() != WebMediaStreamSource::kTypeVideo) {
    return nullptr;
  }
  return static_cast<MediaStreamVideoTrack*>(track.GetPlatformTrack());
}

MediaStreamVideoTrack::MediaStreamVideoTrack(
    MediaStreamVideoSource* source,
    MediaStreamVideoSource::ConstraintsOnceCallback callback,
    bool enabled)
    : WebPlatformMediaStreamTrack(true),
      adapter_settings_(std::make_unique<VideoTrackAdapterSettings>(
          VideoTrackAdapterSettings())),
      is_screencast_(false),
      source_(source->GetWeakPtr()) {
  frame_deliverer_ =
      base::MakeRefCounted<MediaStreamVideoTrack::FrameDeliverer>(
          source->io_task_runner(), weak_factory_.GetWeakPtr(), enabled);
  source->AddTrack(
      this, VideoTrackAdapterSettings(),
      ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
          &MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO,
          frame_deliverer_)),
      ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
          &MediaStreamVideoTrack::FrameDeliverer::DeliverEncodedVideoFrameOnIO,
          frame_deliverer_)),
      media::BindToCurrentLoop(WTF::BindRepeating(
          &MediaStreamVideoTrack::SetSizeAndComputedFrameRate,
          weak_factory_.GetWeakPtr())),
      media::BindToCurrentLoop(
          WTF::BindRepeating(&MediaStreamVideoTrack::set_computed_source_format,
                             weak_factory_.GetWeakPtr())),
      std::move(callback));
}

MediaStreamVideoTrack::MediaStreamVideoTrack(
    MediaStreamVideoSource* source,
    const VideoTrackAdapterSettings& adapter_settings,
    const base::Optional<bool>& noise_reduction,
    bool is_screen_cast,
    const base::Optional<double>& min_frame_rate,
    MediaStreamVideoSource::ConstraintsOnceCallback callback,
    bool enabled)
    : WebPlatformMediaStreamTrack(true),
      adapter_settings_(
          std::make_unique<VideoTrackAdapterSettings>(adapter_settings)),
      noise_reduction_(noise_reduction),
      is_screencast_(is_screen_cast),
      min_frame_rate_(min_frame_rate),
      source_(source->GetWeakPtr()) {
  frame_deliverer_ =
      base::MakeRefCounted<MediaStreamVideoTrack::FrameDeliverer>(
          source->io_task_runner(), weak_factory_.GetWeakPtr(), enabled);
  source->AddTrack(
      this, adapter_settings,
      ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
          &MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO,
          frame_deliverer_)),
      ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
          &MediaStreamVideoTrack::FrameDeliverer::DeliverEncodedVideoFrameOnIO,
          frame_deliverer_)),
      media::BindToCurrentLoop(WTF::BindRepeating(
          &MediaStreamVideoTrack::SetSizeAndComputedFrameRate,
          weak_factory_.GetWeakPtr())),
      media::BindToCurrentLoop(
          WTF::BindRepeating(&MediaStreamVideoTrack::set_computed_source_format,
                             weak_factory_.GetWeakPtr())),
      std::move(callback));
}

MediaStreamVideoTrack::~MediaStreamVideoTrack() {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  DCHECK(sinks_.empty());
  DCHECK(encoded_sinks_.empty());
  Stop();
  DVLOG(3) << "~MediaStreamVideoTrack()";
}

static void AddSinkInternal(std::vector<WebMediaStreamSink*>* sinks,
                            WebMediaStreamSink* sink) {
  DCHECK(!base::Contains(*sinks, sink));
  sinks->push_back(sink);
}

static void RemoveSinkInternal(std::vector<WebMediaStreamSink*>* sinks,
                               WebMediaStreamSink* sink) {
  auto it = std::find(sinks->begin(), sinks->end(), sink);
  DCHECK(it != sinks->end());
  sinks->erase(it);
}

void MediaStreamVideoTrack::AddSink(WebMediaStreamSink* sink,
                                    const VideoCaptureDeliverFrameCB& callback,
                                    bool is_sink_secure) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  AddSinkInternal(&sinks_, sink);
  frame_deliverer_->AddCallback(sink, callback);
  secure_tracker_.Add(sink, is_sink_secure);
  // Request source to deliver a frame because a new sink is added.
  if (!source_)
    return;
  UpdateSourceHasConsumers();
  source_->RequestRefreshFrame();
  source_->UpdateCapturingLinkSecure(this,
                                     secure_tracker_.is_capturing_secure());
}

void MediaStreamVideoTrack::AddEncodedSink(WebMediaStreamSink* sink,
                                           EncodedVideoFrameCB callback) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  AddSinkInternal(&encoded_sinks_, sink);
  frame_deliverer_->AddEncodedCallback(sink, std::move(callback));
  if (source_)
    source_->UpdateNumEncodedSinks();
  UpdateSourceHasConsumers();
}

void MediaStreamVideoTrack::RemoveSink(WebMediaStreamSink* sink) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  RemoveSinkInternal(&sinks_, sink);
  frame_deliverer_->RemoveCallback(sink);
  secure_tracker_.Remove(sink);
  if (!source_)
    return;
  UpdateSourceHasConsumers();
  source_->UpdateCapturingLinkSecure(this,
                                     secure_tracker_.is_capturing_secure());
}

void MediaStreamVideoTrack::RemoveEncodedSink(WebMediaStreamSink* sink) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  RemoveSinkInternal(&encoded_sinks_, sink);
  frame_deliverer_->RemoveEncodedCallback(sink);
  if (source_)
    source_->UpdateNumEncodedSinks();
  UpdateSourceHasConsumers();
}

void MediaStreamVideoTrack::UpdateSourceHasConsumers() {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  if (!source_)
    return;
  bool has_consumers = !sinks_.empty() || !encoded_sinks_.empty();
  source_->UpdateHasConsumers(this, has_consumers);
}

void MediaStreamVideoTrack::SetEnabled(bool enabled) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  // If enabled, encoded sinks exist and the source supports encoded output, we
  // need a new keyframe from the source as we may have dropped data making the
  // stream undecodable.
  bool maybe_await_key_frame = false;
  if (enabled && source_ && source_->SupportsEncodedOutput() &&
      !encoded_sinks_.empty()) {
    source_->RequestRefreshFrame();
    maybe_await_key_frame = true;
  }
  frame_deliverer_->SetEnabled(enabled, maybe_await_key_frame);
  for (auto* sink : sinks_)
    sink->OnEnabledChanged(enabled);
  for (auto* encoded_sink : encoded_sinks_)
    encoded_sink->OnEnabledChanged(enabled);
}

size_t MediaStreamVideoTrack::CountEncodedSinks() const {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  return encoded_sinks_.size();
}

void MediaStreamVideoTrack::SetContentHint(
    WebMediaStreamTrack::ContentHintType content_hint) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  for (auto* sink : sinks_)
    sink->OnContentHintChanged(content_hint);
  for (auto* encoded_sink : encoded_sinks_)
    encoded_sink->OnContentHintChanged(content_hint);
}

void MediaStreamVideoTrack::StopAndNotify(base::OnceClosure callback) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  if (source_) {
    source_->RemoveTrack(this, std::move(callback));
    source_ = nullptr;
  } else if (callback) {
    std::move(callback).Run();
  }
  OnReadyStateChanged(WebMediaStreamSource::kReadyStateEnded);
}

void MediaStreamVideoTrack::GetSettings(
    WebMediaStreamTrack::Settings& settings) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  if (!source_)
    return;

  if (width_ && height_) {
    settings.width = width_;
    settings.height = height_;
    settings.aspect_ratio = static_cast<double>(width_) / height_;
  }

  // 0.0 means the track is using the source's frame rate.
  if (frame_rate_ != 0.0) {
    settings.frame_rate = frame_rate_;
  }

  base::Optional<media::VideoCaptureFormat> format =
      source_->GetCurrentFormat();
  if (format) {
    if (frame_rate_ == 0.0)
      settings.frame_rate = format->frame_rate;
    settings.video_kind = GetVideoKindForFormat(*format);
  } else {
    // Format is only set for local tracks. For other tracks, use the frame rate
    // reported through settings callback SetSizeAndComputedFrameRate().
    if (computed_frame_rate_)
      settings.frame_rate = *computed_frame_rate_;
  }

  settings.facing_mode = ToWebFacingMode(source_->device().video_facing);
  settings.resize_mode = WebString::FromASCII(std::string(
      adapter_settings().target_size() ? WebMediaStreamTrack::kResizeModeRescale
                                       : WebMediaStreamTrack::kResizeModeNone));
  if (source_->device().display_media_info.has_value()) {
    const auto& info = source_->device().display_media_info.value();
    settings.display_surface = info->display_surface;
    settings.logical_surface = info->logical_surface;
    settings.cursor = info->cursor;
  }
}

void MediaStreamVideoTrack::OnReadyStateChanged(
    WebMediaStreamSource::ReadyState state) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  for (auto* sink : sinks_)
    sink->OnReadyStateChanged(state);
  for (auto* encoded_sink : encoded_sinks_)
    encoded_sink->OnReadyStateChanged(state);
}

void MediaStreamVideoTrack::SetTrackAdapterSettings(
    const VideoTrackAdapterSettings& settings) {
  adapter_settings_ = std::make_unique<VideoTrackAdapterSettings>(settings);
}

media::VideoCaptureFormat MediaStreamVideoTrack::GetComputedSourceFormat() {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  return computed_source_format_;
}

void MediaStreamVideoTrack::OnFrameDropped(
    media::VideoCaptureFrameDropReason reason) {
  DCHECK_CALLED_ON_VALID_THREAD(main_render_thread_checker_);
  if (!source_)
    return;
  source_->OnFrameDropped(reason);
}

}  // namespace blink


text:
"""
@copyright   Copyright (c) 2014 Submit Consulting
@author      Angel Sullon (@asullom)
@package     params

Descripcion: Testing de los models de la app params
"""
from django.test import TestCase


text:
<?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="582">
  <!-- This xml conforms to an XML Schema at:
    http://clinicaltrials.gov/ct2/html/images/info/public.xsd
 and an XML DTD at:
    http://clinicaltrials.gov/ct2/html/images/info/public.dtd -->
  <required_header>
    <download_date>ClinicalTrials.gov processed this data on May 14, 2015</download_date>
    <link_text>Link to the current ClinicalTrials.gov record.</link_text>
    <url>http://clinicaltrials.gov/show/NCT00227617</url>
  </required_header>
  <id_info>
    <org_study_id>04458</org_study_id>
    <secondary_id>P30CA082103</secondary_id>
    <secondary_id>UCSF-04458</secondary_id>
    <nct_id>NCT00227617</nct_id>
  </id_info>
  <brief_title>Combination Chemotherapy and Bevacizumab in Treating Patients With Advanced Neuroendocrine Tumors</brief_title>
  <official_title>A Pilot Study of FOLFOX in Combination With Bevacizumab in Patients With Advanced Neuroendocrine Tumors</official_title>
  <sponsors>
    <lead_sponsor>
      <agency>University of California, San Francisco</agency>
      <agency_class>Other</agency_class>
    </lead_sponsor>
    <collaborator>
      <agency>National Cancer Institute (NCI)</agency>
      <agency_class>NIH</agency_class>
    </collaborator>
    <collaborator>
      <agency>Genentech, Inc.</agency>
      <agency_class>Industry</agency_class>
    </collaborator>
    <collaborator>
      <agency>Sanofi</agency>
      <agency_class>Industry</agency_class>
    </collaborator>
  </sponsors>
  <source>University of California, San Francisco</source>
  <oversight_info>
    <authority>United States: Food and Drug Administration</authority>
    <has_dmc>Yes</has_dmc>
  </oversight_info>
  <brief_summary>
    <textblock>
      RATIONALE: Drugs used in chemotherapy, such as fluorouracil, leucovorin, and oxaliplatin,
      work in different ways to stop the growth of tumor cells, either by killing the cells or by
      stopping them from dividing. Monoclonal antibodies, such as bevacizumab, can block tumor
      growth in different ways. Some block the ability of tumor cells to grow and spread. Others
      find tumor cells and help kill them or carry tumor-killing substances to them. Bevacizumab
      may also stop the growth of neuroendocrine tumors by blocking blood flow to the tumor.
      Giving combination chemotherapy together with bevacizumab may kill more tumor cells.

      PURPOSE: This phase I/II trial is studying the side effects of giving combination
      chemotherapy together with bevacizumab and to see how well it works in treating patients
      with advanced neuroendocrine tumors.
    </textblock>
  </brief_summary>
  <detailed_description>
    <textblock>
      OBJECTIVES:

      Primary

        -  Determine the safety of fluorouracil, leucovorin calcium, and oxaliplatin (FOLFOX) with
           bevacizumab in patients with advanced neuroendocrine tumors.

        -  Determine the best overall response rate in patients treated with this regimen.

      Secondary

        -  Determine the overall survival of patients treated with this regimen.

        -  Determine the time to treatment failure and progression in patients treated with this
           regimen.

        -  Determine the biochemical marker response in patients treated with this regimen.

      OUTLINE: This is an open-label, pilot study. Patients are stratified according to tumor type
      (carcinoid vs islet cell vs poorly differentiated neuroendocrine).

      Patients receive oxaliplatin IV over 2 hours and leucovorin calcium IV over 2 hours on day 1
      and fluorouracil IV continuously over 46-48 hours beginning on day 1. Patients also receive
      bevacizumab IV over 30-90 minutes on day 1. Treatment repeats every 14 days for up to 26
      courses in the absence of disease progression or unacceptable toxicity.

      After completion of study treatment, patients are followed every 3 months.

      PROJECTED ACCRUAL: A total of 39-102 patients (13-34 per stratum) will be accrued for this
      study.
    </textblock>
  </detailed_description>
  <overall_status>Active, not recruiting</overall_status>
  <start_date>June 2005</start_date>
  <completion_date type="Anticipated">June 2016</completion_date>
  <primary_completion_date type="Actual">January 2012</primary_completion_date>
  <phase>Phase 2/Phase 3</phase>
  <study_type>Interventional</study_type>
  <study_design>Endpoint Classification: Safety/Efficacy Study, Intervention Model: Single Group Assignment, Masking: Open Label, Primary Purpose: Treatment</study_design>
  <primary_outcome>
    <measure>The rate of discontinuation due to adverse events (besides neuropathy) possibly related to study treatment.</measure>
    <time_frame>During study treatment period, expected to be up to 2 - 18 months; Post-study survival follow-up period, up to 2-8 years</time_frame>
    <safety_issue>Yes</safety_issue>
    <description>Carcinoid Tumors: 2-8 months median time to progression Pancreatic Neuroendocrine Tumors: 15-18 months median time to progression Poorly Differentiated Neuroendocrine Tumors: 9-11 months median time to progression</description>
  </primary_outcome>
  <primary_outcome>
    <measure>Objective radiographic response rate</measure>
    <time_frame>During study treatment period, expected to be up to 2 - 18 months; Post-study survival follow-up period, up to 2-8 years</time_frame>
    <safety_issue>No</safety_issue>
    <description>Carcinoid Tumors: 2-8 months median time to progression Pancreatic Neuroendocrine Tumors: 15-18 months median time to progression Poorly Differentiated Neuroendocrine Tumors: 9-11 months median time to progression</description>
  </primary_outcome>
  <secondary_outcome>
    <measure>Overall survival</measure>
    <time_frame>until death</time_frame>
    <safety_issue>No</safety_issue>
  </secondary_outcome>
  <secondary_outcome>
    <measure>Time to treatment failure</measure>
    <time_frame>until patient went off study</time_frame>
    <safety_issue>No</safety_issue>
  </secondary_outcome>
  <secondary_outcome>
    <measure>Time to progression</measure>
    <time_frame>Until patient went off study and until death</time_frame>
    <safety_issue>No</safety_issue>
  </secondary_outcome>
  <secondary_outcome>
    <measure>Biochemical marker response</measure>
    <time_frame>Until patient went off study</time_frame>
    <safety_issue>No</safety_issue>
  </secondary_outcome>
  <number_of_arms>1</number_of_arms>
  <enrollment type="Anticipated">70</enrollment>
  <condition>Gastrointestinal Carcinoid Tumor</condition>
  <condition>Islet Cell Tumor</condition>
  <condition>Lung Cancer</condition>
  <condition>Neoplastic Syndrome</condition>
  <condition>Neuroendocrine Tumor</condition>
  <arm_group>
    <arm_group_label>FOLFOX with Bevacizumab</arm_group_label>
    <arm_group_type>Experimental</arm_group_type>
    <description>Starting on Day 1, administered every two weeks:
5-fluorouracil: 2400 mg/ m2 CIV; over 46-48 hours Leucovorin: 200 mg/ m2; over 2 hours Oxaliplatin : 85 mg/m2; over 2 hours Bevacizumab: 5 mg/kg IV over 30-90 minutes</description>
  </arm_group>
  <intervention>
    <intervention_type>Biological</intervention_type>
    <intervention_name>bevacizumab</intervention_name>
    <description>5mg/kg IV q 2 wk on day 1. Initial study drug dose will be delivered over 90 +/- 15 minutes x1. If the first infusion is tolerated without fever/chills, the second infusion may be delivered over 60 +/- 10 minutes. If 60 minutes infusion is well tolerated, all subsequent infusions maybe be delivered over 30 +/- 10 minutes.</description>
    <arm_group_label>FOLFOX with Bevacizumab</arm_group_label>
    <other_name>Avastin</other_name>
  </intervention>
  <intervention>
    <intervention_type>Drug</intervention_type>
    <intervention_name>5-fluorouracil</intervention_name>
    <description>2400mg/m2 CIV over 46-48 hours D1-2 q2 weeks.</description>
    <arm_group_label>FOLFOX with Bevacizumab</arm_group_label>
    <other_name>5-FU</other_name>
    <other_name>Adrucil</other_name>
  </intervention>
  <intervention>
    <intervention_type>Drug</intervention_type>
    <intervention_name>leucovorin</intervention_name>
    <description>200mg/m2 IV q2 wk on day 1 over a 2-hour period.</description>
    <arm_group_label>FOLFOX with Bevacizumab</arm_group_label>
    <other_name>Folinic acid</other_name>
  </intervention>
  <intervention>
    <intervention_type>Drug</intervention_type>
    <intervention_name>oxaliplatin</intervention_name>
    <description>200mg/m2 IV q 2 wk on day 1 over a 2-hour period</description>
    <arm_group_label>FOLFOX with Bevacizumab</arm_group_label>
    <other_name>Eloxatin</other_name>
  </intervention>
  <eligibility>
    <criteria>
      <textblock>
        DISEASE CHARACTERISTICS:

          -  Histologically or cytologically confirmed neuroendocrine tumor (NET)

               -  Carcinoid at any site, with or without carcinoid syndrome

               -  Pancreatic islet cell tumor

                    -  Prior streptozocin-based therapy not required

               -  Poorly differentiated NET of any primary site (this arm closed to accrual May
                  2009)

                    -  Progression with prior treatment with cisplatin-, or carboplatin-based
                       chemotherapy required (unless contraindicated)

          -  The following tumors are not allowed:

               -  Endocrine organ carcinoma

               -  Adrenal gland malignancies

               -  Thyroid carcinoma of any histology

               -  Pheochromocytoma/paraganglioma

          -  Advanced disease

               -  Disease not amenable to surgery, radiotherapy, or combined modality therapy with
                  curative intent

          -  Radiologically or clinically confirmed progressive disease

               -  At least 25% increase in radiologically or clinically measurable disease

               -  At least 20% increase in the longest diameter (LD) of any previously documented
                  lesion

               -  Increase in the sum of the LD of multiple lesions in aggregate of 20%, OR
                  appearance of new lesions OR deterioration in clinical status

          -  Measurable disease

               -  At least 1 unidimensionally measurable lesion ≥ 20 mm by conventional
                  radiographic techniques OR ≥ 10 mm by spiral CT scan

                    -  Ultrasound or positron-emission tomography alone not sufficient

               -  Bone lesions, ascites, peritoneal carcinomatosis, pleural or pericardial
                  effusion, and irradiated lesions are not considered measurable disease

          -  Primary tumors of the pancreas should not invade adjacent organs (e.g., stomach or
             duodenum)

          -  No history or evidence of brain or leptomeningeal disease (baseline CNS imaging
             required if clinical suspicion of CNS metastases)

        PATIENT CHARACTERISTICS:

        Age

          -  18 and over

        Performance status

          -  ECOG 0-1

        Life expectancy

          -  More than 12 weeks

        Hematopoietic

          -  Absolute neutrophil count ≥ 1,500/mm^3

          -  Platelet count ≥ 100,000/mm^3

          -  No history of hemoptysis or bleeding diathesis

          -  No coagulopathy unrelated to therapeutic anticoagulation

          -  No significant bleeding events within the past 6 months unless the source of the
             bleeding has been resected

        Hepatic

          -  Bilirubin < 2 mg/dL

          -  ALT ≤ 2.5 times upper limit of normal (ULN) (5 times ULN if due to liver metastases)

        Renal

          -  Creatinine ≤ 2 mg/dL

          -  Protein ≤ 1+ OR

          -  Protein < 1 gm on 24-hour urine collection

          -  Urine protein:creatinine ratio < 1.0

        Cardiovascular

          -  History of thromboembolic condition allowed provided patient is on therapeutic
             anticoagulation at a stable dose for ≥ 4 weeks

               -  Concurrent daily prophylactic aspirin (< 325 mg/day) allowed

          -  No uncontrolled hypertension, myocardial infarction, clinically significant
             peripheral arterial ischemia, visceral arterial ischemia or angina within the past 6
             months

          -  No serious cardiac arrhythmia requiring medication

          -  No cerebrovascular event (e.g., stroke or transient ischemic attack) within the past
             12 months

          -  No history of peripheral vascular disease ≥ grade 2

          -  No history New York Heart Association class II-IV congestive heart failure

          -  Blood pressure ≤ 160/90 mm Hg

        Gastrointestinal

          -  No abdominal fistula, gastrointestinal perforation, or intra-abdominal abscess within
             the past 6 months

          -  No predisposing uncontrolled small bowel or colonic disorder

               -  Baseline disease-related diarrhea allowed if symptoms are stable and
                  well-characterized (i.e., # stools/day stable)

          -  No gastric or esophageal varices

          -  No gastroduodenal ulcers determined to be active by endoscopy

        Pulmonary

          -  No interstitial pneumonia or extensive and symptomatic interstitial fibrosis

          -  No lung tumor in close proximity to a major vessel, or with associated cavitation

          -  No pleural effusion or ascites that causes ≥ grade 2 dyspnea

        Other

          -  Not pregnant or nursing

          -  Negative pregnancy test

          -  Fertile patients must use effective contraception during and for at least 3 months
             after completion of study treatment

          -  No significant traumatic injury within the past 28 days

          -  No currently active second malignancy other than, non-melanoma skin cancer or
             carcinoma in situ

               -  Patients are not considered to have a currently active malignancy if they have
                  completed therapy and are considered by their physician to be at ≤ 30% risk for
                  relapse

          -  No known hypersensitivity reaction attributed to study drugs or to compounds of
             similar chemical or biological composition

          -  No symptomatic peripheral neuropathy > grade 1

          -  No other severe disease or comorbidity that would preclude study participation

          -  No medically uncontrolled seizures

          -  No active infection

          -  No serious non-healing wound, ulcer, or bone fracture

          -  No psychiatric illness or social situation that would preclude study compliance

          -  No other severe, concurrent disease, infection, or co-morbidity that in the judgement
             of the investigator would constitute a hazard for study participation

        PRIOR CONCURRENT THERAPY:

        Biologic therapy

          -  Recovered from prior cytokine therapy

          -  At least 4 weeks since prior immunotherapy

          -  No prior tyrosine kinase inhibitors or anti-vascular endothelial growth factor (VEGF)
             angiogenic inhibitors

        Chemotherapy

          -  See Disease Characteristics

          -  At least 4 weeks since prior chemotherapy

          -  No prior oxaliplatin

          -  Prior chemoembolization therapy allowed provided it did not affect areas of
             measurable disease

        Endocrine therapy

          -  Prior and concurrent somatostatin analogs allowed for symptomatic control and/or
             control of hormone hypersecretion only provided treatment was initiated > 3 months
             prior to study entry

        Radiotherapy

          -  See Disease Characteristics

          -  At least 4 weeks since prior radiotherapy and recovered

               -  Prior radiotherapy must not affect areas of measurable disease

          -  No concurrent radiotherapy to only site of measurable disease

        Surgery

          -  Recovered from prior surgery

          -  Prior cryotherapy allowed provided it did not affect areas of measurable disease

          -  At least 28 days since prior major surgical procedure or open biopsy

          -  At least 7 days since minor surgical procedure, fine-needle aspirations, or core
             biopsy

          -  No prior organ allograft

          -  No concurrent major surgery

        Other

          -  At least 4 weeks since prior participation in an experimental drug study

          -  No other concurrent investigational agents

          -  No other concurrent anticancer therapy

          -  No halogenated antiviral agents

          -  Concurrent antiplatelet agents allowed
      </textblock>
    </criteria>
    <gender>Both</gender>
    <minimum_age>18 Years</minimum_age>
    <maximum_age>N/A</maximum_age>
    <healthy_volunteers>No</healthy_volunteers>
  </eligibility>
  <overall_official>
    <last_name>Emily K. Bergsland, MD</last_name>
    <role>Principal Investigator</role>
    <affiliation>University of California, San Francisco</affiliation>
  </overall_official>
  <location>
    <facility>
      <name>UCSF Helen Diller Family Comprehensive Cancer Center</name>
      <address>
        <city>San Francisco</city>
        <state>California</state>
        <zip>94115</zip>
        <country>United States</country>
      </address>
    </facility>
  </location>
  <location>
    <facility>
      <name>Kaiser Permanente Medical Center - Vallejo</name>
      <address>
        <city>Vallejo</city>
        <state>California</state>
        <zip>94589</zip>
        <country>United States</country>
      </address>
    </facility>
  </location>
  <location_countries>
    <country>United States</country>
  </location_countries>
  <link>
    <url>http://cancer.gov/clinicaltrials/UCSF-04458</url>
    <description>Clinical trial summary from the National Cancer Institute's PDQ® database</description>
  </link>
  <verification_date>April 2015</verification_date>
  <lastchanged_date>April 7, 2015</lastchanged_date>
  <firstreceived_date>September 26, 2005</firstreceived_date>
  <responsible_party>
    <responsible_party_type>Sponsor</responsible_party_type>
  </responsible_party>
  <keyword>recurrent gastrointestinal carcinoid tumor</keyword>
  <keyword>regional gastrointestinal carcinoid tumor</keyword>
  <keyword>pulmonary carcinoid tumor</keyword>
  <keyword>gastrinoma</keyword>
  <keyword>insulinoma</keyword>
  <keyword>WDHA syndrome</keyword>
  <keyword>glucagonoma</keyword>
  <keyword>pancreatic polypeptide tumor</keyword>
  <keyword>somatostatinoma</keyword>
  <keyword>recurrent islet cell carcinoma</keyword>
  <keyword>metastatic gastrointestinal carcinoid tumor</keyword>
  <is_fda_regulated>Yes</is_fda_regulated>
  <is_section_801>Yes</is_section_801>
  <has_expanded_access>No</has_expanded_access>
  <condition_browse>
    <!-- CAUTION:  The following MeSH terms are assigned with an imperfect algorithm  -->
    <mesh_term>Apudoma</mesh_term>
    <mesh_term>Carcinoid Tumor</mesh_term>
    <mesh_term>Gastrointestinal Neoplasms</mesh_term>
    <mesh_term>Malignant Carcinoid Syndrome</mesh_term>
    <mesh_term>Neoplasms</mesh_term>
    <mesh_term>Neuroendocrine Tumors</mesh_term>
  </condition_browse>
  <intervention_browse>
    <!-- CAUTION:  The following MeSH terms are assigned with an imperfect algorithm  -->
    <mesh_term>Bevacizumab</mesh_term>
    <mesh_term>Fluorouracil</mesh_term>
    <mesh_term>Oxaliplatin</mesh_term>
  </intervention_browse>
  <!-- Results have not yet been posted for this study                                -->
</clinical_study>


text:
.subcategory-title {
    font-size: 1.3em;
}

.category-list .subcategory-table td {
    vertical-align: middle;
}

.category-list .subcategory-table td p {
    vertical-align: middle;
    margin-bottom: 0;
}

.thread-list .thread-table td p {
    vertical-align: middle;
    margin-bottom: 0;
}

.liddleforum-post {
    padding: 10px;
    background-color: #f3f3f3;
    border-radius: 5px;
    color: #333;
    margin-bottom: 20px;
    position: relative;
}

.liddleforum-container .thread-title {
    margin-bottom: 20px;
    font-weight: bold;
}

.liddleforum-container .liddleforum-avatar {
    float: left;
    margin: 5px;
    margin-right: 15px;
    position: absolute;
    left: 10px;
}

.liddleforum-container .liddleforum-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.liddleforum-container .post-body {
    margin-left: 80px;
    min-height: 70px;
}

.liddleforum-icon-locked {
    color: #d0c700;
    font-weight: bold;
}

.liddleforum-icon-stickied {
    color: #099709;
    font-weight: bold;
}


text:
// ----------------------------------------------------------------------
// This code is developed as part of the Java CoG Kit project
// The terms of the license can be found at http://www.cogkit.org/license
// This message may not be removed or altered.
// ----------------------------------------------------------------------

package org.globus.cog.abstraction.impl.common.task;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector;

import org.globus.cog.abstraction.interfaces.Specification;
import org.globus.cog.abstraction.interfaces.WSInvocationSpecification;

public class WSInvocationSpecificationImpl implements WSInvocationSpecification {

    private static final long serialVersionUID = 1L;

    private int type;
    private String method;
    private Hashtable<String,Object> additionalAttributes;
    private Vector<String> arguments;

    public WSInvocationSpecificationImpl() {
        this.type = Specification.WS_INVOCATION;
        this.additionalAttributes = new Hashtable<String,Object>();
        this.arguments = new Vector<String>();
    }

    public void setType(int type) {
        // By default = WS_INVOCATION
    }

    public int getType() {
        return this.type;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getMethod() {

        return this.method;
    }

    public String[] getArgumentsAsArray() {
        int count = this.arguments.size();
        String args[] = new String[count];
        for (int i = 0; i < count; i++) {
            args[i] = (String) this.arguments.get(i);
        }
        return args;
    }

    public void addArgument(String argument) {
        this.arguments.add(argument);
    }

    public void addArgument(int index, String argument) {
        this.arguments.ensureCapacity(index + 1);
        this.arguments.add(index, argument);
    }

    public void removeArgument(String argument) {
        this.arguments.remove(argument);
    }

    public String removeArgument(int index) {
        return (String) this.arguments.remove(index);
    }

    public Vector<String> getArgumentsAsVector() {
        return this.arguments;
    }

    public void setArguments(Vector<String> arguments) {
        this.arguments = arguments;
    }

    public void setArguments(String arguments) {
        this.arguments = new Vector<String>();
        StringTokenizer st = new StringTokenizer(arguments);
        while (st.hasMoreTokens()) {
            this.arguments.add(st.nextToken());
        }
    }

    public String getArguments() {
        return getArgumentsAsString();
    }

    public String getArgumentsAsString() {
        String arg;
        if (!this.arguments.isEmpty()) {
            arg = "";
            Enumeration en = this.arguments.elements();
            while (en.hasMoreElements()) {
                String str = (String) en.nextElement();
                arg = arg + str + " ";
            }
            arg = arg.trim();
        } else {
            arg = null;
        }
        return arg;
    }

    public void setAttribute(String name, Object value) {
        this.additionalAttributes.put(name, value);
    }

    public Object getAttribute(String name) {
        return (String) this.additionalAttributes.get(name);
    }

    public Enumeration getAllAttributes() {
        return this.additionalAttributes.keys();
    }

    public void setSpecification(String specification) {
    }

    public String getSpecification() {

        return null;
    }

    @SuppressWarnings("unchecked")
    public Object clone() {
        WSInvocationSpecificationImpl result = null;
        try {
            result = (WSInvocationSpecificationImpl) super.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        result.arguments = (Vector<String>) arguments.clone();
        return result;
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/language/v1/language_service.proto

namespace Google\Cloud\Language\V1;

use UnexpectedValueException;

/**
 * Represents the text encoding that the caller uses to process the output.
 * Providing an `EncodingType` is recommended because the API provides the
 * beginning offsets for various outputs, such as tokens and mentions, and
 * languages that natively use different text encodings may access offsets
 * differently.
 *
 * Protobuf type google.cloud.language.v1.EncodingType
 */
class EncodingType
{
    /**
     * If `EncodingType` is not specified, encoding-dependent information (such as
     * `begin_offset`) will be set at `-1`.
     *
     * Generated from protobuf enum NONE = 0;
     */
    const NONE = 0;
    /**
     * Encoding-dependent information (such as `begin_offset`) is calculated based
     * on the UTF-8 encoding of the input. C++ and Go are examples of languages
     * that use this encoding natively.
     *
     * Generated from protobuf enum UTF8 = 1;
     */
    const UTF8 = 1;
    /**
     * Encoding-dependent information (such as `begin_offset`) is calculated based
     * on the UTF-16 encoding of the input. Java and JavaScript are examples of
     * languages that use this encoding natively.
     *
     * Generated from protobuf enum UTF16 = 2;
     */
    const UTF16 = 2;
    /**
     * Encoding-dependent information (such as `begin_offset`) is calculated based
     * on the UTF-32 encoding of the input. Python is an example of a language
     * that uses this encoding natively.
     *
     * Generated from protobuf enum UTF32 = 3;
     */
    const UTF32 = 3;

    private static $valueToName = [
        self::NONE => 'NONE',
        self::UTF8 => 'UTF8',
        self::UTF16 => 'UTF16',
        self::UTF32 => 'UTF32',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }

    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


text:
package aws.daleks

import rx.lang.scala._
import scala.collection.JavaConverters._
import com.amazonaws.regions.Region
import java.util.List
import java.util.Collections
//import aws.daleks.RxDalek

case class PrototypeDalek() extends RxDalek[Any] {

  override def list() = Collections.emptyList()
  override def exterminate(ar: Any) = {}
  override def describe(ar: Any) = Map()

}


text:
module core {
	/**
     * 本类为webSocket事件数据类
     */
    export class SocketEventData extends EventData {

        public constructor(messageID: string, messageData?: core.ByteBuffer) {
            super(messageID, messageData);
        }
    }
}