text:
package Paws::SQS::CreateQueue;
  use Moose;
  has Attributes => (is => 'ro', isa => 'Paws::SQS::QueueAttributeMap', traits => ['NameInRequest'], request_name => 'Attribute' );
  has QueueName => (is => 'ro', isa => 'Str', required => 1);

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateQueue');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SQS::CreateQueueResult');
  class_has _result_key => (isa => 'Str', is => 'ro', default => 'CreateQueueResult');
1;

### main pod documentation begin ###

=head1 NAME

Paws::SQS::CreateQueue - Arguments for method CreateQueue on Paws::SQS

=head1 DESCRIPTION

This class represents the parameters used for calling the method CreateQueue on the
Amazon Simple Queue Service service. Use the attributes of this class
as arguments to method CreateQueue.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateQueue.

As an example:

  $service_obj->CreateQueue(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 Attributes => L<Paws::SQS::QueueAttributeMap>

A map of attributes with their corresponding values.

The following lists the names, descriptions, and values of the special
request parameters that the C<CreateQueue> action uses:

=over

=item *

C<DelaySeconds> - The length of time, in seconds, for which the
delivery of all messages in the queue is delayed. Valid values: An
integer from 0 to 900 seconds (15 minutes). The default is 0 (zero).

=item *

C<MaximumMessageSize> - The limit of how many bytes a message can
contain before Amazon SQS rejects it. Valid values: An integer from
1,024 bytes (1 KiB) to 262,144 bytes (256 KiB). The default is 262,144
(256 KiB).

=item *

C<MessageRetentionPeriod> - The length of time, in seconds, for which
Amazon SQS retains a message. Valid values: An integer from 60 seconds
(1 minute) to 1,209,600 seconds (14 days). The default is 345,600 (4
days).

=item *

C<Policy> - The queue's policy. A valid AWS policy. For more
information about policy structure, see Overview of AWS IAM Policies in
the I<Amazon IAM User Guide>.

=item *

C<ReceiveMessageWaitTimeSeconds> - The length of time, in seconds, for
which a C< ReceiveMessage > action waits for a message to arrive. Valid
values: An integer from 0 to 20 (seconds). The default is 0 (zero).

=item *

C<RedrivePolicy> - The string that includes the parameters for the
dead-letter queue functionality of the source queue. For more
information about the redrive policy and dead-letter queues, see Using
Amazon SQS Dead-Letter Queues in the I<Amazon SQS Developer Guide>.

=over

=item *

C<deadLetterTargetArn> - The Amazon Resource Name (ARN) of the
dead-letter queue to which Amazon SQS moves messages after the value of
C<maxReceiveCount> is exceeded.

=item *

C<maxReceiveCount> - The number of times a message is delivered to the
source queue before being moved to the dead-letter queue.

=back

The dead-letter queue of a FIFO queue must also be a FIFO queue.
Similarly, the dead-letter queue of a standard queue must also be a
standard queue.

=item *

C<VisibilityTimeout> - The visibility timeout for the queue. Valid
values: An integer from 0 to 43,200 (12 hours). The default is 30. For
more information about the visibility timeout, see Visibility Timeout
in the I<Amazon SQS Developer Guide>.

=back

The following attributes apply only to server-side-encryption:

=over

=item *

C<KmsMasterKeyId> - The ID of an AWS-managed customer master key (CMK)
for Amazon SQS or a custom CMK. For more information, see Key Terms.
While the alias of the AWS-managed CMK for Amazon SQS is always
C<alias/aws/sqs>, the alias of a custom CMK can, for example, be
C<alias/I<MyAlias> >. For more examples, see KeyId in the I<AWS Key
Management Service API Reference>.

=item *

C<KmsDataKeyReusePeriodSeconds> - The length of time, in seconds, for
which Amazon SQS can reuse a data key to encrypt or decrypt messages
before calling AWS KMS again. An integer representing seconds, between
60 seconds (1 minute) and 86,400 seconds (24 hours). The default is 300
(5 minutes). A shorter time period provides better security but results
in more calls to KMS which might incur charges after Free Tier. For
more information, see How Does the Data Key Reuse Period Work?.

=back

The following attributes apply only to FIFO (first-in-first-out)
queues:

=over

=item *

C<FifoQueue> - Designates a queue as FIFO. Valid values: C<true>,
C<false>. You can provide this attribute only during queue creation.
You can't change it for an existing queue. When you set this attribute,
you must also provide the C<MessageGroupId> for your messages
explicitly.

For more information, see FIFO Queue Logic in the I<Amazon SQS
Developer Guide>.

=item *

C<ContentBasedDeduplication> - Enables content-based deduplication.
Valid values: C<true>, C<false>. For more information, see Exactly-Once
Processing in the I<Amazon SQS Developer Guide>.

=over

=item *

Every message must have a unique C<MessageDeduplicationId>,

=over

=item *

You may provide a C<MessageDeduplicationId> explicitly.

=item *

If you aren't able to provide a C<MessageDeduplicationId> and you
enable C<ContentBasedDeduplication> for your queue, Amazon SQS uses a
SHA-256 hash to generate the C<MessageDeduplicationId> using the body
of the message (but not the attributes of the message).

=item *

If you don't provide a C<MessageDeduplicationId> and the queue doesn't
have C<ContentBasedDeduplication> set, the action fails with an error.

=item *

If the queue has C<ContentBasedDeduplication> set, your
C<MessageDeduplicationId> overrides the generated one.

=back

=item *

When C<ContentBasedDeduplication> is in effect, messages with identical
content sent within the deduplication interval are treated as
duplicates and only one copy of the message is delivered.

=item *

If you send one message with C<ContentBasedDeduplication> enabled and
then another message with a C<MessageDeduplicationId> that is the same
as the one generated for the first C<MessageDeduplicationId>, the two
messages are treated as duplicates and only one copy of the message is
delivered.

=back

=back

Any other valid special request parameters (such as the following) are
ignored:

=over

=item *

C<ApproximateNumberOfMessages>

=item *

C<ApproximateNumberOfMessagesDelayed>

=item *

C<ApproximateNumberOfMessagesNotVisible>

=item *

C<CreatedTimestamp>

=item *

C<LastModifiedTimestamp>

=item *

C<QueueArn>

=back

=head2 B<REQUIRED> QueueName => Str

The name of the new queue. The following limits apply to this name:

=over

=item *

A queue name can have up to 80 characters.

=item *

Valid values: alphanumeric characters, hyphens (C<->), and underscores
(C<_>).

=item *

A FIFO queue name must end with the C<.fifo> suffix.

=back

Queue names are case-sensitive.

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method CreateQueue in L<Paws::SQS>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
<?php

// load Zend_Search_Lucene
xfLuceneZendManager::load();

/**
 * An convenience analyzer to provide a shortcut to setting up the analyzers.
 *
 * @package sfLucene
 * @subpackage Analyzer
 * @author Carl Vondrick
 */
final class xfLuceneAnalyzer extends Zend_Search_Lucene_Analysis_Analyzer
{
  /**
   * Flag for text
   */
  const TEXT = 0;

  /**
   * Flag for utf8
   */
  const UTF8 = 1;

  /**
   * Flag for numbers
   */
  const NUMBERS = 2;

  /**
   * Flag for case insensitive.
   */
  const CASE_INSENSITIVE = 4;

  /**
   * The configured analyzer
   *
   * @var Zend_Search_Lucene_Analysis_Analyzer_Common
   */
  private $analyzer;

  /**
   * The analyzer clss
   *
   * @var string
   */
  private $analyzerClass;

  /**
   * The registered filters
   *
   * @param array
   */
  private $filters = array();

  /**
   * Flag to indicate if the analyzer has been modified.
   *
   * True if modified, false otherwise
   *
   * @var bool
   */
  private $modified = false;

  /**
   * The initialized mode.
   *
   * @var int
   */
  private $mode = 0;

  /**
   * Constructor
   *
   * @param int $mode The mode
   */
  public function __construct($mode = 0)
  {
    $this->initialize($mode);

    $this->setCaseInsensitive();
  }

  /**
   * Initializes the analyzer.  This will also remove any old customizations.
   *
   * @param int $mode The mode
   */
  public function initialize($mode)
  {
    $class = 'Zend_Search_Lucene_Analysis_Analyzer_Common_';

    if ($mode & self::UTF8)
    {
      $class .= 'Utf8';
    }
    else
    {
      $class .= 'Text';
    }

    if ($mode & self::NUMBERS)
    {
      $class .= 'Num';
    }

    $this->analyzerClass = $class;
    $this->mode = $mode;
    $this->modified = true;
  }

  /**
   * Makes the analyzer case insensitive
   */
  public function setCaseInsensitive()
  {
    $this->setCaseSensitive();

    $filter = 'Zend_Search_Lucene_Analysis_TokenFilter_Lowercase';
    if ($this->mode & self::UTF8)
    {
      $filter .= 'Utf8';
    }

    $this->addFilter(new $filter);
  }

  /**
   * Makes the analyzer case sensitive
   */
  public function setCaseSensitive()
  {
    $this->removeFilter('Zend_Search_Lucene_Analysis_TokenFilter_LowerCase');
    $this->removeFilter('Zend_Search_Lucene_Analysis_TokenFilter_LowerCaseUtf8');
  }

  /**
   * Configures the stop words
   *
   * If any of these words appear, they will be thrown out.
   *
   * @param array $words
   */
  public function addStopWords(array $words)
  {
    $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_StopWords($words));
  }

  /**
   * Configures the stop words from file.
   *
   * One word per line.  If it starts with a #, it's ignored.
   *
   * @param string $file
   */
  public function addStopWordsFromFile($file)
  {
    $filter = new Zend_Search_Lucene_Analysis_TokenFilter_StopWords;
    $filter->loadFromFile($file);

    $this->addFilter($filter);
  }

  /**
   * Sets the short word length
   *
   * If a word is less than the required length, it will be thrown out.
   *
   * @param int $lenght
   */
  public function setShortWordLength($length)
  {
    $this->removeFilter('Zend_Search_Lucene_Analysis_TokenFilter_ShortWords');

    $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_ShortWords($length));
  }

  /**
   * Sets a stemmer.
   *
   * @param xfLuceneStemmer $stemmer
   */
  public function setStemmer(xfLuceneStemmer $stemmer)
  {
    $this->addFilter(new xfLuceneStemmerTokenFilter($stemmer));
  }

  /**
   * Adds a filter to the queue
   *
   * @param Zend_Search_Lucene_Analysis_TokenFilter $filter
   */
  public function addFilter(Zend_Search_Lucene_Analysis_TokenFilter $filter)
  {
    $this->modified = true;
    $this->filters[] = $filter;
  }

  /**
   * Removes a filter by class instance
   *
   * @param string $name
   */
  public function removeFilter($name)
  {
    $filters = array();
    foreach ($this->filters as $filter)
    {
      if (!($filter instanceof $name))
      {
        $filters[] = $filter;
      }
    }
    $this->filters = $filters;
    $this->modified = true;
  }

  /**
   * Binds the analyzer
   */
  public function bind()
  {
    $class = $this->analyzerClass;
    $this->analyzer = new $class;

    foreach ($this->filters as $filter)
    {
      $this->analyzer->addFilter($filter);
    }

    $this->modified = false;
  }

  /**
   * Gets the configured analyzer.
   *
   * @returns Zend_Search_Lucene_Analysis_Analyzer
   */
  public function getAnalyzer()
  {
    if ($this->analyzer == null || $this->modified)
    {
      $this->bind();
    }

    return $this->analyzer;
  }

  /**
   * @see Zend_Search_Lucene_Analysis_Analyzer
   */
  public function reset()
  {
    $this->getAnalyzer()->reset();
  }

  /**
   * @see Zend_Search_Lucene_Analysis_Analyzer
   */
  public function setInput($data, $encoding = '')
  {
    $this->reset();
    $this->getAnalyzer()->setInput($data, $encoding);
  }

  /**
   * @see Zend_Search_Lucene_Analysis_Analyzer
   */
  public function nextToken()
  {
    return $this->getAnalyzer()->nextToken();
  }
}

redpajama_set_name: RedPajamaGithub


text:
"""sys.excepthook for IPython itself, leaves a detailed report on disk.

Authors:

* Fernando Perez
* Brian E. Granger
"""

#-----------------------------------------------------------------------------
#  Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>
#  Copyright (C) 2008-2011  The IPython Development Team
#
#  Distributed under the terms of the BSD License.  The full license is in
#  the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function

import os
import sys
import traceback
from pprint import pformat

from IPython.core import ultratb
from IPython.core.release import author_email
from IPython.utils.sysinfo import sys_info
from IPython.utils.py3compat import input, getcwd

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------

# Template for the user message.
_default_message_template = """\
Oops, {app_name} crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:
  - A verbatim copy of the crash traceback.
  - A copy of your input history during this session.
  - Data on your current {app_name} configuration.

It was left in the file named:
\t'{crash_report_fname}'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: {contact_name} at {contact_email}
with the subject '{app_name} Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s '{app_name} Crash Report' {contact_email} < {crash_report_fname}

To ensure accurate tracking of this issue, please file a report about it at:
{bug_tracker}
"""

_lite_message_template = """
If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at {email}

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    {config}Application.verbose_crash=True
"""

class CrashHandler(object):

    """Customizable crash handlers for IPython applications.

    Instances of this class provide a :meth:`__call__` method which can be
    used as a ``sys.excepthook``.  The :meth:`__call__` signature is::

        def __call__(self, etype, evalue, etb)
    """

    message_template = _default_message_template
    section_sep = '\n\n' + '*' * 75 + '\n\n'

    def __init__(self, app, contact_name=None, contact_email=None,
                 bug_tracker=None, show_crash_traceback=True, call_pdb=False):
        """Create a new crash handler

        Parameters
        ----------
        app :  Application
            A running :class:`Application` instance, which will be queried at
            crash time for internal information.

        contact_name : str
            A string with the name of the person to contact.

        contact_email : str
            A string with the email address of the contact.

        bug_tracker : str
            A string with the URL for your project's bug tracker.

        show_crash_traceback : bool
            If false, don't print the crash traceback on stderr, only generate
            the on-disk report

        Non-argument instance attributes:

        These instances contain some non-argument attributes which allow for
        further customization of the crash handler's behavior. Please see the
        source for further details.
        """
        self.crash_report_fname = "Crash_report_%s.txt" % app.name
        self.app = app
        self.call_pdb = call_pdb
        # self.call_pdb = True # dbg
        self.show_crash_traceback = show_crash_traceback
        self.info = dict(app_name=app.name,
                         contact_name=contact_name,
                         contact_email=contact_email,
                         bug_tracker=bug_tracker,
                         crash_report_fname=self.crash_report_fname)

    def __call__(self, etype, evalue, etb):
        """Handle an exception, call for compatible with sys.excepthook"""

        # do not allow the crash handler to be called twice without reinstalling it
        # this prevents unlikely errors in the crash handling from entering an
        # infinite loop.
        sys.excepthook = sys.__excepthook__

        # Report tracebacks shouldn't use color in general (safer for users)
        color_scheme = 'NoColor'

        # Use this ONLY for developer debugging (keep commented out for release)
        # color_scheme = 'Linux'   # dbg
        try:
            rptdir = self.app.ipython_dir
        except:
            rptdir = getcwd()
        if rptdir is None or not os.path.isdir(rptdir):
            rptdir = getcwd()
        report_name = os.path.join(rptdir, self.crash_report_fname)
        # write the report filename into the instance dict so it can get
        # properly expanded out in the user message template
        self.crash_report_fname = report_name
        self.info['crash_report_fname'] = report_name
        TBhandler = ultratb.VerboseTB(
            color_scheme=color_scheme,
            long_header=1,
            call_pdb=self.call_pdb,
        )
        if self.call_pdb:
            TBhandler(etype, evalue, etb)
            return
        else:
            traceback = TBhandler.text(etype, evalue, etb, context=31)

        # print traceback to screen
        if self.show_crash_traceback:
            print(traceback, file=sys.stderr)

        # and generate a complete report on disk
        try:
            report = open(report_name, 'w')
        except:
            print('Could not create crash report on disk.', file=sys.stderr)
            return

        # Inform user on stderr of what happened
        print('\n' + '*' * 70 + '\n', file=sys.stderr)
        print(self.message_template.format(**self.info), file=sys.stderr)

        # Construct report on disk
        report.write(self.make_report(traceback))
        report.close()
        input("Hit <Enter> to quit (your terminal may close):")

    def make_report(self, traceback):
        """Return a string containing a crash report."""

        sec_sep = self.section_sep

        report = ['*' * 75 + '\n\n' + 'IPython post-mortem report\n\n']
        rpt_add = report.append
        rpt_add(sys_info())

        try:
            config = pformat(self.app.config)
            rpt_add(sec_sep)
            rpt_add('Application name: %s\n\n' % self.app_name)
            rpt_add('Current user configuration structure:\n\n')
            rpt_add(config)
        except:
            pass
        rpt_add(sec_sep + 'Crash traceback:\n\n' + traceback)

        return ''.join(report)

def crash_handler_lite(etype, evalue, tb):
    """a light excepthook, adding a small message to the usual traceback"""
    traceback.print_exception(etype, evalue, tb)

    from IPython.core.interactiveshell import InteractiveShell
    if InteractiveShell.initialized():
        # we are in a Shell environment, give %magic example
        config = "%config "
    else:
        # we are not in a shell, show generic config
        config = "c."
    print(_lite_message_template.format(
        email=author_email, config=config), file=sys.stderr)


text:
package biz.webgate.xpages.dss.binding;

import java.lang.reflect.Method;
import java.util.HashMap;

import lotus.domino.Document;

public class IntBuilder implements IBinder<Integer> {

	private static IntBuilder m_Binder;

	public void processDomino2Java(Document docCurrent, Object objCurrent,
			String strNotesField, String strJavaField, HashMap<String, Object> addValues) {
		try {
			Method mt = objCurrent.getClass().getMethod("set" + strJavaField,
					Integer.TYPE);
			int nValue = docCurrent.getItemValueInteger(strNotesField);
			mt.invoke(objCurrent, nValue);
		} catch (Exception e) {
			// e.printStackTrace();
		}
	}

	public void processJava2Domino(Document docCurrent, Object objCurrent,
			String strNotesField, String strJavaField, HashMap<String, Object> addValues) {
		try {
			int nValue = getValue(objCurrent, strJavaField).intValue();
			docCurrent.replaceItemValue(strNotesField, nValue);
		} catch (Exception e) {
			// e.printStackTrace();
		}

	}

	public static IBinder<Integer> getInstance() {
		if (m_Binder == null) {
			m_Binder = new IntBuilder();
		}
		return m_Binder;
	}

	public Integer getValue(Object objCurrent, String strJavaField) {
		try {
			Method mt = objCurrent.getClass().getMethod("get" + strJavaField);
			return (Integer) mt.invoke(objCurrent);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return null;
	}

}


text:
using System;

using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Components.Z80A;

namespace BizHawk.Emulation.Cores.ColecoVision
{
	public sealed class TMS9918A : IVideoProvider
	{
		public byte[] VRAM = new byte[0x4000];
		private byte[] Registers = new byte[8];
		private byte StatusByte;

		private bool VdpWaitingForLatchByte = true;
		private byte VdpLatch;
		private ushort VdpAddress;
		private byte VdpBuffer;
		private int TmsMode;

		private bool Mode1Bit => (Registers[1] & 16) > 0;
		private bool Mode2Bit => (Registers[0] & 2) > 0;
		private bool Mode3Bit => (Registers[1] & 8) > 0;
		private bool EnableDoubledSprites => (Registers[1] & 1) > 0;
		private bool EnableLargeSprites => (Registers[1] & 2) > 0;
		public bool EnableInterrupts => (Registers[1] & 32) > 0;
		private bool DisplayOn => (Registers[1] & 64) > 0;
		private bool Mode16k => (Registers[1] & 128) > 0;

		public bool InterruptPending
		{
			get { return (StatusByte & 0x80) != 0; }
			set { StatusByte = (byte)((StatusByte & ~0x02) | (value ? 0x80 : 0x00)); }
		}

		private int ColorTableBase;
		private int PatternGeneratorBase;
		private int SpritePatternGeneratorBase;
		private int TmsPatternNameTableBase;
		private int TmsSpriteAttributeBase;

		public void WriteVdpControl(byte value)
		{
			if (VdpWaitingForLatchByte)
			{
				VdpLatch = value;
				VdpWaitingForLatchByte = false;
				VdpAddress = (ushort)((VdpAddress & 0x3F00) | value);
				return;
			}

			VdpWaitingForLatchByte = true;
			VdpAddress = (ushort)(((value & 63) << 8) | VdpLatch);
			VdpAddress &= 0x3FFF;
			switch (value & 0xC0)
			{
				case 0x00: // read VRAM
					VdpBuffer = VRAM[VdpAddress];
					VdpAddress++;
					VdpAddress &= 0x3FFF;
					break;
				case 0x40: // write VRAM
					break;
				case 0x80: // VDP register write
					int reg = value & 0x0F;
					WriteRegister(reg, VdpLatch);
					break;
			}
		}

		public void WriteVdpData(byte value)
		{
			VdpWaitingForLatchByte = true;
			VdpBuffer = value;

			VRAM[VdpAddress] = value;
			//if (!Mode16k)
			//    Console.WriteLine("VRAM written while not in 16k addressing mode!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
			VdpAddress++;
			VdpAddress &= 0x3FFF;
		}

		void WriteRegister(int reg, byte data)
		{
			if (reg >= 8) return;

			Registers[reg] = data;
			switch (reg)
			{
				case 0: // Mode Control Register 1
					CheckVideoMode();
					break;
				case 1: // Mode Control Register 2
					CheckVideoMode();
					Cpu.NonMaskableInterrupt = (EnableInterrupts && InterruptPending);
					break;
				case 2: // Name Table Base Address
					TmsPatternNameTableBase = (Registers[2] << 10) & 0x3C00;
					break;
				case 3: // Color Table Base Address
					ColorTableBase = (Registers[3] << 6) & 0x3FC0;
					break;
				case 4: // Pattern Generator Base Address
					PatternGeneratorBase = (Registers[4] << 11) & 0x3800;
					break;
				case 5: // Sprite Attribute Table Base Address
					TmsSpriteAttributeBase = (Registers[5] << 7) & 0x3F80;
					break;
				case 6: // Sprite Pattern Generator Base Adderss
					SpritePatternGeneratorBase = (Registers[6] << 11) & 0x3800;
					break;
			}
		}

		public byte ReadVdpStatus()
		{
			VdpWaitingForLatchByte = true;
			byte returnValue = StatusByte;
			StatusByte &= 0x1F;
			Cpu.NonMaskableInterrupt = false;

			return returnValue;
		}

		public byte ReadData()
		{
			VdpWaitingForLatchByte = true;
			byte value = VdpBuffer;
			VdpBuffer = VRAM[VdpAddress];
			VdpAddress++;
			VdpAddress &= 0x3FFF;
			return value;
		}

		private void CheckVideoMode()
		{
			if (Mode1Bit) TmsMode = 1;
			else if (Mode2Bit) TmsMode = 2;
			else if (Mode3Bit) TmsMode = 3;
			else TmsMode = 0;
		}

		public void RenderScanline(int scanLine)
		{
			if (scanLine >= 192)
				return;

			if (TmsMode == 2)
			{
				RenderBackgroundM2(scanLine);
				RenderTmsSprites(scanLine);
			}
			else if (TmsMode == 0)
			{
				RenderBackgroundM0(scanLine);
				RenderTmsSprites(scanLine);
			}
			else if (TmsMode == 3)
			{
				RenderBackgroundM3(scanLine);
				RenderTmsSprites(scanLine);
			}
			else if (TmsMode == 1)
			{
				RenderBackgroundM1(scanLine);
				// no sprites (text mode)
			}
		}

		private void RenderBackgroundM0(int scanLine)
		{
			if (DisplayOn == false)
			{
				Array.Clear(FrameBuffer, scanLine * 256, 256);
				return;
			}

			int yc = scanLine / 8;
			int yofs = scanLine % 8;
			int FrameBufferOffset = scanLine * 256;
			int PatternNameOffset = TmsPatternNameTableBase + (yc * 32);
			int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F];

			for (int xc = 0; xc < 32; xc++)
			{
				int pn = VRAM[PatternNameOffset++];
				int pv = VRAM[PatternGeneratorBase + (pn * 8) + yofs];
				int colorEntry = VRAM[ColorTableBase + (pn / 8)];
				int fgIndex = (colorEntry >> 4) & 0x0F;
				int bgIndex = colorEntry & 0x0F;
				int fgColor = fgIndex == 0 ? ScreenBGColor : PaletteTMS9918[fgIndex];
				int bgColor = bgIndex == 0 ? ScreenBGColor : PaletteTMS9918[bgIndex];

				FrameBuffer[FrameBufferOffset++] = ((pv & 0x80) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x40) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x20) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x10) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x08) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x04) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x02) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x01) > 0) ? fgColor : bgColor;
			}
		}

		private void RenderBackgroundM1(int scanLine)
		{
			if (DisplayOn == false)
			{
				Array.Clear(FrameBuffer, scanLine * 256, 256);
				return;
			}

			int yc = scanLine / 8;
			int yofs = scanLine % 8;
			int FrameBufferOffset = scanLine * 256;
			int PatternNameOffset = TmsPatternNameTableBase + (yc * 40);
			int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F];

			for (int xc = 0; xc < 40; xc++)
			{
				int pn = VRAM[PatternNameOffset++];
				int pv = VRAM[PatternGeneratorBase + (pn * 8) + yofs];
				int colorEntry = Registers[7];
				int fgIndex = (colorEntry >> 4) & 0x0F;
				int bgIndex = colorEntry & 0x0F;
				int fgColor = fgIndex == 0 ? ScreenBGColor : PaletteTMS9918[fgIndex];
				int bgColor = bgIndex == 0 ? ScreenBGColor : PaletteTMS9918[bgIndex];

				FrameBuffer[FrameBufferOffset++] = ((pv & 0x80) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x40) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x20) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x10) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x08) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x04) > 0) ? fgColor : bgColor;
			}
		}

		void RenderBackgroundM2(int scanLine)
		{
			if (DisplayOn == false)
			{
				Array.Clear(FrameBuffer, scanLine * 256, 256);
				return;
			}

			int yrow = scanLine / 8;
			int yofs = scanLine % 8;
			int FrameBufferOffset = scanLine * 256;
			int PatternNameOffset = TmsPatternNameTableBase + (yrow * 32);
			int PatternGeneratorOffset = (((Registers[4] & 4) << 11) & 0x2000);
			int ColorOffset = (ColorTableBase & 0x2000);
			int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F];

			for (int xc = 0; xc < 32; xc++)
			{
				int pn = VRAM[PatternNameOffset++] + ((yrow / 8) * 0x100);
				int pv = VRAM[PatternGeneratorOffset + (pn * 8) + yofs];
				int colorEntry = VRAM[ColorOffset + (pn * 8) + yofs];
				int fgIndex = (colorEntry >> 4) & 0x0F;
				int bgIndex = colorEntry & 0x0F;
				int fgColor = fgIndex == 0 ? ScreenBGColor : PaletteTMS9918[fgIndex];
				int bgColor = bgIndex == 0 ? ScreenBGColor : PaletteTMS9918[bgIndex];

				FrameBuffer[FrameBufferOffset++] = ((pv & 0x80) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x40) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x20) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x10) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x08) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x04) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x02) > 0) ? fgColor : bgColor;
				FrameBuffer[FrameBufferOffset++] = ((pv & 0x01) > 0) ? fgColor : bgColor;
			}
		}

		private void RenderBackgroundM3(int scanLine)
		{
			if (DisplayOn == false)
			{
				Array.Clear(FrameBuffer, scanLine * 256, 256);
				return;
			}

			int yc = scanLine / 8;
			bool top = (scanLine & 4) == 0; // am I in the top 4 pixels of an 8-pixel character?
			int FrameBufferOffset = scanLine * 256;
			int PatternNameOffset = TmsPatternNameTableBase + (yc * 32);
			int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F];

			for (int xc = 0; xc < 32; xc++)
			{
				int pn = VRAM[PatternNameOffset++];
				int pv = VRAM[PatternGeneratorBase + (pn * 8) + ((yc & 3) * 2) + (top ? 0 : 1)];

				int lColorIndex = pv & 0xF;
				int rColorIndex = pv >> 4;
				int lColor = lColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[lColorIndex];
				int rColor = rColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[rColorIndex];

				FrameBuffer[FrameBufferOffset++] = lColor;
				FrameBuffer[FrameBufferOffset++] = lColor;
				FrameBuffer[FrameBufferOffset++] = lColor;
				FrameBuffer[FrameBufferOffset++] = lColor;
				FrameBuffer[FrameBufferOffset++] = rColor;
				FrameBuffer[FrameBufferOffset++] = rColor;
				FrameBuffer[FrameBufferOffset++] = rColor;
				FrameBuffer[FrameBufferOffset  ] = rColor;
			}
		}

		private readonly byte[] ScanlinePriorityBuffer = new byte[256];
		private readonly byte[] SpriteCollisionBuffer = new byte[256];

		private void RenderTmsSprites(int scanLine)
		{
			if (EnableDoubledSprites == false)
			{
				RenderTmsSpritesStandard(scanLine);
			}
			else
			{
				RenderTmsSpritesDouble(scanLine);
			}
		}

		private void RenderTmsSpritesStandard(int scanLine)
		{
			if (DisplayOn == false) return;

			Array.Clear(ScanlinePriorityBuffer, 0, 256);
			Array.Clear(SpriteCollisionBuffer, 0, 256);

			bool LargeSprites = EnableLargeSprites;

			int SpriteSize = 8;
			if (LargeSprites) SpriteSize *= 2;
			const int OneCellSize = 8;

			int NumSpritesOnScanline = 0;
			for (int i = 0; i < 32; i++)
			{
				int SpriteBase = TmsSpriteAttributeBase + (i * 4);
				int y = VRAM[SpriteBase++];
				int x = VRAM[SpriteBase++];
				int Pattern = VRAM[SpriteBase++];
				int Color = VRAM[SpriteBase];

				if (y == 208) break; // terminator sprite
				if (y > 224) y -= 256; // sprite Y wrap
				y++; // inexplicably, sprites start on Y+1
				if (y > scanLine || y + SpriteSize <= scanLine) continue; // sprite is not on this scanline
				if ((Color & 0x80) > 0) x -= 32; // Early Clock adjustment

				if (++NumSpritesOnScanline == 5)
				{
					StatusByte &= 0xE0;    // Clear FS0-FS4 bits
					StatusByte |= (byte)i; // set 5th sprite index
					StatusByte |= 0x40;    // set overflow bit
					break;
				}

				if (LargeSprites) Pattern &= 0xFC; // 16x16 sprites forced to 4-byte alignment
				int SpriteLine = scanLine - y;

				// pv contains the VRAM byte holding the pattern data for this character at this scanline.
				// each byte contains the pattern data for each the 8 pixels on this line.
				// the bit-shift further down on PV pulls out the relevant horizontal pixel.

				byte pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine];

				for (int xp = 0; xp < SpriteSize && x + xp < 256; xp++)
				{
					if (x + xp < 0) continue;
					if (LargeSprites && xp == OneCellSize)
						pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine + 16];

					if (Color != 0 && (pv & (1 << (7 - (xp & 7)))) > 0)
					{
						if (SpriteCollisionBuffer[x + xp] != 0)
							StatusByte |= 0x20; // Set sprite collision flag

						if (ScanlinePriorityBuffer[x + xp] == 0)
						{
							ScanlinePriorityBuffer[x + xp] = 1;
							SpriteCollisionBuffer[x + xp] = 1;
							FrameBuffer[(scanLine * 256) + x + xp] = PaletteTMS9918[Color & 0x0F];
						}
					}
				}
			}
		}

		private void RenderTmsSpritesDouble(int scanLine)
		{
			if (DisplayOn == false) return;

			Array.Clear(ScanlinePriorityBuffer, 0, 256);
			Array.Clear(SpriteCollisionBuffer, 0, 256);

			bool LargeSprites = EnableLargeSprites;

			int SpriteSize = 8;
			if (LargeSprites) SpriteSize *= 2;
			SpriteSize *= 2;  // because sprite magnification
			const int OneCellSize = 16; // once 8-pixel cell, doubled, will take 16 pixels

			int NumSpritesOnScanline = 0;
			for (int i = 0; i < 32; i++)
			{
				int SpriteBase = TmsSpriteAttributeBase + (i * 4);
				int y = VRAM[SpriteBase++];
				int x = VRAM[SpriteBase++];
				int Pattern = VRAM[SpriteBase++];
				int Color = VRAM[SpriteBase];

				if (y == 208) break; // terminator sprite
				if (y > 224) y -= 256; // sprite Y wrap
				y++; // inexplicably, sprites start on Y+1
				if (y > scanLine || y + SpriteSize <= scanLine) continue; // sprite is not on this scanline
				if ((Color & 0x80) > 0) x -= 32; // Early Clock adjustment

				if (++NumSpritesOnScanline == 5)
				{
					StatusByte &= 0xE0;    // Clear FS0-FS4 bits
					StatusByte |= (byte)i; // set 5th sprite index
					StatusByte |= 0x40;    // set overflow bit
					break;
				}

				if (LargeSprites) Pattern &= 0xFC; // 16x16 sprites forced to 4-byte alignment
				int SpriteLine = scanLine - y;
				SpriteLine /= 2; // because of sprite magnification

				byte pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine];

				for (int xp = 0; xp < SpriteSize && x + xp < 256; xp++)
				{
					if (x + xp < 0) continue;
					if (LargeSprites && xp == OneCellSize)
						pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine + 16];

					if (Color != 0 && (pv & (1 << (7 - ((xp / 2) & 7)))) > 0)  // xp/2 is due to sprite magnification
					{
						if (SpriteCollisionBuffer[x + xp] != 0)
							StatusByte |= 0x20; // Set sprite collision flag

						if (ScanlinePriorityBuffer[x + xp] == 0)
						{
							ScanlinePriorityBuffer[x + xp] = 1;
							SpriteCollisionBuffer[x + xp] = 1;
							FrameBuffer[(scanLine * 256) + x + xp] = PaletteTMS9918[Color & 0x0F];
						}
					}
				}
			}
		}

		private readonly Z80A Cpu;

		public TMS9918A(Z80A cpu)
		{
			Cpu = cpu;
		}

		public readonly int[] FrameBuffer = new int[256 * 192];
		public int[] GetVideoBuffer() { return FrameBuffer; }

		public int VirtualWidth => 293;
		public int VirtualHeight => 192;
		public int BufferWidth => 256;
		public int BufferHeight => 192;
		public int BackgroundColor => 0;

		public int VsyncNumerator
		{
			[FeatureNotImplemented]
			get
			{
				return NullVideo.DefaultVsyncNum;
			}
		}

		public int VsyncDenominator
		{
			[FeatureNotImplemented]
			get
			{
				return NullVideo.DefaultVsyncDen;
			}
		}

		private readonly int[] PaletteTMS9918 =
		{
			unchecked((int)0xFF000000),
			unchecked((int)0xFF000000),
			unchecked((int)0xFF47B73B),
			unchecked((int)0xFF7CCF6F),
			unchecked((int)0xFF5D4EFF),
			unchecked((int)0xFF8072FF),
			unchecked((int)0xFFB66247),
			unchecked((int)0xFF5DC8ED),
			unchecked((int)0xFFD76B48),
			unchecked((int)0xFFFB8F6C),
			unchecked((int)0xFFC3CD41),
			unchecked((int)0xFFD3DA76),
			unchecked((int)0xFF3E9F2F),
			unchecked((int)0xFFB664C7),
			unchecked((int)0xFFCCCCCC),
			unchecked((int)0xFFFFFFFF)
		};

		public void SyncState(Serializer ser)
		{
			ser.BeginSection("VDP");
			ser.Sync(nameof(StatusByte), ref StatusByte);
			ser.Sync("WaitingForLatchByte", ref VdpWaitingForLatchByte);
			ser.Sync("Latch", ref VdpLatch);
			ser.Sync("ReadBuffer", ref VdpBuffer);
			ser.Sync(nameof(VdpAddress), ref VdpAddress);
			ser.Sync(nameof(Registers), ref Registers, false);
			ser.Sync(nameof(VRAM), ref VRAM, false);
			ser.EndSection();

			if (ser.IsReader)
			{
				for (int i = 0; i < Registers.Length; i++)
				{
					WriteRegister(i, Registers[i]);
				}
			}
		}
	}
}


text:
import * as path from 'path';

export function helper() {
  let filesIndex: number = process.argv.indexOf('--files');
  let outIndex: number = process.argv.indexOf('--out');
  let outDir: string = path.join(process.cwd(), process.argv[outIndex + 1]);
  let writeDefinitions: boolean = process.argv.indexOf('--definitions') > 0;
  let files: string[] = process.argv.filter((input: string, index: number) => {
    if (filesIndex > outIndex) {
      return index > filesIndex
    } else {
      return index > filesIndex && index < outIndex;
    }
  });

  return {
    filesIndex: filesIndex,
    outIndex: outIndex,
    outDir: outDir,
    writeDefinitions: writeDefinitions,
    files: files
  }
}


text:
<?php

namespace Michaeljennings\Laralastica\Tests;

use Michaeljennings\Laralastica\LengthAwarePaginator;

class LengthAwarePaginatorTest extends TestCase
{
    /** @test */
    public function it_implements_the_result_collection_contract()
    {
        $collection = $this->makePaginator();

        $this->assertInstanceOf(\Michaeljennings\Laralastica\Contracts\ResultCollection::class, $collection);
    }

    /** @test */
    public function it_gets_the_total_hits()
    {
        $collection = $this->makePaginator();

        $this->assertEquals(0, $collection->totalHits());
    }

    /** @test */
    public function it_gets_the_max_score()
    {
        $collection = $this->makePaginator();

        $this->assertEquals(0, $collection->maxScore());
    }

    /** @test */
    public function it_gets_the_time_taken()
    {
        $collection = $this->makePaginator();

        $this->assertEquals(0.5, $collection->totalTime());
    }

    protected function makePaginator()
    {
        $paginator = new LengthAwarePaginator([], 0, 1, 1);

        return $paginator->setQueryStats(0, 0, 0.5);
    }
}


text:
<?php

namespace SellerWorks\Amazon\FulfillmentInbound\Entity;

/**
 * Information returned by Amazon about a Small Parcel shipment by a carrier that has not partnered with Amazon.
 */
final class NonPartneredSmallParcelDataOutput
{
    /**
     * @var Array<NonPartneredSmallParcelPackageOutput>
     */
    public $PackageList;
}


text:
package me.fourground.litmus.util;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;

/**
 * Created by YoungSoo Kim on 2016-06-17.
 * 4ground Ltd
 * byzerowater@gmail.com
 * DialogFactory
 * Dialog 관리
 */
public class DialogFactory {

    /**
     * AlertDialog 생성
     *
     * @param context Context
     * @param message 메세지
     * @return AlertDialog
     */
    public static Dialog createDialog(Context context,
                                      CharSequence message) {
        return new AlertDialog.Builder(context)
                .setMessage(message)
                .create();
    }

    /**
     * AlertDialog 생성
     *
     * @param context          context
     * @param message          메세지
     * @param positiveText     확인 버튼 문구
     * @param positiveListener 확인 버튼 클릭 리스너
     * @return AlertDialog
     */
    public static Dialog createDialog(Context context,
                                      CharSequence message,
                                      CharSequence positiveText,
                                      DialogInterface.OnClickListener positiveListener) {

        AlertDialog alertDialog = new AlertDialog.Builder(context)
                .setMessage(message)
                .setPositiveButton(positiveText, positiveListener)
                .create();

        alertDialog.setCancelable(false);

        return alertDialog;
    }

    /**
     * AlertDialog 생성
     *
     * @param context          Context
     * @param message          메세지
     * @param negativeText     취소 버튼 문구
     * @param positiveText     확인 버튼 문구
     * @param negativeListener 취소 버튼 클릭 리스너
     * @param positiveListener 확인 버튼 클릭 리스너
     * @return AlertDialog
     */
    public static Dialog createDialog(Context context,
                                      CharSequence message,
                                      CharSequence negativeText,
                                      CharSequence positiveText,
                                      DialogInterface.OnClickListener negativeListener,
                                      DialogInterface.OnClickListener positiveListener) {

        AlertDialog alertDialog = new AlertDialog.Builder(context)
                .setMessage(message)
                .setNegativeButton(negativeText, negativeListener)
                .setPositiveButton(positiveText, positiveListener)
                .create();

        alertDialog.setCancelable(false);

        return alertDialog;
    }
}


text:
<?php

namespace Elastica\Suggest\CandidateGenerator;

use Elastica\Param;

class AbstractCandidateGenerator extends Param
{

}


text:
import moment from 'moment';
import Ember from 'ember';
import TimeZoneOption from 'ewd-calendar/models/time-zone-option';

export default Ember.Component.extend({
  classNameBindings: [':as-calendar-time-zone-select', 'showResults:open'],
  tagName: 'section',

  defaultQuery: '',
  showResults: false,
  query: '',
  value: null,
  options: null,
  showSearch: true,

  selectedOptionAbbreviation: Ember.computed.oneWay(
    'selectedOption.abbreviation'
  ),

  arrangedOptions: Ember.computed(
    '_options.@each.{description,value}',
    'selectedOption.value',
    'showSearch',
    '_query', function() {
    if (this.get('showSearch')) {
      var regexp = new RegExp(this.get('_query'), 'i');

      return this.get('_options').filter((option) => {
        return option.get('description').match(regexp) ||
               option.get('value') === this.get('selectedOption.value');
      });
    } else {
      return this.get('_options');
    }
  }),

  selectedOption: Ember.computed('value', function() {
    return TimeZoneOption.create({ value: this.get('value') });
  }),

  _query: Ember.computed('query', 'defaultQuery', function() {
    var query = this.get('query');

    if (Ember.isEmpty(query)) {
       return this.get('defaultQuery');
    } else {
      return query;
    }
  }),

  _options: Ember.computed('options', function() {
    if (Ember.isPresent(this.get('options'))) {
      return this.get('options');
    } else {
      return moment.tz.names().map(function(timeZoneName) {
        return TimeZoneOption.create({ value: timeZoneName });
      });
    }
  }),

  actions: {
    selectOption: function(option) {
      this.sendAction('onChangeValue', option.get('value'));
    }
  }
});


text:
package org.parceler;

import android.os.Parcelable;

/**
 * @author John Ericksen
 */
@ParcelClasses({
    @ParcelClass(ExternalParcel.class),
    @ParcelClass(value = ManuallyRegistered.class, converter = ManuallyRegisteredConverter.class)
})
public class Tester {

    public static void main(String[] args){

        ExampleParcel example = new ExampleParcel("one", 2, 3L, new SubParcel("name"));

        Parcelable parcelable = Parcels.wrap(example);

        ExampleParcel parcel = ((ParcelWrapper<ExampleParcel>) parcelable).getParcel();

        System.out.println("Should be one: " + parcel.getOne());
        System.out.println("Should be 2: " + parcel.getTwo());
        System.out.println("Should be 3: " + parcel.getThree());
        System.out.println("Should be name: " + parcel.getFour().getName());
    }
}


text:
#include "FunctionServiceImpl.hpp"
#include "ExecutionImpl.hpp"
#include <geode/PoolManager.hpp>

using namespace apache::geode::client;

FunctionServiceImpl::FunctionServiceImpl(AuthenticatedView* authenticatedView) {
  m_authenticatedView = authenticatedView;
}

std::shared_ptr<FunctionService> FunctionServiceImpl::getFunctionService(
    AuthenticatedView* authenticatedView) {
  return std::make_shared<FunctionServiceImpl>(authenticatedView);
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="Venuetrack - A venues search engine for Thessaloniki">
    <meta name="author" content="Paraskevas Lagakis">
    <link rel="icon" href="images/favicon.ico">

	<title>Venuetrack - Search venues in Thessaloniki!</title>

	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/custom.css">

    <link href="css/simple-sidebar.css" rel="stylesheet">

		<navbar></navbar>

		<ng-view></ng-view>

  		<sidebar></sidebar>

      About Venuetrack |
      Stats |
       Code on Github


text:
API reference
=============

Modules:

.. toctree::
   :maxdepth: 4

   source_api/graph_constr_group_testing


text:
package org.terracotta.quartz.tests;

import com.tc.test.config.model.TestConfig;
import com.tc.util.PortChooser;

/**
 * This test ensures that a live node can recover acquired triggers (as opposed to doing recovery just at startup of new
 * nodes)
 */
public class NodeDeathTest extends AbstractStandaloneTest {

    @SuppressWarnings("unchecked")
    public NodeDeathTest(TestConfig testConfig) {
        super(testConfig, NodeDeathTestClient1.class, NodeDeathTestClient2.class);
        testConfig.getClientConfig()
            .addExtraClientJvmArg("-DlistenPort=" + new PortChooser().chooseRandomPort());
    }
}


text:
Calculate the localized admittance and correlation spectra of two functions at a given location using spherical cap localization windows.

# Usage

call SHLocalizedAdmitCorr (`tapers`, `taper_order`, `lwin`, `lat`, `lon`, `gilm`, `tilm`, `lmax`, `admit`, `corr`, `k`, `admit_error`, `corr_error`, `taper_wt`, `mtdef`, `k1linsig`, `exitstatus`)

# Parameters

`tapers` : input, real\*8, dimension (`lwin`+1, `k`)
:   A matrix of spherical cap localization functions obtained from `SHReturnTapers` or `SHReturnTapersM`.

`taper_order` : input, integer, dimension (`k`)
:   The angular order of the windowing coefficients in `tapers`.

`lwin` : input, integer
:   The spherical harmonic bandwidth of the localizing windows.

`lat` : input, real\*8
:   The latitude of the localized analysis in degrees.

`lon` : input, real\*8
:   The longitude of the localized analysis in degrees.

`gilm` : input, real\*8, dimension (2, `lmax`+1, `lmax`+1)
:   The spherical harmonic coefficients of the function G.

`tilm` : input, real\*8, dimension (2, `lmax`+1, `lmax`+1)
:   The spherical harmonic coefficients of the function T.

`lmax` : input, integer
:   The maximum spherical harmonic degree of the input functions corresponding to `gilm` and `tilm`.

`admit` : output, real\*8, dimension (`lmax`-`lwin`+1)
:   The admittance function, which is equal to `Sgt/Stt`.

`corr` : output, real\*8, dimension (`lmax`-`lwin`+1)
:   The degree correlation function, which is equal to `Sgt/sqrt(Sgg Stt)`.

`k` : input, integer
:   The number of tapers to be used in the multitaper spectral analysis.

`admit_error` : output, optional, real\*8, dimension (`lmax`-`lwin`+1)
:   The standard error of the admittance function.

`corr_error` : output, optional, real\*8, dimension (`lmax`-`lwin`+1)
:   The standard error of the degree correlation function.

`taper_wt` : input, optional, real\*8, dimension (`k`)
:   The weights to be applied to the spectral estimates when calculating the admittance, correlation, and their associated errors. This must sum to unity.

`mtdef` : input, optional, integer, default = 1
:   1 (default): Calculate the multitaper spectral estimates Sgt, Sgg and Stt first, and then use these to calculate the admittance and correlation functions. 2: Calculate admittance and correlation spectra using each individual taper, and then average these to obtain the multitaper admittance and correlation functions.

`k1linsig` : input, optional, integer
:   If equal to one, and only a single taper is being used, the errors in the admittance function will be calculated by assuming that the coefficients of `gilm` and `tilm` are related by a linear degree-dependent transfer function and that the lack of correlation is a result of uncorrelated noise. This is the square root of eq. 33 of Simons et al. 1997.

`exitstatus` : output, optional, integer
:   If present, instead of executing a STOP when an error is encountered, the variable exitstatus will be returned describing the error. 0 = No errors; 1 = Improper dimensions of input array; 2 = Improper bounds for input variable; 3 = Error allocating memory; 4 = File IO error.

# Description

`SHLocalizedAdmitCorr` will calculate the localized admittance and degree correlation spectra of two functions at a given location. The windowing functions are solutions to the spherical-cap concentration problem (as calculated by `SHReturnTapers` or `SHReturnTapersM`), of which the best `k` concentrated tapers are utilized. If `k` is greater than 1, then estimates of the standard error for the admittance and correlation will be returned in the optional arrays `admit_error` and `corr_error`. The symmetry axis of the localizing windows are rotated to the coordinates (`lat`, `lon`) before performing the windowing operation.

The admittance is defined as `Sgt/Stt`, where `Sgt` is the localized cross-power spectrum of two functions `G` and `T` expressed in spherical harmonics. The localized degree-correlation spectrum is defined as `Sgt/sqrt(Sgg Stt)`, which can possess values between -1 and 1. Two methods are available for calculating the multitaper admittance and correlation functions. When `mtdef` is 1 (default), the multitaper estimates and errors of Sgt, Stt, and Sgg are calculated by calls to `SHMultiTaperSE` and `SHMultiTaperCSE`, and these results are then used to calculate the final admittance and correlation functions. When `mtdef` is 2, the admitance and correlation are calculated invidivually for each individual taper, and these results are then averaged.

If the optional parameter `k1linsig` is specified, and only a single taper is being used, the uncertainty in the admittance function will be calculated by assuming the two sets of coefficients are related by a linear degree-dependent transfer function and that the lack of correlation is a result of uncorrelated noise.

When `mtdef` is 1, by default, the multitaper spectral estimates are calculated as an unweighted average of the individual tapered estimates. However, if the optional argument `taper_wt` is specified, a weighted average will be employed using the weights in this array. Minimum variance optimal weights can be obtained from the routines `SHMTVarOpt` if the form of the underlying global power spectrum is known. Taper weights can not be used when `mtdef` is 2

This routine assumes that the input functions and tapers are expressed using geodesy 4-pi normalized spherical harmonic functions that exclude the  Condon-Shortley phase factor of (-1)^m.

# See also

[shreturntapers](shreturntapers.html), [shreturntapersm](shreturntapersm.html), [shmultitaperse](shmultitaperse.html), [shmultitapercse](shmultitapercse.html)

# References

Wieczorek, M. A. and F. J. Simons, Minimum-variance multitaper spectral estimation on the sphere, J. Fourier Anal. Appl., 13, doi:10.1007/s00041-006-6904-1, 665-692, 2007.

Simons, F. J., F. A. Dahlen and M. A. Wieczorek, Spatiospectral concentration on the sphere, SIAM Review, 48, 504-536, doi:10.1137/S0036144504445765, 2006.

Wieczorek, M. A. and F. J. Simons, Localized spectral analysis on the sphere,
Geophys. J. Int., 162, 655-675, 2005.

Simons, M., S. C. Solomon and B. H. Hager, Localization of gravity and topography: constrains on the tectonics and mantle dynamics of Venus, Geophys. J. Int., 131, 24-44, 1997.


text:
/*
 * Changes for SnappyData data platform.
 *
 * Portions Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
 *
 * 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. See accompanying
 * LICENSE file.
 */

/**
 * PreparedStatement.h
 */

#ifndef PREPAREDSTATEMENT_H_
#define PREPAREDSTATEMENT_H_

#include "Types.h"
#include "ParameterDescriptor.h"
#include "StatementAttributes.h"
#include "ResultSet.h"

#include <memory>

using namespace io::snappydata::client::impl;

namespace io {
namespace snappydata {
namespace client {

  class PreparedStatement {
  private:
    std::shared_ptr<ClientService> m_service;
    StatementAttributes m_attrs;
    thrift::PrepareResult m_prepResult;
    std::unique_ptr<SQLWarning> m_warnings;
    std::unique_ptr<std::map<int32_t, thrift::OutputParameter> > m_outParams;
    // cursorId of last execution
    int64_t m_cursorId;

    friend class Connection;
    friend class Result;

    PreparedStatement(const std::shared_ptr<ClientService>& service,
        const StatementAttributes& attrs);

    PreparedStatement(const std::shared_ptr<ClientService>& service,
        const StatementAttributes& attrs,
        const thrift::PrepareResult& prepResult);

    // no copy constructor or assignment operator
    PreparedStatement(const PreparedStatement&) = delete;
    PreparedStatement operator=(const PreparedStatement&) = delete;

    inline ClientService& checkAndGetService() const {
      if (m_service != NULL) {
        return *m_service;
      } else {
        throw GET_SQLEXCEPTION2(SQLStateMessage::ALREADY_CLOSED_MSG);
      }
    }

  public:

    void registerOutParameter(const int32_t parameterIndex,
        const SQLType type);

    void registerOutParameter(const int32_t parameterIndex,
        const SQLType type, const int32_t scale);

    bool unregisterOutParameter(const int32_t parameterIndex);

    std::unique_ptr<Result> execute(const Parameters& params);

    int32_t executeUpdate(const Parameters& params);

    std::unique_ptr<ResultSet> executeQuery(const Parameters& params);

    std::vector<int32_t> executeBatch(const ParametersBatch& paramsBatch);

    std::unique_ptr<ResultSet> getNextResults(
        const NextResultSetBehaviour behaviour =
            NextResultSetBehaviour::CLOSE_ALL);

    int8_t getStatementType() const noexcept {
      return m_prepResult.statementType;
    }

    inline bool hasWarnings() const noexcept {
      return m_warnings != NULL || m_prepResult.__isset.warnings;
    }

    std::unique_ptr<SQLWarning> getWarnings();

    uint32_t getParameterCount() const noexcept {
      return static_cast<uint32_t>(m_prepResult.parameterMetaData.size());
    }

    ParameterDescriptor getParameterDescriptor(
        const uint32_t parameterIndex);

    uint32_t getColumnCount() const noexcept {
      return static_cast<uint32_t>(m_prepResult.resultSetMetaData.size());
    }

    ColumnDescriptor getColumnDescriptor(const uint32_t columnIndex);

    bool cancel();

    void close();

    ~PreparedStatement();
  };

} /* namespace client */
} /* namespace snappydata */
} /* namespace io */

#endif /* PREPAREDSTATEMENT_H_ */


text:
A WebDriver that distributes commands to multiple drivers in parallel.

## NuGet

You can install SuperDriver using NuGet

```
PM> Install-Package Fenton.Selenium.SuperDriver
```

## Creating a SuperWebDriver

A ```SuperWebDriver``` can run as many individual ```IWebDrivers``` as you would like (and your machine can take).

```csharp
IWebDriver driver = new SuperWebDriver(new ChromeDriver(), new FirefoxDriver());
```

You are not limited to one of each kind of driver:

```csharp
IWebDriver driver = new SuperWebDriver(
    new ChromeDriver(),
    new FirefoxDriver(),
    new FirefoxDriver()
);
```

Creating drivers can take some time, so consider creating them in parallel. Simple example:

```csharp
IWebDriver driver = new SuperWebDriver(GetDriverSuite());
```

Here is the ```GetDriverSuite``` method:

```csharp
private static IList<IWebDriver> GetDriverSuite()
{
    // Allow some degree of parallelism when creating drivers, which can be slow
    IList<IWebDriver> drivers = new List<Func<IWebDriver>>
    {
        () =>  { return GetDriverFor(Browser.Chrome); },
        () =>  { return GetDriverFor(Browser.Firefox); },
    }.AsParallel().Select(d => d()).ToList();

    return drivers;
}
```

## Using the SuperWebDriver

The ```SuperWebDriver``` can be used just like any other ```IWebDriver```. It handles all the hard work distributing commands to all of the drivers, web controls, options objects and so on.

Everything with an interface has a partner Super object:

| Interface      | Substitute         |
|----------------|--------------------|
| IWebDriver     | SuperWebDriver     |
| IAlert         | SuperAlert         |
| ICookieJar     | SuperCookieJar     |
| INavigation    | SuperNavigation    |
| IOptions       | SuperOptions       |
| ITargetLocator | SuperTargetLocator |
| ITimeouts      | SuperTimeouts      |
| IWebElement    | SuperWebElement    |
| IWindow        | SuperWindow        |

The following classes have also been crowbarred out of the way using the ```new``` keyword to hide base class members.

| Class                 | Substitute                 |
|-----------------------|----------------------------|
| Cookie                | SuperCookie                |
| ReadOnlyCollection<T> | SuperReadOnlyCollection<T> |

Ideally, you shouldn't need to create anything except the ```SuperWebDriver```. The substitutes are used to ensure that commands are distributed to all web browsers and make multiple web browsers look like a single web browser to your code.

## Substitution and Return Value Selection

The current rules for substitution are:

Where any of these interfaces are returned from a method, they are automatically substituted with the appropriate ```SuperX``` class.

The current rules for return value selection are:

Where a simple type (such as ```string``` or ```bool```) is returned, a check is made to ensure that each browser gives the same answer. For example ```page.Title``` will return a single title, after a check has been made to ensure all browsers give the same answer.

Where a return type cannot be substituted, the value from the first browser is returned. (Currently applies to ```Point``` and ```Size```).

I am keen on getting feedback on these rules with a view to refining them to best work with real use cases. For example, if you are obtaining ```Size``` are you asserting that it is correct? (If so, you would only really be checking that the first browser in the collection is correct - does this behaviour need to be more sophisticated?)

## Contributions

Pre-Requisites - theses are the tools you'll need if you want to work with the source code or contribute to the project.

### Software

 - Visual Studio 2013 Community Edition (or better)
 - TypeScript 1.4 (used in the sample application)

#### Software (Only needed to get code coverage if using Visual Studio Community Edition or Pro Edition)

 - NUnit (the installed version)
 - OpenCover (the installed version)

The installed version of NUnit and OpenCover seems to work best when using OpenCover to track code coverage.

### Visual Studio Extensions

 - SpecFlow
 - NUnit Test Adapter
 - OpenCover UI

### NuGet Packages

Just ensure "Enable NuGet Package Restore" is used on the solution and they'll all download.


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

<title>AbortablePrintWriter (GWT Javadoc)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Deprecated

Help

GWT 2.8.0-rc1

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.google.gwt.codegen.server

Class AbortablePrintWriter

java.lang.Object

java.io.Writer

java.io.PrintWriter

com.google.gwt.codegen.server.AbortablePrintWriter

All Implemented Interfaces:

java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

public class AbortablePrintWriter
extends java.io.PrintWriter

Wrapper for a PrintWriter that adds the ability to abort creation
 and an onClose hook

 Experimental API - subject to change.

Field Summary

Fields inherited from class java.io.PrintWriter

out

Fields inherited from class java.io.Writer

lock

Constructor Summary

Constructors

Constructor and Description

AbortablePrintWriter(java.io.PrintWriter pw)

Wrap a PrintWriter instance.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
abort()

Abort creation of this output.

void
close()

protected void
onClose(boolean aborted)

Called exactly once when this PrintWriter is closed or aborted.

Methods inherited from class java.io.PrintWriter

append, append, append, checkError, clearError, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbortablePrintWriter

public AbortablePrintWriter(java.io.PrintWriter pw)

Wrap a PrintWriter instance.

Parameters:

pw -

Throws:

java.lang.RuntimeException - if there are reflection errors accessing the out
     field in pw

Method Detail

abort

public void abort()

Abort creation of this output.

close

public void close()

Specified by:

close in interface java.io.Closeable

Specified by:

close in interface java.lang.AutoCloseable

Overrides:

close in class java.io.PrintWriter

onClose

protected void onClose(boolean aborted)

Called exactly once when this PrintWriter is closed or aborted.

Parameters:

aborted -

Skip navigation links

Overview

Package

Class

Use

Deprecated

Help

GWT 2.8.0-rc1

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
typedef enum {
    KEYBOARD_TYPE_DEFAULT,
    KEYBOARD_TYPE_FORMAT
}KEYBOARD_TYPE;

@class P2MSTextView;

@protocol P2MSTextViewDelegate <NSObject, UIScrollViewDelegate>
@optional

- (BOOL)p2msTextViewShouldBeginEditing:(P2MSTextView *)textView;
- (BOOL)p2msTextViewShouldEndEditing:(P2MSTextView *)textView;
- (void)p2msTextViewDidBeginEditing:(P2MSTextView *)textView;
- (void)p2msTextViewDidEndEditing:(P2MSTextView *)textView;

- (void)p2msTextViewDidChange:(P2MSTextView *)textView;
- (void)p2msTextViewDidChangeSelection:(P2MSTextView *)textView;

- (void)p2msTextViewLinkAdded:(P2MSTextView *)textView andLink:(P2MSLink *)link;
- (void)p2msTextViewLinkClicked:(P2MSTextView *)textView andLink:(P2MSLink *)link;

@end

@interface P2MSTextView : UIScrollView<UITextInput, UIGestureRecognizerDelegate, P2MSLinkViewControllerDelegate>

@property (nonatomic)BOOL editable;
@property(nonatomic,unsafe_unretained) id <P2MSTextViewDelegate> textViewDelegate;

@property (nonatomic, readonly)TEXT_ATTRIBUTE curTextStyle;
@property (nonatomic, readonly) PARAGRAPH_STYLE curParagraphStyle;

@property (nonatomic, retain) NSDictionary *fontNames, *fontSizes;
@property (nonatomic, retain) NSDictionary *fontColors;

@property(readwrite, retain) UIView *inputAccessoryView;

@property (nonatomic, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer;
@property (nonatomic, readonly) UITapGestureRecognizer *tapGestureRecognizer, *doubleTapGestureRecognizer;

@property (nonatomic) NSRange markedRange; // Marked text range (for input method marked text).
@property (nonatomic) NSRange selectedRange; // Selected text range.
@property (nonatomic) NSRange correctionRange;

@property (nonatomic, readonly) KEYBOARD_TYPE activeKeyboardType;
@property (nonatomic) NSString *plainText;
@property (nonatomic) BOOL canDisplayCustomKeyboard;

@property (nonatomic) UIEdgeInsets edgeInsets;

//- (PARAGRAPH_STYLE)getParagraphStyleAtIndex:(NSInteger)index;
- (PARAGRAPH_STYLE)getCurrentParagraphStyle;

- (NSMutableDictionary *)getStyleAttributes;

- (void)setAction:(TEXT_ATTRIBUTE)txtFormat;

- (void)toggleKeyboard;

//hide kb if you call the same keyboard type twice
- (void)showKeyboard:(KEYBOARD_TYPE)kbType;

//HTML related
- (NSString *)exportHTMLString;
- (void) importHTMLString:(NSString *)htmlString;

@end


text:
test_number=07
description="multiple trailing input files"

infile="$test_dir/test.in $test_dir/test.in2"
outfile=$test_dir/test_$test_number.out
expected=$test_dir/test_$test_number.expected

subtest=1
$bin -p -k 1 -s 3 $infile > $outfile
if [ $? -ne 0 ] ||
   [ "`diff -q $outfile $expected`" ]; then
  test_status $test_number $subtest "$description (indexes)" FAIL
else
  test_status $test_number $subtest "$description (indexes)" PASS
  rm "$outfile"
fi

subtest=2
$bin -K Text-1 -S Numeric-1 $infile > $outfile
if [ $? -ne 0 ] ||
   [ "`diff -q $outfile $expected`" ]; then
  test_status $test_number $subtest "$description (labels)" FAIL
else
  test_status $test_number $subtest "$description (labels)" PASS
  rm "$outfile"
fi


text:
using std::iterator;
using std::set;
using std::vector;

using namespace TIM;
using VAL::FastEnvironment;
using VAL::operator_;
using VAL::pddl_type;
using VAL::var_symbol;

namespace Inst {
  class instantiatedOp;
};

using Inst::instantiatedOp;

namespace SAS {

  extern bool use_sasoutput;

  class ValHolder {
   protected:
    PropertySpace *pspace;
    const PropertyState *pstate;
    const pddl_type *forThis;
    Property *prop;

   public:
    ValHolder(const pddl_type *pt, const PropertyState *ps,
              PropertySpace *prpsp, Property *p)
        : pspace(prpsp), pstate(ps), forThis(pt), prop(p){};
    virtual ~ValHolder(){};
    virtual void write(ostream &o) const = 0;
    const PropertyState *getState() const { return pstate; };
    Property *getProp() const { return prop; };
    const pddl_type *getType() const { return forThis; };
    PropertySpace *getSpace() const { return pspace; };
    virtual bool operator==(const ValHolder &v) const {
      return pstate == v.pstate;
    };
    virtual bool equivalent(const ValHolder *v) const {
      return prop->equivalent(v->prop);
    };
    virtual void add(const PropertyState *ps){};
  };

  class PlaceHolder : public ValHolder {
   private:
    static int idGen;
    int id;
    vector< const PropertyState * > allStates;

   public:
    PlaceHolder(const pddl_type *pt, const PropertyState *ps,
                PropertySpace *prpsp)
        : ValHolder(pt, ps, prpsp, 0), id(idGen++) {
      allStates.push_back(ps);
    };
    void write(ostream &o) const {
      o << "{X - ";
      for_each(allStates.begin(), allStates.end(),
               ptrwriter< const PropertyState >(o, " "));
      o << "}";
    };
    bool operator==(const ValHolder &v) const {
      const PlaceHolder *p = dynamic_cast< const PlaceHolder * >(&v);
      if (!p) return false;
      return this->ValHolder::operator==(v);
    };
    bool equivalent(const ValHolder *v) const {
      const PlaceHolder *p = dynamic_cast< const PlaceHolder * >(v);
      if (!p) return false;
      return this->ValHolder::equivalent(v);
    };
    void add(const PropertyState *ps) { allStates.push_back(ps); };
    typedef vector< const PropertyState * >::const_iterator const_iterator;
    const_iterator begin() const { return allStates.begin(); };
    const_iterator end() const { return allStates.end(); };
    void showValue(ostream &o) const { o << "X_" << id; };
  };

  // This holds all the argument types of the "other" arguments in the Property
  // ie the arguments of the proposition other than the one defining the
  // properties.
  class TypesHolder : public ValHolder {
   private:
    vector< pddl_type * > ptypes;

   public:
    TypesHolder(const pddl_type *pt, const PropertyState *ps,
                PropertySpace *psp, Property *p,
                const vector< pddl_type * > &pts)
        : ValHolder(pt, ps, psp, p), ptypes(pts){};
    void write(ostream &o) const {
      vector< pddl_type * >::const_iterator i = ptypes.begin();
      while (true) {
        o << (*i)->getName();
        ++i;
        if (i == ptypes.end()) {
          break;
        } else {
          o << ",";
        };
      };
    };
    bool operator==(const ValHolder &v) const {
      const TypesHolder *t = dynamic_cast< const TypesHolder * >(&v);
      if (!t) return false;
      return this->ValHolder::operator==(v);
    };
    bool equivalent(const ValHolder *v) const {
      const TypesHolder *t = dynamic_cast< const TypesHolder * >(v);
      if (!t) return false;
      return this->ValHolder::equivalent(v);
    };
  };

  // This case is used when there are no other arguments.
  class NullHolder : public ValHolder {
   public:
    NullHolder(const pddl_type *pt, const PropertyState *ps, PropertySpace *psp,
               Property *p)
        : ValHolder(pt, ps, psp, p){};
    void write(ostream &o) const { o << "{" << *prop << "}"; };
    bool operator==(const ValHolder &v) const {
      const NullHolder *t = dynamic_cast< const NullHolder * >(&v);
      if (!t) return false;
      return this->ValHolder::operator==(v);
    };
    bool equivalent(const ValHolder *v) const {
      const NullHolder *t = dynamic_cast< const NullHolder * >(v);
      if (!t) return false;
      return this->ValHolder::equivalent(v);
    };
  };

  ostream &operator<<(ostream &o, const ValHolder &vh);

  // A ValHolder is just one Property in a PropertyState.
  // A Values is the collection of all the things generated for a PropertyState.
  // A ValuesUnion is the union of the values for the PropertyStates in one
  // PropertySpace. A Range is the product over all PropertySpaces.

  class Values {
   private:
    vector< ValHolder * > values;

   public:
    Values() : values(){};
    void push_back(ValHolder *v) { values.push_back(v); };
    typedef vector< ValHolder * >::const_iterator const_iterator;
    const_iterator begin() const { return values.begin(); };
    const_iterator end() const { return values.end(); };
    typedef vector< ValHolder * >::iterator iterator;
    iterator begin() { return values.begin(); };
    iterator end() { return values.end(); };
    size_t size() const { return values.size(); };

    bool operator==(const Values &vals) const {
      if (values.size() != vals.values.size()) return false;
      for (unsigned int i = 0; i < values.size(); ++i) {
        if (!(*(values[i]) == *(vals.values[i]))) return false;
      };
      return true;
    };
    bool equivalent(const Values &vals) const {
      if (values.size() != vals.values.size()) return false;
      for (unsigned int i = 0; i < values.size(); ++i) {
        if (!values[i]->equivalent(vals.values[i])) return false;
      };
      return true;
    };
    ValHolder *&operator[](int i) { return values[i]; };
  };

  class VElement;

  class ValuesUnion {
   private:
    vector< pair< const PropertyState *, Values > > valuesUnion;

   public:
    ValuesUnion(const ValuesUnion &v1, const ValuesUnion &v2);
    ValuesUnion() : valuesUnion(){};
    class const_iterator : public iterator< Values, size_t > {
     private:
      typedef vector< pair< const PropertyState *, Values > >::const_iterator
          CI;
      CI i;

     public:
      const_iterator(CI j) : i(j){};
      bool operator==(const const_iterator &x) { return i == x.i; };
      bool operator!=(const const_iterator &x) { return i != x.i; };
      const_iterator &operator++() {
        ++i;
        return *this;
      };
      const Values &operator*() const { return i->second; };
      const Values *operator->() { return &(i->second); };
      const PropertyState *forState() const { return (i->first); };
    };
    void push_back(const Values &vs, const PropertyState *p) {
      if (find(valuesUnion.begin(), valuesUnion.end(), make_pair(p, vs)) ==
          valuesUnion.end()) {
        valuesUnion.push_back(make_pair(p, vs));
      };
    };
    const_iterator begin() const {
      return const_iterator(valuesUnion.begin());
    };
    const_iterator end() const { return const_iterator(valuesUnion.end()); };
    size_t size() const { return valuesUnion.size(); };
    bool hasPlaceHolder(const PropertyState *ps);
    bool intersectsWith(const ValuesUnion &v) const;
  };

  inline ostream &operator<<(ostream &o, const Values &vls) {
    o << "(";
    Values::const_iterator i = vls.begin();
    o << **i;
    ++i;
    while (i != vls.end()) {
      o << "," << **i;
      ++i;
    };
    o << ")";
    return o;
  };

  inline ostream &operator<<(ostream &o, const ValuesUnion &vu) {
    ValuesUnion::const_iterator i = vu.begin();
    o << "(";
    o << *i;
    ++i;
    while (i != vu.end()) {
      o << " U " << *i;
      ++i;
    };
    o << ")";
    return o;
  };

  class Range {
   private:
    vector< ValuesUnion > range;

   public:
    void push_back(const ValuesUnion &vu) { range.push_back(vu); };
    typedef vector< ValuesUnion >::const_iterator const_iterator;
    const_iterator begin() const { return range.begin(); };
    const_iterator end() const { return range.end(); };
    size_t size() const { return range.size(); };
    void update(const ValuesUnion &oldvu, const ValuesUnion &newvu1,
                const ValuesUnion &newvu2);
  };

  class VElement {
   public:
    virtual ~VElement(){};
    virtual void write(ostream &o) const = 0;
    virtual VElement *copy() const = 0;
    virtual VElement *build(FastEnvironment *fe) { return this; };
    virtual void showValue(ostream &o) const { write(o); };
    virtual bool matches(VElement *vel, FastEnvironment *fenv) = 0;
  };

  class VarElement : public VElement {
   private:
    typedef VAL::parameter_symbol parameter_symbol;
    const parameter_symbol *var;

   public:
    VarElement(const parameter_symbol *v) : var(v){};
    void write(ostream &o) const {
      o << var->getName() << "::" << var->type->getName();
    };
    VarElement *copy() const { return new VarElement(*this); };
    VElement *build(FastEnvironment *fe);
    void showValue(ostream &o) const { o << "?" << var->getName(); };
    bool matches(VElement *vel, FastEnvironment *fenv) {
      if (VarElement *vr = dynamic_cast< VarElement * >(vel)) {
        return vr->var == var;
      };
      return false;
    };
    const parameter_symbol *getVar() const { return var; };
  };

  class ObElement : public VElement {
   private:
    TIMobjectSymbol *tob;

   public:
    ObElement(TIMobjectSymbol *t) : tob(t){};
    void write(ostream &o) const { o << *tob; };
    ObElement *copy() const { return new ObElement(*this); };
    bool matches(VElement *vel, FastEnvironment *fenv) {
      if (VarElement *vr = dynamic_cast< VarElement * >(vel)) {
        return (*fenv)[vr->getVar()] == tob;
      };
      if (ObElement *ob = dynamic_cast< ObElement * >(vel)) {
        return ob->tob == tob;
      };
      return false;
    };
  };

  class PElement : public VElement {
   private:
    Property *prop;

   public:
    PElement(Property *p) : prop(p){};
    void write(ostream &o) const { o << *prop; };
    PElement *copy() const { return new PElement(*this); };
    bool matches(VElement *vel, FastEnvironment *fenv) {
      if (PElement *pel = dynamic_cast< PElement * >(vel)) {
        return pel->prop == prop;
      };
      return false;
    };
  };

  class WildElement : public VElement {
   private:
    static int idgen;
    int id;
    ValuesUnion var;

   public:
    WildElement(const ValuesUnion &v) : id(idgen++), var(v){};
    void write(ostream &o) const {
      int u = var.size();
      o << "?" << id << " :: (";
      for (ValuesUnion::const_iterator j = var.begin(); j != var.end();
           ++j, --u) {
        o << "(";
        int ocs = j->size();
        for (Values::const_iterator pp = j->begin(); pp != j->end();
             ++pp, --ocs) {
          o << **pp;
          if (ocs > 1) o << ",";
        };
        o << ")";
        if (u > 1) o << " U ";
      };
      o << ")";
    };
    WildElement *copy() const { return new WildElement(*this); };
    bool matches(VElement *vel, FastEnvironment *fenv) { return true; };
  };

  class PlaceHolderElement : public VElement {
   private:
    const PlaceHolder *ph;

   public:
    PlaceHolderElement(const PlaceHolder *p) : ph(p){};
    void write(ostream &o) const { o << *ph; };
    PlaceHolderElement *copy() const { return new PlaceHolderElement(ph); };
    void showValue(ostream &o) const { ph->showValue(o); };
    bool matches(VElement *vel, FastEnvironment *fenv) {
      if (PlaceHolderElement *pel = dynamic_cast< PlaceHolderElement * >(vel)) {
        return *ph == *(pel->ph);
      };
      return false;
    };
  };

  ostream &operator<<(ostream &o, const VElement &v);

  class ValueElement {
   private:
    const PropertyState *pst;
    vector< VElement * > value;

   public:
    ValueElement(const PropertyState *p, const vector< VElement * > &vs)
        : pst(p), value(vs){};
    ValueElement(ValueElement *vel, FastEnvironment *fe);

    void write(ostream &o) const {
      o << "(";
      for_each(value.begin(), value.end(), ptrwriter< VElement >(o, " "));
      o << ")";
    };
    const PropertyState *getPS() const { return pst; };
    VElement *operator[](int i) { return value[i]; };
    size_t size() const { return value.size(); };
    void showValue(ostream &o) const {
      o << "(";
      for (vector< VElement * >::const_iterator i = value.begin();
           i != value.end();) {
        (*i)->showValue(o);
        ++i;
        if (i != value.end()) o << ",";
      };
      o << ")";
    };
    bool matches(ValueElement *vel, FastEnvironment *fenv) {
      if (value.size() != vel->value.size()) return false;
      for (size_t i = 0; i < value.size(); ++i) {
        if (!value[i]->matches(vel->value[i], fenv)) return false;
      };
      return true;
    };
  };

  ostream &operator<<(ostream &o, const ValueElement &ve);

  class RangeRep;

  typedef map< TIMobjectSymbol *, vector< ValueElement * > > ElementRanges;
  typedef map< const pddl_type *, map< const TIMobjectSymbol *, RangeRep * > >
      Reachables;

  class ValueStructure {
   private:
    Range range;
    pddl_type *pt;

    ElementRanges rngs;

   public:
    ValueStructure(pddl_type *p) : pt(p){};

    void add(const ValuesUnion &vu) { range.push_back(vu); };

    void write(ostream &o) const {
      int c = range.size();
      for (Range::const_iterator i = range.begin(); i != range.end();
           ++i, --c) {
        o << "(";
        int u = i->size();
        for (ValuesUnion::const_iterator j = i->begin(); j != i->end();
             ++j, --u) {
          o << "(";
          int ocs = j->size();
          for (Values::const_iterator pp = j->begin(); pp != j->end();
               ++pp, --ocs) {
            o << **pp;
            if (ocs > 1) o << ",";
          };
          o << ")";
          if (u > 1) o << " U ";
        };
        o << ")";
        if (c > 1) o << " X ";
      };
    };

    void initialise();
    const Range &getRange() const { return range; };
    const pddl_type *getType() const { return pt; };
    void update(const ValuesUnion &oldvu, const ValuesUnion &newvu1,
                const ValuesUnion &newvu2);
    void liftFrom(ValueStructure &vs1, ValueStructure &vs2);
    void setUpInitialState(Reachables &reachables);
  };

  ostream &operator<<(ostream &o, const ValueStructure &vs);

  typedef std::map< const pddl_type *, ValueStructure > FunctionRep;

  class ValueStruct;
  class SASActionTemplate;
  class ValueRep;

  class FunctionStructure {
   private:
    FunctionRep frep;
    vector< const pddl_type * > noStates;
    typedef map< const operator_ *, SASActionTemplate * > SASActionTemplates;
    SASActionTemplates sasActionTemplates;

    void restructure(const vector< ValueStruct > &red,
                     const vector< ValueStruct > &lve, const PropertyState *ps);

    Reachables reachables;
    map< const operator_ *, pair< int, int > > startOp;
    int levels;
    vector< int > unsatisfiedPrecs;

    vector< VAL::proposition * > others;
    vector< int > othercounts;

   public:
    FunctionStructure();

    void initialise();
    void processActions();
    const ValueStructure &forType(const pddl_type *pt) {
      return frep.find(pt)->second;
    };
    bool hasFluent(const pddl_type *pt) const {
      return frep.find(pt) != frep.end();
    };
    void normalise();
    void restructure(const operator_ *op, const var_symbol *prm,
                     const vector< const pddl_type * > &rtps);
    void setUpInitialState();
    bool growOneLevel();
    int startFor(const operator_ *op) const {
      return startOp.find(op)->second.first;
    };
    int endFor(const operator_ *op) const {
      return startOp.find(op)->second.second;
    };
    bool tryMatchedPre(int k, instantiatedOp *iop, const var_symbol *var,
                       SASActionTemplate *sasact, ValueRep *vrep);
    void buildLayers();
    typedef SASActionTemplates::const_iterator iterator;
    iterator begin() const { return sasActionTemplates.begin(); };
    iterator end() const { return sasActionTemplates.end(); };
  };

};  // namespace SAS

#endif


text:
"""Turn files into nice html."""

import os
import glob
from bs4 import BeautifulSoup

def create_full_html():
    """Turn all files into html."""
    # It's a text file so that it doesn't get picked up by glob
    result_soup = BeautifulSoup(open(os.path.join("modded_files", 'base.txt'), encoding="utf8"), 'html.parser')

    files = glob.glob(os.path.join(
        os.path.join(os.getcwd(), "html_files", "*.htm")))

    series1_contents = BeautifulSoup(
        open(os.path.join(
            "html_files", "scp-series-contents.html"), encoding="utf8"), 'html.parser')

    result_soup.find("div", id="toc").append(
        series1_contents.find("div", id="main-content"))

    result_soup.find("div", id="toc").append(result_soup.new_tag("br"))

    series2_contents = BeautifulSoup(
        open(os.path.join(
            "html_files", "scp-series2-contents.html"), encoding="utf8"), 'html.parser')

    result_soup.find("div", id="toc").append(
        series2_contents.find("div", id="main-content"))

    result_soup.find("div", id="toc").append(result_soup.new_tag("br"))

    for file in files:
        print("Adding " + file)
        file_soup = BeautifulSoup(open(file, encoding="utf8"), 'html.parser')

        result_soup.find("div", id="articles").append(
            file_soup.find("div", id="container"))
        result_soup.find("div", id="articles").append(
            result_soup.new_tag("br"))

    f = open(os.path.join("encyclopedia", "SCP Encyclopedia.htm"),
             'w', encoding="utf8")
    f.write(result_soup.prettify())
    print("Created Encyclopedia. Location: encyclopedia/SCP Encyclopedia.htm")


text:
/*** Creation and destruction ***/

/* Feel free to read from this struct's members, but don't write to them except
through the accessor functions. */
typedef struct sceneNode sceneNode;
struct sceneNode {
	GLdouble rotation[3][3];
	GLdouble translation[3];
	GLuint unifDim;
	GLdouble *unif;
	meshGLMesh *meshGL;
	sceneNode *firstChild, *nextSibling;
};

/* Initializes a sceneNode struct. The translation and rotation are initialized to trivial values. The user must remember to call sceneDestroy or
sceneDestroyRecursively when finished. Returns 0 if no error occurred. */
int sceneInitialize(sceneNode *node, GLuint unifDim, meshGLMesh *mesh,
		sceneNode *firstChild, sceneNode *nextSibling) {
	node->unif = (GLdouble *)malloc(unifDim * sizeof(GLdouble));
	if (node->unif == NULL)
		return 1;
	mat33Identity(node->rotation);
	vecSet(3, node->translation, 0.0, 0.0, 0.0);
	node->unifDim = unifDim;
	node->meshGL = mesh;
	node->firstChild = firstChild;
	node->nextSibling = nextSibling;
	return 0;
}

/* Deallocates the resources backing this scene node. Does not destroy the
resources backing the mesh, etc. */
void sceneDestroy(sceneNode *node) {
	if (node->unif != NULL)
		free(node->unif);
	node->unif = NULL;
}

/*** Accessors ***/

/* Copies the unifDim-dimensional vector from unif into the node. */
void sceneSetUniform(sceneNode *node, double unif[]) {
	vecCopy(node->unifDim, unif, node->unif);
}

/* Sets one uniform in the node, based on its index in the unif array. */
void sceneSetOneUniform(sceneNode *node, int index, double unif) {
	node->unif[index] = unif;
}

/* Calls sceneDestroy recursively on the node's descendants and younger
siblings, and then on the node itself. */
void sceneDestroyRecursively(sceneNode *node) {
	if (node->firstChild != NULL)
		sceneDestroyRecursively(node->firstChild);
	if (node->nextSibling != NULL)
		sceneDestroyRecursively(node->nextSibling);
	sceneDestroy(node);
}

/* Sets the node's rotation. */
void sceneSetRotation(sceneNode *node, GLdouble rot[3][3]) {
	vecCopy(9, (GLdouble *)rot, (GLdouble *)(node->rotation));
}

/* Sets the node's translation. */
void sceneSetTranslation(sceneNode *node, GLdouble transl[3]) {
	vecCopy(3, transl, node->translation);
}

/* Sets the scene's mesh. */
void sceneSetMesh(sceneNode *node, meshGLMesh *mesh) {
	node->meshGL = mesh;
}

/* Sets the node's first child. */
void sceneSetFirstChild(sceneNode *node, sceneNode *child) {
	node->firstChild = child;
}

/* Sets the node's next sibling. */
void sceneSetNextSibling(sceneNode *node, sceneNode *sibling) {
	node->nextSibling = sibling;
}

/* Adds a sibling to the given node. The sibling shows up as the youngest of
its siblings. */
void sceneAddSibling(sceneNode *node, sceneNode *sibling) {
	if (node->nextSibling == NULL)
		node->nextSibling = sibling;
	else
		sceneAddSibling(node->nextSibling, sibling);
}

/* Adds a child to the given node. The child shows up as the youngest of its
siblings. */
void sceneAddChild(sceneNode *node, sceneNode *child) {
	if (node->firstChild == NULL)
		node->firstChild = child;
	else
		sceneAddSibling(node->firstChild, child);
}

/* Removes a sibling from the given node. Equality of nodes is assessed as
equality of pointers. If the sibling is not present, then has no effect (fails
silently). */
void sceneRemoveSibling(sceneNode *node, sceneNode *sibling) {
	if (node->nextSibling == NULL)
		return;
	else if (node->nextSibling == sibling)
		node->nextSibling = sibling->nextSibling;
	else
		sceneRemoveSibling(node->nextSibling, sibling);
}

/* Removes a child from the given node. Equality of nodes is assessed as
equality of pointers. If the sibling is not present, then has no effect (fails
silently). */
void sceneRemoveChild(sceneNode *node, sceneNode *child) {
	if (node->firstChild == NULL)
		return;
	else if (node->firstChild == child)
		node->firstChild = child->nextSibling;
	else
		sceneRemoveSibling(node->firstChild, child);
}

/*** OpenGL ***/

void vecOpenGL(int dim, GLdouble v[], GLfloat openGL[]) {
	for (int i = 0; i < dim; i += 1)
		openGL[i] = v[i];
}

/* Renders the node, its younger siblings, and their descendants. parent is the
modeling matrix at the parent of the node. If the node has no parent, then this
matrix is the 4x4 identity matrix. Loads the modeling transformation into
modelingLoc. The attribute information exists to be passed to meshGLRender. The
uniform information is analogous, but sceneRender loads it, not meshGLRender. */
void sceneRender(sceneNode *node, GLdouble parent[4][4], GLint modelingLoc,
		GLuint unifNum, GLuint unifDims[], GLint unifLocs[],
		GLuint attrNum, GLuint attrDims[], GLint attrLocs[]) {
	/* Set the uniform modeling matrix. */
	GLdouble isom[4][4];
	GLdouble modeling[4][4];
	GLfloat newModeling[4][4];
	mat44Isometry(node->rotation, node->translation, isom);
	mat444Multiply(isom, parent, modeling);
	mat44OpenGL(modeling, newModeling);
	glUniformMatrix4fv(modelingLoc, 1, GL_FALSE, (GLfloat *) newModeling);
	/* Set the other uniforms. The casting from double to float is annoying. */
	/* Render the mesh, the children, and the younger siblings. */
	meshGLRender(node->meshGL, attrNum, attrDims, attrLocs);

	//render child/sib if possible
	if (node->firstChild != NULL ){
		sceneRender(node->firstChild, modeling, modelingLoc, unifNum, unifDims, unifLocs, attrNum,
		attrDims, attrLocs);
	}
	if (node->nextSibling != NULL){
		sceneRender(node->nextSibling, parent, modelingLoc, unifNum, unifDims, unifLocs, attrNum,
		attrDims, attrLocs);
	}

// /* Set the uniform modeling matrix. */
// 	GLfloat modeling[4][4];
// 	double rot[3][3], model[4][4], newModel[4][4];
// 	mat44Isometry(node->rotation, node->translation, model);
// 	mat444Multiply(parent, model, newModel);
// 	mat44OpenGL(newModel, modeling);
// 	glUniformMatrix4fv(modelingLoc, 1, GL_FALSE, (GLfloat *)modeling);

// 	glUniform2fv(unifLocs[0], 1, (GLfloat *) node->unif);
// /* Render the mesh, the children, and the younger siblings. */
// 	meshGLRender(node->meshGL, attrNum, attrDims, attrLocs);
// /* Then, call sceneRender recursively on its first child/next sibling
// if there are any. */
// 	if (node->firstChild != NULL) {
// 		sceneRender(node->firstChild, newModel, modelingLoc,
// 			unifNum, unifDims, unifLocs, attrNum, attrDims, attrLocs);
// 	}
// 	if (node->nextSibling != NULL) {
// 		sceneRender(node->nextSibling, parent, modelingLoc,
// 			unifNum, unifDims, unifLocs, attrNum, attrDims, attrLocs);
// 	}
}


text:
package com.hazelcast.simulator.tests.webContainer;

import com.hazelcast.logging.ILogger;
import com.hazelcast.logging.Logger;
import com.hazelcast.simulator.test.TestContext;
import com.hazelcast.simulator.test.annotations.Run;
import com.hazelcast.simulator.test.annotations.Setup;
import com.hazelcast.simulator.utils.ThreadSpawner;
import com.hazelcast.simulator.worker.selector.OperationSelector;
import com.hazelcast.simulator.worker.selector.OperationSelectorBuilder;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.BasicCookieStore;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import static com.hazelcast.simulator.tests.helpers.HazelcastTestUtils.rethrow;
import static org.junit.Assert.assertEquals;

/**
 * A load producing HTTP test. Making HTTP PUT and GET requests. The ip addresses and ports of the members are configured in the
 * properties. Each thread of this test represents a HTTP client.
 */
public class HttpLoadTest {

    private static final ILogger LOGGER = Logger.getLogger(HttpLoadTest.class);

    private enum RequestType {
        GET_REQUEST,
        PUT_REQUEST
    }

    public String basename = HttpLoadTest.class.getSimpleName();
    public String serverIp = "";
    public int serverPort = 0;

    public int threadCount = 3;
    public int maxKeys = 1000;
    public double getRequestProb = 0.5;
    public double postRequestProb = 0.5;

    private final OperationSelectorBuilder<RequestType> operationSelectorBuilder = new OperationSelectorBuilder<RequestType>();

    private TestContext testContext;
    private String baseRul;

    @Setup
    public void setup(TestContext testContext) {
        this.testContext = testContext;

        baseRul = "http://" + serverIp + ':' + serverPort + '/';

        operationSelectorBuilder
                .addOperation(RequestType.GET_REQUEST, getRequestProb)
                .addOperation(RequestType.PUT_REQUEST, postRequestProb);
    }

    @Run
    public void run() {
        ThreadSpawner spawner = new ThreadSpawner(basename);
        for (int i = 0; i < threadCount; i++) {
            spawner.spawn(new Worker());
        }
        spawner.awaitCompletion();
    }

    private class Worker implements Runnable {

        private final Random random = new Random();
        private final Map<Integer, String> putKeyValues = new HashMap<Integer, String>();
        private final CookieStore cookieStore = new BasicCookieStore();

        private final OperationSelector<RequestType> requestSelector = operationSelectorBuilder.build();

        private final HttpClient client;

        public Worker() {
            LOGGER.info(basename + ": baseRul=" + baseRul + " cookie=" + cookieStore);

            client = HttpClientBuilder.create().disableRedirectHandling().setDefaultCookieStore(cookieStore).build();

            try {
                for (int key = 0; key < maxKeys; key++) {
                    int val = random.nextInt();
                    String res = putRequest("key/" + key + '/' + val);
                    putKeyValues.put(key, res);
                }
            } catch (Exception e) {
                throw rethrow(e);
            }
        }

        public void run() {
            while (!testContext.isStopped()) {
                try {
                    int key = random.nextInt(maxKeys);
                    String res;
                    switch (requestSelector.select()) {
                        case PUT_REQUEST:
                            int val = random.nextInt();
                            res = putRequest("key/" + key + '/' + val);
                            putKeyValues.put(key, res);
                            break;

                        case GET_REQUEST:
                            res = getRequest("key/" + key);
                            assertEquals(basename + ": not what I put", res, putKeyValues.get(key));
                            break;

                        default:
                            throw new UnsupportedOperationException();
                    }
                } catch (IOException e) {
                    throw rethrow(e);
                }
            }
        }

        private String getRequest(String restOpp) throws IOException {
            HttpUriRequest request = new HttpGet(baseRul + restOpp);
            return responseToString(client.execute(request));
        }

        private String putRequest(String restOpp) throws IOException {
            HttpUriRequest request = new HttpPut(baseRul + restOpp);
            return responseToString(client.execute(request));
        }

        private String responseToString(HttpResponse response) throws IOException {
            HttpEntity entity = response.getEntity();
            return EntityUtils.toString(entity);
        }
    }
}


text:
package system

import (
	"testing"

	"github.com/docker/docker/api/types"
	"github.com/stretchr/testify/assert"
)

func TestValidateDockerInfo(t *testing.T) {
	v := &DockerValidator{
		Reporter: DefaultReporter,
	}
	spec := &DockerSpec{
		Version:     []string{`1\.1[1-3]\..*`}, // Requires 1.11+
		GraphDriver: []string{"driver_1", "driver_2"},
	}
	for _, test := range []struct {
		info types.Info
		err  bool
		warn bool
	}{
		{
			info: types.Info{Driver: "driver_1", ServerVersion: "1.10.1"},
			err:  true,
			warn: false,
		},
		{
			info: types.Info{Driver: "bad_driver", ServerVersion: "1.11.1"},
			err:  true,
			warn: false,
		},
		{
			info: types.Info{Driver: "driver_1", ServerVersion: "1.11.1"},
			err:  false,
			warn: false,
		},
		{
			info: types.Info{Driver: "driver_2", ServerVersion: "1.12.1"},
			err:  false,
			warn: false,
		},
		{
			info: types.Info{Driver: "driver_2", ServerVersion: "1.13.1"},
			err:  false,
			warn: false,
		},
		// TODO remove/change warn value once sig-node supports 17.03-0-ce
		{
			info: types.Info{Driver: "driver_2", ServerVersion: "17.03.0-ce"},
			err:  false,
			warn: true,
		},
	} {
		warn, err := v.validateDockerInfo(spec, test.info)
		if !test.err {
			assert.Nil(t, err, "Expect error not to occur with docker info %+v", test.info)
		} else {
			assert.NotNil(t, err, "Expect error to occur with docker info %+v", test.info)
		}
		if !test.warn {
			assert.Nil(t, warn, "Expect error not to occur with docker info %+v", test.info)
		} else {
			assert.NotNil(t, warn, "Expect error to occur with docker info %+v", test.info)
		}

	}
}


text:
package com.buterfleoge.whale.type.protocol.account;

import com.buterfleoge.whale.type.protocol.Request;

/**
 * @author xiezhenzong
 *
 */
public class GetWxShareConfigRequest extends Request {

    private String url;

    /**
     * @return the url
     */
    public String getUrl() {
        return url;
    }

    /**
     * @param url
     *            the url to set
     */
    public void setUrl(String url) {
        this.url = url;
    }

}


text:
sessionclient-python
====================

Sessionserver client library for Python