text:
#ifndef _PARSERS_H
#define _PARSERS_H

/* Add the name of any new parser definition function here */
#define PARSER_LIST \
	AntParser, \
	AsmParser, \
	AspParser, \
	AwkParser, \
	BasicParser, \
	BetaParser, \
	CParser, \
	CppParser, \
	CsharpParser, \
	CobolParser, \
	DosBatchParser, \
	EiffelParser, \
	ErlangParser, \
	FlexParser, \
	FortranParser, \
	HtmlParser, \
	JavaParser, \
	JavaScriptParser, \
	LispParser, \
	LuaParser, \
	MakefileParser, \
	MatLabParser, \
	OcamlParser, \
	PascalParser, \
	PerlParser, \
	PhpParser, \
	PythonParser, \
	RexxParser, \
	RubyParser, \
	SchemeParser, \
	ShParser, \
	SlangParser, \
	SmlParser, \
	SqlParser, \
	TclParser, \
	TexParser, \
	VeraParser, \
	VerilogParser, \
	VhdlParser, \
	VimParser, \
	YaccParser

#endif  /* _PARSERS_H */

/* vi:set tabstop=4 shiftwidth=4: */


text:
package org.arquillian.cube.openshift.impl.adapter;

import org.arquillian.cube.openshift.impl.client.CubeOpenShiftConfiguration;

/**
 * @author Ales Justin
 */
public interface OpenShiftAdapterProvider {
    OpenShiftAdapter create(CubeOpenShiftConfiguration configuration);
}

redpajama_set_name: RedPajamaGithub


text:
package com.hiagg.item.extracts;

import com.hiagg.creativetabs.ModTabs;
import com.hiagg.item.ModItems;
import com.hiagg.item.UnrefHiaggArmor;

public class UnrefHiaggLeggings extends UnrefHiaggArmor {
	public UnrefHiaggLeggings() {
		super(ModItems.UnrefHiaggArmor, 0, 2);
		setUnlocalizedName("UnrefHiaggLeggings");
		setCreativeTab(ModTabs.tabGear);
		setTextureName("hiaggium:UnrefHiaggLeggings");
	}

}


text:
package com.appleframework.config.springboot.utils;

import org.springframework.core.io.Resource;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.reader.UnicodeReader;

import java.io.IOException;
import java.util.*;

@SuppressWarnings({ "unchecked", "rawtypes" })
public class YamlUtils {

	/**
	 * 单个yaml文件处理
	 *
	 * @param resource
	 * @return
	 * @throws IOException
	 */
	public static Map<String, Object> yamlHandler(@NonNull Resource resource) throws IOException {
		// 返回的结果
		Map<String, Object> result = new LinkedHashMap<>();
		// 读取方式
		UnicodeReader reader = new UnicodeReader(resource.getInputStream());
		// 单文件处理
		Yaml yaml = new Yaml();
		Object object = yaml.load(reader);
		// 这里只是简单处理,需要多个方式可以自己添加
		if (object instanceof Map) {
			Map<String, Object> map = (Map) object;
			buildFlattenedMap(result, map, null);
		}
		reader.close();
		return result;
	}

	/**
	 * 单个yaml文件处理
	 *
	 * @param resources
	 * @return
	 * @throws IOException
	 */
	public static Map<String, Object> yamlHandler(@NonNull Resource[] resources) throws IOException {
		// 返回的结果
		Map<String, Object> result = new LinkedHashMap<>();
		Yaml yaml = new Yaml();
		// 多个文件处理
		Iterator<Resource> iterator = Arrays.stream(resources).iterator();
		while (iterator.hasNext()) {
			Resource resource = iterator.next();
			UnicodeReader reader = new UnicodeReader(resource.getInputStream());
			Object object = yaml.load(reader);
			// 这里只是简单处理,需要多个方式可以自己添加
			if (object instanceof Map) {
				Map<String, Object> map = (Map) object;
				buildFlattenedMap(result, map, null);
			}
			reader.close();
		}
		return result;
	}

	/**
	 * 这部分代码来至springboot源码部分对yaml的解析 YamlProcessor.java buildFlattenedMap方法
	 *
	 * @param result
	 * @param source
	 * @param path
	 */
	private static void buildFlattenedMap(Map<String, Object> result, Map<String, Object> source, @Nullable String path) {
		for (Map.Entry<String, Object> m : source.entrySet()) {
			String key = m.getKey();
			Object value = m.getValue();
			// 如果存在路径进行拼接
			if (StringUtils.hasText(path)) {
				if (key.startsWith("[")) {
					key = path + key;
				} else {
					key = path + '.' + key;
				}
			}
			// 数据类型匹配
			if (value instanceof String) {
				result.put(key, value);
			} else if (value instanceof Map) {
				// 如果是map,就继续读取
				Map<String, Object> map = (Map) value;
				buildFlattenedMap(result, map, key);
			} else if (value instanceof Collection) {
				Collection<Object> collection = (Collection) value;
				if (collection.isEmpty()) {
					result.put(key, "");
				} else {
					int count = 0;
					Iterator<?> var7 = collection.iterator();

					while (var7.hasNext()) {
						Object object = var7.next();
						buildFlattenedMap(result, Collections.singletonMap("[" + count++ + "]", object), key);
					}
				}
			} else {
				result.put(key, value != null ? value : "");
			}
		}
	}

}


text:
var originalFetch = require('isomorphic-fetch'),
    assign = require('object-assign');

module.exports = function fetch(input, init) {

  init = init || {};

  // Send cookies to server, please.
  init.credentials = 'same-origin';

  return originalFetch(input, init);
};


text:
namespace Octokit
{
    /// <summary>
    /// A plan (either paid or free) for a particular user
    /// </summary>
    public class Plan
    {
        /// <summary>
        /// The number of collaborators allowed with this plan.
        /// </summary>
        /// <remarks>This returns <see cref="long"/> because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" number of collaborators.</remarks>
        public long Collaborators { get; set; }

        /// <summary>
        /// The name of the plan.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// The number of private repositories allowed with this plan.
        /// </summary>
        /// <remarks>This returns <see cref="long"/> because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" number of plans.</remarks>
        public long PrivateRepos { get; set; }

        /// <summary>
        /// The amount of disk space allowed with this plan.
        /// </summary>
        /// <remarks>This returns <see cref="long"/> because GitHub Enterprise uses a sentinel value of 999999999999 to denote an "unlimited" amount of disk space.</remarks>
        public long Space { get; set; }

        /// <summary>
        /// The billing email for the organization. Only has a value in response to editing an organization.
        /// </summary>
        public string BillingEmail { get; set; }
    }
}


text:
RawCoin

The Best x15 PoW + PoS hybrid coin.


text:
#ifndef PHALCON_DI_FACTORYDEFAULT_H
#define PHALCON_DI_FACTORYDEFAULT_H

#include "php_phalcon.h"

extern zend_class_entry *phalcon_di_factorydefault_ce;

PHALCON_INIT_CLASS(Phalcon_DI_FactoryDefault);

#endif /* PHALCON_DI_FACTORYDEFAULT_H */


text:
/*global QUnit */
sap.ui.define([
	"sap/ui/core/CalendarType",
	"sap/ui/core/Locale",
	"sap/ui/core/LocaleData",
	"sap/ui/core/Configuration"
], function(CalendarType, Locale, LocaleData, Configuration) {
	"use strict";

	var sDefaultLanguage = Configuration.getLanguage();

	//var aUSDSymbols = ["US$", "$", "$", "$", "$", "US$", "$", "US$", "$", "US$", , "$", "$US", "$\u00a0US", "$US", "$", "US$", "US$", "$",
	//	"US$", "US$", "$", "$", "$", "US$", "US$", "USD", "US$", "US$", "$", "US$", "$", "USD"];

	/*
	"getOrientation", "getLanguages", "getScripts", "getTerritories", "getMonths", "getDays", "getQuarters", "getDayPeriods",
	"getDatePattern", "getTimePattern", "getDateTimePattern", "getNumberSymbol"
	*/
	function genericTests(assert, oLocaleData, sLocale) {
		var aCalendarTypes = [undefined],
			sCalendarType,
			j;

		assert.equal(typeof oLocaleData.getOrientation(), "string", "getOrientation()");
		assert.equal(typeof oLocaleData.getLanguages(), "object", "getLanguages()");
		assert.equal(typeof oLocaleData.getScripts(), "object", "getScripts()");
		assert.equal(typeof oLocaleData.getTerritories(), "object", "getTerritories()");

		if (sLocale !== "xx_XX") {
			for (sCalendarType in CalendarType) {
				aCalendarTypes.push(CalendarType[sCalendarType]);
			}
		}

		aCalendarTypes.forEach(function(sCalendarType) {
			assert.equal(oLocaleData.getMonths("narrow", sCalendarType) && oLocaleData.getMonths("narrow", sCalendarType).length, 12, "getMonths(\"narrow\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getMonths("abbreviated", sCalendarType) && oLocaleData.getMonths("abbreviated", sCalendarType).length, 12, "getMonths(\"abbreviated\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getMonths("wide", sCalendarType) && oLocaleData.getMonths("wide", sCalendarType).length, 12, "getMonths(\"wide\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDays("narrow", sCalendarType) && oLocaleData.getDays("narrow", sCalendarType).length, 7, "getDays(\"narrow\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDays("abbreviated", sCalendarType) && oLocaleData.getDays("abbreviated", sCalendarType).length, 7, "getDays(\"abbreviated\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDays("wide", sCalendarType) && oLocaleData.getDays("wide", sCalendarType).length, 7, "getDays(\"wide\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDays("short", sCalendarType) && oLocaleData.getDays("short", sCalendarType).length, 7, "getDays(\"short\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getQuarters("narrow", sCalendarType) && oLocaleData.getQuarters("narrow", sCalendarType).length, 4, "getQuarters(\"narrow\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getQuarters("abbreviated", sCalendarType) && oLocaleData.getQuarters("abbreviated", sCalendarType).length, 4, "getQuarters(\"abbreviated\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getQuarters("wide", sCalendarType) && oLocaleData.getQuarters("wide", sCalendarType).length, 4, "getQuarters(\"wide\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDayPeriods("narrow", sCalendarType) && oLocaleData.getDayPeriods("narrow", sCalendarType).length, 2, "getDayPeriods(\"narrow\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDayPeriods("abbreviated", sCalendarType) && oLocaleData.getDayPeriods("abbreviated", sCalendarType).length, 2, "getDayPeriods(\"abbreviated\", \"" + sCalendarType + "\")");
			assert.equal(oLocaleData.getDayPeriods("wide", sCalendarType) && oLocaleData.getDayPeriods("wide", sCalendarType).length, 2, "getDayPeriods(\"wide\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getEras("wide", sCalendarType), "object", "getEras(\"wide\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getEras("abbreviated", sCalendarType), "object", "getEras(\"abbreviated\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getEras("narrow", sCalendarType), "object", "getEras(\"narrow\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDatePattern("short", sCalendarType), "string", "getDatePattern(\"short\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDatePattern("medium", sCalendarType), "string", "getDatePattern(\"medium\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDatePattern("long", sCalendarType), "string", "getDatePattern(\"long\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDatePattern("full", sCalendarType), "string", "getDatePattern(\"full\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getTimePattern("short", sCalendarType), "string", "getTimePattern(\"short\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getTimePattern("medium", sCalendarType), "string", "getTimePattern(\"medium\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getTimePattern("long", sCalendarType), "string", "getTimePattern(\"long\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getTimePattern("full", sCalendarType), "string", "getTimePattern(\"full\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDateTimePattern("short", sCalendarType), "string", "getTimePattern(\"short\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDateTimePattern("medium", sCalendarType), "string", "getTimePattern(\"medium\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDateTimePattern("long", sCalendarType), "string", "getTimePattern(\"long\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getDateTimePattern("full", sCalendarType), "string", "getTimePattern(\"full\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCombinedDateTimePattern("full", "medium", sCalendarType), "string", "getTimePattern(\"full\", \"medium\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCombinedDateTimePattern("medium", "short", sCalendarType), "string", "getTimePattern(\"medium\", \"short\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("y", sCalendarType), "string", "getCustomDateTimePattern(\"y\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMd", sCalendarType), "string", "getCustomDateTimePattern(\"yMd\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("Hms", sCalendarType), "string", "getCustomDateTimePattern(\"Hms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("jms", sCalendarType), "string", "getCustomDateTimePattern(\"jms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("Jms", sCalendarType), "string", "getCustomDateTimePattern(\"jms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMdd", sCalendarType), "string", "getCustomDateTimePattern(\"yMdd\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("Hmss", sCalendarType), "string", "getCustomDateTimePattern(\"Hmss\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMMd", sCalendarType), "string", "getCustomDateTimePattern(\"yMMd\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMMMw", sCalendarType), "string", "getCustomDateTimePattern(\"yMMMw\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMdHms", sCalendarType), "string", "getCustomDateTimePattern(\"yMdHms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMdjms", sCalendarType), "string", "getCustomDateTimePattern(\"yMdjms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms", sCalendarType), "string", "getCustomDateTimePattern(\"yMMMMEEEEdHms\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("Q", sCalendarType), "string", "getCustomDateTimePattern(\"Q\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomDateTimePattern("w", sCalendarType), "string", "getCustomDateTimePattern(\"w\", \"" + sCalendarType + "\")");
			assert.throws(function(){oLocaleData.getCustomDateTimePattern("My", sCalendarType);}, Error, "getCustomDateTimePattern(\"My\", \"" + sCalendarType + "\")");
			assert.throws(function(){oLocaleData.getCustomDateTimePattern("yMLd", sCalendarType);}, Error, "getCustomDateTimePattern(\"yMLd\", \"" + sCalendarType + "\")");
			assert.throws(function(){oLocaleData.getCustomDateTimePattern("yMdp", sCalendarType);}, Error, "getCustomDateTimePattern(\"yMdp\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomIntervalPattern("y", "y", sCalendarType), "string", "getCustomIntervalPattern(\"y\", \"y\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomIntervalPattern("yMd", "y", sCalendarType), "string", "getCustomIntervalPattern(\"yMd\", \"y\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomIntervalPattern("yMd", "d", sCalendarType), "string", "getCustomIntervalPattern(\"yMd\", \"d\", \"" + sCalendarType + "\")");
			assert.ok(Array.isArray(oLocaleData.getCustomIntervalPattern("yMd", "", sCalendarType)), "getCustomIntervalPattern(\"yMd\", \"\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomIntervalPattern("yw", "y", sCalendarType), "string", "getCustomIntervalPattern(\"yMd\", \"d\", \"" + sCalendarType + "\")");
			assert.equal(typeof oLocaleData.getCustomIntervalPattern("Q", "Q", sCalendarType), "string", "getCustomIntervalPattern(\"yMd\", \"d\", \"" + sCalendarType + "\")");
			[undefined, "wide", "short", "narrow"].forEach(function(sStyle, index) {
				assert.equal(typeof oLocaleData.getDisplayName("era", sStyle), "string", "getDisplayName(\"era\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("year", sStyle), "string", "getDisplayName(\"year\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("quarter", sStyle), "string", "getDisplayName(\"quarter\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("month", sStyle), "string", "getDisplayName(\"month\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("day", sStyle), "string", "getDisplayName(\"day\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("weekday", sStyle), "string", "getDisplayName(\"weekday\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("hour", sStyle), "string", "getDisplayName(\"hour\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("minute", sStyle), "string", "getDisplayName(\"minute\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("second", sStyle), "string", "getDisplayName(\"second\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				assert.equal(typeof oLocaleData.getDisplayName("zone", sStyle), "string", "getDisplayName(\"zone\"" + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				for (j = -2; j <= 2; j++) {
					assert.equal(typeof oLocaleData.getRelativeSecond(j), "string", "getRelativeSecond(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					if (j === 0) {
						assert.strictEqual(oLocaleData.getRelativeMinute(j), null, "getRelativeMinute(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
						assert.strictEqual(oLocaleData.getRelativeHour(j), null, "getRelativeHour(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					} else {
						assert.equal(typeof oLocaleData.getRelativeMinute(j), "string", "getRelativeMinute(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
						assert.equal(typeof oLocaleData.getRelativeHour(j), "string", "getRelativeHour(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					}
					assert.equal(typeof oLocaleData.getRelativeDay(j), "string", "getRelativeDay(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					assert.equal(typeof oLocaleData.getRelativeWeek(j), "string", "getRelativeWeek(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					assert.equal(typeof oLocaleData.getRelativeMonth(j), "string", "getRelativeMonth(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
					assert.equal(typeof oLocaleData.getRelativeYear(j), "string", "getRelativeYear(" + j + (sStyle === undefined ? "" : ', "' + sStyle + '"') + ")");
				}
			});
		});

		assert.equal(typeof oLocaleData.getNumberSymbol("decimal"), "string", "getNumberSymbol(\"decimal\")");
		assert.equal(typeof oLocaleData.getNumberSymbol("group"), "string", "getNumberSymbol(\"group\")");
		assert.equal(typeof oLocaleData.getNumberSymbol("plusSign"), "string", "getNumberSymbol(\"plusSign\")");
		assert.equal(typeof oLocaleData.getNumberSymbol("minusSign"), "string", "getNumberSymbol(\"minusSign\")");
		assert.equal(typeof oLocaleData.getCurrencySpacing(), "object", "getCurrencySpacing()");
		assert.equal(typeof oLocaleData.getCurrencySpacing("after"), "object", "getCurrencySpacing(\"after\")");
		assert.equal(typeof oLocaleData.getFirstDayOfWeek(), "number", "getFirstDayOfWeek()");
		assert.ok(oLocaleData.getFirstDayOfWeek() >= 0 && oLocaleData.getFirstDayOfWeek() < 7, "getFirstDayOfWeek()");
		assert.equal(typeof oLocaleData.getWeekendStart(), "number", "getWeekendStart()");
		assert.ok(oLocaleData.getWeekendStart() >= 0 && oLocaleData.getWeekendStart() < 7, "getWeekendStart()");
		assert.equal(typeof oLocaleData.getWeekendEnd(), "number", "getWeekendEnd()");
		assert.ok(oLocaleData.getWeekendEnd() >= 0 && oLocaleData.getWeekendEnd() < 7, "getWeekendEnd()");
		assert.ok(oLocaleData.getPreferredCalendarType() in CalendarType, "getPreferredCalendar()");
		assert.equal(typeof oLocaleData.getCalendarWeek("wide", 1), "string", "getCalendarWeek wide");
		assert.equal(typeof oLocaleData.getCalendarWeek("narrow", 1), "string", "getCalendarWeek narrow");
		assert.equal(typeof oLocaleData.getPluralCategories(), "object", "getPluralCategories");
		assert.ok(oLocaleData.getPluralCategories().length >= 1, "object", "getPluralCategories contains at least \"other\"");
		assert.equal(typeof oLocaleData.getPluralCategory("0"), "string", "getPluralCategory(\"0\")");
		assert.equal(typeof oLocaleData.getPluralCategory("1"), "string", "getPluralCategory(\"1\")");
		assert.equal(typeof oLocaleData.getPluralCategory("-2.00"), "string", "getPluralCategory(\"-2.00\")");
		assert.equal(typeof oLocaleData.getPluralCategory("123.456"), "string", "getPluralCategory(\"123.456\")");

		assert.equal(typeof oLocaleData.getDecimalPattern(), "string", "getDecimalPattern");
		assert.equal(typeof oLocaleData.getCurrencyPattern(), "string", "getCurrencyPattern");
		assert.equal(typeof oLocaleData.getPercentPattern(), "string", "getPercentPattern");
		assert.equal(typeof oLocaleData.getMiscPattern("approximately"), "string", "getMiscPattern approximately");
		assert.equal(typeof oLocaleData.getMiscPattern("atLeast"), "string", "getMiscPattern atLeast");
		assert.equal(typeof oLocaleData.getMiscPattern("atMost"), "string", "getMiscPattern atMost");
		assert.equal(typeof oLocaleData.getMiscPattern("range"), "string", "getMiscPattern range");

		// there's no currency symbol defined for EUR and USD in 'es_MX' locale in CLDR data version 26
		if (sLocale !== "xx_XX" /*&& sLocale !== "es_MX"*/) {
			assert.equal(oLocaleData.getCurrencyCodeBySymbol(oLocaleData.getCurrencySymbol("EUR")), "EUR", "Currency Symbol € has currency code EUR");
			assert.equal(oLocaleData.getCurrencyCodeBySymbol(oLocaleData.getCurrencySymbol("USD")), "USD", "Currency Symbol for US Dollar has currency code USD");
		}
	}

	var customTests = {
		ar_SA: function customTests_ar_SA(assert, oLocaleData) {
			assert.equal(oLocaleData.getPluralCategories().length, 6, "six plural forms");
			assert.equal(oLocaleData.getPluralCategories()[0], "zero", "special plural form for zero");
			assert.equal(oLocaleData.getPluralCategories()[1], "one", "special plural form for one");
			assert.equal(oLocaleData.getPluralCategories()[2], "two", "special plural form for two");
			assert.equal(oLocaleData.getPluralCategory("0"), "zero", "plural category zero for 0");
			assert.equal(oLocaleData.getPluralCategory("1"), "one", "plural category one for 1");
			assert.equal(oLocaleData.getPluralCategory("2.0"), "two", "plural category two for 2.0");
			assert.equal(oLocaleData.getPluralCategory("4"), "few", "plural category few for 4");
			assert.equal(oLocaleData.getPluralCategory("11"), "many", "plural category many for 11");
			assert.equal(oLocaleData.getPluralCategory("101"), "other", "plural category other for 101");
			assert.equal(oLocaleData.getPreferredCalendarType(), "Islamic", "islamic calendar preferred");
		},

		de_AT: function customTests_de_AT(assert, oLocaleData) {
			assert.equal(oLocaleData.getMonths("wide")[0], "Jänner", "1st month");
		},

		de_DE: function customTests_de_DE(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "Deutsch", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "Lateinisch", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Deutschland", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "Januar", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "Jan.", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "J", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "Sonntag", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "So.", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "S", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "So.", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "dd.MM.y", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} 'um' {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("long", "long"), "d. MMMM y 'um' HH:mm:ss z", "datetime pattern \"long\", \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimeWithTimezonePattern("long", "long"), "d. MMMM y 'um' HH:mm:ss z VV", "datetime pattern \"long\", \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short"), "dd.MM.y, HH:mm", "datetime pattern \"medium\", \"short\"");
			assert.equal(oLocaleData.applyTimezonePattern("y"), "y VV", "time zone pattern applied");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short", "Japanese"), "dd.MM.y G, HH:mm", "datetime pattern \"medium\", \"short\", \"Japanese\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd.MM.y", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "MMM y ('Woche': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "d.M.y, HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE, d. MMMM y 'um' HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdJms"), "EEEE, d. MMMM y 'um' HH:mm:ss", "datetime format \"yMMMMdEEEEJms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y ('Tag': d), HH 'Uhr' ('Sekunde': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("km"), "HH:mm", "datetime format \"km\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("Km"), "h:mm a", "datetime format \"Km\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("jms"), "HH:mm:ss", "datetime format \"jms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("Jms"), "HH:mm:ss", "datetime format \"Jms\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y–y", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "dd.–dd.MM.y", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "j"), "d.M.y, HH:mm–HH:mm 'Uhr'", "interval format \"yMdjm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "d.–d. MMM", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", "d"), "dd.–dd. MMM", "interval format \"MMMdd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "H"), "HH:mm–HH:mm 'Uhr'", "interval format \"Hm\", \"H\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "HH:mm–HH:mm 'Uhr'", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yw", "y"), "'Woche' w 'des' 'Jahres' Y – 'Woche' w 'des' 'Jahres' Y", "interval format \"yw\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Q", "Q"), "Q – Q", "interval format \"Q\", \"Q\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y–y", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "dd.–dd.MM.y", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Hour: true }), "d.M.y, HH:mm–HH:mm 'Uhr'", "interval format \"yMdjm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "d.–d. MMM", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", { Day: true }), "dd.–dd. MMM", "interval format \"MMMdd\", { Day: true}");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { Hour: true }), "HH:mm–HH:mm 'Uhr'", "interval format \"Hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "HH:mm–HH:mm 'Uhr'", "interval format \"jm\", { Hour: true}");
			assert.equal(oLocaleData.getCustomIntervalPattern("yw", { Year: true }), "'Woche' w 'des' 'Jahres' Y – 'Woche' w 'des' 'Jahres' Y", "interval format \"yw\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yw", { Week: true, Day: true }), "'Woche' w 'des' 'Jahres' Y – 'Woche' w 'des' 'Jahres' Y", "interval format \"yw\", { Week: true, Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yw", { Day: true }), "'Woche' w 'des' 'Jahres' Y", "interval format \"yw\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Q", { Quarter: true }), "Q – Q", "interval format \"Q\", { Quarter: true }");
			// skeleton "yMMdd" has pattern "dd.MM.y" and
			// skeleton "yMMMd" has pattern "d. MMM y"
			// "yMMMMdd"'s best match is "yMMMd" since both "month" and "day" have the same representation category
			// and both should be expanded which results in "dd. MMMM y"
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMdd"), "dd. MMMM y", "datetime format 'yMMMMdd'");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ".", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getFirstDayOfWeek(), 1, "first day of week");
			assert.equal(oLocaleData.getWeekendStart(), 6, "weekend start");
			assert.equal(oLocaleData.getWeekendEnd(), 0, "weekend end");
			assert.equal(oLocaleData.getPluralCategories().length, 2, "two plural forms");
			assert.equal(oLocaleData.getPluralCategories()[0], "one", "special plural form for one");
			assert.equal(oLocaleData.getPluralCategory("0"), "other", "plural category other for 0");
			assert.equal(oLocaleData.getPluralCategory("1"), "one", "plural category one for 1");
			assert.equal(oLocaleData.getPluralCategory("2.0"), "other", "plural category other for 2.0");
			assert.equal(oLocaleData.getPluralCategory("4"), "other", "plural category other for 4");
			assert.equal(oLocaleData.getPluralCategory("10"), "other", "plural category other for 10");
			assert.equal(oLocaleData.getPluralCategory("101"), "other", "plural category other for 101");
			assert.equal(oLocaleData.getPreferredCalendarType(), "Gregorian", "gregorian calendar preferred");
		},

		de_XX: function customTests_de_XX(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getMonths("wide")[0], "Januar", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "Jan.", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "J", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "Sonntag", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "So.", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "S", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "So.", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "dd.MM.y", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} 'um' {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ".", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
		},

		en_GB: function customTests_en_GB(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "German", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "Latin", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Germany", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "January", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "Jan", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "J", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "Sunday", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "Sun", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "S", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "Su", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "d MMM y", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} 'at' {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimeWithTimezonePattern("long", "long"), "d MMMM y 'at' HH:mm:ss z VV", "datetime pattern \"long\", \"long\"");
			assert.equal(oLocaleData.applyTimezonePattern("y"), "y VV", "time zone pattern applied");
			assert.equal(oLocaleData.getCombinedDateTimePattern("long", "long"), "d MMMM y 'at' HH:mm:ss z", "datetime pattern \"long\", \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short"), "d MMM y, HH:mm", "datetime pattern \"medium\", \"short\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short", "Japanese"), "MMM d, y G, HH:mm", "datetime pattern \"medium\", \"short\", \"Japanese\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd/MM/y", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "MMM y ('week': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "dd/MM/y, HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE, d MMMM y 'at' HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdJms"), "EEEE, d MMMM y 'at' HH:mm:ss", "datetime format \"yMMMMdEEEEJms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y ('day': d), HH ('second': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("km"), "HH:mm", "datetime format \"km\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("Km"), "h:mm a", "datetime format \"Km\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("jms"), "HH:mm:ss", "datetime format \"jms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("Jms"), "HH:mm:ss", "datetime format \"Jms\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y–y", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "dd/MM/y – dd/MM/y", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "j"), "dd/MM/y, HH:mm–HH:mm", "interval format \"yMdjm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "d–d MMM", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", "d"), "dd–dd MMM", "interval format \"MMMdd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "H"), "HH:mm–HH:mm", "interval format \"Hm\", \"H\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "HH:mm–HH:mm", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", "a"), "h:mm a – h:mm a", "interval format \"hm\", \"a\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", "h"), "h:mm – h:mm a", "interval format \"hm\", \"h\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", "H"), "h:mm a – h:mm a", "interval format \"hm\", \"h\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", "j"), "h:mm a – h:mm a", "interval format \"hm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "a"), "HH:mm – HH:mm", "interval format \"Hm\", \"a\"");
			// if the diff field is smaller than the fields in skeleton format, create custom format for a single date
			assert.equal(oLocaleData.getCustomIntervalPattern("yMMM", "d"), "MMM y", "interval format \"yMMM\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "s"), "dd/MM/y, HH:mm", "interval format \"yMdjm\", \"s\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y–y", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "dd/MM/y – dd/MM/y", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Hour: true }), "dd/MM/y, HH:mm–HH:mm", "interval format \"yMdjm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "d–d MMM", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", { Day: true }), "dd–dd MMM", "interval format \"MMMdd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { Hour: true }), "HH:mm–HH:mm", "interval format \"Hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "HH:mm–HH:mm", "interval format \"jm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", { DayPeriod: true, Hour: true }), "h:mm a – h:mm a", "interval format \"hm\", { DayPeriod: true, Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", { Hour: true }), "h:mm – h:mm a", "interval format \"hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("hm", { Year: true }), "h:mm a", "interval format \"hm\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { DayPeriod: true, Hour: true }), "HH:mm–HH:mm", "interval format \"Hm\", { DayPeriod: true, Hour: true }");
			// if the diff field is smaller than the fields in skeleton format, create custom format for a single date
			assert.equal(oLocaleData.getCustomIntervalPattern("yMMM", { Day: true }), "MMM y", "interval format \"yMMM\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Second: true }), "dd/MM/y, HH:mm", "interval format \"yMdjm\", { Second: true }");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ".", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ",", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‐‒–⁻₋−➖﹣-", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getFirstDayOfWeek(), 1, "first day of week"); // TODO decide 0 or 1
			assert.equal(oLocaleData.getWeekendStart(), 6, "weekend start");
			assert.equal(oLocaleData.getWeekendEnd(), 0, "weekend end");
			assert.equal(oLocaleData.getEras("abbreviated")[1], "AD", "Abbreviated Era Name");
			assert.equal(oLocaleData.getEras("abbreviated")[0], "BC", "Abbreviated Era Name");
		},

		en_ZA: function customTests_en_ZA(assert, oLocaleData) {
			assert.equal(oLocaleData.getDatePattern("medium"), "dd MMM y", "date pattern \"medium\"");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), "\xa0", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‐‒–⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
		},

		en_US: function customTests_en_US(assert, oLocaleData) {
			assert.equal(oLocaleData.getDayPeriods("abbreviated")[0], "AM", "day periods \"abbreviated\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("jms"), "h:mm:ss a", "datetime format \"jms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("Jms"), "h:mm:ss", "datetime format \"Jms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdjms"), "EEEE, MMMM d, y 'at' h:mm:ss a", "datetime format \"yMMMMdEEEEjms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdJms"), "EEEE, MMMM d, y 'at' h:mm:ss", "datetime format \"yMMMMdEEEEJms\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "h:mm – h:mm a", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "h:mm – h:mm a", "interval format \"jm\", { Hour: true }");
		},

		he_IL: function customTests_he_IL(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "right-to-left", "orientation");
		},

		fa_IR: function customTests_fa_IR(assert, oLocaleData) {
			assert.equal(oLocaleData.getPreferredCalendarType(), "Persian", "persian calendar preferred");
		},

		fr_FR: function customTests_fr_FR(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "allemand", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "latin", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Allemagne", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "janvier", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "janv.", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "J", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "dimanche", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "dim.", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "D", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "di", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "d MMM y", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} 'à' {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd/MM/y", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "MMM y ('semaine': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "dd/MM/y HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE d MMMM y 'à' HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y ('jour': d) HH 'h' ('seconde': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), "\u202f", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
		},

		ja_JP: function customTests_ja_JP(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "ドイツ語", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "ラテン文字", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "ドイツ", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "1月", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "1月", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "1", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "日曜日", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "日", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "日", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "日", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "y/MM/dd", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "H:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y年", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "Gy年", "datetime format \"y\"");
			// skeleton "yMMMd" has pattern "y年M月d日"
			// "yMMMdd"'s best match should be "yMMMd" and the "day" should be expanded which results in "y年M月dd日"
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMdd"), "y年M月dd日", "datetime format \"yMMMdd\"");
			// "yMMMMd"'s best match should be "yMMMd" and the "month" shouldn't be expanded which results in "y年M月d日"
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMd"), "y年M月d日", "datetime format \"yMMMMd\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y年~y年", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "y/MM/dd~y/MM/dd", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "M月d日~d日", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y年~y年", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "y/MM/dd~y/MM/dd", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "M月d日~d日", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ".", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ",", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.ok(oLocaleData.getCalendarWeek("wide", 0).toLowerCase().indexOf("week") === -1, "calendar week should be translated");
		},

		nl_BE: function customTests_nl_BE(assert, oLocaleData) {
			assert.equal(oLocaleData.getDatePattern("medium"), "d MMM y", "date pattern \"medium\"");
		},

		sr_Latn: function customTests_sr_Latn(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "nemački", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "latinica", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Nemačka", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "januar", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "jan", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "j", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "nedelja", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "ned", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "n", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "ne", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "dd.MM.y.", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short"), "dd.MM.y. HH:mm", "datetime pattern \"medium\", \"short\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y.", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y. G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd.MM.y.", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "MMM y. ('nedelja': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "d.M.y. HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE, d. MMMM y. HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y. ('dan': d) HH ('sekund': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y–y", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "d.M.y. – d.M.y.", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "j"), "d.M.y. HH:mm–HH:mm", "interval format \"yMdjm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "dd.–dd. MMM", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", "d"), "dd.–dd. MMM", "interval format \"MMMdd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "H"), "HH:mm–HH:mm", "interval format \"Hm\", \"H\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "HH:mm–HH:mm", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y–y", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "d.M.y. – d.M.y.", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Hour: true }), "d.M.y. HH:mm–HH:mm", "interval format \"yMdjm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "dd.–dd. MMM", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", { Day: true }), "dd.–dd. MMM", "interval format \"MMMdd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { Hour: true }), "HH:mm–HH:mm", "interval format \"Hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "HH:mm–HH:mm", "interval format \"jm\", { Hour: true }");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ".", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getPluralCategories().length, 3, "four plural forms");
			assert.equal(oLocaleData.getPluralCategories()[0], "one", "special plural form for one");
			assert.equal(oLocaleData.getPluralCategory("0"), "other", "plural category many for 0");
			assert.equal(oLocaleData.getPluralCategory("1"), "one", "plural category one for 1");
			assert.equal(oLocaleData.getPluralCategory("2.0"), "other", "plural category other for 2.0");
			assert.equal(oLocaleData.getPluralCategory("4"), "few", "plural category few for 4");
			assert.equal(oLocaleData.getPluralCategory("10"), "other", "plural category many for 10");
			assert.equal(oLocaleData.getPluralCategory("101"), "one", "plural category one for 101");
		},
		sr: function customTests_sr_Latn(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "немачки", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "латиница", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Немачка", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "јануар", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "јан", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "ј", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "недеља", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "нед", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "н", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "не", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "dd.MM.y.", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1} {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short"), "dd.MM.y. HH:mm", "datetime pattern \"medium\", \"short\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y.", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y. G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd.MM.y.", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "MMM y. ('недеља': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "d.M.y. HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE, d. MMMM y. HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y. ('дан': d) HH ('секунд': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y–y", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "d.M.y. – d.M.y.", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "j"), "d.M.y. HH:mm–HH:mm", "interval format \"yMdjm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "dd.–dd. MMM", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", "d"), "dd.–dd. MMM", "interval format \"MMMdd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "H"), "HH:mm–HH:mm", "interval format \"Hm\", \"H\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "HH:mm–HH:mm", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y–y", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "d.M.y. – d.M.y.", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Hour: true }), "d.M.y. HH:mm–HH:mm", "interval format \"yMdjm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "dd.–dd. MMM", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", { Day: true }), "dd.–dd. MMM", "interval format \"MMMdd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { Hour: true }), "HH:mm–HH:mm", "interval format \"Hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "HH:mm–HH:mm", "interval format \"jm\", { Hour: true }");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), ".", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getPluralCategories().length, 3, "four plural forms");
			assert.equal(oLocaleData.getPluralCategories()[0], "one", "special plural form for one");
			assert.equal(oLocaleData.getPluralCategory("0"), "other", "plural category many for 0");
			assert.equal(oLocaleData.getPluralCategory("1"), "one", "plural category one for 1");
			assert.equal(oLocaleData.getPluralCategory("2.0"), "other", "plural category other for 2.0");
			assert.equal(oLocaleData.getPluralCategory("4"), "few", "plural category few for 4");
			assert.equal(oLocaleData.getPluralCategory("10"), "other", "plural category many for 10");
			assert.equal(oLocaleData.getPluralCategory("101"), "one", "plural category one for 101");
		},

		ru_RU: function customTests_ru_RU(assert, oLocaleData) {
			assert.equal(oLocaleData.getOrientation(), "left-to-right", "orientation");
			assert.equal(oLocaleData.getLanguages()["de"], "немецкий", "language");
			assert.equal(oLocaleData.getScripts()["Latn"], "латиница", "scripts");
			assert.equal(oLocaleData.getTerritories()["DE"], "Германия", "territories");
			assert.equal(oLocaleData.getMonths("wide")[0], "января", "1st month");
			assert.equal(oLocaleData.getMonths("abbreviated")[0], "янв.", "1st month abbreviated");
			assert.equal(oLocaleData.getMonths("narrow")[0], "Я", "1st month narrow");
			assert.equal(oLocaleData.getDays("wide")[0], "воскресенье", "1st day");
			assert.equal(oLocaleData.getDays("abbreviated")[0], "вс", "1st day abbreviated");
			assert.equal(oLocaleData.getDays("narrow")[0], "вс", "1st day narrow");
			assert.equal(oLocaleData.getDays("short")[0], "вс", "1st day short");
			assert.equal(oLocaleData.getDatePattern("medium"), "d MMM y 'г'.", "date pattern \"medium\"");
			assert.equal(oLocaleData.getTimePattern("medium"), "HH:mm:ss", "time pattern \"medium\"");
			assert.equal(oLocaleData.getDateTimePattern("long"), "{1}, {0}", "datetime pattern \"long\"");
			assert.equal(oLocaleData.getCombinedDateTimePattern("medium", "short"), "d MMM y 'г'., HH:mm", "datetime pattern \"medium\", \"short\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y"), "y", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("y", "Japanese"), "y 'г'. G", "datetime format \"y\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMd"), "dd.MM.y", "datetime format \"yMMd\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMw"), "LLL y 'г'. ('неделя': w)", "datetime format \"yMMMw\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMdHms"), "dd.MM.y, HH:mm:ss", "datetime format \"yMdHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("yMMMMEEEEdHms"), "EEEE, d MMMM y 'г'., HH:mm:ss", "datetime format \"yMMMMdEEEEHms\"");
			assert.equal(oLocaleData.getCustomDateTimePattern("ydHs"), "y ('день': d), HH ('секунда': s)", "datetime format \"ydHs\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", "y"), "y–y", "interval format \"y\", \"y\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", "d"), "dd.MM.y – dd.MM.y", "interval format \"yMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", "j"), "dd.MM.y, HH:mm–HH:mm", "interval format \"yMdjm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", "d"), "d–d MMM", "interval format \"MMMd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", "d"), "dd–dd MMM", "interval format \"MMMdd\", \"d\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", "H"), "HH:mm–HH:mm", "interval format \"Hm\", \"H\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", "j"), "HH:mm–HH:mm", "interval format \"jm\", \"j\"");
			assert.equal(oLocaleData.getCustomIntervalPattern("y", { Year: true }), "y–y", "interval format \"y\", { Year: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMd", { Day: true }), "dd.MM.y – dd.MM.y", "interval format \"yMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("yMdjm", { Hour: true }), "dd.MM.y, HH:mm–HH:mm", "interval format \"yMdjm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMd", { Day: true }), "d–d MMM", "interval format \"MMMd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("MMMdd", { Day: true }), "dd–dd MMM", "interval format \"MMMdd\", { Day: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("Hm", { Hour: true }), "HH:mm–HH:mm", "interval format \"Hm\", { Hour: true }");
			assert.equal(oLocaleData.getCustomIntervalPattern("jm", { Hour: true }), "HH:mm–HH:mm", "interval format \"jm\", { Hour: true }");
			assert.equal(oLocaleData.getNumberSymbol("decimal"), ",", "decimal separator");
			assert.equal(oLocaleData.getNumberSymbol("group"), "\xa0", "group separator");
			assert.equal(oLocaleData.getLenientNumberSymbols("minusSign"), "-‒⁻₋−➖﹣-", "Should return the correct minusSign symbols");
			assert.equal(oLocaleData.getLenientNumberSymbols("plusSign"), "+⁺₊➕﬩﹢+", "Should return the correct plusSign symbols");
			assert.equal(oLocaleData.getPluralCategories().length, 4, "four plural forms");
			assert.equal(oLocaleData.getPluralCategories()[0], "one", "special plural form for one");
			assert.equal(oLocaleData.getPluralCategory("0"), "many", "plural category many for 0");
			assert.equal(oLocaleData.getPluralCategory("1"), "one", "plural category one for 1");
			assert.equal(oLocaleData.getPluralCategory("2.0"), "other", "plural category other for 2.0");
			assert.equal(oLocaleData.getPluralCategory("4"), "few", "plural category few for 4");
			assert.equal(oLocaleData.getPluralCategory("10"), "many", "plural category many for 10");
			assert.equal(oLocaleData.getPluralCategory("101"), "one", "plural category one for 101");
		},

		pt_BR: function customTests_pt_BR(assert, oLocaleData) {
			assert.equal(oLocaleData.getFirstDayOfWeek(), 0, "first day of week");
			assert.equal(oLocaleData.getWeekendStart(), 6, "weekend start");
			assert.equal(oLocaleData.getWeekendEnd(), 0, "weekend end");
		},

		pt_PT: function customTests_pt_PT(assert, oLocaleData) {
			assert.equal(oLocaleData.getFirstDayOfWeek(), 0, "first day of week");
			assert.equal(oLocaleData.getWeekendStart(), 6, "weekend start");
			assert.equal(oLocaleData.getWeekendEnd(), 0, "weekend end");
		},

		th_TH: function customTests_th_TH(assert, oLocaleData) {
			assert.equal(oLocaleData.getPreferredCalendarType(), "Buddhist", "buddhist calendar preferred");
		}
	};

	QUnit.module("Generic LocaleData", {
		afterEach : function () {
			Configuration.setLanguage(sDefaultLanguage);
		}
	});

[
	"ar_SA", "de_AT", "de_CH", "de_DE", "da_DK", "en_AU", "en_CA", "en_GB", "en_US", "en_ZA",
	"es_MX", "es_ES", "fa_IR", "fr_FR", "fr_CA", "fr_BE", "ja_JP", "id_ID", "it_IT", "ru_RU",
	"sr_Latn", "sr", "pt_BR", "pt_PT", "hi_IN", "he_IL", "tr_TR", "nl_BE", "nl_NL", "pl_PL",
	"ko_KR", "th_TH", "zh_SG", "zh_TW", "zh_CN", "de_XX", "xx_XX"
].forEach(function (sLanguage) {
	QUnit.test("Locale " + sLanguage, function(assert) {
		var fnCustomTests, sLocale, oLocaleData;

		Configuration.setLanguage(sLanguage);
		sLocale = Configuration.getLanguage();
		oLocaleData = new LocaleData(new Locale(sLocale));
		fnCustomTests = customTests[sLocale];

		genericTests(assert, oLocaleData, sLocale);
		if (fnCustomTests) {
			fnCustomTests(assert, oLocaleData);
		}
	});
});
});


text:
The Kubernetes project welcomes contributions of test results from organizations
that execute e2e test jobs.  This ensures we have coverage of Kubernetes on more
platforms than just those that the Kubernetes project itself can fund or support.

The process is as follows:

- Designate a point of contact (github handle / e-mail / github team) that we can
  reach out to if needed (eg: mitigating flood/drought of data, assisting with
  migrations, etc)
- Create a GCS bucket that is [world-readable](https://cloud.google.com/storage/docs/access-control/making-data-public)
- Run e2e tests (we recommend using [kubetest](/kubetest/README.md))
- Store test results in accordance with [Gubernator's GCS Layout](/gubernator/README.md#gcs-layout)
  - Unfortunately this part is currently left as an exercise to the reader. We use
    [bootstrap](/jenkins/bootstrap.py) to facilitate this and are in the midst of
    rewriting it to better support external usage.
- Add the GCS bucket info to [buckets.yaml](/kettle/buckets.yaml) via a PR (use the
  previously designated github handle for the `contact` field).
- Add jobs and dashboards to the [testgrid config](/testgrid/config.yaml) via
  a PR (use the previously designated point of contact info in a comment next to
  added `test_group`s, or even better in the `description` field for added
  `dashboard_tab`s)

As of this writing, a good example GCS bucket to grep for in this repo would be the
`k8s-conformance-openstack` bucket.

We are actively working on improving this process, which means that this
document may not be kept exactly up-to-date. Feel free to file an issue against
this repo when you run into problems.

We prefer test results that are actively kept up to date and maintained. This is
especially true for testgrid, where stale dashboards clutter up the UI. We may
periodically identify GCS buckets, jobs, or testgrid dashboards that have become
more than 90 days stale and remove them via revertible PR.


text:
package com.globant.plugins;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

import com.atlassian.user.User;
import com.atlassian.bamboo.user.BambooAuthenticationContext;
import com.atlassian.bamboo.plan.Plan;
import com.atlassian.bamboo.plan.PlanHelper;
import com.atlassian.bamboo.plan.PlanManager;
import com.atlassian.bamboo.plugins.git.GitHubRepository;

import static com.google.common.base.Preconditions.*;

/**
 * Created by claudio.melendrez on 22/02/16.
 *
 * Servlet to edit PRBuilderConfig objects.
 */
public class PRBuilderConfigServlet extends HttpServlet {

    private final PRBuilderConfigService prbcService;
    private final PlanManager planManager;
    private final BambooAuthenticationContext authContext;

    public PRBuilderConfigServlet(PRBuilderConfigService prbcService, PlanManager planManager, BambooAuthenticationContext authContext)
    {
        this.prbcService = checkNotNull(prbcService);
        this.planManager = checkNotNull(planManager);
        this.authContext = checkNotNull(authContext);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {
        String action = req.getParameter("action");
        if (action != null && action.equals("delete"))
        {
            int prbcId = Integer.parseInt(req.getParameter("id"));
            this.delete(prbcId);
            res.sendRedirect(req.getContextPath() + "/plugins/servlet/ghprbuilder/config");
        }
        else
        {
            this.list(res);
        }
    }

    protected void delete(int prbcId)
    {
        prbcService.delete(prbcId);
    }

    protected void list(HttpServletResponse res) throws IOException, ServletException
    {
        final PrintWriter w = res.getWriter();
        w.write("
Todos
");

        // the form to post more TODOs
        w.write("<form method=\"post\">");
        w.write("<select name=\"plan-id\"/>");
        for (Plan plan: planManager.getAllPlansUnrestricted())
        {
            w.printf("<option value=\"%s\">%s</option>", plan.getId(), plan.getBuildName());
        }
        w.write("</select>");
        w.write("  ");
        w.write("<button type=\"submit\">Add</button>");
        w.write("</form>");

        w.write("

");
        w.write("
Plan	Repository	Branch	User
");

        for (PRBuilderConfig prbConfig: prbcService.all()) // (2)
        {
            int planId = prbConfig.getPlanId();
            Plan plan = planManager.getPlanById(planId);
            String repoName = "N/A";
            String branchName = "N/A";
            String buildName = "N/A";
            if (plan != null)
            {
                buildName = plan.getBuildName();
                GitHubRepository repo = (GitHubRepository) PlanHelper.getDefaultRepository(plan);
                if (repo != null)
                {
                    repoName = repo.getRepository();
                    branchName = repo.getVcsBranch().getName();
                }
            }

            w.printf("
%s	%s	%s	%s	x
", buildName, repoName, branchName, prbConfig.getUserName(), prbConfig.getID());
        }

        w.write("

");
        w.write("");
        w.close();
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {
        final int planId = Integer.parseInt(req.getParameter("plan-id"));
        User user = authContext.getUser();
        if (user != null)
        {
            prbcService.add(planId, user.getName());
            res.sendRedirect(req.getContextPath() + "/plugins/servlet/ghprbuilder/config");
        }
        else
        {
            res.getWriter().write("Error!");
        }
    }
}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings

PREFIX = getattr(settings, 'TABLE_PREFIX', '')
TABLE_PREFIX = len(PREFIX) > 0 and "%s_" % PREFIX or PREFIX

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Token.for_view'
        db.add_column('%ssession_csrf_token' % TABLE_PREFIX, 'for_view',
                      self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'Token.for_view'
        db.delete_column('%ssession_csrf_token' % TABLE_PREFIX, 'for_view')

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'session_csrf.token': {
            'Meta': {'object_name': 'Token'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'for_view': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'value': ('django.db.models.fields.CharField', [], {'max_length': '32'})
        }
    }

    complete_apps = ['session_csrf']


text:
COMPONENT=PingPong
include ../Makerules


text:
void display_init(void);

void display_update(void);

void display_force_update(void);

void display_clear(U32 updateToo);

void display_goto_xy(int x, int y);

void display_char(int c);

void display_string(const char *str);

void display_int(int val, U32 places);
void display_hex(U32 val, U32 places);

void display_unsigned(U32 val, U32 places);

void display_bitmap_copy(const U8 *data, U32 width, U32 depth, U32 x, U32 y);

void display_test(void);

U8 *display_get_buffer(void);

extern int displayTick;

#endif


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>D-xylose absorption is a laboratory test to determine how well the intestines absorb a simple sugar (D-xylose).</value>
		<pattern_crowdsource> D-xylose absorption is a laboratory test to determine how well the intestines absorb a [[simple sugar|C0026492]] ([[D-xylose|C0043375]]).		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>D-xylose</surface-form>
				<RDF-ID>C0043375</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>laboratory test</surface-form>
				<RDF-ID>C0022885</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>well</surface-form>
				<RDF-ID>C0205170</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intestines</surface-form>
				<RDF-ID>C0021853</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>simple sugar</surface-form>
				<RDF-ID>C0026492</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>D-xylose</surface-form>
				<RDF-ID>C0043375</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0043375 ISA C0026492</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Your health care provider may tell you to stop taking certain drugs that can affect test results.</value>
		<pattern_crowdsource> Your health care provider may tell you to stop taking certain [[drugs|C0013227]] that can affect [[test results|C0456984]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>health care provider</surface-form>
				<RDF-ID>C0018724</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>certain</surface-form>
				<RDF-ID>C0205423</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>drugs</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>test results</surface-form>
				<RDF-ID>C0456984</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0013227 AFFECTS C0456984</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Drugs that can affect test results include aspirin, atropine, indomethacin, isocarboxazid, and phenelzine.</value>
		<pattern_crowdsource> [[Drugs|C0013227]] that can affect [[test results|C0456984]] include aspirin, atropine, indomethacin, isocarboxazid, and phenelzine.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Drugs</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>test results</surface-form>
				<RDF-ID>C0456984</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>aspirin</surface-form>
				<RDF-ID>C0004057</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>atropine</surface-form>
				<RDF-ID>C0004259</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>indomethacin</surface-form>
				<RDF-ID>C0021246</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>isocarboxazid</surface-form>
				<RDF-ID>C0022154</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>phenelzine</surface-form>
				<RDF-ID>C0031392</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0013227 AFFECTS C0456984</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Your doctor may order this test if you have:  - Persistent diarrhea  - Signs of malnutrition  - Unexplained weight loss    This test is primarily used to determine if nutrient absorption problems are due to a disease of the intestines.</value>
		<pattern_crowdsource> Your doctor may order this test if you have:  - Persistent diarrhea  - Signs of malnutrition  - Unexplained weight loss    This test is primarily used to determine if nutrient absorption problems are due to a [[disease|C0012634]] of the [[intestines|C0021853]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>doctor</surface-form>
				<RDF-ID>C0031831</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>test</surface-form>
				<RDF-ID>C0039593</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Persistent</surface-form>
				<RDF-ID>C0205322</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>diarrhea</surface-form>
				<RDF-ID>C0011991</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Signs</surface-form>
				<RDF-ID>C0220913</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>malnutrition</surface-form>
				<RDF-ID>C0162429</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>weight loss</surface-form>
				<RDF-ID>C0043096</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>test</surface-form>
				<RDF-ID>C0039593</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>nutrient absorption</surface-form>
				<RDF-ID>C0021826</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>problems</surface-form>
				<RDF-ID>C1546466</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>disease</surface-form>
				<RDF-ID>C0012634</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intestines</surface-form>
				<RDF-ID>C0021853</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0021853 LOCATION_OF C0012634</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>A positive result means that D-xylose is found in the blood or urine and is therefore being absorbed by the intestines.</value>
		<pattern_crowdsource> A positive result means that [[D-xylose|C0043375]] is found in the [[blood|C0005767]] or urine and is therefore being absorbed by the intestines.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>positive</surface-form>
				<RDF-ID>C1446409</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>result</surface-form>
				<RDF-ID>C1274040</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>D-xylose</surface-form>
				<RDF-ID>C0043375</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood</surface-form>
				<RDF-ID>C0005767</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>urine</surface-form>
				<RDF-ID>C0042036</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intestines</surface-form>
				<RDF-ID>C0021853</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0005767 LOCATION_OF C0043375</triple>
		</triples>
	</Sentence>

</Document>


text:
layout: post
title: Forward and Futures Contract
comments: True
---
[^reference]
**Forward contract** An agreement to buy or sell an asset on a fixed date in the future, called the *delivery time*, for a price specified in advance, called the *forward price*.

**Short forward position** The party who agrees to **sell the asset** is said to be taking a *short forward position*. The other party, who agrees to *buy the asset* at delivery, is said to have a *long forward position*.

**Notations** The time at which forward contract is exchanged is $0$, delivery time $T$, and the forward price $F(0,T)$. The time $t$ market price of the asset be $S(t)$. (No payment is made by any party at time $0$, when the forward contract is exchanged). The payoff at delivery is $S(T)-F(t,T)$ for a long forward position and $F(t,T)-S(T)$ for a short forward position.

## Forward price

Let $r$ denote risk free rate under continuous compounding which is assumed to be constant throughout.

>**Theorem** For a stock paying no dividends, the forward price is
>
> $$F(0,T) = S(0) e^{rT}$$
>
> if the contract is initiated at a time $t<T$, then $F(t,T) = S(t)e^{r(T-t)}$.

The proof of the above theorem can be easily done using no-arbitrage principle.

>**Theorem** The forward price of a stock paying exactly one dividend $d$ at time $t$, where $0<t<T$, is
>
>$$F(0.T) = [S(0) - e^{-rt}d]e^{rT}$$

The proof of the above theorem can also be done using no-arbitrage principle. The above formula can be generalized to the case when dividends are paid more than once:

$$F(0,T) = [S(0) - d_0]e^{rT},$$

where $d_0$ is the present value of all dividends due during the lifetime of the forward contract.

## Dividend yield

Dividends are often paid continuously, with an interest $r_d>0$, the interest is called *(continuous) dividend yield*.

> **Theorem** The forward price for stock paying dividends continuously at a rate $r_d$ is
>
> $$ F(0,T) = S(0)e^{(r-r_d)T}$$
>
> In general, if the contract is initiated at time $t<T$, then
>
> $$F(t,T) = S(t)e^{(r-r_d)(T-t)}$$

## Value of forward contract

The value of a forward contract, at a time $t$, can be defined as *the price one has to pay currently to initiate the forward contract, started at time $0$, with maturity $T$ and payoff $F(0,T)$, at time $t$*. Every forward contract has value zero, when initiated. As the price of the commodity changes, the value of the forward contract too, changes. In particular, at delivery time, the value of a long forward contract is $S(T) - F(0,T)$. The value, of course, can be zero, positive or negative.

> **Theorem** For any $t$ such that $0 \le t \le T$ the time $t$ value of a long forward contract with forward price $F(0,T)$ is given by
>
> $$V(t) = [F(t,T) - F(0,T)]e^{-r(T-t)}$$

It should be noted that the above theorem works fine even if there are dividends involved! Now, for a stock paying no dividends, we see that $V(t) = S(t) - S(0)e^t$.[^1]

# Futures

One of the the two parties of a forward contract will be losing money (unless the payoff at $T$ is $0$). Futures contracts are designed to eliminate such risk. It costs nothing to initiate a futures position.

A *futures contract* involves an underlying asset and a specified time of delivery, a stock with prices $S(n)$ for $n=0,1,\cdots$ and time $T$. In addition to the usual stock prices, the market dictates the so called *futures prices* $f(n,T)$ for each step $n=0,1,\cdots$ such that $n\tau \le T$. A futures contract involves a random cash flow, known as *marking to market*. Namely, at each time set $n=1,2,\cdots$ such that $n\tau \le T$, the holder of **a long futures position** will receive the amount

$$f(n,T) - f(n-1,T)$$

if positive, or will have to pay it if negative. The opposite payments apply for a short futures account. We impose the following two conditions:

 1. The futures price at delivery is $f(T,T) = S(T)$.
 2. At each time step $n=0,1,\cdots$ such that $n\tau \le T$ the value of a futures position is zero.

## Working

* **Initial margin**: Each investor entering into a futures contract has to pay a deposit, called the initial margin, which is kept at the clear house as a collateral. Typically, a fixed percentage of current price of the stock.
* In case of a long futures position, the amount $f(n,T)-f(n-1,T)$ is added to the deposit if positive or subtracted if negative at each time step $n$ (the negative amount is added or subtracted in case of a short futures account).
* **Maintenance margin**: If the deposit falls below a certain level, known as maintenance margin, the clearing house will issue a *margin call*, requesting the investor to make a payment and restore the deposit to the level of *initial margin*.
* The futures position can be closed at any time, in which case the deposit will be returned to the investor. In particular, if the investor fails to respond to the margin call, the clearing house will forcefully close the account.

## Pricing of $f$

> **Theorem** If the interest rate is constant, then $f(0,T) = F(0,T)$.

## Hedging with futures

It is possible to hedge risk associated with a stock by using the futures market, i.e., if you wishes to sell the stock at some point in the future, using a futures account, one can minimize the risk associated with this.

The difference between the spot and futures prices is called the *basis*:

$$ b(t,T) = S(t)- f(t,T)$$

Clearly, the Basis converges to zero as $t\rightarrow T$. In a market with constant interest rates, it is given explicitly by

$$ b(t,T) = S(t)(1-e^{r(T-t)})$$

Similarly, if the asset pays dividends at the rate $r_d>r$, then the basis is positive and is given by

$$ b(t,T) = S(t)(1-e^{(r-r_d)(T-t)})$$

### Hedging with $N$ futures account

We may invest in $N$ futures account to decrease the risk. In this case, the basis is given by $b_{N}(t,T) = S(t) - N f(t,T)$ and hence the variance is:

$$ \text{Var}(b_N(t,T)) = \sigma_s^2 + N^2\sigma_f^2 - 2 N\sigma_s \sigma_f \rho$$

and the quadratic expression has a minimum at

$$ N = \rho \frac{\sigma_s}{\sigma_f}.$$

This ratio is known as **optimal hedge ratio**.

* If the interest rate is constant, it can be easily shown that $N = e^{-r(T-t)}$.

### Futures on stock index

A **stock exchange index** is a weighted average of a selection of stock prices with weights proportional to the market capitalization of stocks. An index of this kind is approximately proportional to the market portfolio. We can treat index as a security, for the purpose of the futures market.

* * *

#### Beta factor

(Topic from Portfolio management)

It is important to understand how the return $K_V$ of a given portfolio or a single security will react to trends affecting the whole market. To this end, we can plot the values of $K_V$ for each market scenario agains those of the return $K_M$ on the market portfolio and compute the line of best fit, also known as the regression line or the charecterestic line. The equation of the best fit will be

$$ y = \beta_V x + \alpha _ V. $$

One can show that the gradient $\beta_V$ and the intercept $\alpha_V$ of the line of best fit,

$$ \beta_V = \frac{\text{Cov}(K_V, K_M)}{\sigma^2_M}, \quad \alpha_V = \mu_V - \beta_V\mu_M. $$

Further, it can be shown that the expected return of a portfolio $\mu_V$ is a linear function of the beta coefficient $\beta_V$ of the portfolio,

$$ \mu_V = r_F + (\mu_M - r_F) \beta_V.$$

where $r_F$ is the risk free return rate.

The expected return on a portfolio over a time step of length $\tau$ is given by

$$ \mu_V = r_F + (\mu_M - r_F)\beta_V$$

* * *

By $V(n)$, we shall denote the value of the portfolio at the $n$th time step and we assume that the index is equal to the market portfolio. Hence the futures price is given by

$$ f(n,T) = M(n)(1+r_F)^{T-n}$$

We can form a new porfolio with value $\bar{V}(n)$ by supplementing the original portfolio with $N$ short futures contract on the index with delivery time $T$. The value of the new portfolio at the nth step is given by

$$ \bar{V}(n) = V(n) -n(f(n,T) - f(n-1,T)) $$

The return on the portfolio in the first step is denoted by $K_{\bar{V}}$.

> **Proposition** If
>
> $$ N = (\beta_V - a)\frac{(1+r_F)V(0)}{f(0,T)} $$
>
> Then $\beta_{\bar{V}} = a$ for any given number $a$.

The proof of the above proposition boils down to calculating $\text{Cov} (K_{\bar{V}}, K_M)/\sigma_M^2$. A straightforward corollary is that when $a=0$, $\beta_{\bar{V}} = 0$ and hence $\mu_{\bar{V}} = r_F$.

### Notes

* In case of hedging with futures account, there can be a possibility of loss or gain because of the marking to the market payments. But this does not exist when one hedges using a forward contract and the only downside of this is the default risk.

* * *

[^1]: <small> Some parts, before section 6.2 Futures are skipped </small>
[^reference]: **Reference** Mathematics for finance, an introduction to financial engineering.


text:
"""
Copyright 2014 Planet Labs, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import unittest
import os

import numpy as np
from osgeo import gdal, gdal_array

from color_balance import image_io as io

class CImageTests(unittest.TestCase):

    def _create_image_with_geotransform(self, filename):
        gdal_ds = gdal.GetDriverByName('GTiff').Create(
            filename, 2, 2, 1, gdal.GDT_UInt16)
        gdal_array.BandWriteArray(
            gdal_ds.GetRasterBand(1),
            np.ones((2,2), dtype=np.uint16))
        gdal_ds.SetGeoTransform([-1.0, 1.0, 0.0, 1.0, 0.0, -1.0])

    def test_create_alpha(self):
        shape = (5, 5)
        expected_alpha = 255 * np.ones((5, 5), dtype=np.uint8)

        alpha_from_shape_cimage = io.CImage()
        alpha_from_shape_cimage.create_alpha(shape)
        np.testing.assert_array_equal(
            alpha_from_shape_cimage.alpha, expected_alpha)

        band = np.ones((5, 5), dtype=np.uint8)
        alpha_from_band_cimage = io.CImage()
        alpha_from_band_cimage.bands=[band]
        alpha_from_band_cimage.create_alpha()
        np.testing.assert_array_equal(
            alpha_from_band_cimage.alpha, expected_alpha)

    def test_load(self):
        input_file = 'test_file.tif'
        self._create_image_with_geotransform(input_file)
        test_cimage = io.CImage()
        test_cimage.load(input_file)

        test_geotransform = test_cimage.metadata['geotransform']
        self.assertEquals(test_geotransform, (-1.0, 1.0, 0.0, 1.0, 0.0, -1.0))

        os.unlink(input_file)

    def test_save(self):
        output_file = 'test_file.tif'
        test_band = 255 * np.ones((5, 5), dtype=np.uint8)
        test_cimage = io.CImage()
        test_cimage.bands = [test_band]
        test_cimage.save(output_file)

        test_ds = gdal.Open(output_file)

        saved_number_of_bands = test_ds.RasterCount
        self.assertEquals(saved_number_of_bands, 1)

        saved_band = test_ds.GetRasterBand(1).ReadAsArray()
        np.testing.assert_array_equal(saved_band, test_band)

        os.unlink(output_file)

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


text:
<?php

namespace Apps\Controller\Admin\Content;

use Apps\ActiveRecord\Content as ContentEntity;
use Apps\Model\Admin\Content\FormContentDelete;
use Ffcms\Core\App;
use Ffcms\Core\Arch\View;
use Ffcms\Core\Exception\NotFoundException;
use Ffcms\Core\Helper\Type\Any;
use Ffcms\Core\Network\Request;
use Ffcms\Core\Network\Response;

/**
 * Trait ActionDelete
 * @package Apps\Controller\Admin\Content
 * @property Request $request
 * @property Response $response
 * @property View $view
 */
trait ActionDelete
{
    /**
     * Delete content by id
     * @param string $id
     * @return string
     * @throws \Exception
     */
    public function delete(string $id): ?string
    {
        if (!Any::isInt($id) || $id < 1) {
            throw new NotFoundException();
        }

        // get content record and check availability
        $record = ContentEntity::find($id);
        if (!$record) {
            throw new NotFoundException();
        }

        // init delete model
        $model = new FormContentDelete($record);
        if ($model->send() && $model->validate()) {
            $model->make();
            App::$Session->getFlashBag()->add('success', __('Content is successful moved to trash'));
            $this->response->redirect('content/index');
        }

        return $this->view->render('content/content_delete', [
            'model' => $model
        ]);
    }
}


text:
namespace Judge.Application.ViewModels.Admin.Users
{
    public sealed class UserListItem
    {
        public long Id { get; set; }
        public string UserName { get; set; }
        public string Email { get; set; }
    }
}