text:
package name

import (
	"testing"
	"unicode"
)

func createBasicVaidator(t *testing.T) RuneLevelValidator {
	isValidTest := func(r rune) bool {
		return unicode.IsLetter(r) || unicode.IsDigit(r) || r == '-' || r == '_' || r == '.' || r == '/'
	}
	validator, err := NewBasicValidator(false, isValidTest)
	if err != nil {
		t.Error(err)
		return nil
	}

	return validator
}

func TestBasicValidation(t *testing.T) {
	testCases := []struct {
		testString string
		expectPass bool
	}{
		{"abc", true},
		{"one.two.three", true},
		{"1/2/3/4", true},
		{"abc-123/456_xyz", true},
		{"", false},
		{" ", false},
		{"abc$", false},
		{"abc!xyz", false},
	}

	validator := createBasicVaidator(t)

	for _, testCase := range testCases {
		if validator.IsValid(testCase.testString) != testCase.expectPass {
			t.Errorf("Expected IsValid test for '%s' to yeild '%t' not '%t'",
				testCase.testString, testCase.expectPass, !testCase.expectPass)
		}
	}
}

func TestRuneLevelValidation(t *testing.T) {
	testCases := []struct {
		testRune   rune
		expectPass bool
	}{
		{'a', true},
		{'Z', true},
		{'0', true},
		{'9', true},
		{'-', true},
		{'_', true},
		{'.', true},
		{'/', true},

		{'£', false},
		{'$', false},
		{'?', false},
	}

	validator := createBasicVaidator(t)

	for _, testCase := range testCases {
		if validator.IsRuneValid(testCase.testRune) != testCase.expectPass {
			t.Errorf("Expected rune '%c' to be [valid=%t] but it was [valid=%t]",
				testCase.testRune, testCase.expectPass, !testCase.expectPass)
		}
	}
}


text:
REG_FIDDLE(Paint_isFakeBoldText, 256, 256, true, 0) {
void draw(SkCanvas* canvas) {
    SkPaint paint;
    SkDebugf("paint.isFakeBoldText() %c= !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag)\n",
        paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) ? '=' : '!');
    paint.setFakeBoldText(true);
    SkDebugf("paint.isFakeBoldText() %c= !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag)\n",
        paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) ? '=' : '!');
}
}  // END FIDDLE
#endif  // Disabled until updated to use current API.

redpajama_set_name: RedPajamaGithub


text:
cd upload/$1/

if [ -f outfile ]
then
	rm -f outfile
fi
if [ -f outtree ]
then
	rm -f outtree
fi
/usr/local/bin/neighbor <<eof
y
y
eof

cp outtree intree

if [ -f plotfile ]
then
	rm -f plotfile
fi

/usr/local/bin/drawgram <<eof
$(pwd)/../../fontfile
y
eof

cp plotfile plotfile.ps
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
/usr/local/bin/convert plotfile.ps ../DrawT/$1.svg
/usr/local/bin/convert plotfile.ps $1.svg


text:
<title>Memory model - GNU Compiler Collection (GCC) Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Tree-SSA.html#Tree-SSA" title="Tree SSA">
<link rel="prev" href="Alias-analysis.html#Alias-analysis" title="Alias analysis">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Previous: Alias analysis,
Up: Tree SSA

12.5 Memory model

The memory model used by the middle-end models that of the C/C++
languages.  The middle-end has the notion of an effective type
of a memory region which is used for type-based alias analysis.

The following is a refinement of ISO C99 6.5/6, clarifying the block copy case
to follow common sense and extending the concept of a dynamic effective
type to objects with a declared type as required for C++.

     The effective type of an object for an access to its stored value is
     the declared type of the object or the effective type determined by
     a previous store to it.  If a value is stored into an object through
     an lvalue having a type that is not a character type, then the
     type of the lvalue becomes the effective type of the object for that
     access and for subsequent accesses that do not modify the stored value.
     If a value is copied into an object using memcpy or memmove,
     or is copied as an array of character type, then the effective type
     of the modified object for that access and for subsequent accesses that
     do not modify the value is undetermined.  For all other accesses to an
     object, the effective type of the object is simply the type of the
     lvalue used for the access.


text:
import re
import sys

from generator3.constants import STR_TYPES
from generator3.util_methods import sanitize_value
from six import PY2

if PY2:
    from generator3._vendor.pyparsing_py2 import *
else:
    # noinspection PyUnresolvedReferences
    from generator3._vendor.pyparsing_py3 import *

# grammar to parse parameter lists

# // snatched from parsePythonValue.py, from pyparsing samples, copyright 2006 by Paul McGuire but under BSD license.
# we don't suppress lots of punctuation because we want it back when we reconstruct the lists

lparen, rparen, lbrack, rbrack, lbrace, rbrace, colon = map(Literal, "()[]{}:")

integer = Combine(Optional(oneOf("+ -")) + Word(nums)).setName("integer")
real = Combine(Optional(oneOf("+ -")) + Word(nums) + "." +
               Optional(Word(nums)) +
               Optional(oneOf("e E") + Optional(oneOf("+ -")) + Word(nums))).setName("real")
tupleStr = Forward()
listStr = Forward()
dictStr = Forward()

boolLiteral = oneOf("True False")
noneLiteral = Literal("None")

listItem = real | integer | quotedString | unicodeString | boolLiteral | noneLiteral | \
           Group(listStr) | tupleStr | dictStr

tupleStr << (Suppress("(") + Optional(delimitedList(listItem)) +
             Optional(Literal(",")) + Suppress(")")).setResultsName("tuple")

listStr << (lbrack + Optional(delimitedList(listItem) +
                              Optional(Literal(","))) + rbrack).setResultsName("list")

dictEntry = Group(listItem + colon + listItem)
dictStr << (lbrace + Optional(delimitedList(dictEntry) + Optional(Literal(","))) + rbrace).setResultsName("dict")
# \\ end of the snatched part

# our output format is s-expressions:
# (simple name optional_value) is name or name=value
# (nested (simple ...) (simple ...)) is (name, name,...)
# (opt ...) is [, ...] or suchlike.

T_SIMPLE = 'Simple'
T_NESTED = 'Nested'
T_OPTIONAL = 'Opt'
T_RETURN = "Ret"

TRIPLE_DOT = '...'

COMMA = Suppress(",")
APOS = Suppress("'")
QUOTE = Suppress('"')
SP = Suppress(Optional(White()))

ident = Word(alphas + "_", alphanums + "_-.").setName("ident")  # we accept things like "foo-or-bar"
decorated_ident = ident + Optional(Suppress(SP + Literal(":") + SP + ident))  # accept "foo: bar", ignore "bar"
spaced_ident = Combine(
    decorated_ident + ZeroOrMore(Literal(' ') + decorated_ident))  # we accept 'list or tuple' or 'C struct'

# allow quoted names, because __setattr__, etc docs use it
paramname = spaced_ident | \
            APOS + spaced_ident + APOS | \
            QUOTE + spaced_ident + QUOTE

parenthesized_tuple = (Literal("(") + Optional(delimitedList(listItem, combine=True)) +
                       Optional(Literal(",")) + Literal(")")).setResultsName("(tuple)")

initializer = (SP + Suppress("=") + SP + Combine(parenthesized_tuple | listItem | ident)).setName(
    "=init")  # accept foo=defaultfoo

param = Group(Empty().setParseAction(replaceWith(T_SIMPLE)) + Combine(Optional(oneOf("* **")) + paramname) + Optional(
    initializer))

ellipsis = Group(
    Empty().setParseAction(replaceWith(T_SIMPLE)) + \
    (Literal("..") +
     ZeroOrMore(Literal('.'))).setParseAction(replaceWith(TRIPLE_DOT))  # we want to accept both 'foo,..' and 'foo, ...'
)

paramSlot = Forward()

simpleParamSeq = ZeroOrMore(paramSlot + COMMA) + Optional(paramSlot + Optional(COMMA))
nestedParamSeq = Group(
    Suppress('(').setParseAction(replaceWith(T_NESTED)) + \
    simpleParamSeq + Optional(ellipsis + Optional(COMMA) + Optional(simpleParamSeq)) + \
    Suppress(')')
)  # we accept "(a1, ... an)"

paramSlot << (param | nestedParamSeq)

optionalPart = Forward()

paramSeq = simpleParamSeq + Optional(optionalPart)  # this is our approximate target

optionalPart << (
        Group(
            Suppress('[').setParseAction(replaceWith(T_OPTIONAL)) + Optional(COMMA) +
            paramSeq + Optional(ellipsis) +
            Suppress(']')
        )
        | ellipsis
)

return_type = Group(
    Empty().setParseAction(replaceWith(T_RETURN)) +
    Suppress(SP + (Literal("->") | (Literal(":") + SP + Literal("return"))) + SP) +
    ident
)

# this is our ideal target, with balancing paren and a multiline rest of doc.
paramSeqAndRest = paramSeq + Suppress(')') + Optional(return_type) + Suppress(Optional(Regex(".*(?s)")))

def transform_seq(results, toplevel=True):
    """Transforms a tree of ParseResults into a param spec string."""
    is_clr = sys.platform == "cli"
    ret = [] # add here token to join
    for token in results:
        token_type = token[0]
        if token_type is T_SIMPLE:
            token_name = token[1]
            if len(token) == 3: # name with value
                if toplevel:
                    ret.append(sanitize_ident(token_name, is_clr) + "=" + sanitize_value(token[2]))
                else:
                    # smth like "a, (b1=1, b2=2)", make it "a, p_b"
                    return ["p_" + results[0][1]] # NOTE: for each item of tuple, return the same name of its 1st item.
            elif token_name == TRIPLE_DOT:
                if toplevel and not has_item_starting_with(ret, "*"):
                    ret.append("*more")
                else:
                    # we're in a "foo, (bar1, bar2, ...)"; make it "foo, bar_tuple"
                    return extract_alpha_prefix(results[0][1]) + "_tuple"
            else: # just name
                ret.append(sanitize_ident(token_name, is_clr))
        elif token_type is T_NESTED:
            inner = transform_seq(token[1:], False)
            if len(inner) != 1:
                ret.append(inner)
            else:
                ret.append(inner[0]) # [foo] -> foo
        elif token_type is T_OPTIONAL:
            ret.extend(transform_optional_seq(token))
        elif token_type is T_RETURN:
            pass # this is handled elsewhere
        else:
            raise Exception("This cannot be a token type: " + repr(token_type))
    return ret

def transform_optional_seq(results):
    """
    Produces a string that describes the optional part of parameters.
    @param results must start from T_OPTIONAL.
    """
    assert results[0] is T_OPTIONAL, "transform_optional_seq expects a T_OPTIONAL node, sees " + \
                                     repr(results[0])
    is_clr = sys.platform == "cli"
    ret = []
    for token in results[1:]:
        token_type = token[0]
        if token_type is T_SIMPLE:
            token_name = token[1]
            if len(token) == 3: # name with value; little sense, but can happen in a deeply nested optional
                ret.append(sanitize_ident(token_name, is_clr) + "=" + sanitize_value(token[2]))
            elif token_name == '...':
                # we're in a "foo, [bar, ...]"; make it "foo, *bar"
                return ["*" + extract_alpha_prefix(
                    results[1][1])] # we must return a seq; [1] is first simple, [1][1] is its name
            else: # just name
                ret.append(sanitize_ident(token_name, is_clr) + "=None")
        elif token_type is T_OPTIONAL:
            ret.extend(transform_optional_seq(token))
            # maybe handle T_NESTED if such cases ever occur in real life
            # it can't be nested in a sane case, really
    return ret

def has_item_starting_with(p_seq, p_start):
    for item in p_seq:
        if isinstance(item, STR_TYPES) and item.startswith(p_start):
            return True
    return False

def sanitize_ident(x, is_clr=False):
    """Takes an identifier and returns it sanitized"""
    if x in ("class", "object", "def", "list", "tuple", "int", "float", "str", "unicode" "None"):
        return "p_" + x
    else:
        if is_clr:
            # it tends to have names like "int x", turn it to just x
            xs = x.split(" ")
            if len(xs) == 2:
                return sanitize_ident(xs[1])
        return x.replace("-", "_").replace(" ", "_").replace(".", "_") # for things like "list-or-tuple" or "list or tuple"

def extract_alpha_prefix(p_string, default_prefix="some"):
    """Returns 'foo' for things like 'foo1' or 'foo2'; if prefix cannot be found, the default is returned"""
    match = NUM_IDENT_PATTERN.match(p_string)
    prefix = match and match.groups()[match.lastindex - 1] or None
    return prefix or default_prefix

NUM_IDENT_PATTERN = re.compile("([A-Za-z_]+)[0-9]?[A-Za-z_]*") # 'foo_123' -> $1 = 'foo_'


text:
/* global js_evrbf, e, jsEOUtils, jsEOOperator */

/**
 * @file operators
 * @brief Set of operators in Javascript for EvRBF
 * @date 15/oct/2015, 12:00
 * @author Victor M. Rivas Santos <vrivas@ujaen.es>
 *         Geneura Team (http://geneura.wordpress.com)
 */
/*
 * --------------------------------------------
 *
 * Copyright (C) 2015 Victor M. Rivas Santos <vrivas@ujaen.es>
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

try {

    if (typeof js_evrbf === "undefined")
        throw new ReferenceError("EvRBF won't work since jsEVRBF/EvRBF.js has not been loaded");
    if (typeof jsEOOperator === "undefined")
        throw new ReferenceError("EvRBF won't work since jsEO/core/jsEOperator.js has not been loaded");

    /*
     js_evrbf.jsXOver = new Class({// ### Aün sin hacer
     Extends: jsEOOperator,
     initialize: function (_applicationRate, _bitsRate) {
     this.parent(_applicationRate);
     this.bitsRate = _bitsRate;
     jsEOUtils.debugln("Initializing a js_evrf.XOver with " +
     "applicationRate " + this.applicationRate);

     },
     operate: function (_auxPop) {
     jsEOUtils.debugln("Applying js_evrf.XOver");
     var toRet = new jsEOPopulation();
     if (typeof _auxPop == 'undefined') {
     return toRet;
     }
     if (_auxPop.length() <= 0) {
     toRet.add(_auxPop.getAt(0).copy());
     return toRet;
     }

     var rnd2 = Math.floor(Math.random() * (_auxPop.length() - 1)) + 1;
     jsEOUtils.debugln("  rnd2 is " + rnd2 +
     " while length is " + _auxPop.length() +
     " and " + typeof _auxPop.pop[0]);

     var tmpChr1 = _auxPop.getAt(0).getChromosome();
     var tmpChr2 = _auxPop.getAt(rnd2).getChromosome();
     var point1 = Math.floor(Math.random() * (tmpChr1.length - 1));
     var point2 = point1 + Math.floor(Math.random() * (tmpChr1.length - point1));

     jsEOUtils.debugln("  Individuals are " + tmpChr1 + " and " + tmpChr2);
     jsEOUtils.debugln("  Points are " + point1 + " and " + point2);

     var newChr = new Array();
     for (var i = 0; i < point1; ++i) {
     newChr.push(tmpChr1[i]);
     }
     for (var i = point1; i <= point2; ++i) {
     newChr.push(tmpChr2[i]);
     }
     for (var i = point2 + 1; i < tmpChr1.length; ++i) {
     newChr.push(tmpChr1[i]);
     }

     jsEOUtils.debugln("  Inicio es " + tmpChr1 + " Final  " + newChr);
     toRet.add(new jsEOFVIndividual());
     toRet.getAt(0).setChromosome(newChr);
     return toRet;
     }
     });

     */
    /**
     * Centers Mutator... transitory until re-reading the original paper
     * @type Class
     */
    js_evrbf.CenterMut = new Class({
        Extends: jsEOOperator,
        initialize: function (_applicationRate, _centersRate, _min, _max, _trnSamples, _trainIterations, _trainAlfa) {
            this.parent(_applicationRate);
            this.centersRate = _centersRate || 0.5;
            this.min = _min || 0;
            this.max = _max || 1;
            this.trnSamples = _trnSamples || [];
            this.trainIterations = _trainIterations || 1;
            this.trainAlfa = _trainAlfa || 0;
            jsEOUtils.debugln("Initializing a js_evrf.CenterMut with "
                    + "applicationRate " + this.applicationRate
                    + " and centersRate " + this.centersRate);

        },
        operate: function (_auxPop) {
            jsEOUtils.debugln("Applying js_evrf.CenterMut");
            var tmpChr = _auxPop.getAt(0).getChromosome().copy();
            var self = this;

            // Changing the values of the centers for those neurons selected according to this.centersRate
            tmpChr.neurons
                    .filter(function () {
                        return Math.random() <= self.centersRate;
                    })
                    .forEach(function (e) {
                        e.center.forEach(function (e, i, v) {
                            v[i] = jsEOUtils.random(self.min, self.max);
                        });
                    });

            tmpChr.trainLMS(
                    this.trnSamples.map(function (e) {
                        return e.input;
                    }) // INputs
                    , this.trnSamples.map(function (e) {
                        return e.output;
                    })// Desired outputs
                    , this.trainIterations // Iterations
                    , this.trainAlfa);
            return (new jsEOPopulation())
                    .add(new js_evrbf.individual(tmpChr));
        }
    });

    /**
     * RADIUS Mutator... transitory until re-reading the original paper
     * @type Class
     */
    js_evrbf.RadiusMut = new Class({
        Extends: jsEOOperator,
        initialize: function (_applicationRate, _radiusRate, _min, _max, _trnSamples, _trainIterations, _trainAlfa) {
            this.parent(_applicationRate);
            this.min = _min || 0;
            this.max = _max || 1;
            this.radiusRate = _radiusRate || 0.5;
            this.trnSamples = _trnSamples || [];
            this.trainIterations = _trainIterations || 1;
            this.trainAlfa = _trainAlfa || 0;
            jsEOUtils.debugln("Initializing a js_evrf.RadiusMut with "
                    + "applicationRate " + this.applicationRate);

        },
        operate: function (_auxPop) {
            jsEOUtils.debugln("Applying js_evrf.RadiusMut");
            var tmpChr = _auxPop.getAt(0).getChromosome().copy();
            var self = this;

            // Changing the values of the centers for those neurons selected according to this.radiusRate
            tmpChr.neurons
                    .filter(function () {
                        return Math.random() <= self.radiusRate;
                    })
                    .forEach(function (e) {
                        e.radius = jsEOUtils.random(self.min, self.max);
                    });

            tmpChr.trainLMS(
                    this.trnSamples.map(function (e) {
                        return e.input;
                    }) // INputs
                    , this.trnSamples.map(function (e) {
                        return e.output;
                    })// Desired outputs
                    , this.trainIterations // Iterations
                    , this.trainAlfa);
            return (new jsEOPopulation())
                    .add(new js_evrbf.individual(tmpChr));
        }
    });

} catch (e) {
    console.log(e.message);
}


text:
NSString * const kGTLRGamesConfigurationImageTypeAchievementIcon = @"ACHIEVEMENT_ICON";
NSString * const kGTLRGamesConfigurationImageTypeImageTypeUnspecified = @"IMAGE_TYPE_UNSPECIFIED";
NSString * const kGTLRGamesConfigurationImageTypeLeaderboardIcon = @"LEADERBOARD_ICON";

// ----------------------------------------------------------------------------
// Query Classes
//

@implementation GTLRGamesConfigurationQuery

@dynamic fields;

@end

@implementation GTLRGamesConfigurationQuery_AchievementConfigurationsDelete

@dynamic achievementId;

+ (instancetype)queryWithAchievementId:(NSString *)achievementId {
  NSArray *pathParams = @[ @"achievementId" ];
  NSString *pathURITemplate = @"games/v1configuration/achievements/{achievementId}";
  GTLRGamesConfigurationQuery_AchievementConfigurationsDelete *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"DELETE"
                       pathParameterNames:pathParams];
  query.achievementId = achievementId;
  query.loggingName = @"gamesConfiguration.achievementConfigurations.delete";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_AchievementConfigurationsGet

@dynamic achievementId;

+ (instancetype)queryWithAchievementId:(NSString *)achievementId {
  NSArray *pathParams = @[ @"achievementId" ];
  NSString *pathURITemplate = @"games/v1configuration/achievements/{achievementId}";
  GTLRGamesConfigurationQuery_AchievementConfigurationsGet *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:nil
                       pathParameterNames:pathParams];
  query.achievementId = achievementId;
  query.expectedObjectClass = [GTLRGamesConfiguration_AchievementConfiguration class];
  query.loggingName = @"gamesConfiguration.achievementConfigurations.get";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_AchievementConfigurationsInsert

@dynamic applicationId;

+ (instancetype)queryWithObject:(GTLRGamesConfiguration_AchievementConfiguration *)object
                  applicationId:(NSString *)applicationId {
  if (object == nil) {
#if defined(DEBUG) && DEBUG
    NSAssert(object != nil, @"Got a nil object");
#endif
    return nil;
  }
  NSArray *pathParams = @[ @"applicationId" ];
  NSString *pathURITemplate = @"games/v1configuration/applications/{applicationId}/achievements";
  GTLRGamesConfigurationQuery_AchievementConfigurationsInsert *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"POST"
                       pathParameterNames:pathParams];
  query.bodyObject = object;
  query.applicationId = applicationId;
  query.expectedObjectClass = [GTLRGamesConfiguration_AchievementConfiguration class];
  query.loggingName = @"gamesConfiguration.achievementConfigurations.insert";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_AchievementConfigurationsList

@dynamic applicationId, maxResults, pageToken;

+ (instancetype)queryWithApplicationId:(NSString *)applicationId {
  NSArray *pathParams = @[ @"applicationId" ];
  NSString *pathURITemplate = @"games/v1configuration/applications/{applicationId}/achievements";
  GTLRGamesConfigurationQuery_AchievementConfigurationsList *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:nil
                       pathParameterNames:pathParams];
  query.applicationId = applicationId;
  query.expectedObjectClass = [GTLRGamesConfiguration_AchievementConfigurationListResponse class];
  query.loggingName = @"gamesConfiguration.achievementConfigurations.list";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_AchievementConfigurationsUpdate

@dynamic achievementId;

+ (instancetype)queryWithObject:(GTLRGamesConfiguration_AchievementConfiguration *)object
                  achievementId:(NSString *)achievementId {
  if (object == nil) {
#if defined(DEBUG) && DEBUG
    NSAssert(object != nil, @"Got a nil object");
#endif
    return nil;
  }
  NSArray *pathParams = @[ @"achievementId" ];
  NSString *pathURITemplate = @"games/v1configuration/achievements/{achievementId}";
  GTLRGamesConfigurationQuery_AchievementConfigurationsUpdate *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"PUT"
                       pathParameterNames:pathParams];
  query.bodyObject = object;
  query.achievementId = achievementId;
  query.expectedObjectClass = [GTLRGamesConfiguration_AchievementConfiguration class];
  query.loggingName = @"gamesConfiguration.achievementConfigurations.update";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_ImageConfigurationsUpload

@dynamic imageType, resourceId;

+ (instancetype)queryWithResourceId:(NSString *)resourceId
                          imageType:(NSString *)imageType
                   uploadParameters:(GTLRUploadParameters *)uploadParameters {
  NSArray *pathParams = @[
    @"imageType", @"resourceId"
  ];
  NSString *pathURITemplate = @"games/v1configuration/images/{resourceId}/imageType/{imageType}";
  GTLRGamesConfigurationQuery_ImageConfigurationsUpload *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"POST"
                       pathParameterNames:pathParams];
  query.resourceId = resourceId;
  query.imageType = imageType;
  query.uploadParameters = uploadParameters;
  query.expectedObjectClass = [GTLRGamesConfiguration_ImageConfiguration class];
  query.loggingName = @"gamesConfiguration.imageConfigurations.upload";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_LeaderboardConfigurationsDelete

@dynamic leaderboardId;

+ (instancetype)queryWithLeaderboardId:(NSString *)leaderboardId {
  NSArray *pathParams = @[ @"leaderboardId" ];
  NSString *pathURITemplate = @"games/v1configuration/leaderboards/{leaderboardId}";
  GTLRGamesConfigurationQuery_LeaderboardConfigurationsDelete *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"DELETE"
                       pathParameterNames:pathParams];
  query.leaderboardId = leaderboardId;
  query.loggingName = @"gamesConfiguration.leaderboardConfigurations.delete";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_LeaderboardConfigurationsGet

@dynamic leaderboardId;

+ (instancetype)queryWithLeaderboardId:(NSString *)leaderboardId {
  NSArray *pathParams = @[ @"leaderboardId" ];
  NSString *pathURITemplate = @"games/v1configuration/leaderboards/{leaderboardId}";
  GTLRGamesConfigurationQuery_LeaderboardConfigurationsGet *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:nil
                       pathParameterNames:pathParams];
  query.leaderboardId = leaderboardId;
  query.expectedObjectClass = [GTLRGamesConfiguration_LeaderboardConfiguration class];
  query.loggingName = @"gamesConfiguration.leaderboardConfigurations.get";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_LeaderboardConfigurationsInsert

@dynamic applicationId;

+ (instancetype)queryWithObject:(GTLRGamesConfiguration_LeaderboardConfiguration *)object
                  applicationId:(NSString *)applicationId {
  if (object == nil) {
#if defined(DEBUG) && DEBUG
    NSAssert(object != nil, @"Got a nil object");
#endif
    return nil;
  }
  NSArray *pathParams = @[ @"applicationId" ];
  NSString *pathURITemplate = @"games/v1configuration/applications/{applicationId}/leaderboards";
  GTLRGamesConfigurationQuery_LeaderboardConfigurationsInsert *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"POST"
                       pathParameterNames:pathParams];
  query.bodyObject = object;
  query.applicationId = applicationId;
  query.expectedObjectClass = [GTLRGamesConfiguration_LeaderboardConfiguration class];
  query.loggingName = @"gamesConfiguration.leaderboardConfigurations.insert";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_LeaderboardConfigurationsList

@dynamic applicationId, maxResults, pageToken;

+ (instancetype)queryWithApplicationId:(NSString *)applicationId {
  NSArray *pathParams = @[ @"applicationId" ];
  NSString *pathURITemplate = @"games/v1configuration/applications/{applicationId}/leaderboards";
  GTLRGamesConfigurationQuery_LeaderboardConfigurationsList *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:nil
                       pathParameterNames:pathParams];
  query.applicationId = applicationId;
  query.expectedObjectClass = [GTLRGamesConfiguration_LeaderboardConfigurationListResponse class];
  query.loggingName = @"gamesConfiguration.leaderboardConfigurations.list";
  return query;
}

@end

@implementation GTLRGamesConfigurationQuery_LeaderboardConfigurationsUpdate

@dynamic leaderboardId;

+ (instancetype)queryWithObject:(GTLRGamesConfiguration_LeaderboardConfiguration *)object
                  leaderboardId:(NSString *)leaderboardId {
  if (object == nil) {
#if defined(DEBUG) && DEBUG
    NSAssert(object != nil, @"Got a nil object");
#endif
    return nil;
  }
  NSArray *pathParams = @[ @"leaderboardId" ];
  NSString *pathURITemplate = @"games/v1configuration/leaderboards/{leaderboardId}";
  GTLRGamesConfigurationQuery_LeaderboardConfigurationsUpdate *query =
    [[self alloc] initWithPathURITemplate:pathURITemplate
                               HTTPMethod:@"PUT"
                       pathParameterNames:pathParams];
  query.bodyObject = object;
  query.leaderboardId = leaderboardId;
  query.expectedObjectClass = [GTLRGamesConfiguration_LeaderboardConfiguration class];
  query.loggingName = @"gamesConfiguration.leaderboardConfigurations.update";
  return query;
}

@end


text:
namespace Google.Cloud.Kms.V1.Snippets
{
    // [START cloudkms_v1_generated_KeyManagementService_CreateKeyRing_async_flattened]
    using Google.Cloud.Kms.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedKeyManagementServiceClientSnippets
    {
        /// <summary>Snippet for CreateKeyRingAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateKeyRingAsync()
        {
            // Create client
            KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
            // Initialize request argument(s)
            string parent = "projects/[PROJECT]/locations/[LOCATION]";
            string keyRingId = "";
            KeyRing keyRing = new KeyRing();
            // Make the request
            KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(parent, keyRingId, keyRing);
        }
    }
    // [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_async_flattened]
}


text:
package uk.co.real_logic.aeron.driver;

import java.net.InetSocketAddress;

import static uk.co.real_logic.aeron.common.concurrent.logbuffer.LogBufferDescriptor.computePosition;

public class UnicastSenderFlowControl implements SenderFlowControl
{
    private long positionLimit = 0;
    private int positionBitsToShift;
    private int initialTermId;

    public long onStatusMessage(
        final int termId, final int completedTermOffset, final int receiverWindowLength, final InetSocketAddress address)
    {
        final long position = computePosition(termId, completedTermOffset, positionBitsToShift, initialTermId);
        final long newPositionLimit = position + receiverWindowLength;
        positionLimit = Math.max(positionLimit, newPositionLimit);

        return positionLimit;
    }

    public long initialPositionLimit(final int initialTermId, final int termBufferCapacity)
    {
        this.initialTermId = initialTermId;
        positionBitsToShift = Long.numberOfTrailingZeros(termBufferCapacity);
        positionLimit = computePosition(initialTermId, 0, positionBitsToShift, initialTermId);

        return positionLimit;
    }
}


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2022, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* 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.                                             */
/* -------------------------------------------------------------------------- */

define(function(require) {
  /*
    DEPENDENCIES
   */

//  require('foundation.tab');
  var Config = require('sunstone-config');
  var Locale = require('utils/locale');
  var Tips = require('utils/tips');
  var WizardFields = require('utils/wizard-fields');
  var UniqueId = require('utils/unique-id');
  var CustomTagsTable = require('utils/custom-tags-table');
  var OpenNebula = require('opennebula');

  /*
    TEMPLATES
   */

  var TemplateHTML = require('hbs!./hybrid/html');
  var EC2HTML = require('hbs!./hybrid/ec2');
  var AzureHTML = require('hbs!./hybrid/azure');
  var OpenNebulaHTML = require('hbs!./hybrid/opennebula');

  /*
    CONSTANTS
   */

  var WIZARD_TAB_ID = require('./hybrid/wizardTabId');

  /*
    CONSTRUCTOR
   */

  function WizardTab(opts) {
    if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'hybrid')) {
      throw "Wizard Tab not enabled";
    }

    this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
    this.icon = 'fa-cloud';
    this.title = Locale.tr("Hybrid");
    this.classes = "not_firecracker";

    this.oneEnabled = false;

    var mads = Config.onedConf.VM_MAD;
    if (! (mads instanceof Array)){
      mads = [mads];
    }

    var i = 0;
    while (!this.oneEnabled && i < mads.length){
      this.oneEnabled = mads[i].NAME == "opennebula";
      i++;
    }
  }

  WizardTab.prototype.constructor = WizardTab;
  WizardTab.prototype.html = _html;
  WizardTab.prototype.setup = _setup;
  WizardTab.prototype.onShow = _onShow;
  WizardTab.prototype.retrieve = _retrieve;
  WizardTab.prototype.fill = _fill;
  WizardTab.prototype.addProviderTab = _addProviderTab;
  WizardTab.prototype.fillProviderTab = _fillProviderTab;

  return WizardTab;

  /*
    FUNCTION DEFINITIONS
   */

  function _html() {
    return TemplateHTML();
  }

  function _onShow(context, panelForm) {
  }

  function _setup(context) {
    var that = this;
    Foundation.reflow(context, 'tabs');
    that.numberOfProviders = 0;

    context.on("click", "#tf_btn_hybrid", function() {
      that.addProviderTab(that.numberOfProviders, context);
      that.numberOfProviders++;
      return false;
    });

    $("#tf_btn_hybrid", context).trigger("click");

    this.hosts_ec2 = [];
    var that = this;

    OpenNebula.Host.list({
      timeout: true,
      success: function(request, results){
        $.each(results, function(key, value){
          if(value.HOST.TEMPLATE.HYPERVISOR == "ec2"){
            that.hosts_ec2.push({"ID":value.HOST.ID, "NAME": value.HOST.NAME});
          }
        });
        return true;
      }
    });
  }

  function _retrieve(context) {
    var templateJSON = {};
    var publicCloudJSON = [];

    $('.provider', context).each(function() {
      var hypervisor = $("input.hybridRadio:checked", this).val();

      var hash;

      if (hypervisor == "custom"){
        hash = CustomTagsTable.retrieve(this);
      } else {
        hash  = WizardFields.retrieve(this);

        if (!$.isEmptyObject(hash)) {
          hash["TYPE"] = hypervisor;
        }
      }

      if (!$.isEmptyObject(hash)) {
        publicCloudJSON.push(hash);
      }
    });

    if (!$.isEmptyObject(publicCloudJSON)) { templateJSON['PUBLIC_CLOUD'] = publicCloudJSON; };

    return templateJSON;
  }

  function _fill(context, templateJSON) {
    var that = this;
    var clickButton = false;
    if (templateJSON.PUBLIC_CLOUD) {
      var providers = templateJSON.PUBLIC_CLOUD

      if (providers instanceof Array) {
        $.each(providers, function(index, provider) {
          clickButton = index > 0;
          that.fillProviderTab(context, provider, provider.TYPE, clickButton);
        });
      } else if (providers instanceof Object) {
        that.fillProviderTab(context, providers, providers.TYPE, clickButton);
        clickButton = true;
      }

      delete templateJSON.PUBLIC_CLOUD
    }
  }

  function _addProviderTab(provider_id, context) {
    var htmlId  = 'provider' + provider_id + UniqueId.id();
    var that = this;
    var oneInput = "";

    if (this.oneEnabled){
      oneInput = '<input type="radio" class="hybridRadio" name="hybrid' + htmlId + '" value="opennebula" id="opennebulaRadio' + htmlId + '">' + Locale.tr("Remote OpenNebula") + '';
    }

    // Append the new div containing the tab and add the tab to the list
    var html_tab_content = '
' +
      '
' +
        '
' +
          '<input type="radio" class="hybridRadio" name="hybrid' + htmlId + '" value="ec2" id="amazonRadio' + htmlId + '">Amazon EC2' +
          '<input type="radio" class="hybridRadio" name="hybrid' + htmlId + '" value="azure" id="azureRadio' + htmlId + '">Microsoft Azure' +
          oneInput +
          '<input type="radio" class="hybridRadio" name="hybrid' + htmlId + '" value="custom" id="customRadio' + htmlId + '">' + Locale.tr("Custom") + '' +
        '
' +
      '
' +
      '
' +
      '
' +
    '
'
    $(html_tab_content).appendTo($("#template_create_hybrid_tabs_content", context));

    var a = $("
\
        " + Locale.tr("PROVIDER") + "\

").appendTo($("ul#template_create_hybrid_tabs", context));

    $("ul#template_create_hybrid_tabs li", context).each(function(index) {
        $("a", this).html(Locale.tr("Provider") + ' ' + index + " ");
      })

    Foundation.reInit($("ul#template_create_hybrid_tabs", context));

    $("a", a).trigger("click");

    // close icon: removing the tab on click
    a.on("click", "i.remove-tab", function() {
      var target = $(this).parent().attr("href");
      var li = $(this).closest('li');
      var ul = $(this).closest('ul');
      var content = $(target);

      li.remove();
      content.remove();

      if (li.hasClass('is-active')) {
        $('a', ul.children('li').last()).click();
      }

      $("ul#template_create_hybrid_tabs li", context).each(function(index) {
          $("a", this).html(Locale.tr("Provider") + ' ' + index + " ");
        })
    });

    var providerSection = $('#' + htmlId + 'Tab', context);

    providerSection.on("change", "input.hybridRadio", function() {
      $(".hybrid_inputs", providerSection).html("");

      if (this.value == "ec2"){
        $(".hybrid_inputs", providerSection).append(EC2HTML());
        $.each(that.hosts_ec2, function(key, value){
          $("#HOST", providerSection).append("<option value="+value.ID+">"+value.NAME+"</option>");
        });
        $("#HOST", providerSection)
      } else if (this.value == "azure"){
        $(".hybrid_inputs", providerSection).append(AzureHTML());
      } else if (this.value == "opennebula"){
        $(".hybrid_inputs", providerSection).append(OpenNebulaHTML());
      } else { // "custom"
        $(".hybrid_inputs", providerSection).append(CustomTagsTable.html());
        CustomTagsTable.setup(providerSection);
      }

      Tips.setup(providerSection);
    })
  }

  function _fillProviderTab(context, provider, providerType, clickButton) {
    var that = this;
    if (providerType == "vcenter") {
      return false;
    }

    if (clickButton) {
      $("#tf_btn_hybrid", context).trigger("click");
    }

    var providerContext = $(".provider", context).last();
    var input = $("input.hybridRadio[value='" + providerType + "']", providerContext);

    if (input.length != 0){
      input.trigger("click");
      WizardFields.fill(providerContext, provider);
    } else {
      input = $("input.hybridRadio[value='custom']", providerContext);
      input.trigger("click");
      CustomTagsTable.fill(providerContext, provider);
    }
  }
});


text:
/* Add to Homescreen v3.0.7 ~ (c) 2014 Matteo Spinelli ~ @license: http://cubiq.org/license */
(function(window, document) {
    'use strict';
    /*
       _   _ _____     _____
 ___ _| |_| |_   _|___|  |  |___ _____ ___ ___ ___ ___ ___ ___ ___
| .'| . | . | | | | . |     | . |     | -_|_ -|  _|  _| -_| -_|   |
|__,|___|___| |_| |___|__|__|___|_|_|_|___|___|___|_| |___|___|_|_|
                              by Matteo Spinelli ~ http://cubiq.org
*/

    // Check if document is loaded, needed by autostart
    var _DOMReady = false;
    if (document.readyState === 'complete') {
        _DOMReady = true;
    } else {
        window.addEventListener('load', loaded, false);
    }

    function loaded() {
        window.removeEventListener('load', loaded, false);
        _DOMReady = true;
    }

    // regex used to detect if app has been added to the homescreen
    var _reSmartURL = /\/ath(\/)?$/;
    var _reQueryString = /([\?&]ath=[^&]*$|&ath=[^&]*(&))/;

    // singleton
    var _instance;

    function ath(options) {
        _instance = _instance || new ath.Class(options);

        return _instance;
    }

    // message in all supported languages
    ath.intl = {
        de_de: {
            message: 'Um diese Web-App zum Home-Bildschirm hinzuzufügen, tippen Sie auf %icon und dann %action.',
            action: {
                ios: 'Zum Home-Bildschirm',
                android: 'Zum Startbildschirm hinzufügen',
                windows: 'Auf Startseite'
            }
        },

        en_us: {
            message: 'Need to add this web app to the home screen: tap %icon and then %action.',
            action: {
                ios: 'Add to Home Screen',
                android: 'Add to homescreen',
                windows: 'pin to start'
            }
        },

        es_es: {
            message: 'Para añadir esta aplicación web a la pantalla de inicio: pulsa %icon y selecciona %action.',
            action: {
                ios: 'Añadir a pantalla de inicio',
                android: 'Añadir a pantalla de inicio',
                windows: 'Añadir a inicio'
            }
        },

        fr_fr: {
            message: 'Pour une expérience optimale, il faut ajouter cette application sur votre écran d\'accueil : Appuyez sur %icon et sélectionnez %action.',
            action: {
                ios: 'Ajouter sur l\'écran d\'accueil',
                android: 'Ajouter à l\'écran d\'accueil',
                windows: 'Épingler à l\'écran d\'accueil'
            }
        },

        it_it: {
            message: 'Per Aggiungere questa web app alla schermata iniziale: premi %icon e poi %action.',
            action: {
                ios: 'Aggiungi a Home',
                android: 'Aggiungi alla homescreen',
                windows: 'aggiungi a start'
            }
        },

        nb_no: {
            message: 'For å installere denne appen på hjem-skjermen: trykk på %icon og deretter %action.',
            action: {
                ios: 'Legg til på Hjem-skjerm',
                android: 'Legg til på startsiden',
                windows: 'fest til start'
            }
        },

        nl_nl: {
            message: 'Om deze webapp op je telefoon te installeren, klik op %icon en dan %action.',
            action: {
                ios: 'Voeg toe aan beginscherm',
                android: 'Toevoegen aan startscherm',
                windows: 'Aan startscherm vastmaken'
            }
        },

        sv_se: {
            message: 'För att lägga till denna webbapplikation på hemskärmen: tryck på %icon och därefter %action.',
            action: {
                ios: 'Lägg till på hemskärmen',
                android: 'Lägg til på startskärmen',
                windows: 'fäst på startskärmen'
            }
        },

        zh_cn: {
            message: '如要把应用程式加至主屏幕,请点击%icon, 然后%action',
            action: {
                ios: '加至主屏幕',
                android: '加至主屏幕',
                windows: '按住启动'
            }
        },

        zh_tw: {
            message: '如要把應用程式加至主屏幕, 請點擊%icon, 然後%action.',
            action: {
                ios: '加至主屏幕',
                android: '加至主屏幕',
                windows: '按住啟動'
            }
        }
    };

    // Add 2 characters language support (Android mostly)
    for (var lang in ath.intl) {
        ath.intl[lang.substr(0, 2)] = ath.intl[lang];
    }

    // default options
    ath.defaults = {
        appID: 'com.kiteassit', // local storage name (no need to change)
        fontSize: 15, // base font size, used to properly resize the popup based on viewport scale factor
        debug: false, // override browser checks
        modal: false, // prevent further actions until the message is closed
        mandatory: true, // you can't proceed if you don't add the app to the homescreen
        autostart: true, // show the message automatically
        skipFirstVisit: false, // show only to returning visitors (ie: skip the first time you visit)
        startDelay: 1, // display the message after that many seconds from page load
        lifespan: 30, // life of the message in seconds
        displayPace: 0, // minutes before the message is shown again (0: display every time, default 24 hours)
        maxDisplayCount: 0, // absolute maximum number of times the message will be shown to the user (0: no limit)
        icon: true, // add touch icon to the message
        message: '', // the message can be customized
        validLocation: [], // list of pages where the message will be shown (array of regexes)
        onInit: null, // executed on instance creation
        onShow: null, // executed when the message is shown
        onRemove: null, // executed when the message is removed
        onAdd: null, // when the application is launched the first time from the homescreen (guesstimate)
        onPrivate: null, // executed if user is in private mode
        detectHomescreen: false // try to detect if the site has been added to the homescreen (false | true | 'hash' | 'queryString' | 'smartURL')
    };

    // browser info and capability
    var _ua = window.navigator.userAgent;
    var _nav = window.navigator;
    _extend(ath, {
        hasToken: document.location.hash == '#ath' || _reSmartURL.test(document.location.href) || _reQueryString.test(document.location.search),
        isRetina: window.devicePixelRatio && window.devicePixelRatio > 1,
        isIDevice: (/iphone|ipod|ipad/i).test(_ua),
        isMobileChrome: _ua.indexOf('Android') > -1 && (/Chrome\/[.0-9]*/).test(_ua),
        isMobileIE: _ua.indexOf('Windows Phone') > -1,
        language: _nav.language && _nav.language.toLowerCase().replace('-', '_') || ''
    });

    // falls back to en_us if language is unsupported
    ath.language = ath.language && ath.language in ath.intl ? ath.language : 'en_us';

    ath.isMobileSafari = ath.isIDevice && _ua.indexOf('Safari') > -1 && _ua.indexOf('CriOS') < 0;
    ath.OS = ath.isIDevice ? 'ios' : ath.isMobileChrome ? 'android' : ath.isMobileIE ? 'windows' : 'unsupported';

    ath.OSVersion = _ua.match(/(OS|Android) (\d+[_\.]\d+)/);
    ath.OSVersion = ath.OSVersion && ath.OSVersion[2] ? +ath.OSVersion[2].replace('_', '.') : 0;

    ath.isStandalone = window.navigator.standalone || (ath.isMobileChrome && (screen.height - document.documentElement.clientHeight < 40)); // TODO: check the lame polyfill
    ath.isTablet = (ath.isMobileSafari && _ua.indexOf('iPad') > -1) || (ath.isMobileChrome && _ua.indexOf('Mobile') < 0);

    ath.isCompatible = (ath.isMobileSafari && ath.OSVersion >= 6) || ath.isMobileChrome; // TODO: add winphone

    var _defaultSession = {
        lastDisplayTime: 0, // last time we displayed the message
        returningVisitor: false, // is this the first time you visit
        displayCount: 0, // number of times the message has been shown
        optedout: false, // has the user opted out
        added: false // has been actually added to the homescreen
    };

    ath.removeSession = function(appID) {
        try {
            localStorage.removeItem(appID || ath.defaults.appID);
        } catch (e) {
            // we are most likely in private mode
        }
    };

    ath.Class = function(options) {
        // merge default options with user config
        this.options = _extend({}, ath.defaults);
        _extend(this.options, options);

        // normalize some options
        this.options.mandatory = this.options.mandatory && ('standalone' in window.navigator || this.options.debug);
        this.options.modal = this.options.modal || this.options.mandatory;
        if (this.options.mandatory) {
            this.options.startDelay = -0.5; // make the popup hasty
        }
        this.options.detectHomescreen = this.options.detectHomescreen === true ? 'hash' : this.options.detectHomescreen;

        // setup the debug environment
        if (this.options.debug) {
            ath.isCompatible = true;
            ath.OS = typeof this.options.debug == 'string' ? this.options.debug : ath.OS == 'unsupported' ? 'android' : ath.OS;
            ath.OSVersion = ath.OS == 'ios' ? '7' : '4';
        }

        // the element the message will be appended to
        this.container = document.documentElement;

        // load session
        this.session = JSON.parse(localStorage.getItem(this.options.appID));

        // user most likely came from a direct link containing our token, we don't need it and we remove it
        if (ath.hasToken && (!ath.isCompatible || !this.session)) {
            ath.hasToken = false;
            _removeToken();
        }

        // the device is not supported
        if (!ath.isCompatible) {
            return;
        }

        this.session = this.session || _defaultSession;

        // check if we can use the local storage
        try {
            localStorage.setItem(this.options.appID, JSON.stringify(this.session));
            ath.hasLocalStorage = true;
        } catch (e) {
            // we are most likely in private mode
            ath.hasLocalStorage = false;

            if (this.options.onPrivate) {
                this.options.onPrivate.call(this);
            }
        }

        // check if this is a valid location
        var isValidLocation = !this.options.validLocation.length;
        for (var i = this.options.validLocation.length; i--;) {
            if (this.options.validLocation[i].test(document.location.href)) {
                isValidLocation = true;
                break;
            }
        }

        // check compatibility with old versions of add to homescreen. Opt-out if an old session is found
        if (localStorage.getItem('addToHome')) {
            this.optOut();
        }

        // critical errors:
        // user opted out, already added to the homescreen, not a valid location
        if (this.session.optedout || this.session.added || !isValidLocation) {
            return;
        }

        // check if the app is in stand alone mode
        if (ath.isStandalone) {
            // execute the onAdd event if we haven't already
            if (!this.session.added) {
                this.session.added = true;
                this.updateSession();

                if (this.options.onAdd && ath.hasLocalStorage) { // double check on localstorage to avoid multiple calls to the custom event
                    this.options.onAdd.call(this);
                }
            }

            return;
        }

        // (try to) check if the page has been added to the homescreen
        if (this.options.detectHomescreen) {
            // the URL has the token, we are likely coming from the homescreen
            if (ath.hasToken) {
                _removeToken(); // we don't actually need the token anymore, we remove it to prevent redistribution

                // this is called the first time the user opens the app from the homescreen
                if (!this.session.added) {
                    this.session.added = true;
                    this.updateSession();

                    if (this.options.onAdd && ath.hasLocalStorage) { // double check on localstorage to avoid multiple calls to the custom event
                        this.options.onAdd.call(this);
                    }
                }

                return;
            }

            // URL doesn't have the token, so add it
            if (this.options.detectHomescreen == 'hash') {
                history.replaceState('', window.document.title, document.location.href + '#ath');
            } else if (this.options.detectHomescreen == 'smartURL') {
                history.replaceState('', window.document.title, document.location.href.replace(/(\/)?$/, '/ath$1'));
            } else {
                history.replaceState('', window.document.title, document.location.href + (document.location.search ? '&' : '?') + 'ath=');
            }
        }

        // check if this is a returning visitor
        if (!this.session.returningVisitor) {
            this.session.returningVisitor = true;
            this.updateSession();

            // we do not show the message if this is your first visit
            if (this.options.skipFirstVisit) {
                return;
            }
        }

        // we do no show the message in private mode
        if (!ath.hasLocalStorage) {
            return;
        }

        // all checks passed, ready to display
        this.ready = true;

        if (this.options.onInit) {
            this.options.onInit.call(this);
        }

        if (this.options.autostart) {
            this.show();
        }
    };

    ath.Class.prototype = {
        // event type to method conversion
        events: {
            load: '_delayedShow',
            error: '_delayedShow',
            orientationchange: 'resize',
            resize: 'resize',
            scroll: 'resize',
            click: 'remove',
            touchmove: '_preventDefault',
            transitionend: '_removeElements',
            webkitTransitionEnd: '_removeElements',
            MSTransitionEnd: '_removeElements'
        },

        handleEvent: function(e) {
            var type = this.events[e.type];
            if (type) {
                this[type](e);
            }
        },

        show: function(force) {
            // in autostart mode wait for the document to be ready
            if (this.options.autostart && !_DOMReady) {
                setTimeout(this.show.bind(this), 50);
                return;
            }

            // message already on screen
            if (this.shown) {
                return;
            }

            var now = Date.now();
            var lastDisplayTime = this.session.lastDisplayTime;

            if (force !== true) {
                // this is needed if autostart is disabled and you programmatically call the show() method
                if (!this.ready) {
                    return;
                }

                // we obey the display pace (prevent the message to popup too often)
                if (now - lastDisplayTime < this.options.displayPace * 60000) {
                    return;
                }

                // obey the maximum number of display count
                if (this.options.maxDisplayCount && this.session.displayCount >= this.options.maxDisplayCount) {
                    return;
                }
            }

            this.shown = true;

            // increment the display count
            this.session.lastDisplayTime = now;
            this.session.displayCount++;
            this.updateSession();

            // try to get the highest resolution application icon
            if (!this.applicationIcon) {
                if (ath.OS == 'ios') {
                    this.applicationIcon = document.querySelector('head link[rel^=apple-touch-icon][sizes="152x152"],head link[rel^=apple-touch-icon][sizes="144x144"],head link[rel^=apple-touch-icon][sizes="120x120"],head link[rel^=apple-touch-icon][sizes="114x114"],head link[rel^=apple-touch-icon]');
                } else {
                    this.applicationIcon = document.querySelector('head link[rel^="shortcut icon"][sizes="196x196"],head link[rel^=apple-touch-icon]');
                }
            }

            var message = '';

            if (this.options.message in ath.intl) { // you can force the locale
                message = ath.intl[this.options.message].message.replace('%action', ath.intl[this.options.message].action[ath.OS]);
            } else if (this.options.message !== '') { // or use a custom message
                message = this.options.message;
            } else { // otherwise we use our message
                message = ath.intl[ath.language].message.replace('%action', ath.intl[ath.language].action[ath.OS]);
            }

            // add the action icon
            message = '
' + message.replace('%icon', 'icon') + '
';

            // create the message container
            this.viewport = document.createElement('div');
            this.viewport.className = 'ath-viewport';
            if (this.options.modal) {
                this.viewport.className += ' ath-modal';
            }
            if (this.options.mandatory) {
                this.viewport.className += ' ath-mandatory';
            }
            this.viewport.style.position = 'absolute';

            // create the actual message element
            this.element = document.createElement('div');
            this.element.className = 'ath-container ath-' + ath.OS + ' ath-' + ath.OS + (ath.OSVersion + '').substr(0, 1) + ' ath-' + (ath.isTablet ? 'tablet' : 'phone');
            this.element.style.cssText = '-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);transition-property:transform,opacity;transition-duration:0;transform:translate3d(0,0,0);-webkit-transition-timing-function:ease-out';
            this.element.style.webkitTransform = 'translate3d(0,-' + window.innerHeight + 'px,0)';
            this.element.style.webkitTransitionDuration = '0s';

            // add the application icon
            if (this.options.icon && this.applicationIcon) {
                this.element.className += ' ath-icon';
                this.img = document.createElement('img');
                this.img.className = 'ath-application-icon';
                this.img.addEventListener('load', this, false);
                this.img.addEventListener('error', this, false);

                this.img.src = this.applicationIcon.href;
                this.element.appendChild(this.img);
            }

            this.element.innerHTML += message;

            // we are not ready to show, place the message out of sight
            this.viewport.style.left = '-99999em';

            // attach all elements to the DOM
            this.viewport.appendChild(this.element);
            this.container.appendChild(this.viewport);

            // if we don't have to wait for an image to load, show the message right away
            if (!this.img) {
                this._delayedShow();
            }
        },

        _delayedShow: function(e) {
            setTimeout(this._show.bind(this), this.options.startDelay * 1000 + 500);
        },

        _show: function() {
            var that = this;

            // update the viewport size and orientation
            this.updateViewport();

            // reposition/resize the message on orientation change
            window.addEventListener('resize', this, false);
            window.addEventListener('scroll', this, false);
            window.addEventListener('orientationchange', this, false);

            if (this.options.modal) {
                // lock any other interaction
                document.addEventListener('touchmove', this, true);
            }

            // Enable closing after 1 second
            if (!this.options.mandatory) {
                setTimeout(function() {
                    that.element.addEventListener('click', that, true);
                }, 1000);
            }

            // kick the animation
            setTimeout(function() {
                that.element.style.webkitTransform = 'translate3d(0,0,0)';
                that.element.style.webkitTransitionDuration = '1.2s';
            }, 0);

            // set the destroy timer
            if (this.options.lifespan) {
                this.removeTimer = setTimeout(this.remove.bind(this), this.options.lifespan * 1000);
            }

            // fire the custom onShow event
            if (this.options.onShow) {
                this.options.onShow.call(this);
            }
        },

        remove: function() {
            clearTimeout(this.removeTimer);

            // clear up the event listeners
            if (this.img) {
                this.img.removeEventListener('load', this, false);
                this.img.removeEventListener('error', this, false);
            }

            window.removeEventListener('resize', this, false);
            window.removeEventListener('scroll', this, false);
            window.removeEventListener('orientationchange', this, false);
            document.removeEventListener('touchmove', this, true);
            this.element.removeEventListener('click', this, true);

            // remove the message element on transition end
            this.element.addEventListener('transitionend', this, false);
            this.element.addEventListener('webkitTransitionEnd', this, false);
            this.element.addEventListener('MSTransitionEnd', this, false);

            // start the fade out animation
            this.element.style.webkitTransitionDuration = '0.3s';
            this.element.style.opacity = '0';
        },

        _removeElements: function() {
            this.element.removeEventListener('transitionend', this, false);
            this.element.removeEventListener('webkitTransitionEnd', this, false);
            this.element.removeEventListener('MSTransitionEnd', this, false);

            // remove the message from the DOM
            this.container.removeChild(this.viewport);

            this.shown = false;

            // fire the custom onRemove event
            if (this.options.onRemove) {
                this.options.onRemove.call(this);
            }
        },

        updateViewport: function() {
            if (!this.shown) {
                return;
            }

            this.viewport.style.width = window.innerWidth + 'px';
            this.viewport.style.height = window.innerHeight + 'px';
            this.viewport.style.left = window.scrollX + 'px';
            this.viewport.style.top = window.scrollY + 'px';

            var clientWidth = document.documentElement.clientWidth;

            this.orientation = clientWidth > document.documentElement.clientHeight ? 'landscape' : 'portrait';

            var screenWidth = ath.OS == 'ios' ? this.orientation == 'portrait' ? screen.width : screen.height : screen.width;
            this.scale = screen.width > clientWidth ? 1 : screenWidth / window.innerWidth;

            this.element.style.fontSize = this.options.fontSize / this.scale + 'px';
        },

        resize: function() {
            clearTimeout(this.resizeTimer);
            this.resizeTimer = setTimeout(this.updateViewport.bind(this), 100);
        },

        updateSession: function() {
            if (ath.hasLocalStorage === false) {
                return;
            }

            localStorage.setItem(this.options.appID, JSON.stringify(this.session));
        },

        clearSession: function() {
            this.session = _defaultSession;
            this.updateSession();
        },

        optOut: function() {
            this.session.optedout = true;
            this.updateSession();
        },

        optIn: function() {
            this.session.optedout = false;
            this.updateSession();
        },

        clearDisplayCount: function() {
            this.session.displayCount = 0;
            this.updateSession();
        },

        _preventDefault: function(e) {
            e.preventDefault();
            e.stopPropagation();
        }
    };

    // utility
    function _extend(target, obj) {
        for (var i in obj) {
            target[i] = obj[i];
        }

        return target;
    }

    function _removeToken() {
        if (document.location.hash == '#ath') {
            history.replaceState('', window.document.title, document.location.href.split('#')[0]);
        }

        if (_reSmartURL.test(document.location.href)) {
            history.replaceState('', window.document.title, document.location.href.replace(_reSmartURL, '$1'));
        }

        if (_reQueryString.test(document.location.search)) {
            history.replaceState('', window.document.title, document.location.href.replace(_reQueryString, '$2'));
        }
    }

    // expose to the world
    window.addToHomescreen = ath;

})(window, document);


text:
package de.etecture.opensource.dynamicmessages.api;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
 * @author rhk
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MessageFallbacks {

	MessageFallback[] value();
}


text:
<!doctype html>

<meta charset="UTF-8">
<title>DOM Test</title>


text:
package org.apache.hadoop.hbase.procedure2;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Exchanger;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseCommonTestingUtil;
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure;
import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore;
import org.apache.hadoop.hbase.testclassification.MasterTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;

import org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState;

@Category({ MasterTests.class, SmallTests.class })
public class TestForceUpdateProcedure {

  @ClassRule
  public static final HBaseClassTestRule CLASS_RULE =
    HBaseClassTestRule.forClass(TestForceUpdateProcedure.class);

  private static HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil();

  private static WALProcedureStore STORE;

  private static ProcedureExecutor<Void> EXEC;

  private static Exchanger<Boolean> EXCHANGER = new Exchanger<>();

  private static int WAL_COUNT = 5;

  @Rule
  public final TestName name = new TestName();

  private void createStoreAndExecutor() throws IOException {
    UTIL.getConfiguration().setInt(CompletedProcedureCleaner.CLEANER_INTERVAL_CONF_KEY, 1000);
    Path logDir = UTIL.getDataTestDir(name.getMethodName());
    STORE = ProcedureTestingUtility.createWalStore(UTIL.getConfiguration(), logDir);
    STORE.start(1);
    EXEC = new ProcedureExecutor<Void>(UTIL.getConfiguration(), null, STORE);
    ProcedureTestingUtility.initAndStartWorkers(EXEC, 1, true);
  }

  @BeforeClass
  public static void setUpBeforeClass() throws IOException {
    UTIL.getConfiguration().setInt(WALProcedureStore.WAL_COUNT_WARN_THRESHOLD_CONF_KEY, WAL_COUNT);
  }

  private void stopStoreAndExecutor() {
    EXEC.stop();
    STORE.stop(false);
    EXEC = null;
    STORE = null;
  }

  @AfterClass
  public static void tearDownAfterClass() throws IOException {
    UTIL.cleanupTestDir();
  }

  @Before
  public void setUp() throws IOException {
    createStoreAndExecutor();
  }

  @After
  public void tearDown() {
    stopStoreAndExecutor();
  }

  public static final class WaitingProcedure extends NoopProcedure<Void> {

    @Override
    protected Procedure<Void>[] execute(Void env)
      throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException {
      EXCHANGER.exchange(Boolean.TRUE);
      setState(ProcedureState.WAITING_TIMEOUT);
      setTimeout(Integer.MAX_VALUE);
      throw new ProcedureSuspendedException();
    }
  }

  public static final class ParentProcedure extends NoopProcedure<Void> {

    @SuppressWarnings("unchecked")
    @Override
    protected Procedure<Void>[] execute(Void env)
      throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException {
      return new Procedure[] { new NoopProcedure<>(), new WaitingProcedure() };
    }
  }

  public static final class ExchangeProcedure extends NoopProcedure<Void> {

    @SuppressWarnings("unchecked")
    @Override
    protected Procedure<Void>[] execute(Void env)
      throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException {
      if (EXCHANGER.exchange(Boolean.TRUE)) {
        return new Procedure[] { this };
      } else {
        return null;
      }
    }
  }

  public static final class NoopNoAckProcedure extends NoopProcedure<Void> {

    @Override
    protected boolean shouldWaitClientAck(Void env) {
      return false;
    }
  }

  @Test
  public void testProcedureStuck() throws IOException, InterruptedException {
    EXEC.submitProcedure(new ParentProcedure());
    EXCHANGER.exchange(Boolean.TRUE);
    UTIL.waitFor(10000, () -> EXEC.getActiveExecutorCount() == 0);
    // The above operations are used to make sure that we have persist the states of the two
    // procedures.
    long procId = EXEC.submitProcedure(new ExchangeProcedure());
    assertEquals(1, STORE.getActiveLogs().size());
    for (int i = 0; i < WAL_COUNT - 1; i++) {
      assertTrue(STORE.rollWriterForTesting());
      // The WaitinProcedure never gets updated so we can not delete the oldest wal file, so the
      // number of wal files will increase
      assertEquals(2 + i, STORE.getActiveLogs().size());
      EXCHANGER.exchange(Boolean.TRUE);
      Thread.sleep(1000);
    }
    STORE.rollWriterForTesting();
    // Finish the ExchangeProcedure
    EXCHANGER.exchange(Boolean.FALSE);
    // Make sure that we can delete several wal files because we force update the state of
    // WaitingProcedure. Notice that the last closed wal files can not be deleted, as when rolling
    // the newest wal file does not have anything in it, and in the closed file we still have the
    // state for the ExchangeProcedure so it can not be deleted
    UTIL.waitFor(10000, () -> STORE.getActiveLogs().size() <= 2);
    UTIL.waitFor(10000, () -> EXEC.isFinished(procId));
    // Make sure that after the force update we could still load the procedures
    stopStoreAndExecutor();
    createStoreAndExecutor();
    Map<Class<?>, Procedure<Void>> procMap = new HashMap<>();
    EXEC.getActiveProceduresNoCopy().forEach(p -> procMap.put(p.getClass(), p));
    assertEquals(3, procMap.size());
    ParentProcedure parentProc = (ParentProcedure) procMap.get(ParentProcedure.class);
    assertEquals(ProcedureState.WAITING, parentProc.getState());
    WaitingProcedure waitingProc = (WaitingProcedure) procMap.get(WaitingProcedure.class);
    assertEquals(ProcedureState.WAITING_TIMEOUT, waitingProc.getState());
    NoopProcedure<Void> noopProc = (NoopProcedure<Void>) procMap.get(NoopProcedure.class);
    assertEquals(ProcedureState.SUCCESS, noopProc.getState());
  }

  @Test
  public void testCompletedProcedure() throws InterruptedException, IOException {
    long procId = EXEC.submitProcedure(new ExchangeProcedure());
    EXCHANGER.exchange(Boolean.FALSE);
    UTIL.waitFor(10000, () -> EXEC.isFinished(procId));
    for (int i = 0; i < WAL_COUNT - 1; i++) {
      assertTrue(STORE.rollWriterForTesting());
      // The exchange procedure is completed but still not deleted yet so we can not delete the
      // oldest wal file
      long pid = EXEC.submitProcedure(new NoopNoAckProcedure());
      assertEquals(2 + i, STORE.getActiveLogs().size());
      UTIL.waitFor(10000, () -> EXEC.isFinished(pid));
    }
    // Only the exchange procedure can not be deleted
    UTIL.waitFor(10000, () -> EXEC.getCompletedSize() == 1);
    STORE.rollWriterForTesting();
    UTIL.waitFor(10000, () -> STORE.getActiveLogs().size() <= 1);
  }
}


text:
(function() {

  'use strict';

  angular
    .module('harbor.project.member')
    .directive('addProjectMember', addProjectMember);

  AddProjectMemberController.$inject = ['$scope', 'roles', 'AddProjectMemberService'];

  function AddProjectMemberController($scope, roles, AddProjectMemberService) {
    var vm = this;

    $scope.pm = {};

    var pm = $scope.pm;

    vm.roles = roles();
    vm.optRole = 1;

    vm.save = save;
    vm.cancel = cancel;
    vm.reset = reset;

    vm.hasError = false;
    vm.errorMessage = '';

    function save(pm) {
      if(pm && angular.isDefined(pm.username)) {
        AddProjectMemberService(vm.projectId, vm.optRole, pm.username)
          .success(addProjectMemberComplete)
          .error(addProjectMemberFailed);
      }
    }

    function cancel(form) {

      form.$setPristine();
      form.$setUntouched();

      vm.isOpen = false;
      pm.username = '';
      vm.optRole = 1;

      vm.hasError = false;
      vm.errorMessage = '';
    }

    function addProjectMemberComplete(data, status, header) {
      console.log('addProjectMemberComplete: status:' + status + ', data:' + data);
      vm.reload();
      vm.isOpen = false;
    }

    function addProjectMemberFailed(data, status, headers) {
      if(status === 403) {
        vm.hasError = true;
        vm.errorMessage = 'failed_to_add_member';
      }
      if(status === 409 && pm.username !== '') {
        vm.hasError = true;
        vm.errorMessage = 'username_already_exist';
      }
      if(status === 404) {
        vm.hasError = true;
        vm.errorMessage = 'username_does_not_exist';
      }
      console.log('addProjectMemberFailed: status:' + status + ', data:' + data);
    }

    function reset() {
      vm.hasError = false;
      vm.errorMessage = '';
    }

  }

  addProjectMember.$inject = ['$timeout'];

  function addProjectMember($timeout) {
    var directive = {
      'restrict': 'E',
      'templateUrl': '/static/resources/js/components/project-member/add-project-member.directive.html',
      'scope': {
        'projectId': '@',
        'isOpen': '=',
        'reload': '&'
      },
      'link': link,
      'controller': AddProjectMemberController,
      'controllerAs': 'vm',
      'bindToController': true
    };

    return directive;

    function link(scope, element, attrs, ctrl) {
      scope.form.$setPristine();
      scope.form.$setUntouched();
      scope.$watch('vm.isOpen', function(current) {
        if(current) {
          $timeout(function() {
            element.find('[name=uUsername]:input').focus();
          });
        }
      });
    }
  }

})();


text:
package priv.jesse.netctoss.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;

import priv.jesse.netctoss.entity.Admin;
import priv.jesse.netctoss.service.ApplicationException;
import priv.jesse.netctoss.service.LoginService;

/**
 *  ´¦ÀíÆ÷Àࣨ¶þ¼¶´¦ÀíÆ÷£©
 * @author Jesse
 *
 */
@Controller
public class LoginController {
	@Resource(name="loginService")
	private LoginService service;

	@RequestMapping("/toLogin.do")
	public String toLogin(){
		return "main/login";
	}

	@RequestMapping("/login.do")
	public String login(HttpServletRequest req,HttpSession session){

		//¶ÁÈ¡Õ˺źÍÃÜÂë
		String adminCode = req.getParameter("adminCode");
		String password = req.getParameter("password");
		System.out.println(adminCode+":"+password);

		//ÔÝʱ²»×ö²ÎÊýÖµºÏ·¨ÐÔ¼ì²é
		Admin admin = service.checkLogin(adminCode, password);
		//µÇ¼³É¹¦½«½«admin¶ÔÏó°ó¶¨µ½session¶ÔÏóÉÏ£¬ÓÃÓÚsessionÑéÖ¤
		session.setAttribute("admin", admin);
		//µÇ¼³É¹¦£¬Öض¨Ïòµ½Ê×Ò³
		return "redirect:toIndex.do";
	}

	@RequestMapping("/toIndex.do")
	public String toIndex(){
		return "main/index";
	}

	@ExceptionHandler
	public String execute(Exception ex,HttpServletRequest req){
		if(ex instanceof ApplicationException){
			req.setAttribute("error", ex.getMessage());
			return "main/login";
		}else{
			return "error";
		}
	}
}


text:
Ext.define('Ext.ux.event.Player', {
    extend: 'Ext.ux.event.Driver',

    speed: 1.0,

    tagPathRegEx: /(\w+)(?:\[(\d+)\])?/,

    constructor: function (config) {
        var me = this;

        me.callParent(arguments);

        me.eventObject = new Ext.EventObjectImpl();
        me.timerFn = Ext.Function.bind(me.onTick, me);
    },

    getElementFromXPath: function (xpath) {
        var parts = xpath.split('/'),
            regex = this.tagPathRegEx,
            i, n, m, count, tag, child,
            el = (parts[0] == '~') ? document.body
                    : Ext.fly(parts[0].substring(1)).dom; // remove '#'

        for (i = 1, n = parts.length; el && i < n; ++i) {
            m = regex.exec(parts[i]);
            count = m[2] ? parseInt(m[2], 10) : 1;
            tag = m[1].toUpperCase();

            for (child = el.firstChild; child; child = child.nextSibling) {
                if (child.tagName == tag) {
                    if (count == 1) {
                        break;
                    }
                    --count;
                }
            }

            el = child;
        }

        return el;
    },

    onEnd: function () {},

    onStart: function () {
        this.schedule(0);
    },

    onStop: function () {
        var me = this;

        if (me.timer) {
            clearTimeout(me.timer);
            me.timer = null;
        }

        me.onEnd();
    },

    onTick: function () {
        var me = this,
            event,
            eventIndex = me.nextEvent,
            events = me.events,
            timeIndex = me.getTimestamp() * me.speed;

        me.timer = null;

        while (1) {
            event = events[eventIndex];

            if (event.ts > timeIndex) {
                me.schedule(eventIndex);
                break;
            }

            me.playEvent(event);

            if (++eventIndex == events.length) {
                me.stop();
                break;
            }
        }
    },

    playEvent: function (event) {
        var me = this,
            eventObject = me.eventObject,
            modKeys = event.modKeys || '',
            target = me.getElementFromXPath(event.target);

        if (target) {
            Ext.log('play: ' + Ext.encode(event));
            eventObject.type = event.type;
            eventObject.xy = event.xy || null;
            eventObject.button = event.button;

            if ('wheel' in event) {
                // see getWheelDelta
            }

            eventObject.altKey = modKeys.indexOf('A') > 0;
            eventObject.ctrlKey = modKeys.indexOf('C') > 0;
            eventObject.metaKey = modKeys.indexOf('M') > 0;
            eventObject.shiftKey = modKeys.indexOf('S') > 0;

            eventObject.injectEvent(target);
        } else {
            Ext.log('Cannot find: ', event.target);
        }
    },

    schedule: function (eventIndex) {
        var me = this;
        me.nextEvent = eventIndex;
        me.timer = setTimeout(me.timerFn, 10);
    }
});


text:
import { MyAccountEditEmailQuery } from "__generated__/MyAccountEditEmailQuery.graphql"
import { useToast } from "app/Components/Toast/toastHook"
import { defaultEnvironment } from "app/relay/createEnvironment"
import { PlaceholderBox } from "app/utils/placeholders"
import { renderWithPlaceholder } from "app/utils/renderWithPlaceholder"
import { Input } from "palette"
import React, { useEffect, useRef, useState } from "react"
import { createFragmentContainer, graphql, QueryRenderer, RelayProp } from "react-relay"
import { string } from "yup"
import { MyAccountEditEmail_me$data } from "../../../__generated__/MyAccountEditEmail_me.graphql"
import {
  MyAccountFieldEditScreen,
  MyAccountFieldEditScreenPlaceholder,
} from "./Components/MyAccountFieldEditScreen"
import { updateMyUserProfile } from "./updateMyUserProfile"

const MyAccountEditEmail: React.FC<{ me: MyAccountEditEmail_me$data; relay: RelayProp }> = ({
  me,
  relay,
}) => {
  const [email, setEmail] = useState<string>(me.email ?? "")
  const [receivedError, setReceivedError] = useState<string | undefined>(undefined)

  useEffect(() => {
    setReceivedError(undefined)
  }, [email])

  const isEmailValid = Boolean(email && string().email().isValidSync(email))

  const editScreenRef = useRef<MyAccountFieldEditScreen>(null)

  const toast = useToast()

  return (
    <MyAccountFieldEditScreen
      ref={editScreenRef}
      title="Email"
      canSave={isEmailValid}
      onSave={async (dismiss) => {
        try {
          await updateMyUserProfile({ email }, relay.environment)

          if (email !== me.email) {
            toast.show("Please confirm your new email for this update to take effect", "middle", {
              duration: "long",
            })
          }

          dismiss()
        } catch (e: any) {
          setReceivedError(e)
        }
      }}
    >
      <Input
        accessibilityLabel="email-input"
        enableClearButton
        value={email}
        onChangeText={setEmail}
        autoFocus
        autoCapitalize="none"
        autoCorrect={false}
        autoComplete="off"
        onSubmitEditing={() => {
          if (isEmailValid) {
            editScreenRef.current?.save()
          }
        }}
        error={receivedError}
      />
    </MyAccountFieldEditScreen>
  )
}

const MyAccountEditEmailPlaceholder: React.FC<{}> = ({}) => {
  return (
    <MyAccountFieldEditScreenPlaceholder title="Email">
      <PlaceholderBox height={40} />
    </MyAccountFieldEditScreenPlaceholder>
  )
}

export const MyAccountEditEmailContainer = createFragmentContainer(MyAccountEditEmail, {
  me: graphql`
    fragment MyAccountEditEmail_me on Me {
      email
    }
  `,
})

export const MyAccountEditEmailQueryRenderer: React.FC<{}> = () => {
  return (
    <QueryRenderer<MyAccountEditEmailQuery>
      environment={defaultEnvironment}
      query={graphql`
        query MyAccountEditEmailQuery {
          me {
            ...MyAccountEditEmail_me
          }
        }
      `}
      render={renderWithPlaceholder({
        Container: MyAccountEditEmailContainer,
        renderPlaceholder: () => <MyAccountEditEmailPlaceholder />,
      })}
      variables={{}}
    />
  )
}


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from measurement_stats.distributions import kernels
from measurement_stats.distributions.distributions_ops import * # has __all__
from measurement_stats.distributions.distributions_type \
    import create as create_distribution
from measurement_stats.distributions.distributions_type import Distribution


text:
using System.Text;

namespace Windar.ErlangTermsParser
{
    public abstract class Parser<T> where T : new()
    {
        #region Properties

        ParserInputStream _inputStream;
        int _numErrors;
        int _numWarnings;
        int _numRecoveries;

        protected ParserInputStream InputStream
        {
            get { return _inputStream; }
            set { _inputStream = value; }
        }

        protected int NumErrors
        {
            get { return _numErrors; }
            set { _numErrors = value; }
        }

        protected int NumWarnings
        {
            get { return _numWarnings; }
            set { _numWarnings = value; }
        }

        protected int NumRecoveries
        {
            get { return _numRecoveries; }
            set { _numRecoveries = value; }
        }

        public int CharCount
        {
            get { return InputStream.CharCount; }
        }

        public int Checksum
        {
            get { return InputStream.Checksum; }
        }

        #endregion

        protected Parser(ParserInputStream stream)
        {
            InputStream = stream;
        }

        public abstract T NextToken();

        #region Reporting

        /// <summary>
        /// A standard message for state changes.
        /// </summary>
        /// <param name="fromState">From state name.</param>
        /// <param name="toState">Target state name.</param>
        /// <returns></returns>
        protected static string GetStateChangeMessage(string fromState, string toState)
        {
            StringBuilder result = new StringBuilder();
            result.Append("Changing state from ").Append(fromState);
            result.Append(" to ").Append(toState);
            result.Append('.');
            return result.ToString();
        }

        /// <summary>
        /// Provides a simple error message naming an unexpected state.
        /// </summary>
        /// <param name="state">Unexpected state name.</param>
        /// <returns>Error message.</returns>
        protected static string GetUnexpectedStateErrorMessage(string state)
        {
            StringBuilder result = new StringBuilder();
            result.Append("Unexpected state ").Append(state);
            result.Append('.');
            return result.ToString();
        }

        /// <summary>
        /// This produces a warning message when a character is accepted by default.
        /// </summary>
        /// <param name="c">The character accepted by default.</param>
        /// <param name="stateName">The parser state name.</param>
        /// <returns>The warning message.</returns>
        protected string GetCharDefaultAcceptWarningMessage(char c, string stateName)
        {
            StringBuilder result = new StringBuilder();
            result.Append(GetCharacterPositionMessagePrefix());
            result.Append("Character ");
            result.Append(ParserInputStream.ToNameString(c));
            result.Append(" defaulted from the ");
            result.Append(stateName);
            result.Append(" state");
            return result.ToString();
        }

        /// <summary>
        /// Produces the error message for invalid name character.
        /// </summary>
        /// <param name="c">The invalid character.</param>
        /// <param name="stateName">The parser state.</param>
        /// <returns>The error message.</returns>
        protected string GetInvalidCharErrorMessage(char c, string stateName)
        {
            StringBuilder result = new StringBuilder();
            result.Append(GetCharacterPositionMessagePrefix());
            result.Append("Character ");
            result.Append(ParserInputStream.ToNameString(c));
            result.Append(" cannot be accepted from the ");
            result.Append(stateName);
            result.Append(" state");
            return result.ToString();
        }

        /// <summary>
        /// This method reports that there does not exist an edge from the current
        /// state which matches the next character from input.
        /// </summary>
        /// <param name="edge">Next input character.</param>
        /// <param name="stateName">Current parse state.</param>
        /// <returns>Error message for when invalid character found.</returns>
        protected string GetEdgeUnknownErrorMessage(int edge, string stateName)
        {
            StringBuilder result = new StringBuilder();
            result.Append(GetCharacterPositionMessagePrefix());
            result.Append("No edge labelled ");
            result.Append(ParserInputStream.ToNameString(edge));
            result.Append(" from the ");
            result.Append(stateName);
            result.Append(" state");
            return result.ToString();
        }

        /// <summary>
        /// Produces the line number and column number to be added to error
        /// and warning messages.
        /// </summary>
        /// <returns>Character position prefix.</returns>
        protected string GetCharacterPositionMessagePrefix()
        {
            StringBuilder result = new StringBuilder();
            result.Append("Ln: ").Append(InputStream.LineNo.ToString().PadLeft(4)).Append("   ");
            result.Append("Col: ").Append(InputStream.ColNo.ToString().PadLeft(3)).Append("   ");
            return result.ToString();
        }

        /// <summary>
        /// This method is used to report the final status of the parser.
        /// </summary>
        /// <returns>The completion report as a string.</returns>
        public string GetCompletionReport()
        {
            StringBuilder report = new StringBuilder();
            report.Append("Parsed ");
            report.Append(InputStream.LineNo);
            report.Append(" line");
            if (InputStream.LineNo > 1) report.Append('s');
            report.Append(" containing ");
            report.Append(InputStream.CharCount);
            report.Append(" characters.");
            if ((NumErrors + NumRecoveries) > 0 || NumWarnings > 0)
            {
                report.Append(" Reported ");
                if ((NumErrors + NumRecoveries) > 0)
                {
                    report.Append(NumErrors + NumRecoveries);
                    report.Append(" error");
                    if (NumErrors + NumRecoveries != 1)
                    {
                        report.Append('s');
                    }
                    if (NumRecoveries > 0)
                    {
                        report.Append(" (recovered ");
                        report.Append(NumRecoveries).Append(')');
                    }
                    if (NumWarnings == 0)
                    {
                        report.Append('.');
                    }
                    else
                    {
                        report.Append(" and ");
                    }
                }
                if (NumWarnings > 0)
                {
                    report.Append(NumWarnings);
                    report.Append(" warnings.");
                }
            }
            return report.ToString();
        }

        #endregion
    }
}


text:
package ch.bfh.gr33nopo55um.enocean.telegram;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * @class When sending a telegram, a RESPOND has to be expected. In this case, the following RESPONSE message gives the return codes: 00 RET_OK 02 RET_NOT_SUPPORTED 03 RET_WRONG_PARAM, for further informations check EnoceanSerialProtocol v3
 *
 * @author silas & louis
 */
@Entity
public class Response extends TelegramHeader {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private int returnCode;

    /**
     * @brief encodeTelegram provides an example telegram hex for this packet type.
     *
     * @return telegram hex
     */
    @Override
    public String encodeTelegram() {
        return null;
    }

    /**
     * @brief encodeTelegramData provides an example data hex for this packet type.
     *
     * @return String hexTelegramData EnOcean Telegram
     */
    @Override
    public String encodeTelegramData() {
        return null;
    }

    /**
     * @brief decodeTelegramData splits telegram in parts
     *
     * @param hexTelegram in hex String
     */
    @Override
    public void decodeTelegramData(String hexTelegram) {

        this.setReturnCode(Integer.parseInt(hexTelegram.substring(14, 4), 16));
        this.setCrcData(Integer.parseInt(hexTelegram.substring(14, 16), 16));

    }

    /**
     * @brief dumpData Print Data, useful for logs and testiing
     * EnOcean Telegram
     */
    @Override
    public void dumpData() {
        System.out.println(this.toString());
    }

    @Override
    public String toString() {
        return "PacketType=Response" +
                " ReturnCode=" + returnCode;
    }

    public int getReturnCode() {
        return returnCode;
    }

    private void setReturnCode(int returnCode) {
        this.returnCode = returnCode;
    }
}


text:
<?php

class Google_Service_DeploymentManager_Manifest extends Google_Collection
{
  protected $collection_key = 'imports';
  protected $configType = 'Google_Service_DeploymentManager_ConfigFile';
  protected $configDataType = '';
  public $expandedConfig;
  public $id;
  protected $importsType = 'Google_Service_DeploymentManager_ImportFile';
  protected $importsDataType = 'array';
  public $insertTime;
  public $layout;
  public $name;
  public $selfLink;

  public function setConfig(Google_Service_DeploymentManager_ConfigFile $config)
  {
    $this->config = $config;
  }
  public function getConfig()
  {
    return $this->config;
  }
  public function setExpandedConfig($expandedConfig)
  {
    $this->expandedConfig = $expandedConfig;
  }
  public function getExpandedConfig()
  {
    return $this->expandedConfig;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setImports($imports)
  {
    $this->imports = $imports;
  }
  public function getImports()
  {
    return $this->imports;
  }
  public function setInsertTime($insertTime)
  {
    $this->insertTime = $insertTime;
  }
  public function getInsertTime()
  {
    return $this->insertTime;
  }
  public function setLayout($layout)
  {
    $this->layout = $layout;
  }
  public function getLayout()
  {
    return $this->layout;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 486 (1898)

#### Original name
Peziza soleniiformis Berk. & M.A. Curtis

### Remarks
null


text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2008,2009 IITP RAS
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Kirill Andreev <andreev@iitp.ru>
 */

#include "ie-dot11s-metric-report.h"
#include "ns3/assert.h"

namespace ns3 {
namespace dot11s {
IeLinkMetricReport::IeLinkMetricReport () :
  m_metric (0)
{
}
IeLinkMetricReport::IeLinkMetricReport (uint32_t metric)
{
  m_metric = metric;
}
WifiInformationElementId
IeLinkMetricReport::ElementId () const
{
  return IE11S_LINK_METRIC_REPORT;
}
uint8_t
IeLinkMetricReport::GetInformationFieldSize (void) const
{
  return sizeof (uint32_t);
}
uint32_t
IeLinkMetricReport::GetMetric ()
{
  return m_metric;
}
void
IeLinkMetricReport::SetMetric (uint32_t metric)
{
  m_metric = metric;
}
void
IeLinkMetricReport::SerializeInformationField (Buffer::Iterator i) const
{
  i.WriteHtolsbU32 (m_metric);
}
uint8_t
IeLinkMetricReport::DeserializeInformationField (Buffer::Iterator start, uint8_t length)
{
  Buffer::Iterator i = start;
  m_metric = i.ReadLsbtohU32 ();
  return i.GetDistanceFrom (start);
}
void
IeLinkMetricReport::Print (std::ostream& os) const
{
  os << "Metric=" << m_metric;
}
bool
operator== (const IeLinkMetricReport & a, const IeLinkMetricReport & b)
{
  return (a.m_metric == b.m_metric);
}
bool
operator< (const IeLinkMetricReport & a, const IeLinkMetricReport & b)
{
  return (a.m_metric < b.m_metric);
}
bool
operator> (const IeLinkMetricReport & a, const IeLinkMetricReport & b)
{
  return (a.m_metric > b.m_metric);
}
std::ostream &
operator << (std::ostream &os, const IeLinkMetricReport &a)
{
  a.Print (os);
  return os;
}
} // namespace dot11s
} // namespace ns3


text:
package org.onosproject.net.intent;

/**
 * Contact point for installers to report progress of intent installation and to
 * update intent-specific status and context appropriately.
 */
public interface IntentInstallCoordinator {
    /**
     * Handles success state for an Intent operation context.
     *
     * @param context the Intent operation context
     */
    void intentInstallSuccess(IntentOperationContext context);

    /**
     * Handles failed state for an Intent operation context.
     *
     * @param context the Intent operation context
     */
    void intentInstallFailed(IntentOperationContext context);
}


text:
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.Azure.Insights.Models;

namespace Microsoft.Azure.Insights.Models
{
    /// <summary>
    /// The List Metric values operation response.
    /// </summary>
    public partial class MetricListResponse : AzureOperationResponse
    {
        private MetricCollection _metricCollection;

        /// <summary>
        /// Optional. Gets or sets the retrieved metric value sets.
        /// </summary>
        public MetricCollection MetricCollection
        {
            get { return this._metricCollection; }
            set { this._metricCollection = value; }
        }

        /// <summary>
        /// Initializes a new instance of the MetricListResponse class.
        /// </summary>
        public MetricListResponse()
        {
        }
    }
}