text:
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
  <meta charset="utf-8">
  <meta http-equiv="cache-control" content="no-cache" />
  <meta http-equiv="expires" content="0" />
  <title>Jasmine Spec Runner</title>
  <link rel="stylesheet" type="text/css" href="lib/jasmine/jasmine.css">

  <link rel="stylesheet" type="text/css" href="css/SpecRunner.css">

  <link rel="stylesheet" type="text/css" href="../../dist/handsontable.css">

  <link rel="stylesheet" type="text/css" href="../../plugins/removeRow/handsontable.removeRow.css">

  <link rel="stylesheet" type="text/css" href="../../lib/jquery-ui/css/ui-bootstrap/jquery-ui.custom.css">

  <script src="lib/jasmine/phantom-polyfill.js"></script>
  <script src="lib/jasmine/jasmine.js"></script>
  <script src="lib/jasmine/jasmine-html.js"></script>

  <script>
    document.writeln('<scr' + 'ipt src="../../lib/jquery.min.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../lib/numeral.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../lib/numeral.de-de.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="lib/jasmine-extensions.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="spec/SpecHelper.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="spec/MobileSpecHelper.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="lib/nodeShim.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="spec/test-init.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../dist/handsontable.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../demo/js/backbone/lodash.underscore.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../demo/js/backbone/backbone.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../demo/js/backbone/backbone-relational/backbone-relational.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../lib/jquery-ui/js/jquery-ui.custom.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../plugins/removeRow/handsontable.removeRow.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="spec/mobile/mobileTextEditorSpec.js"></scr' + 'ipt>');
  </script>

  <script>
    document.writeln('<scr' + 'ipt src="../../src/plugins/multipleSelectionHandles/test/mobile/multipleSelectionHandles.spec.js"></scr' + 'ipt>');
  </script>

  <script src="lib/jasmine/reporter.js"></script>
  <script src="lib/jquery.simulate.js"></script>
  <script src="lib/jasmine/jasmine-helper.js"></script>

</head>
<body>
</body>
</html>


text:
/******************************************************************************
 *
 * Name: acexcep.h - Exception codes returned by the ACPI subsystem
 *
 *****************************************************************************/

/*
 * Copyright (C) 2000 - 2013, Intel Corp.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#ifndef __ACEXCEP_H__
#define __ACEXCEP_H__

/* This module contains all possible exception codes for ACPI_STATUS */

/*
 * Exception code classes
 */
#define AE_CODE_ENVIRONMENTAL           0x0000 /* General ACPICA environment */
#define AE_CODE_PROGRAMMER              0x1000 /* External ACPICA interface caller */
#define AE_CODE_ACPI_TABLES             0x2000 /* ACPI tables */
#define AE_CODE_AML                     0x3000 /* From executing AML code */
#define AE_CODE_CONTROL                 0x4000 /* Internal control codes */

#define AE_CODE_MAX                     0x4000
#define AE_CODE_MASK                    0xF000

/*
 * Macros to insert the exception code classes
 */
#define EXCEP_ENV(code)                 ((ACPI_STATUS) (code | AE_CODE_ENVIRONMENTAL))
#define EXCEP_PGM(code)                 ((ACPI_STATUS) (code | AE_CODE_PROGRAMMER))
#define EXCEP_TBL(code)                 ((ACPI_STATUS) (code | AE_CODE_ACPI_TABLES))
#define EXCEP_AML(code)                 ((ACPI_STATUS) (code | AE_CODE_AML))
#define EXCEP_CTL(code)                 ((ACPI_STATUS) (code | AE_CODE_CONTROL))

/*
 * Exception info table. The "Description" field is used only by the
 * ACPICA help application (acpihelp).
 */
typedef struct acpi_exception_info
{
    char                *Name;

#ifdef ACPI_HELP_APP
    char                *Description;
#endif
} ACPI_EXCEPTION_INFO;

#ifdef ACPI_HELP_APP
#define EXCEP_TXT(Name,Description)     {Name, Description}
#else
#define EXCEP_TXT(Name,Description)     {Name}
#endif

/*
 * Success is always zero, failure is non-zero
 */
#define ACPI_SUCCESS(a)                 (!(a))
#define ACPI_FAILURE(a)                 (a)

#define AE_OK                           (ACPI_STATUS) 0x0000

/*
 * Environmental exceptions
 */
#define AE_ERROR                        EXCEP_ENV (0x0001)
#define AE_NO_ACPI_TABLES               EXCEP_ENV (0x0002)
#define AE_NO_NAMESPACE                 EXCEP_ENV (0x0003)
#define AE_NO_MEMORY                    EXCEP_ENV (0x0004)
#define AE_NOT_FOUND                    EXCEP_ENV (0x0005)
#define AE_NOT_EXIST                    EXCEP_ENV (0x0006)
#define AE_ALREADY_EXISTS               EXCEP_ENV (0x0007)
#define AE_TYPE                         EXCEP_ENV (0x0008)
#define AE_NULL_OBJECT                  EXCEP_ENV (0x0009)
#define AE_NULL_ENTRY                   EXCEP_ENV (0x000A)
#define AE_BUFFER_OVERFLOW              EXCEP_ENV (0x000B)
#define AE_STACK_OVERFLOW               EXCEP_ENV (0x000C)
#define AE_STACK_UNDERFLOW              EXCEP_ENV (0x000D)
#define AE_NOT_IMPLEMENTED              EXCEP_ENV (0x000E)
#define AE_SUPPORT                      EXCEP_ENV (0x000F)
#define AE_LIMIT                        EXCEP_ENV (0x0010)
#define AE_TIME                         EXCEP_ENV (0x0011)
#define AE_ACQUIRE_DEADLOCK             EXCEP_ENV (0x0012)
#define AE_RELEASE_DEADLOCK             EXCEP_ENV (0x0013)
#define AE_NOT_ACQUIRED                 EXCEP_ENV (0x0014)
#define AE_ALREADY_ACQUIRED             EXCEP_ENV (0x0015)
#define AE_NO_HARDWARE_RESPONSE         EXCEP_ENV (0x0016)
#define AE_NO_GLOBAL_LOCK               EXCEP_ENV (0x0017)
#define AE_ABORT_METHOD                 EXCEP_ENV (0x0018)
#define AE_SAME_HANDLER                 EXCEP_ENV (0x0019)
#define AE_NO_HANDLER                   EXCEP_ENV (0x001A)
#define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
#define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)

#define AE_CODE_ENV_MAX                 0x001C

/*
 * Programmer exceptions
 */
#define AE_BAD_PARAMETER                EXCEP_PGM (0x0001)
#define AE_BAD_CHARACTER                EXCEP_PGM (0x0002)
#define AE_BAD_PATHNAME                 EXCEP_PGM (0x0003)
#define AE_BAD_DATA                     EXCEP_PGM (0x0004)
#define AE_BAD_HEX_CONSTANT             EXCEP_PGM (0x0005)
#define AE_BAD_OCTAL_CONSTANT           EXCEP_PGM (0x0006)
#define AE_BAD_DECIMAL_CONSTANT         EXCEP_PGM (0x0007)
#define AE_MISSING_ARGUMENTS            EXCEP_PGM (0x0008)
#define AE_BAD_ADDRESS                  EXCEP_PGM (0x0009)

#define AE_CODE_PGM_MAX                 0x0009

/*
 * Acpi table exceptions
 */
#define AE_BAD_SIGNATURE                EXCEP_TBL (0x0001)
#define AE_BAD_HEADER                   EXCEP_TBL (0x0002)
#define AE_BAD_CHECKSUM                 EXCEP_TBL (0x0003)
#define AE_BAD_VALUE                    EXCEP_TBL (0x0004)
#define AE_INVALID_TABLE_LENGTH         EXCEP_TBL (0x0005)

#define AE_CODE_TBL_MAX                 0x0005

/*
 * AML exceptions. These are caused by problems with
 * the actual AML byte stream
 */
#define AE_AML_BAD_OPCODE               EXCEP_AML (0x0001)
#define AE_AML_NO_OPERAND               EXCEP_AML (0x0002)
#define AE_AML_OPERAND_TYPE             EXCEP_AML (0x0003)
#define AE_AML_OPERAND_VALUE            EXCEP_AML (0x0004)
#define AE_AML_UNINITIALIZED_LOCAL      EXCEP_AML (0x0005)
#define AE_AML_UNINITIALIZED_ARG        EXCEP_AML (0x0006)
#define AE_AML_UNINITIALIZED_ELEMENT    EXCEP_AML (0x0007)
#define AE_AML_NUMERIC_OVERFLOW         EXCEP_AML (0x0008)
#define AE_AML_REGION_LIMIT             EXCEP_AML (0x0009)
#define AE_AML_BUFFER_LIMIT             EXCEP_AML (0x000A)
#define AE_AML_PACKAGE_LIMIT            EXCEP_AML (0x000B)
#define AE_AML_DIVIDE_BY_ZERO           EXCEP_AML (0x000C)
#define AE_AML_BAD_NAME                 EXCEP_AML (0x000D)
#define AE_AML_NAME_NOT_FOUND           EXCEP_AML (0x000E)
#define AE_AML_INTERNAL                 EXCEP_AML (0x000F)
#define AE_AML_INVALID_SPACE_ID         EXCEP_AML (0x0010)
#define AE_AML_STRING_LIMIT             EXCEP_AML (0x0011)
#define AE_AML_NO_RETURN_VALUE          EXCEP_AML (0x0012)
#define AE_AML_METHOD_LIMIT             EXCEP_AML (0x0013)
#define AE_AML_NOT_OWNER                EXCEP_AML (0x0014)
#define AE_AML_MUTEX_ORDER              EXCEP_AML (0x0015)
#define AE_AML_MUTEX_NOT_ACQUIRED       EXCEP_AML (0x0016)
#define AE_AML_INVALID_RESOURCE_TYPE    EXCEP_AML (0x0017)
#define AE_AML_INVALID_INDEX            EXCEP_AML (0x0018)
#define AE_AML_REGISTER_LIMIT           EXCEP_AML (0x0019)
#define AE_AML_NO_WHILE                 EXCEP_AML (0x001A)
#define AE_AML_ALIGNMENT                EXCEP_AML (0x001B)
#define AE_AML_NO_RESOURCE_END_TAG      EXCEP_AML (0x001C)
#define AE_AML_BAD_RESOURCE_VALUE       EXCEP_AML (0x001D)
#define AE_AML_CIRCULAR_REFERENCE       EXCEP_AML (0x001E)
#define AE_AML_BAD_RESOURCE_LENGTH      EXCEP_AML (0x001F)
#define AE_AML_ILLEGAL_ADDRESS          EXCEP_AML (0x0020)
#define AE_AML_INFINITE_LOOP            EXCEP_AML (0x0021)

#define AE_CODE_AML_MAX                 0x0021

/*
 * Internal exceptions used for control
 */
#define AE_CTRL_RETURN_VALUE            EXCEP_CTL (0x0001)
#define AE_CTRL_PENDING                 EXCEP_CTL (0x0002)
#define AE_CTRL_TERMINATE               EXCEP_CTL (0x0003)
#define AE_CTRL_TRUE                    EXCEP_CTL (0x0004)
#define AE_CTRL_FALSE                   EXCEP_CTL (0x0005)
#define AE_CTRL_DEPTH                   EXCEP_CTL (0x0006)
#define AE_CTRL_END                     EXCEP_CTL (0x0007)
#define AE_CTRL_TRANSFER                EXCEP_CTL (0x0008)
#define AE_CTRL_BREAK                   EXCEP_CTL (0x0009)
#define AE_CTRL_CONTINUE                EXCEP_CTL (0x000A)
#define AE_CTRL_SKIP                    EXCEP_CTL (0x000B)
#define AE_CTRL_PARSE_CONTINUE          EXCEP_CTL (0x000C)
#define AE_CTRL_PARSE_PENDING           EXCEP_CTL (0x000D)

#define AE_CODE_CTRL_MAX                0x000D

/* Exception strings for AcpiFormatException */

#ifdef ACPI_DEFINE_EXCEPTION_TABLE

/*
 * String versions of the exception codes above
 * These strings must match the corresponding defines exactly
 */
static const ACPI_EXCEPTION_INFO    AcpiGbl_ExceptionNames_Env[] =
{
    EXCEP_TXT ("AE_OK",                         "No error"),
    EXCEP_TXT ("AE_ERROR",                      "Unspecified error"),
    EXCEP_TXT ("AE_NO_ACPI_TABLES",             "ACPI tables could not be found"),
    EXCEP_TXT ("AE_NO_NAMESPACE",               "A namespace has not been loaded"),
    EXCEP_TXT ("AE_NO_MEMORY",                  "Insufficient dynamic memory"),
    EXCEP_TXT ("AE_NOT_FOUND",                  "The name was not found in the namespace"),
    EXCEP_TXT ("AE_NOT_EXIST",                  "A required entity does not exist"),
    EXCEP_TXT ("AE_ALREADY_EXISTS",             "An entity already exists"),
    EXCEP_TXT ("AE_TYPE",                       "The object type is incorrect"),
    EXCEP_TXT ("AE_NULL_OBJECT",                "A required object was missing"),
    EXCEP_TXT ("AE_NULL_ENTRY",                 "The requested object does not exist"),
    EXCEP_TXT ("AE_BUFFER_OVERFLOW",            "The buffer provided is too small"),
    EXCEP_TXT ("AE_STACK_OVERFLOW",             "An internal stack overflowed"),
    EXCEP_TXT ("AE_STACK_UNDERFLOW",            "An internal stack underflowed"),
    EXCEP_TXT ("AE_NOT_IMPLEMENTED",            "The feature is not implemented"),
    EXCEP_TXT ("AE_SUPPORT",                    "The feature is not supported"),
    EXCEP_TXT ("AE_LIMIT",                      "A predefined limit was exceeded"),
    EXCEP_TXT ("AE_TIME",                       "A time limit or timeout expired"),
    EXCEP_TXT ("AE_ACQUIRE_DEADLOCK",           "Internal error, attempt was made to acquire a mutex in improper order"),
    EXCEP_TXT ("AE_RELEASE_DEADLOCK",           "Internal error, attempt was made to release a mutex in improper order"),
    EXCEP_TXT ("AE_NOT_ACQUIRED",               "An attempt to release a mutex or Global Lock without a previous acquire"),
    EXCEP_TXT ("AE_ALREADY_ACQUIRED",           "Internal error, attempt was made to acquire a mutex twice"),
    EXCEP_TXT ("AE_NO_HARDWARE_RESPONSE",       "Hardware did not respond after an I/O operation"),
    EXCEP_TXT ("AE_NO_GLOBAL_LOCK",             "There is no FACS Global Lock"),
    EXCEP_TXT ("AE_ABORT_METHOD",               "A control method was aborted"),
    EXCEP_TXT ("AE_SAME_HANDLER",               "Attempt was made to install the same handler that is already installed"),
    EXCEP_TXT ("AE_NO_HANDLER",                 "A handler for the operation is not installed"),
    EXCEP_TXT ("AE_OWNER_ID_LIMIT",             "There are no more Owner IDs available for ACPI tables or control methods"),
    EXCEP_TXT ("AE_NOT_CONFIGURED",             "The interface is not part of the current subsystem configuration")
};

static const ACPI_EXCEPTION_INFO    AcpiGbl_ExceptionNames_Pgm[] =
{
    EXCEP_TXT (NULL, NULL),
    EXCEP_TXT ("AE_BAD_PARAMETER",              "A parameter is out of range or invalid"),
    EXCEP_TXT ("AE_BAD_CHARACTER",              "An invalid character was found in a name"),
    EXCEP_TXT ("AE_BAD_PATHNAME",               "An invalid character was found in a pathname"),
    EXCEP_TXT ("AE_BAD_DATA",                   "A package or buffer contained incorrect data"),
    EXCEP_TXT ("AE_BAD_HEX_CONSTANT",           "Invalid character in a Hex constant"),
    EXCEP_TXT ("AE_BAD_OCTAL_CONSTANT",         "Invalid character in an Octal constant"),
    EXCEP_TXT ("AE_BAD_DECIMAL_CONSTANT",       "Invalid character in a Decimal constant"),
    EXCEP_TXT ("AE_MISSING_ARGUMENTS",          "Too few arguments were passed to a control method"),
    EXCEP_TXT ("AE_BAD_ADDRESS",                "An illegal null I/O address")
};

static const ACPI_EXCEPTION_INFO    AcpiGbl_ExceptionNames_Tbl[] =
{
    EXCEP_TXT (NULL, NULL),
    EXCEP_TXT ("AE_BAD_SIGNATURE",              "An ACPI table has an invalid signature"),
    EXCEP_TXT ("AE_BAD_HEADER",                 "Invalid field in an ACPI table header"),
    EXCEP_TXT ("AE_BAD_CHECKSUM",               "An ACPI table checksum is not correct"),
    EXCEP_TXT ("AE_BAD_VALUE",                  "An invalid value was found in a table"),
    EXCEP_TXT ("AE_INVALID_TABLE_LENGTH",       "The FADT or FACS has improper length")
};

static const ACPI_EXCEPTION_INFO    AcpiGbl_ExceptionNames_Aml[] =
{
    EXCEP_TXT (NULL, NULL),
    EXCEP_TXT ("AE_AML_BAD_OPCODE",             "Invalid AML opcode encountered"),
    EXCEP_TXT ("AE_AML_NO_OPERAND",             "A required operand is missing"),
    EXCEP_TXT ("AE_AML_OPERAND_TYPE",           "An operand of an incorrect type was encountered"),
    EXCEP_TXT ("AE_AML_OPERAND_VALUE",          "The operand had an inappropriate or invalid value"),
    EXCEP_TXT ("AE_AML_UNINITIALIZED_LOCAL",    "Method tried to use an uninitialized local variable"),
    EXCEP_TXT ("AE_AML_UNINITIALIZED_ARG",      "Method tried to use an uninitialized argument"),
    EXCEP_TXT ("AE_AML_UNINITIALIZED_ELEMENT",  "Method tried to use an empty package element"),
    EXCEP_TXT ("AE_AML_NUMERIC_OVERFLOW",       "Overflow during BCD conversion or other"),
    EXCEP_TXT ("AE_AML_REGION_LIMIT",           "Tried to access beyond the end of an Operation Region"),
    EXCEP_TXT ("AE_AML_BUFFER_LIMIT",           "Tried to access beyond the end of a buffer"),
    EXCEP_TXT ("AE_AML_PACKAGE_LIMIT",          "Tried to access beyond the end of a package"),
    EXCEP_TXT ("AE_AML_DIVIDE_BY_ZERO",         "During execution of AML Divide operator"),
    EXCEP_TXT ("AE_AML_BAD_NAME",               "An ACPI name contains invalid character(s)"),
    EXCEP_TXT ("AE_AML_NAME_NOT_FOUND",         "Could not resolve a named reference"),
    EXCEP_TXT ("AE_AML_INTERNAL",               "An internal error within the interprete"),
    EXCEP_TXT ("AE_AML_INVALID_SPACE_ID",       "An Operation Region SpaceID is invalid"),
    EXCEP_TXT ("AE_AML_STRING_LIMIT",           "String is longer than 200 characters"),
    EXCEP_TXT ("AE_AML_NO_RETURN_VALUE",        "A method did not return a required value"),
    EXCEP_TXT ("AE_AML_METHOD_LIMIT",           "A control method reached the maximum reentrancy limit of 255"),
    EXCEP_TXT ("AE_AML_NOT_OWNER",              "A thread tried to release a mutex that it does not own"),
    EXCEP_TXT ("AE_AML_MUTEX_ORDER",            "Mutex SyncLevel release mismatch"),
    EXCEP_TXT ("AE_AML_MUTEX_NOT_ACQUIRED",     "Attempt to release a mutex that was not previously acquired"),
    EXCEP_TXT ("AE_AML_INVALID_RESOURCE_TYPE",  "Invalid resource type in resource list"),
    EXCEP_TXT ("AE_AML_INVALID_INDEX",          "Invalid Argx or Localx (x too large)"),
    EXCEP_TXT ("AE_AML_REGISTER_LIMIT",         "Bank value or Index value beyond range of register"),
    EXCEP_TXT ("AE_AML_NO_WHILE",               "Break or Continue without a While"),
    EXCEP_TXT ("AE_AML_ALIGNMENT",              "Non-aligned memory transfer on platform that does not support this"),
    EXCEP_TXT ("AE_AML_NO_RESOURCE_END_TAG",    "No End Tag in a resource list"),
    EXCEP_TXT ("AE_AML_BAD_RESOURCE_VALUE",     "Invalid value of a resource element"),
    EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE",     "Two references refer to each other"),
    EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH",    "The length of a Resource Descriptor in the AML is incorrect"),
    EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS",        "A memory, I/O, or PCI configuration address is invalid"),
    EXCEP_TXT ("AE_AML_INFINITE_LOOP",          "An apparent infinite AML While loop, method was aborted")
};

static const ACPI_EXCEPTION_INFO    AcpiGbl_ExceptionNames_Ctrl[] =
{
    EXCEP_TXT (NULL, NULL),
    EXCEP_TXT ("AE_CTRL_RETURN_VALUE",          "A Method returned a value"),
    EXCEP_TXT ("AE_CTRL_PENDING",               "Method is calling another method"),
    EXCEP_TXT ("AE_CTRL_TERMINATE",             "Terminate the executing method"),
    EXCEP_TXT ("AE_CTRL_TRUE",                  "An If or While predicate result"),
    EXCEP_TXT ("AE_CTRL_FALSE",                 "An If or While predicate result"),
    EXCEP_TXT ("AE_CTRL_DEPTH",                 "Maximum search depth has been reached"),
    EXCEP_TXT ("AE_CTRL_END",                   "An If or While predicate is false"),
    EXCEP_TXT ("AE_CTRL_TRANSFER",              "Transfer control to called method"),
    EXCEP_TXT ("AE_CTRL_BREAK",                 "A Break has been executed"),
    EXCEP_TXT ("AE_CTRL_CONTINUE",              "A Continue has been executed"),
    EXCEP_TXT ("AE_CTRL_SKIP",                  "Not currently used"),
    EXCEP_TXT ("AE_CTRL_PARSE_CONTINUE",        "Used to skip over bad opcodes"),
    EXCEP_TXT ("AE_CTRL_PARSE_PENDING",         "Used to implement AML While loops")
};

#endif /* EXCEPTION_TABLE */

#endif /* __ACEXCEP_H__ */

redpajama_set_name: RedPajamaGithub


text:
import * as vscode from 'vscode';
import * as path from 'path';

import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { TableOfContentsProvider } from '../tableOfContentsProvider';
import { isMarkdownFile } from '../util/file';

export interface OpenDocumentLinkArgs {
	path: string;
	fragment: string;
}

export class OpenDocumentLinkCommand implements Command {
	private static readonly id = '_markdown.openDocumentLink';
	public readonly id = OpenDocumentLinkCommand.id;

	public static createCommandUri(
		path: string,
		fragment: string
	): vscode.Uri {
		return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`);
	}

	public constructor(
		private readonly engine: MarkdownEngine
	) { }

	public execute(args: OpenDocumentLinkArgs) {
		const p = decodeURIComponent(args.path);
		return this.tryOpen(p, args).catch(() => {
			if (path.extname(p) === '') {
				return this.tryOpen(p + '.md', args);
			}
			const resource = vscode.Uri.file(p);
			return Promise.resolve(void 0)
				.then(() => vscode.commands.executeCommand('vscode.open', resource))
				.then(() => void 0);
		});
	}

	private async tryOpen(path: string, args: OpenDocumentLinkArgs) {
		const resource = vscode.Uri.file(path);
		if (vscode.window.activeTextEditor && isMarkdownFile(vscode.window.activeTextEditor.document) && vscode.window.activeTextEditor.document.uri.fsPath === resource.fsPath) {
			return this.tryRevealLine(vscode.window.activeTextEditor, args.fragment);
		} else {
			return vscode.workspace.openTextDocument(resource)
				.then(vscode.window.showTextDocument)
				.then(editor => this.tryRevealLine(editor, args.fragment));
		}
	}

	private async tryRevealLine(editor: vscode.TextEditor, fragment?: string) {
		if (editor && fragment) {
			const toc = new TableOfContentsProvider(this.engine, editor.document);
			const entry = await toc.lookup(fragment);
			if (entry) {
				return editor.revealRange(new vscode.Range(entry.line, 0, entry.line, 0), vscode.TextEditorRevealType.AtTop);
			}
			const lineNumberFragment = fragment.match(/^L(\d+)$/i);
			if (lineNumberFragment) {
				const line = +lineNumberFragment[1] - 1;
				if (!isNaN(line)) {
					return editor.revealRange(new vscode.Range(line, 0, line, 0), vscode.TextEditorRevealType.AtTop);
				}
			}
		}
	}
}


text:
package org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.string;

import com.google.common.collect.ImmutableMap;
import java.util.List;
import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlExpression;
import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlPrimitive;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.values.Row;
import org.apache.calcite.sql.type.SqlTypeName;

/** 'LOWER' operator. */
public class BeamSqlLowerExpression extends BeamSqlStringUnaryExpression {
  public BeamSqlLowerExpression(List<BeamSqlExpression> operands) {
    super(operands, SqlTypeName.VARCHAR);
  }

  @Override
  public BeamSqlPrimitive evaluate(
      Row inputRow, BoundedWindow window, ImmutableMap<Integer, Object> correlateEnv) {
    String str = opValueEvaluated(0, inputRow, window, correlateEnv);
    return BeamSqlPrimitive.of(SqlTypeName.VARCHAR, str.toLowerCase());
  }
}


text:
namespace Doge.Web.Models
{
    using Newtonsoft.Json;
    using System;
    using System.Xml.Linq;

    public class LogEvent
    {
        [JsonProperty("id")]
        public int Id { get; set; }

        [JsonProperty("data")]
        public XDocument Data { get; set; }

        [JsonProperty("logged_at")]
        public DateTime LoggedAt {get;set;}
    }
}


text:
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");

local function constructNew_frmRecordListFormExperience()
    local obj = GUI.fromHandle(_obj_newObject("form"));
    local self = obj;
    local sheet = nil;

    rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject"));

    function obj:setNodeObject(nodeObject)
        sheet = nodeObject;
        self.sheet = nodeObject;
        self:_oldSetNodeObjectFunction(nodeObject);
    end;

    function obj:setNodeDatabase(nodeObject)
        self:setNodeObject(nodeObject);
    end;

    _gui_assignInitialParentForForm(obj.handle);
    obj:beginUpdate();
    obj:setName("frmRecordListFormExperience");
    obj:setWidth(150);
    obj:setHeight(25);
    obj:setMargins({top=1});

    obj.rectangle1 = GUI.fromHandle(_obj_newObject("rectangle"));
    obj.rectangle1:setParent(obj);
    obj.rectangle1:setAlign("client");
    obj.rectangle1:setColor("#212121");
    obj.rectangle1:setName("rectangle1");

    obj.edit1 = GUI.fromHandle(_obj_newObject("edit"));
    obj.edit1:setParent(obj.rectangle1);
    obj.edit1:setLeft(0);
    obj.edit1:setTop(0);
    obj.edit1:setWidth(30);
    obj.edit1:setHeight(25);
    obj.edit1:setField("contador");
    obj.edit1:setType("number");
    obj.edit1:setName("edit1");

    obj.edit2 = GUI.fromHandle(_obj_newObject("edit"));
    obj.edit2:setParent(obj.rectangle1);
    obj.edit2:setLeft(30);
    obj.edit2:setTop(0);
    obj.edit2:setWidth(95);
    obj.edit2:setHeight(25);
    obj.edit2:setField("valor");
    obj.edit2:setType("number");
    obj.edit2:setName("edit2");

    obj.button1 = GUI.fromHandle(_obj_newObject("button"));
    obj.button1:setParent(obj.rectangle1);
    obj.button1:setLeft(125);
    obj.button1:setTop(0);
    obj.button1:setWidth(25);
    obj.button1:setHeight(25);
    obj.button1:setText("X");
    obj.button1:setName("button1");

    obj.dataLink1 = GUI.fromHandle(_obj_newObject("dataLink"));
    obj.dataLink1:setParent(obj.rectangle1);
    obj.dataLink1:setField("valor");
    obj.dataLink1:setName("dataLink1");

    obj._e_event0 = obj.edit1:addEventListener("onChange",
        function (_)
            -- Atualiza a ordem lista a cada alteração
            				local rcl = self:findControlByName("rclExperience");
            				if rcl~=nil then
            					rcl:sort();
            				end;
        end, obj);

    obj._e_event1 = obj.button1:addEventListener("onClick",
        function (_)
            dialogs.confirmOkCancel("Tem certeza que quer apagar essa Experiência?",
            					function (confirmado)
            						if confirmado then
            							ndb.deleteNode(sheet);
            						end;
            				end);
        end, obj);

    obj._e_event2 = obj.dataLink1:addEventListener("onChange",
        function (_, field, oldValue, newValue)
            if sheet~= nil then
            		        	local box = self:findControlByName("boxDetalhesDoItem");
            					if box~=nil then
            						local node = box.node;

            						local objetos = ndb.getChildNodes(node.listaDeExperiencia);
            						local soma = 0;

            						for i=1, #objetos, 1 do
            							soma = soma + (tonumber(objetos[i].valor) or 0);
            						end;

            						local mod = "" .. soma;

            						while true do
            							mod, k = string.gsub(mod, "^(-?%d+)(%d%d%d)", '%1,%2')
            							if (k==0) then
            							  break
            							end
            						end
            						mod = string.gsub(mod, ",", ".");

            						node.XP = mod;
            					end;
            				end;
        end, obj);

    function obj:_releaseEvents()
        __o_rrpgObjs.removeEventListenerById(self._e_event2);
        __o_rrpgObjs.removeEventListenerById(self._e_event1);
        __o_rrpgObjs.removeEventListenerById(self._e_event0);
    end;

    obj._oldLFMDestroy = obj.destroy;

    function obj:destroy()
        self:_releaseEvents();

        if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then
          self:setNodeDatabase(nil);
        end;

        if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end;
        if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end;
        if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end;
        if self.button1 ~= nil then self.button1:destroy(); self.button1 = nil; end;
        if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end;
        self:_oldLFMDestroy();
    end;

    obj:endUpdate();

    return obj;
end;

function newfrmRecordListFormExperience()
    local retObj = nil;
    __o_rrpgObjs.beginObjectsLoading();

    __o_Utils.tryFinally(
      function()
        retObj = constructNew_frmRecordListFormExperience();
      end,
      function()
        __o_rrpgObjs.endObjectsLoading();
      end);

    assert(retObj ~= nil);
    return retObj;
end;

local _frmRecordListFormExperience = {
    newEditor = newfrmRecordListFormExperience,
    new = newfrmRecordListFormExperience,
    name = "frmRecordListFormExperience",
    dataType = "",
    formType = "undefined",
    formComponentName = "form",
    title = "",
    description=""};

frmRecordListFormExperience = _frmRecordListFormExperience;
Firecast.registrarForm(_frmRecordListFormExperience);

return _frmRecordListFormExperience;


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>DbTxn::set_name()</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
    <link rel="up" href="txn.html" title="Chapter 13.  The DbTxn Handle" />
    <link rel="prev" href="txnrecover.html" title="DbEnv::txn_recover()" />
    <link rel="next" href="txnset_timeout.html" title="DbTxn::set_timeout()" />

          DbTxn::set_name()

          Prev
          Chapter 13.
                The DbTxn Handle

           Next

DbTxn::set_name()

#include <db_cxx.h>

int
DbTxn::set_name(const char *name);

         The DbTxn::set_name() method associates the specified string with
         the transaction.  The string is returned by
         DbEnv::txn_stat()  and displayed
         by DbEnv::txn_stat_print().

         If the database environment has been configured for logging and the
         Berkeley DB library was configured with --enable-diagnostic,
         a debugging log record is written including the transaction ID and the
         name.

         The DbTxn::set_name() method may be called at any time during the
         life of the application.

         The DbTxn::set_name()

                method either returns a non-zero error value or throws an
                exception that encapsulates a non-zero error value on
                failure, and returns 0 on success.

Parameters

name

                          The name parameter is the string to
                          associate with the transaction.

Class

                 DbEnv, DbTxn

See Also

                     Transaction Subsystem and Related Methods

          Prev

            Up

           Next

          DbEnv::txn_recover()

            Home

           DbTxn::set_timeout()


text:
package WWW::String;

use strict;
use warnings;

use List::Util qw[min max];

# normalize string
sub normalize {

    my $string = shift;

    $string =~ s/\s+/ /g;
    $string =~ s/^ //;
    $string =~ s/ $//;
    $string =~ s/^[[:punct:]]+$//;

    if ( ! length($string) ) {
        return undef;
    }

    return $string;

}

# check that two string match, irrespective of punctuation, whitespaces, etc.
sub check_match {

    my $string = shift;
    my $reference = shift;

    my @references = (ref($reference) eq 'ARRAY')?@{$reference}:$reference;

    foreach my $reference (@references) {

	# print STDERR "checking match between {$string} and {$reference} ...\n";

	if ( $string eq $reference ) {
	    return $reference;
	}

	# lower case both string and reference
	my $string_lower = lc($string);
	my $reference_lower = lc($reference);

	# attempt to match without punctuation
	my $string_no_punctuation = $string_lower;
	$string_no_punctuation =~ s/[[:punct:]]/ /g;
	my $reference_no_punctuation = $reference_lower;
	$reference_no_punctuation =~ s/[[:punct:]]/ /g;
	if ( $string_no_punctuation eq $reference_no_punctuation ) {
	    return $reference;
	}

	# attempt to match without spaces
	my $string_no_space_no_punctuation = $string_no_punctuation;
	$string_no_space_no_punctuation =~ s/\s+//g;
	my $reference_no_space_no_punctuation = $reference_no_punctuation;
	$reference_no_space_no_punctuation =~ s/\s+//g;
	if ( $string_no_space_no_punctuation eq $reference_no_space_no_punctuation ) {
	    return $reference;
	}

    }

    return undef;

}

# word overlap between two strings
# two values are returned, using both strings as a reference
sub wordoverlap {

    my $string1 = shift;
    my $string2 = shift;

    my $split_regex = qr/(\s|[[:punct:]])+/i;

    my %tokens;

    my %tokens1 = map { $_ => 1 } split $split_regex, $string1;
    my %tokens2 = map { $_ => 1 } split $split_regex, $string2;

    map { $tokens{$_}++; } keys(%tokens1);
    map { $tokens{$_}++; } keys(%tokens2);

    my $n_tokens1 = scalar(keys(%tokens1));
    my $n_tokens2 = scalar(keys(%tokens2));

    if ( !$n_tokens1 || !$n_tokens2 ) {
	return (0, 0);
    }

    my $n_overlap = 0;
    foreach my $key (keys(%tokens)) {
	if ( defined($tokens1{$key}) && defined($tokens2{$key}) ) {
	    $n_overlap++;
	}
    }

    return ($n_overlap/$n_tokens1, $n_overlap/$n_tokens2);

}

# compute word overlap ratio between two strings
sub distance_wordoverlap {

    my $string1 = shift;
    my $string2 = shift;

    my ($wordoverlap1, $wordoverlap2) = wordoverlap($string1, $string2);

    return (1 - min($wordoverlap1, $wordoverlap2));

}

1;


text:
package com.liangmayong.apkbox.hook.listener;

import android.app.Activity;
import android.os.Bundle;

/**
 * Created by LiangMaYong on 2017/4/10.
 */
public interface OnActivityListener {

    void onPostCreate(Activity target, Bundle savedInstanceState, boolean after);

    void onCreate(Activity target, Bundle savedInstanceState, boolean after);

    void onStart(Activity target, boolean after);

    void onRestart(Activity target, boolean after);

    void onDestroy(Activity target, boolean after);

    void onPause(Activity target, boolean after);

    void onStop(Activity target, boolean after);

    void onResume(Activity target, boolean after);

}


text:
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>ExifTool Date/Time Shift Module</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:_securityagent@gamma.local" />

<big> ExifTool Date/Time Shift Module</big>

NAME

DESCRIPTION

DETAILS

NOTES

TRICKY

BUGS

AUTHOR

SEE ALSO

NAME

Image::ExifTool::Shift.pl - ExifTool time shifting routines

DESCRIPTION

This module contains routines used by ExifTool to shift date and time
values.

DETAILS

Time shifts are applied to standard EXIF-formatted date/time values (eg.
2005:03:14 18:55:00).  Date-only and time-only values may also be
shifted, and an optional timezone (eg. -05:00) is also supported.  Here
are some general rules and examples to explain how shift strings are
interpreted:

Date-only values are shifted using the following formats:

    'Y:M:D'     - shift date by 'Y' years, 'M' months and 'D' days
    'M:D'       - shift months and days only
    'D'         - shift specified number of days

Time-only values are shifted using the following formats:

    'h:m:s'     - shift time by 'h' hours, 'm' minutes and 's' seconds
    'h:m'       - shift hours and minutes only
    'h'         - shift specified number of hours

Timezone shifts are specified in the following formats:

    '+h:m'      - shift timezone by 'h' hours and 'm' minutes
    '-h:m'      - negative shift of timezone hours and minutes
    '+h'        - shift timezone hours only
    '-h'        - negative shift of timezone hours only

A valid shift value consists of one or two arguments, separated by a space.
If only one is provided, it is assumed to be a time shift when applied to a
time-only or a date/time value, or a date shift when applied to a date-only
value.  For example:

    '1'         - shift by 1 hour if applied to a time or date/time
                  value, or by one day if applied to a date value
    '2:0'       - shift 2 hours (time, date/time), or 2 months (date)
    '5:0:0'     - shift 5 hours (time, date/time), or 5 years (date)
    '0:0:1'     - shift 1 s (time, date/time), or 1 day (date)

If two arguments are given, the date shift is first, followed by the time
shift:

    '3:0:0 0'         - shift date by 3 years
    '0 15:30'         - shift time by 15 hours and 30 minutes
    '1:0:0 0:0:0+5:0' - shift date by 1 year and timezone by 5 hours

A date shift is simply ignored if applied to a time value or visa versa.

Numbers specified in shift fields may contain a decimal point:

    '1.5'       - 1 hour 30 minutes (time, date/time), or 1 day (date)
    '2.5 0'     - 2 days 12 hours (date/time), 12 hours (time) or
                  2 days (date)

And to save typing, a zero is assumed for any missing numbers:

    '1::'       - shift by 1 hour (time, date/time) or 1 year (date)
    '26:: 0'    - shift date by 26 years
    '+:30       - shift timezone by 30 minutes

Below are some specific examples applied to real date and/or time values
('Dir' is the applied shift direction: '+' is positive, '-' is negative):

     Original Value         Shift   Dir    Shifted Value
    ---------------------  -------  ---  ---------------------
    '20:30:00'             '5'       +   '01:30:00'
    '2005:01:27'           '5'       +   '2005:02:01'
    '2005:01:27 20:30:00'  '5'       +   '2005:01:28 01:30:00'
    '11:54:00'             '2.5 0'   -   '23:54:00'
    '2005:11:02'           '2.5 0'   -   '2005:10:31'
    '2005:11:02 11:54:00'  '2.5 0'   -   '2005:10:30 23:54:00'
    '2004:02:28 08:00:00'  '1 1.3'   +   '2004:02:29 09:18:00'
    '07:00:00'             '-5'      +   '07:00:00'
    '07:00:00+01:00'       '-5'      +   '07:00:00-04:00'
    '07:00:00Z'            '+2:30'   -   '07:00:00-02:30'
    '1970:01:01'           '35::'    +   '2005:01:01'
    '2005:01:01'           '400'     +   '2006:02:05'
    '10:00:00.00'          '::1.33'  -   '09:59:58.67'

NOTES

The format of the original date/time value is not changed when the time
shift is applied.  This means that the length of the date/time string will
not change, and only the numbers in the string will be modified.  The only
exception to this rule is that a 'Z' timezone is changed to '+00:00'
notation if a timezone shift is applied.  A timezone will not be added to
the date/time string.

TRICKY

This module is perhaps more complicated than it needs to be because it is
designed to be very flexible in the way time shifts are specified and
applied...

The ability to shift dates by Y years, M months, etc, conflicts with the
design goal of maintaining a constant shift for all time values when
applying a batch shift.  This is because shifting by 1 month can be
equivalent to anything from 28 to 31 days, and 1 year can be 365 or 366
days, depending on the starting date.

The inconsistency is handled by shifting the first tag found with the actual
specified shift, then calculating the equivalent time difference in seconds
for this shift and applying this difference to subsequent tags in a batch
conversion.  So if it works as designed, the behaviour should be both
intuitive and mathematically correct, and the user shouldn't have to worry
about details such as this (in keeping with Perl's "do the right thing"
philosophy).

BUGS

Due to the use of the standard time library functions, dates are typically
limited to the range 1970 to 2038 on 32-bit systems.

AUTHOR

Copyright 2003-2015, Phil Harvey (phil at owl.phy.queensu.ca)

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

SEE ALSO

Image::ExifTool(3pm)

<big> ExifTool Date/Time Shift Module</big>


text:
<?php
namespace FlatSite\Builder;

use FlatSite\Config;
use FlatSite\Storage\StorageInterface;
use FlatSite\View;

interface BuilderInterface
{
    public function __construct(Config $config, StorageInterface $storage, View $view);
    public function buildIndex();
    public function buildPostsAndTags();
    public function buildComments();
    public function save();
}


text:
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import org.neo4j.io.fs.FileUtils;

public class TxBench
{
    public static void main(String ... args) throws Throwable
    {
        int iterations = 500_000;

        bench( (long) iterations, 1 );
        bench( (long) iterations / 2, 2 );
        bench( (long) iterations / 4, 4 );
        bench( (long) iterations / 8, 8 );
    }

    private static GraphDatabaseService db;

    public static void setup() throws IOException
    {
        File path = new File( "/tmp/asd" );
        if( path.exists())
        {
            FileUtils.deleteRecursively( path );
        }
        db = new GraphDatabaseFactory().newEmbeddedDatabase( path.getAbsolutePath() );
        try( Transaction tx = db.beginTx() )
        {
            db.execute( "CREATE INDEX ON :User(name)" );
            tx.success();
        }

        try( Transaction tx = db.beginTx() )
        {
            db.schema().awaitIndexesOnline( 10, TimeUnit.SECONDS );
            tx.success();
        }
    }

    static class Worker
    {
        private final Map<String, Object> params = new HashMap<>();

        public void operation()
        {
            try ( Transaction tx = db.beginTx() )
            {
                params.put( "name", ThreadLocalRandom.current().nextInt( 100000 ) );
                db.execute( "MERGE (n:User {name:{name}}) RETURN n", params );
                tx.success();
            }
        }
    }

    public static void teardown()
    {
        db.shutdown();
    }

    private static void bench( long iterations, int concurrency ) throws InterruptedException, ExecutionException,
            IOException
    {
        ExecutorService executorService = Executors.newFixedThreadPool( concurrency );

        setup();

        long start = System.nanoTime();
        List<Future<Object>> futures = executorService.invokeAll( workers( iterations, concurrency ) );
        awaitAll( futures );
        long delta = System.nanoTime() - start;

        System.out.println("With "+ concurrency +" threads: " + (iterations * concurrency) / (delta / 1000_000_000.0) + " ops/s");

        teardown();

        executorService.shutdownNow();
        executorService.awaitTermination( 10, TimeUnit.SECONDS );
    }

    private static void awaitAll( List<Future<Object>> futures ) throws InterruptedException, ExecutionException
    {
        for ( Future<Object> future : futures )
        {
            future.get();
        }
    }

    private static List<Callable<Object>> workers( final long iterations, final int numWorkers )
    {
        List<Callable<Object>> workers = new ArrayList<>();
        for ( int i = 0; i < numWorkers; i++ )
        {
            final Worker worker = new Worker();
            workers.add( new Callable<Object>()
            {
                @Override
                public Object call() throws Exception
                {
                    for ( int i = 0; i < iterations; i++ )
                    {
                        worker.operation();
                    }
                    return null;
                }
            });
        }
        return workers;
    }

}


text:
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log
from six import moves
import sqlalchemy as sa
from sqlalchemy import sql

from neutron.common import exceptions as n_exc
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.i18n import _LE, _LW
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers import type_tunnel

LOG = log.getLogger(__name__)

gre_opts = [
    cfg.ListOpt('tunnel_id_ranges',
                default=[],
                help=_("Comma-separated list of <tun_min>:<tun_max> tuples "
                       "enumerating ranges of GRE tunnel IDs that are "
                       "available for tenant network allocation"))
]

cfg.CONF.register_opts(gre_opts, "ml2_type_gre")

class GreAllocation(model_base.BASEV2):

    __tablename__ = 'ml2_gre_allocations'

    gre_id = sa.Column(sa.Integer, nullable=False, primary_key=True,
                       autoincrement=False)
    allocated = sa.Column(sa.Boolean, nullable=False, default=False,
                          server_default=sql.false(), index=True)

class GreEndpoints(model_base.BASEV2):
    """Represents tunnel endpoint in RPC mode."""

    __tablename__ = 'ml2_gre_endpoints'
    __table_args__ = (
        sa.UniqueConstraint('host',
                            name='unique_ml2_gre_endpoints0host'),
        model_base.BASEV2.__table_args__
    )
    ip_address = sa.Column(sa.String(64), primary_key=True)
    host = sa.Column(sa.String(255), nullable=True)

    def __repr__(self):
        return "<GreTunnelEndpoint(%s)>" % self.ip_address

class GreTypeDriver(type_tunnel.EndpointTunnelTypeDriver):

    def __init__(self):
        super(GreTypeDriver, self).__init__(
            GreAllocation, GreEndpoints)

    def get_type(self):
        return p_const.TYPE_GRE

    def initialize(self):
        try:
            self._initialize(cfg.CONF.ml2_type_gre.tunnel_id_ranges)
        except n_exc.NetworkTunnelRangeError:
            LOG.exception(_LE("Failed to parse tunnel_id_ranges. "
                              "Service terminated!"))
            raise SystemExit()

    def sync_allocations(self):

        # determine current configured allocatable gres
        gre_ids = set()
        for gre_id_range in self.tunnel_ranges:
            tun_min, tun_max = gre_id_range
            if tun_max + 1 - tun_min > 1000000:
                LOG.error(_LE("Skipping unreasonable gre ID range "
                              "%(tun_min)s:%(tun_max)s"),
                          {'tun_min': tun_min, 'tun_max': tun_max})
            else:
                gre_ids |= set(moves.range(tun_min, tun_max + 1))

        session = db_api.get_session()
        try:
            self._add_allocation(session, gre_ids)
        except db_exc.DBDuplicateEntry:
            # in case multiple neutron-servers start allocations could be
            # already added by different neutron-server. because this function
            # is called only when initializing this type driver, it's safe to
            # assume allocations were added.
            LOG.warning(_LW("Gre allocations were already created."))

    def _add_allocation(self, session, gre_ids):
        with session.begin(subtransactions=True):
            # remove from table unallocated tunnels not currently allocatable
            allocs = (session.query(GreAllocation).all())
            for alloc in allocs:
                try:
                    # see if tunnel is allocatable
                    gre_ids.remove(alloc.gre_id)
                except KeyError:
                    # it's not allocatable, so check if its allocated
                    if not alloc.allocated:
                        # it's not, so remove it from table
                        LOG.debug("Removing tunnel %s from pool", alloc.gre_id)
                        session.delete(alloc)

            # add missing allocatable tunnels to table
            for gre_id in sorted(gre_ids):
                alloc = GreAllocation(gre_id=gre_id)
                session.add(alloc)

    def get_endpoints(self):
        """Get every gre endpoints from database."""
        gre_endpoints = self._get_endpoints()
        return [{'ip_address': gre_endpoint.ip_address,
                 'host': gre_endpoint.host}
                for gre_endpoint in gre_endpoints]

    def add_endpoint(self, ip, host):
        return self._add_endpoint(ip, host)

    def get_mtu(self, physical_network=None):
        mtu = super(GreTypeDriver, self).get_mtu(physical_network)
        return mtu - p_const.GRE_ENCAP_OVERHEAD if mtu else 0


text:
var arg0 = "foo";
%CreateSymbol(arg0);


text:
export const MEDIA3P_SET_SELECTED_PROVIDER = 'MEDIA3P_SET_SELECTED_PROVIDER';
export const MEDIA3P_SET_SEARCH_TERM = 'MEDIA3P_SET_SEARCH_TERM';


text:
define(
['jquery-1', 'timeline/models/GraphicalTimelineEvent', 'vendor/EventEmitter', 'vendor/cmptbl', 'vendor/drgbl'],

function (
$,
GraphicalTimelineEvent,
EventEmitter,
Compatible,
Draggable) {

  var GraphicalTimeline = function (timelineModel, templates) {
      EventEmitter.apply(this);

      this.moveable = false;
      this.templates = templates;
      this.graphicalEvents = [];
      this.timelineModel = timelineModel;
      this.draggable = true;
      this.dragInProgress = false;
      this.lockToViewport = true;
      this.showPanels = true;
      this.timelineAttachSelector = '.timeline';

      this.view = function () {
        return {
          name: this.timelineModel.name,
          range: this.timelineModel.range,
          length: this.timelineModel.events.length + " Events"
        };
      };
      this.animationProperties = function (distance) {
        return {
          left: distance
        };
      };
      this.animationOptions = function (callback) {
        var graphicalTimeline = this;
        return {
          duration: 500,
          easing: 'swing',
          complete: function () {
            if (callback && typeof (callback) === "function") {
              graphicalTimeline.emit('refocussed');
              callback();
            }
          }
        };
      };
      this.eventListenersForGraphicalEvents = {};
      this.focusEventHandler = function () {
        if (!this.t.dragInProgress) {
          this.t.centerEvent(this.e);
          this.t.focusEvent(this.e);
        }
      };
      this.updateVisibilityCallback = function(){

      };
    };

  GraphicalTimeline.prototype = EventEmitter.extend();

  GraphicalTimeline.prototype.init = function ($container) {
    this.$container = $container;
    this.$timeline = this.$container.find(this.timelineAttachSelector);

    this.addEvents();

    if (this.draggable) {
      this.makeDraggable();
    }

    return this.$container;
  };

  GraphicalTimeline.prototype.reset = function () {
    if (this.graphicalEvents && !this.moveable) {
      this.centerEvent(this.graphicalEvents[0]);
      this.focusEvent(this.graphicalEvents[0]);
    }
    this.emit('reset');
  };

  GraphicalTimeline.prototype.hasTimelineEvent = function (timelineEvent) {
    for (var i = 0; i < this.graphicalEvents.length; i++) {
      if (this.graphicalEvents[i].timelineEvent === timelineEvent) {
        return this.graphicalEvents[i];
      }
    }
  };

  GraphicalTimeline.prototype.hasTimelineEventDOMElement = function (DOMElement) {
    for (var i = 0; i < this.graphicalEvents.length; i++) {
      if (this.graphicalEvents[i].$event && this.graphicalEvents[i].$event.get(0) === DOMElement) {

        return this.graphicalEvents[i];
      }
    }
  };

  GraphicalTimeline.prototype.addEvents = function () {
    for (var i = 0; i < this.timelineModel.length(); i++) {
      this.addEvent(this.timelineModel.events[i]);
    }
  };

  GraphicalTimeline.prototype.addEvent = function (timelineEvent) {
    var graphicalEvent = new GraphicalTimelineEvent(timelineEvent);
    var graphicalTimeline = this;

    for (var eventName in this.eventListenersForGraphicalEvents) {
      var e = graphicalTimeline.eventListenersForGraphicalEvents[eventName];
      var scope = {
        e: graphicalEvent,
        t: graphicalTimeline
      };
      graphicalEvent.on(eventName, e, scope);
      graphicalEvent.on('click',this.focusEventHandler,scope);
    }

    this.graphicalEvents.push(graphicalEvent);
  };

  GraphicalTimeline.prototype.length = function () {
    return this.graphicalEvents.length;
  };

  GraphicalTimeline.prototype.makeDraggable = function () {
    var self = this;

    var opts = {
      axis: 'x',
      bound: function(){
        var $lastElement = self.$timeline.find('li').last();
        var bottomBound = -($lastElement.position().left + $lastElement.width()  - self.viewportWidth()) ;
        var topBound = 0

        var currentPosition = $(this.element).position().left;

        if( currentPosition >= bottomBound &&
            currentPosition <= topBound){
            return true;
        }
      },
      callback: {
        dragging: function () {
          self.dragInProgress = true;
        },
        dragend: function () {
          if (self.dragInProgress) {
            self.dragInProgress = false;
            var centralEvent = self.centralEvent();
            self.centerEvent(centralEvent);
            self.focusEvent(centralEvent);
            self.emit('dragend');
          }
        }
      }
    };

    return new Draggable(this.$timeline.get(0), opts);
  };

  GraphicalTimeline.prototype.visibleEvents = function () {
    var visibleEvents = [];

    if (this.$container) {
      var timelineWidth = this.$container.width();
      var offSet = this.$timeline.position().left;

      var length = this.length();

      for (var i = 0; i < length; i++) {
        var eventWidth = this.graphicalEvents[i].$event.width();
        var eventLeftPos = offSet + this.graphicalEvents[i].$event.position().left;
        var eventRightPos = eventLeftPos + eventWidth;

        if (eventRightPos > 0 && eventLeftPos < timelineWidth) {
          visibleEvents.push(this.graphicalEvents[i]);
        }
      }
    }

    return visibleEvents;
  };

  GraphicalTimeline.prototype.focusOffset = function (graphicalEvent) {
    var focusIndex;
    var currentIndex;

    for (var i = 0; i < this.graphicalEvents.length; i++) {
      if (this.graphicalEvents[i].focus){
        focusIndex = i;
      }
      if (this.graphicalEvents[i] === graphicalEvent){
        currentIndex = i;
      }
    }

    if (focusIndex !== undefined && currentIndex !== undefined) {
      return Math.abs(focusIndex - currentIndex);
    }
  };

  GraphicalTimeline.prototype.centralEvent = function () {
    if (this.$container) {
      var timelineWidth = this.$container.width();
      var offSet = this.$timeline.position().left;
      var timelineCentre = this.$container.width() / 2;
      var visibleEvents = this.visibleEvents();
      var centralEvent = {
        distance: undefined,
        graphicalEvent: undefined
      };

      for (var i = 0; i < visibleEvents.length; i++) {
        var eventWidth = visibleEvents[i].$event.width();
        var eventLeftPos = offSet + visibleEvents[i].$event.position().left;
        var eventRightPos = eventLeftPos + eventWidth;

        var eventCenter = eventLeftPos + (eventWidth / 2);
        var centreOffset = Math.abs(timelineCentre - eventCenter);

        if (centralEvent.distance === undefined || centreOffset < centralEvent.distance) {
          centralEvent.distance = centreOffset;
          centralEvent.graphicalEvent = visibleEvents[i];
        }
      }

      return centralEvent.graphicalEvent;
    }
  };

  GraphicalTimeline.prototype.focussedEvent = function () {
    for (var i = 0; i < this.graphicalEvents.length; i++) {
      if (this.graphicalEvents[i].focus) {
        return this.graphicalEvents[i];
      }
    }
  };

  GraphicalTimeline.prototype.centerEvent = function (graphicalEvent) {
    if (graphicalEvent && graphicalEvent.$event && this.$timeline) {
      var moveDistance = ((graphicalEvent.$event.position().left) - (this.viewportWidth() / 2)) + ((graphicalEvent.$event.outerWidth()) / 2);
      var moveTo = -(moveDistance);

      this.moveTimeline(moveTo, this.updateVisibilityCallback);
    }
  };

  GraphicalTimeline.prototype.focusEvent = function (graphicalEvent) {
		for (var i = 0; i < this.graphicalEvents.length; i++) {
			this.graphicalEvents[i].emit('reset');
      this.graphicalEvents[i].setFocussed(false);
		}

    var tense = 'past';
    if (graphicalEvent && graphicalEvent.$event && this.$timeline) {
      for (var i = 0; i < this.graphicalEvents.length; i++) {
        if (this.graphicalEvents[i] === graphicalEvent) {
          tense = 'future';

					if(this.graphicalEvents[i-1]){
						this.graphicalEvents[i-1].emit('previous');
					}
					if(this.graphicalEvents[i+1]){
					  this.graphicalEvents[i+1].emit('next');
					}

        } else {
          this.graphicalEvents[i].emit(tense);
        }
      }
		}

    graphicalEvent.setFocussed(true);

    return false;
  };

  GraphicalTimeline.prototype.width = function () {
    if (this.$timeline) {
      var $lastElement = this.graphicalEvents[this.graphicalEvents.length - 1].$event;
      return $lastElement.position().left + $lastElement.outerWidth();
    } else {
      return undefined;
    }
  };

  GraphicalTimeline.prototype.viewportWidth = function () {
    if (this.$container) {
      return this.$container.outerWidth();
    } else {
      return undefined;
    }
  };

  GraphicalTimeline.prototype.moveTimeline = function (distance, callback) {
    if (this.moveable) { return; }

		var $lastTimelineItem = this.$timeline.find('li').last();
		var fullWidth = $lastTimelineItem.position().left + $lastTimelineItem.outerWidth();

    if (this.lockToViewport) {
      if (((-distance) + this.viewportWidth()) > fullWidth) {
        distance = -(fullWidth - this.viewportWidth());
      }
      if (distance > 0) {
        distance = 0;
      }
    }

    this.$timeline.clearQueue();
    this.$timeline.delay(200).animate(
    this.animationProperties(distance),
    this.animationOptions(callback));
  };

  return GraphicalTimeline;
}

);


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['currentdatedefault'] = 'Susmaya görə cari xanadan istifadə etmək üçün işarə qoyun';
$string['defaultdate'] = 'Susmaya görə vaxt';
$string['endyear'] = 'Sonuncu il';
$string['notset'] = 'Quraşdırılmayıb';
$string['pluginname'] = 'Vaxt/zaman';
$string['specifydatedefault'] = 'və ya vaxtı göstərin';
$string['startyear'] = 'Başlanğıc il';
$string['startyearafterend'] = 'Başlanğıc il sonuncu ildən böyük ola bilməz';
$string['wanttime'] = 'Vaxtı əlavə etsin?';


text:
var test = require('tape');
var file = require('../src/codility/counting-elements/missingInteger.js');

test('missingInteger', function(t) {
  t.plan(6);
  t.equal(5, file.missingInteger([ 1, 3, 6, 4, 1, 2 ]), 'first example test');
  t.equal(2, file.missingInteger([ 1 ]), 'a single element');
  t.equal(1, file.missingInteger([ 0 ]), 'a single element');
  t.equal(1, file.missingInteger([ -1 ]), 'a single element');
  t.equal(1, file.missingInteger([ 4, 5, 6, 2 ]), 'simple test');
  t.equal(3, file.missingInteger([ 4, 1, 5, 6, 2 ]), 'simple test');
});