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

import java.io.*;

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

/**
 * Provides a base implementation of <tt>PullBufferDataSource</tt> and
 * <tt>CaptureDevice</tt> in order to facilitate implementers by taking care of
 * boilerplate in the most common cases.
 *
 * @author Lyubomir Marinov
 */
public abstract class AbstractPullBufferCaptureDevice
    extends PullBufferDataSource
    implements CaptureDevice
{

    /**
     * The <tt>CaptureDeviceInfo</tt>.
     */
    private CaptureDeviceInfo deviceInfo;

    /**
     * The <tt>AbstractBufferCaptureDevice</tt> which provides the
     * implementation of this <tt>AbstractPullBufferCaptureDevice</tt>.
     */
    private final AbstractBufferCaptureDevice<AbstractPullBufferStream<?>> impl
        = new AbstractBufferCaptureDevice<AbstractPullBufferStream<?>>()
        {
            @Override
            protected FrameRateControl createFrameRateControl()
            {
                return
                    AbstractPullBufferCaptureDevice.this
                            .createFrameRateControl();
            }

            @Override
            protected AbstractPullBufferStream<?> createStream(
                    int streamIndex,
                    FormatControl formatControl)
            {
                return
                    AbstractPullBufferCaptureDevice.this.createStream(
                            streamIndex,
                            formatControl);
            }

            @Override
            protected void doConnect()
                throws IOException
            {
                AbstractPullBufferCaptureDevice.this.doConnect();
            }

            @Override
            protected void doDisconnect()
            {
                AbstractPullBufferCaptureDevice.this.doDisconnect();
            }

            @Override
            protected void doStart()
                throws IOException
            {
                AbstractPullBufferCaptureDevice.this.doStart();
            }

            @Override
            protected void doStop()
                throws IOException
            {
                AbstractPullBufferCaptureDevice.this.doStop();
            }

            @Override
            public CaptureDeviceInfo getCaptureDeviceInfo()
            {
                return
                    AbstractPullBufferCaptureDevice.this
                            .getCaptureDeviceInfo();
            }

            @Override
            protected Format getFormat(int streamIndex, Format oldValue)
            {
                return
                    AbstractPullBufferCaptureDevice.this.getFormat(
                            streamIndex,
                            oldValue);
            }

            @Override
            protected Format[] getSupportedFormats(int streamIndex)
            {
                return
                    AbstractPullBufferCaptureDevice.this
                            .getSupportedFormats(streamIndex);
            }

            @Override
            protected Format setFormat(
                    int streamIndex,
                    Format oldValue, Format newValue)
            {
                return
                    AbstractPullBufferCaptureDevice.this.setFormat(
                            streamIndex,
                            oldValue, newValue);
            }
        };

    /**
     * Initializes a new <tt>AbstractPullBufferCaptureDevice</tt> instance.
     */
    protected AbstractPullBufferCaptureDevice()
    {
    }

    /**
     * Initializes a new <tt>AbstractPullBufferCaptureDevice</tt> instance from
     * a specific <tt>MediaLocator</tt>.
     *
     * @param locator the <tt>MediaLocator</tt> to create the new instance from
     */
    protected AbstractPullBufferCaptureDevice(MediaLocator locator)
    {
        setLocator(locator);
    }

    /**
     * Opens a connection to the media source specified by the
     * <tt>MediaLocator</tt> of this <tt>DataSource</tt>.
     *
     * @throws IOException if anything goes wrong while opening the connection
     * to the media source specified by the <tt>MediaLocator</tt> of this
     * <tt>DataSource</tt>
     */
    @Override
    public void connect()
        throws IOException
    {
        impl.connect();
    }

    /**
     * Creates a new <tt>FrameRateControl</tt> instance which is to allow the
     * getting and setting of the frame rate of this
     * <tt>AbstractPullBufferCaptureDevice</tt>.
     *
     * @return a new <tt>FrameRateControl</tt> instance which is to allow the
     * getting and setting of the frame rate of this
     * <tt>AbstractPullBufferCaptureDevice</tt>
     */
    protected FrameRateControl createFrameRateControl()
    {
        return null;
    }

    /**
     * Creates a new <tt>PullBufferStream</tt> which is to be at a specific
     * zero-based index in the list of streams of this
     * <tt>PullBufferDataSource</tt>. The <tt>Format</tt>-related information of
     * the new instance is to be abstracted by a specific
     * <tt>FormatControl</tt>.
     *
     * @param streamIndex the zero-based index of the <tt>PullBufferStream</tt>
     * in the list of streams of this <tt>PullBufferDataSource</tt>
     * @param formatControl the <tt>FormatControl</tt> which is to abstract the
     * <tt>Format</tt>-related information of the new instance
     * @return a new <tt>PullBufferStream</tt> which is to be at the specified
     * <tt>streamIndex</tt> in the list of streams of this
     * <tt>PullBufferDataSource</tt> and which has its <tt>Format</tt>-related
     * information abstracted by the specified <tt>formatControl</tt>
     */
    protected abstract AbstractPullBufferStream<?> createStream(
            int streamIndex,
            FormatControl formatControl);

    /**
     * Closes the connection to the media source specified by the
     * <tt>MediaLocator</tt> of this <tt>DataSource</tt>. If such a connection
     * has not been opened, the call is ignored.
     */
    @Override
    public void disconnect()
    {
        impl.disconnect();
    }

    /**
     * Opens a connection to the media source specified by the
     * <tt>MediaLocator</tt> of this <tt>DataSource</tt>. Allows extenders to
     * override and be sure that there will be no request to open a connection
     * if the connection has already been opened.
     *
     * @throws IOException if anything goes wrong while opening the connection
     * to the media source specified by the <tt>MediaLocator</tt> of this
     * <tt>DataSource</tt>
     */
    protected void doConnect()
        throws IOException
    {
    }

    /**
     * Closes the connection to the media source specified by the
     * <tt>MediaLocator</tt> of this <tt>DataSource</tt>. Allows extenders to
     * override and be sure that there will be no request to close a connection
     * if the connection has not been opened yet.
     */
    protected void doDisconnect()
    {
        /*
         * While it is not clear whether the streams can be released upon
         * disconnect, com.imb.media.protocol.SuperCloneableDataSource gets the
         * streams of the DataSource it adapts (i.e. this DataSource when
         * SourceCloneable support is to be created for it) before #connect().
         * Unfortunately, it means that it isn't clear when the streams are to
         * be disposed.
         */
    }

    /**
     * Starts the transfer of media data from this <tt>DataSource</tt>. Allows
     * extenders to override and be sure that there will be no request to start
     * the transfer of media data if it has already been started.
     *
     * @throws IOException if anything goes wrong while starting the transfer of
     * media data from this <tt>DataSource</tt>
     */
    protected void doStart()
        throws IOException
    {
        impl.defaultDoStart();
    }

    /**
     * Stops the transfer of media data from this <tt>DataSource</tt>. Allows
     * extenders to override and be sure that there will be no request to stop
     * the transfer of media data if it has not been started yet.
     *
     * @throws IOException if anything goes wrong while stopping the transfer of
     * media data from this <tt>DataSource</tt>
     */
    protected void doStop()
        throws IOException
    {
        impl.defaultDoStop();
    }

    /**
     * Gets the <tt>CaptureDeviceInfo</tt> of this <tt>CaptureDevice</tt> which
     * describes it.
     *
     * @return the <tt>CaptureDeviceInfo</tt> of this <tt>CaptureDevice</tt>
     * which describes it
     */
    public CaptureDeviceInfo getCaptureDeviceInfo()
    {
        return
            (deviceInfo == null)
                ? AbstractBufferCaptureDevice.getCaptureDeviceInfo(this)
                : deviceInfo;
    }

    /**
     * Gets the content type of the media represented by this instance. The
     * <tt>AbstractPullBufferCaptureDevice</tt> implementation always returns
     * {@link ContentDescriptor#RAW}.
     *
     * @return the content type of the media represented by this instance
     */
    @Override
    public String getContentType()
    {
        return ContentDescriptor.RAW;
    }

    /**
     * Gets the control of the specified type available for this instance.
     *
     * @param controlType the type of the control available for this instance to
     * be retrieved
     * @return an <tt>Object</tt> which represents the control of the specified
     * type available for this instance if such a control is indeed available;
     * otherwise, <tt>null</tt>
     */
    @Override
    public Object getControl(String controlType)
    {
        return impl.getControl(controlType);
    }

    /**
     * Implements {@link javax.media.Controls#getControls()}. Gets the controls
     * available for this instance.
     *
     * @return an array of <tt>Object</tt>s which represent the controls
     * available for this instance
     */
    @Override
    public Object[] getControls()
    {
        return impl.getControls();
    }

    /**
     * Gets the duration of the media represented by this instance. The
     * <tt>AbstractPullBufferCaptureDevice</tt> always returns
     * {@link #DURATION_UNBOUNDED}.
     *
     * @return the duration of the media represented by this instance
     */
    @Override
    public Time getDuration()
    {
        return DURATION_UNBOUNDED;
    }

    /**
     * Gets the <tt>Format</tt> to be reported by the <tt>FormatControl</tt> of
     * a <tt>PullBufferStream</tt> at a specific zero-based index in the list of
     * streams of this <tt>PullBufferDataSource</tt>. The
     * <tt>PullBufferStream</tt> may not exist at the time of requesting its
     * <tt>Format</tt>. Allows extenders to override the default behavior which
     * is to report any last-known format or the first <tt>Format</tt> from the
     * list of supported formats as defined in the JMF registration of this
     * <tt>CaptureDevice</tt>.
     *
     * @param streamIndex the zero-based index of the <tt>PullBufferStream</tt>
     * the <tt>Format</tt> of which is to be retrieved
     * @param oldValue the last-known <tt>Format</tt> for the
     * <tt>PullBufferStream</tt> at the specified <tt>streamIndex</tt>
     * @return the <tt>Format</tt> to be reported by the <tt>FormatControl</tt>
     * of the <tt>PullBufferStream</tt> at the specified <tt>streamIndex</tt> in
     * the list of streams of this <tt>PullBufferDataSource</tt>.
     */
    protected Format getFormat(int streamIndex, Format oldValue)
    {
        return impl.defaultGetFormat(streamIndex, oldValue);
    }

    /**
     * Gets an array of <tt>FormatControl</tt> instances each one of which can
     * be used before {@link #connect()} to get and set the capture
     * <tt>Format</tt> of each one of the capture streams.
     *
     * @return an array of <tt>FormatControl</tt> instances each one of which
     * can be used before {@link #connect()} to get and set the capture
     * <tt>Format</tt> of each one of the capture streams
     */
    public FormatControl[] getFormatControls()
    {
        return impl.getFormatControls();
    }

    /**
     * Gets the <tt>Object</tt> which is to synchronize the access to
     * {@link #streams()} and its return value.
     *
     * @return the <tt>Object</tt> which is to synchronize the access to
     * {@link #streams()} and its return value
     */
    protected Object getStreamSyncRoot()
    {
        return impl.getStreamSyncRoot();
    }

    /**
     * Gets the <tt>PullBufferStream</tt>s through which this
     * <tt>PullBufferDataSource</tt> gives access to its media data.
     *
     * @return an array of the <tt>PullBufferStream</tt>s through which this
     * <tt>PullBufferDataSource</tt> gives access to its media data
     */
    @Override
    public PullBufferStream[] getStreams()
    {
        return impl.getStreams(PullBufferStream.class);
    }

    /**
     * Gets the <tt>Format</tt>s which are to be reported by a
     * <tt>FormatControl</tt> as supported formats for a
     * <tt>PullBufferStream</tt> at a specific zero-based index in the list of
     * streams of this <tt>PullBufferDataSource</tt>.
     *
     * @param streamIndex the zero-based index of the <tt>PullBufferStream</tt>
     * for which the specified <tt>FormatControl</tt> is to report the list of
     * supported <tt>Format</tt>s
     * @return an array of <tt>Format</tt>s to be reported by a
     * <tt>FormatControl</tt> as the supported formats for the
     * <tt>PullBufferStream</tt> at the specified <tt>streamIndex</tt> in the
     * list of streams of this <tt>PullBufferDataSource</tt>
     */
    protected Format[] getSupportedFormats(int streamIndex)
    {
        return impl.defaultGetSupportedFormats(streamIndex);
    }

    /**
     * Sets a specific <tt>CaptureDeviceInfo</tt> on this
     * <tt>CaptureDevice</tt>.
     *
     * @param deviceInfo the <tt>CaptureDeviceInfo</tt> on this
     * <tt>CaptureDevice</tt>
     */
    public void setCaptureDeviceInfo(CaptureDeviceInfo deviceInfo)
    {
        this.deviceInfo = deviceInfo;
    }

    /**
     * Attempts to set the <tt>Format</tt> to be reported by the
     * <tt>FormatControl</tt> of a <tt>PullBufferStream</tt> at a specific
     * zero-based index in the list of streams of this
     * <tt>PullBufferDataSource</tt>. The <tt>PullBufferStream</tt> does not
     * exist at the time of the attempt to set its <tt>Format</tt>. Allows
     * extenders to override the default behavior which is to not attempt to set
     * the specified <tt>Format</tt> so that they can enable setting the
     * <tt>Format</tt> prior to creating the <tt>PullBufferStream</tt>. If
     * setting the <tt>Format</tt> of an existing <tt>PullBufferStream</tt> is
     * desired, <tt>AbstractPullBufferStream#doSetFormat(Format)</tt> should be
     * overridden instead.
     *
     * @param streamIndex the zero-based index of the <tt>PullBufferStream</tt>
     * the <tt>Format</tt> of which is to be set
     * @param oldValue the last-known <tt>Format</tt> for the
     * <tt>PullBufferStream</tt> at the specified <tt>streamIndex</tt>
     * @param newValue the <tt>Format</tt> which is to be set
     * @return the <tt>Format</tt> to be reported by the <tt>FormatControl</tt>
     * of the <tt>PullBufferStream</tt> at the specified <tt>streamIndex</tt>
     * in the list of streams of this <tt>PullBufferStream</tt> or <tt>null</tt>
     * if the attempt to set the <tt>Format</tt> did not success and any
     * last-known <tt>Format</tt> is to be left in effect
     */
    protected Format setFormat(
            int streamIndex,
            Format oldValue,
            Format newValue)
    {
        return oldValue;
    }

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

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

    /**
     * Gets the internal array of <tt>AbstractPushBufferStream</tt>s through
     * which this <tt>AbstractPushBufferCaptureDevice</tt> gives access to its
     * media data.
     *
     * @return the internal array of <tt>AbstractPushBufferStream</tt>s through
     * which this <tt>AbstractPushBufferCaptureDevice</tt> gives access to its
     * media data
     */
    protected AbstractBufferStream<?>[] streams()
    {
        return impl.streams();
    }
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>PHPExcel classes » \PHPExcel_Worksheet_PageSetup</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">

PHPExcel classes

                                    API Documentation

Packages

 Default

 JAMA

 JAMA
Cholesky decomposition class
For a symmetric, positive definite matrix A, the Cholesky decomposition
is an lower triangular matrix L so that A = L*L'

 JAMA
Class to obtain eigenvalues and eigenvectors of a real matrix

 JAMA
Error handling

 JAMA
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n
unit lower triangular matrix L, an n-by-n upper triangular matrix U,
and a permutation vector piv of length m so that A(piv,:) = L*U

 JAMA
For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n
orthogonal matrix Q and an n-by-n upper triangular matrix R so that
A = Q*R

 JAMA
For an m-by-n matrix A with m >= n, the singular value decomposition is
an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and
an n-by-n orthogonal matrix V so that A = U*S*V'

 JAMA
Pythagorean Theorem:
a = 3
b = 4
r = sqrt(square(a) + square(b))
r = 5
r = sqrt(a^2 + b^2) without under/overflow

 PHPExcel

                                    Charts

 Class hierarchy diagram

                                    Reports

 Errors
                519

 Markers

todo
                19

fixme
                10

 Deprecated elements
                12

Back to top

                            Javascript is disabled; several features are only available
                            if Javascript is enabled.

<button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button>

<button class="btn details" title="Show descriptions and method names"></button><button class="btn simple" title="Show only method names"></button>

 Methods

Implement PHP __clone to create a deep clone, not just a shallow copy.
__clone()

Create a new PHPExcel_Worksheet_PageSetup
__construct()

Add a new print area (e.g.
addPrintArea()

Add a new print area to the list of print areas
addPrintAreaByColumnAndRow()

Clear a print area
clearPrintArea()

Get Columns to repeat at left
getColumnsToRepeatAtLeft()

Get first page number
getFirstPageNumber()

Get Fit To Height
getFitToHeight()

Get Fit To Page
getFitToPage()

Get Fit To Width
getFitToWidth()

Get center page horizontally
getHorizontalCentered()

Get Orientation
getOrientation()

Get Paper Size
getPaperSize()

Get print area
getPrintArea()

Get Rows to repeat at top
getRowsToRepeatAtTop()

Get Scale
getScale()

Get center page vertically
getVerticalCentered()

Is Columns to repeat at left set?
isColumnsToRepeatAtLeftSet()

Is print area set?
isPrintAreaSet()

Is Rows to repeat at top set?
isRowsToRepeatAtTopSet()

Reset first page number
resetFirstPageNumber()

Set Columns to repeat at left
setColumnsToRepeatAtLeft()

Set Columns to repeat at left by start and end
setColumnsToRepeatAtLeftByStartAndEnd()

Set first page number
setFirstPageNumber()

Set Fit To Height
setFitToHeight()

Set Fit To Page
setFitToPage()

Set Fit To Width
setFitToWidth()

Set center page horizontally
setHorizontalCentered()

Set Orientation
setOrientation()

Set Paper Size
setPaperSize()

Set print area.
setPrintArea()

Set print area
setPrintAreaByColumnAndRow()

Set Rows to repeat at top
setRowsToRepeatAtTop()

Set Rows to repeat at top by start and end
setRowsToRepeatAtTopByStartAndEnd()

Set Scale
setScale()

Set center page vertically
setVerticalCentered()

 Properties

» Private

$_columnsToRepeatAtLeft

$_firstPageNumber

$_fitToHeight

$_fitToPage

$_fitToWidth

$_horizontalCentered

$_orientation

$_paperSize

$_printArea

$_rowsToRepeatAtTop

$_scale

$_verticalCentered

 Constants

ORIENTATION_DEFAULT
ORIENTATION_DEFAULT

ORIENTATION_LANDSCAPE
ORIENTATION_LANDSCAPE

ORIENTATION_PORTRAIT
ORIENTATION_PORTRAIT

PAPERSIZE_6_3_4_ENVELOPE
PAPERSIZE_6_3_4_ENVELOPE

PAPERSIZE_A2_PAPER
PAPERSIZE_A2_PAPER

PAPERSIZE_A3
PAPERSIZE_A3

PAPERSIZE_A3_EXTRA_PAPER
PAPERSIZE_A3_EXTRA_PAPER

PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER
PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_A3_TRANSVERSE_PAPER
PAPERSIZE_A3_TRANSVERSE_PAPER

PAPERSIZE_A4
PAPERSIZE_A4

PAPERSIZE_A4_EXTRA_PAPER
PAPERSIZE_A4_EXTRA_PAPER

PAPERSIZE_A4_PLUS_PAPER
PAPERSIZE_A4_PLUS_PAPER

PAPERSIZE_A4_SMALL
PAPERSIZE_A4_SMALL

PAPERSIZE_A4_TRANSVERSE_PAPER
PAPERSIZE_A4_TRANSVERSE_PAPER

PAPERSIZE_A5
PAPERSIZE_A5

PAPERSIZE_A5_EXTRA_PAPER
PAPERSIZE_A5_EXTRA_PAPER

PAPERSIZE_A5_TRANSVERSE_PAPER
PAPERSIZE_A5_TRANSVERSE_PAPER

PAPERSIZE_B4
PAPERSIZE_B4

PAPERSIZE_B4_ENVELOPE
PAPERSIZE_B4_ENVELOPE

PAPERSIZE_B5
PAPERSIZE_B5

PAPERSIZE_B5_ENVELOPE
PAPERSIZE_B5_ENVELOPE

PAPERSIZE_B6_ENVELOPE
PAPERSIZE_B6_ENVELOPE

PAPERSIZE_C
PAPERSIZE_C

PAPERSIZE_C3_ENVELOPE
PAPERSIZE_C3_ENVELOPE

PAPERSIZE_C4_ENVELOPE
PAPERSIZE_C4_ENVELOPE

PAPERSIZE_C5_ENVELOPE
PAPERSIZE_C5_ENVELOPE

PAPERSIZE_C65_ENVELOPE
PAPERSIZE_C65_ENVELOPE

PAPERSIZE_C6_ENVELOPE
PAPERSIZE_C6_ENVELOPE

PAPERSIZE_D
PAPERSIZE_D

PAPERSIZE_DL_ENVELOPE
PAPERSIZE_DL_ENVELOPE

PAPERSIZE_E
PAPERSIZE_E

PAPERSIZE_EXECUTIVE
PAPERSIZE_EXECUTIVE

PAPERSIZE_FOLIO
PAPERSIZE_FOLIO

PAPERSIZE_GERMAN_LEGAL_FANFOLD
PAPERSIZE_GERMAN_LEGAL_FANFOLD

PAPERSIZE_GERMAN_STANDARD_FANFOLD
PAPERSIZE_GERMAN_STANDARD_FANFOLD

PAPERSIZE_INVITE_ENVELOPE
PAPERSIZE_INVITE_ENVELOPE

PAPERSIZE_ISO_B4
PAPERSIZE_ISO_B4

PAPERSIZE_ISO_B5_EXTRA_PAPER
PAPERSIZE_ISO_B5_EXTRA_PAPER

PAPERSIZE_ITALY_ENVELOPE
PAPERSIZE_ITALY_ENVELOPE

PAPERSIZE_JAPANESE_DOUBLE_POSTCARD
PAPERSIZE_JAPANESE_DOUBLE_POSTCARD

PAPERSIZE_JIS_B5_TRANSVERSE_PAPER
PAPERSIZE_JIS_B5_TRANSVERSE_PAPER

PAPERSIZE_LEDGER
PAPERSIZE_LEDGER

PAPERSIZE_LEGAL
PAPERSIZE_LEGAL

PAPERSIZE_LEGAL_EXTRA_PAPER
PAPERSIZE_LEGAL_EXTRA_PAPER

PAPERSIZE_LETTER
PAPERSIZE_LETTER

PAPERSIZE_LETTER_EXTRA_PAPER
PAPERSIZE_LETTER_EXTRA_PAPER

PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER
PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_LETTER_PLUS_PAPER
PAPERSIZE_LETTER_PLUS_PAPER

PAPERSIZE_LETTER_SMALL
PAPERSIZE_LETTER_SMALL

PAPERSIZE_LETTER_TRANSVERSE_PAPER
PAPERSIZE_LETTER_TRANSVERSE_PAPER

PAPERSIZE_MONARCH_ENVELOPE
PAPERSIZE_MONARCH_ENVELOPE

PAPERSIZE_NO10_ENVELOPE
PAPERSIZE_NO10_ENVELOPE

PAPERSIZE_NO11_ENVELOPE
PAPERSIZE_NO11_ENVELOPE

PAPERSIZE_NO12_ENVELOPE
PAPERSIZE_NO12_ENVELOPE

PAPERSIZE_NO14_ENVELOPE
PAPERSIZE_NO14_ENVELOPE

PAPERSIZE_NO9_ENVELOPE
PAPERSIZE_NO9_ENVELOPE

PAPERSIZE_NOTE
PAPERSIZE_NOTE

PAPERSIZE_QUARTO
PAPERSIZE_QUARTO

PAPERSIZE_STANDARD_1
PAPERSIZE_STANDARD_1

PAPERSIZE_STANDARD_2
PAPERSIZE_STANDARD_2

PAPERSIZE_STANDARD_PAPER_1
PAPERSIZE_STANDARD_PAPER_1

PAPERSIZE_STANDARD_PAPER_2
PAPERSIZE_STANDARD_PAPER_2

PAPERSIZE_STANDARD_PAPER_3
PAPERSIZE_STANDARD_PAPER_3

PAPERSIZE_STATEMENT
PAPERSIZE_STATEMENT

PAPERSIZE_SUPERA_SUPERA_A4_PAPER
PAPERSIZE_SUPERA_SUPERA_A4_PAPER

PAPERSIZE_SUPERB_SUPERB_A3_PAPER
PAPERSIZE_SUPERB_SUPERB_A3_PAPER

PAPERSIZE_TABLOID
PAPERSIZE_TABLOID

PAPERSIZE_TABLOID_EXTRA_PAPER
PAPERSIZE_TABLOID_EXTRA_PAPER

PAPERSIZE_US_STANDARD_FANFOLD
PAPERSIZE_US_STANDARD_FANFOLD

SETPRINTRANGE_INSERT
SETPRINTRANGE_INSERT

SETPRINTRANGE_OVERWRITE
SETPRINTRANGE_OVERWRITE

\

global

\PHPExcel_Worksheet_PageSetup

PHPExcel_Worksheet_PageSetup

Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:

1 = Letter paper (8.5 in. by 11 in.)
2 = Letter small paper (8.5 in. by 11 in.)
3 = Tabloid paper (11 in. by 17 in.)
4 = Ledger paper (17 in. by 11 in.)
5 = Legal paper (8.5 in. by 14 in.)
6 = Statement paper (5.5 in. by 8.5 in.)
7 = Executive paper (7.25 in. by 10.5 in.)
8 = A3 paper (297 mm by 420 mm)
9 = A4 paper (210 mm by 297 mm)
10 = A4 small paper (210 mm by 297 mm)
11 = A5 paper (148 mm by 210 mm)
12 = B4 paper (250 mm by 353 mm)
13 = B5 paper (176 mm by 250 mm)
14 = Folio paper (8.5 in. by 13 in.)
15 = Quarto paper (215 mm by 275 mm)
16 = Standard paper (10 in. by 14 in.)
17 = Standard paper (11 in. by 17 in.)
18 = Note paper (8.5 in. by 11 in.)
19 = #9 envelope (3.875 in. by 8.875 in.)
20 = #10 envelope (4.125 in. by 9.5 in.)
21 = #11 envelope (4.5 in. by 10.375 in.)
22 = #12 envelope (4.75 in. by 11 in.)
23 = #14 envelope (5 in. by 11.5 in.)
24 = C paper (17 in. by 22 in.)
25 = D paper (22 in. by 34 in.)
26 = E paper (34 in. by 44 in.)
27 = DL envelope (110 mm by 220 mm)
28 = C5 envelope (162 mm by 229 mm)
29 = C3 envelope (324 mm by 458 mm)
30 = C4 envelope (229 mm by 324 mm)
31 = C6 envelope (114 mm by 162 mm)
32 = C65 envelope (114 mm by 229 mm)
33 = B4 envelope (250 mm by 353 mm)
34 = B5 envelope (176 mm by 250 mm)
35 = B6 envelope (176 mm by 125 mm)
36 = Italy envelope (110 mm by 230 mm)
37 = Monarch envelope (3.875 in. by 7.5 in.).
38 = 6 3/4 envelope (3.625 in. by 6.5 in.)
39 = US standard fanfold (14.875 in. by 11 in.)
40 = German standard fanfold (8.5 in. by 12 in.)
41 = German legal fanfold (8.5 in. by 13 in.)
42 = ISO B4 (250 mm by 353 mm)
43 = Japanese double postcard (200 mm by 148 mm)
44 = Standard paper (9 in. by 11 in.)
45 = Standard paper (10 in. by 11 in.)
46 = Standard paper (15 in. by 11 in.)
47 = Invite envelope (220 mm by 220 mm)
50 = Letter extra paper (9.275 in. by 12 in.)
51 = Legal extra paper (9.275 in. by 15 in.)
52 = Tabloid extra paper (11.69 in. by 18 in.)
53 = A4 extra paper (236 mm by 322 mm)
54 = Letter transverse paper (8.275 in. by 11 in.)
55 = A4 transverse paper (210 mm by 297 mm)
56 = Letter extra transverse paper (9.275 in. by 12 in.)
57 = SuperA/SuperA/A4 paper (227 mm by 356 mm)
58 = SuperB/SuperB/A3 paper (305 mm by 487 mm)
59 = Letter plus paper (8.5 in. by 12.69 in.)
60 = A4 plus paper (210 mm by 330 mm)
61 = A5 transverse paper (148 mm by 210 mm)
62 = JIS B5 transverse paper (182 mm by 257 mm)
63 = A3 extra paper (322 mm by 445 mm)
64 = A5 extra paper (174 mm by 235 mm)
65 = ISO B5 extra paper (201 mm by 276 mm)
66 = A2 paper (420 mm by 594 mm)
67 = A3 transverse paper (297 mm by 420 mm)
68 = A3 extra transverse paper (322 mm by 445 mm)

category
PHPExcel

package
PHPExcel_Worksheet

copyright
Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)

 Methods

Implement PHP __clone to create a deep clone, not just a shallow copy.

__clone()

Create a new PHPExcel_Worksheet_PageSetup

__construct()

Add a new print area (e.g.

addPrintArea(string $value, int $index) : \PHPExcel_Worksheet_PageSetup

'A1:D10' or 'A1:D10,G5:M20') to the list of print areas

Parameters

$value

string

$index

int
Identifier for a specific print area range allowing several ranges to be set
						A positive index will insert after that indexed entry in the print areas list, while a
							negative index will insert before the indexed entry.
							Specifying an index value of 0, will always append the new print range at the end of the
							list.
						Print areas are numbered from 1

Exceptions

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_PageSetup

Add a new print area to the list of print areas

addPrintAreaByColumnAndRow(int $column1, int $row1, int $column2, int $row2, int $index) : \PHPExcel_Worksheet_PageSetup

Parameters

$column1

int
Start Column for the print area

$row1

int
Start Row for the print area

$column2

int
End Column for the print area

$row2

int
End Row for the print area

$index

int
Identifier for a specific print area range allowing several ranges to be set
							A positive index will insert after that indexed entry in the print areas list, while a
								negative index will insert before the indexed entry.
								Specifying an index value of 0, will always append the new print range at the end of the
								list.
							Print areas are numbered from 1

Exceptions

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_PageSetup

Clear a print area

clearPrintArea(int $index) : \PHPExcel_Worksheet_PageSetup

Parameters

$index

int
Identifier for a specific print area range if several ranges have been set
                        Default behaviour, or an index value of 0, will clear all print ranges that are set
                        Otherwise, the range identified by the value of $index will be removed from the series
                        Print areas are numbered from 1

Returns

\PHPExcel_Worksheet_PageSetup

Get Columns to repeat at left

getColumnsToRepeatAtLeft() : array

Returns

arrayContaining start column and end column, empty array if option unset

Get first page number

getFirstPageNumber() : int

Returns

int

Get Fit To Height

getFitToHeight() : \int?

Returns

\int?

Get Fit To Page

getFitToPage() : boolean

Returns

boolean

Get Fit To Width

getFitToWidth() : \int?

Returns

\int?

Get center page horizontally

getHorizontalCentered() : bool

Returns

bool

Get Orientation

getOrientation() : string

Returns

string

Get Paper Size

getPaperSize() : int

Returns

int

Get print area

getPrintArea(int $index) : string

Parameters

$index

int
Identifier for a specific print area range if several ranges have been set
                        Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
                        Otherwise, the specific range identified by the value of $index will be returned
                        Print areas are numbered from 1

Exceptions

\PHPExcel_Exception

Returns

string

Get Rows to repeat at top

getRowsToRepeatAtTop() : array

Returns

arrayContaining start column and end column, empty array if option unset

Get Scale

getScale() : \int?

Returns

\int?

Get center page vertically

getVerticalCentered() : bool

Returns

bool

Is Columns to repeat at left set?

isColumnsToRepeatAtLeftSet() : boolean

Returns

boolean

Is print area set?

isPrintAreaSet(int $index) : boolean

Parameters

$index

int
Identifier for a specific print area range if several ranges have been set
                        Default behaviour, or an index value of 0, will identify whether any print range is set
                        Otherwise, existence of the range identified by the value of $index will be returned
                        Print areas are numbered from 1

Returns

boolean

Is Rows to repeat at top set?

isRowsToRepeatAtTopSet() : boolean

Returns

boolean

Reset first page number

resetFirstPageNumber() : \PHPExcel_Worksheet_HeaderFooter

Returns

\PHPExcel_Worksheet_HeaderFooter

Set Columns to repeat at left

setColumnsToRepeatAtLeft(array $pValue) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

array
Containing start column and end column, empty array if option unset

Returns

\PHPExcel_Worksheet_PageSetup

Set Columns to repeat at left by start and end

setColumnsToRepeatAtLeftByStartAndEnd(string $pStart, string $pEnd) : \PHPExcel_Worksheet_PageSetup

Parameters

$pStart

string

$pEnd

string

Returns

\PHPExcel_Worksheet_PageSetup

Set first page number

setFirstPageNumber(int $value) : \PHPExcel_Worksheet_HeaderFooter

Parameters

$value

int

Returns

\PHPExcel_Worksheet_HeaderFooter

Set Fit To Height

setFitToHeight(\int? $pValue, boolean $pUpdate) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

\int?

$pUpdate

boolean
Update fitToPage so it applies rather than scaling

Returns

\PHPExcel_Worksheet_PageSetup

Set Fit To Page

setFitToPage(boolean $pValue) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

boolean

Returns

\PHPExcel_Worksheet_PageSetup

Set Fit To Width

setFitToWidth(\int? $pValue, boolean $pUpdate) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

\int?

$pUpdate

boolean
Update fitToPage so it applies rather than scaling

Returns

\PHPExcel_Worksheet_PageSetup

Set center page horizontally

setHorizontalCentered(bool $value) : \PHPExcel_Worksheet_PageSetup

Parameters

$value

bool

Returns

\PHPExcel_Worksheet_PageSetup

Set Orientation

setOrientation(string $pValue) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

string

Returns

\PHPExcel_Worksheet_PageSetup

Set Paper Size

setPaperSize(int $pValue) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

int

Returns

\PHPExcel_Worksheet_PageSetup

Set print area.

setPrintArea(string $value, int $index, string $method) : \PHPExcel_Worksheet_PageSetup

e.g. 'A1:D10' or 'A1:D10,G5:M20'

Parameters

$value

string

$index

int
Identifier for a specific print area range allowing several ranges to be set
                        When the method is "O"verwrite, then a positive integer index will overwrite that indexed
                            entry in the print areas list; a negative index value will identify which entry to
                            overwrite working bacward through the print area to the list, with the last entry as -1.
                            Specifying an index value of 0, will overwrite all existing print ranges.
                        When the method is "I"nsert, then a positive index will insert after that indexed entry in
                            the print areas list, while a negative index will insert before the indexed entry.
                            Specifying an index value of 0, will always append the new print range at the end of the
                            list.
                        Print areas are numbered from 1

$method

string
Determines the method used when setting multiple print areas
                        Default behaviour, or the "O" method, overwrites existing print area
                        The "I" method, inserts the new print area before any specified index, or at the end of the list

Exceptions

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_PageSetup

Set print area

setPrintAreaByColumnAndRow(int $column1, int $row1, int $column2, int $row2, int $index, string $method) : \PHPExcel_Worksheet_PageSetup

Parameters

$column1

int
Column 1

$row1

int
Row 1

$column2

int
Column 2

$row2

int
Row 2

$index

int
Identifier for a specific print area range allowing several ranges to be set
                            When the method is "O"verwrite, then a positive integer index will overwrite that indexed
                                entry in the print areas list; a negative index value will identify which entry to
                                overwrite working bacward through the print area to the list, with the last entry as -1.
                                Specifying an index value of 0, will overwrite all existing print ranges.
                            When the method is "I"nsert, then a positive index will insert after that indexed entry in
                                the print areas list, while a negative index will insert before the indexed entry.
                                Specifying an index value of 0, will always append the new print range at the end of the
                                list.
                            Print areas are numbered from 1

$method

string
Determines the method used when setting multiple print areas
                            Default behaviour, or the "O" method, overwrites existing print area
                            The "I" method, inserts the new print area before any specified index, or at the end of the list

Exceptions

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_PageSetup

Set Rows to repeat at top

setRowsToRepeatAtTop(array $pValue) : \PHPExcel_Worksheet_PageSetup

Parameters

$pValue

array
Containing start column and end column, empty array if option unset

Returns

\PHPExcel_Worksheet_PageSetup

Set Rows to repeat at top by start and end

setRowsToRepeatAtTopByStartAndEnd(int $pStart, int $pEnd) : \PHPExcel_Worksheet_PageSetup

Parameters

$pStart

int

$pEnd

int

Returns

\PHPExcel_Worksheet_PageSetup

Set Scale

setScale(\int? $pValue, boolean $pUpdate) : \PHPExcel_Worksheet_PageSetup

Print scaling. Valid values range from 10 to 400
This setting is overridden when fitToWidth and/or fitToHeight are in use

Parameters

$pValue

\int?

$pUpdate

boolean
Update fitToPage so scaling applies rather than fitToHeight / fitToWidth

Exceptions

\PHPExcel_Exception

Returns

\PHPExcel_Worksheet_PageSetup

Set center page vertically

setVerticalCentered(bool $value) : \PHPExcel_Worksheet_PageSetup

Parameters

$value

bool

Returns

\PHPExcel_Worksheet_PageSetup

 Properties

$_columnsToRepeatAtLeft : array

$_firstPageNumber : int

$_fitToHeight : \int?

$_fitToPage : boolean

$_fitToWidth : \int?

$_horizontalCentered : boolean

$_orientation : string

$_paperSize : int

$_printArea : string

$_rowsToRepeatAtTop : array

$_scale : \int?

Print scaling. Valid values range from 10 to 400
This setting is overridden when fitToWidth and/or fitToHeight are in use

$_verticalCentered : boolean

 Constants

ORIENTATION_DEFAULT

ORIENTATION_DEFAULT

ORIENTATION_LANDSCAPE

ORIENTATION_LANDSCAPE

ORIENTATION_PORTRAIT

ORIENTATION_PORTRAIT

PAPERSIZE_6_3_4_ENVELOPE

PAPERSIZE_6_3_4_ENVELOPE

PAPERSIZE_A2_PAPER

PAPERSIZE_A2_PAPER

PAPERSIZE_A3

PAPERSIZE_A3

PAPERSIZE_A3_EXTRA_PAPER

PAPERSIZE_A3_EXTRA_PAPER

PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_A3_TRANSVERSE_PAPER

PAPERSIZE_A3_TRANSVERSE_PAPER

PAPERSIZE_A4

PAPERSIZE_A4

PAPERSIZE_A4_EXTRA_PAPER

PAPERSIZE_A4_EXTRA_PAPER

PAPERSIZE_A4_PLUS_PAPER

PAPERSIZE_A4_PLUS_PAPER

PAPERSIZE_A4_SMALL

PAPERSIZE_A4_SMALL

PAPERSIZE_A4_TRANSVERSE_PAPER

PAPERSIZE_A4_TRANSVERSE_PAPER

PAPERSIZE_A5

PAPERSIZE_A5

PAPERSIZE_A5_EXTRA_PAPER

PAPERSIZE_A5_EXTRA_PAPER

PAPERSIZE_A5_TRANSVERSE_PAPER

PAPERSIZE_A5_TRANSVERSE_PAPER

PAPERSIZE_B4

PAPERSIZE_B4

PAPERSIZE_B4_ENVELOPE

PAPERSIZE_B4_ENVELOPE

PAPERSIZE_B5

PAPERSIZE_B5

PAPERSIZE_B5_ENVELOPE

PAPERSIZE_B5_ENVELOPE

PAPERSIZE_B6_ENVELOPE

PAPERSIZE_B6_ENVELOPE

PAPERSIZE_C

PAPERSIZE_C

PAPERSIZE_C3_ENVELOPE

PAPERSIZE_C3_ENVELOPE

PAPERSIZE_C4_ENVELOPE

PAPERSIZE_C4_ENVELOPE

PAPERSIZE_C5_ENVELOPE

PAPERSIZE_C5_ENVELOPE

PAPERSIZE_C65_ENVELOPE

PAPERSIZE_C65_ENVELOPE

PAPERSIZE_C6_ENVELOPE

PAPERSIZE_C6_ENVELOPE

PAPERSIZE_D

PAPERSIZE_D

PAPERSIZE_DL_ENVELOPE

PAPERSIZE_DL_ENVELOPE

PAPERSIZE_E

PAPERSIZE_E

PAPERSIZE_EXECUTIVE

PAPERSIZE_EXECUTIVE

PAPERSIZE_FOLIO

PAPERSIZE_FOLIO

PAPERSIZE_GERMAN_LEGAL_FANFOLD

PAPERSIZE_GERMAN_LEGAL_FANFOLD

PAPERSIZE_GERMAN_STANDARD_FANFOLD

PAPERSIZE_GERMAN_STANDARD_FANFOLD

PAPERSIZE_INVITE_ENVELOPE

PAPERSIZE_INVITE_ENVELOPE

PAPERSIZE_ISO_B4

PAPERSIZE_ISO_B4

PAPERSIZE_ISO_B5_EXTRA_PAPER

PAPERSIZE_ISO_B5_EXTRA_PAPER

PAPERSIZE_ITALY_ENVELOPE

PAPERSIZE_ITALY_ENVELOPE

PAPERSIZE_JAPANESE_DOUBLE_POSTCARD

PAPERSIZE_JAPANESE_DOUBLE_POSTCARD

PAPERSIZE_JIS_B5_TRANSVERSE_PAPER

PAPERSIZE_JIS_B5_TRANSVERSE_PAPER

PAPERSIZE_LEDGER

PAPERSIZE_LEDGER

PAPERSIZE_LEGAL

PAPERSIZE_LEGAL

PAPERSIZE_LEGAL_EXTRA_PAPER

PAPERSIZE_LEGAL_EXTRA_PAPER

PAPERSIZE_LETTER

PAPERSIZE_LETTER

PAPERSIZE_LETTER_EXTRA_PAPER

PAPERSIZE_LETTER_EXTRA_PAPER

PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER

PAPERSIZE_LETTER_PLUS_PAPER

PAPERSIZE_LETTER_PLUS_PAPER

PAPERSIZE_LETTER_SMALL

PAPERSIZE_LETTER_SMALL

PAPERSIZE_LETTER_TRANSVERSE_PAPER

PAPERSIZE_LETTER_TRANSVERSE_PAPER

PAPERSIZE_MONARCH_ENVELOPE

PAPERSIZE_MONARCH_ENVELOPE

PAPERSIZE_NO10_ENVELOPE

PAPERSIZE_NO10_ENVELOPE

PAPERSIZE_NO11_ENVELOPE

PAPERSIZE_NO11_ENVELOPE

PAPERSIZE_NO12_ENVELOPE

PAPERSIZE_NO12_ENVELOPE

PAPERSIZE_NO14_ENVELOPE

PAPERSIZE_NO14_ENVELOPE

PAPERSIZE_NO9_ENVELOPE

PAPERSIZE_NO9_ENVELOPE

PAPERSIZE_NOTE

PAPERSIZE_NOTE

PAPERSIZE_QUARTO

PAPERSIZE_QUARTO

PAPERSIZE_STANDARD_1

PAPERSIZE_STANDARD_1

PAPERSIZE_STANDARD_2

PAPERSIZE_STANDARD_2

PAPERSIZE_STANDARD_PAPER_1

PAPERSIZE_STANDARD_PAPER_1

PAPERSIZE_STANDARD_PAPER_2

PAPERSIZE_STANDARD_PAPER_2

PAPERSIZE_STANDARD_PAPER_3

PAPERSIZE_STANDARD_PAPER_3

PAPERSIZE_STATEMENT

PAPERSIZE_STATEMENT

PAPERSIZE_SUPERA_SUPERA_A4_PAPER

PAPERSIZE_SUPERA_SUPERA_A4_PAPER

PAPERSIZE_SUPERB_SUPERB_A3_PAPER

PAPERSIZE_SUPERB_SUPERB_A3_PAPER

PAPERSIZE_TABLOID

PAPERSIZE_TABLOID

PAPERSIZE_TABLOID_EXTRA_PAPER

PAPERSIZE_TABLOID_EXTRA_PAPER

PAPERSIZE_US_STANDARD_FANFOLD

PAPERSIZE_US_STANDARD_FANFOLD

SETPRINTRANGE_INSERT

SETPRINTRANGE_INSERT

SETPRINTRANGE_OVERWRITE

SETPRINTRANGE_OVERWRITE

            Template is built using Twitter Bootstrap 2 and icons provided by Glyphicons.

            Documentation is powered by phpDocumentor 2.0.0a12 and

            generated on 2013-06-02T15:42:52+01:00.

redpajama_set_name: RedPajamaGithub


text: Neo4j POC edited


text:
package org.takes.misc;

import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;

/**
 * Test case for {@link Href}.
 * @since 0.7
 */
final class HrefTest {

    /**
     * Href can build an URI.
     */
    @Test
    void buildsUri() {
        MatcherAssert.assertThat(
            new Href("http://example.com?%D0%B0=8&b=9")
                .with("д", "hello")
                // @checkstyle MultipleStringLiteralsCheck (1 line)
                .without("b")
                .with("b", "test")
                .toString(),
            Matchers.equalTo("http://example.com/?b=test&%D0%B0=8&%D0%B4=hello")
        );
    }

    /**
     * Href can build an URI from empty start.
     */
    @Test
    void buildsUriFromEmpty() {
        MatcherAssert.assertThat(
            new Href().path("boom-4").with("д", "").toString(),
            Matchers.equalTo("/boom-4?%D0%B4")
        );
    }

    /**
     * Href can build an URI without params.
     */
    @Test
    void buildsUriWithoutParams() {
        final String uri = "http://a.example.com";
        MatcherAssert.assertThat(
            new Href(uri).toString(),
            Matchers.equalTo("http://a.example.com/")
        );
    }

    /**
     * Href can add path.
     */
    @Test
    void addsPath() {
        MatcherAssert.assertThat(
            new Href("http://example.com").path("д").path("d").toString(),
            Matchers.equalTo("http://example.com/%D0%B4/d")
        );
        MatcherAssert.assertThat(
            new Href("http://example.com/").path("а").path("f").toString(),
            Matchers.equalTo("http://example.com/%D0%B0/f")
        );
    }

    /**
     * Href can accept encoded query part.
     */
    @Test
    void acceptsEncodedQuery() {
        final String url = "http://localhost/read?file=%5B%5D%28%29.txt";
        MatcherAssert.assertThat(
            new Href(url).toString(),
            Matchers.equalTo(url)
        );
        MatcherAssert.assertThat(
            new Href(url).param("file").iterator().next(),
            Matchers.equalTo("[]().txt")
        );
    }

    /**
     * Href can accept non properly encoded URL.
     */
    @Test
    void acceptsNonProperlyEncodedUrl() {
        MatcherAssert.assertThat(
            // @checkstyle LineLength (2 lines)
            new Href("http://www.netbout.com/[foo/bar]/read?file=%5B%5D%28%29.txt").toString(),
            Matchers.equalTo("http://www.netbout.com/%5Bfoo/bar%5D/read?file=%5B%5D%28%29.txt")
        );
    }

    /**
     * Href can build an URI with fragment.
     */
    @SuppressWarnings("PMD.AvoidDuplicateLiterals")
    @Test
    void buildsUriWithFragmentAndParams() {
        MatcherAssert.assertThat(
            new Href("http://example.com/%D0%B0/?a=1#hello").toString(),
            Matchers.equalTo("http://example.com/%D0%B0/?a=1#hello")
        );
    }

    /**
     * Href can build an URI with fragment and no params.
     */
    @SuppressWarnings("PMD.AvoidDuplicateLiterals")
    @Test
    void buildsUriWithFragmentAndNoParams() {
        MatcherAssert.assertThat(
            new Href("http://example.com/#hello").toString(),
            Matchers.equalTo("http://example.com/#hello")
        );
    }
}


text:
require 'isimud'
require 'thread'

module Isimud
  # Daemon process manager for monitoring event queues.
  # Known EventObserver models and their instances automatically registered upon startup. It is also possible to
  # define ad-hoc queues and handlers by extending
  # In addition, ad-hoc event managing may be set up by extending bind_queues() and making the appropriate subscribe
  # calls directly.
  #
  # =====================================
  # Threads created by the daemon process
  # =====================================
  #
  # Upon startup, EventListener operates using the following threads:
  # * An event processing thread that establishes consumers for message queues
  # * An error counter thread that manages the error counter
  # * A shutdown thread that listens for INT or TERM signals, which will trigger a graceful shutdown.
  # * The main thread is put to sleep until a shutdown is required.
  #
  # ==================
  # Registering Queues
  # ==================
  #
  # All active instances of all known EventObserver classes (which are assumed to be ActiveRecord instances) are
  # automatically loaded by the event processing thread, and their associated queues are bound. Note that queues
  # and associated routing key bindings are established at the time the instance is created or modified.
  # @see EventObserver.find_active_observers
  #
  # Each EventListener process creates an exclusive queue for monitoring the creation, modification, and destruction
  # of EventObserver instances, using ModelWatcher messages.
  #
  # ==============
  # Error Handling
  # ==============
  #
  # Whenever an uncaught exception is rescued from a consumer handling a message, it is logged and the error counter
  # is incremented. The error counter is reset periodically according to the value of +error_interval+.
  # If the total number of errors logged exceeds +error_limit+, the process is terminated immediately.
  # @see BunnyClient#subscribe()
  #
  # There are certain situations that may cause a Bunny exception to occur, such as a loss of network connection.
  # Whenever a Bunny exception is rescued in the event processing thread, the Bunny session is closed (canceling all
  # queue consumers), in addition to the error being counted, all Bunny channels are closed, and queues are
  # reinitialized.
  class EventListener
    include Logging

    attr_reader :error_count, :error_interval, :error_limit, :name, :queues, :events_exchange, :models_exchange, :status

    DEFAULT_ERROR_LIMIT    = 10
    DEFAULT_ERROR_INTERVAL = 3600

    DEFAULT_EVENTS_EXCHANGE = 'events'
    DEFAULT_MODELS_EXCHANGE = 'models'

    STATUS_INITIALIZE = :initialize
    STATUS_RUNNING    = :running
    STATUS_SHUTDOWN   = :shutdown

    # Initialize a new EventListener daemon instance
    # @param [Hash] options daemon options
    # @option options [Integer] :error_limit (10) maximum number of errors that are allowed to occur within error_interval
    #   before the process terminates
    # @option options [Integer] :error_interval (3600) time interval, in seconds, before the error counter is cleared
    # @option options [String] :events_exchange ('events') name of AMQP exchange used for listening to event messages
    # @option options [String] :models_exchange ('models') name of AMQP exchange used for listening to EventObserver
    #   instance create, update, and destroy messages
    # @option options [String] :name ("#{Rails.application.class.parent_name.downcase}-listener") daemon instance name.
    def initialize(options = {})
      default_options = {
          error_limit:     Isimud.listener_error_limit || DEFAULT_ERROR_LIMIT,
          error_interval:  DEFAULT_ERROR_INTERVAL,
          events_exchange: Isimud.events_exchange || DEFAULT_EVENTS_EXCHANGE,
          models_exchange: Isimud.model_watcher_exchange || DEFAULT_MODELS_EXCHANGE,
          name:            "#{Rails.application.class.parent_name.downcase}-listener"
      }
      options.reverse_merge!(default_options)
      @error_count         = 0
      @observers           = Hash.new
      @observed_models     = Set.new
      @error_limit         = options[:error_limit]
      @error_interval      = options[:error_interval]
      @events_exchange     = options[:events_exchange]
      @models_exchange     = options[:models_exchange]
      @name                = options[:name]
      @observer_mutex      = Thread::Mutex.new
      @error_counter_mutex = Thread::Mutex.new
      @status              = STATUS_INITIALIZE
    end

    # Run the daemon process. This creates the event, error counter, and shutdown threads
    def run
      bind_queues and return if test_env?
      start_shutdown_thread
      start_error_counter_thread
      client.on_exception do |e|
        count_error(e)
      end
      client.connect
      start_event_thread

      puts 'EventListener started. Hit Ctrl-C to exit'
      Thread.stop
      puts 'Main thread wakeup - exiting.'
      client.close
    end

    # Hook for setting up custom queues in your application. Override in your subclass.
    def bind_event_queues
    end

    # @private
    def bind_queues
      bind_observer_queues
      bind_event_queues
    end

    # @private
    def has_observer?(observer)
      @observers.has_key?(observer_key_for(observer.class, observer.id))
    end

    # @private
    def find_observer(klass, id)
      @observers[observer_key_for(klass, id)]
    end

    private

    def test_env?
      ['cucumber', 'test'].include?(Rails.env)
    end

    def bind_observer_queues
      Isimud::EventObserver.observed_models.each do |model_class|
        log "EventListener: registering observers for #{model_class}"
        register_observer_class(model_class)
        count = 0
        model_class.find_active_observers.each do |model|
          register_observer(model)
          count += 1
        end
        log "EventListener: registered #{count} observers for #{model_class}"
      end
      client.subscribe(observer_queue) do |payload|
        handle_observer_event(payload)
      end
    end

    def start_shutdown_thread
      shutdown_thread = Thread.new do
        Thread.stop # wait until we get a TERM or INT signal.
        log 'EventListener: shutdown requested.  Shutting down AMQP...', :info
        @status = STATUS_SHUTDOWN
        Thread.main.run
      end
      %w(SIGINT SIGTERM).each { |sig| trap(sig) { shutdown_thread.wakeup } }
    end

    def client
      Isimud.client
    end

    def initializing?
      status == STATUS_INITIALIZE
    end

    def running?
      status == STATUS_RUNNING
    end

    def shutdown?
      status == STATUS_SHUTDOWN
    end

    def start_event_thread
      Thread.new do
        log 'EventListener: starting event_thread', :info
        until shutdown? do
          begin
            bind_queues
            log 'EventListener: event_thread bind_queues finished', :info
            @status = STATUS_RUNNING
            Thread.stop
          rescue => e
            log "EventListener: error in event thread: #{e.message}\n  #{e.backtrace.join("\n  ")}", :warn
            count_error(e)
            @observer_queue = nil
            client.reset
          end
        end
      end
    end

    def count_error(exception)
      @error_counter_mutex.synchronize do
        @error_count += 1
        log "EventListener#count_error count = #{@error_count} limit=#{error_limit}", :warn
        if (@error_count >= error_limit)
          log 'EventListener: too many errors, exiting', :fatal
          @status = STATUS_SHUTDOWN
          Thread.main.run unless test_env?
        end
      end
    end

    def start_error_counter_thread
      log 'EventListener: starting error counter', :info
      @error_count = 0
      Thread.new do
        while true
          sleep(error_interval)
          @error_counter_mutex.synchronize do
            log('EventListener: resetting error counter') if @error_count > 0
            @error_count = 0
          end
        end
      end
    end

    def handle_observer_event(payload)
      event  = JSON.parse(payload).with_indifferent_access
      action = event[:action]
      log "EventListener: received observer model message: #{event.inspect}"
      if %w(update destroy).include?(action)
        unregister_observer(event[:type], event[:id])
      end
      if %w(create update).include?(action)
        observer = event[:type].constantize.find(event[:id])
        register_observer(observer) if observer.enable_listener?
      end
    end

    # Register the observer class watcher
    def register_observer_class(observer_class)
      @observer_mutex.synchronize do
        return if @observed_models.include?(observer_class)
        @observed_models << observer_class
        log "EventListener: registering observer class #{observer_class}"
        observer_queue.bind(models_exchange, routing_key: "#{Isimud.model_watcher_schema}.#{observer_class.base_class.name}.*")
      end
    end

    # Register an observer instance, and start listening for events on its associated queue.
    # Also ensure that we are listening for observer class update events
    def register_observer(observer)
      @observer_mutex.synchronize do
        log "EventListener: registering observer #{observer.class} #{observer.id}"
        @observers[observer_key_for(observer.class, observer.id)] = observer.observe_events(client)
      end
    end

    # Unregister an observer instance, and cancel consumption of messages. Any pre-fetched messages will be returned to the queue.
    def unregister_observer(observer_class, observer_id)
      @observer_mutex.synchronize do
        log "EventListener: un-registering observer #{observer_class} #{observer_id}"
        if (consumer = @observers.delete(observer_key_for(observer_class, observer_id)))
          consumer.cancel
        end
      end
    end

    # Create or return the observer queue which listens for ModelWatcher events
    def observer_queue
      @observer_queue ||= client.create_queue([name, 'listener', Socket.gethostname, Process.pid].join('.'),
                                              models_exchange,
                                              queue_options:     {exclusive: true},
                                              subscribe_options: {manual_ack: true})
    end

    def observer_key_for(type, id)
      [type.to_s, id.to_s].join(':')
    end
  end
end


text:
using System.Threading.Tasks;
using GitReleaseManager.Core.Commands;
using GitReleaseManager.Core.Options;
using NSubstitute;
using NUnit.Framework;
using Serilog;
using Shouldly;

namespace GitReleaseManager.Core.Tests.Commands
{
    [TestFixture]
    public class OpenCommandTests
    {
        private IVcsService _vcsService;
        private ILogger _logger;
        private OpenCommand _command;

        [SetUp]
        public void Setup()
        {
            _vcsService = Substitute.For<IVcsService>();
            _logger = Substitute.For<ILogger>();
            _command = new OpenCommand(_vcsService, _logger);
        }

        [Test]
        public async Task Should_Execute_Command()
        {
            var options = new OpenSubOptions
            {
                RepositoryOwner = "owner",
                RepositoryName = "repository",
                Milestone = "0.1.0",
            };

            _vcsService.OpenMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone)
                .Returns(Task.CompletedTask);

            var result = await _command.Execute(options).ConfigureAwait(false);
            result.ShouldBe(0);

            await _vcsService.Received(1).OpenMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone).ConfigureAwait(false);
            _logger.Received(1).Information(Arg.Any<string>(), options.Milestone);
        }
    }
}


text:
/*! UIkit 3.15.12 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */

(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
    typeof define === 'function' && define.amd ? define('uikitcountdown', ['uikit-util'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkitCountdown = factory(global.UIkit.util));
})(this, (function (uikitUtil) { 'use strict';

    var Class = {
      connected() {
        uikitUtil.addClass(this.$el, this.$options.id);
      }
    };

    const units = ['days', 'hours', 'minutes', 'seconds'];

    var Component = {
      mixins: [Class],

      props: {
        date: String,
        clsWrapper: String
      },

      data: {
        date: '',
        clsWrapper: '.uk-countdown-%unit%'
      },

      connected() {
        this.date = Date.parse(this.$props.date);
        this.start();
      },

      disconnected() {
        this.stop();
      },

      events: [
      {
        name: 'visibilitychange',

        el() {
          return document;
        },

        handler() {
          if (document.hidden) {
            this.stop();
          } else {
            this.start();
          }
        }
      }],

      methods: {
        start() {
          this.stop();
          this.update();
          this.timer = setInterval(this.update, 1000);
        },

        stop() {
          clearInterval(this.timer);
        },

        update() {
          const timespan = getTimeSpan(this.date);

          if (!this.date || timespan.total <= 0) {
            this.stop();

            timespan.days = timespan.hours = timespan.minutes = timespan.seconds = 0;
          }

          for (const unit of units) {
            const el = uikitUtil.$(this.clsWrapper.replace('%unit%', unit), this.$el);

            if (!el) {
              continue;
            }

            let digits = String(Math.trunc(timespan[unit]));

            digits = digits.length < 2 ? "0" + digits : digits;

            if (el.textContent !== digits) {
              digits = digits.split('');

              if (digits.length !== el.children.length) {
                uikitUtil.html(el, digits.map(() => '').join(''));
              }

              digits.forEach((digit, i) => el.children[i].textContent = digit);
            }
          }
        }
      }
    };

    function getTimeSpan(date) {
      const total = date - Date.now();

      return {
        total,
        seconds: total / 1000 % 60,
        minutes: total / 1000 / 60 % 60,
        hours: total / 1000 / 60 / 60 % 24,
        days: total / 1000 / 60 / 60 / 24
      };
    }

    if (typeof window !== 'undefined' && window.UIkit) {
      window.UIkit.component('countdown', Component);
    }

    return Component;

}));


text:
package cn.felord.wepay.ali.sdk.api.response;

import cn.felord.wepay.ali.sdk.api.internal.mapping.ApiField;
import cn.felord.wepay.ali.sdk.api.domain.AlipayCodeRecoResult;

import cn.felord.wepay.ali.sdk.api.AlipayResponse;

/**
 * ALIPAY API: alipay.data.dataservice.code.reco response.
 *
 * @author auto create
 * @version $Id: $Id
 */
public class AlipayDataDataserviceCodeRecoResponse extends AlipayResponse {

	private static final long serialVersionUID = 8191513246658922461L;

	/**
	 * 识别结果
	 */
	@ApiField("result")
	private AlipayCodeRecoResult result;

	/**
	 *
Setter for the field result.

	 *
	 * @param result a {@link cn.felord.wepay.ali.sdk.api.domain.AlipayCodeRecoResult} object.
	 */
	public void setResult(AlipayCodeRecoResult result) {
		this.result = result;
	}
	/**
	 *
Getter for the field result.

	 *
	 * @return a {@link cn.felord.wepay.ali.sdk.api.domain.AlipayCodeRecoResult} object.
	 */
	public AlipayCodeRecoResult getResult( ) {
		return this.result;
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta microbiol. sin. 19(3): 288 (1979)

#### Original name
Uncinuliella simulans var. rosae-rubi R.Y. Zheng & G.Q. Chen

### Remarks
null


text:
import store from '../store';
import types from '../action-types';
import * as app from '../../lib/app';

/**
 * Show a native notification
 */
export const add = (title: string, notificationData: NotificationOptions): void => {
  if (app.config.get('displayNotifications')) {
    const notification = new Notification(title, {
      body: notificationData.body,
      icon: notificationData.icon,
      silent: true,
      tag: 'museeks-notification',
    });

    notification.onclick = () => {
      app.browserWindows.main.show();
      app.browserWindows.main.focus();
    };

    store.dispatch({
      type: types.NOTIFICATION_NEW,
      payload: {
        notification,
      },
    });
  }
};


text:
'use strict';

var Config = require('./../../config');

var getCurrentHash = function () {
    return window.location.hash.substr(1);
};

var changeScene = function (element, forceRedraw) {

    var hash = getCurrentHash();

    if (!hash || !Config.scenes[hash]) hash = Config.defaultScene;

    if (forceRedraw || Config.currentSceneHash !== hash) {

        if (!window.scenes[hash]) {

            Config.currentSceneHash = hash;

            var script = document.createElement('script');
            script.setAttribute('type', 'text/javascript');
            script.setAttribute('src', Config.scenes[hash]);

            script.onload = function () {

                if (Config.currentScene && Config.currentScene.dispose) {
                    Config.currentScene.dispose();
                }
                if (window.scenes[hash]) {
                    Config.currentScene = window.scenes[hash](element, Config.renderer, Config);
                } else {
                    console.log('couldn\'t load scene');
                }

            };

            document.body.appendChild(script);

        } else {

            Config.currentSceneHash = hash;

            if (Config.currentScene && Config.currentScene.dispose) {
                Config.currentScene.dispose();
            }
            Config.currentScene = window.scenes[hash](element, Config.renderer);

        }
    }
};

var canvasService = function (element, isInitialized) {

    if (isInitialized) return;
    if (!window.scenes) window.scenes = {};

    var canvas;

    if (!Config.renderer) {

        canvas = document.createElement('canvas');
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;
        Config.renderer = new THREE.WebGLRenderer({antialias: true, canvas: canvas});
        window.addEventListener("hashchange", function () {
            changeScene(element);
        }, false);

    } else {

        canvas = Config.renderer.domElement;

    }

    Config.renderer.setClearColor(0x111111, 1.0);
    Config.renderer.clear();
    element.appendChild(canvas);

    changeScene(element, true);

    var gl = Config.renderer.getContext();

    function resize() {

        var width = gl.canvas.clientWidth;
        var height = gl.canvas.clientHeight;

        if (gl.canvas.width != width || gl.canvas.height != height) {

            gl.canvas.width = width;
            gl.canvas.height = height;

            if (Config.currentScene.resize) {
                Config.currentScene.resize(width, height);
            }
            gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
        }

    }

    resize();

    function animate() {

        requestAnimationFrame(animate);

        if (Config.currentScene && Config.currentScene.scene) {
            resize();
            Config.currentScene.update();
        }

    }

    animate();

};

module.exports = canvasService;


text:
BoxMesh::BoxMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pDeviceContext)
{
	mDevice = pDevice;
	mDeviceContext = pDeviceContext;

	AglBoxMesh sm;
	vector<AglVertexSTBN> v = vector<AglVertexSTBN>(sm.positions.size());
	for (int i = 0; i < v.size(); i++)
	{
		v[i].position = sm.positions[i];
		v[i].normal = AglVector3(1, 1, 1);//sm.normals[i];
		v[i].texCoord = sm.texCoord[i];
		v[i].tangent = AglVector3(0, 0, 0);
		v[i].binormal = AglVector3(0, 0, 0);
	}

	//Create Vertex Buffer
	D3D11_BUFFER_DESC bd;
	ZeroMemory(&bd, sizeof(bd));
	bd.Usage = D3D11_USAGE_DYNAMIC;
	bd.ByteWidth = sizeof(AglVertexSTBN) * v.size();
	bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
	bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;

	D3D11_SUBRESOURCE_DATA vertexData;
	vertexData.pSysMem = &v[0];
	vertexData.SysMemPitch = 0;
	vertexData.SysMemSlicePitch = 0;

	mDevice->CreateBuffer(&bd, &vertexData, &mVB);

	D3D11_BUFFER_DESC ibd;
	ibd.Usage = D3D11_USAGE_DEFAULT;
	ibd.ByteWidth = sizeof(unsigned int) * sm.indices.size();
	ibd.BindFlags = D3D11_BIND_INDEX_BUFFER;
	ibd.CPUAccessFlags = 0;
	ibd.MiscFlags = 0;
	ibd.StructureByteStride = 0;

	D3D11_SUBRESOURCE_DATA indexData;
	indexData.pSysMem = &sm.indices[0];
	indexData.SysMemPitch = 0;
	indexData.SysMemSlicePitch = 0;

	mDevice->CreateBuffer(&ibd, &indexData, &mIB);

	mIndexCount = sm.indices.size();

	mStride = sizeof(AglVertexSTBN);
}

BoxMesh::~BoxMesh()
{

}
void BoxMesh::Draw(AglMatrix pWorld, AglVector3 pColor)
{
	RasterManager::getInstance()->setWireframeState();
	AglMaterial mat;
	mat.diffuse = pColor * 100;
	mat.specular = AglVector3(0, 0, 0);
	StandardShader* ss = ShaderManager::GetInstance()->GetStandardShader();
	ss->SetBuffer(pWorld, Camera::GetInstance()->GetViewMatrix(), Camera::GetInstance()->GetProjectionMatrix(), 1.0f, mat);
	mDeviceContext->VSSetShader(ss->GetVertexShader(), 0, 0);
	mDeviceContext->PSSetShader(ss->GetPixelShader(), 0, 0);
	mDeviceContext->HSSetShader(ss->GetHullShader(), 0, 0);
	mDeviceContext->DSSetShader(ss->GetDomainShader(), 0, 0);
	mDeviceContext->GSSetShader(NULL, 0, 0);
	mDeviceContext->IASetInputLayout(ss->GetInputLayout());
	UINT stride = mStride;
	UINT offset = 0;
	mDeviceContext->IASetVertexBuffers(0, 1, &mVB, &stride, &offset);
	mDeviceContext->IASetIndexBuffer(mIB, DXGI_FORMAT_R32_UINT, 0);
	mDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST);
	mDeviceContext->DrawIndexed(mIndexCount, 0, 0);
	RasterManager::getInstance()->setStandardState();
}


text:
package java.sql;

/**
 * The mapping in the Java programming language of an SQL REF
 * value, which is a reference to an SQL structured type value in the database.
 *

 * SQL REF values are stored in a table that contains
 * instances of a referenceable SQL structured type, and each REF
 * value is a unique identifier for one instance in that table.
 * An SQL REF value may be used in place of the
 * SQL structured type it references, either as a column value in a
 * table or an attribute value in a structured type.
 *

 * Because an SQL REF value is a logical pointer to an
 * SQL structured type, a Ref object is by default also a logical
 * pointer. Thus, retrieving an SQL REF value as
 * a Ref object does not materialize
 * the attributes of the structured type on the client.
 *

 * A Ref object can be stored in the database using the
 * PreparedStatement.setRef method.
  *

 * All methods on the Ref interface must be fully implemented if the
 * JDBC driver supports the data type.
 *
 * @see Struct
 * @since 1.2
 */
public interface Ref {

    /**
     * Retrieves the fully-qualified SQL name of the SQL structured type that
     * this Ref object references.
     *
     * @return the fully-qualified SQL name of the referenced SQL structured type
     * @exception SQLException if a database access error occurs
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
     * this method
     * @since 1.2
     */
    String getBaseTypeName() throws SQLException;

    /**
     * Retrieves the referenced object and maps it to a Java type
     * using the given type map.
     *
     * @param map a java.util.Map object that contains
     *        the mapping to use (the fully-qualified name of the SQL
     *        structured type being referenced and the class object for
     *        SQLData implementation to which the SQL
     *        structured type will be mapped)
     * @return  a Java Object that is the custom mapping for
     *          the SQL structured type to which this Ref
     *          object refers
     * @exception SQLException if a database access error occurs
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
     * this method
     * @since 1.4
     * @see #setObject
     */
    Object getObject(java.util.Map<String,Class<?>> map) throws SQLException;

    /**
     * Retrieves the SQL structured type instance referenced by
     * this Ref object.  If the connection's type map has an entry
     * for the structured type, the instance will be custom mapped to
     * the Java class indicated in the type map.  Otherwise, the
     * structured type instance will be mapped to a Struct object.
     *
     * @return  a Java Object that is the mapping for
     *          the SQL structured type to which this Ref
     *          object refers
     * @exception SQLException if a database access error occurs
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
     * this method
     * @since 1.4
     * @see #setObject
     */
    Object getObject() throws SQLException;

    /**
     * Sets the structured type value that this Ref
     * object references to the given instance of Object.
     * The driver converts this to an SQL structured type when it
     * sends it to the database.
     *
     * @param value an Object representing the SQL
     *        structured type instance that this
     *        Ref object will reference
     * @exception SQLException if a database access error occurs
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
     * this method
     * @since 1.4
     * @see #getObject()
     * @see #getObject(Map)
     * @see PreparedStatement#setObject(int, Object)
     * @see CallableStatement#setObject(String, Object)
     */
    void setObject(Object value) throws SQLException;

}


text:
package glide.product.handlers;

import java.util.StringTokenizer;
import java.util.Hashtable;

import glide.structs.QueryObject;
import glide.structs.Result;
import glide.util.mimeTypes;

/**
 *
Example Query Handler that contains a hard coded database (a {@link Hashtable}). It accepts a keyword query
 * specified by a {@link QueryObject} and returns {@link Result}s it found in the hard coded DB. Queries are in the format of:

 *
 * KEY=[some key]

 *
 *
Replace [some key] with either DRDF, MDS, or Chris

 *
 * @author USC Software Architecture Research Group and JPL OODT Research Group
 * @version 1.0
 *
 */

public class HardCodedDBHandler implements IQueryHandler
{

    private Hashtable db = null;

    /**
     *
Initialize the hard coded db and return a new handler.

     *
     */
    public HardCodedDBHandler(){
    	db = new Hashtable();

    	db.put("DRDF","100%");
    	db.put("MDS","50%");
    	db.put("Chris","150%");
    }

    /**
     *
Method takes a query object, which specifies a keyword query, and then queries the hard coded
     * database, and returns any results it found.

     *
     * @param q The QueryObject containing the keyword query.
     * @return A {@link QueryObject} with (possibly) populated results.
     */
	public QueryObject query(QueryObject q){
		//System.err.println("HardCodedDBHandler inside");

		String queryStr = q.getQuery();

		if(queryStr.indexOf("=") != -1 && queryStr.indexOf("=") == queryStr.lastIndexOf("=")){
			StringTokenizer st = new StringTokenizer(queryStr,"=");

			String dataElement = (String)st.nextToken();
			String dataValue = (String)st.nextToken();

			//System.err.println("dataElement = "+dataElement);
			//System.err.println("dataValue = "+dataValue);

			if(dataElement.equals("KEY")){
				String dbVal = (String)db.get(dataValue);
				q.getResults().addElement(new Result(mimeTypes.TEXT_PLAIN,"HardCodedDBHandler",dbVal));
			}
			else{
				System.err.println("DATA ELEMENT WAS NOT = KEY");
			}
		}

		return q;

	}

}


text:
    {% load static %}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{% static 'styles.css' %}">
    <link rel="stylesheet" href="https://atomiks.github.io/tippyjs/tippy/tippy.css">
    {% block metablock %}
    {% endblock metablock %}

    {% block injectable %}
    {% endblock %}
    <title>{% block title %}{% endblock %} - Podcasts - KBIA</title>

     MENU

    {% block content %}
    {% endblock %}

Copyright 2017 KBIA and The University of Missouri. Development and Design by Nathan Lawrence.

    ×

        Return to KBIA
        View all Podcasts

{% block scriptyblock %}
{% endblock scriptyblock %}


text:
package org.opencb.opencga.core.config;

import java.util.List;

public class RgaSearchConfiguration extends SearchConfiguration {

    private boolean cache;
    private int cacheSize;

    public RgaSearchConfiguration() {
    }

    public RgaSearchConfiguration(List<String> hosts, String configSet, String mode, String user, String password, String manager,
                                  boolean active, int timeout, int insertBatchSize, boolean cache, int cacheSize) {
        super(hosts, configSet, mode, user, password, manager, active, timeout, insertBatchSize);
        this.cache = cache;
        this.cacheSize = cacheSize;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("RgaSearchConfiguration{");
        sb.append("cache=").append(cache);
        sb.append(", cacheSize=").append(cacheSize);
        sb.append('}');
        return sb.toString();
    }

    public boolean isCache() {
        return cache;
    }

    public RgaSearchConfiguration setCache(boolean cache) {
        this.cache = cache;
        return this;
    }

    public int getCacheSize() {
        return cacheSize;
    }

    public RgaSearchConfiguration setCacheSize(int cacheSize) {
        this.cacheSize = cacheSize;
        return this;
    }
}


text:
namespace tinygltf
{
    class Model;
    class Node;
    struct Primitive;
    struct Mesh;
}

namespace Kioto
{
    namespace Renderer
    {
        class Mesh;
    }

    class ParserGLTF : public MeshParser
    {
    public:
        void Init() override;
        void Shutdown() override;

        Renderer::Mesh* ParseMesh(const std::string& path) override;
        void ParseMesh(Renderer::Mesh* dst) override;

    private:
        bool LoadModel(const std::string& path, tinygltf::Model& model);
        void ParseModelNodes(const tinygltf::Model& model, const tinygltf::Node& node, Renderer::Mesh* dst);
        void ParseGLTFMesh(const tinygltf::Model& model, const tinygltf::Mesh& mesh, Renderer::Mesh* dst);
        void ParseVertices(const tinygltf::Model& model, const tinygltf::Mesh& mesh, const tinygltf::Primitive& primitive, std::vector<Renderer::IntermediateMesh::Vertex>& vertices, uint32& layoutMask);
        void ParseIndices(const tinygltf::Model& model, const tinygltf::Mesh& mesh, const tinygltf::Primitive& primitive, std::vector<uint32>& indices);
    };
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/searchBg" />
    <stroke
        android:width="1px"
        android:color="@color/searchBg" />
    <corners android:radius="3dip" />
</shape>


text:
An implementation of IPv4 Routing Lookup Table and MRT files parsing in python.

This is how it works -
  - MRT RIB file is parsed for type 13 subtypes (1,2) to obtain, peerIndexTable and RIBEntries
  - For each RIB Entry the 'last AS' in ASPath attribute is the 'destination AS' for that prefix
  - This information is used to populate a routing table that implements Radix Lookup.
  - The Routing table can then be searched for finding out destination AS for a given input IP Address (using Longest Prefix Match)
  - Information from asorg info (see below in caida datasets) is used to map an AS number to country.

 1. mrtdump.py - A wrapper class for an MRT file
 2. mrttypes.py - A class implementing individual MRT entries (supported right now are PeerIndexTable and RIBEntry for IPv4)
 3. asinformation.py - A class supporting various 'AS -> Country' mappings and similar
 4. ipv4_route_table.py - A simple routing table implementation that supports longest prefix match. Tested for about 585K entries from a BGP RIB dump.
 5. ip_to_country.py - Python scripts that puts all together to test

Most of the data is available from http://data.caida.org/datasets/
docs/ directory contains referred RFCs, files


text:
using System.Diagnostics.CodeAnalysis;
using Moq;
using NUnit.Framework;
using NVisitor.Api.FuncPayloadPair;

namespace NVisitorTest.Api.FuncPayloadPair
{
    [TestFixture]
    [SuppressMessage("ReSharper", "InconsistentNaming")]
    public class FuncPayloadPairTest
    {
        public interface ICar
        {
        }

        public class Bmw : ICar
        {
        }

        public class Audi : ICar
        {
        }

        public interface IPerson
        {
        }

        public class Driver : IPerson
        {
        }

        public class Mechanic : IPerson
        {
        }

        public class MyDir : FuncPayloadPairDirector<ICar, IPerson, MyDir, int, string>
        {
            public MyDir(params IFuncPayloadPairVisitorClass<ICar, IPerson, MyDir, int, string>[] visitorArray)
                : base(visitorArray)
            {
            }
        }

        public interface IVis<TCar, TPer> : IFuncPayloadPairVisitor<ICar, IPerson, MyDir, TCar, TPer, int, string>
            where TCar : ICar
            where TPer : IPerson
        {
        }

        public interface IVisitor_Car_Person : IVis<ICar, IPerson>
        {
        }

        public interface IVisitor_Car_Driver : IVis<ICar, Driver>
        {
        }

        public interface IVisitor_Car_Mechanic : IVis<ICar, Mechanic>
        {
        }

        public interface IVisitor_Bmw_Person : IVis<Bmw, IPerson>
        {
        }

        public interface IVisitor_Bmw_Driver : IVis<Bmw, Driver>
        {
        }

        public interface IVisitor_Bmw_Mechanic : IVis<Bmw, Mechanic>
        {
        }

        public interface IVisitor_Audi_Person : IVis<Audi, IPerson>
        {
        }

        public interface IVisitor_Audi_Driver : IVis<Audi, Driver>
        {
        }

        public interface IVisitor_Audi_Mechanic : IVis<Audi, Mechanic>
        {
        }

        [Test]
        public void TestFirstNodeTypeHasPrecedence()
        {
            var mockVisitor_Car_Driver = new Mock<IVisitor_Car_Driver>();
            var mockVisitor_Bmw_Person = new Mock<IVisitor_Bmw_Person>();

            var dir = new MyDir(
                mockVisitor_Car_Driver.Object,
                mockVisitor_Bmw_Person.Object);

            var bmw = new Bmw();
            var driver = new Driver();

            dir.Visit(bmw, driver, 1);

            mockVisitor_Car_Driver.Verify(v => v.Visit(dir, It.IsAny<ICar>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Bmw_Person.Verify(v => v.Visit(dir, bmw, driver, 1), Times.Once);
        }

        [Test]
        public void TestSimpleDoubleDispatch()
        {
            var mockVisitor_Bmw_Driver = new Mock<IVisitor_Bmw_Driver>();
            var mockVisitor_Bmw_Mechanic = new Mock<IVisitor_Bmw_Mechanic>();
            var mockVisitor_Audi_Driver = new Mock<IVisitor_Audi_Driver>();
            var mockVisitor_Audi_Mechanic = new Mock<IVisitor_Audi_Mechanic>();

            var dir = new MyDir(
                mockVisitor_Bmw_Driver.Object,
                mockVisitor_Bmw_Mechanic.Object,
                mockVisitor_Audi_Driver.Object,
                mockVisitor_Audi_Mechanic.Object);

            var bmw = new Bmw();
            var audi = new Audi();
            var driver = new Driver();
            var mechanic = new Mechanic();

            dir.Visit(bmw, driver, 1);

            mockVisitor_Bmw_Driver.Verify(v => v.Visit(dir, bmw, driver, 1), Times.Once);
            mockVisitor_Bmw_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Mechanic>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Driver.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Mechanic>(), It.IsAny<int>()),
                                             Times.Never);

            mockVisitor_Bmw_Driver.ResetCalls();
            mockVisitor_Bmw_Mechanic.ResetCalls();
            mockVisitor_Audi_Driver.ResetCalls();
            mockVisitor_Audi_Mechanic.ResetCalls();

            dir.Visit(bmw, mechanic, 2);

            mockVisitor_Bmw_Driver.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Bmw_Mechanic.Verify(v => v.Visit(dir, bmw, mechanic, 2), Times.Once);
            mockVisitor_Audi_Driver.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Mechanic>(), It.IsAny<int>()),
                                             Times.Never);

            mockVisitor_Bmw_Driver.ResetCalls();
            mockVisitor_Bmw_Mechanic.ResetCalls();
            mockVisitor_Audi_Driver.ResetCalls();
            mockVisitor_Audi_Mechanic.ResetCalls();

            dir.Visit(audi, driver, 3);

            mockVisitor_Bmw_Driver.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Bmw_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Mechanic>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Driver.Verify(v => v.Visit(dir, audi, driver, 3), Times.Once);
            mockVisitor_Audi_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Mechanic>(), It.IsAny<int>()),
                                             Times.Never);

            mockVisitor_Bmw_Driver.ResetCalls();
            mockVisitor_Bmw_Mechanic.ResetCalls();
            mockVisitor_Audi_Driver.ResetCalls();
            mockVisitor_Audi_Mechanic.ResetCalls();

            dir.Visit(audi, mechanic, 4);

            mockVisitor_Bmw_Driver.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Bmw_Mechanic.Verify(v => v.Visit(dir, It.IsAny<Bmw>(), It.IsAny<Mechanic>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Driver.Verify(v => v.Visit(dir, It.IsAny<Audi>(), It.IsAny<Driver>(), It.IsAny<int>()), Times.Never);
            mockVisitor_Audi_Mechanic.Verify(v => v.Visit(dir, audi, mechanic, 4), Times.Once);

            mockVisitor_Bmw_Driver.ResetCalls();
            mockVisitor_Bmw_Mechanic.ResetCalls();
            mockVisitor_Audi_Driver.ResetCalls();
            mockVisitor_Audi_Mechanic.ResetCalls();
        }
    }
}