text:
from .extensions import db
import sqlalchemy_utils
import phonenumbers

class PhoneNumberType(sqlalchemy_utils.PhoneNumberType):
    """
    Changes PhoneNumber objects to a string representation on the way in and
    changes them back to PhoneNumber objects on the way out. If RFC3966 is used
    as storing format, no country code is needed for parsing the database
    value to PhoneNumber object.
    """
    STORE_FORMAT = 'rfc3966'
    impl = db.String()

    def __init__(self, country_code='US', *args, **kwargs):
        super(PhoneNumberType, self).__init__(country_code=country_code, length=None,
                                              *args, **kwargs)
        self.impl = db.String()

    def process_bind_param(self, value, dialect):
        if value:
            value = phonenumbers.format_number(value._phone_number,
                                               phonenumbers.PhoneNumberFormat.RFC3966)
        return value

class EmailType(sqlalchemy_utils.EmailType):
    impl = db.String()

    def process_bind_param(self, value, dialect):
        if value is not None:
            return value.strip().lower()
        return value


text:
<refentry id="vidioc-prepare-buf">
  <refmeta>
    <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle>
    &manvol;
  </refmeta>

  <refnamediv>
    <refname>VIDIOC_PREPARE_BUF</refname>
    <refpurpose>Prepare a buffer for I/O</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <funcsynopsis>
      <funcprototype>
	<funcdef>int <function>ioctl</function></funcdef>
	<paramdef>int <parameter>fd</parameter></paramdef>
	<paramdef>int <parameter>request</parameter></paramdef>
	<paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
      </funcprototype>
    </funcsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Arguments</title>

    <variablelist>
      <varlistentry>
	<term><parameter>fd</parameter></term>
	<listitem>
	  <para>&fd;</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter>request</parameter></term>
	<listitem>
	  <para>VIDIOC_PREPARE_BUF</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter>argp</parameter></term>
	<listitem>
	  <para></para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>Applications can optionally call the
<constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer
to the driver before actually enqueuing it, using the
<constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O.
Such preparations may include cache invalidation or cleaning. Performing them
in advance saves time during the actual I/O. In case such cache operations are
not required, the application can use one of
<constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and
<constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective
step.</para>

    <para>The <structname>v4l2_buffer</structname> structure is
specified in <xref linkend="buffer" />.</para>
  </refsect1>

  <refsect1>
    &return-value;

    <variablelist>
      <varlistentry>
	<term><errorcode>EBUSY</errorcode></term>
	<listitem>
	  <para>File I/O is in progress.</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><errorcode>EINVAL</errorcode></term>
	<listitem>
	  <para>The buffer <structfield>type</structfield> is not
supported, or the <structfield>index</structfield> is out of bounds,
or no buffers have been allocated yet, or the
<structfield>userptr</structfield> or
<structfield>length</structfield> are invalid.</para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
</refentry>

redpajama_set_name: RedPajamaGithub


text:
package prefuse.data.column;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;

import prefuse.data.Table;
import prefuse.data.event.ColumnListener;
import prefuse.data.util.Index;
import prefuse.util.DataLib;
import prefuse.util.TypeLib;
import prefuse.util.collections.DefaultLiteralComparator;

/**
 * ColumnMetadata stores computed metadata and statistics for a singe column
 * instance. They are created automatically by Table instances and are
 * retrieved using the {@link prefuse.data.Table#getMetadata(String)} method.
 * @author jeffrey heer
 */
public class ColumnMetadata implements ColumnListener {

	// TODO consider refactor. is non-dynamic mode needed? pass Column reference in?

    private Table   m_table;
    private String  m_field;
    private boolean m_dynamic;
    private boolean m_init;

    private Comparator m_cmp;

    private Object m_default;
    private int m_min;
    private int m_max;
    private int m_median;
    private int m_unique;
    private Double m_mean;
    private Double m_stdev;
    private Double m_sum;
    private Object[] m_ordinalA;
    private Map m_ordinalM;

    // ------------------------------------------------------------------------

    /**
     * Creates a new ColumnMetadata instance.
     * @param table the backing table
     * @param column the name of the column to store metadata for
     */
    public ColumnMetadata(Table table, String column) {
        this(table, column, DefaultLiteralComparator.getInstance(), true);
    }

    /**
     * Creates a new ColumnMetadata instance.
     * @param table the backing table
     * @param column the name of the column to store metadata for
     * @param cmp a Comparator that determines the default sort order for
     * values in the column
     * @param dynamic indicates if this ColumnMetadata should react to
     * changes in the underlying table values. If true, computed values
     * stored in this metadata object will be invalidated when updates to
     * the column data occur.
     */
    public ColumnMetadata(Table table, String column,
            Comparator cmp, boolean dynamic)
    {
        m_table = table;
        m_field = column;
        m_cmp = cmp;
        m_dynamic = dynamic;
    }

    /**
     * Dispose of this metadata, freeing any resources and unregistering any
     * listeners.
     */
    public void dispose() {
        m_table.getColumn(m_field).removeColumnListener(this);
    }

    // ------------------------------------------------------------------------

    private void clearCachedValues() {
        m_min    = -1;
        m_max    = -1;
        m_median = -1;
        m_unique = -1;
        m_mean   = null;
        m_stdev  = null;
        m_sum    = null;
        m_ordinalA = null;
        m_ordinalM = null;
    }

    /**
     * Re-calculates all the metadata and statistics maintained by this object.
     */
    public void calculateValues() {
        clearCachedValues();
        boolean dyn = m_dynamic;
        m_dynamic = true;
        getMinimumRow();
        getMaximumRow();
        getMedianRow();
        getUniqueCount();
        if ( TypeLib.isNumericType(m_table.getColumnType(m_field)) ) {
            getMean();
            getDeviation();
            getSum();
        }
        getOrdinalArray();
        getOrdinalMap();
        m_init = true;
        m_dynamic = dyn;
    }

    private void accessCheck() {
        if ( m_init ) return;

        if ( m_dynamic ) {
          clearCachedValues();
          m_table.getColumn(m_field).addColumnListener(this);
        } else {
          calculateValues();
        }
        m_init = true;
    }

    // ------------------------------------------------------------------------

    /**
     * Returns the comparator used to determine column values' sort order.
     * @return the Comparator
     */
    public Comparator getComparator() {
        return m_cmp;
    }

    /**
     * Sets the comparator used to detemine column values' sort order.
     * @param c the Comparator to use
     */
    public void setComparator(Comparator c) {
        m_cmp = c;
        clearCachedValues();
    }

    /**
     * Get the columns' default value.
     * @return the column's default value
     */
    public Object getDefaultValue() {
        return m_default;
    }

    /**
     * Get the row index of the minimum column value. If there are multiple
     * minima, only one is returned.
     * @return the row index of the minimum column value.
     */
    public int getMinimumRow() {
        accessCheck();
        if ( m_min == -1 && m_dynamic ) {
            Index idx = m_table.getIndex(m_field);
            if ( idx != null ) {
                m_min = idx.minimum();
            } else {
                m_min = DataLib.min(m_table.tuples(), m_field, m_cmp).getRow();
            }
        }
        return m_min;
    }

    /**
     * Get the row index of the maximum column value. If there are multiple
     * maxima, only one is returned.
     * @return the row index of the maximum column value.
     */
    public int getMaximumRow() {
        accessCheck();
        if ( m_max == -1 && m_dynamic ) {
            Index idx = m_table.getIndex(m_field);
            if ( idx != null ) {
                m_max = idx.maximum();
            } else {
                m_max = DataLib.max(m_table.tuples(), m_field, m_cmp).getRow();
            }
        }
        return m_max;
    }

    /**
     * Get the row index of the median column value.
     * @return the row index of the median column value
     */
    public int getMedianRow() {
        accessCheck();
        if ( m_median == -1 && m_dynamic ) {
            Index idx = m_table.getIndex(m_field);
            if ( idx != null ) {
                m_max = idx.median();
            } else {
                m_median = DataLib.median(
                                m_table.tuples(), m_field, m_cmp).getRow();
            }
        }
        return m_median;
    }

    /**
     * Get the number of unique values in the column.
     * @return the number of unique values in the column
     */
    public int getUniqueCount() {
        accessCheck();
        if ( m_unique == -1 && m_dynamic ) {
            Index idx = m_table.getIndex(m_field);
            if ( idx != null ) {
                m_unique = idx.uniqueCount();
            } else {
                m_unique = DataLib.uniqueCount(m_table.tuples(), m_field);
            }
        }
        return m_unique;
    }

    /**
     * Get the mean value of numeric values in the column. If this column
     * does not contain numeric values, this method will result in an
     * exception being thrown.
     * @return the mean of numeric values in the column
     */
    public double getMean() {
        accessCheck();
        if ( m_mean == null && m_dynamic ) {
            m_mean = new Double(DataLib.mean(m_table.tuples(), m_field));
        }
        return m_mean.doubleValue();
    }

    /**
     * Get the standard deviation of numeric values in the column. If this column
     * does not contain numeric values, this method will result in an
     * exception being thrown.
     * @return the standard deviation of numeric values in the column
     */
    public double getDeviation() {
        accessCheck();
        if ( m_stdev == null && m_dynamic ) {
            m_stdev = new Double(
                    DataLib.deviation(m_table.tuples(), m_field, getMean()));
        }
        return m_stdev.doubleValue();
    }

    /**
     * Get the sum of numeric values in the column. If this column
     * does not contain numeric values, this method will result in an
     * exception being thrown.
     * @return the sum of numeric values in the column
     */
    public double getSum() {
        accessCheck();
        if ( m_sum == null && m_dynamic ) {
            m_sum = new Double(DataLib.sum(m_table.tuples(), m_field));
        }
        return m_sum.doubleValue();
    }

    /**
     * Get an array of all unique column values, in sorted order.
     * @return an array of all unique column values, in sorted order.
     */
    public Object[] getOrdinalArray() {
        accessCheck();
        if ( m_ordinalA == null && m_dynamic ) {
            m_ordinalA = DataLib.ordinalArray(m_table.tuples(),m_field,m_cmp);
        }
        return m_ordinalA;
    }

    /**
     * Get a map between all unique column values and their integer index
     * in the sort order of those values. For example, the minimum value
     * maps to 0, the next greater value to 1, etc.
     * @return a map between all unique column values and their integer index
     * in the values' sort order
     */
    public Map getOrdinalMap() {
        accessCheck();
        if ( m_ordinalM == null && m_dynamic ) {
            Object[] a = getOrdinalArray();
            m_ordinalM = new HashMap();
            for ( int i=0; i<a.length; ++i )
                m_ordinalM.put(a[i], new Integer(i));
            //m_ordinalM = DataLib.ordinalMap(m_table.tuples(), m_field, m_cmp);
        }
        return m_ordinalM;
    }

    // ------------------------------------------------------------------------

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, int, int)
     */
    public void columnChanged(Column src, int type, int start, int end) {
        clearCachedValues();
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, boolean)
     */
    public void columnChanged(Column src, int idx, boolean prev) {
        columnChanged(src, 0, idx, idx);
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, double)
     */
    public void columnChanged(Column src, int idx, double prev) {
        columnChanged(src, 0, idx, idx);
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, float)
     */
    public void columnChanged(Column src, int idx, float prev) {
        columnChanged(src, 0, idx, idx);
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, int)
     */
    public void columnChanged(Column src, int idx, int prev) {
        columnChanged(src, 0, idx, idx);
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, long)
     */
    public void columnChanged(Column src, int idx, long prev) {
        columnChanged(src, 0, idx, idx);
    }

    /**
     * @see prefuse.data.event.ColumnListener#columnChanged(prefuse.data.column.Column, int, java.lang.Object)
     */
    public void columnChanged(Column src, int idx, Object prev) {
        columnChanged(src, 0, idx, idx);
    }

} // end of class ColumnMetadata


text:
package trampoline

import "errors"

func Setup(path string, magic, infoAddr, entryPoint uintptr) ([]byte, error) {
	return nil, errors.New("not implemented yet")
}


text:
@charset "utf-8";
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
body{font-family:Verdana, Geneva, sans-serif;background:#eeeeee;font-size:12px;}

/* featured-area */
#featured-area{
  height:337px;
  width:950px;
  margin:40px auto 0 auto;
}
.roundabout-holder {
  list-style:none;
  width:500px;
  height:300px;
  margin:0px auto;
}
.roundabout-moveable-item {
  font-size:12px!important;
  height:300px;width:600px;cursor:pointer;padding:5px;border:1px solid #aaaaaa;-webkit-border-radius:5px;-moz-border-radius:5px;background:#f9f9f9;}
.roundabout-moveable-item img{height:100%;width:100%;background-color:#FFFFFF;margin:0;}
.roundabout-in-focus{cursor:auto;}
.roundabout-in-focus:hover{-webkit-box-shadow:0px 0px 20px #787878;-moz-box-shadow:0px 0px 20px #787878;background:#f9f9f9;}
.roundabout-holder span{display:none;}
.roundabout-in-focus:hover span{display:inline;position:absolute;bottom:5px;right:5px;padding:8px 20px;background:#f9f9f9;color:#3366cc;z-index:999;-webkit-border-top-left-radius:5px;-moz-border-radius-topLeft:5px;border-left:1px solid #aaaaaa;border-top:1px solid #aaaaaa;}
// .roundabout a:active, .roundabout a:focus, .roundabout a:visited{outline:none;text-decoration:none;}
.roundabout li{margin:0}


text: German topic content


text:
using namespace gfx;

namespace gfx_test
{
    struct Vertex
    {
        float position[3];
    };

    struct Instance
    {
        float position[3];
        float color[3];
    };

    static const int kVertexCount = 6;
    static const Vertex kVertexData[kVertexCount] =
    {
        // Triangle 1
        { 0, 0, 0.5 },
        { 1, 0, 0.5 },
        { 0, 1, 0.5 },

        // Triangle 2
        { -1, 0, 0.5 },
        {  0, 0, 0.5 },
        { -1, 1, 0.5 },
    };

    static const int kInstanceCount = 2;
    static const Instance kInstanceData[kInstanceCount] =
    {
        { { 0,  0, 0 }, { 1, 0, 0 } },
        { { 0, -1, 0 }, { 0, 0, 1 } },
    };

    static const int kIndexCount = 6;
    static const uint32_t kIndexData[kIndexCount] =
    {
        0, 2, 5,
        0, 1, 2,
    };

    const int kWidth = 256;
    const int kHeight = 256;
    const Format format = Format::R32G32B32A32_FLOAT;

    ComPtr<IBufferResource> createVertexBuffer(IDevice* device)
    {
        IBufferResource::Desc vertexBufferDesc;
        vertexBufferDesc.type = IResource::Type::Buffer;
        vertexBufferDesc.sizeInBytes = kVertexCount * sizeof(Vertex);
        vertexBufferDesc.defaultState = ResourceState::VertexBuffer;
        vertexBufferDesc.allowedStates = ResourceState::VertexBuffer;
        ComPtr<IBufferResource> vertexBuffer = device->createBufferResource(vertexBufferDesc, &kVertexData[0]);
        SLANG_CHECK_ABORT(vertexBuffer != nullptr);
        return vertexBuffer;
    }

    ComPtr<IBufferResource> createInstanceBuffer(IDevice* device)
    {
        IBufferResource::Desc instanceBufferDesc;
        instanceBufferDesc.type = IResource::Type::Buffer;
        instanceBufferDesc.sizeInBytes = kInstanceCount * sizeof(Instance);
        instanceBufferDesc.defaultState = ResourceState::VertexBuffer;
        instanceBufferDesc.allowedStates = ResourceState::VertexBuffer;
        ComPtr<IBufferResource> instanceBuffer = device->createBufferResource(instanceBufferDesc, &kInstanceData[0]);
        SLANG_CHECK_ABORT(instanceBuffer != nullptr);
        return instanceBuffer;
    }

    ComPtr<IBufferResource> createIndexBuffer(IDevice* device)
    {
        IBufferResource::Desc indexBufferDesc;
        indexBufferDesc.type = IResource::Type::Buffer;
        indexBufferDesc.sizeInBytes = kIndexCount * sizeof(uint32_t);
        indexBufferDesc.defaultState = ResourceState::IndexBuffer;
        indexBufferDesc.allowedStates = ResourceState::IndexBuffer;
        ComPtr<IBufferResource> indexBuffer = device->createBufferResource(indexBufferDesc, &kIndexData[0]);
        SLANG_CHECK_ABORT(indexBuffer != nullptr);
        return indexBuffer;
    }

    ComPtr<ITextureResource> createColorBuffer(IDevice* device)
    {
        gfx::ITextureResource::Desc colorBufferDesc;
        colorBufferDesc.type = IResource::Type::Texture2D;
        colorBufferDesc.size.width = kWidth;
        colorBufferDesc.size.height = kHeight;
        colorBufferDesc.size.depth = 1;
        colorBufferDesc.numMipLevels = 1;
        colorBufferDesc.format = format;
        colorBufferDesc.defaultState = ResourceState::RenderTarget;
        colorBufferDesc.allowedStates = { ResourceState::RenderTarget, ResourceState::CopySource };
        ComPtr<ITextureResource> colorBuffer = device->createTextureResource(colorBufferDesc, nullptr);
        SLANG_CHECK_ABORT(colorBuffer != nullptr);
        return colorBuffer;
    }

    class BaseDrawTest
    {
    public:
        ComPtr<IDevice> device;
        UnitTestContext* context;

        ComPtr<ITransientResourceHeap> transientHeap;
        ComPtr<IPipelineState> pipelineState;
        ComPtr<IRenderPassLayout> renderPass;
        ComPtr<IFramebuffer> framebuffer;

        ComPtr<IBufferResource> vertexBuffer;
        ComPtr<IBufferResource> instanceBuffer;
        ComPtr<ITextureResource> colorBuffer;

        void init(IDevice* device, UnitTestContext* context)
        {
            this->device = device;
            this->context = context;
        }

        void createRequiredResources()
        {
            VertexStreamDesc vertexStreams[] = {
                { sizeof(Vertex), InputSlotClass::PerVertex, 0 },
                { sizeof(Instance), InputSlotClass::PerInstance, 1 },
            };

            InputElementDesc inputElements[] = {
                // Vertex buffer data
                { "POSITIONA", 0, Format::R32G32B32_FLOAT, offsetof(Vertex, position), 0 },

                // Instance buffer data
                { "POSITIONB", 0, Format::R32G32B32_FLOAT, offsetof(Instance, position), 1 },
                { "COLOR",     0, Format::R32G32B32_FLOAT, offsetof(Instance, color),    1 },
            };
            IInputLayout::Desc inputLayoutDesc = {};
            inputLayoutDesc.inputElementCount = SLANG_COUNT_OF(inputElements);
            inputLayoutDesc.inputElements = inputElements;
            inputLayoutDesc.vertexStreamCount = SLANG_COUNT_OF(vertexStreams);
            inputLayoutDesc.vertexStreams = vertexStreams;
            auto inputLayout = device->createInputLayout(inputLayoutDesc);
            SLANG_CHECK_ABORT(inputLayout != nullptr);

            vertexBuffer = createVertexBuffer(device);
            instanceBuffer = createInstanceBuffer(device);
            colorBuffer = createColorBuffer(device);

            ITransientResourceHeap::Desc transientHeapDesc = {};
            transientHeapDesc.constantBufferSize = 4096;
            GFX_CHECK_CALL_ABORT(
                device->createTransientResourceHeap(transientHeapDesc, transientHeap.writeRef()));

            ComPtr<IShaderProgram> shaderProgram;
            slang::ProgramLayout* slangReflection;
            GFX_CHECK_CALL_ABORT(loadGraphicsProgram(device, shaderProgram, "graphics-smoke", "vertexMain", "fragmentMain", slangReflection));

            IFramebufferLayout::TargetLayout targetLayout;
            targetLayout.format = format;
            targetLayout.sampleCount = 1;

            IFramebufferLayout::Desc framebufferLayoutDesc;
            framebufferLayoutDesc.renderTargetCount = 1;
            framebufferLayoutDesc.renderTargets = &targetLayout;
            ComPtr<gfx::IFramebufferLayout> framebufferLayout = device->createFramebufferLayout(framebufferLayoutDesc);
            SLANG_CHECK_ABORT(framebufferLayout != nullptr);

            GraphicsPipelineStateDesc pipelineDesc = {};
            pipelineDesc.program = shaderProgram.get();
            pipelineDesc.inputLayout = inputLayout;
            pipelineDesc.framebufferLayout = framebufferLayout;
            pipelineDesc.depthStencil.depthTestEnable = false;
            pipelineDesc.depthStencil.depthWriteEnable = false;
            GFX_CHECK_CALL_ABORT(
                device->createGraphicsPipelineState(pipelineDesc, pipelineState.writeRef()));

            IRenderPassLayout::Desc renderPassDesc = {};
            renderPassDesc.framebufferLayout = framebufferLayout;
            renderPassDesc.renderTargetCount = 1;
            IRenderPassLayout::TargetAccessDesc renderTargetAccess = {};
            renderTargetAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear;
            renderTargetAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store;
            renderTargetAccess.initialState = ResourceState::RenderTarget;
            renderTargetAccess.finalState = ResourceState::CopySource;
            renderPassDesc.renderTargetAccess = &renderTargetAccess;
            GFX_CHECK_CALL_ABORT(device->createRenderPassLayout(renderPassDesc, renderPass.writeRef()));

            gfx::IResourceView::Desc colorBufferViewDesc;
            memset(&colorBufferViewDesc, 0, sizeof(colorBufferViewDesc));
            colorBufferViewDesc.format = format;
            colorBufferViewDesc.renderTarget.shape = gfx::IResource::Type::Texture2D;
            colorBufferViewDesc.type = gfx::IResourceView::Type::RenderTarget;
            auto rtv = device->createTextureView(colorBuffer, colorBufferViewDesc);

            gfx::IFramebuffer::Desc framebufferDesc;
            framebufferDesc.renderTargetCount = 1;
            framebufferDesc.depthStencilView = nullptr;
            framebufferDesc.renderTargetViews = rtv.readRef();
            framebufferDesc.layout = framebufferLayout;
            GFX_CHECK_CALL_ABORT(device->createFramebuffer(framebufferDesc, framebuffer.writeRef()));
        }

        void checkTestResults(int pixelCount, int channelCount, const int* testXCoords, const int* testYCoords, float* testResults)
        {
            // Read texture values back from four specific pixels located within the triangles
            // and compare against expected values (because testing every single pixel will be too long and tedious
            // and requires maintaining reference images).
            ComPtr<ISlangBlob> resultBlob;
            size_t rowPitch = 0;
            size_t pixelSize = 0;
            GFX_CHECK_CALL_ABORT(device->readTextureResource(
                colorBuffer, ResourceState::CopySource, resultBlob.writeRef(), &rowPitch, &pixelSize));
            auto result = (float*)resultBlob->getBufferPointer();

            int cursor = 0;
            for (int i = 0; i < pixelCount; ++i)
            {
                auto x = testXCoords[i];
                auto y = testYCoords[i];
                auto pixelPtr = result + x * channelCount + y * rowPitch / sizeof(float);
                for (int j = 0; j < channelCount; ++j)
                {
                    testResults[cursor] = pixelPtr[j];
                    cursor++;
                }
            }

            float expectedResult[] = { 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
                                       0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f };
            compareComputeResultFuzzy(testResults, expectedResult, sizeof(expectedResult));
        }
    };

    struct DrawInstancedTest : BaseDrawTest
    {
        void setUpAndDraw()
        {
            createRequiredResources();

            ICommandQueue::Desc queueDesc = { ICommandQueue::QueueType::Graphics };
            auto queue = device->createCommandQueue(queueDesc);
            auto commandBuffer = transientHeap->createCommandBuffer();

            auto encoder = commandBuffer->encodeRenderCommands(renderPass, framebuffer);
            auto rootObject = encoder->bindPipeline(pipelineState);

            gfx::Viewport viewport = {};
            viewport.maxZ = 1.0f;
            viewport.extentX = kWidth;
            viewport.extentY = kHeight;
            encoder->setViewportAndScissor(viewport);

            uint32_t startVertex = 0;
            uint32_t startInstanceLocation = 0;

            encoder->setVertexBuffer(0, vertexBuffer);
            encoder->setVertexBuffer(1, instanceBuffer);
            encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList);

            encoder->drawInstanced(kVertexCount, kInstanceCount, startVertex, startInstanceLocation);
            encoder->endEncoding();
            commandBuffer->close();
            queue->executeCommandBuffer(commandBuffer);
            queue->waitOnHost();
        }

        void run()
        {
            setUpAndDraw();

            const int kPixelCount = 4;
            const int kChannelCount = 4;
            int testXCoords[kPixelCount] = { 64, 192, 64, 192 };
            int testYCoords[kPixelCount] = { 100, 100, 250, 250 };
            float testResults[kPixelCount * kChannelCount];

            checkTestResults(kPixelCount, kChannelCount, testXCoords, testYCoords, testResults);
        }
    };

    struct DrawIndexedInstancedTest : BaseDrawTest
    {
        ComPtr<IBufferResource> indexBuffer;

        void setUpAndDraw()
        {
            createRequiredResources();

            ICommandQueue::Desc queueDesc = { ICommandQueue::QueueType::Graphics };
            auto queue = device->createCommandQueue(queueDesc);
            auto commandBuffer = transientHeap->createCommandBuffer();

            auto encoder = commandBuffer->encodeRenderCommands(renderPass, framebuffer);
            auto rootObject = encoder->bindPipeline(pipelineState);

            gfx::Viewport viewport = {};
            viewport.maxZ = 1.0f;
            viewport.extentX = kWidth;
            viewport.extentY = kHeight;
            encoder->setViewportAndScissor(viewport);

            uint32_t startIndex = 0;
            int32_t startVertex = 0;
            uint32_t startInstanceLocation = 0;

            encoder->setVertexBuffer(0, vertexBuffer);
            encoder->setVertexBuffer(1, instanceBuffer);
            encoder->setIndexBuffer(indexBuffer, Format::R32_UINT);
            encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList);

            encoder->drawIndexedInstanced(kIndexCount, kInstanceCount, startIndex, startVertex, startInstanceLocation);
            encoder->endEncoding();
            commandBuffer->close();
            queue->executeCommandBuffer(commandBuffer);
            queue->waitOnHost();
        }

        void run()
        {
            indexBuffer = createIndexBuffer(device);

            setUpAndDraw();

            const int kPixelCount = 4;
            const int kChannelCount = 4;
            int testXCoords[kPixelCount] = { 64, 192, 64, 192 };
            int testYCoords[kPixelCount] = { 32, 100, 150, 250 };
            float testResults[kPixelCount * kChannelCount];

            checkTestResults(kPixelCount, kChannelCount, testXCoords, testYCoords, testResults);
        }
    };

    struct DrawIndirectTest : BaseDrawTest
    {
        ComPtr<IBufferResource> indirectBuffer;

        struct IndirectArgData
        {
            float padding; // Ensure args and count don't start at 0 offset for testing purposes
            IndirectDrawArguments args;
        };

        ComPtr<IBufferResource> createIndirectBuffer(IDevice* device)
        {
            static const IndirectArgData kIndirectData =
            {
                42.0f, // padding
                {6, 2, 0, 0}, // args
            };

            IBufferResource::Desc indirectBufferDesc;
            indirectBufferDesc.type = IResource::Type::Buffer;
            indirectBufferDesc.sizeInBytes = sizeof(IndirectArgData);
            indirectBufferDesc.defaultState = ResourceState::IndirectArgument;
            indirectBufferDesc.allowedStates = ResourceState::IndirectArgument;
            ComPtr<IBufferResource> indirectBuffer = device->createBufferResource(indirectBufferDesc, &kIndirectData);
            SLANG_CHECK_ABORT(indirectBuffer != nullptr);
            return indirectBuffer;
        }

        void setUpAndDraw()
        {
            createRequiredResources();

            ICommandQueue::Desc queueDesc = { ICommandQueue::QueueType::Graphics };
            auto queue = device->createCommandQueue(queueDesc);
            auto commandBuffer = transientHeap->createCommandBuffer();

            auto encoder = commandBuffer->encodeRenderCommands(renderPass, framebuffer);
            auto rootObject = encoder->bindPipeline(pipelineState);

            gfx::Viewport viewport = {};
            viewport.maxZ = 1.0f;
            viewport.extentX = kWidth;
            viewport.extentY = kHeight;
            encoder->setViewportAndScissor(viewport);

            encoder->setVertexBuffer(0, vertexBuffer);
            encoder->setVertexBuffer(1, instanceBuffer);
            encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList);

            uint32_t maxDrawCount = 1;
            Offset argOffset = offsetof(IndirectArgData, args);

            encoder->drawIndirect(maxDrawCount, indirectBuffer, argOffset);
            encoder->endEncoding();
            commandBuffer->close();
            queue->executeCommandBuffer(commandBuffer);
            queue->waitOnHost();
        }

        void run()
        {
            indirectBuffer = createIndirectBuffer(device);

            setUpAndDraw();

            const int kPixelCount = 4;
            const int kChannelCount = 4;
            int testXCoords[kPixelCount] = { 64, 192, 64, 192 };
            int testYCoords[kPixelCount] = { 100, 100, 250, 250 };
            float testResults[kPixelCount * kChannelCount];

            checkTestResults(kPixelCount, kChannelCount, testXCoords, testYCoords, testResults);
        }
    };

    struct DrawIndexedIndirectTest : BaseDrawTest
    {
        ComPtr<IBufferResource> indexBuffer;
        ComPtr<IBufferResource> indirectBuffer;

        struct IndexedIndirectArgData
        {
            float padding; // Ensure args and count don't start at 0 offset for testing purposes
            IndirectDrawIndexedArguments args;
        };

        ComPtr<IBufferResource> createIndirectBuffer(IDevice* device)
        {
            static const IndexedIndirectArgData kIndexedIndirectData =
            {
                42.0f, // padding
                {6, 2, 0, 0, 0}, // args
            };

            IBufferResource::Desc indirectBufferDesc;
            indirectBufferDesc.type = IResource::Type::Buffer;
            indirectBufferDesc.sizeInBytes = sizeof(IndexedIndirectArgData);
            indirectBufferDesc.defaultState = ResourceState::IndirectArgument;
            indirectBufferDesc.allowedStates = ResourceState::IndirectArgument;
            ComPtr<IBufferResource> indexBuffer = device->createBufferResource(indirectBufferDesc, &kIndexedIndirectData);
            SLANG_CHECK_ABORT(indexBuffer != nullptr);
            return indexBuffer;
        }

        void setUpAndDraw()
        {
            createRequiredResources();

            ICommandQueue::Desc queueDesc = { ICommandQueue::QueueType::Graphics };
            auto queue = device->createCommandQueue(queueDesc);
            auto commandBuffer = transientHeap->createCommandBuffer();

            auto encoder = commandBuffer->encodeRenderCommands(renderPass, framebuffer);
            auto rootObject = encoder->bindPipeline(pipelineState);

            gfx::Viewport viewport = {};
            viewport.maxZ = 1.0f;
            viewport.extentX = kWidth;
            viewport.extentY = kHeight;
            encoder->setViewportAndScissor(viewport);

            encoder->setVertexBuffer(0, vertexBuffer);
            encoder->setVertexBuffer(1, instanceBuffer);
            encoder->setIndexBuffer(indexBuffer, Format::R32_UINT);
            encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList);

            uint32_t maxDrawCount = 1;
            Offset argOffset = offsetof(IndexedIndirectArgData, args);

            encoder->drawIndexedIndirect(maxDrawCount, indirectBuffer, argOffset);
            encoder->endEncoding();
            commandBuffer->close();
            queue->executeCommandBuffer(commandBuffer);
            queue->waitOnHost();
        }

        void run()
        {
            indexBuffer = createIndexBuffer(device);
            indirectBuffer = createIndirectBuffer(device);

            setUpAndDraw();

            const int kPixelCount = 4;
            const int kChannelCount = 4;
            int testXCoords[kPixelCount] = { 64, 192, 64, 192 };
            int testYCoords[kPixelCount] = { 32, 100, 150, 250 };
            float testResults[kPixelCount * kChannelCount];

            checkTestResults(kPixelCount, kChannelCount, testXCoords, testYCoords, testResults);
        }
    };

    template <typename T>
    void drawTestImpl(IDevice* device, UnitTestContext* context)
    {
        T test;
        test.init(device, context);
        test.run();
    }

    SLANG_UNIT_TEST(drawInstancedD3D11)
    {
        runTestImpl(drawTestImpl<DrawInstancedTest>, unitTestContext, Slang::RenderApiFlag::D3D11);
    }

    SLANG_UNIT_TEST(drawIndexedInstancedD3D11)
    {
        runTestImpl(drawTestImpl<DrawIndexedInstancedTest>, unitTestContext, Slang::RenderApiFlag::D3D11);
    }

    SLANG_UNIT_TEST(drawInstancedD3D12)
    {
        runTestImpl(drawTestImpl<DrawInstancedTest>, unitTestContext, Slang::RenderApiFlag::D3D12);
    }

    SLANG_UNIT_TEST(drawIndexedInstancedD3D12)
    {
        runTestImpl(drawTestImpl<DrawIndexedInstancedTest>, unitTestContext, Slang::RenderApiFlag::D3D12);
    }

    SLANG_UNIT_TEST(drawIndirectD3D12)
    {
        runTestImpl(drawTestImpl<DrawIndirectTest>, unitTestContext, Slang::RenderApiFlag::D3D12);
    }

    SLANG_UNIT_TEST(drawIndexedIndirectD3D12)
    {
        runTestImpl(drawTestImpl<DrawIndexedIndirectTest>, unitTestContext, Slang::RenderApiFlag::D3D12);
    }

    SLANG_UNIT_TEST(drawInstancedVulkan)
    {
        runTestImpl(drawTestImpl<DrawInstancedTest>, unitTestContext, Slang::RenderApiFlag::Vulkan);
    }

    SLANG_UNIT_TEST(drawIndexedInstancedVulkan)
    {
        runTestImpl(drawTestImpl<DrawIndexedInstancedTest>, unitTestContext, Slang::RenderApiFlag::Vulkan);
    }

    SLANG_UNIT_TEST(drawIndirectVulkan)
    {
        runTestImpl(drawTestImpl<DrawIndirectTest>, unitTestContext, Slang::RenderApiFlag::Vulkan);
    }

    SLANG_UNIT_TEST(drawIndexedIndirectVulkan)
    {
        runTestImpl(drawTestImpl<DrawIndexedIndirectTest>, unitTestContext, Slang::RenderApiFlag::Vulkan);
    }
}


text:
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var Game = require('./game.js');
var routes = require('./routes/routes.js');
var players = { };
var io = require('socket.io').listen(server);
var socketCount = 0;
var config = require('./config.js');

server.listen(process.env.PORT || config.port || 3000);

app.set('view engine', 'ejs');
app.set('view options', { layout: false });
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(app.router);
app.use('/public', express.static('public'));

function returnGame(gameId, res) { res.json(gameViewModel(gameId)); }

function broadcastGame(gameId) {
  var vm = gameViewModel(gameId);
  for(var player in players[gameId]) {
    players[gameId][player].emit("updateGame", vm);
  }
}

function gameViewModel(gameId) {
  var game = Game.getGame(gameId);
  var viewModel = JSON.parse(JSON.stringify(game));
  delete viewModel.deck;
  return viewModel;
}

var lobbySocket = io
    .of('/lobby')
    .on('connection', function(socket) {
        console.info('lobby socket connect');
        var gameList = Game.list();
        socket.emit('lobbyJoin', gameList);
    });

io.sockets.on('connection', function(socket) {
    socketCount+=1;
    console.info('*****SocketCount: ' + socketCount);
    socket.on('connectToGame', function(data) {
        console.info('server: connectToGame');
        var game = Game.getGame(data.gameId);
        if(game){
          if(!players[data.gameId]) {
              players[data.gameId] = { };
          }
          socket.gameId = data.gameId;
          socket.playerId = data.playerId;
          players[data.gameId][data.playerId] = socket;
          broadcastGame(data.gameId);
        } else {
            socket.emit('gameError', 'Invalid Game ID');
        }
  });

  socket.on('disconnect', function() {
    socketCount-=1;
    if(socket.playerId && socket.gameId){
        console.info('socket disconnect ' + socket.playerId);
        delete players[socket.gameId][socket.playerId];
        Game.departGame(socket.gameId, socket.playerId);
        lobbySocket.emit('gameAdded', Game.list());
    }
  });
});

app.get('/', routes.index);
app.get('/views/*', routes.partials);
app.get('/list', function (req, res) { res.json(Game.list()); });
app.get('/listall', function (req, res) { res.json(Game.listAll()); });
app.post('/add', function (req, res) {
    var newGame = Game.addGame(req.body);
    res.json(newGame);
    lobbySocket.emit('gameAdded', Game.list());
});
app.get('/gamebyid', function (req, res) { res.json(Game.getGame(req.query.id)); });

app.post('/joingame', function (req, res) {
  var game = Game.getGame(req.body.gameId);
  if(!game) {
    res.writeHead(500, { 'Content-Type': 'application/json' });
    res.write(JSON.stringify({ error: "invalid GameId" }));
    res.end();
    return null;
  }

  if(game.players.length >= config.maxPlayers) {
    res.writeHead(500, { 'Content-Type': 'application/json' });
    res.write(JSON.stringify({ error: "too many players" }));
    res.end();
    return null;
  }

  game = Game.joinGame(game, { id: req.body.playerId, name: req.body.playerName });
  returnGame(req.body.gameId, res);
  lobbySocket.emit('gameAdded', Game.list());
});

app.post('/departgame', function(req, res) {
    Game.departGame(req.body.gameId, req.body.playerId);
    lobbySocket.emit('gameAdded', Game.list());
    broadcastGame(req.body.gameId);
});

app.post('/selectcard', function(req, res) {
  Game.selectCard(req.body.gameId, req.body.playerId, req.body.whiteCardId);
  broadcastGame(req.body.gameId);
  returnGame(req.body.gameId, res);
});

app.post('/selectWinner', function(req, res) {
  Game.selectWinner(req.body.gameId, req.body.cardId);
  broadcastGame(req.body.gameId);
  returnGame(req.body.gameId, res);
});

app.post('/readyForNextRound', function(req, res){
  Game.readyForNextRound(req.body.gameId, req.body.playerId);
  broadcastGame(req.body.gameId);
  returnGame(req.body.gameId, res);
});


text:
A selection of example projects to get started with.

## Official examples

You can find some example projects in the [GitHub repository](https://github.com/mui-org/material-ui) under the [`/examples`](https://github.com/mui-org/material-ui/tree/master/examples) folder:

- [Create React App](https://github.com/mui-org/material-ui/tree/master/examples/create-react-app)
- [Gatsby](https://github.com/mui-org/material-ui/tree/master/examples/gatsby)
- [Next.js](https://github.com/mui-org/material-ui/tree/master/examples/nextjs)
- [Preact](https://github.com/mui-org/material-ui/tree/master/examples/preact)
- [CDN](https://github.com/mui-org/material-ui/tree/master/examples/cdn)
- [Plain server-side](https://github.com/mui-org/material-ui/tree/master/examples/ssr)
- E mais

Create React App es un excelente proyecto para aprender React. Echa un vistazo a [las alternativas disponibles](https://github.com/facebook/create-react-app/blob/master/README.md#popular-alternatives) para ver qué proyecto se adapta mejor a tus necesidades.

El código fuente de esta documentación también está incluido en el repositorio. Es un proyecto ligeramente más complejo. Echa un vistazo en la carpeta [`/docs`](https://github.com/mui-org/material-ui/tree/master/docs) para las instrucciones de compilación.

## More advanced example projects

If you want to start with a more complete and real world example, you could take a look at the [free templates](/getting-started/templates/) or [premium themes & templates](https://themes.material-ui.com/) or:

- [React Most Wanted](https://github.com/TarikHuber/react-most-wanted), which includes:

  - Created with Create React App
  - Custom Create React App script to start a new project with just a single CLI command
  - Build for Firebase including Authentication using the official Firebase Web Auth UI
  - Routing with React Router including error handling (404) and lazy loading
  - All PWA features included (SW, Notifications, deffered installation prompt and more)
  - Optimized and scalable performance (all ~100 points on Lighthouse)
- [React + Material-UI + Firebase](https://github.com/Phoqe/react-material-ui-firebase):

  - Bootstrapped with Create React App, the same tooling works out of the box
  - Built on top of Firebase with Authentication, Cloud Firestore, Cloud Functions, Storage, and Performance Monitoring working from the start
  - Robust routing with React Router including error handling
  - Extensive mobile support with full-screen dialogs and react-swipeable-views for tabs
- [Material Sense](https://github.com/alexanmtz/material-sense), which includes:

  - Graph using recharts
  - React Router incluido con un ejemplo de navegación
  - Un contenedor de docker con servidor Nginx para compilado de producción
  - Created with Create React App


text:
Zebra 2.0 and Quagga protocol modules can run on LXC container with some additional configurations.

This document describes an example steps to run Quagga bgpd and ospfd with Zebra 2.0 / OpenConfigd on LXC container.

> Note: Steps are verified using Ubuntu 16.04.03 and Quagga 0.99.24.1

### Topology

```
 +-------+   +-------+
 | host1 |   | host2 |
 +---+---+   +---+---+
     |           |
 +---+-----------+----+
 | lxcbr0 10.0.3.1/24 |
 +--------------------+
```

* host1 IP address
    * eth0 : 10.0.3.61/24
    * lo: 10.10.0.1/32, 10.10.10.1/31
* host2 IP address
    * eth0 : 10.0.3.62/24
    * lo: 10.10.0.2/32, 10.10.10.2/31

### Steps on the host

Install OpenConfigd with CLI and Zebra 2.0.

* https://github.com/coreswitch/openconfigd/blob/master/README.md
* https://github.com/coreswitch/zebra/blob/master/README.md

Install quaggad, an openconfigd configuration gateway to quagga.

* https://github.com/coreswitch/openconfigd/tree/master/quagga

```
$ go get github.com/coreswitch/openconfigd/quagga/quaggad
```

Install Quagga.

```
# apt install quagga
```

Install LXC and create 2 containers.

```
# apt install lxc
# lxc-create -t ubuntu -n host1
# lxc-create -t ubuntu -n host2
```

Container Network will be automatically created.

```
$ ip a
 ... snip ...
3: lxcbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:16:3e:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.1/24 scope global lxcbr0
       valid_lft forever preferred_lft forever
```

Copy `vtysh` under `/usr/local/bin/`
> Note: `/usr/bin` will be initialized after container restart, and symbolic link is not accessbile from container.

```
$ cp /usr/bin/vtysh /usr/local/bin/
```

Create `/var/lib/lxc/<host>/fstab` and mount required directories.

```
> Example for host1
# vi /var/lib/lxc/host1/fstab
/home/<user>/go home/ubuntu/go none bind,create=dir
/usr/lib/quagga usr/lib/quagga none bind,create=dir
/usr/local/bin usr/local/bin none bind,create=dir
/usr/lib usr/lib none bind,create=dir
```

Edit `/var/lib/lxc/<host>/config` to mount and assign static address to the hosts.

```
# /var/lib/lxc/host1/config
lxc.mount= /var/lib/lxc/host1/fstab
lxc.network.ipv4 = 10.0.3.61/24
lxc.network.ipv4.gateway = auto
```

### Steps inside the containers.

Start and log into the contatiner. (default user/password is 'ubuntu/ubuntu')

```
$ sudo lxc-start -n host1 -d
$ ssh ubuntu@10.0.3.61
```

You can also use console to log into container.

```
# lxc-console -n host1
> Type `Ctrl+A Q` to exit from console.
```

Set $PATH for `vtysh` and $GOPATH

```
$ vi ~/.bashrc
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
export PATH=/usr/local/bin:$PATH
$ source ~/.bashrc
```

Change `eth0` to manual. (Since you statically set address in `/var/lib/lxc/host1/config`)
```
# vi /etc/network/interfaces
auto eth0
iface eth0 inet manual
```

Install bash-completion for CLI.

```
# apt install bash-completion
# cp $GOPATH/src/github.com/coreswitch/openconfigd/bash_completion.d/cli /etc/bash_completion.d/
```

Add group and user.

```
# groupadd quaggavty
# groupadd quagga
# useradd -g quagga -s /bin/false quagga
```

Create `/etc/pam.d/quagga`

```
$ sudo vi /etc/pam.d/quagga
# Any user may call vtysh but only those belonging to the group quaggavty can
# actually connect to the socket and use the program.
auth    sufficient      pam_permit.so
```

### Run

Create and run below script to start bgpd, ospfd, openconfigd and ribd in the container.

```
#!/bin/bash

# run with sudo

mkdir /var/run/quagga
chown quagga:quagga /var/run/quagga/

openconfigd -y ${GOPATH}/src/github.com/coreswitch/openconfigd/yang &
ribd &

sleep 10
chmod 777 /var/run/zserv.api

/usr/lib/quagga/bgpd --config_file /dev/null --pid_file /var/run/quagga/bgpd.pid --socket /var/run/zserv.api &
/usr/lib/quagga/ospfd --config_file /dev/null --pid_file /var/run/quagga/ospfd.pid --socket /var/run/zserv.api &

quaggad &
```

### config and show examples

Open new terminal and start CLI. (to avoid logs to show up in terminal running CLI)

```
ubuntu@host1:~$ cli
host1> configure
```

Configure ospf/bgpd on both host.

```
> host1
set interfaces interface lo ipv4 address 10.10.0.1/32
set interfaces interface lo ipv4 address 10.10.10.1/32
set protocols ospf parameters router-id 10.10.0.1
set protocols ospf area 0.0.0.0 network 10.0.3.0/24
set protocols ospf area 0.0.0.0 network 10.10.10.0/24
set protocols bgp 65001 parameters router-id 10.0.3.61
set protocols bgp 65001 neighbor 10.0.3.62 remote-as 65002
set protocols bgp 65001 network 10.10.0.1/32
commit

> host2
set interfaces interface lo ipv4 address 10.10.0.2/32
set interfaces interface lo ipv4 address 10.10.10.2/32
set protocols ospf parameters router-id 10.10.0.2
set protocols ospf area 0.0.0.0 network 10.0.3.0/24
set protocols ospf area 0.0.0.0 network 10.10.10.0/24
set protocols bgp 65002 parameters router-id 10.0.3.62
set protocols bgp 65002 neighbor 10.0.3.61 remote-as 65001
set protocols bgp 65002 network 10.10.0.2/32
commit
```

Show routes.

```
host1>show ip ospf route
============ OSPF network routing table ============
N    10.0.3.0/24           [10] area: 0.0.0.0
                           directly attached to eth0
N    10.10.10.1/32         [10] area: 0.0.0.0
                           directly attached to lo

============ OSPF router routing table =============

============ OSPF external routing table ===========

host1>show ip bgp
BGP table version is 0, local router ID is 10.0.3.61
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.0.1/32     0.0.0.0                  0         32768 i
*> 10.10.0.2/32     10.0.3.62                0             0 65002 i

Total number of prefixes 2
host1>show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
       O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

K        0.0.0.0/0 via 10.0.3.1, eth0
C        10.0.3.0/24 is directly connected eth0
C        10.10.0.1/32 is directly connected lo
B        10.10.0.2/32 [200/0] via 10.0.3.62
C        10.10.10.1/32 is directly connected lo
C        127.0.0.0/8 is directly connected lo
```


text:
package com.turingtechnologies.materialscrollbar;

import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class DragScrollBar extends MaterialScrollBar<DragScrollBar>{

    float handleOffset = 0;
    float indicatorOffset = 0;

    public DragScrollBar(Context context, AttributeSet attributeSet, int defStyle) {
        super(context, attributeSet, defStyle);
    }

    public DragScrollBar(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public DragScrollBar(Context context, RecyclerView recyclerView, boolean lightOnTouch) {
        super(context, recyclerView, lightOnTouch);
    }

    boolean held = false;

    @Override
    void setTouchIntercept() {
        final Handle handle = super.handleThumb;
        OnTouchListener otl = (v, event) -> {
            if(!hiddenByUser) {
                boolean valid = validTouch(event);

                // check valid touch region only on action down => otherwise the check will fail if users scrolls very fast
                if(event.getAction() == MotionEvent.ACTION_DOWN && !valid) {
                    return false;
                }

                if(event.getAction() == MotionEvent.ACTION_DOWN && valid) {
                    held = true;

                    indicatorOffset = event.getY() - handle.getY() - handle.getLayoutParams().height / 2;
                    float offset2 = event.getY() - handle.getY();
                    float balance = handle.getY() / scrollUtils.getAvailableScrollBarHeight();
                    handleOffset = (offset2 * balance) + (indicatorOffset * (1 - balance));
                }
                //On Down
                if((event.getAction() == MotionEvent.ACTION_MOVE || event.getAction() == MotionEvent.ACTION_DOWN) && held) {
                    onDown(event);
                    fadeIn();
                    //On Up
                } else {
                    onUp();

                    held = false;

                    fadeOut();
                }
                performClick();
                return true;
            }
            return false;
        };
        setOnTouchListener(otl);
    }

    @Override
    int getMode() {
        return 0;
    }

    @Override
    float getHideRatio() {
        return .4F;
    }

    @Override
    void onScroll() {}

    @Override
    boolean getHide() {
        return true;
    }

    @Override
    void implementFlavourPreferences() {}

    @Override
    float getHandleOffset() {
        return draggableFromAnywhere ? 0 : handleOffset;
    }

    @Override
    float getIndicatorOffset() {
        return draggableFromAnywhere ? 0 : indicatorOffset;
    }
}


text:
'use strict';

var util = require('util');
var cp = require('child_process');

var Q = require('q');
var _ = require('lodash');
var semver = require('semver');

var exec = function (cmd) {
  return function () {
    var args = Array.prototype.slice.call(arguments, 0);
    args.unshift(cmd);
    var fullCmd = util.format.apply(util, args);
    return Q.nfcall(cp.exec, fullCmd).then(function (out) {
      return out[0].split('\n');
    });
  };
};

var andThen = function (fn, after) {
  return function () {
    return fn.apply(this, arguments).then(after);
  };
};

var oneArg = function (fn) {
  return function (arg) {
    return fn(arg);
  };
};

var oneLine = function (lines) {
  return lines[0].trim();
};

var noArgs = function (fn) {
  return function () {
    return fn();
  };
};

var identity = function (i) { return i; };

// like Q.all, but runs the comands in series
// useful for ensuring env state (like which branch is checked out)
var allInSeries = function (fn) {
  return function (args) {
    var results = [];
    var def;
    while (args.length > 0) {
      (function (arg) {
        if (def) {
          def = def.then(function () {
            return fn(arg);
          });
        } else {
          def = fn(arg);
        }
        def = def.then(function (res) {
          results.push(res);
        });
      }(args.pop()));
    }
    return def.then(function () {
      return results;
    });
  };
};

var compareBranches = function (left, right) {
  console.log('# These commits are in ' + left.name + ' but not in ' + right.name + '\n');
  console.log(_(left.log).
    difference(right.log).
    map(function (line) {
      return left.full[left.log.indexOf(line)]; // lol O(n^2)
    }).
    value().
    join('\n'));
};

var checkout = oneArg(exec('git checkout %s'));

var getCurrentBranch = andThen(noArgs(exec('git rev-parse --abbrev-ref HEAD')), oneLine);
var getTags = noArgs(exec('git tag'));
var getShaOfTag = oneArg(exec('git rev-list %s | head -n 1'));
var getTheLog = oneArg(exec('git log --pretty=oneline %s..HEAD | cat'));

// remember this so we can restore state
var currentBranch;

getCurrentBranch().
then(function (branch) {
  currentBranch = branch;
}).
then(getTags).
then(function (tags) {
  return tags.
    filter(semver.valid).
    map(semver.clean).
    sort(semver.rcompare);
}).
then(function (tags) {
  var major = tags[0].split('.')[0] + '.x';
  return tags.
    filter(function (ver) {
      return semver.satisfies(ver, major);
    });
}).
then(function (tags) {
  return _(tags).
    groupBy(function (tag) {
      return tag.split('.')[1];
    }).
    map(function (group) {
      return _.first(group);
    }).
    map(function (tag) {
      return 'v' + tag;
    }).
    value();
}).
then(function (tags) {
  var master = tags.pop();
  var stable = tags.pop();

  return [
    { name: stable.replace(/\d+$/, 'x'), tag: stable },
    { name: 'master', tag: master}
  ];
}).
then(allInSeries(function (branch) {
  return checkout(branch.name).
    then(function () {
      return getTheLog(branch.tag);
    }).
    then(function (log) {
      return log.
        filter(identity);
    }).
    then(function (log) {
      branch.full = log.map(function (line) {
        line = line.split(' ');
        var sha = line.shift();
        var msg = line.join(' ');
        return sha + (msg.toLowerCase().indexOf('fix') === -1 ? '   ' : ' * ') + msg;
      });
      branch.log = log.map(function (line) {
        return line.substr(41);
      });
      return branch;
    });
})).
then(function (pairs) {
  compareBranches(pairs[0], pairs[1]);
  console.log('\n');
  compareBranches(pairs[1], pairs[0]);
  return pairs;
}).
then(function () {
  return checkout(currentBranch);
}).
catch(function (e) {
  console.log(e.stack);
});


text: Hello PISC web-ide!


text:
package com.dabay6.libraries.androidshared.widget;

import android.R.attr;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Checkable;
import android.widget.LinearLayout;
import com.dabay6.libraries.androidshared.R.drawable;
import com.dabay6.libraries.androidshared.logging.Logger;

/**
 * CheckableLinearLayout
 *
 * @author Remel Pugh
 * @version 1.0
 */
@SuppressWarnings("unused")
public class CheckableLinearLayout extends LinearLayout implements Checkable {
    private static final int[] ACTIVATED_STATE_SET = {attr.state_checked};
    private final static String TAG = Logger.makeTag(CheckableLinearLayout.class);
    private boolean isChecked = false;

    /**
     * @param context
     */
    public CheckableLinearLayout(final Context context) {
        this(context, null);
        initialize();
    }

    /**
     * @param context
     * @param attributes
     */
    public CheckableLinearLayout(final Context context, final AttributeSet attributes) {
        super(context, attributes);
        initialize();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isChecked() {
        return isChecked;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setChecked(final boolean checked) {
        if (isChecked != checked) {
            isChecked = checked;

            setCheckedRecursive(this, checked);
            refreshDrawableState();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean onInterceptTouchEvent(final MotionEvent ev) {
        return onTouchEvent(ev);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean performClick() {
        toggle();

        return super.performClick();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void toggle() {
        setChecked(!isChecked);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void drawableStateChanged() {
        final Drawable drawable = getBackground();

        super.drawableStateChanged();

        if (drawable != null) {
            final int[] drawableState = getDrawableState();

            drawable.setState(drawableState);

            invalidate();
        }
    }

    /**
     * @param extraSpace
     * @return
     */
    @Override
    protected int[] onCreateDrawableState(final int extraSpace) {
        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);

        if (isChecked()) {
            mergeDrawableStates(drawableState, ACTIVATED_STATE_SET);
        }

        return drawableState;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onRestoreInstanceState(final Parcelable state) {
        final SavedState savedState = (SavedState) state;

        super.onRestoreInstanceState(savedState.getSuperState());

        setChecked(savedState.isChecked);

        requestLayout();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected Parcelable onSaveInstanceState() {
        final SavedState state = new SavedState(super.onSaveInstanceState());

        state.isChecked = isChecked();

        return state;
    }

    /**
     *
     */
    private void initialize() {
        if (getBackground() == null) {
            setBackgroundResource(drawable.util__list_item_selector);
        }
    }

    /**
     * @param parent
     * @param checked
     */
    private void setCheckedRecursive(final ViewGroup parent, final boolean checked) {
        for (int i = 0, count = parent.getChildCount(); i < count; i++) {
            final View view = parent.getChildAt(i);

            if (view instanceof Checkable) {
                ((Checkable) view).setChecked(checked);
            }

            if (view instanceof ViewGroup) {
                setCheckedRecursive((ViewGroup) view, checked);
            }
        }
    }

    static class SavedState extends BaseSavedState {
        public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
            @Override
            public SavedState createFromParcel(final Parcel source) {
                return new SavedState(source);
            }

            @Override
            public SavedState[] newArray(final int size) {
                return new SavedState[size];
            }
        };
        boolean isChecked;

        /**
         * Constructor used when reading from a parcel. Reads the state of the superclass.
         */
        public SavedState(final Parcel source) {
            super(source);

            final Boolean value = (Boolean) source.readValue(null);

            if (value == null) {
                isChecked = false;
            }
            else {
                isChecked = value;
            }
        }

        /**
         * Constructor called by derived classes when creating their SavedState objects
         *
         * @param superState The state of the superclass of this view
         */
        public SavedState(final Parcelable superState) {
            super(superState);
        }

        /**
         * {@inheritDoc}
         */
        @SuppressWarnings("NullableProblems")
        @Override
        public void writeToParcel(final Parcel dest, final int flags) {
            super.writeToParcel(dest, flags);

            dest.writeValue(isChecked);
        }
    }
}


text:
package com.yandex.money.api.model.showcase;

import com.google.gson.annotations.SerializedName;
import com.yandex.money.api.methods.ShowcaseSearch;
import com.yandex.money.api.util.Enums;

import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

import static com.yandex.money.api.util.Common.checkNotEmpty;

/**
 * Element of {@link ShowcaseSearch} class.
 */
public final class ShowcaseReference {

    /**
     * Showcase ID.
     */
    @SuppressWarnings("WeakerAccess")
    @SerializedName("id")
    public final long scid;

    /**
     * Title.
     */
    @SerializedName("title")
    public final String title;

    /**
     * Index of an item in list (lower is higher ranking). May be {@code null}
     */
    @SuppressWarnings("WeakerAccess")
    @SerializedName("top")
    public final Integer topIndex;

    /**
     * URL to submit params of the first step if applicable. May be {@code null}.
     */
    @SerializedName("url")
    public final String url;

    /**
     * Showcase parameters.
     */
    @SerializedName("params")
    public final Map<String, String> params;

    /**
     * Showcase format. JSON or unknown one.
     */
    @SerializedName("format")
    public final Format format;

    /**
     * Describing possibility to use bonuses in showcase
     */
    @SerializedName("bonus_points")
    public final BonusOperationType[] bonusPoints;

    ShowcaseReference(Builder builder) {
        scid = builder.scid;
        title = checkNotEmpty(builder.title, "title");
        topIndex = builder.topIndex;
        url = builder.url;
        format = builder.format;
        params = builder.params != null ? Collections.unmodifiableMap(builder.params) : null;
        bonusPoints = builder.bonusPoints;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ShowcaseReference that = (ShowcaseReference) o;

        if (scid != that.scid) return false;
        if (title != null ? !title.equals(that.title) : that.title != null) return false;
        if (topIndex != null ? !topIndex.equals(that.topIndex) : that.topIndex != null) return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        //noinspection SimplifiableIfStatement
        if (params != null ? !params.equals(that.params) : that.params != null) return false;
        if (bonusPoints != null ? !Arrays.equals(bonusPoints, that.bonusPoints)
                : that.bonusPoints != null) return false;
        return format == that.format;
    }

    @Override
    public int hashCode() {
        int result = (int) (scid ^ (scid >>> 32));
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (topIndex != null ? topIndex.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (params != null ? params.hashCode() : 0);
        result = 31 * result + (format != null ? format.hashCode() : 0);
        result = 31 * result + (bonusPoints != null ? Arrays.hashCode(bonusPoints) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "ShowcaseReference{" +
                "scid=" + scid +
                ", title='" + title + '\'' +
                ", topIndex=" + topIndex +
                ", url='" + url + '\'' +
                ", params=" + params +
                ", format=" + format +
                ", bonusPoints=" + bonusPoints +
                '}';
    }

    /**
     * Format.
     */
    public enum Format implements Enums.WithCode<Format> {
        /**
         * JSON.
         */
        @SerializedName("json")
        JSON("json");

        public final String code;

        Format(String code) {
            this.code = code;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public Format[] getValues() {
            return values();
        }
    }

    public enum BonusOperationType {
        @SerializedName("spending")
        SPENDING,
        @SerializedName("earning")
        EARNING
    }

    public final static class Builder {

        long scid;
        String title;
        Integer topIndex;
        Format format;
        String url = null;
        Map<String, String> params;
        BonusOperationType[] bonusPoints;

        public Builder setScid(long scid) {
            this.scid = scid;
            return this;
        }

        public Builder setTitle(String title) {
            this.title = title;
            return this;
        }

        public Builder setTopIndex(Integer topIndex) {
            this.topIndex = topIndex;
            return this;
        }

        public Builder setFormat(Format format) {
            this.format = format;
            return this;
        }

        public Builder setUrl(String url) {
            this.url = url;
            return this;
        }

        public Builder setParams(Map<String, String> params) {
            this.params = params;
            return this;
        }

        public Builder setBonusPoints(BonusOperationType[] bonusPoints) {
            this.bonusPoints = bonusPoints;
            return this;
        }

        public ShowcaseReference create() {
            return new ShowcaseReference(this);
        }
    }
}


text:
module Twitcher
  class StreamerNilObject
    def initialize(name)
      @name = name
    end

    def name
      @name
    end

    def game
      ""
    end
  end
end


text:
import Ember from 'ember';
import A from '@ember/array';
import { computed } from '@ember/object';
import { classify } from '@ember/string';
import { registerAsyncHelper } from '@ember/test';
import MediaService from 'ember-responsive/media';

const {
  getOwner
} = Ember;

MediaService.reopen({
  // Change this if you want a different default breakpoint in tests.
  _defaultBreakpoint: 'full',

  _breakpointArr: computed('breakpoints', function() {
    return Object.keys(this.get('breakpoints')) || A([]);
  }),

  _forceSetBreakpoint(breakpoint) {
    let found = false;

    let props = {};
    this.get('_breakpointArr').forEach(function(bp) {
      let val = bp === breakpoint;
      if (val) {
        found = true;
      }

      props[`is${classify(bp)}`] = val;
    });

    if (found) {
      this.setProperties(props);
    } else {
      throw new Error(
        `You tried to set the breakpoint to ${breakpoint}, which is not in your app/breakpoint.js file.`
      );
    }
  },

  match() {}, // do not set up listeners in test

  init() {
    this._super(...arguments);

    this._forceSetBreakpoint(this.get('_defaultBreakpoint'));
  }
});

export default registerAsyncHelper('setBreakpoint', function(app, breakpoint) {
  // this should use getOwner once that's supported
  let mediaService = app.__deprecatedInstance__.lookup('service:media');
  mediaService._forceSetBreakpoint(breakpoint);
});

export function setBreakpointForIntegrationTest(container, breakpoint) {
  let mediaService = getOwner(container).lookup('service:media');
  mediaService._forceSetBreakpoint(breakpoint);
  container.set('media', mediaService);

  return mediaService;
}


text: export * from 'aurelia-animator-css/aurelia-animator-css';


text:
package io.fabric8.maven.stubs;

import java.io.File;

public class CreateProfileZipMuleProjectStub extends CreateProfileZipProjectStub {

    @Override
    public File getBasedir()
    {
        return new File( super.getBasedir() + "/src/test/resources/unit/profile-zip/mule-test/" );
    }
}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?>
<current_observation version="1.0"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
	<credit>NOAA's National Weather Service</credit>
	<credit_URL>http://weather.gov/</credit_URL>
	<image>
		<url>http://weather.gov/images/xml_logo.gif</url>
		<title>NOAA's National Weather Service</title>
		<link>http://weather.gov</link>
	</image>
	<suggested_pickup>15 minutes after the hour</suggested_pickup>
	<suggested_pickup_period>60</suggested_pickup_period>
	<location>Teterboro, Teterboro Airport, NJ</location>
	<station_id>KTEB</station_id>
	<latitude>40.85889</latitude>
	<longitude>-74.05667</longitude>
	<observation_time>Last Updated on Jan 4 2016, 9:51 pm EST</observation_time>
        <observation_time_rfc822>Mon, 04 Jan 2016 21:51:00 -0500</observation_time_rfc822>
	<weather>Fair</weather>
	<temperature_string>16.0 F (-8.9 C)</temperature_string>
	<temp_f>16.0</temp_f>
	<temp_c>-8.9</temp_c>
	<relative_humidity>47</relative_humidity>
	<wind_string>from the North at 12.7 gusting to 20.7 MPH (11 gusting to 18 KT)</wind_string>
	<wind_dir>North</wind_dir>
	<wind_degrees>340</wind_degrees>
	<wind_mph>12.7</wind_mph>
	<wind_gust_mph>20.7</wind_gust_mph>
	<wind_kt>11</wind_kt>
	<wind_gust_kt>18</wind_gust_kt>
	<pressure_string>1027.1 mb</pressure_string>
	<pressure_mb>1027.1</pressure_mb>
	<pressure_in>30.33</pressure_in>
	<dewpoint_string>-0.9 F (-18.3 C)</dewpoint_string>
	<dewpoint_f>-0.9</dewpoint_f>
	<dewpoint_c>-18.3</dewpoint_c>
	<windchill_string>2 F (-17 C)</windchill_string>
      	<windchill_f>2</windchill_f>
      	<windchill_c>-17</windchill_c>
	<visibility_mi>10.00</visibility_mi>
 	<icon_url_base>http://forecast.weather.gov/images/wtf/small/</icon_url_base>
	<two_day_history_url>http://www.weather.gov/data/obhistory/KTEB.html</two_day_history_url>
	<icon_url_name>nskc.png</icon_url_name>
	<ob_url>http://www.weather.gov/data/METAR/KTEB.1.txt</ob_url>
	<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
	<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
	<privacy_policy_url>http://weather.gov/notice.html</privacy_policy_url>
</current_observation>


text:
<?php

namespace Zend\Cache\Exception;

class LogicException extends \LogicException implements ExceptionInterface {
}


text:
      real function hdepth(t2,x)
c
c     + + + PURPOSE + + +
c     Finds depth H on an overland flow element by solving the
c     partial differential equation:
c
c       h1+alpha*m*h**(m-1)*h2=s ,t and x non-negative    (1)
c
c    where:
c
c      h1    =  partial of h with respect to t,
c      h2    =  partial of h with respect to x,
c      alpha =  chezy depth-discharge coefficient,
c      m     =  chezy depth-discharge exponent,
c      s     =  step function with ns initial non-zero steps that
c               is zero after the last step, and h is zero when
c               either t or x is zero.
c
c XXX -- I cannot determine the structure of the equation being
c        discussed, from these comments. -- CRM 6/3/91.
c    Let phi(t) be psi(t,0), where psi(t,u) is defined to be the
c    integral from u to t with respect to l of the m-1th power of
c    ***the integral of s from time u to l.***
c XXX -- With respect to what variable?  S? TIME? -- CRM 6/3/91.
c    Psi(t,u) strictly decreases from
c    phi(t) to 0 for fixed t and for u between 0 and ***am1n(t,tstar)***
c XXX -- What does this mean? -- CRM 6/3/91.
c    (s>0 before tstar,s=0 after);  let psiinv(t,-) be the inverse
c    of psi(t,-). Then the general solution to (1) is given by:
c
c    for x >= x1, h(t,x)=integral of s from 0 to t             (2)
c    for x <= x1, h(t,x)=integral of s from psiinv(t,x2) to t  (3)
c
c    where x1 = alpha*m*phi(t) and x2 = x/(alpha*m).
c
c    Subroutine phi(-) computes phi, subroutine psiinv(t,-)
c    computes the inverse of psi(t,-), and subroutine sint(t)
c    computes the integral of s from 0 to t.
c
c
c     Called from HDRIVE
c     Author(s): Shirley, Stone
c     Reference in User Guide:
c
c     Changes:
c          1) SAVE, which saves all applicable local variables,
c             deleted.
c          2) Common block PASS never used.  It was de-referenced.
c          3) No parameters were used.  Their include files were
c             dereferenced.
c
c     Version: This module recoded from WEPP version 91.10.
c     Date recoded: 04/24/91.
c     Recoded by: Charles R. Meyer.
c
c     + + + KEYWORDS + + +
c
c     + + + ARGUMENT DECLARATIONS + + +
      real t2, x
c
c     + + + ARGUMENT DEFINITIONS + + +
c     t2     - current time
c     x      - length of equivalent plane
c
c     + + + COMMON BLOCKS + + +
c
      include 'cconsts.inc'
c       read: a1
c
c     + + + LOCAL VARIABLES + + +
      real xx
c
c     + + + LOCAL DEFINITIONS + + +
c     xx     - X/A1
c
c     + + + FUNCTION DECLARATIONS + + +
c     real phi, sint, psiinv
      real phi, psiinv
      double precision sint
c
c     + + + END SPECIFICATIONS + + +
c
      xx = x / a1
c
      if (xx.lt.phi(t2)) then
        hdepth = sint(t2) - sint(psiinv(t2,xx))
      else
        hdepth = sint(t2)
      end if
c
c     Following line inserted 12/11/92 to prevent hdepth from becoming
c     a negative number for test data set 45     dcf
c
      if (hdepth.lt.0.0) hdepth = 0.0
c
      return
      end


text:
<?php

	// application entry point
	header( "Location: /shortener.php" );


text:
module Azure::Hdinsight::Mgmt::V2018_06_01_preview
  module Models
    #
    # The execution details of a script action.
    #
    class RuntimeScriptActionDetail < RuntimeScriptAction

      include MsRestAzure

      # @return [Integer] The execution id of the script action.
      attr_accessor :script_execution_id

      # @return [String] The start time of script action execution.
      attr_accessor :start_time

      # @return [String] The end time of script action execution.
      attr_accessor :end_time

      # @return [String] The current execution status of the script action.
      attr_accessor :status

      # @return [String] The reason why the script action was executed.
      attr_accessor :operation

      # @return [Array<ScriptActionExecutionSummary>] The summary of script
      # action execution result.
      attr_accessor :execution_summary

      # @return [String] The script action execution debug information.
      attr_accessor :debug_information

      #
      # Mapper for RuntimeScriptActionDetail class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'RuntimeScriptActionDetail',
          type: {
            name: 'Composite',
            class_name: 'RuntimeScriptActionDetail',
            model_properties: {
              name: {
                client_side_validation: true,
                required: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              uri: {
                client_side_validation: true,
                required: true,
                serialized_name: 'uri',
                type: {
                  name: 'String'
                }
              },
              parameters: {
                client_side_validation: true,
                required: false,
                serialized_name: 'parameters',
                type: {
                  name: 'String'
                }
              },
              roles: {
                client_side_validation: true,
                required: true,
                serialized_name: 'roles',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              application_name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'applicationName',
                type: {
                  name: 'String'
                }
              },
              script_execution_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'scriptExecutionId',
                type: {
                  name: 'Number'
                }
              },
              start_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'startTime',
                type: {
                  name: 'String'
                }
              },
              end_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'endTime',
                type: {
                  name: 'String'
                }
              },
              status: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'status',
                type: {
                  name: 'String'
                }
              },
              operation: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'operation',
                type: {
                  name: 'String'
                }
              },
              execution_summary: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'executionSummary',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ScriptActionExecutionSummaryElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ScriptActionExecutionSummary'
                      }
                  }
                }
              },
              debug_information: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'debugInformation',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package network::nortel::standard::snmp::plugin;

use strict;
use warnings;
use base qw(centreon::plugins::script_snmp);

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $self->{version} = '1.0';
    %{$self->{modes}} = (
        'cpu'              => 'network::nortel::standard::snmp::mode::cpu',
        'hardware'         => 'network::nortel::standard::snmp::mode::hardware',
        'interfaces'       => 'snmp_standard::mode::interfaces',
        'list-interfaces'  => 'snmp_standard::mode::listinterfaces',
        'memory'           => 'network::nortel::standard::snmp::mode::memory',
    );

    return $self;
}

1;

__END__

=head1 PLUGIN DESCRIPTION

Check Nortel switch/routers in SNMP.
Can be used for avaya equipments also.

=cut


text:
"""Tests for the template string generator."""

import unittest

from yaldevtools import template_string

from tests import test_lib

class TemplateStringGeneratorTest(test_lib.BaseTestCase):
  """Template string generator tests."""

  def testInitialize(self):
    """Tests the __init__ function."""
    generator = template_string.TemplateStringGenerator()
    self.assertIsNotNone(generator)

if __name__ == '__main__':
  unittest.main()


text:
"An expression that is not a value can always be partitioned into two parts: a
_redex_, which is the part that changed in a single-step simplification, and the
_continuation_, which is the surrounding expression context."


text:
import {{camelCase componentName}}Data from './{{camelCase componentName}}Chart.fixtures';
import {{camelCase componentName}} from './{{camelCase componentName}}Chart';

describe('{{titleCase componentName}} Chart', () => {
    let anchor;

    beforeEach(() => {
        anchor = document.createElement('div');
    });

    describe('create', () => {

        describe('when incorrect arguments are used', () => {

            describe('when the DOM element is not passed', () => {
                it('should throw an error', () => {
                    expect(() => {
                      {{camelCase componentName}}.create(
                            undefined,
                            {{camelCase componentName}}Data.firstDataMethod(),
                            {}
                        );
                    }).toThrowError('A root container is required');
                });
            });

            describe('when a non-supported method is passed', () => {
                it('should throw an error', () => {
                    expect(() => {
                        {{camelCase componentName}}.create(
                            anchor,
                            {{camelCase componentName}}Data.firstDataMethod(),
                            { test: 'test' }
                        );
                    }).toThrowError('Method not supported by Britechart: test');
                });
            });

            describe('when wrong event handlers are passed', () => {
                it('should throw ane error', () => {
                    const callback = jest.fn();

                    expect(() => {
                        {{camelCase componentName}}.create(
                            anchor,
                            {{camelCase componentName}}Data.firstDataMethod(),
                            { customFakeEvent: callback }
                        );
                    }).toThrowError('Method not supported by Britechart: customFakeEvent');
                });
            });
        });

        describe('when proper arguments are passed', () => {

            it('should set data as a DOM property', () => {
                const expected = {{camelCase componentName}}Data.firstDataMethod().length;

                {{camelCase componentName}}.create(anchor, {{camelCase componentName}}Data.firstDataMethod());

                const actual = anchor.__data__.length;

                expect(actual).toEqual(expected);
            });

            it('should set the width', () => {
                const expected = 500;

                const chart = {{camelCase componentName}}.create(
                    anchor,
                    {{camelCase componentName}}Data.firstDataMethod(),
                    { width: expected }
                );

                const actual = chart.width();

                expect(actual).toEqual(expected);
            });

            it('should set the height', () => {
                const expected = 600;

                const chart = {{camelCase componentName}}.create(
                    anchor,
                    {{camelCase componentName}}Data.firstDataMethod(),
                    { height: expected }
                );

                const actual = chart.height();

                expect(actual).toEqual(expected);
            });

            it('should set the margin', () => {
                const expected = {
                    top: 0,
                    bottom: 1,
                    left: 2,
                    right: 3,
                };

                const chart = {{camelCase componentName}}.create(
                    anchor,
                    {{camelCase componentName}}Data.firstDataMethod(),
                    { margin: expected }
                );

                const actual = chart.margin();

                expect(actual).toEqual(expected);
            });

            /**
             * The grid is not supported by every chart, and this test should only be included if necessary
             */
            it('should set the grid', () => {
                const expected = 'vertical';

                const chart = {{camelCase componentName}}.create(
                    anchor,
                    {{camelCase componentName}}Data.firstDataMethod(),
                    { grid: expected }
                );

                const actual = chart.grid();

                expect(actual).toEqual(expected);
            });

            describe('when event handlers are passed', () => {

                it('should set customMouseOver callback', () => {
                    const expected = jest.fn();

                    const chart = {{camelCase componentName}}.create(
                        anchor,
                        {{camelCase componentName}}Data.firstDataMethod(),
                        { customMouseOver: expected }
                    );

                    const actual = chart.on('customMouseOver');

                    expect(actual).toEqual(expected);
                });

                it('should set customMouseMove callback', () => {
                    const expected = jest.fn();

                    const chart = {{camelCase componentName}}.create(
                        anchor,
                        {{camelCase componentName}}Data.firstDataMethod(),
                        { customMouseMove: expected }
                    );

                    const actual = chart.on('customMouseMove');

                    expect(actual).toEqual(expected);
                });

                it('should set customMouseOut callback', () => {
                    const expected = jest.fn();

                    const chart = {{camelCase componentName}}.create(
                        anchor,
                        {{camelCase componentName}}Data.firstDataMethod(),
                        { customMouseOut: expected }
                    );

                    const actual = chart.on('customMouseOut');

                    expect(actual).toEqual(expected);
                });
            });
        });
    });

    describe('update', () => {

        describe('when updating data', () => {

            describe('when new data is passed', () => {
                it('should update the data in the container', () => {
                    const firstDataSet = {{camelCase componentName}}Data.firstDataMethod();
                    const secondDataSet = {{camelCase componentName}}Data.secondDataMethod();
                    let chart = {{camelCase componentName}}.create(anchor, firstDataSet, {});

                    {{camelCase componentName}}.update(anchor, secondDataSet, {}, chart);

                    const expected = secondDataSet.length;
                    const actual = anchor.__data__.length;

                    expect(actual).toEqual(expected);
                });
            });

            describe('when new data is not passed', () => {
                it('should keep the data in the container', () => {
                    const dataSet = {{camelCase componentName}}Data.firstDataMethod();
                    let chart = {{camelCase componentName}}.create(anchor, dataSet, {});

                    {{camelCase componentName}}.update(anchor, [], {}, chart);

                    const expected = dataSet.length;
                    const actual = anchor.__data__.length;

                    expect(actual).toEqual(expected);
                });
            });
        });

        describe('when updating configuration', () => {

            describe('when new configuration is passed', () => {
                it('should update the configuration in the chart', () => {
                    const expected = 500;
                    const firstWidth = 200;
                    const chart = {{camelCase componentName}}.create(
                        anchor,
                        {{camelCase componentName}}Data.firstDataMethod(),
                        { width: firstWidth }
                    );

                    {{camelCase componentName}}.update(anchor, [], { width: expected }, chart);

                    const actual = chart.width();

                    expect(actual).toEqual(expected);
                });
            });
        });
    });
});


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.microsoft.azure.samples</groupId>
  <artifactId>azure-monitor-eph-reader</artifactId>
  <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <packaging>jar</packaging>

  <name>azure-monitor-eph-reader</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

      <dependency>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-eventhubs</artifactId>
          <version>0.14.4</version>
      </dependency>
      <dependency>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-eventhubs-eph</artifactId>
          <version>0.14.4</version>
      </dependency>

      <dependency>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
          <version>19.0</version>
      </dependency>

      <dependency>
          <groupId>io.dropwizard.metrics</groupId>
          <artifactId>metrics-core</artifactId>
          <version>3.1.0</version>
      </dependency>

      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-api</artifactId>
          <version>2.9.0</version>
      </dependency>

      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-core</artifactId>
          <version>2.9.0</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.9.1</version>
      </dependency>

      <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
          <version>2.9.1</version>
      </dependency>

      <!-- https://mvnrepository.com/artifact/com.lmax/disruptor -->
      <dependency>
          <groupId>com.lmax</groupId>
          <artifactId>disruptor</artifactId>
          <version>3.3.6</version>
      </dependency>

      <dependency>
          <groupId>com.izettle</groupId>
          <artifactId>dropwizard-metrics-influxdb</artifactId>
          <version>1.1.9</version>
      </dependency>

  </dependencies>
</project>


text:
namespace Google.Cloud.Video.Stitcher.V1.Snippets
{
    // [START videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_sync]
    using Google.Cloud.Video.Stitcher.V1;

    public sealed partial class GeneratedVideoStitcherServiceClientSnippets
    {
        /// <summary>Snippet for GetVodStitchDetail</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void GetVodStitchDetailRequestObject()
        {
            // Create client
            VideoStitcherServiceClient videoStitcherServiceClient = VideoStitcherServiceClient.Create();
            // Initialize request argument(s)
            GetVodStitchDetailRequest request = new GetVodStitchDetailRequest
            {
                VodStitchDetailName = VodStitchDetailName.FromProjectLocationVodSessionVodStitchDetail("[PROJECT]", "[LOCATION]", "[VOD_SESSION]", "[VOD_STITCH_DETAIL]"),
            };
            // Make the request
            VodStitchDetail response = videoStitcherServiceClient.GetVodStitchDetail(request);
        }
    }
    // [END videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_sync]
}


text:
<script type="text/javascript" src="resources/testcode.js"></script>
<!-- %23 below is a #, which is escaped so the anchor applies to the subframe instead of the frameset. -->
<script>
    if(window.testRunner) {
        testRunner.dumpChildFrameScrollPositions();
        testRunner.dumpAsText();
    }
    runBasicTest("resources/frameset.pl?frameURL=success200.html", "relativeanchor");
</script>
This page just kicks off a test, and should not appear in the expected test output.
The files in the resources dir have comments about the tests.


text:
import Authenticator from 'wherehows-web/authenticators/custom-ldap';
import { module, test } from 'qunit';
import sinon from 'sinon';
import { ApiStatus } from 'wherehows-web/utils/api';

module('Unit | Utility | authenticators/custom ldap', function(hooks) {
  hooks.beforeEach(function() {
    this.sinonServer = sinon.createFakeServer();
  });

  hooks.afterEach(function() {
    this.sinonServer.restore();
  });

  test('Authenticate methods work as expected', async function(assert) {
    assert.expect(2);

    const authenticator = new Authenticator();
    const data = {
      username: 'wherehows',
      uuid: 'wherehows-uuid'
    };

    let response;

    this.sinonServer.respondWith('POST', '/authenticate', [
      200,
      { 'Content-Type': 'application/json' },
      JSON.stringify({ status: ApiStatus.OK, data })
    ]);

    response = authenticator.authenticate('username', 'password');
    this.sinonServer.respond();

    assert.ok(typeof response.then === 'function', 'returns a Promise object or thennable');
    assert.equal((await response).username, data.username, 'authenticate correctly resolves with api response');
  });

  test('Restore method works as expected', function(assert) {
    const authenticator = new Authenticator();
    const response = authenticator.restore();

    assert.ok(typeof response.then === 'function', 'returns a Promise object or thennable');
  });
});


text:
package com.sumologic.shellbase

import java.io._

import org.apache.commons.io.IOUtils

import scala.io.Source

class ScriptRenderer(file: File, args: Array[String]) {

  def getLines: Seq[String] = {
    val prefix = file.getName + ("_" * Math.max(0, 3 - file.getName.length))
    val output = File.createTempFile(prefix, "script")
    output.deleteOnExit()
    val reader = new FileReader(file)
    val writer = new FileWriter(output)
    try {
      VelocityRenderer.render(argsToMap, reader, writer)
    } finally {
      IOUtils.closeQuietly(reader)
      IOUtils.closeQuietly(writer)
    }
    Source.fromFile(output).getLines().toSeq
  }

  private[shellbase] def argsToMap: Map[String, String] = {
    args.map(s => {
      require(s.contains("="), s"Argument $s does not contain = sign!")
      val splitted = s.split("=")
      require(splitted.size == 2, s"Argument $s contains more than on =!")
      splitted(0) -> splitted(1)
    }).toMap
  }

}