.border, .form_builder, .form_builder .form_builder-controlsList .form_builder-controlItem .badge {
  border: 1px solid #cccccc !important; }

.form-group.selected .input-group {
  border: 1px solid wheat; }

.form-title {
  border-bottom: 1px solid #858585 !important; }

.form_builder .form_builder-tab {
  border-left: 1px solid #cccccc;
  border-right: 1px solid #cccccc; }
.form_builder .form_builder-tabControl {
  margin-top: 10px; }
  .form_builder .form_builder-tabControl .btn, .form_builder .form_builder-tabControl .btn.selected {
    background-color: #eeeeee !important;
    color: black !important;
    border: solid 1px #cccccc;
    overflow: hidden !important;
    text-overflow: ellipsis;
    word-break: break-all; }
    .form_builder .form_builder-tabControl .btn:hover {
      background-color: white !important; }
    .form_builder .form_builder-tabControl .btn.over {
      background-color: wheat !important; }
    .form_builder .form_builder-tabControl .btn.tabs-sortable-placeholder {
      width: 10px;
      height: 0px; }
  .form_builder .form_builder-tabControl .selected.btn {
    border-bottom: none; }
    .form_builder .form_builder-tabControl .selected.btn:not(.over) {
      background-color: white !important; }
    .form_builder .form_builder-tabControl .selected.btn:hover {
      cursor: default;
      background-color: white !important; }
.form_builder .form_builder-controlsList {
  list-style-type: none;
  margin-top: 10px; }
  .form_builder .form_builder-controlsList .form_builder-controlItem {
    margin-top: 10px;
    cursor: move;
    border: 1px solid #cccccc; }
    .form_builder .form_builder-controlsList .form_builder-controlItem .badge {
      color: black;
      background-color: white; }
      .form_builder .form_builder-controlsList .form_builder-controlItem .badge:hover {
        background-color: #999999; }
.form_builder li a h1 {
  border-bottom: none !important;
  display: inline; }
.form_builder .form_builder-formContainer .form_container {
  margin-top: 8px; }
.form_builder .form_builder-settingsContainer {
  overflow-y: scroll; }
  .form_builder .form_builder-settingsContainer h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    position: relative;
    font-weight: normal;
    font-size: 14px;
    padding: 5px 0; }
.form_builder [data-addon-toggle]:not([data-addon-toggle="grab"]) {
  cursor: pointer; }
  .form_builder [data-addon-toggle]:not([data-addon-toggle="grab"]):hover {
    background-color: wheat; }
.form_builder [data-addon-toggle].selected {
  background-color: wheat;
  cursor: default; }
.form_builder [data-addon-toggle="grab"] {
  cursor: move; }
.form_builder .form_builder-properties h3 {
  font-size: 17px; }
  .form_builder .form_builder-properties h3:hover {
    border-bottom: 1px solid black;
    cursor: pointer; }
.form_builder .form_builder-properties a {
  margin-left: 4px; }
  .form_builder .form_builder-properties a:hover {
    color: black; }


#pragma once

// Copyright 2014 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "crypto/ByteSlice.h"
#include "crypto/XDRHasher.h"
#include "sodium/crypto_hash_sha256.h"
#include "xdr/Stellar-types.h"
#include <memory>

namespace stellar
{

// Plain SHA256
uint256 sha256(ByteSlice const& bin);

// SHA256 in incremental mode, for large inputs.
class SHA256
{
    crypto_hash_sha256_state mState;
    bool mFinished{false};

  public:
    SHA256();
    void reset();
    void add(ByteSlice const& bin);
    uint256 finish();
};

// Helper for xdrSha256 below.
struct XDRSHA256 : XDRHasher<XDRSHA256>
{
    SHA256 state;
    void
    hashBytes(unsigned char const* bytes, size_t size)
    {
        state.add(ByteSlice(bytes, size));
    }
};

// Equivalent to `sha256(xdr_to_opaque(t))` on any XDR object `t` but
// without allocating a temporary buffer.
//
// NB: This is not an overload of `sha256` to avoid ambiguity when called
// with xdrpp-provided types like opaque_vec, which will convert to a ByteSlice
// if demanded, but can also be passed to XDRSHA256.
template <typename T>
uint256
xdrSha256(T const& t)
{
    XDRSHA256 xs;
    xdr::archive(xs, t);
    xs.flush();
    return xs.state.finish();
}

// HMAC-SHA256 (keyed)
HmacSha256Mac hmacSha256(HmacSha256Key const& key, ByteSlice const& bin);

// Use this rather than HMAC-output ==, to avoid timing leaks.
bool hmacSha256Verify(HmacSha256Mac const& hmac, HmacSha256Key const& key,
                      ByteSlice const& bin);

// Unsalted HKDF-extract(bytes) == HMAC(<zero>,bytes)
HmacSha256Key hkdfExtract(ByteSlice const& bin);

// Single-step HKDF-expand(key,bytes) == HMAC(key,bytes|0x1)
HmacSha256Key hkdfExpand(HmacSha256Key const& key, ByteSlice const& bin);
}


/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program 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 2
 * of the License, or (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef TITANIC_ARM_H
#define TITANIC_ARM_H

#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
#include "titanic/messages/pet_messages.h"

namespace Titanic {

class CArm : public CCarry {
	DECLARE_MESSAGE_MAP;
	bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
	bool TranslateObjectMsg(CTranslateObjectMsg *msg);
	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
	bool MaitreDHappyMsg(CMaitreDHappyMsg *msg);
	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
private:
	CString _heldItemName;
	int _puzzleUnused;
	Rect _hookedRect;
	CString _hookedTarget;
	bool _armUnlocked;
	Rect _armRect;
	int _arboretumFrame;
	int _unlockedFrame;
public:
	CLASSDEF;
	CArm();

	/**
	 * Save the data for the class to file
	 */
	void save(SimpleFile *file, int indent) override;

	/**
	 * Load the data for the class from file
	 */
	void load(SimpleFile *file) override;
};

} // End of namespace Titanic

#endif /* TITANIC_ARM_H */


"""
Pure-Python implementation of a Python 2-like str object for Python 3.
"""

from collections import Iterable
from numbers import Integral

from past.utils import PY2, with_metaclass

_builtin_bytes = bytes

class BaseOldStr(type):
    def __instancecheck__(cls, instance):
        return isinstance(instance, _builtin_bytes)

def unescape(s):
    """
    Interprets strings with escape sequences

    Example:
    >>> s = unescape(r'abc\\def')   # i.e. 'abc\\\\def'
    >>> print(s)
    'abc\def'
    >>> s2 = unescape('abc\\ndef')
    >>> len(s2)
    8
    >>> print(s2)
    abc
    def
    """
    return s.encode().decode('unicode_escape')

class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
    """
    A forward port of the Python 2 8-bit string object to Py3
    """
    # Python 2 strings have no __iter__ method:
    @property
    def __iter__(self):
        raise AttributeError

    def __dir__(self):
        return [thing for thing in dir(_builtin_bytes) if thing != '__iter__']

    # def __new__(cls, *args, **kwargs):
    #     """
    #     From the Py3 bytes docstring:

    #     bytes(iterable_of_ints) -> bytes
    #     bytes(string, encoding[, errors]) -> bytes
    #     bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
    #     bytes(int) -> bytes object of size given by the parameter initialized with null bytes
    #     bytes() -> empty bytes object
    #
    #     Construct an immutable array of bytes from:
    #       - an iterable yielding integers in range(256)
    #       - a text string encoded using the specified encoding
    #       - any object implementing the buffer API.
    #       - an integer
    #     """
    #
    #     if len(args) == 0:
    #         return super(newbytes, cls).__new__(cls)
    #     # Was: elif isinstance(args[0], newbytes):
    #     # We use type() instead of the above because we're redefining
    #     # this to be True for all unicode string subclasses. Warning:
    #     # This may render newstr un-subclassable.
    #     elif type(args[0]) == newbytes:
    #         return args[0]
    #     elif isinstance(args[0], _builtin_bytes):
    #         value = args[0]
    #     elif isinstance(args[0], unicode):
    #         if 'encoding' not in kwargs:
    #             raise TypeError('unicode string argument without an encoding')
    #         ###
    #         # Was:   value = args[0].encode(**kwargs)
    #         # Python 2.6 string encode() method doesn't take kwargs:
    #         # Use this instead:
    #         newargs = [kwargs['encoding']]
    #         if 'errors' in kwargs:
    #             newargs.append(kwargs['errors'])
    #         value = args[0].encode(*newargs)
    #         ###
    #     elif isinstance(args[0], Iterable):
    #         if len(args[0]) == 0:
    #             # What is this?
    #             raise ValueError('unknown argument type')
    #         elif len(args[0]) > 0 and isinstance(args[0][0], Integral):
    #             # It's a list of integers
    #             value = b''.join([chr(x) for x in args[0]])
    #         else:
    #             raise ValueError('item cannot be interpreted as an integer')
    #     elif isinstance(args[0], Integral):
    #         if args[0] < 0:
    #             raise ValueError('negative count')
    #         value = b'\x00' * args[0]
    #     else:
    #         value = args[0]
    #     return super(newbytes, cls).__new__(cls, value)

    def __repr__(self):
        s = super(oldstr, self).__repr__()   # e.g. b'abc' on Py3, b'abc' on Py3
        return s[1:]

    def __str__(self):
        s = super(oldstr, self).__str__()   # e.g. "b'abc'" or "b'abc\\ndef'
        # TODO: fix this:
        assert s[:2] == "b'" and s[-1] == "'"
        return unescape(s[2:-1])            # e.g. 'abc'    or 'abc\ndef'

    def __getitem__(self, y):
        if isinstance(y, Integral):
            return super(oldstr, self).__getitem__(slice(y, y+1))
        else:
            return super(oldstr, self).__getitem__(y)

    def __getslice__(self, *args):
        return self.__getitem__(slice(*args))

    def __contains__(self, key):
        if isinstance(key, int):
            return False

    def __native__(self):
        return bytes(self)

__all__ = ['oldstr']


/*
 * SHA-256 internal definitions
 * Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef SHA256_I_H
#define SHA256_I_H

#define SHA256_BLOCK_SIZE 64

struct sha256_state {
	u64 length;
	u32 state[8], curlen;
	u8 buf[SHA256_BLOCK_SIZE];
};

void sha256_init(struct sha256_state *md);
int sha256_process(struct sha256_state *md, const unsigned char *in,
		   unsigned long inlen);
int sha256_done(struct sha256_state *md, unsigned char *out);

#endif /* SHA256_I_H */


@ECHO OFF & SETLOCAL EnableDelayedExpansion
TITLE ghacks user.js updater

REM ## ghacks-user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.10
REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts

SET v=4.10

VERIFY ON
CD /D "%~dp0"
SET _myname=%~n0
SET _myparams=%*

:parse
IF "%~1"=="" (GOTO endparse)
IF /I "%~1"=="-unattended" (SET _ua=1)
IF /I "%~1"=="-log" (SET _log=1)
IF /I "%~1"=="-logp" (SET _log=1 & SET _logp=1)
IF /I "%~1"=="-multioverrides" (SET _multi=1)
IF /I "%~1"=="-merge" (SET _merge=1)
IF /I "%~1"=="-updatebatch" (SET _updateb=1)
IF /I "%~1"=="-singlebackup" (SET _singlebackup=1)
IF /I "%~1"=="-esr" (SET _esr=1)
IF /I "%~1"=="-rfpalts" (SET _rfpalts=1)
SHIFT
GOTO parse
:endparse

IF DEFINED _updateb (
	REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
	IF NOT "!_myname:~0,9!"=="[updated]" (
		IF EXIST "[updated]!_myname!.bat" (
			REM ## Phase 3 ##: The new script, with the original name, will:
			REM 	* Delete the [updated]*.bat and *.bat.old scripts
			REM 	* Begin the normal routine
			FC "[updated]!_myname!.bat" "!_myname!.bat.old" >nul
			IF NOT "!errorlevel!"=="0" (
				CALL :message "Script updated to version !v!"
				TIMEOUT 3 >nul
			)
			REN "[updated]!_myname!.bat" "[updated]!_myname!.bat.old"
			DEL /F "!_myname!.bat.old" "[updated]!_myname!.bat.old"
			GOTO begin
		)
		REM ## Phase 1 ##
		REM 	* Download new batch and name it [updated]*.bat
		REM 	* Start that script in a new CMD window
		REM 	* Exit
		CALL :message "Updating script..."
		REM Uncomment the next line and comment out the PowerShell call for testing.
		REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul
		(
			PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.bat', '[updated]!_myname!.bat')"
		) >nul 2>&1
		IF EXIST "[updated]!_myname!.bat" (
			START /min CMD /C "[updated]!_myname!.bat" !_myparams!
		) ELSE (
			CALL :message "Failed. Make sure PowerShell is allowed internet access."
			TIMEOUT 120 >nul
		)
	) ELSE (
		IF "!_myname!"=="[updated]" (
			CALL :message "The [updated] label is reserved. Rename this script and try again."
			TIMEOUT 300 >nul
		) ELSE (
			REM ## Phase 2 ##: The [updated]*.bat script will:
			REM 	* Rename the old script and make a copy of itself with the original name.
			REM 	* Run that copy in a new CMD instance
			REM 	* Exit
			IF EXIST "!_myname:~9!.bat" ( REN "!_myname:~9!.bat" "!_myname:~9!.bat.old" )
			COPY /B /Y "!_myname!.bat" "!_myname:~9!.bat"
			START CMD /C "!_myname:~9!.bat" !_myparams!
		)
	)
	EXIT /B
)

:begin
CLS
ECHO:
ECHO:
ECHO:                ########################################
ECHO:                ####  user.js Updater for Windows   ####
ECHO:                ####       by claustromaniac        ####
ECHO:                ####             v!v!              ####
ECHO:                ########################################
ECHO:
SET /A "_line=0"
IF NOT EXIST user.js (
	CALL :message "user.js not detected in the current directory."
) ELSE (
	FOR /F "skip=1 tokens=1,* delims=:" %%G IN (user.js) DO (
		SET /A "_line+=1"
		IF !_line! GEQ 4 (GOTO exitloop)
		IF !_line! EQU 1 (SET _name=%%H)
		IF !_line! EQU 2 (SET _date=%%H)
		IF !_line! EQU 3 (SET _version=%%G)
	)
	:exitloop
	IF NOT "!_name!"=="" (
		IF /I NOT "!_name!"=="!_name:ghacks=!" (
			CALL :message "!_name! !_version:~2!,!_date!"
		) ELSE (CALL :message "Current user.js version not recognised.")
	) ELSE (CALL :message "Current user.js version not recognised.")
)
ECHO:
IF NOT DEFINED _ua (
	CALL :message "This batch should be run from your Firefox profile directory."
	ECHO:  It will download the latest version of ghacks user.js from github and then
	CALL :message "append any of your own changes from user-overrides.js to it."
	CALL :message "Visit the wiki for more detailed information."
	ECHO:
	TIMEOUT 1 /nobreak >nul
	CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
	CLS
	IF ERRORLEVEL 3 (EXIT /B)
	IF ERRORLEVEL 2 (GOTO :showhelp)
)
IF DEFINED _log (
	CALL :log >>user.js-update-log.txt 2>&1
	IF DEFINED _logp (START user.js-update-log.txt)
	EXIT /B
	:log
	SET _log=2
	ECHO:##################################################################
	ECHO:  %date%, %time%
)
IF EXIST user.js.new (DEL /F "user.js.new")
CALL :message "Retrieving latest user.js file from github repository..."
(
	PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js', 'user.js.new')"
) >nul 2>&1
IF EXIST user.js.new (
	IF DEFINED _rfpalts (
		CALL :message "Activating RFP Alternatives section..."
		CALL :activate user.js.new "[SETUP-non-RFP]"
	)
	IF DEFINED _esr (
		CALL :message "Activating ESR section..."
		CALL :activate user.js.new ".x still uses all the following prefs"
	)
	IF DEFINED _multi (
		FORFILES /P user.js-overrides /M *.js >nul 2>&1
		IF NOT ERRORLEVEL 1 (
			IF DEFINED _merge (
				CALL :message "Merging..."
				COPY /B /Y user.js-overrides\*.js user-overrides-merged.js
				CALL :merge user-overrides-merged.js
				COPY /B /Y user.js.new+user-overrides-merged.js user.js.new
				CALL :merge user.js.new
			) ELSE (
				CALL :message "Appending..."
				COPY /B /Y user.js.new+"user.js-overrides\*.js" user.js.new
			)
		) ELSE (CALL :message "No override files found.")
	) ELSE (
		IF EXIST "user-overrides.js" (
			COPY /B /Y user.js.new+"user-overrides.js" "user.js.new"
			IF DEFINED _merge (
				CALL :message "Merging user-overrides.js..."
				CALL :merge user.js.new
			) ELSE (
				CALL :message "user-overrides.js appended."
			)
		) ELSE (CALL :message "user-overrides.js not found.")
	)
	IF EXIST user.js (
		FC user.js.new user.js >nul && SET "_changed=false" || SET "_changed=true"
	)
	IF "!_changed!"=="true" (
		CALL :message "Backing up..."
		IF DEFINED _singlebackup (
			MOVE /Y user.js user.js.bak >nul
		) ELSE (
			SET "_time=!time: =0!"
			MOVE /Y user.js "user-backup-!date:/=-!_!_time::=.!.js" >nul
		)
		REN user.js.new user.js
		CALL :message "Update complete."
	) ELSE (
		IF "!_changed!"=="false" (
			DEL /F user.js.new >nul
			CALL :message "Update completed without changes."
		) ELSE (
			REN user.js.new user.js
			CALL :message "Update complete."
			SET "_changed=true"
		)
	)
) ELSE (
	CALL :message "Update failed. Make sure PowerShell is allowed internet access."
	ECHO:  No changes were made.
)
IF NOT DEFINED _log (
	IF NOT DEFINED _ua (
		IF EXIST prefsCleaner.bat (
			IF "!_changed!"=="true" (
				CALL :message "Would you like to run the prefsCleaner now?"
				CHOICE /C YN /N /M "(Y/N) "
				IF "1"=="!errorlevel!" ( START "" cmd.exe /C "prefsCleaner.bat" )
			) ELSE (PAUSE)
		) ELSE (PAUSE)
	)
)
EXIT /B

::::::::::::::: Message :::::::::::::::
:message
SETLOCAL DisableDelayedExpansion
IF NOT "2"=="%_log%" (ECHO:)
ECHO:  %~1
IF NOT "2"=="%_log%" (ECHO:)
ENDLOCAL
GOTO :EOF

::::::::::::::: Activate Section :::::::::::::::
:activate
:: arg1 = file
:: arg2 = line substring
SETLOCAL DisableDelayedExpansion
(
	FOR /F "tokens=1,* delims=:" %%G IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%H"
		SETLOCAL EnableDelayedExpansion
		IF "!_temp:%~2=!"=="!_temp!" (
			ENDLOCAL & ECHO:%%H
		) ELSE (
			ECHO://!_temp:~2!
			ENDLOCAL
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

::::::::::::::: Merge :::::::::::::::
:merge
SETLOCAL DisableDelayedExpansion
FOR /F tokens^=2^,^*^ delims^=^'^" %%G IN ('FINDSTR /R /C:"^user_pref[ 	]*\([ 	]*[\"'].*[\"'][ 	]*,.*\)[ 	]*;" "%~1"') DO (SET "[%%G]=%%H")
FOR /F tokens^=2^,^*^ delims^=^' %%G IN ('FINDSTR /R /C:"^//// --- comment-out --- '[^'][^']*'.*" "%~1"') DO (SET "__unset__%%G=1")
(
	FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
		SET "_temp=%%J"
		SETLOCAL EnableDelayedExpansion
		IF NOT "!_temp:~0,9!"=="user_pref" (
			ENDLOCAL & ECHO:%%J
		) ELSE (
			IF "!_temp:;=!"=="!_temp!" (
				ENDLOCAL & ECHO:%%J
			) ELSE (
				ENDLOCAL
				FOR /F tokens^=2^ delims^=^'^" %%K IN ("%%J") DO (
					IF NOT "_user.js.parrot"=="%%K" (
						IF DEFINED __unset__%%K (
							ECHO://%%J
						) ELSE (
							IF DEFINED [%%K] (
								SETLOCAL EnableDelayedExpansion
								FOR /F "delims=" %%L IN ("![%%K]!") DO (
									ENDLOCAL & ECHO:user_pref("%%K"%%L
									SET "[%%K]="
								)
							)
						)
					) ELSE (ECHO:%%J)
				)
			)
		)
	)
)>updatertempfile
MOVE /Y updatertempfile "%~1" >nul
ENDLOCAL
GOTO :EOF

::::::::::::::: Help :::::::::::::::
:showhelp
MODE 80,54
CLS
CALL :message "Available arguments (case-insensitive):"
CALL :message "  -esr"
ECHO:     Activate ESR related preferences
CALL :message "  -log"
ECHO:     Write the console output to a logfile (user.js-update-log.txt)
CALL :message "  -logP"
ECHO:     Like -log, but also open the logfile after updating.
CALL :message "  -merge"
ECHO:     Merge overrides instead of appending them. Single-line comments and
ECHO:     _user.js.parrot lines are appended normally. Overrides for inactive
ECHO:     user.js prefs will be appended. When -Merge and -MultiOverrides are used
ECHO:     together, a user-overrides-merged.js file is also generated in the root
ECHO:     directory for quick reference. It contains only the merged data from
ECHO:     override files and can be safely discarded after updating, or used as the
ECHO:     new user-overrides.js. When there are conflicting records for the same
ECHO:     pref, the value of the last one declared will be used. Visit the wiki
ECHO:     for usage examples and more detailed information.
CALL :message "  -multiOverrides"
ECHO:     Use any and all .js files in a user.js-overrides sub-folder as overrides
ECHO:     instead of the default user-overrides.js file. Files are appended in
ECHO:     alphabetical order.
CALL :message "  -unattended"
ECHO:     Run without user input.
CALL :message "  -singleBackup"
ECHO:     Use a single backup file and overwrite it on new updates, instead of
ECHO:     cumulative backups. This was the default behaviour before v4.3.
CALL :message "  -rfpAlts"
ECHO:     Activate RFP Alternatives section
CALL :message "  -updateBatch"
ECHO:     Update the script itself on execution, before the normal routine.
CALL :message ""
PAUSE
MODE 80,25
GOTO :begin


#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "THC/generic/THCStorage.cu"
#else

void THCStorage_(fill)(THCState *state, THCStorage *self, scalar_t value)
{
  THCThrustAllocator thrustAlloc(state);
  thrust::device_ptr<scalar_t> self_data(THCStorage_(data)(state, self));
  thrust::fill(
#if CUDA_VERSION >= 7000 || defined __HIP_PLATFORM_HCC__
      thrust::cuda::par(thrustAlloc).on(c10::cuda::getCurrentCUDAStream()),
#endif
      self_data,
      self_data + (self->nbytes() / sizeof(scalar_t)),
      value);
}

void THCStorage_(
    resizeBytes)(THCState* state, THCStorage* self, ptrdiff_t size_bytes) {
  THCStorage_resizeBytes(state, self, size_bytes);
}

int THCStorage_(getDevice)(THCState* state, const THCStorage* storage) {
  return THCStorage_getDevice(state, storage);
}

#endif


#!/bin/bash
#
# Compiles and installs a Linux/x86_64 -> Linux/ARM crosstool based on LLVM and
# LLVM-GCC-4.2 using SVN snapshots in provided tarballs.

set -o nounset
set -o errexit

echo -n "Welcome to LLVM Linux/X86_64 -> Linux/ARM crosstool "
echo "builder/installer; some steps will require sudo privileges."

readonly INSTALL_ROOT="${INSTALL_ROOT:-/usr/local/crosstool}"
# Both $USER and root *must* have read/write access to this dir.
readonly SCRATCH_ROOT=$(mktemp -d "${TMPDIR:-/tmp}/llvm-project.XXXXXX")
readonly SRC_ROOT="${SCRATCH_ROOT}/src"
readonly OBJ_ROOT="${SCRATCH_ROOT}/obj"

readonly CROSS_HOST="x86_64-unknown-linux-gnu"
readonly CROSS_TARGET="arm-none-linux-gnueabi"
readonly CROSS_MARCH="${CROSS_MARCH:-armv6}"

readonly CODE_SOURCERY="${INSTALL_ROOT}/codesourcery"
readonly CODE_SOURCERY_PKG_PATH="${CODE_SOURCERY_PKG_PATH:-${HOME}/codesourcery}"
readonly CODE_SOURCERY_HTTP="http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/public"
readonly CODE_SOURCERY_PKG="arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2"
readonly CODE_SOURCERY_ROOT="${CODE_SOURCERY}/arm-2007q3"
readonly CODE_SOURCERY_BIN="${CODE_SOURCERY_ROOT}/bin"
# Make sure ${CROSS_TARGET}-* binutils are in command path
export PATH="${CODE_SOURCERY_BIN}:${PATH}"

readonly CROSS_TARGET_AS="${CODE_SOURCERY_BIN}/${CROSS_TARGET}-as"
readonly CROSS_TARGET_LD="${CODE_SOURCERY_BIN}/${CROSS_TARGET}-ld"

readonly SYSROOT="${CODE_SOURCERY_ROOT}/${CROSS_TARGET}/libc"

readonly LLVM_PKG_PATH="${LLVM_PKG_PATH:-${HOME}/llvm-project/snapshots}"

# Latest SVN revisions known to be working in this configuration.
readonly LLVM_DEFAULT_REV="74530"
readonly LLVMGCC_DEFAULT_REV="74535"

readonly LLVM_PKG="llvm-${LLVM_SVN_REV:-${LLVM_DEFAULT_REV}}.tar.bz2"
readonly LLVM_SRC_DIR="${SRC_ROOT}/llvm"
readonly LLVM_OBJ_DIR="${OBJ_ROOT}/llvm"
readonly LLVM_INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET}/llvm"

readonly LLVMGCC_PKG="llvm-gcc-4.2-${LLVMGCC_SVN_REV:-${LLVMGCC_DEFAULT_REV}}.tar.bz2"
readonly LLVMGCC_SRC_DIR="${SRC_ROOT}/llvm-gcc-4.2"
readonly LLVMGCC_OBJ_DIR="${OBJ_ROOT}/llvm-gcc-4.2"
readonly LLVMGCC_INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET}/llvm-gcc-4.2"

readonly MAKE_OPTS="${MAKE_OPTS:--j2}"

# Params:
#   $1: directory to be created
#   $2: optional mkdir command prefix, e.g. "sudo"
createDir() {
  if [[ ! -e $1 ]]; then
    ${2:-} mkdir -p $1
  elif [[ -e $1 && ! -d $1 ]]; then
    echo "$1 exists but is not a directory; exiting."
    exit 3
  fi
}

sudoCreateDir() {
  createDir $1 sudo
  sudo chown ${USER} $1
}

# Prints out and runs the command, but without logging -- intended for use with
# lightweight commands that don't have useful output to parse, e.g. mkdir, tar,
# etc.
runCommand() {
  local message="$1"
  shift
  echo "=> $message"
  echo "==> Running: $*"
  $*
}

runAndLog() {
  local message="$1"
  local log_file="$2"
  shift 2
  echo "=> $message; log in $log_file"
  echo "==> Running: $*"
  # Pop-up a terminal with the output of the current command?
  # e.g.: xterm -e /bin/bash -c "$* >| tee $log_file"
  $* &> $log_file
  if [[ $? != 0 ]]; then
    echo "Error occurred: see most recent log file for details."
    exit
  fi
}

installCodeSourcery() {
  # Unpack the tarball, creating the CodeSourcery dir, if necessary.
  if [[ ! -d ${CODE_SOURCERY_ROOT} ]]; then
    sudoCreateDir ${CODE_SOURCERY}
    cd ${CODE_SOURCERY}
    if [[ -e ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG} ]]; then
      runCommand "Unpacking CodeSourcery in ${CODE_SOURCERY}" \
          tar jxf ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG}
    else
      echo -n "CodeSourcery tarball not found in "
      echo "${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG}"
      echo -n "Fix the path or download it from "
      echo "${CODE_SOURCERY_HTTP}/${CROSS_TARGET}/${CODE_SOURCERY_PKG}"
      exit
    fi
  else
    echo "CodeSourcery install dir already exists; skipping."
  fi

  # Verify our CodeSourcery toolchain installation.
  if [[ ! -d "${SYSROOT}" ]]; then
    echo -n "Error: CodeSourcery does not contain libc for ${CROSS_TARGET}: "
    echo "${SYSROOT} not found."
    exit
  fi

  for tool in ${CROSS_TARGET_AS} ${CROSS_TARGET_LD}; do
    if [[ ! -e $tool ]]; then
      echo "${tool} not found; exiting."
      exit
    fi
  done
}

installLLVM() {
  if [[ -d ${LLVM_INSTALL_DIR} ]]; then
    echo "LLVM install dir ${LLVM_INSTALL_DIR} exists; skipping."
    return
  fi

  sudoCreateDir ${LLVM_INSTALL_DIR}

  # Unpack LLVM tarball; should create the directory "llvm".
  cd ${SRC_ROOT}
  runCommand "Unpacking LLVM" tar jxf ${LLVM_PKG_PATH}/${LLVM_PKG}

  # Configure, build, and install LLVM.
  createDir ${LLVM_OBJ_DIR}
  cd ${LLVM_OBJ_DIR}
  runAndLog "Configuring LLVM" ${LLVM_OBJ_DIR}/llvm-configure.log \
      ${LLVM_SRC_DIR}/configure \
      --disable-jit \
      --enable-optimized \
      --prefix=${LLVM_INSTALL_DIR} \
      --target=${CROSS_TARGET} \
      --with-llvmgccdir=${LLVMGCC_INSTALL_DIR}
  runAndLog "Building LLVM" ${LLVM_OBJ_DIR}/llvm-build.log \
      make ${MAKE_OPTS}
  runAndLog "Installing LLVM" ${LLVM_OBJ_DIR}/llvm-install.log \
      make ${MAKE_OPTS} install
}

installLLVMGCC() {
  if [[ -d ${LLVMGCC_INSTALL_DIR} ]]; then
    echo "LLVM-GCC install dir ${LLVMGCC_INSTALL_DIR} exists; skipping."
    return
  fi

  sudoCreateDir ${LLVMGCC_INSTALL_DIR}

  # Unpack LLVM-GCC tarball; should create the directory "llvm-gcc-4.2".
  cd ${SRC_ROOT}
  runCommand "Unpacking LLVM-GCC" tar jxf ${LLVM_PKG_PATH}/${LLVMGCC_PKG}

  # Configure, build, and install LLVM-GCC.
  createDir ${LLVMGCC_OBJ_DIR}
  cd ${LLVMGCC_OBJ_DIR}
  runAndLog "Configuring LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-configure.log \
      ${LLVMGCC_SRC_DIR}/configure \
      --enable-languages=c,c++ \
      --enable-llvm=${LLVM_INSTALL_DIR} \
      --prefix=${LLVMGCC_INSTALL_DIR} \
      --program-prefix=llvm- \
      --target=${CROSS_TARGET} \
      --with-arch=${CROSS_MARCH} \
      --with-as=${CROSS_TARGET_AS} \
      --with-ld=${CROSS_TARGET_LD} \
      --with-sysroot=${SYSROOT}
  runAndLog "Building LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-build.log \
      make
  runAndLog "Installing LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-install.log \
      make install
}

echo "Building in ${SCRATCH_ROOT}; installing in ${INSTALL_ROOT}"

createDir ${SRC_ROOT}
createDir ${OBJ_ROOT}

installCodeSourcery
installLLVM
installLLVMGCC

echo "Done."


# Functionality covered: this file contains a collection of tests for the auto
# loading and namespaces.
#
# Sourcing this file into Tcl runs the tests and generates output for errors.
# No output means no errors were found.
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.

if {"::tcltest" ni [namespace children]} {
    package require tcltest 2.5
    namespace import -force ::tcltest::*
}

# Clear out any namespaces called test_ns_*
catch {namespace delete {*}[namespace children :: test_ns_*]}

test init-0.1 {no error on initialization phase (init.tcl)} -setup {
    interp create child
} -body {
    child eval {
	list [set v [info exists ::errorInfo]] \
		[if {$v} {set ::errorInfo}] \
	     [set v [info exists ::errorCode]] \
		[if {$v} {set ::errorCode}]
    }
} -cleanup {
    interp delete child
} -result {0 {} 0 {}}

# Six cases - white box testing

test init-1.1 {auto_qualify - absolute cmd - namespace} {
    auto_qualify ::foo::bar ::blue
} ::foo::bar
test init-1.2 {auto_qualify - absolute cmd - global} {
    auto_qualify ::global ::sub
} global
test init-1.3 {auto_qualify - no colons cmd - global} {
    auto_qualify nocolons ::
} nocolons
test init-1.4 {auto_qualify - no colons cmd - namespace} {
    auto_qualify nocolons ::sub
} {::sub::nocolons nocolons}
test init-1.5 {auto_qualify - colons in cmd - global} {
    auto_qualify foo::bar ::
} ::foo::bar
test init-1.6 {auto_qualify - colons in cmd - namespace} {
    auto_qualify foo::bar ::sub
} {::sub::foo::bar ::foo::bar}
# Some additional tests
test init-1.7 {auto_qualify - multiples colons 1} {
    auto_qualify :::foo::::bar ::blue
} ::foo::bar
test init-1.8 {auto_qualify - multiple colons 2} {
    auto_qualify :::foo ::bar
} foo

# We use a child interp and auto_reset and double the tests because there is 2
# places where auto_loading occur (before loading the indexes files and after)

set testInterp [interp create]
tcltest::loadIntoChildInterpreter $testInterp {*}$argv
interp eval $testInterp {
    namespace import -force ::tcltest::*
    customMatch pairwise {apply {{mode pair} {
	if {[llength $pair] != 2} {error "need a pair of values to check"}
	string $mode [lindex $pair 0] [lindex $pair 1]
    }}}

    auto_reset
    catch {rename parray {}}

test init-2.0 {load parray - stage 1} -body {
    parray
} -returnCodes error -cleanup {
    rename parray {}  ;# remove it, for the next test - that should not fail.
} -result {wrong # args: should be "parray a ?pattern?"}
test init-2.1 {load parray - stage 2} -body {
    parray
} -returnCodes error -result {wrong # args: should be "parray a ?pattern?"}
auto_reset
catch {rename ::safe::setLogCmd {}}
#unset -nocomplain auto_index(::safe::setLogCmd) auto_oldpath
test init-2.2 {load ::safe::setLogCmd - stage 1} {
    ::safe::setLogCmd
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
test init-2.3 {load ::safe::setLogCmd - stage 2} {
    ::safe::setLogCmd
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
auto_reset
catch {rename ::safe::setLogCmd {}}
test init-2.4 {load safe:::setLogCmd - stage 1} {
    safe:::setLogCmd  ;# intentionally 3 :
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
test init-2.5 {load safe:::setLogCmd - stage 2} {
    safe:::setLogCmd  ;# intentionally 3 :
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
auto_reset
catch {rename ::safe::setLogCmd {}}
test init-2.6 {load setLogCmd from safe:: - stage 1} {
    namespace eval safe setLogCmd
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
test init-2.7 {oad setLogCmd from safe::  - stage 2} {
    namespace eval safe setLogCmd
    rename ::safe::setLogCmd {}  ;# should not fail
} {}
test init-2.8 {load tcl::HistAdd} -setup {
    auto_reset
    catch {rename ::tcl::HistAdd {}}
} -body {
    # 3 ':' on purpose
    tcl:::HistAdd
} -returnCodes error -cleanup {
    rename ::tcl::HistAdd {}
} -result {wrong # args: should be "tcl:::HistAdd event ?exec?"}

test init-3.0 {random stuff in the auto_index, should still work} {
    set auto_index(foo:::bar::blah) {
        namespace eval foo {namespace eval bar {proc blah {} {return 1}}}
    }
    foo:::bar::blah
} 1

# Tests that compare the error stack trace generated when autoloading with
# that generated when no autoloading is necessary.  Ideally they should be the
# same.

set count 0
foreach arg [subst -nocommands -novariables {
    c
    {argument
                which spans
                multiple lines}
    {argument which is all on one line but which is of such great length that the Tcl C library will truncate it when appending it onto the global error stack}
    {argument which spans multiple lines
                and is long enough to be truncated and
"               <- includes a false lead in the prune point search
                and must be longer still to force truncation}
                {contrived example: rare circumstance
		where the point at which to prune the
		error stack cannot be uniquely determined.
		foo bar foo
"}
    {contrived example: rare circumstance
		where the point at which to prune the
		error stack cannot be uniquely determined.
		foo bar
"}
    {argument that contains non-ASCII character, \u20ac, and which is of such great length that it will be longer than 150 bytes so it will be truncated by the Tcl C library}
	}] {    ;# emacs needs -> "

    test init-4.$count.0 {::errorInfo produced by [unknown]} -setup {
	auto_reset
    } -body {
	catch {parray a b $arg}
	set first $::errorInfo
	catch {parray a b $arg}
	list $first $::errorInfo
    } -match pairwise -result equal
    test init-4.$count.1 {::errorInfo produced by [unknown]} -setup {
	auto_reset
    } -body {
	namespace eval junk [list array set $arg [list 1 2 3 4]]
	trace variable ::junk::$arg r \
		"[list error [subst {Variable \"$arg\" is write-only}]] ;# "
	catch {parray ::junk::$arg}
	set first $::errorInfo
	catch {parray ::junk::$arg}
	list $first $::errorInfo
    } -match pairwise -result equal

    incr count
}

test init-4.$count {[Bug 46f801ed5a]} -setup {
    auto_reset
    array set auto_index {demo {proc demo {} {tailcall error foo}}}
} -body {
    demo
} -cleanup {
    array unset auto_index demo
    rename demo {}
} -returnCodes error -result foo

test init-5.0 {return options passed through ::unknown} -setup {
    catch {rename xxx {}}
    set ::auto_index(::xxx) {proc ::xxx {} {
	return -code error -level 2 xxx
    }}
} -body {
    set code [catch {::xxx} foo bar]
    set code2 [catch {::xxx} foo2 bar2]
    list $code $foo $bar $code2 $foo2 $bar2
} -cleanup {
    unset ::auto_index(::xxx)
} -match glob -result {2 xxx {-errorcode NONE -code 1 -level 1} 2 xxx {-code 1 -level 1 -errorcode NONE}}

cleanupTests
}	;#  End of [interp eval $testInterp]

# cleanup
interp delete $testInterp
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl
# fill-column: 78
# End:


bootblock-y += bootblock.c
romstage-y += romstage.c
ramstage-y += ramstage.c


// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

namespace System.Data.Entity.TestModels.ArubaModel
{
    public enum ArubaBugResolution
    {
        ByDesign = 1,
        Fixed = 2,
        NoRepro = 3,
        WontFix = 4,
        None = 0,
    }

    public class ArubaBug
    {
        public int Id { get; set; }
        public int Number { get; set; }
        public string Comment { get; set; }
        public ArubaFailure Failure { get; set; }
        public ArubaBugResolution? Resolution { get; set; }
    }
}


const errors = require('@tryghost/errors');
const _ = require('lodash');
const Promise = require('bluebird');
const rewire = require('rewire');
const should = require('should');
const sinon = require('sinon');
const {events} = require('../../../../core/server/lib/common');
const Queue = require('../../../../core/frontend/services/url/Queue');
const Resources = require('../../../../core/frontend/services/url/Resources');
const UrlGenerator = require('../../../../core/frontend/services/url/UrlGenerator');
const Urls = require('../../../../core/frontend/services/url/Urls');
const UrlService = rewire('../../../../core/frontend/services/url/UrlService');

describe('Unit: services/url/UrlService', function () {
    let QueueStub;
    let ResourcesStub;
    let UrlsStub;
    let UrlGeneratorStub;
    let urlService;

    beforeEach(function () {
        QueueStub = sinon.stub();
        QueueStub.returns(sinon.createStubInstance(Queue));

        ResourcesStub = sinon.stub();
        ResourcesStub.returns(sinon.createStubInstance(Resources));

        UrlsStub = sinon.stub();
        UrlsStub.returns(sinon.createStubInstance(Urls));

        UrlGeneratorStub = sinon.stub();
        UrlGeneratorStub.returns(sinon.createStubInstance(UrlGenerator));

        UrlService.__set__('Queue', QueueStub);
        UrlService.__set__('Resources', ResourcesStub);
        UrlService.__set__('Urls', UrlsStub);
        UrlService.__set__('UrlGenerator', UrlGeneratorStub);

        sinon.stub(events, 'on');

        urlService = new UrlService();
    });

    afterEach(function () {
        sinon.restore();
    });

    it('instantiate', function () {
        should.exist(urlService.utils);
        should.exist(urlService.urls);
        should.exist(urlService.resources);
        should.exist(urlService.queue);

        urlService.urlGenerators.should.eql([]);
        urlService.hasFinished().should.be.false();

        urlService.queue.addListener.calledTwice.should.be.true();
        urlService.queue.addListener.args[0][0].should.eql('started');
        urlService.queue.addListener.args[1][0].should.eql('ended');

        events.on.calledTwice.should.be.true();
        events.on.args[0][0].should.eql('router.created');
        events.on.args[1][0].should.eql('services.themes.api.changed');
    });

    it('fn: _onQueueStarted', function () {
        urlService._onQueueStarted('init');
        urlService.hasFinished().should.be.false();
    });

    it('fn: _onQueueEnded', function () {
        urlService._onQueueEnded('init');
        urlService.hasFinished().should.be.true();
    });

    it('fn: _onRouterAddedType', function () {
        urlService._onRouterAddedType({getPermalinks: sinon.stub().returns({})});
        urlService.urlGenerators.length.should.eql(1);
    });

    it('fn: getResourceById', function (done) {
        urlService.urls.getByResourceId.withArgs('id123').returns({resource: true});
        urlService.getResourceById('id123').should.eql(true);

        urlService.urls.getByResourceId.withArgs('id12345').returns(null);

        try {
            urlService.getResourceById('id12345').should.eql(true);
            done(new Error('expected error'));
        } catch (err) {
            should.exist(err);
            err.code.should.eql('URLSERVICE_RESOURCE_NOT_FOUND');
            done();
        }
    });

    describe('fn: getResource', function () {
        it('no resource for url found', function () {
            urlService.finished = false;
            urlService.urls.getByUrl.withArgs('/blog-post/').returns([]);

            try {
                urlService.getResource('/blog-post/');
                throw new Error('Expected error.');
            } catch (err) {
                (err instanceof errors.InternalServerError).should.be.true();
            }
        });

        it('no resource for url found', function () {
            urlService.finished = true;
            urlService.urls.getByUrl.withArgs('/blog-post/').returns([]);
            should.not.exist(urlService.getResource('/blog-post/'));
        });

        it('one resource for url found', function () {
            const resource = {x: 'y'};

            urlService.finished = true;
            urlService.urls.getByUrl.withArgs('/blog-post/').returns([{resource: resource}]);
            urlService.getResource('/blog-post/').should.eql(resource);
        });

        it('two resources for url found', function () {
            const object1 = {generatorId: 1, resource: {a: 1}};
            const object2 = {generatorId: 0, resource: {a: 2}};

            urlService.urlGenerators = [
                {
                    uid: 0
                },
                {
                    uid: 1
                }
            ];

            urlService.finished = true;
            urlService.urls.getByUrl.withArgs('/blog-post/').returns([object1, object2]);
            urlService.getResource('/blog-post/').should.eql(object2.resource);
        });

        it('two resources for url found', function () {
            const object1 = {generatorId: 0, resource: {a: 1}};
            const object2 = {generatorId: 1, resource: {a: 2}};

            urlService.urlGenerators = [
                {
                    uid: 0
                },
                {
                    uid: 1
                }
            ];

            urlService.finished = true;
            urlService.urls.getByUrl.withArgs('/blog-post/').returns([object1, object2]);
            urlService.getResource('/blog-post/').should.eql(object1.resource);
        });
    });

    describe('fn: getPermalinkByUrl', function () {
        it('found', function () {
            const permalinkStub1 = sinon.stub().returns({
                getValue: sinon.stub().returns('/:slug/')
            });

            const permalinkStub2 = sinon.stub().returns({
                getValue: sinon.stub().returns('/:primary_tag/')
            });

            urlService.urlGenerators = [
                {
                    uid: 0,
                    router: {
                        getPermalinks: permalinkStub1
                    }
                },
                {
                    uid: 1,
                    router: {
                        getPermalinks: permalinkStub2
                    }
                }
            ];

            sinon.stub(urlService, 'getResource').withArgs('/blog-post/', {returnEverything: true})
                .returns({generatorId: 1, resource: true});

            urlService.getPermalinkByUrl('/blog-post/').should.eql('/:primary_tag/');
        });

        it('found', function () {
            const permalinkStub1 = sinon.stub().returns({
                getValue: sinon.stub().returns('/:slug/')
            });

            const permalinkStub2 = sinon.stub().returns({
                getValue: sinon.stub().returns('/:primary_tag/')
            });

            urlService.urlGenerators = [
                {
                    uid: 0,
                    router: {
                        getPermalinks: permalinkStub1
                    }
                },
                {
                    uid: 1,
                    router: {
                        getPermalinks: permalinkStub2
                    }
                }
            ];

            sinon.stub(urlService, 'getResource').withArgs('/blog-post/', {returnEverything: true})
                .returns({generatorId: 0, resource: true});

            urlService.getPermalinkByUrl('/blog-post/').should.eql('/:slug/');
        });
    });

    describe('fn: getUrlByResourceId', function () {
        it('not found', function () {
            urlService.urls.getByResourceId.withArgs(1).returns(null);
            urlService.getUrlByResourceId(1).should.eql('/404/');
        });

        it('not found: absolute', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns(null);
            urlService.getUrlByResourceId(1, {absolute: true});

            urlService.utils.createUrl.calledWith('/404/', true, undefined).should.be.true();
        });

        it('found', function () {
            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1).should.eql('/post/');
        });

        it('found: absolute', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1, {absolute: true});
            urlService.utils.createUrl.calledWith('/post/', true, undefined).should.be.true();
        });

        it('found: absolute + secure', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1, {absolute: true, secure: true});
            urlService.utils.createUrl.calledWith('/post/', true, true).should.be.true();
        });

        it('not found: withSubdirectory', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns(null);
            urlService.getUrlByResourceId(1, {withSubdirectory: true});
            urlService.utils.createUrl.calledWith('/404/', false, undefined).should.be.true();
        });

        it('not found: withSubdirectory + secure', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns(null);
            urlService.getUrlByResourceId(1, {withSubdirectory: true, secure: true});
            urlService.utils.createUrl.calledWith('/404/', false, true).should.be.true();
        });

        it('not found: withSubdirectory + secure + absolute', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns(null);
            urlService.getUrlByResourceId(1, {withSubdirectory: true, secure: true, absolute: true});
            urlService.utils.createUrl.calledWith('/404/', true, true).should.be.true();
        });

        it('found: withSubdirectory', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1, {withSubdirectory: true});
            urlService.utils.createUrl.calledWith('/post/', false, undefined).should.be.true();
        });

        it('found: withSubdirectory + secure', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1, {withSubdirectory: true, secure: true});
            urlService.utils.createUrl.calledWith('/post/', false, true).should.be.true();
        });

        it('found: withSubdirectory + secure + absolute', function () {
            urlService.utils = sinon.stub();
            urlService.utils.createUrl = sinon.stub();

            urlService.urls.getByResourceId.withArgs(1).returns({url: '/post/'});
            urlService.getUrlByResourceId(1, {withSubdirectory: true, secure: true, absolute: true});
            urlService.utils.createUrl.calledWith('/post/', true, true).should.be.true();
        });
    });
});


package magic.model.action;

import magic.model.MagicCard;
import magic.model.MagicCardDefinition;
import magic.model.MagicGame;
import magic.model.MagicObject;
import magic.model.MagicPlayer;

public class PlayTokensAction extends MagicAction {

    private final MagicCard card;
    private final int count;

    public PlayTokensAction(final MagicPlayer player, final MagicCardDefinition cardDefinition, final int aCount) {
        card  = MagicCard.createTokenCard(cardDefinition,player);
        count = aCount;
    }

    public PlayTokensAction(final MagicPlayer player, final MagicObject obj, final int aCount) {
        this(player, obj.getCardDefinition(), aCount);
    }

    @Override
    public void doAction(final MagicGame game) {
        for (int i = 0; i < count; i++) {
            game.doAction(new PlayTokenAction(card));
        }
    }

    @Override
    public void undoAction(final MagicGame game) {
        //empty
    }
}


/*
 * Copyright (c) 2010. All rights reserved.
 */
package ro.isdc.wro.http;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import ro.isdc.wro.config.Context;
import ro.isdc.wro.config.jmx.WroConfiguration;
import ro.isdc.wro.http.support.ServletContextAttributeHelper;

/**
 * Test for {@link WroFilter} class.
 *
 * @author Alex Objelean
 * @created Created on Jul 13, 2009
 */
public class TestWroContextFilter {
  private WroContextFilter victim;
  @Mock
  private FilterConfig mockFilterConfig;
  @Mock
  private ServletContext mockServletContext;
  @Mock
  private HttpServletRequest mockRequest;
  @Mock
  private HttpServletResponse mockResponse;
  @Mock
  private FilterChain mockFilterChain;
  @Mock
  private ServletContextAttributeHelper mockServletContextAttributeHelper;

  @BeforeClass
  public static void onBeforeClass() {
    assertEquals(0, Context.countActive());
  }

  @Before
  public void setUp()
    throws Exception {
    MockitoAnnotations.initMocks(this);
    victim = new WroContextFilter() {
      @Override
      ServletContextAttributeHelper getServletContextAttributeHelper() {
        return mockServletContextAttributeHelper;
      }
    };
    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
    victim.init(mockFilterConfig);
  }

  @Test
  public void shouldInitializeContextForChainedFilters() throws Exception {
    doAnswer(new Answer<Void>() {
      public Void answer(InvocationOnMock invocation)
          throws Throwable {
        assertTrue(Context.isContextSet());
        return null;
      }
    }).when(mockFilterChain).doFilter(Mockito.any(HttpServletRequest.class), Mockito.any(HttpServletResponse.class));
    victim.doFilter(mockRequest, mockResponse, mockFilterChain);
    verify(mockFilterChain, times(1)).doFilter(Mockito.any(HttpServletRequest.class),
        Mockito.any(HttpServletResponse.class));
    //After chain processing, the context must be unset
    assertFalse(Context.isContextSet());
  }

  @Test
  public void shouldUseWroConfigurationFoundInServletContext() throws Exception {
    final WroConfiguration config = new WroConfiguration();
    config.setCacheUpdatePeriod(1000);

    when(mockServletContextAttributeHelper.getWroConfiguration()).thenReturn(config);
    doAnswer(new Answer<Void>() {
      public Void answer(InvocationOnMock invocation)
          throws Throwable {
        assertSame(config, Context.get().getConfig());
        return null;
      }
    }).when(mockFilterChain).doFilter(Mockito.any(HttpServletRequest.class), Mockito.any(HttpServletResponse.class));
    victim.doFilter(mockRequest, mockResponse, mockFilterChain);
    verify(mockFilterChain, Mockito.times(1)).doFilter(Mockito.any(HttpServletRequest.class),
        Mockito.any(HttpServletResponse.class));
  }

  /**
   * Test for issue824 (https://code.google.com/p/wro4j/issues/detail?id=824).
   * Checks that nested requests are properly cleaned up.
   */
  @Test
  public void shouldNotLeakContextForNestedRequest()
      throws Exception {

    final WroFilter innerFilter = new WroFilter();
    innerFilter.init(mockFilterConfig);

    final FilterChain chain = new FilterChain() {
      public void doFilter(ServletRequest req, ServletResponse res)
          throws IOException, ServletException {
        victim.doFilter(req, res, mockFilterChain);
      }
    };

    victim.init(mockFilterConfig);
    victim.doFilter(mockRequest, mockResponse, chain);
    assertEquals(0, Context.countActive());
  }
}


/**
 * NuxtOptionsLoading
 * Documentation: https://nuxtjs.org/api/configuration-loading
 */

export interface NuxtOptionsLoading {
  color?: string
  continuous?: boolean
  css?: boolean
  duration?: number
  failedColor?: string
  height?: string
  rtl?: boolean
  throttle?: number
}

/**
 * NuxtOptionsLoadingIndicator
 * Documentation: https://nuxtjs.org/api/configuration-loading-indicator
 */

export interface NuxtOptionsLoadingIndicator {
  background?: string
  color?: string
  color2?: string
  name?: string
}


// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

/*
For extra ASP classic objects, initialize CodeMirror instance with this option:
    isASP: true

E.G.:
    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        isASP: true
      });
*/

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
"use strict";

CodeMirror.defineMode("vbscript", function(conf, parserConf) {
    var ERRORCLASS = 'error';

    function wordRegexp(words) {
        return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
    }

    var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]");
    var doubleOperators = new RegExp("^((<>)|(<=)|(>=))");
    var singleDelimiters = new RegExp('^[\\.,]');
    var brakets = new RegExp('^[\\(\\)]');
    var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*");

    var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for'];
    var middleKeywords = ['else','elseif','case'];
    var endKeywords = ['next','loop','wend'];

    var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']);
    var commonkeywords = ['dim', 'redim', 'then',  'until', 'randomize',
                          'byval','byref','new','property', 'exit', 'in',
                          'const','private', 'public',
                          'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me'];

    //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx
    var atomWords = ['true', 'false', 'nothing', 'empty', 'null'];
    //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx
    var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart',
                        'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject',
                        'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left',
                        'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round',
                        'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp',
                        'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year'];

    //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx
    var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare',
                         'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek',
                         'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError',
                         'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2',
                         'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo',
                         'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse',
                         'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray'];
    //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx
    var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp'];
    var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count'];
    var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit'];

    var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application'];
    var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response
                              'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request
                              'contents', 'staticobjects', //application
                              'codepage', 'lcid', 'sessionid', 'timeout', //session
                              'scripttimeout']; //server
    var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response
                           'binaryread', //request
                           'remove', 'removeall', 'lock', 'unlock', //application
                           'abandon', //session
                           'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server

    var knownWords = knownMethods.concat(knownProperties);

    builtinObjsWords = builtinObjsWords.concat(builtinConsts);

    if (conf.isASP){
        builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords);
        knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties);
    };

    var keywords = wordRegexp(commonkeywords);
    var atoms = wordRegexp(atomWords);
    var builtinFuncs = wordRegexp(builtinFuncsWords);
    var builtinObjs = wordRegexp(builtinObjsWords);
    var known = wordRegexp(knownWords);
    var stringPrefixes = '"';

    var opening = wordRegexp(openingKeywords);
    var middle = wordRegexp(middleKeywords);
    var closing = wordRegexp(endKeywords);
    var doubleClosing = wordRegexp(['end']);
    var doOpening = wordRegexp(['do']);
    var noIndentWords = wordRegexp(['on error resume next', 'exit']);
    var comment = wordRegexp(['rem']);

    function indent(_stream, state) {
      state.currentIndent++;
    }

    function dedent(_stream, state) {
      state.currentIndent--;
    }
    // tokenizers
    function tokenBase(stream, state) {
        if (stream.eatSpace()) {
            return 'space';
            //return null;
        }

        var ch = stream.peek();

        // Handle Comments
        if (ch === "'") {
            stream.skipToEnd();
            return 'comment';
        }
        if (stream.match(comment)){
            stream.skipToEnd();
            return 'comment';
        }

        // Handle Number Literals
        if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) {
            var floatLiteral = false;
            // Floats
            if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; }
            else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
            else if (stream.match(/^\.\d+/)) { floatLiteral = true; }

            if (floatLiteral) {
                // Float literals may be "imaginary"
                stream.eat(/J/i);
                return 'number';
            }
            // Integers
            var intLiteral = false;
            // Hex
            if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; }
            // Octal
            else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; }
            // Decimal
            else if (stream.match(/^[1-9]\d*F?/)) {
                // Decimal literals may be "imaginary"
                stream.eat(/J/i);
                // TODO - Can you have imaginary longs?
                intLiteral = true;
            }
            // Zero by itself with no other piece of number.
            else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
            if (intLiteral) {
                // Integer literals may be "long"
                stream.eat(/L/i);
                return 'number';
            }
        }

        // Handle Strings
        if (stream.match(stringPrefixes)) {
            state.tokenize = tokenStringFactory(stream.current());
            return state.tokenize(stream, state);
        }

        // Handle operators and Delimiters
        if (stream.match(doubleOperators)
            || stream.match(singleOperators)
            || stream.match(wordOperators)) {
            return 'operator';
        }
        if (stream.match(singleDelimiters)) {
            return null;
        }

        if (stream.match(brakets)) {
            return "bracket";
        }

        if (stream.match(noIndentWords)) {
            state.doInCurrentLine = true;

            return 'keyword';
        }

        if (stream.match(doOpening)) {
            indent(stream,state);
            state.doInCurrentLine = true;

            return 'keyword';
        }
        if (stream.match(opening)) {
            if (! state.doInCurrentLine)
              indent(stream,state);
            else
              state.doInCurrentLine = false;

            return 'keyword';
        }
        if (stream.match(middle)) {
            return 'keyword';
        }

        if (stream.match(doubleClosing)) {
            dedent(stream,state);
            dedent(stream,state);

            return 'keyword';
        }
        if (stream.match(closing)) {
            if (! state.doInCurrentLine)
              dedent(stream,state);
            else
              state.doInCurrentLine = false;

            return 'keyword';
        }

        if (stream.match(keywords)) {
            return 'keyword';
        }

        if (stream.match(atoms)) {
            return 'atom';
        }

        if (stream.match(known)) {
            return 'variable-2';
        }

        if (stream.match(builtinFuncs)) {
            return 'builtin';
        }

        if (stream.match(builtinObjs)){
            return 'variable-2';
        }

        if (stream.match(identifiers)) {
            return 'variable';
        }

        // Handle non-detected items
        stream.next();
        return ERRORCLASS;
    }

    function tokenStringFactory(delimiter) {
        var singleline = delimiter.length == 1;
        var OUTCLASS = 'string';

        return function(stream, state) {
            while (!stream.eol()) {
                stream.eatWhile(/[^'"]/);
                if (stream.match(delimiter)) {
                    state.tokenize = tokenBase;
                    return OUTCLASS;
                } else {
                    stream.eat(/['"]/);
                }
            }
            if (singleline) {
                if (parserConf.singleLineStringErrors) {
                    return ERRORCLASS;
                } else {
                    state.tokenize = tokenBase;
                }
            }
            return OUTCLASS;
        };
    }

    function tokenLexer(stream, state) {
        var style = state.tokenize(stream, state);
        var current = stream.current();

        // Handle '.' connected identifiers
        if (current === '.') {
            style = state.tokenize(stream, state);

            current = stream.current();
            if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) {
                if (style === 'builtin' || style === 'keyword') style='variable';
                if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2';

                return style;
            } else {
                return ERRORCLASS;
            }
        }

        return style;
    }

    var external = {
        electricChars:"dDpPtTfFeE ",
        startState: function() {
            return {
              tokenize: tokenBase,
              lastToken: null,
              currentIndent: 0,
              nextLineIndent: 0,
              doInCurrentLine: false,
              ignoreKeyword: false

          };
        },

        token: function(stream, state) {
            if (stream.sol()) {
              state.currentIndent += state.nextLineIndent;
              state.nextLineIndent = 0;
              state.doInCurrentLine = 0;
            }
            var style = tokenLexer(stream, state);

            state.lastToken = {style:style, content: stream.current()};

            if (style==='space') style=null;

            return style;
        },

        indent: function(state, textAfter) {
            var trueText = textAfter.replace(/^\s+|\s+$/g, '') ;
            if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1);
            if(state.currentIndent < 0) return 0;
            return state.currentIndent * conf.indentUnit;
        }

    };
    return external;
});

CodeMirror.defineMIME("text/vbscript", "vbscript");

});


<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8,00"
	Name="perform_front_propagation_mesh"
	ProjectGUID="{E4A823A7-267F-494F-87CF-BB933986F90D}"
	Keyword="Win32Proj"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="../"
			IntermediateDirectory="Debug"
			ConfigurationType="2"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="C:\MATLAB7\extern\include"
				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DENOISING_EXPORTS"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="true"
				DebugInformationFormat="4"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="libmex.lib libmx.lib libut.lib"
				OutputFile="../perform_front_propagation_mesh.dll"
				LinkIncremental="2"
				AdditionalLibraryDirectories="C:\MATLAB7\extern\lib\win32\microsoft\msvc70"
				ModuleDefinitionFile="perform_front_propagation_mesh.def"
				GenerateDebugInformation="true"
				ProgramDatabaseFile="$(OutDir)/perform_front_propagation_mesh.pdb"
				SubSystem="2"
				ImportLibrary="$(OutDir)/perform_front_propagation_mesh.lib"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="../"
			IntermediateDirectory="Release"
			ConfigurationType="2"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="1"
				OmitFramePointers="true"
				AdditionalIncludeDirectories="C:\MATLAB7\extern\include"
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DENOISING_EXPORTS"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="true"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="libmex.lib libmx.lib libut.lib"
				OutputFile="../perform_front_propagation_mesh.dll"
				LinkIncremental="1"
				AdditionalLibraryDirectories="C:\MATLAB7\extern\lib\win32\microsoft\msvc70"
				ModuleDefinitionFile="perform_front_propagation_mesh.def"
				GenerateDebugInformation="true"
				SubSystem="2"
				OptimizeReferences="2"
				EnableCOMDATFolding="2"
				ImportLibrary="$(OutDir)/perform_front_propagation_mesh.lib"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="gw_core"
			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
			>
			<File
				RelativePath=".\gw\gw_core\GW_Config.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Config.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Face.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Face.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Face.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_FaceIterator.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_FaceIterator.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_MathsWrapper.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Mesh.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Mesh.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Mesh.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_PolygonIntersector.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_ProgressBar.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Serializable.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_SmartCounter.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_SmartCounter.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_SmartCounter.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Vertex.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Vertex.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_Vertex.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_VertexIterator.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\GW_VertexIterator.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\stdafx.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_core\stdafx.h"
				>
			</File>
		</Filter>
		<Filter
			Name="gw_geodesic"
			>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicFace.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicFace.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicFace.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicMesh.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicMesh.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicMesh.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicPoint.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicPoint.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicPoint.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicVertex.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicVertex.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_GeodesicVertex.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_ABC.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Linear.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Linear.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Linear.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Quadratic.cpp"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Quadratic.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\GW_TriangularInterpolation_Quadratic.inl"
				>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\stdafx.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						ObjectFile="$(IntDir)\$(InputName)1.obj"
						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						ObjectFile="$(IntDir)\$(InputName)1.obj"
						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\gw\gw_geodesic\stdafx.h"
				>
			</File>
		</Filter>
		<Filter
			Name="main"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
			>
			<File
				RelativePath="perform_front_propagation_mesh.cpp"
				>
			</File>
			<File
				RelativePath="perform_front_propagation_mesh.def"
				>
			</File>
		</Filter>
		<Filter
			Name="gw_maths"
			>
			<File
				RelativePath=".\gw\gw_maths\gw_complex.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Maths.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_MathsConfig.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Matrix2x2.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Matrix3x3.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Matrix4x4.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_MatrixNxP.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_MatrixStatic.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Quaternion.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_SparseMatrix.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Vector2D.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Vector3D.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_Vector4D.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_VectorND.h"
				>
			</File>
			<File
				RelativePath=".\gw\gw_maths\GW_VectorStatic.h"
				>
			</File>
		</Filter>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>


uuid: 69303e67-aeb8-42f6-ac1e-379b72a6989e
langcode: en
status: true
dependencies:
  module:
    - node
id: katacoda_course_alias
label: 'Katacoda Course Alias'
type: 'canonical_entities:node'
pattern: '/courses/[node:field_katacoda_course_url_slug]'
selection_criteria:
  328bb591-559b-4cd0-8100-2c407c3642f4:
    id: node_type
    bundles:
      katacoda_course: katacoda_course
    negate: false
    context_mapping:
      node: node
    uuid: 328bb591-559b-4cd0-8100-2c407c3642f4
selection_logic: and
weight: -5
relationships: {  }


Information about the condition of a component.

Status of the condition for a component. Valid values for "Healthy": "True", "False", or "Unknown".

Message about the condition for a component. For example, information about a health check.

Type of condition for a component. Valid value: "Healthy"

Condition error code for a component. For example, a health check error code.


/**
 * @file   getFunctionApproximatorByName.hpp
 * @brief  getFunctionApproximatorByName header file.
 * @author Freek Stulp
 *
 * This file is part of DmpBbo, a set of libraries and programs for the
 * black-box optimization of dynamical movement primitives.
 * Copyright (C) 2014 Freek Stulp, ENSTA-ParisTech
 *
 * DmpBbo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * DmpBbo 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with DmpBbo.  If not, see <http://www.gnu.org/licenses/>.
 */

/** \ingroup FunctionApproximators
 */

#ifndef _GETFUNCTIONAPPROXIMATORBYNAME_H_
#define _GETFUNCTIONAPPROXIMATORBYNAME_H_

#include <string>

namespace DmpBbo {

class FunctionApproximator;

/** Initialize a function approximator from its name.
 \param[in] name Name of the function approximator, e.g. "LWR"
 \param[in] n_input_dims Dimensionality of the input data
 \return A pointer to an initialized function approximator.
 */
FunctionApproximator* getFunctionApproximatorByName(std::string name, int n_input_dims=1);

/**
LWR : n_basis_functions (int), intersection (double)
RBFN : n_basis_functions (int), intersection (double)
LWPR: w_gen, w_prune, update_D, init_alpha, penalty, init_d
GMR: n_basis_functions (int)
RRRFF n_basis_functions (int), regularization (double), gamma (double)
GPR: maximum_covariance (double), length (double)
 */
FunctionApproximator* getFunctionApproximatorFromArgs(int n_args, char* args[], int n_input_dims=1);

}

#endif


mkdir build && cd build && cmake .. && make -j4


import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { InsertPage } from './insert';

@NgModule({
  declarations: [
    InsertPage,
  ],
  imports: [
    IonicPageModule.forChild(InsertPage),
  ],
})
export class InsertPageModule {}


/*
 * Scala (https://www.scala-lang.org)
 *
 * Copyright EPFL and Lightbend, Inc.
 *
 * Licensed under Apache License 2.0
 * (http://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package scala.annotation.unchecked

import scala.annotation.meta.{field, getter}

/** An annotation for values that are assumed to be stable even though their
 *  types are volatile.
 */
@getter @field
final class uncheckedStable extends scala.annotation.StaticAnnotation {}


#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#  king_phisher/ics.py
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are
#  met:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above
#    copyright notice, this list of conditions and the following disclaimer
#    in the documentation and/or other materials provided with the
#    distribution.
#  * Neither the name of the project nor the names of its
#    contributors may be used to endorse or promote products derived from
#    this software without specific prior written permission.
#
#  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 MERCHANTABILITY AND FITNESS FOR
#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  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 DAMAGE.
#

import collections
import datetime
import os
import re
import uuid

from king_phisher import its
from king_phisher import utilities

import dateutil.tz
import icalendar
import pytz.tzfile
import tzlocal
import smoke_zephyr.utilities

DAY_ABBREVIATIONS = ('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA')
"""The abbreviations of day names for use in :py:class:`icalendar.vRecur` instances."""
SECONDS_IN_ONE_DAY = (24 * 60 * 60)
SECONDS_IN_ONE_HOUR = (60 * 60)

POSIX_VAR_OFFSET = re.compile(
	r'<?(?:[A-Z]{3,5})?'
	r'(?P<offset>([\+\-])?[0-9:]{1,5})'
	r'(<|([A-Z]{3,5})(?P<offset_dst>([\+\-])?([0-9:]{1,5})?))?',
	flags=re.IGNORECASE
)
POSIX_VAR = re.compile(
	POSIX_VAR_OFFSET.pattern +
	r',(?P<start>M\d{1,2}\.[1-5]\.[0-6](/([\+\-])?[0-9:]{1,5})?),'
	r'(?P<end>M\d{1,2}\.[1-5]\.[0-6](/([\+\-])?[0-9:]{1,5})?)',
	flags=re.IGNORECASE
)
POSIX_VAR_DST_RRULE = re.compile(r'M(?P<month>\d{1,2}).(?P<week>[1-5]).(?P<day>[0-6])(/\d{1,2})?', flags=re.IGNORECASE)

zoneinfo_path = os.path.join(os.path.dirname(pytz.tzfile.__file__), 'zoneinfo')
"""The path to the directory which holds the IANA timezone data files."""

if not os.path.isdir(zoneinfo_path) and its.on_linux:
	path = None
	for path in ('/usr/share/zoneinfo', '/usr/local/share/zoneinfo'):
		if os.path.isdir(path):
			zoneinfo_path = path
			break
	del path

TimezoneOffsetDetails = collections.namedtuple(
	'TimezoneOffsetDetails',
	(
		'offset',
		'offset_dst',
		'dst_start',
		'dst_end'
	)
)
"""A named tuple describing the details of a timezone's UTC offset and DST occurrence."""

def get_timedelta_for_offset(offset):
	"""
	Take a POSIX environment variable style offset from UTC and convert it into
	a :py:class:`~datetime.timedelta` instance suitable for use with the
	:py:mod:`icalendar`.

	:param str offset: The offset from UTC such as "-5:00"
	:return: The parsed offset.
	:rtype: :py:class:`datetime.timedelta`
	"""
	sign = '+'
	if offset[0] in ('+', '-'):
		sign = offset[0]
		offset = offset[1:]
	if ':' in offset:
		hours, minutes = offset.split(':')
	else:
		hours, minutes = offset, 0
	hours = int(hours)
	minutes = int(minutes)
	seconds = ((hours * 60 * 60) + (minutes * 60))
	if sign == '-':
		delta = datetime.timedelta(0, seconds)
	else:
		delta = datetime.timedelta(-1, SECONDS_IN_ONE_DAY - seconds)
	return delta

@smoke_zephyr.utilities.Cache(float('inf'))
def get_tz_posix_env_var(tz_name):
	"""
	Get the timezone information in the POSIX TZ environment variable format
	from the IANA timezone data files included in the :py:mod:`pytz` package.

	:param str tz_name: The name of the timezone to get the environment variable
		for such as "America/New_York".
	:return: The TZ environment variable string, if it is specified in the
		timezone data file.
	:rtype: str
	"""
	buffer_size = 2048
	if not os.path.isdir(zoneinfo_path):
		raise ValueError('zoneinfo_path must be a valid directory')
	file_path = os.path.join(zoneinfo_path, *tz_name.split('/'))
	with open(file_path, 'rb') as file_h:
		magic = file_h.read(4)
		if magic != b'TZif':
			raise ValueError('the timezone file header is incorrect')
		version = file_h.read(1)
		if version != b'2':
			return ''
		file_h.seek(max(os.path.getsize(file_path) - buffer_size, 0), os.SEEK_SET)
		data = file_h.read(buffer_size)
	end_pos = -2
	if its.py_v3:
		newline = 0x0a
	else:
		newline = '\n'
	while data[end_pos] != newline:
		end_pos -= 1
	end_pos += 1
	env_var = data[end_pos:-1]
	if its.py_v3:
		env_var = env_var.decode('utf-8')
	return env_var

@smoke_zephyr.utilities.Cache(float('inf'))
def parse_tz_posix_env_var(posix_env_var):
	"""
	Get the details regarding a timezone by parsing the POSIX style TZ
	environment variable.

	:param str posix_env_var: The POSIX style TZ environment variable.
	:return: The parsed TZ environment variable.
	:rtype: :py:class:`.TimezoneOffsetDetails`
	"""
	match = POSIX_VAR_OFFSET.match(posix_env_var)
	if match is None:
		return
	match = match.groupdict()
	offset = get_timedelta_for_offset(match['offset'])
	if match['offset_dst'] is None:
		offset_dst = None
	elif len(match['offset_dst']):
		offset_dst = get_timedelta_for_offset(match['offset_dst'])
	else:
		# default to an hour difference if it's not specified
		offset_dst = offset - datetime.timedelta(0, SECONDS_IN_ONE_HOUR)
	dst_start = None
	dst_end = None
	match = POSIX_VAR.match(posix_env_var)
	if match:
		match = match.groupdict()
		dst_start = match['start']
		dst_end = match['end']

		match = POSIX_VAR_DST_RRULE.match(dst_start)
		details = match.groupdict()
		byday = details['week'] + DAY_ABBREVIATIONS[int(details['day'])]
		dst_start = icalendar.vRecur({'BYMONTH': details['month'], 'FREQ': 'YEARLY', 'INTERVAL': 1, 'BYDAY': byday})

		match = POSIX_VAR_DST_RRULE.match(dst_end)
		details = match.groupdict()
		byday = details['week'] + DAY_ABBREVIATIONS[int(details['day'])]
		dst_end = icalendar.vRecur({'BYMONTH': details['month'], 'FREQ': 'YEARLY', 'INTERVAL': 1, 'BYDAY': byday})
	else:
		# remove the dst offset if not rrule is present on when it's active
		offset_dst = None
	details = TimezoneOffsetDetails(offset, offset_dst, dst_start, dst_end)
	return details

class DurationAllDay(object):
	"""
	A representation of a duration that can be used for an event to indicate
	that it takes place all day.
	"""
	__slots__ = ('days')
	def __init__(self, days=1):
		self.days = max(days, 0)

class Timezone(icalendar.Timezone):
	"""
	An icalendar formatted timezone with all properties populated for the
	specified zone.
	"""
	def __init__(self, tz_name=None):
		"""
		:param str tz_name: The timezone to represent, if not specified it
			defaults to the local timezone.
		"""
		super(Timezone, self).__init__()
		if tz_name is None:
			tz_name = tzlocal.get_localzone().zone
		self.add('tzid', tz_name)

		tz_details = parse_tz_posix_env_var(get_tz_posix_env_var(tz_name))
		timezone_standard = icalendar.TimezoneStandard()
		timezone_standard.add('dtstart', datetime.datetime(1601, 1, 1, 2, 0, tzinfo=dateutil.tz.tzutc()))
		timezone_standard.add('tzoffsetfrom', tz_details.offset + datetime.timedelta(0, SECONDS_IN_ONE_HOUR))
		timezone_standard.add('tzoffsetto', tz_details.offset)

		if tz_details.offset_dst:
			timezone_standard.add('rrule', tz_details.dst_end)
			timezone_daylight = icalendar.TimezoneDaylight()
			timezone_daylight.add('dtstart', datetime.datetime(1601, 1, 1, 2, 0, tzinfo=dateutil.tz.tzutc()))
			timezone_daylight.add('tzoffsetfrom', tz_details.offset)
			timezone_daylight.add('tzoffsetto', tz_details.offset + datetime.timedelta(0, SECONDS_IN_ONE_HOUR))
			timezone_daylight.add('rrule', tz_details.dst_start)
			self.add_component(timezone_daylight)
		self.add_component(timezone_standard)

class Calendar(icalendar.Calendar):
	"""
	An icalendar formatted event for converting to an ICS file and then sending
	in an email.
	"""
	def __init__(self, organizer_email, start, summary, organizer_cn=None, description=None, duration='1h', location=None):
		"""
		:param str organizer_email: The email of the event organizer.
		:param start: The start time for the event.
		:type start: :py:class:`datetime.datetime`
		:param str summary: A short summary of the event.
		:param str organizer_cn: The name of the event organizer.
		:param str description: A more complete description of the event than
			what is provided by the *summary* parameter.
		:param duration: The events scheduled duration.
		:type duration: int, str, :py:class:`~datetime.timedelta`, :py:class:`.DurationAllDay`
		:param str location: The location for the event.
		"""
		utilities.assert_arg_type(start, datetime.datetime, 2)
		super(Calendar, self).__init__()
		if start.tzinfo is None:
			start = start.replace(tzinfo=dateutil.tz.tzlocal())
		start = start.astimezone(dateutil.tz.tzutc())

		for case in utilities.switch(duration, comp=isinstance):
			if case(str):
				duration = smoke_zephyr.utilities.parse_timespan(duration)
				duration = datetime.timedelta(seconds=duration)
				break
			if case(int):
				duration = datetime.timedelta(seconds=duration)
				break
			if case(datetime.timedelta):
				break
			if case(DurationAllDay):
				break
		else:
			raise TypeError('unknown duration type')

		self.add('method', 'REQUEST')
		self.add('prodid', 'Microsoft Exchange Server 2010')
		self.add('version', '2.0')

		self._event = icalendar.Event()
		event = self._event
		self.add_component(event)
		self.add_component(Timezone())

		organizer = icalendar.vCalAddress('MAILTO:' + organizer_email)
		organizer.params['cn'] = icalendar.vText(organizer_cn or organizer_email)
		event['organizer'] = organizer

		event.add('description', description or summary)
		event.add('uid', str(uuid.uuid4()))
		event.add('summary', summary)
		if isinstance(duration, DurationAllDay):
			event.add('dtstart', start.date())
			event.add('dtend', (start + datetime.timedelta(days=duration.days)).date())
		else:
			event.add('dtstart', start)
			event.add('dtend', start + duration)
		event.add('class', 'PUBLIC')
		event.add('priority', 5)
		event.add('dtstamp', datetime.datetime.now(dateutil.tz.tzutc()))
		event.add('transp', 'OPAQUE')
		event.add('status', 'CONFIRMED')
		event.add('sequence', 0)
		if location:
			event.add('location', icalendar.vText(location))

		alarm = icalendar.Alarm()
		alarm.add('description', 'REMINDER')
		alarm.add('trigger;related=start', '-PT1H')
		alarm.add('action', 'DISPLAY')
		event.add_component(alarm)

	def __str__(self):
		return self.to_ical()

	def add_attendee(self, email, cn=None, rsvp=True):
		"""
		Add an attendee to the event. If the event is being sent via an email,
		the recipient should be added as an attendee.

		:param str email: The attendee's email address.
		:param str cn: The attendee's common name.
		:param bool rsvp: Whether or not to request an RSVP response from the
			attendee.
		"""
		attendee = icalendar.vCalAddress('MAILTO:' + email)
		attendee.params['ROLE'] = icalendar.vText('REQ-PARTICIPANT')
		attendee.params['PARTSTAT'] = icalendar.vText('NEEDS-ACTION')
		attendee.params['RSVP'] = icalendar.vText(str(bool(rsvp)).upper())
		attendee.params['CN'] = icalendar.vText(cn or email)
		self._event.add('attendee', attendee)

	def to_ical(self, encoding='utf-8', **kwargs):
		"""
		Convert the calendar object to a string in the iCalendar format.

		:return: The string representation of the data.
		:rtype: str
		"""
		return super(Calendar, self).to_ical(**kwargs).decode('utf-8')


/*
Copyright 2019 The Perkeep Authors

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.
*/

// Package must contains helpers that panic on failure.
package must // import "go4.org/must"

import "io"

// Close calls c.Close and panics if it returns an error.
// The panic value is the return value from Close.
func Close(c io.Closer) {
	if err := c.Close(); err != nil {
		panic(err)
	}
}

// Do runs fn and panics if it returns an error.
// The panic value is the return value from fn.
func Do(fn func() error) {
	if err := fn(); err != nil {
		panic(err)
	}
}


package com.smart.sso.server.dto;

public class PermissionDto extends TreeDto {

    private static final long serialVersionUID = 9191900436619971003L;

    private Boolean checked;

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }
}


A : "a" A "a" ;
  : "a" A "b" ;
  : "b" A "b" ;
  : "b" A "a" ;
  : ;


from OpenNero import *
import time
import random
import math
import action_script
from Queue import Queue
from constants import *

class RoombaBrain(AgentBrain):
    """
    Scripted behavior for Roomba agent
    A "lifetime" of an agent brain looks like this:
    1. __init__() is called (new brain)
    2. initialize() is called (passing specs for sensors, actions and rewards)
    3. start() is called
    4. act() is called 0 or more times
    5. end() is called
    6. if new episode, go to 3, otherwise go to 7
    7. destroy() is called
    """
    def __init__(self):
        """
        this is the constructor - it gets called when the brain object is first created
        """
        # call the parent constructor
        AgentBrain.__init__(self) # do not remove!
        self.action_sq = Queue()

    def initialize(self, init_info):
        """
        init_info contains a description of the observations the agent will see
        and the actions the agent will be able to perform
        """
        self.init_info = init_info
        return True

    def start(self, time, sensors):
        """
        Take in the initial sensors and return the first action
        """
        return self.act(time, sensors, 0)

    def act(self, time, sensors, reward):
        """
        Take in new sensors and reward from previous action and return the next action
        Specifically, just move toward the closest crumb!
        """
        action = self.init_info.actions.get_instance()
        # just tell the agent which way to go!
        action[0] = action_script.go_xy(sensors, sensors[3], sensors[4])
        return action

    def end(self, time, reward):
        """
        take in final reward
        """
        return True

    def destroy(self):
        """
        called when the agent is destroyed
        """
        self.time = 0
        return True


#ifndef LINKLABEL_H
#define LINKLABEL_H

#include <QLabel>

class LinkLabel : public QLabel
{
    Q_OBJECT

public:
    LinkLabel(QWidget *parent = 0);
    ~LinkLabel();

    void setLinkRange(int min, int max);

private:
    QString *numsAtBeginingSmallBox;
    QString *numsAtBegining;
    QString *numsAtMiddle;
    QString *numsAtEnd;
    QString linkButtons;

    int minLinkValue;
    int maxLinkValue;
    int currentValue;

    enum { START_POINT = 1, VISIBLE_COUNT_MARKER = 6, NUMS_AT_LEFT = 2, NUMS_AT_RIGHT = 3 };
    enum { POINT_SIZE = 10 };

    void refreshLabel(int curIndex);
    void setLabelWithoutScrolling(int currentIndex);
    void setScrolledLabel_specialRange(int curIndex);
    void setScrolledLabel_middleRange(int curIndex);
    void switchLinkButtons(int pressedIndex);

private slots:
    void getPressedLink(QString text);

signals:
    void linkPressed(int value);
};

#endif // LINKLABEL_H


/*
Copyright The Kubernetes Authors.

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.
*/

// Code generated by client-gen. DO NOT EDIT.

package v1beta1

type PriorityClassExpansion interface{}


--source include/have_innodb_max_16k.inc

--echo #
--echo # Bug#22046353 ALTER: ASSERT PAGE_SIZE.EQUALS_TO(SPACE_PAGE_SIZE),
--echo # BTR_COPY_BLOB_PREFIX
--echo #

CREATE TABLE t1
( f1 int primary key, f2 blob,
  f3 blob generated always as (f2))
  row_format=compressed, engine=innodb;
insert into t1 (f1, f2) values (1, repeat('&', 50000));
alter table t1 add index i1 (f3(200)) ;
alter table t1 row_format=compact;
drop table t1;