text:
import pytest

from selenium.common.exceptions import WebDriverException

def testShouldReturnNullWhenGettingTheValueOfAnAttributeThatIsNotListed(driver, pages):
    pages.load("simpleTest.html")
    head = driver.find_element_by_xpath("/html")
    attribute = head.get_attribute("cheese")
    assert attribute is None

def testShouldReturnNullWhenGettingSrcAttributeOfInvalidImgTag(driver, pages):
    pages.load("simpleTest.html")
    img = driver.find_element_by_id("invalidImgTag")
    img_attr = img.get_attribute("src")
    assert img_attr is None

def testShouldReturnAnAbsoluteUrlWhenGettingSrcAttributeOfAValidImgTag(driver, pages):
    pages.load("simpleTest.html")
    img = driver.find_element_by_id("validImgTag")
    img_attr = img.get_attribute("src")
    assert "icon.gif" in img_attr

def testShouldReturnAnAbsoluteUrlWhenGettingHrefAttributeOfAValidAnchorTag(driver, pages):
    pages.load("simpleTest.html")
    img = driver.find_element_by_id("validAnchorTag")
    img_attr = img.get_attribute("href")
    assert "icon.gif" in img_attr

def testShouldReturnEmptyAttributeValuesWhenPresentAndTheValueIsActuallyEmpty(driver, pages):
    pages.load("simpleTest.html")
    body = driver.find_element_by_xpath("//body")
    assert "" == body.get_attribute("style")

def testShouldReturnTheValueOfTheDisabledAttributeAsFalseIfNotSet(driver, pages):
    pages.load("formPage.html")
    inputElement = driver.find_element_by_xpath("//input[@id='working']")
    assert inputElement.get_attribute("disabled") is None
    assert inputElement.is_enabled()

    pElement = driver.find_element_by_id("peas")
    assert pElement.get_attribute("disabled") is None
    assert pElement.is_enabled()

def testShouldReturnTheValueOfTheIndexAttrbuteEvenIfItIsMissing(driver, pages):
    pages.load("formPage.html")
    multiSelect = driver.find_element_by_id("multi")
    options = multiSelect.find_elements_by_tag_name("option")
    assert "1" == options[1].get_attribute("index")

def testShouldIndicateTheElementsThatAreDisabledAreNotis_enabled(driver, pages):
    pages.load("formPage.html")
    inputElement = driver.find_element_by_xpath("//input[@id='notWorking']")
    assert not inputElement.is_enabled()

    inputElement = driver.find_element_by_xpath("//input[@id='working']")
    assert inputElement.is_enabled()

def testElementsShouldBeDisabledIfTheyAreDisabledUsingRandomDisabledStrings(driver, pages):
    pages.load("formPage.html")
    disabledTextElement1 = driver.find_element_by_id("disabledTextElement1")
    assert not disabledTextElement1.is_enabled()

    disabledTextElement2 = driver.find_element_by_id("disabledTextElement2")
    assert not disabledTextElement2.is_enabled()

    disabledSubmitElement = driver.find_element_by_id("disabledSubmitElement")
    assert not disabledSubmitElement.is_enabled()

def testShouldIndicateWhenATextAreaIsDisabled(driver, pages):
    pages.load("formPage.html")
    textArea = driver.find_element_by_xpath("//textarea[@id='notWorkingArea']")
    assert not textArea.is_enabled()

def testShouldThrowExceptionIfSendingKeysToElementDisabledUsingRandomDisabledStrings(driver, pages):
    pages.load("formPage.html")
    disabledTextElement1 = driver.find_element_by_id("disabledTextElement1")
    with pytest.raises(WebDriverException):
        disabledTextElement1.send_keys("foo")
    assert "" == disabledTextElement1.text

    disabledTextElement2 = driver.find_element_by_id("disabledTextElement2")
    with pytest.raises(WebDriverException):
        disabledTextElement2.send_keys("bar")
    assert "" == disabledTextElement2.text

def testShouldIndicateWhenASelectIsDisabled(driver, pages):
    pages.load("formPage.html")
    enabled = driver.find_element_by_name("selectomatic")
    disabled = driver.find_element_by_name("no-select")

    assert enabled.is_enabled()
    assert not disabled.is_enabled()

def testShouldReturnTheValueOfCheckedForACheckboxEvenIfItLacksThatAttribute(driver, pages):
    pages.load("formPage.html")
    checkbox = driver.find_element_by_xpath("//input[@id='checky']")
    assert checkbox.get_attribute("checked") is None
    checkbox.click()
    assert "true" == checkbox.get_attribute("checked")

def testShouldReturnTheValueOfSelectedForRadioButtonsEvenIfTheyLackThatAttribute(driver, pages):
    pages.load("formPage.html")
    neverSelected = driver.find_element_by_id("cheese")
    initiallyNotSelected = driver.find_element_by_id("peas")
    initiallySelected = driver.find_element_by_id("cheese_and_peas")

    assert neverSelected.get_attribute("checked") is None
    assert initiallyNotSelected.get_attribute("checked") is None
    assert "true" == initiallySelected.get_attribute("checked")

    initiallyNotSelected.click()
    assert neverSelected.get_attribute("selected") is None
    assert "true" == initiallyNotSelected.get_attribute("checked")
    assert initiallySelected.get_attribute("checked") is None

def testShouldReturnTheValueOfSelectedForOptionsInSelectsEvenIfTheyLackThatAttribute(driver, pages):
    pages.load("formPage.html")
    selectBox = driver.find_element_by_xpath("//select[@name='selectomatic']")
    options = selectBox.find_elements_by_tag_name("option")
    one = options[0]
    two = options[1]
    assert one.is_selected()
    assert not two.is_selected()
    assert "true" == one.get_attribute("selected")
    assert two.get_attribute("selected") is None

def testShouldReturnValueOfClassAttributeOfAnElement(driver, pages):
    pages.load("xhtmlTest.html")
    heading = driver.find_element_by_xpath("//h1")
    classname = heading.get_attribute("class")
    assert "header" == classname

# Disabled due to issues with Frames
# def testShouldReturnValueOfClassAttributeOfAnElementAfterSwitchingIFrame(driver, pages):
#    pages.load("iframes.html")
#    driver.switch_to.frame("iframe1")
#
#    wallace = driver.find_element_by_xpath("//div[@id='wallace']")
#    classname = wallace.get_attribute("class")
#    assert "gromit" == classname

def testShouldReturnTheContentsOfATextAreaAsItsValue(driver, pages):
    pages.load("formPage.html")
    value = driver.find_element_by_id("withText").get_attribute("value")
    assert "Example text" == value

def testShouldReturnTheContentsOfATextAreaAsItsValueWhenSetToNonNorminalTrue(driver, pages):
    pages.load("formPage.html")
    e = driver.find_element_by_id("withText")
    driver.execute_script("arguments[0].value = 'tRuE'", e)
    value = e.get_attribute("value")
    assert "tRuE" == value

def testShouldTreatReadonlyAsAValue(driver, pages):
    pages.load("formPage.html")
    element = driver.find_element_by_name("readonly")
    readOnlyAttribute = element.get_attribute("readonly")

    textInput = driver.find_element_by_name("x")
    notReadOnly = textInput.get_attribute("readonly")

    assert readOnlyAttribute != notReadOnly

def testShouldGetNumericAtribute(driver, pages):
    pages.load("formPage.html")
    element = driver.find_element_by_id("withText")
    assert "5" == element.get_attribute("rows")

def testCanReturnATextApproximationOfTheStyleAttribute(driver, pages):
    pages.load("javascriptPage.html")
    style = driver.find_element_by_id("red-item").get_attribute("style")
    assert "background-color" in style.lower()

def testShouldCorrectlyReportValueOfColspan(driver, pages):
    pages.load("tables.html")

    th1 = driver.find_element_by_id("th1")
    td2 = driver.find_element_by_id("td2")

    assert "th1" == th1.get_attribute("id")
    assert "3" == th1.get_attribute("colspan")

    assert "td2" == td2.get_attribute("id")
    assert "2" == td2.get_attribute("colspan")

def testCanRetrieveTheCurrentValueOfATextFormField_textInput(driver, pages):
    pages.load("formPage.html")
    element = driver.find_element_by_id("working")
    assert "" == element.get_attribute("value")
    element.send_keys("hello world")
    assert "hello world" == element.get_attribute("value")

def testCanRetrieveTheCurrentValueOfATextFormField_emailInput(driver, pages):
    pages.load("formPage.html")
    element = driver.find_element_by_id("email")
    assert "" == element.get_attribute("value")
    element.send_keys("hello@example.com")
    assert "hello@example.com" == element.get_attribute("value")

def testCanRetrieveTheCurrentValueOfATextFormField_textArea(driver, pages):
    pages.load("formPage.html")
    element = driver.find_element_by_id("emptyTextArea")
    assert "" == element.get_attribute("value")
    element.send_keys("hello world")
    assert "hello world" == element.get_attribute("value")

def testShouldReturnNullForNonPresentBooleanAttributes(driver, pages):
    pages.load("booleanAttributes.html")
    element1 = driver.find_element_by_id("working")
    assert element1.get_attribute("required") is None

@pytest.mark.xfail_ie
def testShouldReturnTrueForPresentBooleanAttributes(driver, pages):
    pages.load("booleanAttributes.html")
    element1 = driver.find_element_by_id("emailRequired")
    assert "true" == element1.get_attribute("required")
    element2 = driver.find_element_by_id("emptyTextAreaRequired")
    assert "true" == element2.get_attribute("required")
    element3 = driver.find_element_by_id("inputRequired")
    assert "true" == element3.get_attribute("required")
    element4 = driver.find_element_by_id("textAreaRequired")
    assert "true" == element4.get_attribute("required")

def tesShouldGetUnicodeCharsFromAttribute(driver, pages):
    pages.load("formPage.html")
    title = driver.find_element_by_id("vsearchGadget").get_attribute("title")
    assert 'Hvad s\xf8ger du?' == title


text:
# sparta-test-utils
[![Build Status](https://travis-ci.org/SpartaTech/sparta-test-utils.svg?branch=master)](https://travis-ci.org/SpartaTech/sparta-test-utils)
[![Coverage Status](https://coveralls.io/repos/github/SpartaTech/sparta-test-utils/badge.svg?branch=master)](https://coveralls.io/github/SpartaTech/sparta-test-utils?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.spartatech/sparta-test-utils/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.github.spartatech/sparta-test-utils/)

*Library with Unit Test utilities.*

Sparta Test Utils provides several assert utilities to help you unit testing your Java application. These helpers include:

* **Collection Assert** -> Helpers to assert lists.
* **Logback Asserts** -> Provides a way to assert that your log calls were executed.
* **Temporal Asserts** -> Helpers to assert Dates.

Below there are an explanation on how to use each one.

## Collection Assert
Collection assert provides a way to compare two lists and asserts that both lists has the same elements. The comparison algorithm can be either provided by you or using a field-by-field copmarison.

There are these options available currently:

### Assert using field-by-field comparison
In this option the asserter will compare all the fields using Reflection. For each field it will generate a reflectionToString and compare the values.
The order of the elements in the lists is not considered, it will try to match elements in any order.

***Usage:***

~~~Java
CollectionAssert.assertListByReflection(listOne, listTwo);
~~~

### Assert using field-by-field comparison, with excluded fields
There is also the option to make the same asserts as described in the previous method, but excluding some fields from the comparison. In this case all the other fields will be compared but the ones in the list.
The order of the elements in the lists is not considered, it will try to match elements in any order.

***Usage:***

~~~Java
CollectionAssert.assertListByReflection(listOne, listTwo, "address", "password");
~~~

### Assert using custom Comparator
Some times you need to have a custom way to compare the elements in the lists, to do so a method was provided where you can pass a comparator. Using this approach, the elements will be matched using your defined algorithm.
The order of the elements in the lists is not considered, it will try to match elements in any order.

***Usage:***

~~~Java
CollectionAssert.assertList(listOne, listTwo,
                       (a,b) -> a.equals(b)? 0 : 1);
~~~

## Logback Asserts
There are some unit tests that require you to assert that the log was written. Testing log is something difficult because logging libraries, like Logback, do a good job abstracting all the logic.

In order to help developers to test their code, we created a way to assert that log calls were made to Logback system.

The way it works is:

* Write your log expectations
* Call the method to be tested
* Call the asserter method to ensure all the logs happened as expected.

***The method UnitTestAsserterLogback.assertLogExpectations() is deprecated, use UnitTestAsserterLogback.assertLogExpectations(false) instead***

***Usage:***

~~~Java
//Init the Asserter
final UnitTestAsserterLogback spyAppender = new UnitTestAsserterLogback(<<You Class or Logger>>);

//Indicate which logLevel, message, and optional parameters for the log should happen
spyAppender.addExpectation(Level.INFO, message);

//Execute your code

//Calls assert method
/*False means the the logs has to happen in the same order
as the expectations an the exact same logs hapened, */
/*True means that lib will only check if the expectations happened
regardless of any extra ones,
also it will not care for order that it was called.
*/
spyAppender.assertLogExpectations(false);
~~~

***Example:***

~~~Java
public static final Logger LOGGER = LoggerFactory.getLogger(MyTest.class);

@Test
public void test() {
	final String message = "new message {}, {}";
	final int param1 = 1;
	final String param2 = "New Param";
	final UnitTestAsserterLogback spyAppender = new UnitTestAsserterLogback(this.getClass());
	spyAppender.addExpectation(Level.INFO, message, param1, param2);

	LOGGER.info(message, param1, param2);

	spyAppender.assertLogExpectations(false);
}
~~~

## Temporal Asserts
Helpers to test Java Dates.

Uses:

* Assert only some parts of a Date object
* Assert Date by a specific DateFormat

### Assert by date elements

You can assert a date only by some elements, let's say you want to assert the Date, but only the date piece, not time.

***Usage:***

~~~Java
DateAssertUtils.assertDate(expected, actual, Calendar.DATE, Calendar.MONTH, Calendar.YEAR);
~~~

### Assert by DateFormat

Another usage, instead of informing which fields to test, is to give a DateFormat String to be compared. In this case, code will convert the Date to a String in that format and then compare.

***Usage:***

~~~Java
DateAssertUtils.assertDateByFormat("Date Did no match", expected, actual, "yyyy-MM-dd HH:mm:ss");
~~~

## Exception Asserts

Helpers to assert Exceptions. Provides more control to verify the Exception scenarios than @Test(expected=Exception)

Uses:

* Assert Exception message

### Assert exception message

Let's you assert that teh exception being thrown is the one you're expecting also matching the message.

* The first parameter is the exception you are expecting with the message that should happen.
* The second parameter is a boolean indicating of the exception happened in the tested method should be thrown or swallowed. You can use true if you want to stop execution and in you annotation use @Test(expected=Exception), or false if you just want to assert this exception, and finish the test.
* the third parameter is the block of code that you want to be tested (the one that suppose to throw the exception).

***Usage:***

~~~Java
ExceptionAssert.assertExceptionMessage(new Exception("Message Expected"), false,
	() -> {
			//Call the method to be tested
	});
~~~

redpajama_set_name: RedPajamaGithub


text:
#ifndef UTILS_RUNNINGAVERAGE_H // -*- C++ -*-
#define UTILS_RUNNINGAVERAGE_H

#include <cstddef>
#include <vector>

namespace Logger {
class Log;
}

namespace Utils {

/** Container class the maintains a running average value for a stream of values. Instances have a fixed window
    size that determines how many samples to track for calculations; after receiving this number of samples, the
    algorithm starts to forget the oldest sample.
*/
class RunningAverage {
public:
    /** Obtain Logger::Log device to use for instances of this class.

        \return Logger::Log reference
    */
    static Logger::Log& Log();

    /** Constructor. Creates a new container for windowSize samples, initialized to initialValue values.

        \param windowSize number of samples to remember

        \param initialValue initial value to give to window samples
    */
    RunningAverage(size_t windowSize, double initialValue = 0.0);

    /** Add a new sample to the container.

        \param value sample value to add
    */
    void addValue(double value);

    /** Obtain the current average value for the samples seen so far.

        \return current average value
    */
    double getAverageValue() const { return sum_ / values_.size(); }

    /** Reset the container so that all samples have a given initial value.

        \param initialValue the initial value to use
    */
    void clear(double initialValue = 0.0);

    /** Reset the container so that it has a new sample window size. If the given window size is the same as the
        current one, the effect will be the same as calling clear(initialValue).

        \param windowSize new size to use

        \param initialValue the initial value to use for samples
    */
    void setWindowSize(size_t windowSize, double initialValue = 0.0);

private:
    std::vector<double> values_;
    size_t oldest_;
    double sum_;
};

} // end namespace Utils

#endif


text:
using System;
using SharpDX;

#if !NETFX_CORE
namespace HelixToolkit.Wpf.SharpDX
#else
#if CORE
namespace HelixToolkit.SharpDX.Core
#else
namespace HelixToolkit.UWP
#endif
#endif
{
    namespace Model.Scene
    {
        using Core;
        using System.Collections.Generic;

        /// <summary>
        ///
        /// </summary>
        public class CrossSectionMeshNode : MeshNode
        {
            /// <summary>
            /// Gets or sets the cutting operation.
            /// </summary>
            /// <value>
            /// The cutting operation.
            /// </value>
            public CuttingOperation CuttingOperation
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).CuttingOperation = value;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).CuttingOperation;
                }
            }
            /// <summary>
            /// Gets or sets the color of the cross section.
            /// </summary>
            /// <value>
            /// The color of the cross section.
            /// </value>
            public Color4 CrossSectionColor
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).SectionColor = value;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).SectionColor;
                }
            }
            /// <summary>
            /// Gets or sets a value indicating whether [enable plane1].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane1]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane1
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).PlaneEnabled;
                    v.X = value;
                    (RenderCore as ICrossSectionRenderParams).PlaneEnabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).PlaneEnabled.X;
                }
            }
            /// <summary>
            /// Gets or sets a value indicating whether [enable plane2].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane2]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane2
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).PlaneEnabled;
                    v.Y = value;
                    (RenderCore as ICrossSectionRenderParams).PlaneEnabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).PlaneEnabled.Y;
                }
            }
            /// <summary>
            /// Gets or sets a value indicating whether [enable plane3].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane3]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane3
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).PlaneEnabled;
                    v.Z = value;
                    (RenderCore as ICrossSectionRenderParams).PlaneEnabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).PlaneEnabled.Z;
                }
            }
            /// <summary>
            /// Gets or sets a value indicating whether [enable plane4].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane4]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane4
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).PlaneEnabled;
                    v.W = value;
                    (RenderCore as ICrossSectionRenderParams).PlaneEnabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).PlaneEnabled.W;
                }
            }

            /// <summary>
            /// Gets or sets a value indicating whether [enable plane5].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane5]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane5
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled;
                    v.X = value;
                    (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled.X;
                }
            }

            /// <summary>
            /// Gets or sets a value indicating whether [enable plane6].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane6]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane6
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled;
                    v.Y = value;
                    (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled.Y;
                }
            }

            /// <summary>
            /// Gets or sets a value indicating whether [enable plane7].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane7]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane7
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled;
                    v.Z = value;
                    (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled.Z;
                }
            }

            /// <summary>
            /// Gets or sets a value indicating whether [enable plane8].
            /// </summary>
            /// <value>
            ///   <c>true</c> if [enable plane8]; otherwise, <c>false</c>.
            /// </value>
            public bool EnablePlane8
            {
                set
                {
                    var v = (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled;
                    v.W = value;
                    (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled = v;
                }
                get
                {
                    return (RenderCore as ICrossSectionRenderParams).Plane5To8Enabled.W;
                }
            }

            /// <summary>
            /// Gets or sets the plane1.
            /// </summary>
            /// <value>
            /// The plane1.
            /// </value>
            public Plane Plane1
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane1Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane1Params);
                }
            }
            /// <summary>
            /// Gets or sets the plane2.
            /// </summary>
            /// <value>
            /// The plane2.
            /// </value>
            public Plane Plane2
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane2Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane2Params);
                }
            }
            /// <summary>
            /// Gets or sets the plane3.
            /// </summary>
            /// <value>
            /// The plane3.
            /// </value>
            public Plane Plane3
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane3Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane3Params);
                }
            }
            /// <summary>
            /// Gets or sets the plane4.
            /// </summary>
            /// <value>
            /// The plane4.
            /// </value>
            public Plane Plane4
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane4Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane4Params);
                }
            }

            /// <summary>
            /// Gets or sets the plane5.
            /// </summary>
            /// <value>
            /// The plane5.
            /// </value>
            public Plane Plane5
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane5Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane5Params);
                }
            }

            /// <summary>
            /// Gets or sets the plane6.
            /// </summary>
            /// <value>
            /// The plane6.
            /// </value>
            public Plane Plane6
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane6Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane6Params);
                }
            }

            /// <summary>
            /// Gets or sets the plane7.
            /// </summary>
            /// <value>
            /// The plane7.
            /// </value>
            public Plane Plane7
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane7Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane7Params);
                }
            }

            /// <summary>
            /// Gets or sets the plane8.
            /// </summary>
            /// <value>
            /// The plane8.
            /// </value>
            public Plane Plane8
            {
                set
                {
                    (RenderCore as ICrossSectionRenderParams).Plane8Params = PlaneToVector(ref value);
                }
                get
                {
                    return VectorToPlane((RenderCore as ICrossSectionRenderParams).Plane8Params);
                }
            }

            /// <summary>
            /// The PlaneToVector
            /// </summary>
            /// <param name="p">The <see cref="Plane"/></param>
            /// <returns>The <see cref="Vector4"/></returns>
            private static Vector4 PlaneToVector(ref Plane p)
            {
                return new Vector4(p.Normal, p.D);
            }

            private static Plane VectorToPlane(Vector4 v)
            {
                return new Plane(v.ToXYZ(), v.W);
            }

            /// <summary>
            /// Override this function to set render technique during Attach Host.
            /// <para>If <see cref="SceneNode.OnSetRenderTechnique" /> is set, then <see cref="SceneNode.OnSetRenderTechnique" /> instead of <see cref="OnCreateRenderTechnique" /> function will be called.</para>
            /// </summary>
            /// <param name="host"></param>
            /// <returns>
            /// Return RenderTechnique
            /// </returns>
            protected override IRenderTechnique OnCreateRenderTechnique(IRenderHost host)
            {
                return host.EffectsManager[DefaultRenderTechniqueNames.CrossSection];
            }

            /// <summary>
            /// Called when [create render core].
            /// </summary>
            /// <returns></returns>
            protected override RenderCore OnCreateRenderCore()
            {
                return new CrossSectionMeshRenderCore();
            }

            protected override bool OnHitTest(HitTestContext context, Matrix totalModelMatrix, ref List<HitTestResult> hits)
            {
                int hitsBeforeCheck = hits?.Count ?? 0;
                var meshGeometry3d = Geometry as MeshGeometry3D;
                if (meshGeometry3d == null)
                    return false;
                if(meshGeometry3d.ReturnMultipleHitsOnHitTest)
                    throw new InvalidOperationException($"All hit tests should be called on the same thread, {nameof(Geometry)}.{nameof(meshGeometry3d.ReturnMultipleHitsOnHitTest)} would not be true if that was the case");
                meshGeometry3d.ReturnMultipleHitsOnHitTest = true;
                bool result = meshGeometry3d.HitTest(context, totalModelMatrix, ref hits, this.WrapperSource);
                meshGeometry3d.ReturnMultipleHitsOnHitTest = false;
                var operation = CuttingOperation;
                if (result)
                {
                    switch (operation)
                    {
                        case CuttingOperation.Intersect:
                            // Remove any hit point behinds any of the clip plane.
                            if (EnablePlane1)
                                result = RemoveHitPointBehindCrossingPlane(Plane1, hits, hitsBeforeCheck);
                            if (result && EnablePlane2)
                                result = RemoveHitPointBehindCrossingPlane(Plane2, hits, hitsBeforeCheck);
                            if (result && EnablePlane3)
                                result = RemoveHitPointBehindCrossingPlane(Plane3, hits, hitsBeforeCheck);
                            if (result && EnablePlane4)
                                result = RemoveHitPointBehindCrossingPlane(Plane4, hits, hitsBeforeCheck);
                            if (result && EnablePlane5)
                                result = RemoveHitPointBehindCrossingPlane(Plane5, hits, hitsBeforeCheck);
                            if (result && EnablePlane6)
                                result = RemoveHitPointBehindCrossingPlane(Plane6, hits, hitsBeforeCheck);
                            if (result && EnablePlane7)
                                result = RemoveHitPointBehindCrossingPlane(Plane7, hits, hitsBeforeCheck);
                            if (result && EnablePlane8)
                                result = RemoveHitPointBehindCrossingPlane(Plane8, hits, hitsBeforeCheck);
                            break;
                        case CuttingOperation.Subtract:
                            // Remove any hit point in front of all clip planes
                            result = RemoveHitPointInFrontOfAllCrossingPlanes(hits, hitsBeforeCheck);
                            break;
                    }
                    if (result)
                        RemoveAllButClosest(hits, hitsBeforeCheck);
                }
                return result;
            }

            private static bool RemoveHitPointBehindCrossingPlane(Plane plane, List<HitTestResult> hits, int hitsBeforeCheck)
            {
                // Loop backwards to remove at end of list when possible
                for (int i = hits.Count-1; i >= hitsBeforeCheck; i--)
                {
                    if (hits[i].PointHit.PointToPlanePosition(ref plane) == PlaneIntersectionType.Back)
                    {
                        hits.RemoveAt(i);
                    }
                }
                return hits.Count > hitsBeforeCheck;
            }

            private bool RemoveHitPointInFrontOfAllCrossingPlanes(List<HitTestResult> hits, int hitsBeforeCheck)
            {
                for (int i = hits.Count - 1; i >= hitsBeforeCheck; i--)
                {
                    Vector3 hitPoint = hits[i].PointHit;
                    if (EnablePlane1)
                    {
                        if (hitPoint.PointToPlanePosition(Plane1) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane2)
                    {
                        if (hitPoint.PointToPlanePosition(Plane2) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane3)
                    {
                        if (hitPoint.PointToPlanePosition(Plane3) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane4)
                    {
                        if (hitPoint.PointToPlanePosition(Plane4) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane5)
                    {
                        if (hitPoint.PointToPlanePosition(Plane5) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane6)
                    {
                        if (hitPoint.PointToPlanePosition(Plane6) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane7)
                    {
                        if (hitPoint.PointToPlanePosition(Plane7) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    if (EnablePlane8)
                    {
                        if (hitPoint.PointToPlanePosition(Plane8) != PlaneIntersectionType.Front)
                        {
                            continue;
                        }
                    }
                    hits.RemoveAt(i);
                }
                return hits.Count > hitsBeforeCheck;
            }

            /// <summary>
            /// Removes all but the closes hit point, this is done here despite similar checks being done further up the call stack.
            /// This minimizes the risk of breaking callers assumptions of one hit per object
            /// </summary>
            /// <param name="hits">All hits so far</param>
            /// <param name="hitsBeforeCheck">The number of hits before this object was processed</param>
            private static void RemoveAllButClosest(List<HitTestResult> hits, int hitsBeforeCheck)
            {
                if(hits.Count - hitsBeforeCheck == 0)
                {
                    return;
                }
                double minDistance = double.MaxValue;
                for (int i = hits.Count - 1; i >= hitsBeforeCheck; i--)
                {
                    var hit = hits[i];
                    if (minDistance > hit.Distance)
                    {
                        minDistance = hit.Distance;
                    }
                }
                if(minDistance < double.MaxValue)
                {
                    bool foundMinDistance = false;
                    // Loop backwards to remove at end of list when possible
                    for (int i = hits.Count - 1; i >= hitsBeforeCheck; i--)
                    {
                        if(hits[i].Distance > minDistance || (foundMinDistance && hits[i].Distance == minDistance))
                        {
                            hits.RemoveAt(i);
                        }
                        else
                        {
                            foundMinDistance = true;
                        }
                    }
                }
            }
        }
    }

}


text:
package org.mifos.test.acceptance.framework.admin;

import org.mifos.test.acceptance.framework.MifosPage;
import org.mifos.test.acceptance.util.StringUtil;
import org.springframework.util.StringUtils;
import org.testng.Assert;

import com.thoughtworks.selenium.Selenium;

public class EditPenaltyPreviewPage extends MifosPage {
    private static final String XPATH_DATA_FORMAT = "//form/div/div[2]/div[%d]/div[%d]";

    public EditPenaltyPreviewPage(final Selenium selenium) {
        super(selenium);
    }

    public void verifyPage() {
        this.verifyPage("penaltyPreview");
    }

    public void verifyData(final PenaltyFormParameters parameters) {
        Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 1)),
                "Penalty Name: " + parameters.getName());
        Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 2)),
                "Grace Period Type: " + parameters.getPeriod());

        if (StringUtils.hasText(parameters.getDuration())) {
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 3)), "Grace Period Duration: "
                    + StringUtil.formatNumber(parameters.getDuration()));
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 4)),
                    "Cumulative Penalty Limit (Minimum): " + StringUtil.formatNumber(parameters.getMin()));
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 5)),
                    "Cumulative Penalty Limit (Maximum): " + StringUtil.formatNumber(parameters.getMax()));
        } else {
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 3)),
                    "Cumulative Penalty Limit (Minimum): " + StringUtil.formatNumber(parameters.getMin()));
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 3, 4)),
                    "Cumulative Penalty Limit (Maximum): " + StringUtil.formatNumber(parameters.getMax()));
        }

        if (StringUtils.hasText(parameters.getAmount())) {
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 5, 1)),
                    "Amount: " + StringUtil.formatNumber(parameters.getAmount()));
        }

        if (StringUtils.hasText(parameters.getRate())) {
            Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 5, 1)), "Calculate Penalty As: "
                    + StringUtil.formatNumber(parameters.getRate()) + " % of " + parameters.getFormula());
        }

        Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 5, 2)), "Penalty Application Frequency: "
                + parameters.getFrequency());

        Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 7, 1)),
                "GL Code: " + parameters.getGlCode());
        Assert.assertEquals(selenium.getText(String.format(XPATH_DATA_FORMAT, 7, 2)), "Status: " + parameters.getStatus());
    }

    public PenaltyFormPage navigateToEditPenaltyInformationPage() {
        selenium.click("EDIT");
        waitForPageToLoad();
        return new PenaltyFormPage(selenium);
    }

    public ViewPenaltyPage submit() {
        selenium.click("SUBMIT");
        waitForPageToLoad();
        return new ViewPenaltyPage(selenium);
    }
}


text:
package reflect

import (
	"fmt"
	"strings"
)

func BoolConverter(v interface{}) (interface{}, error) {
	switch t := v.(type) {
	case int:
		return t == 1, nil
	case string:
		truthy := []string{
			"true", "yes", "ok", "Y", "on",
		}

		for _, test := range truthy {
			if strings.ToLower(t) == test {
				return true, nil
			}
		}

		return false, fmt.Errorf("unable to understand value of \"%s\", expected one of %v", t, truthy)
	default:
		return nil, fmt.Errorf("could not convert \"%v\" into type int", v)
	}
}


text:
namespace Organizr.Web.Areas.Administration.ViewModels.Events
{
    using System;

    public class EventInputModel
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }

        public DateTime StartDate { get; set; }
    }
}


text:
function zp = evalinv(M,wp,tol)
%EVALINV Invert Schwarz-Christoffel crossratio disk map at points.
%   EVALINV(M,WP) evaluates the inverse of the Schwarz-Christoffel map
%   M at the points WP in the polygon. The default tolerance of M is
%   used.
%
%   EVALINV(M,WP,TOL) attempts to give an answer accurate to TOL. If TOL
%   is smaller than the accuracy of M, this is unlikely to be met.
%
%   See also CRDISKMAP, CRDISKMAP/EVAL.

%   Copyright 1998 by Toby Driscoll.
%   $Id: evalinv.m 7 1998-05-10 04:37:19Z tad $

if nargin < 3
  % Default means use value stored in map object
  qdata = M.qdata;
  tol = M.accuracy;
else
  % An argument was supplied. Is it qdata or a tolerance?
  qdata = tol;
  if length(tol) > 1
    tol = 10^(-size(qdata,1));
  end
end

p = polygon(M);
w = vertex(p);
beta = angle(p) - 1;
cr = M.crossratio;
aff = M.affine;
wcfix = M.center{2};
Q = M.qlgraph;

zp = NaN*wp;
idx = logical(isinpoly(wp,p));

zp(idx) = crinvmap(wp(idx),w,beta,cr,aff,wcfix,Q,qdata,[0 tol]);


text:
package com.sedmelluq.discord.lavaplayer.remote.message;

import com.sedmelluq.discord.lavaplayer.format.AudioDataFormat;
import com.sedmelluq.discord.lavaplayer.format.OpusAudioDataFormat;
import com.sedmelluq.discord.lavaplayer.format.Pcm16AudioDataFormat;
import com.sedmelluq.discord.lavaplayer.format.StandardAudioDataFormats;
import com.sedmelluq.discord.lavaplayer.player.AudioConfiguration;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * Codec for track start message.
 */
public class TrackStartRequestCodec implements RemoteMessageCodec<TrackStartRequestMessage> {
  private static final int VERSION_INITIAL = 1;
  private static final int VERSION_WITH_FORMAT = 2;
  private static final int VERSION_WITH_POSITION = 3;

  @Override
  public Class<TrackStartRequestMessage> getMessageClass() {
    return TrackStartRequestMessage.class;
  }

  @Override
  public int version(RemoteMessage message) {
    // Backwards compatibility with older nodes.
    if (message instanceof TrackStartRequestMessage) {
      if (((TrackStartRequestMessage) message).position != 0) {
        return VERSION_WITH_POSITION;
      }

      AudioDataFormat format = ((TrackStartRequestMessage) message).configuration.getOutputFormat();

      if (!format.equals(StandardAudioDataFormats.DISCORD_OPUS)) {
        return VERSION_WITH_FORMAT;
      }

      return VERSION_INITIAL;
    }

    return VERSION_WITH_POSITION;
  }

  @Override
  public void encode(DataOutput out, TrackStartRequestMessage message) throws IOException {
    int version = version(message);

    out.writeLong(message.executorId);
    out.writeUTF(message.trackInfo.title);
    out.writeUTF(message.trackInfo.author);
    out.writeLong(message.trackInfo.length);
    out.writeUTF(message.trackInfo.identifier);
    out.writeBoolean(message.trackInfo.isStream);
    out.writeInt(message.encodedTrack.length);
    out.write(message.encodedTrack);
    out.writeInt(message.volume);
    out.writeUTF(message.configuration.getResamplingQuality().name());
    out.writeInt(message.configuration.getOpusEncodingQuality());

    if (version >= VERSION_WITH_FORMAT) {
      AudioDataFormat format = message.configuration.getOutputFormat();
      out.writeInt(format.channelCount);
      out.writeInt(format.sampleRate);
      out.writeInt(format.chunkSampleCount);
      out.writeUTF(format.codecName());
    }

    if (version >= VERSION_WITH_POSITION) {
      out.writeLong(message.position);
    }
  }

  @Override
  public TrackStartRequestMessage decode(DataInput in, int version) throws IOException {
    long executorId = in.readLong();
    AudioTrackInfo trackInfo = new AudioTrackInfo(in.readUTF(), in.readUTF(), in.readLong(), in.readUTF(), in.readBoolean(), null);

    byte[] encodedTrack = new byte[in.readInt()];
    in.readFully(encodedTrack);

    int volume = in.readInt();
    AudioConfiguration configuration = new AudioConfiguration();
    configuration.setResamplingQuality(AudioConfiguration.ResamplingQuality.valueOf(in.readUTF()));
    configuration.setOpusEncodingQuality(in.readInt());

    if (version >= VERSION_WITH_FORMAT) {
      AudioDataFormat format = createFormat(in.readInt(), in.readInt(), in.readInt(), in.readUTF());
      configuration.setOutputFormat(format);
    }

    long position = 0;

    if (version >= VERSION_WITH_POSITION) {
      position = in.readLong();
    }

    return new TrackStartRequestMessage(executorId, trackInfo, encodedTrack, volume, configuration, position);
  }

  private AudioDataFormat createFormat(int channelCount, int sampleRate, int chunkSampleCount, String codecName)
      throws IOException {

    switch (codecName) {
      case OpusAudioDataFormat.CODEC_NAME:
        return new OpusAudioDataFormat(channelCount, sampleRate, chunkSampleCount);
      case Pcm16AudioDataFormat.CODEC_NAME_LE:
        return new Pcm16AudioDataFormat(channelCount, sampleRate, chunkSampleCount, false);
      case Pcm16AudioDataFormat.CODEC_NAME_BE:
        return new Pcm16AudioDataFormat(channelCount, sampleRate, chunkSampleCount, true);
      default:
        throw new IOException("Unsupported codec requested.");
    }
  }
}


text:
import DS from "ember-data";

export default DS.JSONAPIAdapter.extend({
  headers: {
    'Content-Type': 'application/hal+json'
  }
});


text:
#ifndef SDL_config_h_
#define SDL_config_h_

/**
 *  \file SDL_config.h.in
 *
 *  This is a set of defines to configure the SDL features
 */

/* General platform specific identifiers */
#include "SDL_platform.h"

/* C language features */
/* #undef const */
/* #undef inline */
/* #undef volatile */

/* C datatypes */
/* Define SIZEOF_VOIDP for 64/32 architectures */
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif

#define HAVE_GCC_ATOMICS 1
/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */

/* Comment this if you want to build without any C library requirements */
#define HAVE_LIBC 1
#if HAVE_LIBC

/* Useful headers */
#define STDC_HEADERS 1
/* #undef HAVE_ALLOCA_H */
#define HAVE_CTYPE_H 1
/* #undef HAVE_FLOAT_H */
/* #undef HAVE_ICONV_H */
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MATH_H 1
#define HAVE_MEMORY_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_WCHAR_H 1
/* #undef HAVE_PTHREAD_NP_H */
/* #undef HAVE_LIBUNWIND_H */

/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
#define HAVE_GETENV 1
/* #undef HAVE_SETENV */
#define HAVE_PUTENV 1
/* #undef HAVE_UNSETENV */
#endif
#define HAVE_QSORT 1
#define HAVE_ABS 1
/* #undef HAVE_BCOPY */
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_WCSLEN 1
/* #undef HAVE_WCSLCPY */
/* #undef HAVE_WCSLCAT */
#define HAVE_WCSDUP 1
#define HAVE_WCSSTR 1
#define HAVE_WCSCMP 1
#define HAVE_WCSNCMP 1
/* #undef HAVE_WCSCASECMP */
#define HAVE__WCSICMP 1
/* #undef HAVE_WCSNCASECMP */
#define HAVE__WCSNICMP 1
#define HAVE_STRLEN 1
/* #undef HAVE_STRLCPY */
/* #undef HAVE_STRLCAT */
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
#define HAVE__STRLWR 1
/* #undef HAVE_INDEX */
/* #undef HAVE_RINDEX */
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
/* #undef HAVE_STRTOK_S */
#define HAVE_ITOA 1
#define HAVE__LTOA 1
/* #undef HAVE__UITOA */
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE__I64TOA 1
#define HAVE__UI64TOA 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE__STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE__STRNICMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_FOPEN64 1
#define HAVE_FSEEKO 1
#define HAVE_FSEEKO64 1
/* #undef HAVE_SIGACTION */
/* #undef HAVE_SA_SIGACTION */
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
/* #undef HAVE_SYSCONF */
/* #undef HAVE_SYSCTLBYNAME */
/* #undef HAVE_CLOCK_GETTIME */
/* #undef HAVE_GETPAGESIZE */
/* #undef HAVE_MPROTECT */
/* #undef HAVE_ICONV */
/* #undef HAVE_PTHREAD_SETNAME_NP */
/* #undef HAVE_PTHREAD_SET_NAME_NP */
/* #undef HAVE_SEM_TIMEDWAIT */
/* #undef HAVE_GETAUXVAL */
/* #undef HAVE_ELF_AUX_INFO */
/* #undef HAVE_POLL */
#define HAVE__EXIT 1

#elif __WIN32__
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
/* #undef HAVE_FLOAT_H */
#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#endif /* HAVE_LIBC */

/* #undef HAVE_ALTIVEC_H */
/* #undef HAVE_DBUS_DBUS_H */
/* #undef HAVE_FCITX */
/* #undef HAVE_IBUS_IBUS_H */
/* #undef HAVE_SYS_INOTIFY_H */
/* #undef HAVE_INOTIFY_INIT */
/* #undef HAVE_INOTIFY_INIT1 */
/* #undef HAVE_INOTIFY */
#define HAVE_IMMINTRIN_H 1
/* #undef HAVE_LIBUDEV_H */
/* #undef HAVE_LIBSAMPLERATE_H */

#define HAVE_D3D_H 1
#define HAVE_D3D11_H 1
#define HAVE_DDRAW_H 1
#define HAVE_DSOUND_H 1
#define HAVE_DINPUT_H 1
#define HAVE_XINPUT_H 1
#define HAVE_DXGI_H 1

#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
#define HAVE_SENSORSAPI_H 1

/* #undef HAVE_XINPUT_GAMEPAD_EX */
/* #undef HAVE_XINPUT_STATE_EX */

/* SDL internal assertion support */
/* #undef SDL_DEFAULT_ASSERT_LEVEL */

/* Allow disabling of core subsystems */
/* #undef SDL_ATOMIC_DISABLED */
/* #undef SDL_AUDIO_DISABLED */
/* #undef SDL_CPUINFO_DISABLED */
/* #undef SDL_EVENTS_DISABLED */
/* #undef SDL_FILE_DISABLED */
/* #undef SDL_JOYSTICK_DISABLED */
/* #undef SDL_HAPTIC_DISABLED */
/* #undef SDL_SENSOR_DISABLED */
/* #undef SDL_LOADSO_DISABLED */
/* #undef SDL_RENDER_DISABLED */
/* #undef SDL_THREADS_DISABLED */
/* #undef SDL_TIMERS_DISABLED */
/* #undef SDL_VIDEO_DISABLED */
/* #undef SDL_POWER_DISABLED */
/* #undef SDL_FILESYSTEM_DISABLED */

/* Enable various audio drivers */
/* #undef SDL_AUDIO_DRIVER_ALSA */
/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_ANDROID */
/* #undef SDL_AUDIO_DRIVER_ARTS */
/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* #undef SDL_AUDIO_DRIVER_EMSCRIPTEN */
/* #undef SDL_AUDIO_DRIVER_ESD */
/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */
/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_HAIKU */
/* #undef SDL_AUDIO_DRIVER_JACK */
/* #undef SDL_AUDIO_DRIVER_JACK_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_NAS */
/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_NETBSD */
/* #undef SDL_AUDIO_DRIVER_OSS */
/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
/* #undef SDL_AUDIO_DRIVER_PAUDIO */
/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */
/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_QSA */
/* #undef SDL_AUDIO_DRIVER_SNDIO */
/* #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */
/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
#define SDL_AUDIO_DRIVER_WASAPI 1
#define SDL_AUDIO_DRIVER_WINMM 1

/* Enable various input drivers */
/* #undef SDL_INPUT_LINUXEV */
/* #undef SDL_INPUT_LINUXKD */
/* #undef SDL_JOYSTICK_ANDROID */
/* #undef SDL_JOYSTICK_HAIKU */
#define SDL_JOYSTICK_DINPUT 1
#define SDL_JOYSTICK_XINPUT 1
/* #undef SDL_JOYSTICK_DUMMY */
/* #undef SDL_JOYSTICK_IOKIT */
/* #undef SDL_JOYSTICK_MFI */
/* #undef SDL_JOYSTICK_LINUX */
/* #undef SDL_JOYSTICK_WINMM */
/* #undef SDL_JOYSTICK_USBHID */
/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
#define SDL_JOYSTICK_HIDAPI 1
/* #undef SDL_JOYSTICK_EMSCRIPTEN */
#define SDL_JOYSTICK_VIRTUAL 1
/* #undef SDL_HAPTIC_DUMMY */
/* #undef SDL_HAPTIC_LINUX */
/* #undef SDL_HAPTIC_IOKIT */
#define SDL_HAPTIC_DINPUT 1
#define SDL_HAPTIC_XINPUT 1
/* #undef SDL_HAPTIC_ANDROID */
/* #undef SDL_LIBUSB_DYNAMIC */

/* Enable various sensor drivers */
/* #undef SDL_SENSOR_ANDROID */
/* #undef SDL_SENSOR_COREMOTION */
#define SDL_SENSOR_WINDOWS 1
/* #undef SDL_SENSOR_DUMMY */

/* Enable various shared object loading systems */
/* #undef SDL_LOADSO_DLOPEN */
/* #undef SDL_LOADSO_DUMMY */
/* #undef SDL_LOADSO_LDG */
#define SDL_LOADSO_WINDOWS 1

/* Enable various threading systems */
/* #undef SDL_THREAD_PTHREAD */
/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */
/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
#define SDL_THREAD_WINDOWS 1

/* Enable various timer systems */
/* #undef SDL_TIMER_HAIKU */
/* #undef SDL_TIMER_DUMMY */
/* #undef SDL_TIMER_UNIX */
#define SDL_TIMER_WINDOWS 1
/* #undef SDL_TIMER_WINCE */

/* Enable various video drivers */
/* #undef SDL_VIDEO_DRIVER_ANDROID */
/* #undef SDL_VIDEO_DRIVER_HAIKU */
/* #undef SDL_VIDEO_DRIVER_COCOA */
/* #undef SDL_VIDEO_DRIVER_UIKIT */
/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
#define SDL_VIDEO_DRIVER_DUMMY 1
/* #undef SDL_VIDEO_DRIVER_OFFSCREEN */
#define SDL_VIDEO_DRIVER_WINDOWS 1
/* #undef SDL_VIDEO_DRIVER_WINRT */
/* #undef SDL_VIDEO_DRIVER_WAYLAND */
/* #undef SDL_VIDEO_DRIVER_RPI */
/* #undef SDL_VIDEO_DRIVER_VIVANTE */
/* #undef SDL_VIDEO_DRIVER_VIVANTE_VDK */

/* #undef SDL_VIDEO_DRIVER_KMSDRM */
/* #undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC */
/* #undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM */

/* #undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL */
/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR */
/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON */

/* #undef SDL_VIDEO_DRIVER_EMSCRIPTEN */
/* #undef SDL_VIDEO_DRIVER_X11 */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */
/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */
/* #undef SDL_VIDEO_DRIVER_X11_XDBE */
/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */
/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2 */
/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */
/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
/* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */
/* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */
/* #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */
/* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY */
/* #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM */

#define SDL_VIDEO_RENDER_D3D 1
#define SDL_VIDEO_RENDER_D3D11 1
#define SDL_VIDEO_RENDER_OGL 1
/* #undef SDL_VIDEO_RENDER_OGL_ES */
#define SDL_VIDEO_RENDER_OGL_ES2 1
/* #undef SDL_VIDEO_RENDER_DIRECTFB */
/* #undef SDL_VIDEO_RENDER_METAL */

/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
/* #undef SDL_VIDEO_OPENGL_ES */
#define SDL_VIDEO_OPENGL_ES2 1
/* #undef SDL_VIDEO_OPENGL_BGL */
/* #undef SDL_VIDEO_OPENGL_CGL */
/* #undef SDL_VIDEO_OPENGL_GLX */
#define SDL_VIDEO_OPENGL_WGL 1
#define SDL_VIDEO_OPENGL_EGL 1
/* #undef SDL_VIDEO_OPENGL_OSMESA */
/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */

/* Enable Vulkan support */
#define SDL_VIDEO_VULKAN 1

/* Enable Metal support */
/* #undef SDL_VIDEO_METAL */

/* Enable system power support */
/* #undef SDL_POWER_ANDROID */
/* #undef SDL_POWER_LINUX */
#define SDL_POWER_WINDOWS 1
/* #undef SDL_POWER_WINRT */
/* #undef SDL_POWER_MACOSX */
/* #undef SDL_POWER_UIKIT */
/* #undef SDL_POWER_HAIKU */
/* #undef SDL_POWER_EMSCRIPTEN */
/* #undef SDL_POWER_HARDWIRED */

/* Enable system filesystem support */
/* #undef SDL_FILESYSTEM_ANDROID */
/* #undef SDL_FILESYSTEM_HAIKU */
/* #undef SDL_FILESYSTEM_COCOA */
/* #undef SDL_FILESYSTEM_DUMMY */
/* #undef SDL_FILESYSTEM_UNIX */
#define SDL_FILESYSTEM_WINDOWS 1
/* #undef SDL_FILESYSTEM_EMSCRIPTEN */

/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
/* #undef SDL_ALTIVEC_BLITTERS */
/* #undef SDL_ARM_SIMD_BLITTERS */
/* #undef SDL_ARM_NEON_BLITTERS */

/* Enable dynamic libsamplerate support */
/* #undef SDL_LIBSAMPLERATE_DYNAMIC */

/* Platform specific definitions */
/* #undef SDL_IPHONE_KEYBOARD */
/* #undef SDL_IPHONE_LAUNCHSCREEN */

#if !defined(__WIN32__) && !defined(__WINRT__)
#  if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#  endif /* if (stdint.h isn't available) */
#else /* __WIN32__ */
#  if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
#    if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
#define HAVE_STDINT_H	1
#    elif defined(_MSC_VER)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#      ifndef _UINTPTR_T_DEFINED
#        ifdef  _WIN64
typedef unsigned __int64 uintptr_t;
#          else
typedef unsigned int uintptr_t;
#        endif
#define _UINTPTR_T_DEFINED
#      endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#      if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#      endif
#      if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#      endif
#    else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#      ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#      endif
typedef unsigned int uintptr_t;
#    endif /* __GNUC__ || _MSC_VER */
#  endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#endif /* __WIN32__ */

#endif /* SDL_config_h_ */


text:
// The MIT License (MIT)
//
// Copyright (c) 2015 Alexander Grebenyuk (github.com/kean).
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "DFImageManaging.h"
#import <UIKit/UIKit.h>

#if DF_IMAGE_MANAGER_GIF_AVAILABLE
#import <FLAnimatedImage/FLAnimatedImage.h>
#endif

@class DFCompositeImageTask;
@class DFImageRequest;
@class DFImageRequestOptions;
@class DFImageView;

/*! A class conforming to the DFImageViewDelegate protocol provides method for displaying fetched images and reacting to failures.
 */
@protocol DFImageViewDelegate <NSObject>

/*! Method gets called every time the completion block is called for the current image fetch task.
 @note Might be called multiple times depending on the number of image requests.
 */
- (void)imageView:(nonnull DFImageView *)imageView didCompleteImageTask:(nonnull DFImageTask *)imageTask withImage:(nullable UIImage *)image;

@optional
/*! Method gets called right after the image view receives image requests.
 @note This method call is always paired with a least one -imageView:didCompleteRequest:withImage:info call.
 */
- (void)imageView:(nonnull DFImageView *)imageView willStartFetchingImagesForRequests:(nonnull NSArray /*! DFImageRequest */ *)requests;

@end

#if DF_IMAGE_MANAGER_GIF_AVAILABLE
/*! An image view extends UIImageView class with image fetching functionality. It also adds other features like managing request priorities, retrying failed requests and more.
 @note The DFImageView is a FLAnimatedImageView subclass that support animated GIF playback. The playback is enabled by default and can be disabled using allowsGIFPlayback property. The DFImageView doesn't override any of the FLAnimatedImageView methods so should get the same experience as when using the FLAnimatedImageView class directly. The only addition is a new - (void)displayImage:(UIImage *)image method that supports DFAnimatedImage objects and will automatically start GIF playback when passed an object of that class.
 */
@interface DFImageView : FLAnimatedImageView
#else
/*! An image view extends UIImageView class with image fetching functionality. It also adds other features like managing request priorities, retrying failed requests and more.
 */
@interface DFImageView : UIImageView
#endif

/*! Image manager used by the image view. Set to the shared manager during initialization.
 */
@property (nonnull, nonatomic) id<DFImageManaging> imageManager;

/*! Image view delegate. By default delegate is set to the image view itself. The implementation displays fetched images with animation when necessary.
 */
@property (nullable, nonatomic, weak) id<DFImageViewDelegate> delegate;

/*! Image target size  used for image requests when target size is not present in -setImageWith... method that was called.. Returns current view pixel size when the value is CGSizeZero.
 */
@property (nonatomic) CGSize imageTargetSize;

/*! Image content mode used for image requests when content mode is not present in -setImageWith... method that was called. Default value is DFImageContentModeAspectFill.
 */
@property (nonatomic) DFImageContentMode imageContentMode;

/*! Image request options used for image requests when options are no present in -setImageWith... method that was called.
 */
@property (nullable, nonatomic) DFImageRequestOptions *imageRequestOptions;

/*! Automatically changes current request priority when image view gets added/removed from the window. Default value is NO.
 */
@property (nonatomic) BOOL managesRequestPriorities;

/*! If the value is YES image view will animate image changes when necessary. Default value is YES.
 */
@property (nonatomic) BOOL allowsAnimations;

/*! If the value YES image view will automatically retry image requests when necessary. Default value is YES.
 @note Image view is very careful with auto-retries. It will attempt automatic retry only when network reachability changes (and becomes reachable), image view is visible, current image request is completed and was failed with a network connection error. It also won't auto retry too frequently.
 */
@property (nonatomic) BOOL allowsAutoRetries;

#if DF_IMAGE_MANAGER_GIF_AVAILABLE
/*! If the value is YES the receiver will start a GIF playback as soon as the image is displayed. Default value is YES.
 */
@property (nonatomic) BOOL allowsGIFPlayback;

#endif

/*! Displays a given image. Automatically starts GIF playback when given a DFAnimatedImage object and when the GIF playback is enabled. The 'GIF' subspec should be installed to enable this feature.
 @note This method is always included in compilation even if the The 'GIF' subspec is not installed.
 */
- (void)displayImage:(nullable UIImage *)image;

/*! Performs any clean up necessary to prepare the view for use again. Removes currently displayed image and cancels all requests registered with a receiver.
 */
- (void)prepareForReuse;

#pragma mark - Fetching

/*! Returns current image fetch task.
 */
@property (nullable, nonatomic, readonly) DFCompositeImageTask *imageTask;

/*! Requests an image representation with a target size, image content mode and request options of the receiver. For more info see setImageWithRequests: method.
 */
- (void)setImageWithResource:(nullable id)resource;

/*! Requests an image representation for the specified resource. For more info see setImageWithRequests: method.
 */
- (void)setImageWithResource:(nullable id)resource targetSize:(CGSize)targetSize contentMode:(DFImageContentMode)contentMode options:(nullable DFImageRequestOptions *)options;

/*! Requests an image representation for the specified request. For more info see setImageWithRequests: method.
 */
- (void)setImageWithRequest:(nullable DFImageRequest *)request;

/*! Requests an image representation for each of the specified requests.
 @note When the method is called image view cancels current image fetch task and starts a new one with a given requests. For more info see DFCompositeImageTask.
 @note This method doesn't call -prepareForReuse in case you need to refresh image without invalidating previously displayed image.
 */
- (void)setImageWithRequests:(nullable NSArray /* DFImageRequest */ *)requests;

/*! Method gets called every time the completion block is called for the current image fetch task.
 @note Might be called multiple times depending on the number of image requests.
 */
- (void)didCompleteImageTask:(nonnull DFImageTask *)task withImage:(nullable UIImage *)image;

@end


text:
<?php

namespace League\CLImate\Util\Reader;

use League\CLImate\Tests\TestBase;

function fopen($resource, $mode)
{
    return TestBase::$functions->fopen($resource, $mode);
}

function fgets($resource, $length)
{
    return TestBase::$functions->fgets($resource, $length);
}

function fread($resource, $length)
{
    return TestBase::$functions->fread($resource, $length);
}

function stream_get_contents($resource)
{
    return TestBase::$functions->stream_get_contents($resource);
}


text:
#include "test.hpp"

#include <boost/typeof/std/string.hpp>
#include <boost/typeof/std/deque.hpp>
#include <boost/typeof/std/list.hpp>
#include <boost/typeof/std/queue.hpp>
#include <boost/typeof/std/stack.hpp>
#include <boost/typeof/std/vector.hpp>
#include <boost/typeof/std/map.hpp>
#include <boost/typeof/std/set.hpp>
#include <boost/typeof/std/bitset.hpp>
#include <boost/typeof/std/functional.hpp>
#include <boost/typeof/std/valarray.hpp>
#include <boost/typeof/std/locale.hpp>
#include <boost/typeof/std/iostream.hpp>
#include <boost/typeof/std/streambuf.hpp>
#include <boost/typeof/std/istream.hpp>
#include <boost/typeof/std/ostream.hpp>
#include <boost/typeof/std/sstream.hpp>
#include <boost/typeof/std/fstream.hpp>
#include <boost/typeof/std/iterator.hpp>

using namespace std;

// STL containers

BOOST_STATIC_ASSERT(boost::type_of::test<string>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<deque<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<list<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<queue<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<stack<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<vector<int> >::value);
BOOST_STATIC_ASSERT((boost::type_of::test<map<int, int> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<multimap<int, int> >::value));
BOOST_STATIC_ASSERT(boost::type_of::test<set<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<multiset<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<bitset<10> >::value);

// function objects

BOOST_STATIC_ASSERT((boost::type_of::test<unary_function<int, int> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<binary_function<int, int, int> >::value));
BOOST_STATIC_ASSERT(boost::type_of::test<plus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<minus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<multiplies<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<divides<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<modulus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<negate<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<equal_to<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<not_equal_to<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<greater<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<less<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<greater_equal<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<less_equal<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_and<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_or<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_not<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<unary_negate<negate<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binary_negate<less<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binder1st<less<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binder2nd<less<int> > >::value);

// valarray

BOOST_STATIC_ASSERT(boost::type_of::test<valarray<int> >::value);


text:
package org.apache.fluo.command;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.converters.IParameterSplitter;
import org.apache.fluo.api.config.FluoConfiguration;

public class ConfigOpts extends BaseOpts {

  public static class NullSplitter implements IParameterSplitter {
    @Override
    public List<String> split(String value) {
      return Collections.singletonList(value);
    }
  }

  @Parameter(names = "-o", splitter = NullSplitter.class,
      description = "Override configuration set in properties file. Expected format: -o <key>=<value>")
  private List<String> properties = new ArrayList<>();

  List<String> getProperties() {
    return properties;
  }

  void overrideFluoConfig(FluoConfiguration config) {
    for (String prop : getProperties()) {
      String[] propArgs = prop.split("=", 2);
      if (propArgs.length == 2) {
        String key = propArgs[0].trim();
        String value = propArgs[1].trim();
        if (key.isEmpty() || value.isEmpty()) {
          throw new IllegalArgumentException("Invalid command line -o option: " + prop);
        } else {
          config.setProperty(key, value);
        }
      } else {
        throw new IllegalArgumentException("Invalid command line -o option: " + prop);
      }
    }
  }

  public static ConfigOpts parse(String programName, String[] args) {
    ConfigOpts opts = new ConfigOpts();
    parse(programName, opts, args);
    return opts;
  }
}


text:
<?php
include('global/top.php');
if (empty($_SESSION['ep_user_id'])) {
	header("location:index.php");
}

$pagetitle = 'Suggested Sites';
include('global/header.php');

$urlgetarrayvalues = '';
foreach ($_GET as $parameter=>$parametervalue) {
	// aggregate all GET elements into single string
	$urlgetarrayvalues .= ($parametervalue=='') ? '' : $parameter . '=' . urlencode($parametervalue) . '&';
}

// if GET[action] is to edit or delete site
if (isset($_GET['action']) && ($_GET['action'] == 'add') && isset($_GET['site_id']) && is_numeric($_GET['site_id'])) {

	$selectsitequery = "SELECT * FROM site WHERE site_id=$_GET[site_id] LIMIT 1";
	$selectsite = mysqli_query($dbc, $selectsitequery);

	$sitedetails = mysqli_fetch_assoc($selectsite);
	// if action is to edit site
	// check if in pile - if yes, remove entry, else insert
	$checkquery = mysqli_query($dbc, "SELECT * FROM pile WHERE user_id='" . $_SESSION['ep_user_id'] . "' AND site_id='" . $_GET['site_id'] . "'");
	if (mysqli_num_rows($checkquery) == 0){
		mysqli_query($dbc, "INSERT INTO pile (user_id, site_id) VALUES ('" . $_SESSION['ep_user_id'] . "', '" . $_GET['site_id'] . "')");
	} else {
		mysqli_query($dbc, "DELETE FROM pile WHERE user_id='" . $_SESSION['ep_user_id'] . "' AND site_id='" . $_GET['site_id'] . "'");
	}
	$location = '?' . $urlgetarrayvalues . '&action=&site_id=';
	header("Location: $location");
}

if (isset($_GET['action']) && ($_GET['action'] == 'dismiss') && isset($_GET['suggestsite_id']) && is_numeric($_GET['suggestsite_id'])) {

	$selectsitequery = "SELECT * FROM suggestsite WHERE site_id='$_GET[suggestsite_id]' LIMIT 1";
	$selectsite = mysqli_query($dbc, $selectsitequery);

	$sitedetails = mysqli_fetch_assoc($selectsite);
	// check if in pile - if yes, remove entry, else insert
	$checkquery = mysqli_query($dbc, "SELECT * FROM pile WHERE user_id='" . $_SESSION['ep_user_id'] . "' AND site_id='" . $_GET['site_id'] . "'");
	mysqli_query($dbc, "DELETE FROM suggestsite WHERE suggestsite_id='" . $_GET['suggestsite_id'] . "'");
	$location = '?' . $urlgetarrayvalues . '&action=&suggestsite_id=';
	header("Location: $location");
}

include('includes/suggestions_list.php');
include('global/footer.php');
?>


text:
function Base() {
    var self = this;

    this.init = function() {

      var pathname = window.location.pathname;
      if (pathname == "/en/index" || pathname == "/de/index") {
        this.handleArticleFeed();
        this.setWaypoints();
      }
      this.initMap();
      this.handleMenu();
      this.viewOnTablet();
      this.initSlider();
      this.getCategoryHeight();
      this.handleFormMessage();
      this.createStickyElements();
      this.fadeOutSidebar();
      this.setTitleHeightOfThreePictureItem();
      this.toggleDropDown();
      this.sortArticleStream();
      this.addToCart();
      this.showPriceDetails();
      this.editQuantity();
    };

    this.sortArticleStream = function() {
      $('[data-category]').on('click', function(event) {

        var currentCategory = $(this).text();
        $("[data-current-category]").html(currentCategory);

        event.preventDefault();
        var categoryID = $(this).attr('data-category');
        $.ajax({
          url : '/article-stream/category/'+categoryID,
          success: function(articles) {
            $('[data-article-stream]').html($.parseHTML(articles));
          },
        })

      });
    }

    this.toggleDropDown = function() {
      $("[data-toggle-dropdown]").on('click', function() {
        $(this).next('[data-dropdown]').toggle();
      });
    }

  this.fadeOutSidebar = function() {
    var documentHeight = $(document).height();
    var contentHeight = $("main").height();

    if ( documentHeight > contentHeight ) {
      $(".fade-out-widgets").show();
    }
  }

  this.createStickyElements = function() {
    var stickyNavTop = $("header").height();

    var stickyNav = function(){
      var scrollTop = $(window).scrollTop();

      if (scrollTop > stickyNavTop) {
        $('.widget-area').addClass('sticky');
      } else {
        $('.widget-area').removeClass('sticky');
      }
    };
    stickyNav();
    $(window).scroll(function() {
      stickyNav();
    });
  }

  this.handleFormMessage = function(){
    $("[data-send-message]").on("click", function(){
      $("#contact_message").addClass("show");
    })
  }

  this.setTitleHeightOfThreePictureItem = function(){
    var maxHeight = -1;

    $('[data-image-title]').each(function() {
      maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
    });

    $('[data-image-title]').each(function() {
      $(this).height(maxHeight);
    });
  }

  this.initSlider = function () {
    $('.slider').slick({
      dots: true,
      fade: true,
      prevArrow: '<button type="button" class="slick-prev"></button>',
      nextArrow: '<button type="button" class="slick-next"></button>',
      adaptiveHeight: true
    });
  }

  this.getCategoryHeight = function() {
    var maxHeight = 0;

    $("[data-category-item]:lt(3)").each(function(){
      var thisH = $(this).innerHeight();
      if (thisH > maxHeight) { maxHeight = thisH; }
    });

    $("[data-category-item]:lt(3)").css("min-height", maxHeight);
  }

  this.viewport = function() {
      var e = window, a = 'inner';
      if (!('innerWidth' in window )) {
        a = 'client';
        e = document.documentElement || document.body;
      }
      return { width : e[ a+'Width' ] , height : e[ a+'Height' ] };
    };

    this.handleMenu = function(){
      $("[data-open-menu]").on("click", function(event){
        event.preventDefault();
        $("[data-menu-items]").toggleClass("open");
      });
      $("[data-menu-items]").on("click", function(){
        $(this).removeClass("open");
      });
    }

    this.initMap = function() {
      var mapOptions = {
        zoom: 12,
        scrollwheel: false,
        draggable: false,
        disableDefaultUI: true,
        center: new google.maps.LatLng(48.19898, 11.25217),
        styles: [
          {
            "featureType": "all",
            "elementType": "all",
            "stylers": [
              {
                "hue": "#ff0000"
              },
              {
                "saturation": -100
              },
              {
                "lightness": -30
              }
            ]
          },
          {
            "featureType": "all",
            "elementType": "labels.text.fill",
            "stylers": [
              {
                "color": "#ffffff"
              }
            ]
          },
          {
            "featureType": "all",
            "elementType": "labels.text.stroke",
            "stylers": [
              {
                "color": "#353535"
              }
            ]
          },
          {
            "featureType": "landscape",
            "elementType": "geometry",
            "stylers": [
              {
                "color": "#656565"
              }
            ]
          },
          {
            "featureType": "landscape.man_made",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "visibility": "on"
              },
              {
                "color": "#464646"
              }
            ]
          },
          {
            "featureType": "landscape.natural",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#464646"
              }
            ]
          },
          {
            "featureType": "poi",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#505050"
              }
            ]
          },
          {
            "featureType": "poi",
            "elementType": "geometry.stroke",
            "stylers": [
              {
                "color": "#808080"
              }
            ]
          },
          {
            "featureType": "poi.sports_complex",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "road",
            "elementType": "geometry",
            "stylers": [
              {
                "color": "#454545"
              }
            ]
          },
          {
            "featureType": "road.highway",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "road.highway.controlled_access",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "road.arterial",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "road.local",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "transit.line",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "transit.station.rail",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          },
          {
            "featureType": "water",
            "elementType": "geometry.fill",
            "stylers": [
              {
                "color": "#363535"
              }
            ]
          }
        ]
      };
      var mapElement = document.getElementById('map');
      if(mapElement) {
        var map = new google.maps.Map(mapElement, mapOptions);
        var marker = new google.maps.Marker({
          position: new google.maps.LatLng(48.19898, 11.25217),
          map: map,
          title: 'Acme Magazine, 82256 Fürstenfeldbruck',
          icon:  '/bundles/enhavoproject/img/map-marker.png'
        });
      }
    };

  this.handleArticleFeed = function() {
    var clickCount = 5;
    var article = $("[data-article-item]");
    var numberOfArticles = $("[data-article-item]").length;
    article.slice(clickCount).hide();

    $("[data-more-articles]").on("click", function (event) {
      event.preventDefault();
      if (clickCount < numberOfArticles) {
        clickCount = numberOfArticles;
        article.show();
        article.slice(clickCount).hide();
        $(this).html("Show less articles
 ");
      } else {
        clickCount = 5;
        article.slice(clickCount).fadeOut();
        $('html, body').animate({ scrollTop: ($("#article-feed").offset().top)}, 'slow');
        $(this).html("Show more articles
 ");
      }
    });

    // hide elements if articles less than 5
    if ($("[data-article-item]").length <= 5) {
      $(".load-articles").hide();
    }

    // hide elements if articles = 0
    if ($("[data-article-item]").length == 0 ) {
      $(".load-articles").hide();
      $("[data-article-section-subline]").html("Sorry, No Articles yet...")
      $(".mobile-app").css("top", "300px");
    }

  }

  this.sliceCategories = function() {
    var category = $("[data-category-item]");
    category.slice(3).hide();
  }

  this.setWaypoints = function() {
    new Waypoint({
      element: $('#article-feed').get(0),
      handler: function () {
        $(".mobile-app").addClass("animate");
      },
      offset: "40%"
    });
    new Waypoint({
      element: $('#image-text').get(0),
      handler: function () {
        $("#image-text .image").addClass("animate");
      },
      offset: "70%"
    });
  };

  this.viewOnTablet = function(){
    $("[data-tablet-btn]").on("click", function(){
      $("[data-tablet-view]").attr("src", window.location.pathname);
      $("#ipad-overlay").fadeIn();
      $("main, header, footer").addClass("blur");
      $("body").addClass("fixed");
    })
    $("[data-close-tabletview]").on("click", function(){
      $("#ipad-overlay").fadeOut();
      $("main, header, footer").removeClass("blur");
      $("body").removeClass("fixed");
    });
  }

  this.addToCart = function() {
    $('[data-submit-cart-add]').on('click', function() {
      $(this).addClass('added');
      $('[data-shopping-cart]').addClass("add-item");
      setTimeout(function() {
        $('[data-submit-cart-add]').removeClass('added');
        $('[data-shopping-cart]').addClass('update-value');
      }, 1200);
      setTimeout(function() {
        $('[data-shopping-cart]').removeClass('add-item');
        $('[data-shopping-cart]').removeClass('update-value');
      }, 3000);
    });
  }

  this.showPriceDetails = function() {
    $('[data-show-details]').on('click', function () {
      $(this).parent('.price-total').parent('tr').parent('thead').parent('.shop-product').find('[data-price-details]').toggle();
    });
  }

  this.editQuantity = function() {
    $('[data-quantity-value]').on('click', function() {
      // show input & select text
      $(this).prev('[data-quantity-input]').toggle();
      $(this).prev('[data-quantity-input] input').select();
      // show save button
      $(this).prev('[data-quantity-input]').find('[data-save-quantity]').toggle();
    });
    $('[data-save-quantity]').on('click', function() {
        $(this).parent('[data-quantity-input]').fadeOut();
        $(this).fadeOut();
    });

  }

}


text:
package com.example.android.foodrecipes.app.utils;

import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.BulletSpan;
import android.text.style.UnderlineSpan;

import java.util.ArrayList;
import java.util.List;

/**
 * Utility class to create bulleted lists from the {@code List<String>}.
 * If the line starts with one of {@link BulletListUtil#BAD_FIRST_SYMBOLS}, it removes this
 * symbol. Also if the line consists of the upper case words, it means this line is used as the
 * header and this header is underlined.
 *
 * @author Andrei Safronov
 */
public final class BulletListUtil {

	private BulletListUtil() {
	}

	/**
	 * If the line starts with one of this symbols, such symbol should be removed from that line
	 */
	private static final char[] BAD_FIRST_SYMBOLS = {'.', ',', ':', ';'};

	/**
	 * Returns the bulleted list based on the given {@code lines}.
	 * If one of lines starts with {@link BulletListUtil#BAD_FIRST_SYMBOLS}, then such symbol is
	 * removed from there (sometimes bad lines are received from the Food2Work).
	 * Also if line consists of the upper case words, then this line is used like a header and is
	 * underlined.
	 *
	 * @param leadingMargin In pixels, the space between the left edge of the bullet and the left
	 *                         edge of the text
	 * @param lines List of strings. Each string will be a separate item in the bulleted list
	 * @return The bulleted list based on the given {@code lines}
	 */
	public static CharSequence makeBulletList(List<String> lines, int leadingMargin) {
		List<Spanned> spanned = new ArrayList<>(lines.size());
		for (String line : lines) {
			if (!line.trim().isEmpty()) {
				Spanned spannedLine = Html.fromHtml(removeBadFirstCharacters(line.trim()));
				spanned.add(spannedLine);
			}
		}

		SpannableStringBuilder sb = new SpannableStringBuilder();
		for (int i = 0; i < spanned.size(); i++) {
			CharSequence line = spanned.get(i) + (i < spanned.size() - 1 ? "\n" : "");
			boolean underlineNeeded = isUpperCase(line);
			Spannable spannable = new SpannableString(line);
			if (underlineNeeded) {
				spannable.setSpan(new UnderlineSpan(), 0, spannable.length(),
						Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
			} else {
				spannable.setSpan(new BulletSpan(leadingMargin), 0, spannable.length(),
						Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
			}
			sb.append(spannable);
		}
		return sb;
	}

	private static String removeBadFirstCharacters(String line) {
		boolean shouldRemove = false;
		char first = line.charAt(0);
		for (char badFirstSymbol : BAD_FIRST_SYMBOLS) {
			if (first == badFirstSymbol) {
				shouldRemove = true;
				break;
			}
		}

		return shouldRemove ? line.substring(1) : line;
	}

	private static boolean isUpperCase(CharSequence sequence) {
		for (int i = 0; i < sequence.length(); i++) {
			if (Character.isLowerCase(sequence.charAt(i)))
				return false;
		}

		return true;
	}
}


text:
<!doctype html>

        <meta charset="utf-8"/>
	    <title>{{TITLE}}</title>
	    <link href="../../third-party/google-code-prettify/prettify-CppCoverage.css" type="text/css" rel="stylesheet" />

{{SOURCE_WARNING_MESSAGE}}

{{CODE}}


text:
package org.trustedanalytics.user.common;

import java.util.UUID;

public class UuidFormatValidator implements UuidValidator {
    @Override
    public void validate(String uuidString) {
        try {
            UUID.fromString(uuidString);
        } catch(Exception e) {
            throw new WrongUuidFormatException("Wrong uuid format exception", e);
        }
    }

}


text:
package com.netflix.spinnaker.cats.agent;

import com.netflix.spinnaker.cats.cache.CacheData;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * An immutable CacheResult.
 */
public class DefaultCacheResult implements CacheResult {
    private final Map<String, Collection<CacheData>> cacheResults;
    private final Map<String, Collection<String>> evictions;

    public DefaultCacheResult(Map<String, Collection<CacheData>> cacheResults) {
      this(cacheResults, new HashMap<>());
    }
    public DefaultCacheResult(Map<String, Collection<CacheData>> cacheResults, Map<String, Collection<String>> evictions) {
        this.cacheResults = cacheResults;
        this.evictions = evictions;
    }

    @Override
    public Map<String, Collection<CacheData>> getCacheResults() {
        return cacheResults;
    }

    @Override
    public Map<String, Collection<String>> getEvictions() {
        return evictions;
    }
}


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

namespace Sidekick.Windows.ViewModels.SpacedRepetition
{
  using System.Threading.Tasks;

  using Catel.IoC;
  using Catel.Messaging;
  using Catel.MVVM;

  using Orc.FilterBuilder.Models;

  using Sidekick.MVVM.ViewModels;

  ///
  ///   View Model for main browser view. Handles navigation between the different parts of
  ///   browser (display content, add queries, ...)
  ///
  /// <seealso cref="Sidekick.MVVM.ViewModels.MainContentViewModelBase" />
  [InterestedIn(typeof(BrowserQueryViewerViewModel))]
  [InterestedIn(typeof(BrowserQueryBuilderViewModel))]
  public class BrowserViewModel : MainContentViewModelBase
  {
    #region Fields

    private readonly BrowserQueryViewerViewModel _browserQueryViewerViewModel;

    #endregion

    #region Constructors

    /// Initializes a new instance of the <see cref="BrowserViewModel" /> class.
    /// <param name="mediator">The mediator.</param>
    public BrowserViewModel(IMessageMediator mediator)
    {
      _browserQueryViewerViewModel =
        TypeFactory.Default.CreateInstance<BrowserQueryViewerViewModel>();

      CurrentModel = _browserQueryViewerViewModel;

      mediator.Register<SimpleMessage>(this, OnMessageReceived);
    }

    #endregion

    #region Properties

    /// Currently displayed ViewModel.
    public ViewModelBase CurrentModel { get; set; }

    #endregion

    #region Methods

    /// <inheritdoc />
    /// Handles commands from child ViewModels (Add query, ...)
    protected override void OnViewModelCommandExecuted(
      IViewModel viewModel, ICatelCommand command, object commandParameter)
    {
      switch (command.Tag as string)
      {
        case "AddQuery":
          ShowQueryBuilder();
          break;

        case "EditQuery":
          ShowQueryBuilder(commandParameter as FilterScheme);
          break;
      }
    }

    ///
    ///   Closes this instance. Always called after the
    ///   <see cref="M:Catel.MVVM.ViewModelBase.Cancel" /> of
    ///   <see cref="M:Catel.MVVM.ViewModelBase.Save" /> method.
    ///
    /// <returns></returns>
    protected override Task CloseAsync()
    {
      return _browserQueryViewerViewModel.CloseViewModelAsync(null);
    }

    private void OnMessageReceived(SimpleMessage msg)
    {
      switch (msg.Data)
      {
        case BrowserQueryBuilderViewModel.MessageDone:
          CurrentModel = _browserQueryViewerViewModel;
          break;
      }
    }

    private void ShowQueryBuilder(FilterScheme filterScheme = null)
    {
      CurrentModel = filterScheme == null
                       ? TypeFactory.Default.CreateInstance<BrowserQueryBuilderViewModel>()
                       : TypeFactory.Default.CreateInstanceWithParametersAndAutoCompletion(
                                      typeof(BrowserQueryBuilderViewModel), filterScheme) as
                           BrowserQueryBuilderViewModel;
    }

    #endregion
  }
}


text:
HappyMessages
=============

HappyMessages is a simple Rails plugin to make dealing with displaying messages
to the user easier. Instead of setting `flash[:notice]` or whatever, you can
call `add_notice` or `add_error` with your message, like so:

    add_notice "Your mother just called."
    add_error "I drink your milkshake.", :now => true

Notice the one option, `:now`. This indicates to show the message in the
immediate page render, not on the next render. It doesn't actually set
`flash[:now]`, but fulfills much the same purpose.

To activate HappyMessages, add this line to ApplicationController:

    include HappyMessages

I could have done that in `init.rb`, but I didn't want to be presumptuous.

To display messages, add this in your view:

    render_messages

Copyright (c) 2010 Clinton R. Nixon of Viget Labs, released under the MIT license


text:
{-# LANGUAGE DataKinds     #-}
{-# LANGUAGE TypeOperators #-}

module Servant.Crud where

import Data.Text (Text)
import Servant

-- | A `PUT` request against `/:file` with a `JSON`-encoded request body
type PutFile =
    Capture "file" FilePath :> ReqBody '[JSON] Text :> Put '[JSON] ()

-- | A `GET` request against `/:file` with a `JSON`-encoded response body
type GetFile =
    Capture "file" FilePath :> Get '[JSON] Text

-- | A `DELETE` request against `/:file`
type DeleteFile =
    Capture "file" FilePath :> Delete '[JSON] ()

{-| The type of our REST API

    The server uses this to ensure that each API endpoint's handler has the
    correct type

    The client uses this to auto-generate API bindings
-}
type API =   PutFile
        :<|> GetFile
        :<|> DeleteFile


text:
/**
* Sort List.
* https://oj.leetcode.com/problems/sort-list/
* Sort a linked list in O(n log n) time using constant space complexity.
* In-place Merge-sort or Quick-sort?
*/

#ifndef SOLUTIONS_SORT_LIST_H_
#define SOLUTIONS_SORT_LIST_H_

#include <utility>

#include "../util/util_common.h"

class SortList {
public:
  ListNode* sortList(ListNode *head);
private:
  typedef std::pair<ListNode*, ListNode*> SplitListPair;
  SplitListPair divideList(ListNode* head);
  ListNode* mergeList(ListNode* head1, ListNode* head2);
};

#endif  // SOLUTIONS_SORT_LIST_H_