text:
/*!
    @header

    Thread Safety Information

    All functions in this header are thread safe unless otherwise specified.
*/

#ifndef __CTPARAGRAPHSTYLE__
#define __CTPARAGRAPHSTYLE__

#include <CoreText/CTDefines.h>
#include <CoreFoundation/CFArray.h>
#include <CoreGraphics/CGBase.h>

CF_IMPLICIT_BRIDGING_ENABLED
CF_EXTERN_C_BEGIN
CF_ASSUME_NONNULL_BEGIN

/* --------------------------------------------------------------------------- */
/* Paragraph Style Types */
/* --------------------------------------------------------------------------- */

typedef const struct CF_RELATED_TYPE(NSParagraphStyle,,) __CTParagraphStyle * CTParagraphStyleRef;

/*!
    @function   CTParagraphStyleGetTypeID
    @abstract   Returns the CFType of the paragraph style object
*/

CFTypeID CTParagraphStyleGetTypeID( void ) CT_AVAILABLE(10_5, 3_2);

/* --------------------------------------------------------------------------- */
/* Paragraph Style Values */
/* --------------------------------------------------------------------------- */

/*!
    @enum       CTTextAlignment
    @abstract   These constants specify text alignment.

    @constant   kCTTextAlignmentLeft
                Text is visually left-aligned.

    @constant   kCTTextAlignmentRight
                Text is visually right-aligned.

    @constant   kCTTextAlignmentCenter
                Text is visually center-aligned.

    @constant   kCTTextAlignmentJustified
                Text is fully justified. The last line in a paragraph is
                naturally aligned.

    @constant   kCTTextAlignmentNatural
                Use the natural alignment of the text's script.
*/

typedef CF_ENUM(uint8_t, CTTextAlignment) {
    kCTTextAlignmentLeft      CT_ENUM_AVAILABLE(10_8, 6_0) = 0,
    kCTTextAlignmentRight     CT_ENUM_AVAILABLE(10_8, 6_0) = 1,
    kCTTextAlignmentCenter    CT_ENUM_AVAILABLE(10_8, 6_0) = 2,
    kCTTextAlignmentJustified CT_ENUM_AVAILABLE(10_8, 6_0) = 3,
    kCTTextAlignmentNatural   CT_ENUM_AVAILABLE(10_8, 6_0) = 4,

    kCTLeftTextAlignment CT_ENUM_DEPRECATED(10_5, 10_11, 3_2, 9_0) = kCTTextAlignmentLeft,
    kCTRightTextAlignment CT_ENUM_DEPRECATED(10_5, 10_11, 3_2, 9_0) = kCTTextAlignmentRight,
    kCTCenterTextAlignment CT_ENUM_DEPRECATED(10_5, 10_11, 3_2, 9_0) = kCTTextAlignmentCenter,
    kCTJustifiedTextAlignment CT_ENUM_DEPRECATED(10_5, 10_11, 3_2, 9_0) = kCTTextAlignmentJustified,
    kCTNaturalTextAlignment CT_ENUM_DEPRECATED(10_5, 10_11, 3_2, 9_0) = kCTTextAlignmentNatural
};

/*!
    @enum       CTLineBreakMode
    @abstract   These constants specify what happens when a line is too long for
                its frame.

    @constant   kCTLineBreakByWordWrapping
                Wrapping occurs at word boundaries, unless the word itself doesn't
                fit on a single line.

    @constant   kCTLineBreakByCharWrapping
                Wrapping occurs before the first character that doesn't fit.

    @constant   kCTLineBreakByClipping
                Lines are simply not drawn past the edge of the frame.

    @constant   kCTLineBreakByTruncatingHead
                Each line is displayed so that the end fits in the frame and the
                missing text is indicated by some kind of ellipsis glyph.

    @constant   kCTLineBreakByTruncatingTail
                Each line is displayed so that the beginning fits in the
                container and the missing text is indicated by some kind of
                ellipsis glyph.

    @constant   kCTLineBreakByTruncatingMiddle
                Each line is displayed so that the beginning and end fit in the
                container and the missing text is indicated by some kind of
                ellipsis glyph in the middle.
*/

typedef CF_ENUM(uint8_t, CTLineBreakMode) {
    kCTLineBreakByWordWrapping = 0,
    kCTLineBreakByCharWrapping = 1,
    kCTLineBreakByClipping = 2,
    kCTLineBreakByTruncatingHead = 3,
    kCTLineBreakByTruncatingTail = 4,
    kCTLineBreakByTruncatingMiddle = 5
};

/*!
    @enum       CTWritingDirection
    @abstract   These constants specify the writing direction

    @constant   kCTWritingDirectionNatural
                The writing direction is algorithmically determined
                using the Unicode Bidirectional Algorithm rules P2 and P3.

    @constant   kCTWritingDirectionLeftToRight
                The writing direction is left to right.

    @constant   kCTWritingDirectionRightToLeft
                The writing direction is right to left.
*/

typedef CF_ENUM(int8_t, CTWritingDirection) {
    kCTWritingDirectionNatural = -1,
    kCTWritingDirectionLeftToRight = 0,
    kCTWritingDirectionRightToLeft = 1
};

/*!
    @enum       CTParagraphStyleSpecifier
    @abstract   These constants are used to query and modify the CTParagraphStyle
                object.

    @discussion Each specifier has a type and a default value associated with it.
                The type must always be observed when setting or fetching the
                value from the CTParagraphStyle object. In addition, some
                specifiers affect the behavior of both the framesetter and
                the typesetter, and others only affect the behavior of the
                framesetter; this is also noted below.

    @constant   kCTParagraphStyleSpecifierAlignment
                The text alignment. Natural text alignment is realized as
                left or right alignment, depending on the line sweep direction
                of the first script contained in the paragraph.

                Type: CTTextAlignment
                Default: kCTNaturalTextAlignment
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierFirstLineHeadIndent
                The distance in points from the leading margin of a frame to
                the beginning of the paragraph's first line. This value is always
                nonnegative.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierHeadIndent
                The distance in points from the leading margin of a text
                container to the beginning of lines other than the first.
                This value is always nonnegative.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierTailIndent
                The distance in points from the margin of a frame to the end of
                lines. If positive, this value is the distance from the leading
                margin (for example, the left margin in left-to-right text).
                If 0 or negative, it's the distance from the trailing margin.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierTabStops
                The CTTextTab objects, sorted by location, that define the tab
                stops for the paragraph style.

                Type: CFArray of CTTextTabRef
                Default: 12 left-aligned tabs, spaced by 28.0 points
                Application: CTFramesetter, CTTypesetter

    @constant   kCTParagraphStyleSpecifierDefaultTabInterval
                The document-wide default tab interval. Tabs after the last
                specified by kCTParagraphStyleSpecifierTabStops are placed at
                integer multiples of this distance (if positive).

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter, CTTypesetter

    @constant   kCTParagraphStyleSpecifierLineBreakMode
                The mode that should be used to break lines when laying out
                the paragraph's text.

                Type: CTLineBreakMode
                Default: kCTLineBreakByWordWrapping
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierLineHeightMultiple
                The line height multiple. The natural line height of the
                receiver is multiplied by this factor (if positive) before
                being constrained by minimum and maximum line height.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierMaximumLineHeight
                The maximum height that any line in the frame will occupy,
                regardless of the font size or size of any attached graphic.
                Glyphs and graphics exceeding this height will overlap
                neighboring lines. A maximum height of 0 implies
                no line height limit. This value is always nonnegative.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierMinimumLineHeight
                The minimum height that any line in the frame will occupy,
                regardless of the font size or size of any attached graphic.
                This value is always nonnegative.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierLineSpacing
                Deprecated.
                Use kCTParagraphStyleSpecifierMaximumLineSpacing, kCTParagraphStyleSpecifierMinimumLineSpacing,
                and kCTParagraphStyleSpecifierLineSpacingAdjustment to control
                space between lines.

    @constant   kCTParagraphStyleSpecifierParagraphSpacing
                The space added at the end of the paragraph to separate it from
                the following paragraph. This value is always nonnegative and is
                determined by adding the previous paragraph's
                kCTParagraphStyleSpecifierParagraphSpacing setting and the
                current paragraph's kCTParagraphStyleSpecifierParagraphSpacingBefore
                setting.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierParagraphSpacingBefore
                The distance between the paragraph's top and the beginning of
                its text content.

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierBaseWritingDirection
                The base writing direction of the lines.

                Type: CTWritingDirection
                Default: kCTWritingDirectionNatural
                Application: CTFramesetter, CTTypesetter

    @constant   kCTParagraphStyleSpecifierMaximumLineSpacing
                The maximum space in points between lines within the paragraph
                (commonly known as leading).

                Type: CGFloat
                Default: some large number.
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierMinimumLineSpacing
                The minimum space in points between lines within the paragraph
                (commonly known as leading).

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierLineSpacingAdjustment
                The space in points added between lines within the paragraph
                (commonly known as leading).

                Type: CGFloat
                Default: 0.0
                Application: CTFramesetter

    @constant   kCTParagraphStyleSpecifierLineBoundsOptions
                The options controlling the alignment of the line edges with
                the leading and trailing margins.

                Type: CTLineBoundsOptions
                Default: 0 (no options)
                Application: CTTypesetter
*/

typedef CF_ENUM(uint32_t, CTParagraphStyleSpecifier) {
    kCTParagraphStyleSpecifierAlignment = 0,
    kCTParagraphStyleSpecifierFirstLineHeadIndent = 1,
    kCTParagraphStyleSpecifierHeadIndent = 2,
    kCTParagraphStyleSpecifierTailIndent = 3,
    kCTParagraphStyleSpecifierTabStops = 4,
    kCTParagraphStyleSpecifierDefaultTabInterval = 5,
    kCTParagraphStyleSpecifierLineBreakMode = 6,
    kCTParagraphStyleSpecifierLineHeightMultiple = 7,
    kCTParagraphStyleSpecifierMaximumLineHeight = 8,
    kCTParagraphStyleSpecifierMinimumLineHeight = 9,
    kCTParagraphStyleSpecifierLineSpacing = 10,			/* deprecated */
    kCTParagraphStyleSpecifierParagraphSpacing = 11,
    kCTParagraphStyleSpecifierParagraphSpacingBefore = 12,
    kCTParagraphStyleSpecifierBaseWritingDirection = 13,
    kCTParagraphStyleSpecifierMaximumLineSpacing = 14,
    kCTParagraphStyleSpecifierMinimumLineSpacing = 15,
    kCTParagraphStyleSpecifierLineSpacingAdjustment = 16,
    kCTParagraphStyleSpecifierLineBoundsOptions = 17,

    kCTParagraphStyleSpecifierCount
};

/*!
    @struct     CTParagraphStyleSetting
    @abstract   This structure is used to alter the paragraph style.

    @field      spec
                The specifier of the setting.

    @field      valueSize
                The size of the value pointed to by the "value" field. This
                must match the size of the value required by the
                CTParagraphStyleSpecifier set in the "spec" field.

    @field      value
                A reference to the value of the setting specified by the
                "spec" field. The value must be in the proper range for the
                spec value. The value must also be at least valueSize.
*/
typedef struct CTParagraphStyleSetting
{
    CTParagraphStyleSpecifier spec;
    size_t valueSize;
    const void * value;

} CTParagraphStyleSetting;

/* --------------------------------------------------------------------------- */
/* Paragraph Style Creation */
/* --------------------------------------------------------------------------- */

/*!
    @function   CTParagraphStyleCreate
    @abstract   Creates an immutable paragraph style.

    @discussion Using this function is the easiest and most efficient way to
                create a paragraph style. Paragraph styles should be kept
                immutable for totally lock-free operation.

                If an invalid paragraph style setting specifier is passed into
                the "settings" parameter, nothing bad will happen but just don't
                expect to be able to query for this value. This is to allow
                backwards compatibility with style setting specifiers that may
                be introduced in future versions.

    @param      settings
                The settings that you wish to pre-load the paragraph style
                with. If you wish to specify the default set of settings,
                then this parameter may be set to NULL.

    @param      settingCount
                The number of settings that you have specified in the
                "settings" parameter. This must be greater than or equal
                to zero.

    @result     If the paragraph style creation was successful, this function
                will return a valid reference to an immutable CTParagraphStyle
                object. Otherwise, this function will return NULL.
*/

CTParagraphStyleRef CTParagraphStyleCreate(
    const CTParagraphStyleSetting * __nullable settings,
    size_t settingCount ) CT_AVAILABLE(10_5, 3_2);

/*!
    @function   CTParagraphStyleCreateCopy
    @abstract   Creates an immutable copy of a paragraph style.

    @param      paragraphStyle
                The style that you wish to copy.

    @result     If the "paragraphStyle" reference is valid, then this
                function will return valid reference to an immutable
                CTParagraphStyle object that is a copy of the one passed into
                "paragraphStyle".
*/

CTParagraphStyleRef CTParagraphStyleCreateCopy(
    CTParagraphStyleRef paragraphStyle ) CT_AVAILABLE(10_5, 3_2);

/* --------------------------------------------------------------------------- */
/* Paragraph Style Access */
/* --------------------------------------------------------------------------- */

/*!
    @function   CTParagraphStyleGetValueForSpecifier
    @abstract   Obtains the current value for a single setting specifier.

    @discussion This function will return the current value of the specifier
                whether or not the user had actually set it. If the user has
                not set it, this function will return the default value.

                If an invalid paragraph style setting specifier is passed into
                the "spec" parameter, nothing bad will happen and the buffer
                value will simply be zeroed out. This is to allow backwards
                compatibility with style setting specifier that may be introduced
                in future versions.

    @param      paragraphStyle
                The paragraph style that you wish to get the value from.

    @param      spec
                The setting specifier that you want to get the value for.

    @param      valueBufferSize
                The size of the buffer pointed to by the "valueBuffer" parameter.
                This value must be at least as large as the size the required by
                the CTParagraphSpecifier value set in the "spec" parameter.

    @param      valueBuffer
                The buffer where the requested setting value will be written
                upon successful completion. The buffer's size needs to be at least
                as large as the value passed into "valueBufferSize".

    @result     This function will return "true" if the valueBuffer had been
                successfully filled. Otherwise, this function will return false,
                indicating that one or more of the parameters is not valid.
*/

bool CTParagraphStyleGetValueForSpecifier(
    CTParagraphStyleRef paragraphStyle,
    CTParagraphStyleSpecifier spec,
    size_t valueBufferSize,
    void * valueBuffer ) CT_AVAILABLE(10_5, 3_2);

CF_ASSUME_NONNULL_END
CF_EXTERN_C_END
CF_IMPLICIT_BRIDGING_DISABLED

#endif


text:
import os

from ingenico.connect.sdk.factory import Factory
from ingenico.connect.sdk.domain.definitions.address import Address
from ingenico.connect.sdk.domain.definitions.card_without_cvv import CardWithoutCvv
from ingenico.connect.sdk.domain.definitions.company_information import CompanyInformation
from ingenico.connect.sdk.domain.token.update_token_request import UpdateTokenRequest
from ingenico.connect.sdk.domain.token.definitions.customer_token import CustomerToken
from ingenico.connect.sdk.domain.token.definitions.personal_information_token import PersonalInformationToken
from ingenico.connect.sdk.domain.token.definitions.personal_name_token import PersonalNameToken
from ingenico.connect.sdk.domain.token.definitions.token_card import TokenCard
from ingenico.connect.sdk.domain.token.definitions.token_card_data import TokenCardData

class UpdateTokenExample(object):

    def example(self):
        with self.__get_client() as client:
            billing_address = Address()
            billing_address.additional_info = "b"
            billing_address.city = "Monument Valley"
            billing_address.country_code = "US"
            billing_address.house_number = "13"
            billing_address.state = "Utah"
            billing_address.street = "Desertroad"
            billing_address.zip = "84536"

            company_information = CompanyInformation()
            company_information.name = "Acme Labs"

            name = PersonalNameToken()
            name.first_name = "Wile"
            name.surname = "Coyote"
            name.surname_prefix = "E."

            personal_information = PersonalInformationToken()
            personal_information.name = name

            customer = CustomerToken()
            customer.billing_address = billing_address
            customer.company_information = company_information
            customer.merchant_customer_id = "1234"
            customer.personal_information = personal_information

            card_without_cvv = CardWithoutCvv()
            card_without_cvv.card_number = "4567350000427977"
            card_without_cvv.cardholder_name = "Wile E. Coyote"
            card_without_cvv.expiry_date = "1299"
            card_without_cvv.issue_number = "12"

            data = TokenCardData()
            data.card_without_cvv = card_without_cvv

            card = TokenCard()
            card.customer = customer
            card.data = data

            body = UpdateTokenRequest()
            body.card = card
            body.payment_product_id = 1

            client.merchant("merchantId").tokens().update("tokenId", body)

    def __get_client(self):
        api_key_id = os.getenv("connect.api.apiKeyId", "someKey")
        secret_api_key = os.getenv("connect.api.secretApiKey", "someSecret")
        configuration_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                               '../../example_configuration.ini'))
        return Factory.create_client_from_file(configuration_file_name=configuration_file_name,
                                               api_key_id=api_key_id, secret_api_key=secret_api_key)

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

  <meta charset="UTF-8" />
  <title>Schema checker</title>

  <meta name="description" content="Checks if the pages on a site have schemas defined at schema.org">
  <meta name="author" content="Mudit Ameta">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href='//fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="../public/css/normalize.css">
  <link rel="stylesheet" href="../public/css/skeleton.css">
  <link rel="stylesheet" href="../public/css/custom.css">

Check your schema moron

          <input class="u-full-width" name="" type="text" value="" placeholder="Enter url" id="search-box" />
          <button class="button-primary" id="search">Search</button>

          <svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44" stroke="#fff">
            <g fill="none" fill-rule="evenodd" stroke-width="2">
              <circle cx="22" cy="22" r="19.9971">
                <animate attributeName="r" begin="0s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" />
                <animate attributeName="stroke-opacity" begin="0s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite" />
              </circle>
              <circle cx="22" cy="22" r="18.0909">
                <animate attributeName="r" begin="-0.9s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" />
                <animate attributeName="stroke-opacity" begin="-0.9s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite" />
              </circle>
            </g>
          </svg>


text:
package bookshop2.seller.incoming.orderBooks;

import static javax.ejb.ConcurrencyManagementType.BEAN;
import static javax.ejb.TransactionAttributeType.REQUIRED;
import static javax.ejb.TransactionManagementType.CONTAINER;

import javax.annotation.Resource;
import javax.ejb.AccessTimeout;
import javax.ejb.Asynchronous;
import javax.ejb.ConcurrencyManagement;
import javax.ejb.Local;
import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionManagement;
import javax.inject.Inject;
import javax.interceptor.Interceptors;
import javax.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aries.common.AbstractMessage;
import org.aries.runtime.RequestContext;
import org.aries.tx.service.AbstractServiceHandler;
import org.aries.tx.service.ServiceHandlerInterceptor;
import org.aries.util.ExceptionUtil;

import bookshop2.BooksAvailableMessage;
import bookshop2.seller.SellerContext;
import bookshop2.seller.SellerProcess;
import bookshop2.seller.data.bookCache.BookCacheManager;

@Stateful
@Local(BooksAvailableHandler.class)
@ConcurrencyManagement(BEAN)
@TransactionManagement(CONTAINER)
@Interceptors(ServiceHandlerInterceptor.class)
public class BooksAvailableHandlerImpl extends AbstractServiceHandler implements BooksAvailableHandler {

	private static final Log log = LogFactory.getLog(BooksAvailableHandlerImpl.class);

	@Inject
	private RequestContext requestContext;

	@Inject
	private SellerProcess sellerProcess;

	@Inject
	private BookCacheManager bookCacheManager;

	@Resource
	private TransactionSynchronizationRegistry transactionSynchronizationRegistry;

	public String getName() {
		return "BooksAvailable";
	}

	public String getDomain() {
		return "bookshop2.seller";
	}

	public boolean prepare(String transactionId) {
		return bookCacheManager.prepare(transactionId);
	}

	public void commit(String transactionId) {
		bookCacheManager.commit(transactionId);
	}

	public void rollback(String transactionId) {
		bookCacheManager.rollback(transactionId);
	}

	protected SellerContext getContext(AbstractMessage message) {
		return getContext(getCorrelationId(message));
	}

	protected SellerContext getContext(String correlationId) {
		requestContext.setCorrelationId(correlationId);
		return SellerContext.getInstance(correlationId);
	}

	@Override
	@Asynchronous
	@AccessTimeout(value = 60000)
	@TransactionAttribute(REQUIRED)
	public void booksAvailable(BooksAvailableMessage booksAvailableMessage) {
		String correlationId = getCorrelationId(booksAvailableMessage);
		log.info("#### [seller]: BooksAvailable response received: "+correlationId);
		SellerContext sellerContext = getContext(correlationId);

		try {
			sellerContext.validate(booksAvailableMessage);
			sellerContext.fire_BooksAvailable_response_received();

			if (sellerContext.isGlobalTransactionActive())
				enrollTransaction("bookReservation", sellerContext);

			sellerProcess.handle_BooksAvailable_response(booksAvailableMessage);

		} catch (Throwable e) {
			log.error("Error", e);
			e = ExceptionUtil.getRootCause(e);
			transactionSynchronizationRegistry.setRollbackOnly();
			sellerContext.fire_BooksAvailable_incoming_response_aborted(e);
		}
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
    android:background="@color/tabs_background"
    android:elevation="@dimen/elevation_normal">

    <TextView
        android:id = "@+id/tvTabTitle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="left"
        android:fontFamily="Roboto Italic"
        android:textColor="@color/text_black"
        android:textSize="@dimen/text_size_toolbar"
        android:elevation="@dimen/elevation_normal"
        android:text = "@string/sample_text_toolbar"
        android:focusableInTouchMode="false" />

</android.support.v7.widget.Toolbar>


text:
#import "wax_instance.h"
#import "wax_class.h"
#import "wax.h"
#import "wax_helpers.h"

#import "lauxlib.h"

static int __index(lua_State *L);
static int __newindex(lua_State *L);
static int __gc(lua_State *L);
static int __tostring(lua_State *L);
static int __eq(lua_State *L);

static int methods(lua_State *L);

static int methodClosure(lua_State *L);
static int superMethodClosure(lua_State *L);
static int customInitMethodClosure(lua_State *L);

static BOOL overrideMethod(lua_State *L, wax_instance_userdata *instanceUserdata);
static int pcallUserdata(lua_State *L, id self, SEL selector, va_list args);

static const struct luaL_Reg metaFunctions[] = {
    {"__index", __index},
    {"__newindex", __newindex},
    {"__gc", __gc},
    {"__tostring", __tostring},
    {"__eq", __eq},
    {NULL, NULL}
};

static const struct luaL_Reg functions[] = {
    {"methods", methods},
    {NULL, NULL}
};

int luaopen_wax_instance(lua_State *L) {
    BEGIN_STACK_MODIFY(L);

    luaL_newmetatable(L, WAX_INSTANCE_METATABLE_NAME);
    luaL_register(L, NULL, metaFunctions);
    luaL_register(L, WAX_INSTANCE_METATABLE_NAME, functions);

    END_STACK_MODIFY(L, 0)

    return 1;
}

#pragma mark Instance Utils
#pragma mark -------------------

// Creates userdata object for obj-c instance/class and pushes it onto the stack
wax_instance_userdata *wax_instance_create(lua_State *L, id instance, BOOL isClass) {
    BEGIN_STACK_MODIFY(L)

    // Does user data already exist?
    wax_instance_pushUserdata(L, instance);

    if (lua_isnil(L, -1)) {
        // wax_log(LOG_GC, @"Creating %@ for %@(%p)", isClass ? @"class" : @"instance", [instance class], instance);
        lua_pop(L, 1); // pop nil stack
    }
    else {
        // wax_log(LOG_GC, @"Found existing userdata %@ for %@(%p)", isClass ? @"class" : @"instance", [instance class], instance);
        return lua_touserdata(L, -1);
    }

    size_t nbytes = sizeof(wax_instance_userdata);
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)lua_newuserdata(L, nbytes);
    instanceUserdata->instance = instance;
    instanceUserdata->isClass = isClass;
    instanceUserdata->isSuper = nil;
	instanceUserdata->actAsSuper = NO;

    if (!isClass) {
        // wax_log(LOG_GC, @"Retaining %@ for %@(%p -> %p)", isClass ? @"class" : @"instance", [instance class], instance, instanceUserdata);
        [instanceUserdata->instance retain];
    }

    // set the metatable
    luaL_getmetatable(L, WAX_INSTANCE_METATABLE_NAME);
    lua_setmetatable(L, -2);

    // give it a nice clean environment
    lua_newtable(L);
    lua_setfenv(L, -2);

    wax_instance_pushUserdataTable(L);

    // register the userdata table in the metatable (so we can access it from obj-c)
    //wax_log(LOG_GC, @"Storing reference of %@ to userdata table %@(%p -> %p)", isClass ? @"class" : @"instance", [instance class], instance, instanceUserdata);
    lua_pushlightuserdata(L, instanceUserdata->instance);
    lua_pushvalue(L, -3); // Push userdata
    lua_rawset(L, -3);

    lua_pop(L, 1); // Pop off userdata table

    wax_instance_pushStrongUserdataTable(L);
    lua_pushlightuserdata(L, instanceUserdata->instance);
    lua_pushvalue(L, -3); // Push userdata
    lua_rawset(L, -3);

    //wax_log(LOG_GC, @"Storing reference to strong userdata table %@(%p -> %p)", [instance class], instance, instanceUserdata);

    lua_pop(L, 1); // Pop off strong userdata table

    END_STACK_MODIFY(L, 1)

    return instanceUserdata;
}

// Creates pseudo-super userdata object for obj-c instance and pushes it onto the stack
wax_instance_userdata *wax_instance_createSuper(lua_State *L, wax_instance_userdata *instanceUserdata) {
    BEGIN_STACK_MODIFY(L)

    size_t nbytes = sizeof(wax_instance_userdata);
    wax_instance_userdata *superInstanceUserdata = (wax_instance_userdata *)lua_newuserdata(L, nbytes);
    superInstanceUserdata->instance = instanceUserdata->instance;
    superInstanceUserdata->isClass = instanceUserdata->isClass;
	superInstanceUserdata->actAsSuper = YES;

	// isSuper not only stores whether the class is a super, but it also contains the value of the next superClass
	if (instanceUserdata->isSuper) {
		superInstanceUserdata->isSuper = [instanceUserdata->isSuper superclass];
	}
	else {
		superInstanceUserdata->isSuper = [instanceUserdata->instance superclass];
	}

    // set the metatable
    luaL_getmetatable(L, WAX_INSTANCE_METATABLE_NAME);
    lua_setmetatable(L, -2);

    wax_instance_pushUserdata(L, instanceUserdata->instance);
    if (lua_isnil(L, -1)) { // instance has no lua object, push empty env table (This shouldn't happen, tempted to remove it)
        lua_pop(L, 1); // Remove nil and superclass userdata
        lua_newtable(L);
    }
    else {
        lua_getfenv(L, -1);
        lua_remove(L, -2); // Remove nil and superclass userdata
    }

	// Give it the instance's metatable
    lua_setfenv(L, -2);

    END_STACK_MODIFY(L, 1)

    return superInstanceUserdata;
}

// The userdata table holds weak references too all the instance userdata
// created. This is used to manage all instances of Objective-C objects created
// via Lua so we can release/gc them when both Lua and Objective-C are finished with
// them.
void wax_instance_pushUserdataTable(lua_State *L) {
    BEGIN_STACK_MODIFY(L)
    static const char* userdataTableName = "__wax_userdata";
    luaL_getmetatable(L, WAX_INSTANCE_METATABLE_NAME);
    lua_getfield(L, -1, userdataTableName);

    if (lua_isnil(L, -1)) { // Create new userdata table, add it to metatable
        lua_pop(L, 1); // Remove nil

        lua_pushstring(L, userdataTableName); // Table name
        lua_newtable(L);
        lua_rawset(L, -3); // Add userdataTableName table to WAX_INSTANCE_METATABLE_NAME
        lua_getfield(L, -1, userdataTableName);

        lua_pushvalue(L, -1);
        lua_setmetatable(L, -2); // userdataTable is it's own metatable

        lua_pushstring(L, "v");
        lua_setfield(L, -2, "__mode");  // Make weak table
    }

    END_STACK_MODIFY(L, 1)
}

// Holds strong references to userdata created by wax... if the retain count dips below
// 2, then we can remove it because we know obj-c doesn't care about it anymore
void wax_instance_pushStrongUserdataTable(lua_State *L) {
    BEGIN_STACK_MODIFY(L)
    static const char* userdataTableName = "__wax_strong_userdata";
    luaL_getmetatable(L, WAX_INSTANCE_METATABLE_NAME);
    lua_getfield(L, -1, userdataTableName);

    if (lua_isnil(L, -1)) { // Create new userdata table, add it to metatable
        lua_pop(L, 1); // Remove nil

        lua_pushstring(L, userdataTableName); // Table name
        lua_newtable(L);
        lua_rawset(L, -3); // Add userdataTableName table to WAX_INSTANCE_METATABLE_NAME
        lua_getfield(L, -1, userdataTableName);
    }

    END_STACK_MODIFY(L, 1)
}

// First look in the object's userdata for the function, then look in the object's class's userdata
BOOL wax_instance_pushFunction(lua_State *L, id self, SEL selector) {
    BEGIN_STACK_MODIFY(L)

    wax_instance_pushUserdata(L, self);
    if (lua_isnil(L, -1)) {
        END_STACK_MODIFY(L, 0)
        return NO; // userdata doesn't exist
    }

    lua_getfenv(L, -1);
    wax_pushMethodNameFromSelector(L, selector);
    lua_rawget(L, -2);

    BOOL result = YES;

    if (!lua_isfunction(L, -1)) { // function not found in userdata
        lua_pop(L, 3); // Remove userdata, env and non-function
        if ([self class] == self) { // This is a class, not an instance
            result = wax_instance_pushFunction(L, [self superclass], selector); // Check to see if the super classes know about this function
        }
        else {
            result = wax_instance_pushFunction(L, [self class], selector);
        }
    }

    END_STACK_MODIFY(L, 1)

    return result;
}

// Retrieves associated userdata for an object from the wax instance userdata table
void wax_instance_pushUserdata(lua_State *L, id object) {
    BEGIN_STACK_MODIFY(L);

    wax_instance_pushUserdataTable(L);
    lua_pushlightuserdata(L, object);
    lua_rawget(L, -2);
    lua_remove(L, -2); // remove userdataTable

    END_STACK_MODIFY(L, 1)
}

BOOL wax_instance_isWaxClass(id instance) {
     // If this is a wax class, or an instance of a wax class, it has the userdata ivar set
    return class_getInstanceVariable([instance class], WAX_CLASS_INSTANCE_USERDATA_IVAR_NAME) != nil;
}

#pragma mark Override Metatable Functions
#pragma mark ---------------------------------

static int __index(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);

    if (lua_isstring(L, 2) && strcmp("super", lua_tostring(L, 2)) == 0) { // call to super!
        wax_instance_createSuper(L, instanceUserdata);
        return 1;
    }

    // Check instance userdata, unless we are acting like a super
	if (!instanceUserdata->actAsSuper) {
		lua_getfenv(L, -2);
		lua_pushvalue(L, -2);
		lua_rawget(L, 3);
	}
	else {
		lua_pushnil(L);
	}

    // Check instance's class userdata, or if it is a super, check the super's class data
    Class classToCheck = instanceUserdata->actAsSuper ? instanceUserdata->isSuper : [instanceUserdata->instance class];
	while (lua_isnil(L, -1) && wax_instance_isWaxClass(classToCheck)) {
		// Keep checking superclasses if they are waxclasses, we want to treat those like they are lua
		lua_pop(L, 1);
		wax_instance_pushUserdata(L, classToCheck);

		// If there is no userdata for this instance's class, then leave the nil on the stack and don't anything else
		if (!lua_isnil(L, -1)) {
			lua_getfenv(L, -1);
			lua_pushvalue(L, 2);
			lua_rawget(L, -2);
			lua_remove(L, -2); // Get rid of the userdata env
			lua_remove(L, -2); // Get rid of the userdata
		}

		classToCheck = class_getSuperclass(classToCheck);
    }

    if (lua_isnil(L, -1)) { // If we are calling a super class, or if we couldn't find the index in the userdata environment table, assume it is defined in obj-c classes
        SEL foundSelectors[2] = {nil, nil};
        BOOL foundSelector = wax_selectorForInstance(instanceUserdata, foundSelectors, lua_tostring(L, 2), NO);

        if (foundSelector) { // If the class has a method with this name, push as a closure
            lua_pushstring(L, sel_getName(foundSelectors[0]));
            foundSelectors[1] ? lua_pushstring(L, sel_getName(foundSelectors[1])) : lua_pushnil(L);
            lua_pushcclosure(L, instanceUserdata->actAsSuper ? superMethodClosure : methodClosure, 2);
        }
    }
    else if (!instanceUserdata->isSuper && instanceUserdata->isClass && wax_isInitMethod(lua_tostring(L, 2))) { // Is this an init method create in lua?
        lua_pushcclosure(L, customInitMethodClosure, 1);
    }

	// Always reset this, an object only acts like a super ONE TIME!
	instanceUserdata->actAsSuper = NO;

    return 1;
}

static int __newindex(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);

    // If this already exists in a protocol, or superclass make sure it will call the lua functions
    if (instanceUserdata->isClass && lua_type(L, 3) == LUA_TFUNCTION) {
        overrideMethod(L, instanceUserdata);
    }

    // Add value to the userdata's environment table
    lua_getfenv(L, 1);
    lua_insert(L, 2);
    lua_rawset(L, 2);

    return 0;
}

static int __gc(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);

    //wax_log(LOG_GC, @"Releasing %@ %@(%p)", instanceUserdata->isClass ? @"Class" : @"Instance", [instanceUserdata->instance class], instanceUserdata->instance);

    if (!instanceUserdata->isClass && !instanceUserdata->isSuper) {
        // This seems like a stupid hack. But...
        // If we want to call methods on an object durring gc, we have to readd
        // the instance/userdata to the userdata table. Why? Because it is
        // removed from the weak table before GC is called.
        wax_instance_pushUserdataTable(L);
        lua_pushlightuserdata(L, instanceUserdata->instance);
        lua_pushvalue(L, -3);
        lua_rawset(L, -3);

        [instanceUserdata->instance release];

        lua_pushlightuserdata(L, instanceUserdata->instance);
        lua_pushnil(L);
        lua_rawset(L, -3);
        lua_pop(L, 1);
    }

    return 0;
}

static int __tostring(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);
    lua_pushstring(L, [[NSString stringWithFormat:@"(%p => %p) %@", instanceUserdata, instanceUserdata->instance, instanceUserdata->instance] UTF8String]);

    return 1;
}

static int __eq(lua_State *L) {
    wax_instance_userdata *o1 = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);
    wax_instance_userdata *o2 = (wax_instance_userdata *)luaL_checkudata(L, 2, WAX_INSTANCE_METATABLE_NAME);

    lua_pushboolean(L, [o1->instance isEqual:o2->instance]);
    return 1;
}

#pragma mark Userdata Functions
#pragma mark -----------------------

static int methods(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);

    uint count;
    Method *methods = class_copyMethodList([instanceUserdata->instance class], &count);

    lua_newtable(L);

    for (int i = 0; i < count; i++) {
        Method method = methods[i];
        lua_pushstring(L, sel_getName(method_getName(method)));
        lua_rawseti(L, -2, i + 1);
    }

    return 1;
}

#pragma mark Function Closures
#pragma mark ----------------------

static int methodClosure(lua_State *L) {
    if (![[NSThread currentThread] isEqual:[NSThread mainThread]]) NSLog(@"METHODCLOSURE: OH NO SEPERATE THREAD");

    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);
    const char *selectorName = luaL_checkstring(L, lua_upvalueindex(1));

    // If the only arg is 'self' and there is a selector with no args. USE IT!
    if (lua_gettop(L) == 1 && lua_isstring(L, lua_upvalueindex(2))) {
        selectorName = luaL_checkstring(L, lua_upvalueindex(2));
    }

    SEL selector = sel_getUid(selectorName);
    id instance = instanceUserdata->instance;
    BOOL autoAlloc = NO;

    // If init is called on a class, auto-allocate it.
    if (instanceUserdata->isClass && wax_isInitMethod(selectorName)) {
        autoAlloc = YES;
        instance = [instance alloc];
    }

    NSMethodSignature *signature = [instance methodSignatureForSelector:selector];
    if (!signature) {
        // Fix by AWB: Some methods that can be invoked by performSelector: actually return a nil
        // method signature. This occurs if a method has been set up as forwarding to an
        // alternate target. Before giving up see if forwarding is a potential solution.
        //
        NSObject *fwd=[instance forwardingTargetForSelector:selector];
        if (fwd && (signature= [fwd methodSignatureForSelector:selector]))
            instance=fwd;
        else{
            const char *className = [NSStringFromClass([instance class]) UTF8String];
            luaL_error(L, "'%s' has no method selector '%s'", className, selectorName);
        }
    }

    NSInvocation *invocation = nil;
    invocation = [NSInvocation invocationWithMethodSignature:signature];

    [invocation setTarget:instance];
    [invocation setSelector:selector];

    int objcArgumentCount = [signature numberOfArguments] - 2; // skip the hidden self and _cmd argument
    int luaArgumentCount = lua_gettop(L) - 1;

    if (objcArgumentCount > luaArgumentCount && !wax_instance_isWaxClass(instance)) {
        luaL_error(L, "Not Enough arguments given! Method named '%s' requires %d argument(s), you gave %d. (Make sure you used ':' to call the method)", selectorName, objcArgumentCount + 1, lua_gettop(L));
    }

    void **arguements = calloc(sizeof(void*), objcArgumentCount);
    for (int i = 0; i < objcArgumentCount; i++) {
        arguements[i] = wax_copyToObjc(L, [signature getArgumentTypeAtIndex:i + 2], i + 2, nil);
        [invocation setArgument:arguements[i] atIndex:i + 2];
    }

    @try {
        [invocation invoke];
    }
    @catch (NSException *exception) {
        luaL_error(L, "Error invoking method '%s' on '%s' because %s", selector, class_getName([instance class]), [[exception description] UTF8String]);
    }

    for (int i = 0; i < objcArgumentCount; i++) {
        free(arguements[i]);
    }
    free(arguements);

    int methodReturnLength = [signature methodReturnLength];
    if (methodReturnLength > 0) {
        void *buffer = calloc(1, methodReturnLength);
        [invocation getReturnValue:buffer];

        wax_fromObjc(L, [signature methodReturnType], buffer);

        if (autoAlloc) {
            if (lua_isnil(L, -1)) {
                // The init method returned nil... means initialization failed!
                // Remove it from the userdataTable (We don't ever want to clean up after this... it should have cleaned up after itself)
                wax_instance_pushUserdataTable(L);
                lua_pushlightuserdata(L, instance);
                lua_pushnil(L);
                lua_rawset(L, -3);
                lua_pop(L, 1); // Pop the userdataTable

                lua_pushnil(L);
                [instance release];
            }
            else {
                wax_instance_userdata *returnedInstanceUserdata = (wax_instance_userdata *)lua_topointer(L, -1);
                if (returnedInstanceUserdata) { // Could return nil
                    [returnedInstanceUserdata->instance release]; // Wax automatically retains a copy of the object, so the alloc needs to be released
                }
            }
        }

        free(buffer);
    }

    return 1;
}

static int superMethodClosure(lua_State *L) {
    wax_instance_userdata *instanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);
    const char *selectorName = luaL_checkstring(L, lua_upvalueindex(1));

    // If the only arg is 'self' and there is a selector with no args. USE IT!
    if (lua_gettop(L) == 1 && lua_isstring(L, lua_upvalueindex(2))) {
        selectorName = luaL_checkstring(L, lua_upvalueindex(2));
    }

    SEL selector = sel_getUid(selectorName);

    // Super Swizzle
    Method selfMethod = class_getInstanceMethod([instanceUserdata->instance class], selector);
    Method superMethod = class_getInstanceMethod(instanceUserdata->isSuper, selector);

    if (superMethod && selfMethod != superMethod) { // Super's got what you're looking for
        IMP selfMethodImp = method_getImplementation(selfMethod);
        IMP superMethodImp = method_getImplementation(superMethod);
        method_setImplementation(selfMethod, superMethodImp);

        methodClosure(L);

        method_setImplementation(selfMethod, selfMethodImp); // Swap back to self's original method
    }
    else {
        methodClosure(L);
    }

    return 1;
}

static int customInitMethodClosure(lua_State *L) {
    wax_instance_userdata *classInstanceUserdata = (wax_instance_userdata *)luaL_checkudata(L, 1, WAX_INSTANCE_METATABLE_NAME);
    wax_instance_userdata *instanceUserdata = nil;

    id instance = nil;
    BOOL shouldRelease = NO;
    if (classInstanceUserdata->isClass) {
        shouldRelease = YES;
        instance = [classInstanceUserdata->instance alloc];
        instanceUserdata = wax_instance_create(L, instance, NO);
        lua_replace(L, 1); // replace the old userdata with the new one!
    }
    else {
        luaL_error(L, "I WAS TOLD THIS WAS A CUSTOM INIT METHOD. BUT YOU LIED TO ME");
        return -1;
    }

    lua_pushvalue(L, lua_upvalueindex(1)); // Grab the function!
    lua_insert(L, 1); // push it up top

    if (wax_pcall(L, lua_gettop(L) - 1, 1)) {
        const char* errorString = lua_tostring(L, -1);
        luaL_error(L, "Custom init method on '%s' failed.\n%s", class_getName([instanceUserdata->instance class]), errorString);
    }

    if (shouldRelease) {
        [instance release];
    }

    if (lua_isnil(L, -1)) { // The init method returned nil... return the instanceUserdata instead
		luaL_error(L, "Init method must return the self");
    }

    return 1;
}

#pragma mark Override Methods
#pragma mark ---------------------

static int pcallUserdata(lua_State *L, id self, SEL selector, va_list args) {
    BEGIN_STACK_MODIFY(L)

    if (![[NSThread currentThread] isEqual:[NSThread mainThread]]) NSLog(@"PCALLUSERDATA: OH NO SEPERATE THREAD");

    // A WaxClass could have been created via objective-c (like via NSKeyUnarchiver)
    // In this case, no lua object was ever associated with it, so we've got to
    // create one.
    if (wax_instance_isWaxClass(self)) {
        BOOL isClass = self == [self class];
        wax_instance_create(L, self, isClass); // If it already exists, then it will just return without doing anything
        lua_pop(L, 1); // Pops userdata off
    }

    // Find the function... could be in the object or in the class
    if (!wax_instance_pushFunction(L, self, selector)) {
        lua_pushfstring(L, "Could not find function named \"%s\" associated with object %s(%p).(It may have been released by the GC)", selector, class_getName([self class]), self);
        goto error; // function not found in userdata...
    }

    // Push userdata as the first argument
    wax_fromInstance(L, self);
    if (lua_isnil(L, -1)) {
        lua_pushfstring(L, "Could not convert '%s' into lua", class_getName([self class]));
        goto error;
    }

    NSMethodSignature *signature = [self methodSignatureForSelector:selector];
    int nargs = [signature numberOfArguments] - 1; // Don't send in the _cmd argument, only self
    int nresults = [signature methodReturnLength] ? 1 : 0;

    for (int i = 2; i < [signature numberOfArguments]; i++) { // start at 2 because to skip the automatic self and _cmd arugments
        const char *type = [signature getArgumentTypeAtIndex:i];
        int size = wax_fromObjc(L, type, args);
        args += size; // HACK! Since va_arg requires static type, I manually increment the args
    }

    if (wax_pcall(L, nargs, nresults)) { // Userdata will allways be the first object sent to the function
        goto error;
    }

    END_STACK_MODIFY(L, nresults)
    return nresults;

error:
    END_STACK_MODIFY(L, 1)
    return -1;
}

#define WAX_METHOD_NAME(_type_) wax_##_type_##_call

#define WAX_METHOD(_type_) \
static _type_ WAX_METHOD_NAME(_type_)(id self, SEL _cmd, ...) { \
va_list args; \
va_start(args, _cmd); \
va_list args_copy; \
va_copy(args_copy, args); \
/* Grab the static L... this is a hack */ \
lua_State *L = wax_currentLuaState(); \
BEGIN_STACK_MODIFY(L); \
int result = pcallUserdata(L, self, _cmd, args_copy); \
va_end(args_copy); \
va_end(args); \
_type_ returnValue; \
if (result == -1) { \
    luaL_error(L, "Error calling '%s' on '%s'\n%s", _cmd, [[self description] UTF8String], lua_tostring(L, -1)); \
} \
else if (result == 0) { \
    bzero(&returnValue, sizeof(_type_)); \
    END_STACK_MODIFY(L, 0) \
    return returnValue; \
} \
\
NSMethodSignature *signature = [self methodSignatureForSelector:_cmd]; \
_type_ *pReturnValue = (_type_ *)wax_copyToObjc(L, [signature methodReturnType], -1, nil); \
returnValue = *pReturnValue; \
free(pReturnValue); \
END_STACK_MODIFY(L, 0) \
return returnValue; \
}

typedef struct _buffer_16 {char b[16];} buffer_16;

WAX_METHOD(buffer_16)
WAX_METHOD(id)
WAX_METHOD(int)
WAX_METHOD(long)
WAX_METHOD(float)
WAX_METHOD(BOOL)

// Only allow classes to do this
static BOOL overrideMethod(lua_State *L, wax_instance_userdata *instanceUserdata) {
    BEGIN_STACK_MODIFY(L);
    BOOL success = NO;
    const char *methodName = lua_tostring(L, 2);

    SEL foundSelectors[2] = {nil, nil};
    wax_selectorForInstance(instanceUserdata, foundSelectors, methodName, YES);
    SEL selector = foundSelectors[0];
    if (foundSelectors[1]) {
        //NSLog(@"Found two selectors that match %s. Defaulting to %s over %s", methodName, foundSelectors[0], foundSelectors[1]);
    }

    Class klass = [instanceUserdata->instance class];

    char *typeDescription = nil;
    char *returnType = nil;

    Method method = class_getInstanceMethod(klass, selector);

    if (method) { // Is method defined in the superclass?
        typeDescription = (char *)method_getTypeEncoding(method);
        returnType = method_copyReturnType(method);
    }
    else { // Is this method implementing a protocol?
        Class currentClass = klass;

        while (!returnType && [currentClass superclass] != [currentClass class]) { // Walk up the object heirarchy
            uint count;
            Protocol **protocols = class_copyProtocolList(currentClass, &count);

            SEL possibleSelectors[2];
            wax_selectorsForName(methodName, possibleSelectors);

            for (int i = 0; !returnType && i < count; i++) {
                Protocol *protocol = protocols[i];
                struct objc_method_description m_description;

                for (int j = 0; !returnType && j < 2; j++) {
                    selector = possibleSelectors[j];
                    if (!selector) continue; // There may be only one acceptable selector sent back

                    m_description = protocol_getMethodDescription(protocol, selector, YES, YES);
                    if (!m_description.name) m_description = protocol_getMethodDescription(protocol, selector, NO, YES); // Check if it is not a "required" method

                    if (m_description.name) {
                        typeDescription = m_description.types;
                        returnType = method_copyReturnType((Method)&m_description);
                    }
                }
            }

            free(protocols);

            currentClass = [currentClass superclass];
        }
    }

    if (returnType) { // Matching method found! Create an Obj-C method on the
        if (!instanceUserdata->isClass) {
            luaL_error(L, "Trying to override method '%s' on an instance. You can only override classes", methodName);
        }

        const char *simplifiedReturnType = wax_removeProtocolEncodings(returnType);
        IMP imp;
        switch (simplifiedReturnType[0]) {
            case WAX_TYPE_VOID:
            case WAX_TYPE_ID:
                imp = (IMP)WAX_METHOD_NAME(id);
                break;

            case WAX_TYPE_CHAR:
            case WAX_TYPE_INT:
            case WAX_TYPE_SHORT:
            case WAX_TYPE_UNSIGNED_CHAR:
            case WAX_TYPE_UNSIGNED_INT:
            case WAX_TYPE_UNSIGNED_SHORT:
                imp = (IMP)WAX_METHOD_NAME(int);
                break;

            case WAX_TYPE_LONG:
            case WAX_TYPE_LONG_LONG:
            case WAX_TYPE_UNSIGNED_LONG:
            case WAX_TYPE_UNSIGNED_LONG_LONG:
                imp = (IMP)WAX_METHOD_NAME(long);
                break;

            case WAX_TYPE_FLOAT:
                imp = (IMP)WAX_METHOD_NAME(float);
                break;

            case WAX_TYPE_C99_BOOL:
                imp = (IMP)WAX_METHOD_NAME(BOOL);
                break;

            case WAX_TYPE_STRUCT: {
                int size = wax_sizeOfTypeDescription(simplifiedReturnType);
                switch (size) {
                    case 16:
                        imp = (IMP)WAX_METHOD_NAME(buffer_16);
                        break;
                    default:
                        luaL_error(L, "Trying to override a method that has a struct return type of size '%d'. There is no implementation for this size yet.", size);
                        return NO;
                        break;
                }
                break;
            }

            default:
                luaL_error(L, "Can't override method with return type %s", simplifiedReturnType);
                return NO;
                break;
        }

		id metaclass = objc_getMetaClass(object_getClassName(klass));
		success = class_addMethod(klass, selector, imp, typeDescription) && class_addMethod(metaclass, selector, imp, typeDescription);

        if (returnType) free(returnType);
    }
    else {
		SEL possibleSelectors[2];
        wax_selectorsForName(methodName, possibleSelectors);

		success = YES;
		for (int i = 0; i < 2; i++) {
			selector = possibleSelectors[i];
            if (!selector) continue; // There may be only one acceptable selector sent back

			int argCount = 0;
			char *match = (char *)sel_getName(selector);
			while ((match = strchr(match, ':'))) {
				match += 1; // Skip past the matched char
				argCount++;
			}

			size_t typeDescriptionSize = 3 + argCount;
			typeDescription = calloc(typeDescriptionSize + 1, sizeof(char));
			memset(typeDescription, '@', typeDescriptionSize);
			typeDescription[2] = ':'; // Never forget _cmd!

			IMP imp = (IMP)WAX_METHOD_NAME(id);
			id metaclass = objc_getMetaClass(object_getClassName(klass));

			success = success &&
				class_addMethod(klass, possibleSelectors[i], imp, typeDescription) &&
				class_addMethod(metaclass, possibleSelectors[i], imp, typeDescription);

			free(typeDescription);
		}
    }

    END_STACK_MODIFY(L, 1)
    return success;
}


text:
<!DOCTYPE html>

	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta charset="utf-8" />
	<title> Product-detail - GlosoTech </title>
	<meta content="" name="keywords"/>
	<meta id="description" content="" name="description"/>
	<link href="/css/index.css" rel="stylesheet" type="text/css" />
		<link href="/css/main.css" rel="stylesheet" type="text/css" />

		<link rel="stylesheet" type="text/css"
			href="/gadmin/jsplugin/alerts/css/jquery.alerts.css"></link>

Change password

Your Password

<input type="password" class="regInput" id="passwd" maxlength="20" style="width:300px;margin-left:100px;">*

New Password

<input type="password" class="regInput" id="newPasswd" maxlength="20" style="width:300px;margin-left:100px;">*

Repeat Password

<input type="password" class="regInput" id="againPasswd" maxlength="20" style="width:300px;margin-left:100px;">*

<input type="button" value="SAVE" class="regBtn" onclick="login();" style="margin-left:200px;">

Close


text:
package org.thymeleaf.templatemode;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.thymeleaf.TemplateEngine;

/**
 *
 * @author Daniel Fernández
 *
 * @since 3.0.0
 *
 */
public enum TemplateMode {

    HTML(true, false, false), XML(false, true, false),
    TEXT(false, false, true), JAVASCRIPT(false, false, true), CSS(false, false, true),
    RAW(false, false, false);

    private static Logger logger = LoggerFactory.getLogger(TemplateMode.class);

    private final boolean html;
    private final boolean xml;
    private final boolean text;
    private final boolean caseSensitive;

    TemplateMode(final boolean html, final boolean xml, final boolean text) {
        this.html = html;
        this.xml = xml;
        this.text = text;
        this.caseSensitive = !this.html;
    }

    public boolean isMarkup() {
        return this.html || this.xml;
    }

    public boolean isText() {
        return this.text;
    }

    public boolean isCaseSensitive() {
        return this.caseSensitive;
    }

    public static TemplateMode parse(final String mode) {
        if (mode == null || mode.trim().length() == 0) {
            throw new IllegalArgumentException("Template mode cannot be null or empty");
        }
        if ("HTML".equalsIgnoreCase(mode)) {
            return HTML;
        }
        if ("XML".equalsIgnoreCase(mode)) {
            return XML;
        }
        if ("TEXT".equalsIgnoreCase(mode)) {
            return TEXT;
        }
        if ("JAVASCRIPT".equalsIgnoreCase(mode)) {
            return JAVASCRIPT;
        }
        if ("CSS".equalsIgnoreCase(mode)) {
            return CSS;
        }
        if ("RAW".equalsIgnoreCase(mode)) {
            return RAW;
        }
        logger.warn(
                "[THYMELEAF][{}] Unknown Template Mode '{}'. Must be one of: 'HTML', 'XML', 'TEXT', 'JAVASCRIPT', 'CSS', 'RAW'. " +
                "Using default Template Mode '{}'.",
                new Object[]{TemplateEngine.threadIndex(), mode, HTML});
        return HTML;
    }

}


text:
/*!
 *
 *          ┌─┐       ┌─┐
 *       ┌──┘ ┴───────┘ ┴──┐
 *       │                 │
 *       │       ───       │
 *       │  ─┬┘       └┬─  │
 *       │                 │
 *       │       ─┴─       │
 *       │                 │
 *       └───┐         ┌───┘
 *           │         │
 *           │         │
 *           │         │
 *           │         └──────────────┐
 *           │                        │
 *           │                        ├─┐
 *           │                        ┌─┘
 *           │                        │
 *           └─┐  ┐  ┌───────┬──┐  ┌──┘
 *             │ ─┤ ─┤       │ ─┤ ─┤
 *             └──┴──┘       └──┴──┘
 *                 神兽保佑
 *                 代码无BUG!
 */

/*

 *********************************************************************************
 *
 * 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
 *
 * QQ     : 可以添加SDAutoLayout群 497140713 在这里找到我(博爱1616【137361770】)
 * 微博    : 博爱1616
 * Email  : 137361770@qq.com
 * GitHub : https://github.com/boai
 * 博客园  : http://www.cnblogs.com/boai/
 *********************************************************************************

 */

#import "BAPickerView.h"

@interface BAPickerView ()
<
    UIPickerViewDataSource,
    UIPickerViewDelegate
>

@property (nonatomic, copy) NSMutableArray *provinces;//省
@property (nonatomic, copy) NSMutableArray *cityArray;//市
@property (nonatomic, copy) NSMutableArray *areaArray;//县

@property (nonatomic, copy) NSMutableArray *selectedArray;

@property (nonatomic, strong) UIPickerView *pickerView;

@property (nonatomic, strong) UIView *chooseCityView;

@end

@implementation BAPickerView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.backgroundColor = BA_BGClearColor;

        UIView *bgView = [UIView new];
        bgView.frame = CGRectMake(30, (BA_SCREEN_HEIGHT - 300)/2, BA_SCREEN_WIDTH - 60, BA_SCREEN_HEIGHT/3);
        bgView.backgroundColor = BA_White_Color;
        [self addSubview:bgView];

        CGRect pickerViewFrame = CGRectMake(0, 0, bgView.frame.size.width, bgView.frame.size.height - 40);
        self.pickerView = [[UIPickerView alloc]initWithFrame:pickerViewFrame];
        self.pickerView.dataSource = self;
        self.pickerView.delegate = self;
        self.pickerView.backgroundColor = [UIColor whiteColor];
        [bgView addSubview:_pickerView];

        UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
        cancelButton.frame = CGRectMake((bgView.frame.size.width - 200)/3, CGRectGetMaxY(self.pickerView.frame), 100, 35);
        [cancelButton setTitle:@"取消" forState:UIControlStateNormal];
        [cancelButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [cancelButton addTarget:self action:@selector(removeBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [bgView addSubview:cancelButton];

        UIButton *chooseButton = [UIButton buttonWithType:UIButtonTypeCustom];
        chooseButton.frame = CGRectMake(CGRectGetMaxX(cancelButton.frame)+(bgView.frame.size.width - 200)/3, CGRectGetMaxY(self.pickerView.frame), 100, 35);
        [chooseButton setTitle:@"确定" forState:UIControlStateNormal];
        [chooseButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [chooseButton addTarget:self action:@selector(sureBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [bgView addSubview:chooseButton];

        bgView.layer.cornerRadius = 5;
        bgView.layer.borderWidth = 1;
        bgView.layer.borderColor = [[UIColor whiteColor]CGColor];
        bgView.layer.masksToBounds = YES;

        /** 确定 */
        chooseButton.layer.cornerRadius = 3;
        chooseButton.layer.borderWidth = 1;
        chooseButton.layer.borderColor = [[UIColor colorWithHexString:@"5AC33B" alpha:1.0f] CGColor];
        chooseButton.layer.masksToBounds = YES;

        /** 取消按钮 */
        cancelButton.layer.cornerRadius = 3;
        cancelButton.layer.borderWidth = 1;
        cancelButton.layer.borderColor = [[UIColor colorWithHexString:@"BAB9B9" alpha:1.0f] CGColor];
        cancelButton.layer.masksToBounds = YES;

        [self creatData];
    }
    return self;
}

- (void)creatData
{
    NSString *path = [[NSBundle mainBundle]pathForResource:@"area" ofType:@"plist"];
    NSArray *provinceArray = [[NSArray alloc]initWithContentsOfFile:path];
    [provinceArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {

        NSMutableArray *temp = [NSMutableArray arrayWithArray:self.provinces];
        [temp addObject:obj[@"state"]];

        self.provinces = temp;
    }];

    NSMutableArray *citys =[NSMutableArray arrayWithArray:[provinceArray firstObject][@"cities"]];
    [citys enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {

        NSMutableArray *temp = [NSMutableArray arrayWithArray:self.cityArray];
        [temp addObject:obj[@"city"]];

        self.cityArray = temp;
    }];

    self.areaArray = [NSMutableArray arrayWithArray:[citys firstObject][@"areas"]];

    self.province = [self.provinces firstObject];
    self.city = [self.cityArray firstObject];
    self.area = 0 == self.areaArray.count ? @"" : [self.areaArray firstObject];
}

#pragma mark --
#pragma mark -- UIPickerViewDataSource
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {

    return 3;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {

    return 0 == component ? self.provinces.count : 1 == component ? self.cityArray.count : self.areaArray.count;
}

#pragma mark -- UIPickerViewDelegate
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

    NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"plist"];
    NSArray *provinceArray = [[NSArray alloc]initWithContentsOfFile:path];

    if (0 == component) {

        self.selectedArray = provinceArray[row][@"cities"];

        NSMutableArray *temp = [NSMutableArray arrayWithArray:self.cityArray];
        [temp removeAllObjects];
        self.cityArray = temp;

        [self.selectedArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {

            NSMutableArray *temp = [NSMutableArray arrayWithArray:self.cityArray];
            [temp addObject:obj[@"city"]];

            self.cityArray = temp;
        }];

        self.areaArray = [NSMutableArray arrayWithArray:[self.selectedArray firstObject][@"areas"]];
        [pickerView reloadComponent:1];
        [pickerView selectRow:0 inComponent:1 animated:YES];

        [pickerView reloadComponent:2];
        [pickerView selectRow:0 inComponent:2 animated:YES];

    }else if (1 == component) {

        if (0 == self.selectedArray.count) {
            self.selectedArray = [provinceArray firstObject][@"cities"];
        }

        self.areaArray = [NSMutableArray arrayWithArray:[self.selectedArray objectAtIndex:row][@"areas"]];
        [pickerView reloadComponent:2];
        [pickerView selectRow:0 inComponent:2 animated:YES];
    }

    NSInteger provinces = [_pickerView selectedRowInComponent:0];
    NSInteger city = [_pickerView selectedRowInComponent:1];
    NSInteger area = [_pickerView selectedRowInComponent:2];

    self.province = self.provinces[provinces];
    self.city = self.cityArray[city];
    self.area = 0 == self.areaArray.count ? @"" : self.areaArray[area];
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

    return 0 == component ? self.provinces[row] : 1 == component ? self.cityArray[row] : 0 == self.areaArray.count ? nil : self.areaArray[row];
}

#pragma mark -- show and hidden
- (void)showInView:(UIView *)view {

    self.frame = CGRectMake(0, view.frame.size.height, self.frame.size.width, self.frame.size.height);
    [view addSubview:self];

    [UIView animateWithDuration:0.3f animations:^{

        self.frame = CGRectMake(0, view.frame.size.height - self.frame.size.height, self.frame.size.width, self.frame.size.height);
    }];
}

- (void)hiddenPickerView {

    // 开始动画
    //    [self animationbegin:sender];

    [UIView animateWithDuration:0.3f animations:^{

        self.frame = CGRectMake(0, self.frame.origin.y + self.frame.size.height, self.frame.size.width, self.frame.size.height);

    } completion:^(BOOL finished) {

        [self removeFromSuperview];
    }];
}

- (void)animationbegin:(UIView *)view {
    /* 放大缩小 */

    // 设定为缩放
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];

    // 动画选项设定
    animation.duration = 0.1; // 动画持续时间
    animation.repeatCount = -1; // 重复次数
    animation.autoreverses = YES; // 动画结束时执行逆动画

    // 缩放倍数
    animation.fromValue = [NSNumber numberWithFloat:1.0]; // 开始时的倍率
    animation.toValue = [NSNumber numberWithFloat:0.9]; // 结束时的倍率

    // 添加动画
    [view.layer addAnimation:animation forKey:@"scale-layer"];

}

- (IBAction)removeBtnClick:(id)sender {
    // 开始动画
    [self animationbegin:sender];

    [UIView animateWithDuration:0.3 animations:^{
        self.alpha = 0;
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}

- (IBAction)sureBtnClick:(id)sender {
    // 开始动画
    [self animationbegin:sender];

    NSString *province = [self protectString:self.province];
    NSString *city = [self protectString:self.city];
    NSString *area = [self protectString:self.area];

    NSString *selectCity = [NSString stringWithFormat:@"%@%@%@",province, city, area];

    //delegate
    [self.delegate getSelectCity:selectCity];

    [self removeBtnClick:nil];
}

- (NSString *)protectString:(NSString *)string
{
    if (string == nil || [string isKindOfClass:NULL]) {
        string = @"";
    }
    return string;
}

#pragma mark -- setter getter
- (NSMutableArray *)provinces {
    if (!_provinces) {
        self.provinces = [@[] mutableCopy];
    }
    return _provinces;
}

- (NSMutableArray *)cityArray {
    if (!_cityArray) {
        self.cityArray = [@[] mutableCopy];
    }
    return _cityArray;
}

- (NSMutableArray *)areaArray {
    if (!_areaArray) {
        self.areaArray = [@[] mutableCopy];
    }
    return _areaArray;
}

- (NSMutableArray *)selectedArray {
    if (!_selectedArray) {
        self.selectedArray = [@[] mutableCopy];
    }
    return _selectedArray;
}

@end


text:
package org.swcraft.springframework.core.knight;

public class DamselRescuingKnight implements Knight {

    private RescueDamselQuest quest;

    public DamselRescuingKnight() {
        this.quest = new RescueDamselQuest();
    }

    public void embarkOnQuest() {
        quest.embark();
    }

}


text:
package com.valtech.source.dependometer.app.controller.type;

import com.valtech.source.dependometer.app.controller.project.CycleParticipationCollectedEvent;

/**
 * @author Dietmar Menges (dietmar.menges@valtech.de)
 */
public final class TypeCycleParticipationCollectedEvent extends CycleParticipationCollectedEvent
{
   // No extra functionality needed - only the specific subtype
}


text:
package servlets;

import IO.DbReader;
import data.Database;
import data.GCSDatabase;
import decoder.Decoder;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import shared.sharedObjects;

/* Fetch the given data points for a specific run based on its runId and the dataType. */
@WebServlet("/getrun")
public class RunInfo extends HttpServlet {
  Database database;
  /* Initialize the database. */
  @Override
  public void init() throws ServletException {
    database = new GCSDatabase(sharedObjects.databaseName);
  }

  // Return numEntries runId and name pairs for getting urls to load viewer data.
  // Optional numEntries parameter limits the number of returned values.
  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    response.setContentType("text/html;");
    String runId = request.getParameter("id");
    System.out.println("The run id is " + runId);
    String dataType = request.getParameter("dataType");
    System.out.println("The dataType is " + dataType);

    // We now make would make an instance of the reader object to get a stream from
    // the database, then pass this value to the decoder, with a string as our ouput
    // stream.
    DbReader dataReader = new DbReader(database, runId, dataType);
    Decoder.decode(dataReader.read(), response.getOutputStream());
  }
}


text:
<!DOCTYPE html>

<title>Spectra processed | Myrimatch</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/tracervis.css" rel="stylesheet" media="screen">

<?php
include_once "dao.php";
include_once "summary.php";
dao_open();
?>

<?php home_btn(); ?> Spectra

<?php summary_spectra() ?>

<?php
dao_close();
?>


text:
package com.haulmont.cuba.uberjar;

import java.net.URL;
import java.net.URLClassLoader;

class UberJarURLClassLoader extends URLClassLoader {
    private final String name;

    public UberJarURLClassLoader(String name, URL[] urls, ClassLoader parent) {
        super(urls, parent);
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name + " " + super.toString();
    }
}


text:
package org.rosuda.rengine;

/**
 * REXPRaw represents a raw vector in R - essentially a sequence of bytes.
 */
public class REXPRaw extends REXPVector {

  private byte[] payload;

  /**
   * create a new raw vector with the specified payload
   *
   * @param load payload of the raw vector
   */
  public REXPRaw(byte[] load) {
    super();
    payload = (load == null) ? new byte[0] : load;
  }

  /**
   * create a new raw vector with the specified payload and attributes
   *
   * @param load payload of the raw vector
   * @param attr attributes for the resulting R object
   */
  public REXPRaw(byte[] load, REXPList attr) {
    super(attr);
    payload = (load == null) ? new byte[0] : load;
  }

  public int length() {
    return payload.length;
  }

  public boolean isRaw() {
    return true;
  }

  public byte[] asBytes() {
    return payload;
  }

  public Object asNativeJavaObject() {
    return payload;
  }
}


text:
module Kramdown
  module Parser
    class Kramdown

      PARAGRAPH_START = /^#{OPT_SPACE}[^ \t].*?\n/

      # Parse the paragraph at the current location.
      def parse_paragraph
        @src.pos += @src.matched_size
        if @tree.children.last && @tree.children.last.type == :p
          @tree.children.last.children.first.value << "\n" << @src.matched.chomp
        else
          @tree.children << new_block_el(:p)
          add_text(@src.matched.lstrip.chomp, @tree.children.last)
        end
        true
      end
      define_parser(:paragraph, PARAGRAPH_START)

    end
  end
end


text:
/* eslint-env jest */
import { default as renderToString } from 'preact-render-to-string'
import { h, render } from 'preact' // eslint-disable-line
import ColorWheel from './ColorWheel'

global.h = h

beforeEach(() => {
  document.body.innerHTML = ''
})

test(`Shouldn't render anything if no props is set`, () => {
  const vdom = renderToString(<ColorWheel />)
  expect(vdom).toMatchSnapshot()
})

test(`Should render the color wheel if the show prop is set`, () => {
  const vdom = renderToString(<ColorWheel show />)
  expect(vdom).toMatchSnapshot()
})

test(`Should invoke the onClose method when the color wheel closes`, done => {
  const onClose = () => done()

  render(
    <ColorWheel show onClose={onClose} />,
    document.body
  )

  document.querySelector('.color-overlay').click()
})

test(`Should return color coordinates if color wheel is clicked`, done => {
  const onClick = rgb => {
    expect(rgb).toMatchSnapshot()
    done()
  }

  ColorWheel.prototype.onClick = function () {
    this.props.onClick([1, 2, 3])
  }

  render(
    <ColorWheel show onClick={onClick} />,
    document.body
  )

  document.querySelector('.wheel').click()
})


text:
import { assert } from 'chai';
import { serializeTree, deserializeTree } from 'utils/tree-util';
import { flatten, preorder } from '../flatten-binary-tree-to-linked-list';

describe('Flatten Binary Tree to Linked List', () => {
  const testCases = [
    ['1', '1'],
    ['1,null,2', '1,null,2'],
    ['1,2', '1,null,2'],
    ['1,2,5,3,4,null,6', '1,null,2,null,3,null,4,null,5,null,6'],
  ];

  testCases.map((testCase, index) => {
    it(`should flattern binary tree ${testCase[0]} using postorder`, () => {
      const root = deserializeTree(testCase[0]);
      const expected = testCase[1];
      flatten(root);
      const actual = serializeTree(root);
      assert.equal(actual, expected);
    });
  });

  testCases.map((testCase, index) => {
    it(`should flattern binary tree ${testCase[0]} using preorder`, () => {
      const root = deserializeTree(testCase[0]);
      const expected = testCase[1];
      preorder(root);
      const actual = serializeTree(root);
      assert.equal(actual, expected);
    });
  });
});


text:
Clazz.load(["java.lang.RuntimeException"],"java.lang.ArithmeticException",null,function(){
c$=Clazz.declareType(java.lang,"ArithmeticException",RuntimeException);
});


text:
<!DOCTYPE html>

		<meta charset="utf-8"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

		<title>fluidLESS: barebones. </title>

		<meta name="viewport" content="width=device-width, initial-scale=1"/>
		<link rel="stylesheet/less" href="assets/less/bootstrap/bootstrap.less" type="text/css">
		<link rel="stylesheet/less" href="assets/less/fluid.less" type="text/css">

        <link href="assets/styles/kendo.common.min.css" rel="stylesheet" />
    	<link href="assets/styles/kendo.default.min.css" rel="stylesheet" />

		<link rel="shortcut icon" href="assets/images/favicon.png"/>
		<link rel="apple-touch-icon" sizes="114x114" href="assets/images/icon.png"/>

		<meta name="description" content="fluidLESS: barebones"/>

					fluidLESS

					A folding grid for responsive design.

					    <button class="btn btn-primary btn-large dropdown-toggle" data-toggle="dropdown" href="#">
					    Account

					    </button>

 Administration

 Edit Account

 Change Password

									 More options

 Option 1

 Option 2

 Option 3

 Logout

Full

This is full

  <button class="btn btn-link btn-large dropdown-toggle" data-toggle="dropdown" href="#">
					    Account

					    </button>

<embed src="http://www.youtube.com/v/sxBMfmAHENc?hd=1" type="application/x-shockwave-flash" wmode="transparent" width="450" height="290"></embed>

Halve

This is a Halve

About fluidLESS

fluidLESS is currently capable of spliting up its framework into 3 sections within the body consisting of a header, content and footer. Within each of these (primarly focusing on the content) it is possible for one to place multiple dynamic sections. Some current sections.
Selections currently available for use include:

Full width

Split

Third

Quarter

 hover over me

          <embed src="http://www.youtube.com/v/sxBMfmAHENc?hd=1" type="application/x-shockwave-flash" wmode="transparent" width="450" height="290"></embed>

Quarter

This is Quarters

One quarter

	Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.

Third

This is Thirds

One third

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

Two thirds

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

Three thirds

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

Three quarters

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

Four quarters

Third

This is Thirds

One third form

<form id="contactform" class="rounded" method="post" action="">

Contact Form

	Name:
  	<input type="text" class="input" name="name" id="name" />

Enter your name.

	Email:
  	<input type="text" class="input" name="email" id="email" />

Enter your email.

	Message:
  	<textarea class="input textarea" name="message" id="message"></textarea>

Write your message.

<input type="submit" name="Submit"  class="button" value="Submit" />
</form>

Two thirds

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

Three thirds

Content needs to be added in order to see desired results. This content is for testing purposes only. Random content

					Follow @snailface on Twitter to stay up to date with fluidLESS.

Developed by

							Snailface

							A guy who needed an adaptive design. Liked the idea of Joni Korpi's original concept and decided to improve on it.

Version 1.6. This site, its code and design, and fluidLESS itself are licensed under MIT. Javascript powered by Ender, CSS by LESS. Coded with Sublime Text 2. Max-width: 5120px;


text:
{% extends "global/prototypes_base.html" %}

{% block page_title %}
  Sign transfer
{% endblock %}

{% block content %}

    {% include "includes/prototypes_banner.html" %}

            Sign your transfer of whole of registered title agreement

Title number

              TGL123456

Address

              123 High Street

              Ashburton

              Devon

              PL1 1QQ

Title number

              TGL123456

Property

            10 Pound Lane, LittleTown, LT1 2WE

Date this transfer
 will take effect

            21 July 2015 at 11:00.

Transferors

            Victoria O'Hara

            Ian O'Hara

Transferees

            Jeremy Barija

            Peter Steiner

Transferees contact address

            10 Pound Lane, LittleTown, LT1 2WE

            jeremybarija@notarealemail.co.uk

            The transferor transfers the property to the transferee

            The transferor has received from the transferee for the property £250,000.

            The transferor transfers with full title garantee.

            The transferee is more than one person and they are to hold the property in trust for themselves as joint tenants.

            The transferee covenants to observe and perform to the covenants refered to in the proprietorship register of the property and to indemnify the transferor in respect to non-observation of non-performance of them.

          This transfer is electronically signed by Victoria O'Hara.

          This transfer will be signed by the registrar upon completion.

          Effective 21 July 2015 at 11:00.

        <form action="two-factor" method="get" class="form">

              <input id="check-1" type="checkbox" name="agree-execution">
              I agree that I have read the information above and am ready to sign

            <button type="submit" class="button">Sign</button>

        </form>

{% endblock %}


text:
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module YesodCoreTest.NoOverloadedStrings (noOverloadedTest, Widget) where

import Test.Hspec
import Test.Hspec.HUnit ()

import Yesod.Core hiding (Request)
import Network.Wai.Test
import Data.Monoid (mempty)

data Subsite = Subsite

getSubsite :: a -> Subsite
getSubsite = const Subsite

mkYesodSub "Subsite" [] [parseRoutes|
/bar BarR GET
|]

getBarR :: GHandler Subsite m ()
getBarR = return ()

data Y = Y
mkYesod "Y" [parseRoutes|
/ RootR GET
/foo FooR GET
/subsite SubsiteR Subsite getSubsite
|]

instance Yesod Y

getRootR :: Handler ()
getRootR = return ()

getFooR :: Handler ()
getFooR = return ()

runner :: Session () -> IO ()
runner f = toWaiApp Y >>= runSession f

case_sanity :: IO ()
case_sanity = runner $ do
    res <- request defaultRequest
    assertBody mempty res

noOverloadedTest :: [Spec]
noOverloadedTest = describe "Test.NoOverloadedStrings"
    [ it "sanity" case_sanity
    ]


text:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!--DITA Learning 2 Domain-->

   <group><!-- System ID (URL) catalog entries -->
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learning2Domain.rng:1.3"
              uri="rng/learning2Domain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learning2Domain.rng"
              uri="rng/learning2Domain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAggregationsTopicrefConstraintMod.rng:1.3"
              uri="rng/learningAggregationsTopicrefConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAggregationsTopicrefConstraintMod.rng"
              uri="rng/learningAggregationsTopicrefConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessment.rng:1.3"
              uri="rng/learningAssessment.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessment.rng"
              uri="rng/learningAssessment.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessmentMod.rng:1.3"
              uri="rng/learningAssessmentMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessmentMod.rng"
              uri="rng/learningAssessmentMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningBaseMod.rng:1.3"
              uri="rng/learningBaseMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningBaseMod.rng"
              uri="rng/learningBaseMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningBookmap.rng:1.3"
              uri="rng/learningBookmap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningBookmap.rng"
              uri="rng/learningBookmap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningContent.rng:1.3"
              uri="rng/learningContent.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningContent.rng"
              uri="rng/learningContent.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningContentMod.rng:1.3"
              uri="rng/learningContentMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningContentMod.rng"
              uri="rng/learningContentMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningDomain.rng:1.3"
              uri="rng/learningDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningDomain.rng"
              uri="rng/learningDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMap.rng:1.3"
              uri="rng/learningGroupMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMap.rng"
              uri="rng/learningGroupMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMapMod.rng:1.3"
              uri="rng/learningGroupMapMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMapMod.rng"
              uri="rng/learningGroupMapMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBase2Domain.rng:1.3"
              uri="rng/learningInteractionBase2Domain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBase2Domain.rng"
              uri="rng/learningInteractionBase2Domain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBaseDomain.rng:1.3"
              uri="rng/learningInteractionBaseDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBaseDomain.rng"
              uri="rng/learningInteractionBaseDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMap.rng:1.3"
              uri="rng/learningMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMap.rng"
              uri="rng/learningMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMapDomain.rng:1.3"
              uri="rng/learningMapDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMapDomain.rng"
              uri="rng/learningMapDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMetadataDomain.rng:1.3"
              uri="rng/learningMetadataDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningMetadataDomain.rng"
              uri="rng/learningMetadataDomain.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning1ConstraintMod.rng:1.3"
              uri="rng/learningNoLearning1ConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning1ConstraintMod.rng"
              uri="rng/learningNoLearning1ConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning2ConstraintMod.rng:1.3"
              uri="rng/learningNoLearning2ConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning2ConstraintMod.rng"
              uri="rng/learningNoLearning2ConstraintMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMap.rng:1.3"
              uri="rng/learningObjectMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMap.rng"
              uri="rng/learningObjectMap.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMapMod.rng:1.3"
              uri="rng/learningObjectMapMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMapMod.rng"
              uri="rng/learningObjectMapMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningOverview.rng:1.3"
              uri="rng/learningOverview.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningOverview.rng"
              uri="rng/learningOverview.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningOverviewMod.rng:1.3"
              uri="rng/learningOverviewMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningOverviewMod.rng"
              uri="rng/learningOverviewMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningPlan.rng:1.3"
              uri="rng/learningPlan.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningPlan.rng"
              uri="rng/learningPlan.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningPlanMod.rng:1.3"
              uri="rng/learningPlanMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningPlanMod.rng"
              uri="rng/learningPlanMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningSummary.rng:1.3"
              uri="rng/learningSummary.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningSummary.rng"
              uri="rng/learningSummary.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningSummaryMod.rng:1.3"
              uri="rng/learningSummaryMod.rng"/>
      <system systemId="urn:oasis:names:tc:dita:spec:learning:rng:learningSummaryMod.rng"
              uri="rng/learningSummaryMod.rng"/>
   </group>
   <group><!-- Public ID (URN) catalog entries -->
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learning2Domain.rng:1.3"
           uri="rng/learning2Domain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learning2Domain.rng"
           uri="rng/learning2Domain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAggregationsTopicrefConstraintMod.rng:1.3"
           uri="rng/learningAggregationsTopicrefConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAggregationsTopicrefConstraintMod.rng"
           uri="rng/learningAggregationsTopicrefConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessment.rng:1.3"
           uri="rng/learningAssessment.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessment.rng"
           uri="rng/learningAssessment.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessmentMod.rng:1.3"
           uri="rng/learningAssessmentMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningAssessmentMod.rng"
           uri="rng/learningAssessmentMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningBaseMod.rng:1.3"
           uri="rng/learningBaseMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningBaseMod.rng"
           uri="rng/learningBaseMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningBookmap.rng:1.3"
           uri="rng/learningBookmap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningBookmap.rng"
           uri="rng/learningBookmap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningContent.rng:1.3"
           uri="rng/learningContent.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningContent.rng"
           uri="rng/learningContent.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningContentMod.rng:1.3"
           uri="rng/learningContentMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningContentMod.rng"
           uri="rng/learningContentMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningDomain.rng:1.3"
           uri="rng/learningDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningDomain.rng"
           uri="rng/learningDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMap.rng:1.3"
           uri="rng/learningGroupMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMap.rng"
           uri="rng/learningGroupMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMapMod.rng:1.3"
           uri="rng/learningGroupMapMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningGroupMapMod.rng"
           uri="rng/learningGroupMapMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBase2Domain.rng:1.3"
           uri="rng/learningInteractionBase2Domain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBase2Domain.rng"
           uri="rng/learningInteractionBase2Domain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBaseDomain.rng:1.3"
           uri="rng/learningInteractionBaseDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningInteractionBaseDomain.rng"
           uri="rng/learningInteractionBaseDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMap.rng:1.3"
           uri="rng/learningMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMap.rng"
           uri="rng/learningMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMapDomain.rng:1.3"
           uri="rng/learningMapDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMapDomain.rng"
           uri="rng/learningMapDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMetadataDomain.rng:1.3"
           uri="rng/learningMetadataDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningMetadataDomain.rng"
           uri="rng/learningMetadataDomain.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning1ConstraintMod.rng:1.3"
           uri="rng/learningNoLearning1ConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning1ConstraintMod.rng"
           uri="rng/learningNoLearning1ConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning2ConstraintMod.rng:1.3"
           uri="rng/learningNoLearning2ConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningNoLearning2ConstraintMod.rng"
           uri="rng/learningNoLearning2ConstraintMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMap.rng:1.3"
           uri="rng/learningObjectMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMap.rng"
           uri="rng/learningObjectMap.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMapMod.rng:1.3"
           uri="rng/learningObjectMapMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningObjectMapMod.rng"
           uri="rng/learningObjectMapMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningOverview.rng:1.3"
           uri="rng/learningOverview.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningOverview.rng"
           uri="rng/learningOverview.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningOverviewMod.rng:1.3"
           uri="rng/learningOverviewMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningOverviewMod.rng"
           uri="rng/learningOverviewMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningPlan.rng:1.3"
           uri="rng/learningPlan.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningPlan.rng"
           uri="rng/learningPlan.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningPlanMod.rng:1.3"
           uri="rng/learningPlanMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningPlanMod.rng"
           uri="rng/learningPlanMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningSummary.rng:1.3"
           uri="rng/learningSummary.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningSummary.rng"
           uri="rng/learningSummary.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningSummaryMod.rng:1.3"
           uri="rng/learningSummaryMod.rng"/>
      <uri name="urn:oasis:names:tc:dita:spec:learning:rng:learningSummaryMod.rng"
           uri="rng/learningSummaryMod.rng"/>
   </group>
</catalog>