repo_name
stringlengths 6
101
| path
stringlengths 4
300
| text
stringlengths 7
1.31M
|
|---|---|---|
suxingjie99/JavaSource
|
src/org/example/source/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java
|
/*
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Copyright 1999-2002,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xerces.internal.dom;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
/**
* The DOMImplementation class is description of a particular
* implementation of the Document Object Model. As such its data is
* static, shared by all instances of this implementation.
* <P>
* The DOM API requires that it be a real object rather than static
* methods. However, there's nothing that says it can't be a singleton,
* so that's how I've implemented it.
*
* @xerces.internal
*
* @since PR-DOM-Level-1-19980818.
*/
public class DOMImplementationImpl extends CoreDOMImplementationImpl
implements DOMImplementation {
//
// Data
//
// static
/** Dom implementation singleton. */
static DOMImplementationImpl singleton = new DOMImplementationImpl();
//
// Public methods
//
/** NON-DOM: Obtain and return the single shared object */
public static DOMImplementation getDOMImplementation() {
return singleton;
}
//
// DOMImplementation methods
//
/**
* Test if the DOM implementation supports a specific "feature" --
* currently meaning language and level thereof.
*
* @param feature The package name of the feature to test.
* In Level 1, supported values are "HTML" and "XML" (case-insensitive).
* At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
*
* @param version The version number of the feature being tested.
* This is interpreted as "Version of the DOM API supported for the
* specified Feature", and in Level 1 should be "1.0"
*
* @return true iff this implementation is compatable with the
* specified feature and version.
*/
public boolean hasFeature(String feature, String version) {
boolean result = super.hasFeature(feature, version);
if (!result) {
boolean anyVersion = version == null || version.length() == 0;
if (feature.startsWith("+")) {
feature = feature.substring(1);
}
return (
(feature.equalsIgnoreCase("Events")
&& (anyVersion || version.equals("2.0")))
|| (feature.equalsIgnoreCase("MutationEvents")
&& (anyVersion || version.equals("2.0")))
|| (feature.equalsIgnoreCase("Traversal")
&& (anyVersion || version.equals("2.0")))
|| (feature.equalsIgnoreCase("Range")
&& (anyVersion || version.equals("2.0")))
|| (feature.equalsIgnoreCase("MutationEvents")
&& (anyVersion || version.equals("2.0"))));
}
return result;
} // hasFeature(String,String):boolean
/**
* Introduced in DOM Level 2. <p>
*
* Creates an XML Document object of the specified type with its document
* element.
*
* @param namespaceURI The namespace URI of the document
* element to create, or null.
* @param qualifiedName The qualified name of the document
* element to create.
* @param doctype The type of document to be created or null.<p>
*
* When doctype is not null, its
* Node.ownerDocument attribute is set to
* the document being created.
* @return Document A new Document object.
* @throws DOMException WRONG_DOCUMENT_ERR: Raised if doctype has
* already been used with a different document.
* @since WD-DOM-Level-2-19990923
*/
public Document createDocument(String namespaceURI,
String qualifiedName,
DocumentType doctype)
throws DOMException
{
if(namespaceURI == null && qualifiedName == null && doctype == null){
//if namespaceURI, qualifiedName and doctype are null, returned document is empty with
//no document element
return new DocumentImpl();
}
else if (doctype != null && doctype.getOwnerDocument() != null) {
String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
}
DocumentImpl doc = new DocumentImpl(doctype);
Element e = doc.createElementNS( namespaceURI, qualifiedName);
doc.appendChild(e);
return doc;
}
} // class DOMImplementationImpl
|
SpikeLavender/jdk-resource-code
|
sun/reflect/generics/tree/ShortSignature.java
|
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.reflect.generics.tree;
import sun.reflect.generics.visitor.TypeTreeVisitor;
/** AST that represents the type short. */
public class ShortSignature implements BaseType {
private static final ShortSignature singleton = new ShortSignature();
private ShortSignature(){}
public static ShortSignature make() {return singleton;}
public void accept(TypeTreeVisitor<?> v){
v.visitShortSignature(this);
}
}
|
avinashkothagit/Org1Chart
|
server/routes/staticRoutes.js
|
var _ = require( 'lodash' );
var Config = require( '../../config' );
var route = {
method: 'GET',
path: '/dist/{param*}',
handler: {
directory: {
path: './dist',
lookupCompressed: true
}
}
};
// add in caching config based on ENV
cacheConfig = Config.getCacheConfig();
if ( cacheConfig ) {
_.merge( route, { config: cacheConfig } );
}
exports.routes = [ route ];
|
Vizzuality/cw-ndc-tracking
|
db/migrate/20180501092235_change_country_iso_code_to_3_digit.rb
|
<reponame>Vizzuality/cw-ndc-tracking
class ChangeCountryIsoCodeTo3Digit < ActiveRecord::Migration[5.1]
def change
change_column :users, :country_iso_code, :string, null: false, default: 'XXX', limit: 3
end
end
|
wgnet/wds_qt
|
qtdeclarative/src/qml/qml/qqmlboundsignal.cpp
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qqmlboundsignal_p.h"
#include <private/qmetaobject_p.h>
#include <private/qmetaobjectbuilder_p.h>
#include "qqmlengine_p.h"
#include "qqmlexpression_p.h"
#include "qqmlcontext_p.h"
#include "qqmlmetatype_p.h"
#include "qqml.h"
#include "qqmlcontext.h"
#include "qqmlglobal_p.h"
#include <private/qqmlprofiler_p.h>
#include <private/qqmldebugconnector_p.h>
#include <private/qqmldebugserviceinterfaces_p.h>
#include <private/qqmlcompiler_p.h>
#include "qqmlinfo.h"
#include <private/qjsvalue_p.h>
#include <private/qv4value_p.h>
#include <QtCore/qstringbuilder.h>
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index,
QQmlContextData *ctxt, QObject *scope, const QString &expression,
const QString &fileName, quint16 line, quint16 column,
const QString &handlerName,
const QString ¶meterString)
: QQmlJavaScriptExpression(),
m_index(index),
m_target(target)
{
init(ctxt, scope);
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine());
QV4::ExecutionEngine *v4 = ep->v4engine();
QString function;
// Add some leading whitespace to account for the binding's column offset.
// It's 2 off because a, we start counting at 1 and b, the '(' below is not counted.
function.fill(QChar(QChar::Space), qMax(column, (quint16)2) - 2);
function += QStringLiteral("(function ");
function += handlerName;
function += QLatin1Char('(');
if (parameterString.isEmpty()) {
QString error;
//TODO: look at using the property cache here (as in the compiler)
// for further optimization
QMetaMethod signal = QMetaObjectPrivate::signal(m_target->metaObject(), m_index);
function += QQmlPropertyCache::signalParameterStringForJS(v4, signal.parameterNames(), &error);
if (!error.isEmpty()) {
qmlInfo(scopeObject()) << error;
return;
}
} else
function += parameterString;
function += QStringLiteral(") { ");
function += expression;
function += QStringLiteral(" })");
m_function.set(v4, evalFunction(context(), scopeObject(), function, fileName, line));
if (m_function.isNullOrUndefined())
return; // could not evaluate function. Not valid.
}
QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, const QV4::Value &function)
: QQmlJavaScriptExpression(),
m_index(index),
m_target(target)
{
m_function.set(function.as<QV4::Object>()->engine(), function);
init(ctxt, scope);
}
QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, QV4::Function *runtimeFunction)
: QQmlJavaScriptExpression(),
m_index(index),
m_target(target)
{
// It's important to call init first, because m_index gets remapped in case of cloned signals.
init(ctxt, scope);
QMetaMethod signal = QMetaObjectPrivate::signal(m_target->metaObject(), m_index);
QString error;
QV4::ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(ctxt->engine);
m_function.set(engine, QV4::FunctionObject::createQmlFunction(ctxt, scope, runtimeFunction, signal.parameterNames(), &error));
if (!error.isEmpty()) {
qmlInfo(scopeObject()) << error;
m_function.clear();
}
}
void QQmlBoundSignalExpression::init(QQmlContextData *ctxt, QObject *scope)
{
setNotifyOnValueChanged(false);
setContext(ctxt);
setScopeObject(scope);
Q_ASSERT(m_target && m_index > -1);
m_index = QQmlPropertyCache::originalClone(m_target, m_index);
}
QQmlBoundSignalExpression::~QQmlBoundSignalExpression()
{
}
QString QQmlBoundSignalExpression::expressionIdentifier()
{
QQmlSourceLocation loc = sourceLocation();
return loc.sourceFile + QLatin1Char(':') + QString::number(loc.line);
}
void QQmlBoundSignalExpression::expressionChanged()
{
// bound signals do not notify on change.
}
QQmlSourceLocation QQmlBoundSignalExpression::sourceLocation() const
{
QV4::Function *f = function();
if (f) {
QQmlSourceLocation loc;
loc.sourceFile = f->sourceFile();
loc.line = f->compiledFunction->location.line;
loc.column = f->compiledFunction->location.column;
return loc;
}
return QQmlSourceLocation();
}
QString QQmlBoundSignalExpression::expression() const
{
if (expressionFunctionValid()) {
Q_ASSERT (context() && engine());
QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine());
QV4::ScopedValue v(scope, m_function.value());
return v->toQStringNoThrow();
}
return QString();
}
QV4::Function *QQmlBoundSignalExpression::function() const
{
if (expressionFunctionValid()) {
Q_ASSERT (context() && engine());
QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine());
QV4::ScopedFunctionObject v(scope, m_function.value());
return v ? v->function() : 0;
}
return 0;
}
// Parts of this function mirror code in QQmlExpressionPrivate::value() and v8value().
// Changes made here may need to be made there and vice versa.
void QQmlBoundSignalExpression::evaluate(void **a)
{
Q_ASSERT (context() && engine());
if (!expressionFunctionValid())
return;
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine());
QV4::Scope scope(ep->v4engine());
ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation.
QVarLengthArray<int, 9> dummy;
//TODO: lookup via signal index rather than method index as an optimization
int methodIndex = QMetaObjectPrivate::signal(m_target->metaObject(), m_index).methodIndex();
int *argsTypes = QQmlMetaObject(m_target).methodParameterTypes(methodIndex, dummy, 0);
int argCount = argsTypes ? *argsTypes : 0;
QV4::ScopedCallData callData(scope, argCount);
for (int ii = 0; ii < argCount; ++ii) {
int type = argsTypes[ii + 1];
//### ideally we would use metaTypeToJS, however it currently gives different results
// for several cases (such as QVariant type and QObject-derived types)
//args[ii] = engine->metaTypeToJS(type, a[ii + 1]);
if (type == qMetaTypeId<QJSValue>()) {
if (QV4::Value *v4Value = QJSValuePrivate::valueForData(reinterpret_cast<QJSValue *>(a[ii + 1]), &callData->args[ii]))
callData->args[ii] = *v4Value;
else
callData->args[ii] = QV4::Encode::undefined();
} else if (type == QMetaType::QVariant) {
callData->args[ii] = scope.engine->fromVariant(*((QVariant *)a[ii + 1]));
} else if (type == QMetaType::Int) {
//### optimization. Can go away if we switch to metaTypeToJS, or be expanded otherwise
callData->args[ii] = QV4::Primitive::fromInt32(*reinterpret_cast<const int*>(a[ii + 1]));
} else if (type == qMetaTypeId<QQmlV4Handle>()) {
callData->args[ii] = *reinterpret_cast<QQmlV4Handle *>(a[ii + 1]);
} else if (ep->isQObject(type)) {
if (!*reinterpret_cast<void* const *>(a[ii + 1]))
callData->args[ii] = QV4::Primitive::nullValue();
else
callData->args[ii] = QV4::QObjectWrapper::wrap(ep->v4engine(), *reinterpret_cast<QObject* const *>(a[ii + 1]));
} else {
callData->args[ii] = scope.engine->fromVariant(QVariant(type, a[ii + 1]));
}
}
QQmlJavaScriptExpression::evaluate(callData, 0);
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
}
void QQmlBoundSignalExpression::evaluate(const QList<QVariant> &args)
{
Q_ASSERT (context() && engine());
if (!expressionFunctionValid())
return;
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine());
QV4::Scope scope(ep->v4engine());
ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation.
QV4::ScopedCallData callData(scope, args.count());
for (int ii = 0; ii < args.count(); ++ii) {
callData->args[ii] = scope.engine->fromVariant(args[ii]);
}
QQmlJavaScriptExpression::evaluate(callData, 0);
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
}
////////////////////////////////////////////////////////////////////////
/*! \internal
\a signal MUST be in the signal index range (see QObjectPrivate::signalIndex()).
This is different from QMetaMethod::methodIndex().
*/
QQmlBoundSignal::QQmlBoundSignal(QObject *target, int signal, QObject *owner,
QQmlEngine *engine)
: QQmlNotifierEndpoint(QQmlNotifierEndpoint::QQmlBoundSignal),
m_prevSignal(0), m_nextSignal(0),
m_expression(0)
{
addToObject(owner);
/*
If this is a cloned method, connect to the 'original'. For example,
for the signal 'void aSignal(int parameter = 0)', if the method
index refers to 'aSignal()', get the index of 'aSignal(int)'.
This ensures that 'parameter' will be available from QML.
*/
signal = QQmlPropertyCache::originalClone(target, signal);
QQmlNotifierEndpoint::connect(target, signal, engine);
}
QQmlBoundSignal::~QQmlBoundSignal()
{
removeFromObject();
}
void QQmlBoundSignal::addToObject(QObject *obj)
{
Q_ASSERT(!m_prevSignal);
Q_ASSERT(obj);
QQmlData *data = QQmlData::get(obj, true);
m_nextSignal = data->signalHandlers;
if (m_nextSignal) m_nextSignal->m_prevSignal = &m_nextSignal;
m_prevSignal = &data->signalHandlers;
data->signalHandlers = this;
}
void QQmlBoundSignal::removeFromObject()
{
if (m_prevSignal) {
*m_prevSignal = m_nextSignal;
if (m_nextSignal) m_nextSignal->m_prevSignal = m_prevSignal;
m_prevSignal = 0;
m_nextSignal = 0;
}
}
/*!
Returns the signal expression.
*/
QQmlBoundSignalExpression *QQmlBoundSignal::expression() const
{
return m_expression;
}
/*!
Sets the signal expression to \a e.
The QQmlBoundSignal instance takes ownership of \a e (and does not add a reference).
*/
void QQmlBoundSignal::takeExpression(QQmlBoundSignalExpression *e)
{
m_expression.take(e);
if (m_expression)
m_expression->setNotifyOnValueChanged(false);
}
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a)
{
QQmlBoundSignal *s = static_cast<QQmlBoundSignal*>(e);
if (!s->m_expression)
return;
QV4DebugService *service = QQmlDebugConnector::service<QV4DebugService>();
if (service)
service->signalEmitted(QString::fromLatin1(QMetaObjectPrivate::signal(
s->m_expression->target()->metaObject(),
s->signalIndex()).methodSignature()));
QQmlEngine *engine;
if (s->m_expression && (engine = s->m_expression->engine())) {
QQmlHandlingSignalProfiler prof(QQmlEnginePrivate::get(engine)->profiler, s->m_expression);
s->m_expression->evaluate(a);
if (s->m_expression && s->m_expression->hasError()) {
QQmlEnginePrivate::warning(engine, s->m_expression->error(engine));
}
}
}
////////////////////////////////////////////////////////////////////////
QQmlBoundSignalExpressionPointer::QQmlBoundSignalExpressionPointer(QQmlBoundSignalExpression *o)
: o(o)
{
if (o) o->addref();
}
QQmlBoundSignalExpressionPointer::QQmlBoundSignalExpressionPointer(const QQmlBoundSignalExpressionPointer &other)
: o(other.o)
{
if (o) o->addref();
}
QQmlBoundSignalExpressionPointer::~QQmlBoundSignalExpressionPointer()
{
if (o) o->release();
}
QQmlBoundSignalExpressionPointer &QQmlBoundSignalExpressionPointer::operator=(const QQmlBoundSignalExpressionPointer &other)
{
if (other.o) other.o->addref();
if (o) o->release();
o = other.o;
return *this;
}
QQmlBoundSignalExpressionPointer &QQmlBoundSignalExpressionPointer::operator=(QQmlBoundSignalExpression *other)
{
if (other) other->addref();
if (o) o->release();
o = other;
return *this;
}
/*!
Takes ownership of \a other. take() does *not* add a reference, as it assumes ownership
of the callers reference of other.
*/
QQmlBoundSignalExpressionPointer &QQmlBoundSignalExpressionPointer::take(QQmlBoundSignalExpression *other)
{
if (o) o->release();
o = other;
return *this;
}
QT_END_NAMESPACE
|
kingscode/vue-cli-plugin-kingscode-scaffold
|
generator/templates/Default/src/plugins/vuetify/icons/kingscode.js
|
<gh_stars>0
import {
faHome,
faSearch,
faUser,
faUsers,
faEye,
faEyeSlash,
faFile,
faFileVideo,
faFileWord,
faFileExcel,
faFilePowerpoint,
faFilePdf,
faUpload,
} from '<%_ if (options.plugins.includes("fontawesomepro")){ _%> @fortawesome/pro-solid-svg-icons<%_ } else { _%> @fortawesome/free-solid-svg-icons<%_ } _%>';
const icons = [
faHome,
faSearch,
faUser,
faUsers,
faEye,
faEyeSlash,
faFile,
faFileVideo,
faFileWord,
faFileExcel,
faFilePowerpoint,
faFilePdf,
faUpload,
];
/*kingscode icons*/
const identifiers = {
home: ['fas', 'home'],
profile: ['fas', 'user'],
search: ['fas', 'search'],
upload: ['fas', 'upload'],
user: ['fas', 'user'],
users: ['fas', 'users'],
visible: ['fas', 'eye'],
invisible: ['fas', 'eye-slash'],
fileUnknown: ['fas', 'file'],
fileVideo: ['fas', 'file-video'],
fileWord: ['fas', 'file-word'],
fileExcel: ['fas', 'file-excel'],
filePowerpoint: ['fas', 'file-powerpoint'],
filePdf: ['fas', 'file-pdf'],
add: ['fas', 'plus'],
plus: ['fas', 'plus'],
minus: ['fas', 'minus'],
};
export default {
icons,
identifiers,
};
|
Ahmed-Adel-Ismail/OpenWeathrMaps
|
app/src/test/java/com/reactive/owm/presentation/features/splash/SplashViewModelTest.java
|
<reponame>Ahmed-Adel-Ismail/OpenWeathrMaps
package com.reactive.owm.presentation.features.splash;
import org.junit.Assert;
import org.junit.Test;
import java.lang.reflect.Field;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.TestScheduler;
import io.reactivex.subjects.BehaviorSubject;
import static org.junit.Assert.*;
public class SplashViewModelTest {
@Test
public void updateCitiesCountThenUpdateFinishScreen() {
TestScheduler scheduler = new TestScheduler();
SplashViewModel viewModel = new SplashViewModel(scheduler);
viewModel.citiesCount.onNext(10);
scheduler.advanceTimeBy(4, TimeUnit.SECONDS);
assertTrue(viewModel.finishScreen.getValue());
}
@Test
public void onClearedThenCloseAllStreams() {
TestScheduler scheduler = new TestScheduler();
SplashViewModel viewModel = new SplashViewModel(scheduler);
viewModel.finishScreen.onNext(false);
viewModel.citiesCount.onNext(1);
viewModel.progressing.onNext(false);
viewModel.onCleared();
scheduler.triggerActions();
Observable.just(viewModel.getClass())
.map(Class::getDeclaredFields)
.flatMap(Observable::fromArray)
.doOnNext(field -> field.setAccessible(true))
.filter(field -> field.getType().isAssignableFrom(BehaviorSubject.class))
.map(field -> field.get(viewModel))
.cast(BehaviorSubject.class)
.map(subject -> subject.getValue() == null)
.defaultIfEmpty(false)
.all(Boolean::booleanValue)
.onErrorReturnItem(false)
.subscribe((Consumer<Boolean>) Assert::assertTrue);
}
}
|
cocolab8/cocktail
|
r2l/m2c/Scanner.c
|
#include "SYSTEM_.h"
#ifndef DEFINITION_Checks
#include "Checks.h"
#endif
#ifndef DEFINITION_rSystem
#include "rSystem.h"
#endif
#ifndef DEFINITION_General
#include "General.h"
#endif
#ifndef DEFINITION_Pack
#include "Pack.h"
#endif
#ifndef DEFINITION_Position
#include "Position.h"
#endif
#ifndef DEFINITION_IO
#include "IO.h"
#endif
#ifndef DEFINITION_DynArray
#include "DynArray.h"
#endif
#ifndef DEFINITION_Strings
#include "Strings.h"
#endif
#ifndef DEFINITION_Source
#include "Source.h"
#endif
#ifndef DEFINITION_Strings
#include "Strings.h"
#endif
#ifndef DEFINITION_Texts
#include "Texts.h"
#endif
#ifndef DEFINITION_StringM
#include "StringM.h"
#endif
#ifndef DEFINITION_Idents
#include "Idents.h"
#endif
#ifndef DEFINITION_Errors
#include "Errors.h"
#endif
#ifndef DEFINITION_Position
#include "Position.h"
#endif
#ifndef DEFINITION_Scanner
#include "Scanner.h"
#endif
INTEGER Zpky9FDA_3;
INTEGER Zpky9FDA_4;
Zpky9FDA_0 Zpky9FDA_5;
PROC Zpky9FDA_6;
#define Z149 1
#define Z150 2
#define Z151 3
#define Z152 4
#define Z153 5
#define Z154 37
#define Z155 39
#define Z156 32
#define Z157 6
#define Z158 31
#define Z159 7
#define Z160 8
#define Z161 34
#define Z162 36
#define Z163 38
#define Z164 9
#define Z165 10
#define Z166 11
#define Z167 30
#define Z168 12
#define Z169 13
#define Z170 14
#define Z171 15
#define Z172 35
#define Z173 33
#define Z174 16
#define Z175 17
#define Z176 18
#define Z177 19
#define Z178 20
#define Z179 21
#define Z180 22
#define Z181 23
#define Z182 24
#define Z183 25
#define Z184 26
#define Z185 27
#define Z186 28
#define Z187 29
#define Z188 13
#define Z189 14
#define Z190 16
#define Z191 17
#define Z192 21
#define Z193 26
#define Z194 27
static INTEGER Z195;
static Zp1PEAFD_2 Z196;
static Zp1PEAFi_1 Z197;
static ZmtLFGGBG_0 Z198;
static SHORTCARD Z199;
static BOOLEAN Z200;
#define Z211 8
#define Z212 0
#define Z213 16
#define Z214 (1024 * 8 + 256)
#define Z215 '\0'
#define Z216 ((CHAR)'\377')
#define Z217 '\n'
#define Z218 ((CHAR)'\177')
#define Z219 206
#define Z220 5056
#define Z221 66
#define Z222 67
#define Z223 0
#define Z224 1
#define Z225 3
#define Z226 5
#define Z227 7
#define Z228 9
#define Z229 11
#define Z230 13
#define Z231 15
#define Z232 17
typedef SHORTCARD Z233;
typedef Z233 Z234;
typedef Z233 Z235;
typedef struct S_1 {
Z234 Y0, Y1;
} Z236;
typedef Z236 *Z239;
typedef struct S_12 {
CHAR A[1000000 + 1];
} *Z240;
typedef CHAR Z241;
static struct S_2 {
ADDRESS A[Z219 + 1];
} Z242;
static struct S_3 {
Z234 A[Z219 + 1];
} Z243;
static struct S_4 {
Z236 A[Z220 + 1];
} Z244;
static struct S_5 {
Z234 A[Z219 + 1];
} Z245;
static struct S_6 {
CHAR A[Z216 + 1];
} Z246, Z247;
static struct S_7 {
Z234 A[1000000 + 1];
} *Z248;
static LONGINT Z249;
static Z234 Z250;
static Z234 Z251;
static CHAR Z252;
static BOOLEAN Z253;
static ZDz6VQCC_4 Z254;
static BOOLEAN Z256;
static Z240 Z257;
static INTEGER Z258;
static LONGINT Z259;
static INTEGER Z260;
static INTEGER Z261;
static INTEGER Z262;
static CARDINAL Z263;
static INTEGER Z264;
static SHORTCARD Z265;
static struct S_8 {
struct S_9 {
ZDz6VQCC_4 Y0;
BOOLEAN Y1;
Z240 Y2;
INTEGER Y3;
LONGINT Y4;
INTEGER Y5;
INTEGER Y6;
INTEGER Y7;
CARDINAL Y8;
INTEGER Y9;
} A[Z213 - 1 + 1];
} Z266;
#define Z277 16
static LONGINT Z278;
static struct S_10 {
Z234 A[100000 + 1];
} *Z279;
static LONGINT Z280;
static void Z281 ARGS ((Z234 Z282));
static void Z285 ARGS ((void));
struct S_1_GetToken;
static void Z296 ARGS ((struct S_1_GetToken *link));
struct S_1_GetToken {
Zp1PEAFD_2 *Z294;
Zp1PEAFD_2 *Z295;
};
static void Z314 ARGS ((void));
static void Z284 ARGS ((Z234 Z325));
static void Z305 ARGS ((void));
static void Z327 ARGS ((void));
static void Z304 ARGS ((INTEGER Z330));
static void Z302 ARGS ((void));
static void Z331 ARGS ((INTEGER Z332));
static void Z333 ARGS ((INTEGER Z332, INTEGER Z334));
static void Z303 ARGS ((INTEGER Z301));
static void Z335 ARGS ((CHAR Z336));
static void Z337 ARGS ((CHAR Z336));
static CHAR Z338 ARGS ((void));
static CARDINAL Z341;
static void Z342 ARGS ((LONGCARD Z343));
static void Z344 ARGS ((LONGCARD Z343));
static void Z345 ARGS ((LONGCARD Z343));
static void Z346 ARGS ((LONGCARD Z343));
static void Z347 ARGS ((void));
static void Z286 ARGS ((SHORTCARD Z351));
static void Z357 ARGS ((void));
void Zpky9FDA_1
# ifdef HAVE_ARGS
(CARDINAL Z202, Zpky9FDA_0 *Z203)
# else
(Z202, Z203)
CARDINAL Z202;
Zpky9FDA_0 *Z203;
# endif
{
Z203->Y0 = Zpky9FDA_5.Y0;
switch (Z202) {
case Z149:;
Z203->U_1.V_1.Y1 = Zfb3DLQ_1;
break;
case Z150:;
Z203->U_1.V_2.Y2 = 0;
break;
case Z151:;
Z203->U_1.V_3.Y3 = Z197;
break;
case Z152:;
Z203->U_1.V_4.Y4 = '?';
break;
case Z153:;
ZqnGVQ_1(&Z203->U_1.V_5.Y5);
break;
default:
break;
}
}
static void Z281
# ifdef HAVE_ARGS
(Z234 Z282)
# else
(Z282)
Z234 Z282;
# endif
{
if (Z280 == Z278) {
ZarQdhNDD_2((ADDRESS *)&Z279, &Z278, (LONGINT)sizeof (Z234));
}
Z279->A[Z280] = Z250;
INC(Z280);
Z284(Z282);
}
static void Z285
ARGS ((void))
{
Z251 = Z250;
if (Z280 > 0) {
DEC(Z280);
Z250 = Z279->A[Z280];
} else {
Z286(6);
}
}
static void Z296
# ifdef HAVE_ARGS
(struct S_1_GetToken *link)
# else
(link)
struct S_1_GetToken *link;
# endif
{
if (Z195 > 0) {
Zpky9FDA_10(link->Z295);
Zp1PEAFD_5(link->Z294, link->Z295);
} else {
ZblNKKO_30((LONGCARD)Z192, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
}
}
INTEGER Zpky9FDA_9
ARGS ((void))
{
Z234 Z282;
Z239 Z288;
BOOLEAN Z289;
INTEGER Z290, Z291, Z292, Z293;
Zp1PEAFD_2 Z294, Z208, Z295;
struct S_1_GetToken frame;
frame.Z294 = &Z294;
frame.Z295 = &Z295;
for (;;) {
Z282 = Z250;
Zpky9FDA_3 = 0;
Zpky9FDA_4 = Z260;
for (;;) {
for (;;) {
Z288 = (Z239)(Z242.A[Z282] + ORD(Z257->A[Z260]) * sizeof (Z236));
if (Z288->Y0 != Z282) {
Z282 = Z243.A[Z282];
if (Z282 == Z212) {
goto EXIT_3;
}
} else {
Z282 = Z288->Y1;
INC(Zpky9FDA_3);
Z248->A[Zpky9FDA_3] = Z282;
INC(Z260);
}
} EXIT_3:;
for (;;) {
switch (Z248->A[Zpky9FDA_3]) {
case 206:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
if (Z195 == 0) {
ZqnGVQ_1(&Zpky9FDA_5.U_1.V_5.Y5);
Zp1PEAFD_4(&Z294);
Z198 = Zpky9FDA_5.Y0;
} else {
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z294, &Z295);
}
INC(Z195);
Z289 = FALSE;
goto EXIT_4;
break;
case 205:;
DEC(Z195);
if (Z195 == 0) {
Z284(Z199);
ZqnGVQ_2(&Zpky9FDA_5.U_1.V_5.Y5, &Z294);
Zpky9FDA_5.Y0 = Z198;
return Z153;
} else {
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z294, &Z295);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 40:;
case 73:;
if (Z195 > 0) {
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z294, &Z295);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 38:;
case 56:;
case 86:;
case 93:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z296(&frame);
Z289 = FALSE;
goto EXIT_4;
break;
case 204:;
if (Z195 > 0) {
Zp1PEAFD_6(&Z294, '\t');
}
Z302();
Z289 = FALSE;
goto EXIT_4;
break;
case 39:;
case 69:;
if (Z195 > 0) {
ZqnGVQ_2(&Zpky9FDA_5.U_1.V_5.Y5, &Z294);
Zp1PEAFD_4(&Z294);
}
Z303(0L);
Z289 = FALSE;
goto EXIT_4;
break;
case 41:;
case 57:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
if (Z195 > 0) {
Zpky9FDA_10(&Z295);
Zp1PEAFD_6(&Z294, Zp1PEAFD_12(&Z295, 2));
} else {
ZblNKKO_30((LONGCARD)Z192, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 42:;
Z304(1L);
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
if (Z195 > 0) {
Zp1PEAFD_6(&Z294, '\\');
} else {
ZblNKKO_30((LONGCARD)Z192, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 21:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
if (Z195 > 0) {
Zp1PEAFD_6(&Z294, '\\');
} else {
ZblNKKO_30((LONGCARD)Z192, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 203:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z208);
Z284(Z229);
Z289 = FALSE;
goto EXIT_4;
break;
case 202:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z208);
Z284(Z230);
Z289 = FALSE;
goto EXIT_4;
break;
case 30:;
case 50:;
case 51:;
case 62:;
case 75:;
case 88:;
case 95:;
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z208, &Z295);
Z289 = FALSE;
goto EXIT_4;
break;
case 27:;
case 48:;
case 49:;
case 61:;
case 76:;
case 89:;
case 96:;
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z208, &Z295);
Z289 = FALSE;
goto EXIT_4;
break;
case 29:;
Zp1PEAFD_6(&Z208, '\\');
Zp1PEAFD_6(&Z208, '\n');
Z303(0L);
Z289 = FALSE;
goto EXIT_4;
break;
case 201:;
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z208, &Z295);
Z305();
Zp1PEAFD_5(&Z294, &Z208);
Z289 = FALSE;
goto EXIT_4;
break;
case 200:;
Zpky9FDA_10(&Z295);
Zp1PEAFD_5(&Z208, &Z295);
Z305();
Zp1PEAFD_5(&Z294, &Z208);
Z289 = FALSE;
goto EXIT_4;
break;
case 199:;
Zp1PEAFD_6(&Z208, '\t');
Z302();
Z289 = FALSE;
goto EXIT_4;
break;
case 28:;
case 70:;
Zp1PEAFD_6(&Z208, '\n');
Z303(0L);
Z305();
Zp1PEAFD_5(&Z294, &Z208);
Z289 = FALSE;
goto EXIT_4;
break;
case 60:;
Zp1PEAFD_6(&Z208, '\r');
Z289 = FALSE;
goto EXIT_4;
break;
case 198:;
Z284(Z228);
Z289 = FALSE;
goto EXIT_4;
break;
case 31:;
case 52:;
case 74:;
case 87:;
case 91:;
case 94:;
Z289 = FALSE;
goto EXIT_4;
break;
case 196:;
Z305();
Z289 = FALSE;
goto EXIT_4;
break;
case 195:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z155;
Z289 = FALSE;
goto EXIT_4;
break;
case 189:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z156;
Z289 = FALSE;
goto EXIT_4;
break;
case 184:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z157;
Z289 = FALSE;
goto EXIT_4;
break;
case 178:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z158;
Z289 = FALSE;
goto EXIT_4;
break;
case 173:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z159;
Z289 = FALSE;
goto EXIT_4;
break;
case 168:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z160;
Z289 = FALSE;
goto EXIT_4;
break;
case 164:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z162;
Z289 = FALSE;
goto EXIT_4;
break;
case 160:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z224;
Z284(Z225);
return Z161;
Z289 = FALSE;
goto EXIT_4;
break;
case 157:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z154;
Z289 = FALSE;
goto EXIT_4;
break;
case 151:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z284(Z231);
return Z163;
Z289 = FALSE;
goto EXIT_4;
break;
case 138:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z164;
Z289 = FALSE;
goto EXIT_4;
break;
case 132:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z165;
Z289 = FALSE;
goto EXIT_4;
break;
case 43:;
case 58:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z284(Z227);
return Z166;
Z289 = FALSE;
goto EXIT_4;
break;
case 127:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z167;
Z289 = FALSE;
goto EXIT_4;
break;
case 34:;
case 55:;
case 63:;
case 64:;
case 125:;
case 126:;
case 128:;
case 129:;
case 130:;
case 131:;
case 133:;
case 134:;
case 135:;
case 136:;
case 137:;
case 139:;
case 140:;
case 141:;
case 142:;
case 143:;
case 144:;
case 145:;
case 146:;
case 147:;
case 148:;
case 149:;
case 150:;
case 152:;
case 153:;
case 154:;
case 155:;
case 156:;
case 158:;
case 159:;
case 161:;
case 162:;
case 163:;
case 165:;
case 166:;
case 167:;
case 169:;
case 170:;
case 171:;
case 172:;
case 174:;
case 175:;
case 176:;
case 177:;
case 179:;
case 180:;
case 181:;
case 182:;
case 183:;
case 185:;
case 186:;
case 187:;
case 188:;
case 190:;
case 191:;
case 192:;
case 193:;
case 194:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_1.Y1 = Zfb3DLQ_2(&Z295);
return Z149;
Z289 = FALSE;
goto EXIT_4;
break;
case 33:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_2.Y2 = Zp1PEAFD_15(&Z295);
return Z150;
Z289 = FALSE;
goto EXIT_4;
break;
case 37:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
if (Zpky9FDA_3 > Zp1PEAFD_0) {
ZblNKKO_30((LONGCARD)Z193, (LONGCARD)ZblNKKO_11, Zpky9FDA_5.Y0);
Zp1PEAFD_13((STRING)" ", 1L, &Z294);
} else if (Zpky9FDA_3 == 2) {
ZblNKKO_30((LONGCARD)Z194, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
Zp1PEAFD_13((STRING)" ", 1L, &Z294);
} else {
Zpky9FDA_10(&Z295);
Zp1PEAFD_11(&Z295, 2, (Zp1PEAFD_1)(Zp1PEAFD_7(&Z295) - 1), &Z294);
}
Zpky9FDA_5.U_1.V_3.Y3 = Zp1PEAFi_2(&Z294);
return Z151;
Z289 = FALSE;
goto EXIT_4;
break;
case 124:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z168;
Z289 = FALSE;
goto EXIT_4;
break;
case 123:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z170;
Z289 = FALSE;
goto EXIT_4;
break;
case 122:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z305();
return Z185;
Z289 = FALSE;
goto EXIT_4;
break;
case 121:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z177;
Z289 = FALSE;
goto EXIT_4;
break;
case 120:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z169;
Z289 = FALSE;
goto EXIT_4;
break;
case 119:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z175;
Z289 = FALSE;
goto EXIT_4;
break;
case 118:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z176;
Z289 = FALSE;
goto EXIT_4;
break;
case 117:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z178;
Z289 = FALSE;
goto EXIT_4;
break;
case 116:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z179;
Z289 = FALSE;
goto EXIT_4;
break;
case 115:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z180;
Z289 = FALSE;
goto EXIT_4;
break;
case 114:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z181;
Z289 = FALSE;
goto EXIT_4;
break;
case 113:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z182;
Z289 = FALSE;
goto EXIT_4;
break;
case 112:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z183;
Z289 = FALSE;
goto EXIT_4;
break;
case 111:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z284(Z226);
return Z184;
Z289 = FALSE;
goto EXIT_4;
break;
case 110:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z173;
Z289 = FALSE;
goto EXIT_4;
break;
case 109:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z174;
Z289 = FALSE;
goto EXIT_4;
break;
case 108:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z186;
Z289 = FALSE;
goto EXIT_4;
break;
case 107:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
return Z187;
Z289 = FALSE;
goto EXIT_4;
break;
case 105:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z227;
Z284(Z225);
return Z171;
Z289 = FALSE;
goto EXIT_4;
break;
case 106:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z199 = Z227;
Z284(Z225);
return Z172;
Z289 = FALSE;
goto EXIT_4;
break;
case 104:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\n';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 103:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\t';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 102:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = ((CHAR)'\13');
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 101:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\b';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 100:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\r';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 99:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\f';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 36:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z295);
Zp1PEAFD_11(&Z295, 2, (Zp1PEAFD_1)Zp1PEAFD_7(&Z295), &Z294);
Zpky9FDA_5.U_1.V_4.Y4 = CHR((CARDINAL)Zp1PEAFD_15(&Z294));
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 35:;
case 97:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_4.Y4 = Zp1PEAFD_12(&Z295, 2);
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 98:;
DEC1(Z260, 2);
DEC1(Zpky9FDA_3, 2);
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\\';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 32:;
case 53:;
case 54:;
case 197:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_4.Y4 = Zp1PEAFD_12(&Z295, 1);
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 92:;
Z289 = FALSE;
goto EXIT_4;
break;
case 90:;
Z289 = FALSE;
goto EXIT_4;
break;
case 85:;
Z289 = FALSE;
goto EXIT_4;
break;
case 84:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z284(Z232);
Z200 = TRUE;
return Z184;
Z289 = FALSE;
goto EXIT_4;
break;
case 20:;
case 45:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = !Z200;
Zpky9FDA_10(&Z295);
if (!Z200) {
Zpky9FDA_5.U_1.V_4.Y4 = Zp1PEAFD_12(&Z295, 1);
return Z152;
} else {
Zpky9FDA_5.U_1.V_2.Y2 = Zp1PEAFD_15(&Z295);
return Z150;
}
Z289 = FALSE;
goto EXIT_4;
break;
case 25:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = !Z200;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_2.Y2 = Zp1PEAFD_16(&Z295, 8L);
return Z150;
Z289 = FALSE;
goto EXIT_4;
break;
case 24:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = !Z200;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_2.Y2 = Zp1PEAFD_15(&Z295);
return Z150;
Z289 = FALSE;
goto EXIT_4;
break;
case 26:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = !Z200;
Zpky9FDA_10(&Z295);
Zp1PEAFD_11(&Z295, 3, (Zp1PEAFD_1)Zp1PEAFD_7(&Z295), &Z294);
Zpky9FDA_5.U_1.V_2.Y2 = Zp1PEAFD_16(&Z294, 16L);
return Z150;
Z289 = FALSE;
goto EXIT_4;
break;
case 83:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\n';
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 82:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\t';
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 81:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = ((CHAR)'\13');
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 80:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\b';
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 79:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\r';
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 78:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_5.U_1.V_4.Y4 = '\f';
Z200 = FALSE;
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 23:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = FALSE;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_4.Y4 = Zp1PEAFD_12(&Z295, 2);
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 19:;
case 44:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = FALSE;
Zpky9FDA_10(&Z295);
Zpky9FDA_5.U_1.V_4.Y4 = Zp1PEAFD_12(&Z295, 1);
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 22:;
Z304(1L);
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z200 = FALSE;
Zpky9FDA_5.U_1.V_4.Y4 = '}';
return Z152;
Z289 = FALSE;
goto EXIT_4;
break;
case 77:;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Z284(Z224);
return Z185;
Z289 = FALSE;
goto EXIT_4;
break;
case 72:;
while (Z257->A[Z260] == ' ') {
INC(Z260);
}
Z289 = FALSE;
goto EXIT_4;
break;
case 71:;
Z302();
Z289 = FALSE;
goto EXIT_4;
break;
case 68:;
Z303(0L);
Z289 = FALSE;
goto EXIT_4;
break;
case 1:;
case 2:;
case 3:;
case 4:;
case 5:;
case 6:;
case 7:;
case 8:;
case 9:;
case 10:;
case 11:;
case 12:;
case 13:;
case 14:;
case 15:;
case 16:;
case 17:;
case 18:;
case 46:;
case 47:;
case 59:;
case 65:;
DEC(Z260);
DEC(Zpky9FDA_3);
break;
case 67:;
INC(Z260);
Zpky9FDA_3 = 1;
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
ZblNKKO_30((LONGCARD)Z191, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
Z289 = FALSE;
goto EXIT_4;
break;
case Z212:;
Z289 = FALSE;
goto EXIT_4;
break;
case 66:;
DEC(Z260);
DEC(Zpky9FDA_3);
if (Zpky9FDA_3 == 0) {
Z282 = Z250;
} else {
Z282 = Z248->A[Zpky9FDA_3];
}
if (Z260 != Z258 + Z261) {
Z282 = Z245.A[Z282];
if (Z282 != Z212) {
INC(Z260);
INC(Zpky9FDA_3);
Z248->A[Zpky9FDA_3] = Z282;
Z289 = TRUE;
goto EXIT_4;
}
} else {
if (!Z256) {
Z291 = Z260 - Zpky9FDA_3 - 1;
Z292 = ZdaDDAD7_1 - Zpky9FDA_3 % ZdaDDAD7_1 - 1;
if (Z291 > Z292) {
{
LONGINT B_1 = 0, B_2 = Zpky9FDA_3;
if (B_1 <= B_2)
for (Z290 = B_1;; Z290 += 1) {
Z257->A[Z292 + Z290] = Z257->A[Z291 + Z290];
if (Z290 >= B_2) break;
}
}
DEC1(Z264, Z291 - Z292);
DEC1(Zpky9FDA_4, Z291 - Z292);
Z258 = Z292 + Zpky9FDA_3 + 1;
} else {
Z258 = Z260;
}
Z293 = ZdaDDAD7_8(ZdaDDAD7_7((LONGCARD)(Z259 - 4 - ZdaDDAD7_1 - Zpky9FDA_3)));
if (Z293 < Z259 / 8) {
ZarQdhNDD_2((ADDRESS *)&Z257, &Z259, (LONGINT)sizeof (CHAR));
if (Z257 == NIL) {
Z286(1);
}
Z293 = ZdaDDAD7_8(ZdaDDAD7_7((LONGCARD)(Z259 - 4 - ZdaDDAD7_1 - Zpky9FDA_3)));
if (Z249 < Z259) {
ZarQdhNDD_2((ADDRESS *)&Z248, &Z249, (LONGINT)sizeof (Z234));
if (Z248 == NIL) {
Z286(1);
}
}
}
Z260 = Z258;
INC1(Z262, Z261);
Z261 = ZpwNQF2_1(Z254, ADR (Z257->A[Z260]), (LONGCARD)Z293);
if (Z261 <= 0) {
Z261 = 0;
Z256 = TRUE;
}
Z257->A[Z258 + Z261] = Z218;
Z257->A[Z258 + Z261 + 1] = '\0';
Z289 = TRUE;
goto EXIT_4;
}
if (Zpky9FDA_3 == 0) {
Zpky9FDA_5.Y0.Y0 = Z263;
Zpky9FDA_5.Y0.Y1 = Z260 - Z264 - Zpky9FDA_3;
Zpky9FDA_13();
if (Z265 == 0) {
switch (Z250) {
case Z225:;
case Z226:;
ZblNKKO_30((LONGCARD)Z188, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
break;
case Z228:;
ZblNKKO_30((LONGCARD)Z189, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
break;
case Z229:;
case Z230:;
ZblNKKO_30((LONGCARD)Z190, (LONGCARD)ZblNKKO_12, Zpky9FDA_5.Y0);
break;
default:
break;
}
Z284(Z224);
}
if (Z265 == 0) {
return Zpky9FDA_2;
}
Z289 = FALSE;
goto EXIT_4;
}
}
break;
default:
Z286(0);
break;
}
} EXIT_4:;
if (Z289) {
} else {
goto EXIT_2;
}
} EXIT_2:;
} EXIT_1:;
}
void Zpky9FDA_8
# ifdef HAVE_ARGS
(CHAR Z313[], LONGCARD O_1)
# else
(Z313, O_1)
CHAR Z313[];
LONGCARD O_1;
# endif
{
OPEN_ARRAY_LOCALS
ALLOC_OPEN_ARRAYS (O_1 * sizeof (CHAR), 1)
COPY_OPEN_ARRAY (Z313, O_1, CHAR)
if (Z253 && Z261 == 0) {
Z265 = 0;
Z253 = FALSE;
}
Z314();
if (ORD(Z313[0]) == 0) {
Z254 = ZDz6VQCC_1;
} else {
Z254 = ZpwNQF2_0(Z313, O_1);
}
if (Z254 < 0) {
Z286(5);
}
FREE_OPEN_ARRAYS
}
static void Z314
ARGS ((void))
{
if (Z265 >= Z213) {
Z286(3);
}
INC(Z265);
{
register struct S_9 *W_1 = &Z266.A[Z265 - 1];
W_1->Y0 = Z254;
W_1->Y1 = Z256;
W_1->Y2 = Z257;
W_1->Y3 = Z258;
W_1->Y4 = Z259;
W_1->Y5 = Z260;
W_1->Y6 = Z261;
W_1->Y7 = Z262;
W_1->Y8 = Z263;
W_1->Y9 = Z264;
}
Z259 = Z214;
ZarQdhNDD_0((ADDRESS *)&Z257, &Z259, (LONGINT)sizeof (CHAR));
if (Z257 == NIL) {
Z286(1);
}
Z258 = ZdaDDAD7_1;
Z257->A[Z258 - 1] = Z217;
Z257->A[Z258] = Z218;
Z257->A[Z258 + 1] = '\0';
Z260 = Z258;
Z256 = FALSE;
Z261 = 0;
Z262 = 0;
Z263 = 1;
Z264 = Z258 - 1;
}
void Zpky9FDA_13
ARGS ((void))
{
if (Z265 == 0) {
Z286(4);
}
ZpwNQF2_2(Z254);
ZarQdhNDD_3((ADDRESS *)&Z257, &Z259, (LONGINT)sizeof (CHAR));
{
register struct S_9 *W_2 = &Z266.A[Z265 - 1];
Z254 = W_2->Y0;
Z256 = W_2->Y1;
Z257 = W_2->Y2;
Z258 = W_2->Y3;
Z259 = W_2->Y4;
Z260 = W_2->Y5;
Z261 = W_2->Y6;
Z262 = W_2->Y7;
Z263 = W_2->Y8;
Z264 = W_2->Y9;
}
DEC(Z265);
Z253 = FALSE;
}
void Zpky9FDA_10
# ifdef HAVE_ARGS
(Zp1PEAFD_2 *Z295)
# else
(Z295)
Zp1PEAFD_2 *Z295;
# endif
{
CARDINAL Z319, Z320;
Z320 = Z260 - Zpky9FDA_3 - 1;
Z295->Y1 = ZdaDDAD7_3(Zpky9FDA_3, (LONGINT)Zp1PEAFD_0);
{
LONGCARD B_3 = 1, B_4 = Z295->Y1;
if (B_3 <= B_4)
for (Z319 = B_3;; Z319 += 1) {
Z295->Y0.A[Z319] = Z257->A[Z320 + Z319];
if (Z319 >= B_4) break;
}
}
}
void Zpky9FDA_11
# ifdef HAVE_ARGS
(Zp1PEAFD_2 *Z295)
# else
(Z295)
Zp1PEAFD_2 *Z295;
# endif
{
CARDINAL Z319, Z320;
Z320 = Z260 - Zpky9FDA_3 - 1;
Z295->Y1 = ZdaDDAD7_3(Zpky9FDA_3, (LONGINT)Zp1PEAFD_0);
{
LONGCARD B_5 = 1, B_6 = Z295->Y1;
if (B_5 <= B_6)
for (Z319 = B_5;; Z319 += 1) {
Z295->Y0.A[Z319] = Z246.A[Z257->A[Z320 + Z319]];
if (Z319 >= B_6) break;
}
}
}
void Zpky9FDA_12
# ifdef HAVE_ARGS
(Zp1PEAFD_2 *Z295)
# else
(Z295)
Zp1PEAFD_2 *Z295;
# endif
{
CARDINAL Z319, Z320;
Z320 = Z260 - Zpky9FDA_3 - 1;
Z295->Y1 = ZdaDDAD7_3(Zpky9FDA_3, (LONGINT)Zp1PEAFD_0);
{
LONGCARD B_7 = 1, B_8 = Z295->Y1;
if (B_7 <= B_8)
for (Z319 = B_7;; Z319 += 1) {
Z295->Y0.A[Z319] = Z247.A[Z257->A[Z320 + Z319]];
if (Z319 >= B_8) break;
}
}
}
static void Z284
# ifdef HAVE_ARGS
(Z234 Z325)
# else
(Z325)
Z234 Z325;
# endif
{
Z251 = Z250;
Z250 = Z325;
}
static void Z305
ARGS ((void))
{
Z234 Z326;
Z326 = Z250;
Z250 = Z251;
Z251 = Z326;
}
static void Z327
ARGS ((void))
{
INTEGER Z319;
{
LONGINT B_9 = Z260 - Zpky9FDA_3, B_10 = Z260 - 1;
if (B_9 <= B_10)
for (Z319 = B_9;; Z319 += 1) {
ZfM_24((ZDz6VQCC_4)ZfM_1, Z257->A[Z319]);
if (Z319 >= B_10) break;
}
}
}
static void Z304
# ifdef HAVE_ARGS
(INTEGER Z330)
# else
(Z330)
INTEGER Z330;
# endif
{
DEC1(Z260, Zpky9FDA_3 - Z330);
Zpky9FDA_3 = Z330;
}
static void Z302
ARGS ((void))
{
DEC1(Z264, Z211 - 1 - (Z260 - Z264 - 2) % Z211);
}
static void Z331
# ifdef HAVE_ARGS
(INTEGER Z332)
# else
(Z332)
INTEGER Z332;
# endif
{
DEC1(Z264, Z211 - 1 - (Z260 - Z264 - Zpky9FDA_3 + Z332 - 1) % Z211);
}
static void Z333
# ifdef HAVE_ARGS
(INTEGER Z332, INTEGER Z334)
# else
(Z332, Z334)
INTEGER Z332, Z334;
# endif
{
DEC1(Z264, Z211 - 1 - (Z260 - Z264 - Zpky9FDA_3 + Z332 - 1) % Z211);
}
static void Z303
# ifdef HAVE_ARGS
(INTEGER Z301)
# else
(Z301)
INTEGER Z301;
# endif
{
INC(Z263);
Z264 = Z260 - 1 - Z301;
}
static void Z335
# ifdef HAVE_ARGS
(CHAR Z336)
# else
(Z336)
CHAR Z336;
# endif
{
ZfM_24((ZDz6VQCC_4)ZfM_1, Z336);
}
static void Z337
# ifdef HAVE_ARGS
(CHAR Z336)
# else
(Z336)
CHAR Z336;
# endif
{
DEC(Z260);
Z257->A[Z260] = Z336;
}
static CHAR Z338
ARGS ((void))
{
if (Z260 == Z258 + Z261) {
if (!Z256) {
DEC1(Z264, Z261);
Z258 = ZdaDDAD7_1;
Z260 = Z258;
INC1(Z262, Z261);
Z261 = ZpwNQF2_1(Z254, (ADDRESS)Z257, ZdaDDAD7_8(ZdaDDAD7_7((LONGCARD)Z259)));
if (Z261 <= 0) {
Z261 = 0;
Z256 = TRUE;
}
Z257->A[Z261] = Z218;
Z257->A[Z261 + 1] = '\0';
}
}
if (Z260 == Z258 + Z261) {
return '\0';
} else {
INC(Z260);
return Z257->A[Z260 - 1];
}
}
void Zpky9FDA_7
ARGS ((void))
{
Z195 = 0;
Zp1PEAFD_4(&Z196);
Z197 = Zp1PEAFi_2(&Z196);
}
void Zpky9FDA_14
ARGS ((void))
{
}
static void Z342
# ifdef HAVE_ARGS
(LONGCARD Z343)
# else
(Z343)
LONGCARD Z343;
# endif
{
Z242.A[Z341] = ADR (Z244.A[Z343]);
INC(Z341);
}
static void Z344
# ifdef HAVE_ARGS
(LONGCARD Z343)
# else
(Z343)
LONGCARD Z343;
# endif
{
Z243.A[Z341] = Z343;
INC(Z341);
}
static void Z345
# ifdef HAVE_ARGS
(LONGCARD Z343)
# else
(Z343)
LONGCARD Z343;
# endif
{
Z245.A[Z341] = Z343;
INC(Z341);
}
static void Z346
# ifdef HAVE_ARGS
(LONGCARD Z343)
# else
(Z343)
LONGCARD Z343;
# endif
{
if (!ODD(Z341)) {
Z244.A[Z341 / 2].Y0 = Z343;
} else {
Z244.A[Z341 / 2].Y1 = Z343;
}
INC(Z341);
}
static void Z347
ARGS ((void))
{
Zmfy8_1 Z348;
Z348 = Z342;
Z341 = 1;
Zmfy8_9(Z348, (STRING)"++ZP+]C+cG+iK+oO+uS+{N+~++VZ/+V`3++V2V<ZL++++Z,Vf7Z.{.+", 55L, 35L);
Zmfy8_9(Z348, (STRING)"[9+[4+Vl;[5+++[CVr?e+VxC[7V~G+WZK++YAW`O+YDWeM[:Wh6Wn:YM", 56L, 28L);
Zmfy8_9(Z348, (STRING)"Ws8XF+++++++++++++++++++++++++++++++[?+++++++ZG+++ZK+++", 55L, 49L);
Zmfy8_9(Z348, (STRING)"++++++++++++YQYN+.Z8YRYQ+ZAZA2Z:ZD+-ZIZ9ZK[:ZT[:[.ZL[6[E", 56L, 37L);
Zmfy8_9(Z348, (STRING)"[7+[K[?[@[J[>+-[K+[=[G[@+[F[C\\1+\\5\\@\\D^J+c;cHcLcB+cCcAcO", 56L, 32L);
Zmfy8_9(Z348, (STRING)"cQcG+cDcGcEcD+cLcJcLcJcI++dJ+++++++++", 37L, 25L);
Z348 = Z344;
Z341 = 1;
Zmfy8_9(Z348, (STRING)"M,S.:0M2:4C6C8B::<CD,++BCC+B++BOCCBC+BBCVB+VA+VBVBVBVBVB", 56L, 49L);
Zmfy8_9(Z348, (STRING)"VBV2VBV/VBVAVB+VAVBVBV2V2VAVB++++RGVB+SV5V3V1V0BBBBBB++", 55L, 36L);
Zmfy8_9(Z348, (STRING)"V9V5V3V1+V5+V9V5V3V1N+NNNNNNV7+V7V7V7V7V7V7V7V7V7V7V7V7", 55L, 33L);
Zmfy8_9(Z348, (STRING)"V7V7V7V7V7V7VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVA", 56L, 28L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVA", 56L, 28L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVA+V7+VH++++VH+", 55L, 31L);
Zmfy8_9(Z348, (STRING)"+", 1L, 1L);
Z348 = Z345;
Z341 = 1;
Zmfy8_9(Z348, (STRING)"V7V7V9V9V7V7V7V7V5V5V3V3V1V1++V-V-B+V:++++++++++N++++++", 55L, 38L);
Zmfy8_9(Z348, (STRING)"+V9+++++V/+V1+V3+V5V/++V9++++FI++++++++++V9V5V3V1++++++", 55L, 44L);
Zmfy8_9(Z348, (STRING)"+++V9V5V3V1+V5+V9V5V3V1++++++++++++++++++++++++++++++++", 55L, 46L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++++++++++++++++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++", 23L, 23L);
Z348 = Z346;
Z341 = 0;
Zmfy8_9(Z348, (STRING)",V7,V7,V7,V7,V7,V7,V7,V7,V7,VH,VE,V7,W3,W1,V7,V7,V7,V7,", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V7,V7,V7,V7,V7,V7,V7,V7,W,,V7,V7,V7,V7,V7,VI,V7,V6,V7,V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)",V7,V7,V7,WJ,WI,WL,WM,WO,WP,WS,YH,L,L,L,L,L,L,L,L,L,L,V7", 56L, 44L);
Zmfy8_9(Z348, (STRING)",V7,V7,WR,V7,WK,V7++,Y,,X8,X2,XKX-XE,Y6X4XN,YAX8X9++,Y1", 55L, 36L);
Zmfy8_9(Z348, (STRING)"++X8XR++X4X5XKXL,V8,X-++++++X-X.?V<++XKY<,WH,K,WG,V7,V7", 55L, 38L);
Zmfy8_9(Z348, (STRING)",V7CCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD++++++++++?V<+++", 55L, 53L);
Zmfy8_9(Z348, (STRING)"+,WF,WN,WQ,V7BVC,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7", 55L, 37L);
Zmfy8_9(Z348, (STRING)",V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)",V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)",V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7,V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)",V7,V7,V7,V7.YO.VFJYG.W4.QLLLLLLLLLLLLLLLLLLLLQRTV+.W-V2", 56L, 45L);
Zmfy8_9(Z348, (STRING)"HV8V@V;V,V=GV@M.VJVBVC.YMW8W9W@WAWDYIWTX+.YNX+X,X.X/X/X0", 56L, 31L);
Zmfy8_9(Z348, (STRING)"X0X1EEEEEEEEEEEEEEEEEEEEX2X3X3X4X5X6X6X7X9X:X:X;X;X<EEE", 55L, 39L);
Zmfy8_9(Z348, (STRING)"EEEEEEEEEOOOOOOOOOOOOOOOOOOOOV.CV.CV.CV.CV.CV.CV.CV.CV.", 55L, 46L);
Zmfy8_9(Z348, (STRING)"CV.CX<X=X=X>X>X?X?X@X@XA.@EEEEEEEEEEEEXAXBXBXCXCXDXEXFXF", 56L, 36L);
Zmfy8_9(Z348, (STRING)"XGXGXHXHXIXIXJXLXMXNXOXOXPXPXQXRXSXSXT0V70V70V70V70V70V7", 56L, 31L);
Zmfy8_9(Z348, (STRING)"0V70V70V7XTY+.YQ0V7.YPY,Y-0V70V70V70V70V70V70V70V70V70V7", 56L, 36L);
Zmfy8_9(Z348, (STRING)"0V70V7Y-Y.0V70V70V70V70V7Y.Y/0V70V70V70V70V70V70V70V70V7", 56L, 36L);
Zmfy8_9(Z348, (STRING)"0V70V70V70WP0V70V70V70V70V70V70V70V70V70V70V70V70V70V70", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"0V70V70V70V70V70V70V70V70V70V70V70V70V70K0V70V70V70V70V7", 56L, 38L);
Zmfy8_9(Z348, (STRING)"0V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70WQ0V7Y/Y00V70V70V70V70V70V70", 55L, 36L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"0V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"0V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"0V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70V70", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V70V70V70V70V70V70V70V70V70V70V72V72V72V72V72V72V72V72V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"2V72VH2VE2V72W32W12V72V72V72V72V72V72V72V72V72V72V72V72", 55L, 37L);
Zmfy8_9(Z348, (STRING)"W,2V72V72V72V72V72VI2V72V62WE2V72V72V72V72WJ2WI2WL2WM2WO", 56L, 37L);
Zmfy8_9(Z348, (STRING)"2WP2V72WD2L2L2L2L2L2L2L2L2L2L2W@2V72WC2V72WB2WK2V7V0V0V0", 56L, 43L);
Zmfy8_9(Z348, (STRING)"V0Y1Y2Y2Y32VAY3Y4Y4Y5Y6Y7Y7Y8Y8Y9Y9Y:Y:Y;Y<Y=2WTY=Y>Y>Y?", 56L, 29L);
Zmfy8_9(Z348, (STRING)"Y?Y@YAYBYBYCYCYDYDYEYEYFYHYIV0V0++++2WH2K2WG2V72V72V7++", 55L, 34L);
Zmfy8_9(Z348, (STRING)"++++++++++++V0AV0AV0AV0AV0AV0AV0AV0AV0AV0A+++++++++++++", 55L, 45L);
Zmfy8_9(Z348, (STRING)"+++++2WF2WN2V72V7++2V72V72V72V72V72V72V72V72V72V72V72V7", 55L, 39L);
Zmfy8_9(Z348, (STRING)"2V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"2V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"2V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V72V7", 56L, 37L);
Zmfy8_9(Z348, (STRING)"2V72V72V72V72V74V54V54V54V54V54V54V54V54V5++++4V54W54W2", 55L, 38L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54W.4V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"VK4V54V54V54V54V54V54V54V54V54J4V54V54V54V54V54V54V54V5", 55L, 37L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 37L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 37L);
Zmfy8_9(Z348, (STRING)"4V54V5++4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 38L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 37L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 37L);
Zmfy8_9(Z348, (STRING)"4V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V54V5", 56L, 37L);
Zmfy8_9(Z348, (STRING)"4V56V36V36V36V36V36V36V36V36V36YJ6VG6V36W66V=6V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V36V36V36V36V36V36V36V36W/6V36V36V36V36V36VL6V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36YL6V36V36V36V36V36V36V36V36V36V36V36V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V?6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3++6V3", 56L, 38L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V3", 56L, 37L);
Zmfy8_9(Z348, (STRING)"6V36V36V36V36V36V36V36V36V36V36V36V36V36V36V36V38V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18YJ8VG8V18W78V=8V18V18V18V18V18V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18W08V18V18V18V18V18VM8V18YK8V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V>8V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V1++8V18V18V18V1", 55L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V18V1", 56L, 37L);
Zmfy8_9(Z348, (STRING)"8V18V18V18V18V18V18V18V18V18V18V18V18V1:VH:VE++:W3:W1++", 55L, 38L);
Zmfy8_9(Z348, (STRING)"++MVAMVAMVAMVAMVAMVAMVAMVAMVAMVA:W,++++++++++:VIMVAMVAM", 55L, 41L);
Zmfy8_9(Z348, (STRING)"VAMVAMV;MVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVA", 56L, 37L);
Zmfy8_9(Z348, (STRING)"MVAMVAMVAMVAMVA++++++++MVA++MVAMVAMVAMVAMVAMVAMVAMVAMVA", 55L, 40L);
Zmfy8_9(Z348, (STRING)"MVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVAMVA<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-++++<V-++++<V-<V-<V-<V-<V-<V-<V-", 55L, 39L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-++<V-<V-<V-<V-<V-:W+<V-<V-<V-<V-<V-<V-<V-", 56L, 38L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<?<V.<V.<V.<V.<V.<V.<V.<V.<V.<V-", 56L, 38L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<><V-<V-<V-", 55L, 37L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<VN<V-++<V-<V-<V-<V-<V-", 55L, 37L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-", 56L, 37L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-", 56L, 37L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-", 56L, 37L);
Zmfy8_9(Z348, (STRING)"<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V-<V->B>B>B>B>B>B>B>B>B>", 55L, 43L);
Zmfy8_9(Z348, (STRING)"B++>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B", 55L, 55L);
Zmfy8_9(Z348, (STRING)">B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>", 55L, 55L);
Zmfy8_9(Z348, (STRING)"B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B", 55L, 55L);
Zmfy8_9(Z348, (STRING)">B>B>B>B>B>B>VQ>B>B>B>VO>B>B>B>B>B>B>B>VT>B>B>B>VP>B>VS", 55L, 50L);
Zmfy8_9(Z348, (STRING)">B>VR>B>B>B>B>B>B>B>B++>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B", 55L, 54L);
Zmfy8_9(Z348, (STRING)">B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>", 55L, 55L);
Zmfy8_9(Z348, (STRING)"B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B", 55L, 55L);
Zmfy8_9(Z348, (STRING)">B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>", 55L, 55L);
Zmfy8_9(Z348, (STRING)"B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B>B", 55L, 55L);
Zmfy8_9(Z348, (STRING)">B>B@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V+@V:@V:@T@V:@V:@V:@", 55L, 39L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:++@V:", 56L, 38L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:", 56L, 37L);
Zmfy8_9(Z348, (STRING)"@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:@V:KNKNKNK", 55L, 39L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKN++KNKNKW8KNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNK", 55L, 54L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKN++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"KNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNK", 55L, 55L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKNKNKNKNKNKNKNKW<KNKNKNKW:KNKNKNKNKNKNKNKW?K", 55L, 52L);
Zmfy8_9(Z348, (STRING)"NKNKNKW;KNKW>KNKW=KNKNKNKNKNKNKNKN++KNKNKNKNKNKNKNKNKNK", 55L, 52L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKN", 55L, 55L);
Zmfy8_9(Z348, (STRING)"KNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNK", 55L, 55L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKN", 55L, 55L);
Zmfy8_9(Z348, (STRING)"KNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNKNK", 55L, 55L);
Zmfy8_9(Z348, (STRING)"NKNKNKNKNKNKNKNKNSV9SV9SV9SV9SV9SV9SV9SV9SV9++++SV9SV9+", 55L, 44L);
Zmfy8_9(Z348, (STRING)"+SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 55L, 37L);
Zmfy8_9(Z348, (STRING)"SSSV9++SV9SV9SV9SV9++SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9S", 55L, 39L);
Zmfy8_9(Z348, (STRING)"V9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 56L, 37L);
Zmfy8_9(Z348, (STRING)"SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9S", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V9SV9SV9SV9++SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 55L, 37L);
Zmfy8_9(Z348, (STRING)"SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9++SV9++", 55L, 38L);
Zmfy8_9(Z348, (STRING)"SV9++SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 56L, 38L);
Zmfy8_9(Z348, (STRING)"SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9S", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 56L, 37L);
Zmfy8_9(Z348, (STRING)"SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9S", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 56L, 37L);
Zmfy8_9(Z348, (STRING)"SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9S", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9SV9", 56L, 37L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/++V/V/V/V/V/V/V/", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/PV/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 55L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/++V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/V/", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V/V/V/V/V/V/V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1++++V1V1", 56L, 30L);
Zmfy8_9(Z348, (STRING)"V1V1++V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1++V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1++V1V1V1V1V1V1V1V1V1", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1++V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1V1", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V1V1V1V1V1V1V1V1V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3+++", 55L, 29L);
Zmfy8_9(Z348, (STRING)"+V3V3V3V3++V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 55L, 29L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"++V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3++V3V3V3V3V3V3", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3++V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3V3", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V3V3V3V3V3V3V3V3V3V3V3V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5++++V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 30L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5++V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5++V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V5V5V5V5V5V5V5V5V5V5V5V5V5V5V5V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9++++V9V9V9V9++V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 31L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9++V9V9V9", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9++V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9++V9", 56L, 29L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9++V9V9++V9V9++V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 31L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9V9", 56L, 28L);
Zmfy8_9(Z348, (STRING)"V9V9V9V9V9V9V9V9V9V9V9V9V9V9V<EV<EV<EV<EV<EV<EV<EV<EV<E", 55L, 32L);
Zmfy8_9(Z348, (STRING)"V<E++++++++++++++V<EV<EV<EV<EV<EV<E++++++++++++++++++++", 55L, 48L);
Zmfy8_9(Z348, (STRING)"++++++++++++++++++++++++++++++++V<EV<EV<EV<EV<EV<EV>FV>", 55L, 47L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>F++V>FV>FV>V2V>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F++V>FV>FV>FV>", 56L, 38L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>F", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>", 56L, 37L);
Zmfy8_9(Z348, (STRING)"FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV>FV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?I++V?IV?IV?V4V?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I++V?IV?IV?IV?IV?IV?IV?", 55L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?I", 55L, 37L);
Zmfy8_9(Z348, (STRING)"V?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?", 56L, 37L);
Zmfy8_9(Z348, (STRING)"IV?IV?IV?IV?IV?IV?IV?IV?IV?IV?IVAVAVAVAVAVAVAVAVAVAVAVA", 55L, 33L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVA++++++++++++++VAVAVAVAVAVAVAVAVAVAVAVAVA", 56L, 35L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVA", 56L, 28L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVA++++++++VAVA++VAVAVAVAVAVAVAVAVAVA", 56L, 33L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVA", 56L, 28L);
Zmfy8_9(Z348, (STRING)"VAVAVAVAVAVAVAVAVAVAVAVAVAVA+++++++++++++++++++++++++++", 55L, 41L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++++++++++++++++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++++++++++++++++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++++++++++++++++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++++++++++++++++++++++++++++++++++++++", 55L, 55L);
Zmfy8_9(Z348, (STRING)"+++++++++++++++++++", 19L, 19L);
}
static void Z286
# ifdef HAVE_ARGS
(SHORTCARD Z351)
# else
(Z351)
SHORTCARD Z351;
# endif
{
ZmtLFGGBG_3((ZDz6VQCC_4)ZfM_2, Zpky9FDA_5.Y0);
switch (Z351) {
case 0:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: internal error", 25L);
break;
case 1:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: out of memory", 24L);
break;
case 3:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: too many nested include files", 40L);
break;
case 4:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: file stack underflow (too many calls of CloseFile)", 61L);
break;
case 5:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: cannot open input file", 33L);
break;
case 6:;
ZfM_29((ZDz6VQCC_4)ZfM_2, (STRING)": Scanner: start stack underflow (too many calls of yyPop)", 58L);
break;
}
ZfM_33((ZDz6VQCC_4)ZfM_2);
(*Zpky9FDA_6)();
}
static void Z357
ARGS ((void))
{
ZfM_34();
rExit(1L);
}
void BEGIN_Scanner ARGS ((void))
{
static BOOLEAN has_been_called = FALSE;
if (has_been_called) return;
has_been_called = TRUE;
BEGIN_Strings ();
BEGIN_Idents ();
BEGIN_StringM ();
BEGIN_Texts ();
BEGIN_Position ();
BEGIN_Checks ();
BEGIN_rSystem ();
BEGIN_General ();
BEGIN_Pack ();
BEGIN_Position ();
BEGIN_IO ();
BEGIN_DynArray ();
BEGIN_Strings ();
BEGIN_Source ();
BEGIN_Strings ();
BEGIN_Texts ();
BEGIN_StringM ();
BEGIN_Idents ();
BEGIN_Errors ();
BEGIN_Position ();
Zpky9FDA_6 = Z357;
Z253 = TRUE;
Z265 = 0;
Z314();
Z254 = ZDz6VQCC_1;
Z250 = Z224;
Z251 = Z224;
Z249 = Z214;
ZarQdhNDD_0((ADDRESS *)&Z248, &Z249, (LONGINT)sizeof (Z234));
Z248->A[0] = Z222;
Z278 = Z277;
ZarQdhNDD_0((ADDRESS *)&Z279, &Z278, (LONGINT)sizeof (Z234));
Z280 = 0;
Z347();
{
CHAR B_11 = Z215, B_12 = Z216;
if (B_11 <= B_12)
for (Z252 = B_11;; Z252 += 1) {
Z246.A[Z252] = Z252;
if (Z252 >= B_12) break;
}
}
Z247 = Z246;
for (Z252 = 'A'; Z252 <= 'Z'; Z252 += 1) {
Z246.A[Z252] = CHR(ORD(Z252) - ORD('A') + ORD('a'));
}
for (Z252 = 'a'; Z252 <= 'z'; Z252 += 1) {
Z247.A[Z252] = CHR(ORD(Z252) - ORD('a') + ORD('A'));
}
}
|
lucadevitis-msm/ruby-puppetfiles
|
puppetfiles.gemspec
|
<gh_stars>0
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'puppetfiles/version'
Gem::Specification.new do |spec|
raise 'RubyGems 2.0 or newer is required.' unless spec.respond_to?(:metadata)
spec.name = 'puppetfiles'
spec.version = Puppetfiles::VERSION
spec.authors = ['<NAME>']
spec.email = ['<EMAIL>']
spec.summary = 'Write a short summary'
spec.description = 'Write a longer description'
spec.homepage = 'http://mygemserver.com'
spec.license = 'MIT'
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
spec.metadata['allowed_push_host'] = 'http://mygemserver.com'
spec.files = `git ls-files -z`.split("\x0")
spec.files.reject! { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = 'bin'
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
end
|
sharpninja/chrome-music-lab
|
soundwaves/third_party/tone/Tone/core/Buffer.js
|
<gh_stars>1000+
define(["Tone/core/Tone", "Tone/core/Emitter"], function(Tone){
"use strict";
/**
* @class Buffer loading and storage. Tone.Buffer is used internally by all
* classes that make requests for audio files such as Tone.Player,
* Tone.Sampler and Tone.Convolver.
* <br><br>
* Aside from load callbacks from individual buffers, Tone.Buffer
* provides static methods which keep track of the loading progress
* of all of the buffers. These methods are Tone.Buffer.onload, Tone.Buffer.onprogress,
* and Tone.Buffer.onerror.
*
* @constructor
* @extends {Tone}
* @param {AudioBuffer|string} url The url to load, or the audio buffer to set.
* @param {function=} onload A callback which is invoked after the buffer is loaded.
* It's recommended to use Tone.Buffer.onload instead
* since it will give you a callback when ALL buffers are loaded.
* @example
* var buffer = new Tone.Buffer("path/to/sound.mp3", function(){
* //the buffer is now available.
* var buff = buffer.get();
* });
*/
Tone.Buffer = function(){
var options = this.optionsObject(arguments, ["url", "onload"], Tone.Buffer.defaults);
/**
* stores the loaded AudioBuffer
* @type {AudioBuffer}
* @private
*/
this._buffer = null;
/**
* indicates if the buffer should be reversed or not
* @type {boolean}
* @private
*/
this._reversed = options.reverse;
/**
* The url of the buffer. <code>undefined</code> if it was
* constructed with a buffer
* @type {string}
* @readOnly
*/
this.url = undefined;
/**
* Indicates if the buffer is loaded or not.
* @type {boolean}
* @readOnly
*/
this.loaded = false;
/**
* The callback to invoke when everything is loaded.
* @type {function}
*/
this.onload = options.onload.bind(this, this);
if (options.url instanceof AudioBuffer || options.url instanceof Tone.Buffer){
this.set(options.url);
this.onload(this);
} else if (this.isString(options.url)){
this.url = options.url;
Tone.Buffer._addToQueue(options.url, this);
}
};
Tone.extend(Tone.Buffer);
/**
* the default parameters
* @type {Object}
*/
Tone.Buffer.defaults = {
"url" : undefined,
"onload" : Tone.noOp,
"reverse" : false
};
/**
* Pass in an AudioBuffer or Tone.Buffer to set the value
* of this buffer.
* @param {AudioBuffer|Tone.Buffer} buffer the buffer
* @returns {Tone.Buffer} this
*/
Tone.Buffer.prototype.set = function(buffer){
if (buffer instanceof Tone.Buffer){
this._buffer = buffer.get();
} else {
this._buffer = buffer;
}
this.loaded = true;
return this;
};
/**
* @return {AudioBuffer} The audio buffer stored in the object.
*/
Tone.Buffer.prototype.get = function(){
return this._buffer;
};
/**
* Load url into the buffer.
* @param {String} url The url to load
* @param {Function=} callback The callback to invoke on load.
* don't need to set if `onload` is
* already set.
* @returns {Tone.Buffer} this
*/
Tone.Buffer.prototype.load = function(url, callback){
this.url = url;
this.onload = this.defaultArg(callback, this.onload);
Tone.Buffer._addToQueue(url, this);
return this;
};
/**
* dispose and disconnect
* @returns {Tone.Buffer} this
*/
Tone.Buffer.prototype.dispose = function(){
Tone.prototype.dispose.call(this);
Tone.Buffer._removeFromQueue(this);
this._buffer = null;
this.onload = Tone.Buffer.defaults.onload;
return this;
};
/**
* The duration of the buffer.
* @memberOf Tone.Buffer#
* @type {number}
* @name duration
* @readOnly
*/
Object.defineProperty(Tone.Buffer.prototype, "duration", {
get : function(){
if (this._buffer){
return this._buffer.duration;
} else {
return 0;
}
},
});
/**
* Reverse the buffer.
* @private
* @return {Tone.Buffer} this
*/
Tone.Buffer.prototype._reverse = function(){
if (this.loaded){
for (var i = 0; i < this._buffer.numberOfChannels; i++){
Array.prototype.reverse.call(this._buffer.getChannelData(i));
}
}
return this;
};
/**
* Reverse the buffer.
* @memberOf Tone.Buffer#
* @type {boolean}
* @name reverse
*/
Object.defineProperty(Tone.Buffer.prototype, "reverse", {
get : function(){
return this._reversed;
},
set : function(rev){
if (this._reversed !== rev){
this._reversed = rev;
this._reverse();
}
},
});
///////////////////////////////////////////////////////////////////////////
// STATIC METHODS
///////////////////////////////////////////////////////////////////////////
//statically inherits Emitter methods
Tone.Emitter.mixin(Tone.Buffer);
/**
* the static queue for all of the xhr requests
* @type {Array}
* @private
*/
Tone.Buffer._queue = [];
/**
* the array of current downloads
* @type {Array}
* @private
*/
Tone.Buffer._currentDownloads = [];
/**
* the total number of downloads
* @type {number}
* @private
*/
Tone.Buffer._totalDownloads = 0;
/**
* the maximum number of simultaneous downloads
* @static
* @type {number}
*/
Tone.Buffer.MAX_SIMULTANEOUS_DOWNLOADS = 6;
/**
* Adds a file to be loaded to the loading queue
* @param {string} url the url to load
* @param {function} callback the callback to invoke once it's loaded
* @private
*/
Tone.Buffer._addToQueue = function(url, buffer){
Tone.Buffer._queue.push({
url : url,
Buffer : buffer,
progress : 0,
xhr : null
});
this._totalDownloads++;
Tone.Buffer._next();
};
/**
* Remove an object from the queue's (if it's still there)
* Abort the XHR if it's in progress
* @param {Tone.Buffer} buffer the buffer to remove
* @private
*/
Tone.Buffer._removeFromQueue = function(buffer){
var i;
for (i = 0; i < Tone.Buffer._queue.length; i++){
var q = Tone.Buffer._queue[i];
if (q.Buffer === buffer){
Tone.Buffer._queue.splice(i, 1);
}
}
for (i = 0; i < Tone.Buffer._currentDownloads.length; i++){
var dl = Tone.Buffer._currentDownloads[i];
if (dl.Buffer === buffer){
Tone.Buffer._currentDownloads.splice(i, 1);
dl.xhr.abort();
dl.xhr.onprogress = null;
dl.xhr.onload = null;
dl.xhr.onerror = null;
}
}
};
/**
* load the next buffer in the queue
* @private
*/
Tone.Buffer._next = function(){
if (Tone.Buffer._queue.length > 0){
if (Tone.Buffer._currentDownloads.length < Tone.Buffer.MAX_SIMULTANEOUS_DOWNLOADS){
var next = Tone.Buffer._queue.shift();
Tone.Buffer._currentDownloads.push(next);
next.xhr = Tone.Buffer.load(next.url, function(buffer){
//remove this one from the queue
var index = Tone.Buffer._currentDownloads.indexOf(next);
Tone.Buffer._currentDownloads.splice(index, 1);
next.Buffer.set(buffer);
if (next.Buffer._reversed){
next.Buffer._reverse();
}
next.Buffer.onload(next.Buffer);
Tone.Buffer._onprogress();
Tone.Buffer._next();
});
next.xhr.onprogress = function(event){
next.progress = event.loaded / event.total;
Tone.Buffer._onprogress();
};
next.xhr.onerror = function(e){
Tone.Buffer.trigger("error", e);
};
}
} else if (Tone.Buffer._currentDownloads.length === 0){
Tone.Buffer.trigger("load");
//reset the downloads
Tone.Buffer._totalDownloads = 0;
}
};
/**
* internal progress event handler
* @private
*/
Tone.Buffer._onprogress = function(){
var curretDownloadsProgress = 0;
var currentDLLen = Tone.Buffer._currentDownloads.length;
var inprogress = 0;
if (currentDLLen > 0){
for (var i = 0; i < currentDLLen; i++){
var dl = Tone.Buffer._currentDownloads[i];
curretDownloadsProgress += dl.progress;
}
inprogress = curretDownloadsProgress;
}
var currentDownloadProgress = currentDLLen - inprogress;
var completed = Tone.Buffer._totalDownloads - Tone.Buffer._queue.length - currentDownloadProgress;
Tone.Buffer.trigger("progress", completed / Tone.Buffer._totalDownloads);
};
/**
* Makes an xhr reqest for the selected url then decodes
* the file as an audio buffer. Invokes
* the callback once the audio buffer loads.
* @param {string} url The url of the buffer to load.
* filetype support depends on the
* browser.
* @param {function} callback The function to invoke when the url is loaded.
* @returns {XMLHttpRequest} returns the XHR
*/
Tone.Buffer.load = function(url, callback){
var request = new XMLHttpRequest();
request.open("GET", url, true);
request.responseType = "arraybuffer";
// decode asynchronously
request.onload = function() {
Tone.context.decodeAudioData(request.response, function(buff) {
if(!buff){
throw new Error("could not decode audio data:" + url);
}
callback(buff);
});
};
//send the request
request.send();
return request;
};
/**
* @deprecated us on([event]) instead
*/
Object.defineProperty(Tone.Buffer, "onload", {
set : function(cb){
console.warn("Tone.Buffer.onload is deprecated, use Tone.Buffer.on('load', callback)");
Tone.Buffer.on("load", cb);
}
});
Object.defineProperty(Tone.Buffer, "onprogress", {
set : function(cb){
console.warn("Tone.Buffer.onprogress is deprecated, use Tone.Buffer.on('progress', callback)");
Tone.Buffer.on("progress", cb);
}
});
Object.defineProperty(Tone.Buffer, "onerror", {
set : function(cb){
console.warn("Tone.Buffer.onerror is deprecated, use Tone.Buffer.on('error', callback)");
Tone.Buffer.on("error", cb);
}
});
return Tone.Buffer;
});
|
pgotsis/world
|
pkg/clothing/jewelry.go
|
package clothing
import (
"context"
"fmt"
"github.com/ironarachne/world/pkg/random"
)
const jewelryError = "failed to generate jewelry: %w"
func generateJewelry(ctx context.Context) ([]string, error) {
var chanceOfAdornment int
var descriptor string
var err error
var jewelryItem string
var itemType string
var setting string
jewelry := []string{}
mainMaterials := []string{
"metal",
"hide",
"bone",
}
secondaryComponents := []string{
"gems",
"beads",
}
descriptors := []string{
"brilliant",
"entwined",
"gaudy",
"large",
"lustrous",
"ornate",
"simple",
"straight",
"thin",
"twisting",
}
itemTypes := []string{
"anklets",
"bracelets",
"chokers",
"necklaces",
"rings",
}
settings := []string{
"adorned with",
"decorated with",
"set with",
}
numberOfJewelryPieces := random.Intn(ctx, 4) + 1
primaryMaterial, err := random.String(ctx, mainMaterials)
if err != nil {
err = fmt.Errorf(jewelryError, err)
return []string{}, err
}
primaryComponent, err := random.String(ctx, secondaryComponents)
if err != nil {
err = fmt.Errorf(jewelryError, err)
return []string{}, err
}
for i := 0; i < numberOfJewelryPieces; i++ {
descriptor, err = random.String(ctx, descriptors)
if err != nil {
err = fmt.Errorf(jewelryError, err)
return []string{}, err
}
itemType, err = random.String(ctx, itemTypes)
if err != nil {
err = fmt.Errorf(jewelryError, err)
return []string{}, err
}
setting, err = random.String(ctx, settings)
if err != nil {
err = fmt.Errorf(jewelryError, err)
return []string{}, err
}
jewelryItem = descriptor + " " + primaryMaterial + " " + itemType
chanceOfAdornment = random.Intn(ctx, 100)
if chanceOfAdornment > 50 {
jewelryItem += " " + setting + " " + primaryComponent
}
jewelry = append(jewelry, jewelryItem)
}
return jewelry, nil
}
|
ganadist/r8
|
src/test/java/com/android/tools/r8/JavaCompilerTool.java
|
// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8;
import static com.android.tools.r8.ToolHelper.isWindows;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import com.android.tools.r8.TestRuntime.CfRuntime;
import com.android.tools.r8.ToolHelper.ProcessResult;
import com.android.tools.r8.utils.FileUtils;
import com.android.tools.r8.utils.ZipUtils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.rules.TemporaryFolder;
public class JavaCompilerTool {
private final CfRuntime jdk;
private final TestState state;
private final List<Path> sources = new ArrayList<>();
private final List<Path> classpath = new ArrayList<>();
private final List<String> options = new ArrayList<>();
private Path output = null;
private JavaCompilerTool(CfRuntime jdk, TestState state) {
this.jdk = jdk;
this.state = state;
}
public static JavaCompilerTool create(CfRuntime jdk, TemporaryFolder temp) {
assert temp != null;
return create(jdk, new TestState(temp));
}
public static JavaCompilerTool create(CfRuntime jdk, TestState state) {
assert state != null;
return new JavaCompilerTool(jdk, state);
}
public JavaCompilerTool addOptions(String... options) {
return addOptions(Arrays.asList(options));
}
public JavaCompilerTool addOptions(Collection<String> options) {
this.options.addAll(options);
return this;
}
public JavaCompilerTool addSourceFiles(Path... files) {
return addSourceFiles(Arrays.asList(files));
}
public JavaCompilerTool addSourceFiles(Collection<Path> files) {
sources.addAll(files);
return this;
}
public JavaCompilerTool addClasspathFiles(Path... files) {
return addClasspathFiles(Arrays.asList(files));
}
public JavaCompilerTool addClasspathFiles(Collection<Path> files) {
classpath.addAll(files);
return this;
}
/** Set the output. Must be to an existing directory or to an non-existing jar file. */
public JavaCompilerTool setOutputPath(Path file) {
assert (Files.exists(file) && Files.isDirectory(file))
|| (!Files.exists(file) && FileUtils.isJarFile(file) && Files.exists(file.getParent()));
this.output = file;
return this;
}
private Path getOrCreateOutputPath() throws IOException {
return output != null ? output : state.getNewTempFolder().resolve("out.jar");
}
/** Compile and return the compilations process result object. */
public ProcessResult compileRaw() throws IOException {
assertNotNull("An output path must be specified prior to compilation.", output);
return compileInternal(output);
}
/**
* Compile asserting success and return the path to the output file.
*
* <p>If no output file has been set, the output is compiled to a zip archive in a temporary
* directory.
*/
public Path compile() throws IOException {
Path output = getOrCreateOutputPath();
ProcessResult result = compileInternal(output);
assertEquals(result.toString(), result.exitCode, 0);
return output;
}
private ProcessResult compileInternal(Path output) throws IOException {
Path outdir = Files.isDirectory(output) ? output : state.getNewTempFolder();
List<String> cmdline = new ArrayList<>();
cmdline.add(jdk.getJavaExecutable() + "c");
cmdline.addAll(options);
if (!classpath.isEmpty()) {
cmdline.add("-cp");
cmdline.add(
classpath.stream()
.map(Path::toString)
.collect(Collectors.joining(isWindows() ? ";" : ":")));
}
cmdline.add("-d");
cmdline.add(outdir.toString());
for (Path source : sources) {
cmdline.add(source.toString());
}
ProcessBuilder builder = new ProcessBuilder(cmdline);
ProcessResult javacResult = ToolHelper.runProcess(builder);
if (FileUtils.isJarFile(output)) {
assert !outdir.equals(output);
ZipUtils.zip(output, outdir);
}
return javacResult;
}
}
|
adkateki/throneteki-sk
|
server/game/achievements/01-SoTFM/YouWillNeedABoat.js
|
<filename>server/game/achievements/01-SoTFM/YouWillNeedABoat.js<gh_stars>1-10
const Achievement = require('../../achievement.js');
class YouWillNeedABoat extends Achievement {
check(){
return this.owner.faction.name=="House Baratheon" &&this.owner.game.allCards.filter(card => card.owner === this.owner && card.hasTrait('Smuggler')).length>=10;
}
}
YouWillNeedABoat.code='00016';
module.exports = YouWillNeedABoat;
|
NunoEdgarGFlowHub/open-data-certificate
|
db/migrate/20140918143425_add_completed_to_certificate_generator.rb
|
class AddCompletedToCertificateGenerator < ActiveRecord::Migration
def change
add_column :certificate_generators, :completed, :boolean
end
end
|
Willowsap/CS5535-Vue
|
Chapter06/Exercise6.06/tests/unit/messageInfo.spec.js
|
<filename>Chapter06/Exercise6.06/tests/unit/messageInfo.spec.js
import { shallowMount } from '@vue/test-utils'
import MessageInfo from '@/views/MessageInfo.vue'
describe('Message.vue', () => {
it('renders component', () => {
const wrapper = shallowMount(MessageInfo, {
propsData: { message: { sent: '123'} },
})
expect(wrapper.find('p').text()).toBe('123');
expect(wrapper.find('h3').text()).toBe('Message info:');
})
})
|
BearerPipelineTest/gitlabhq
|
app/models/concerns/runners_token_prefixable.rb
|
<gh_stars>0
# frozen_string_literal: true
module RunnersTokenPrefixable
# Prefix for runners_token which can be used to invalidate existing tokens.
# The value chosen here is GR (for Gitlab Runner) combined with the rotation
# date (20220225) decimal to hex encoded.
RUNNERS_TOKEN_PREFIX = '<PASSWORD>'
end
|
chae-heechan/Programmers_Python_Algorithm_Study
|
Level2/printer.py
|
def solution(priorities, location):
answer = 0
count = 0
while True:
if len(priorities) == 0:
break
if priorities[0] == max(priorities):
count += 1
priorities.pop(0)
if location == 0:
return count
else:
location -= 1
else:
priorities.append(priorities.pop(0))
if location == 0:
location += len(priorities) - 1
else:
location -= 1
return answer
|
aggiechris/fleet
|
frontend/components/forms/RegistrationForm/KolideDetails/index.js
|
<gh_stars>0
export { default } from "./KolideDetails";
|
skjanyou/skjanyou-base
|
com.skjanyou.start/src/test/java/com/skjanyou/start/ApplicationStartTest.java
|
package com.skjanyou.start;
import com.skjanyou.start.anno.Configure;
import com.skjanyou.start.config.impl.PropertiesConfig;
import com.skjanyou.start.start.SkjanyouApplicationStart;
@Configure(
configManagerFactory = PropertiesConfig.class,
name = "测试配置props",
scanPath = "com.skjanyou.start"
)
public class ApplicationStartTest {
public static void main(String[] args) {
System.setProperty("skjanyou.configfile", "classpath:skjanyou.config.properties");
SkjanyouApplicationStart.start(ApplicationStartTest.class,args);
}
}
|
MC-JY/aws-sdk-java
|
aws-java-sdk-lookoutmetrics/src/main/java/com/amazonaws/services/lookoutmetrics/AmazonLookoutMetricsAsync.java
|
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.lookoutmetrics;
import javax.annotation.Generated;
import com.amazonaws.services.lookoutmetrics.model.*;
/**
* Interface for accessing LookoutMetrics asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
* <p>
* <b>Note:</b> Do not directly implement this interface, new methods are added to it regularly. Extend from
* {@link com.amazonaws.services.lookoutmetrics.AbstractAmazonLookoutMetricsAsync} instead.
* </p>
* <p>
* <p>
* This is the <i>Amazon Lookout for Metrics API Reference</i>. For an introduction to the service with tutorials for
* getting started, visit <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev">Amazon Lookout for Metrics
* Developer Guide</a>.
* </p>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface AmazonLookoutMetricsAsync extends AmazonLookoutMetrics {
/**
* <p>
* Activates an anomaly detector.
* </p>
*
* @param activateAnomalyDetectorRequest
* @return A Java Future containing the result of the ActivateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ActivateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ActivateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ActivateAnomalyDetectorResult> activateAnomalyDetectorAsync(ActivateAnomalyDetectorRequest activateAnomalyDetectorRequest);
/**
* <p>
* Activates an anomaly detector.
* </p>
*
* @param activateAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ActivateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ActivateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ActivateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ActivateAnomalyDetectorResult> activateAnomalyDetectorAsync(ActivateAnomalyDetectorRequest activateAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<ActivateAnomalyDetectorRequest, ActivateAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Runs a backtest for anomaly detection for the specified resource.
* </p>
*
* @param backTestAnomalyDetectorRequest
* @return A Java Future containing the result of the BackTestAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.BackTestAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/BackTestAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<BackTestAnomalyDetectorResult> backTestAnomalyDetectorAsync(BackTestAnomalyDetectorRequest backTestAnomalyDetectorRequest);
/**
* <p>
* Runs a backtest for anomaly detection for the specified resource.
* </p>
*
* @param backTestAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the BackTestAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.BackTestAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/BackTestAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<BackTestAnomalyDetectorResult> backTestAnomalyDetectorAsync(BackTestAnomalyDetectorRequest backTestAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<BackTestAnomalyDetectorRequest, BackTestAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Creates an alert for an anomaly detector.
* </p>
*
* @param createAlertRequest
* @return A Java Future containing the result of the CreateAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsync.CreateAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateAlert" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateAlertResult> createAlertAsync(CreateAlertRequest createAlertRequest);
/**
* <p>
* Creates an alert for an anomaly detector.
* </p>
*
* @param createAlertRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.CreateAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateAlert" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateAlertResult> createAlertAsync(CreateAlertRequest createAlertRequest,
com.amazonaws.handlers.AsyncHandler<CreateAlertRequest, CreateAlertResult> asyncHandler);
/**
* <p>
* Creates an anomaly detector.
* </p>
*
* @param createAnomalyDetectorRequest
* @return A Java Future containing the result of the CreateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.CreateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<CreateAnomalyDetectorResult> createAnomalyDetectorAsync(CreateAnomalyDetectorRequest createAnomalyDetectorRequest);
/**
* <p>
* Creates an anomaly detector.
* </p>
*
* @param createAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.CreateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<CreateAnomalyDetectorResult> createAnomalyDetectorAsync(CreateAnomalyDetectorRequest createAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<CreateAnomalyDetectorRequest, CreateAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Creates a dataset.
* </p>
*
* @param createMetricSetRequest
* @return A Java Future containing the result of the CreateMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsync.CreateMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateMetricSet" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<CreateMetricSetResult> createMetricSetAsync(CreateMetricSetRequest createMetricSetRequest);
/**
* <p>
* Creates a dataset.
* </p>
*
* @param createMetricSetRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.CreateMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/CreateMetricSet" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<CreateMetricSetResult> createMetricSetAsync(CreateMetricSetRequest createMetricSetRequest,
com.amazonaws.handlers.AsyncHandler<CreateMetricSetRequest, CreateMetricSetResult> asyncHandler);
/**
* <p>
* Deletes an alert.
* </p>
*
* @param deleteAlertRequest
* @return A Java Future containing the result of the DeleteAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsync.DeleteAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DeleteAlert" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<DeleteAlertResult> deleteAlertAsync(DeleteAlertRequest deleteAlertRequest);
/**
* <p>
* Deletes an alert.
* </p>
*
* @param deleteAlertRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DeleteAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.DeleteAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DeleteAlert" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<DeleteAlertResult> deleteAlertAsync(DeleteAlertRequest deleteAlertRequest,
com.amazonaws.handlers.AsyncHandler<DeleteAlertRequest, DeleteAlertResult> asyncHandler);
/**
* <p>
* Deletes a detector. Deleting an anomaly detector will delete all of its corresponding resources including any
* configured datasets and alerts.
* </p>
*
* @param deleteAnomalyDetectorRequest
* @return A Java Future containing the result of the DeleteAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.DeleteAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DeleteAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DeleteAnomalyDetectorResult> deleteAnomalyDetectorAsync(DeleteAnomalyDetectorRequest deleteAnomalyDetectorRequest);
/**
* <p>
* Deletes a detector. Deleting an anomaly detector will delete all of its corresponding resources including any
* configured datasets and alerts.
* </p>
*
* @param deleteAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DeleteAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.DeleteAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DeleteAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DeleteAnomalyDetectorResult> deleteAnomalyDetectorAsync(DeleteAnomalyDetectorRequest deleteAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<DeleteAnomalyDetectorRequest, DeleteAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Describes an alert.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeAlertRequest
* @return A Java Future containing the result of the DescribeAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsync.DescribeAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAlert" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<DescribeAlertResult> describeAlertAsync(DescribeAlertRequest describeAlertRequest);
/**
* <p>
* Describes an alert.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeAlertRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DescribeAlert operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.DescribeAlert
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAlert" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<DescribeAlertResult> describeAlertAsync(DescribeAlertRequest describeAlertRequest,
com.amazonaws.handlers.AsyncHandler<DescribeAlertRequest, DescribeAlertResult> asyncHandler);
/**
* <p>
* Returns information about the status of the specified anomaly detection jobs.
* </p>
*
* @param describeAnomalyDetectionExecutionsRequest
* @return A Java Future containing the result of the DescribeAnomalyDetectionExecutions operation returned by the
* service.
* @sample AmazonLookoutMetricsAsync.DescribeAnomalyDetectionExecutions
* @see <a
* href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAnomalyDetectionExecutions"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeAnomalyDetectionExecutionsResult> describeAnomalyDetectionExecutionsAsync(
DescribeAnomalyDetectionExecutionsRequest describeAnomalyDetectionExecutionsRequest);
/**
* <p>
* Returns information about the status of the specified anomaly detection jobs.
* </p>
*
* @param describeAnomalyDetectionExecutionsRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DescribeAnomalyDetectionExecutions operation returned by the
* service.
* @sample AmazonLookoutMetricsAsyncHandler.DescribeAnomalyDetectionExecutions
* @see <a
* href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAnomalyDetectionExecutions"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeAnomalyDetectionExecutionsResult> describeAnomalyDetectionExecutionsAsync(
DescribeAnomalyDetectionExecutionsRequest describeAnomalyDetectionExecutionsRequest,
com.amazonaws.handlers.AsyncHandler<DescribeAnomalyDetectionExecutionsRequest, DescribeAnomalyDetectionExecutionsResult> asyncHandler);
/**
* <p>
* Describes a detector.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeAnomalyDetectorRequest
* @return A Java Future containing the result of the DescribeAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.DescribeAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeAnomalyDetectorResult> describeAnomalyDetectorAsync(DescribeAnomalyDetectorRequest describeAnomalyDetectorRequest);
/**
* <p>
* Describes a detector.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DescribeAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.DescribeAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeAnomalyDetectorResult> describeAnomalyDetectorAsync(DescribeAnomalyDetectorRequest describeAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<DescribeAnomalyDetectorRequest, DescribeAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Describes a dataset.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeMetricSetRequest
* @return A Java Future containing the result of the DescribeMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsync.DescribeMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeMetricSet"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeMetricSetResult> describeMetricSetAsync(DescribeMetricSetRequest describeMetricSetRequest);
/**
* <p>
* Describes a dataset.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param describeMetricSetRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DescribeMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.DescribeMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/DescribeMetricSet"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<DescribeMetricSetResult> describeMetricSetAsync(DescribeMetricSetRequest describeMetricSetRequest,
com.amazonaws.handlers.AsyncHandler<DescribeMetricSetRequest, DescribeMetricSetResult> asyncHandler);
/**
* <p>
* Returns details about a group of anomalous metrics.
* </p>
*
* @param getAnomalyGroupRequest
* @return A Java Future containing the result of the GetAnomalyGroup operation returned by the service.
* @sample AmazonLookoutMetricsAsync.GetAnomalyGroup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetAnomalyGroup" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<GetAnomalyGroupResult> getAnomalyGroupAsync(GetAnomalyGroupRequest getAnomalyGroupRequest);
/**
* <p>
* Returns details about a group of anomalous metrics.
* </p>
*
* @param getAnomalyGroupRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the GetAnomalyGroup operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.GetAnomalyGroup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetAnomalyGroup" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<GetAnomalyGroupResult> getAnomalyGroupAsync(GetAnomalyGroupRequest getAnomalyGroupRequest,
com.amazonaws.handlers.AsyncHandler<GetAnomalyGroupRequest, GetAnomalyGroupResult> asyncHandler);
/**
* <p>
* Get feedback for an anomaly group.
* </p>
*
* @param getFeedbackRequest
* @return A Java Future containing the result of the GetFeedback operation returned by the service.
* @sample AmazonLookoutMetricsAsync.GetFeedback
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetFeedback" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<GetFeedbackResult> getFeedbackAsync(GetFeedbackRequest getFeedbackRequest);
/**
* <p>
* Get feedback for an anomaly group.
* </p>
*
* @param getFeedbackRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the GetFeedback operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.GetFeedback
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetFeedback" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<GetFeedbackResult> getFeedbackAsync(GetFeedbackRequest getFeedbackRequest,
com.amazonaws.handlers.AsyncHandler<GetFeedbackRequest, GetFeedbackResult> asyncHandler);
/**
* <p>
* Returns a selection of sample records from an Amazon S3 datasource.
* </p>
*
* @param getSampleDataRequest
* @return A Java Future containing the result of the GetSampleData operation returned by the service.
* @sample AmazonLookoutMetricsAsync.GetSampleData
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetSampleData" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<GetSampleDataResult> getSampleDataAsync(GetSampleDataRequest getSampleDataRequest);
/**
* <p>
* Returns a selection of sample records from an Amazon S3 datasource.
* </p>
*
* @param getSampleDataRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the GetSampleData operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.GetSampleData
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/GetSampleData" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<GetSampleDataResult> getSampleDataAsync(GetSampleDataRequest getSampleDataRequest,
com.amazonaws.handlers.AsyncHandler<GetSampleDataRequest, GetSampleDataResult> asyncHandler);
/**
* <p>
* Lists the alerts attached to a detector.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listAlertsRequest
* @return A Java Future containing the result of the ListAlerts operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListAlerts
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAlerts" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<ListAlertsResult> listAlertsAsync(ListAlertsRequest listAlertsRequest);
/**
* <p>
* Lists the alerts attached to a detector.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listAlertsRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListAlerts operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListAlerts
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAlerts" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<ListAlertsResult> listAlertsAsync(ListAlertsRequest listAlertsRequest,
com.amazonaws.handlers.AsyncHandler<ListAlertsRequest, ListAlertsResult> asyncHandler);
/**
* <p>
* Lists the detectors in the current AWS Region.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listAnomalyDetectorsRequest
* @return A Java Future containing the result of the ListAnomalyDetectors operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListAnomalyDetectors
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyDetectors"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyDetectorsResult> listAnomalyDetectorsAsync(ListAnomalyDetectorsRequest listAnomalyDetectorsRequest);
/**
* <p>
* Lists the detectors in the current AWS Region.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listAnomalyDetectorsRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListAnomalyDetectors operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListAnomalyDetectors
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyDetectors"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyDetectorsResult> listAnomalyDetectorsAsync(ListAnomalyDetectorsRequest listAnomalyDetectorsRequest,
com.amazonaws.handlers.AsyncHandler<ListAnomalyDetectorsRequest, ListAnomalyDetectorsResult> asyncHandler);
/**
* <p>
* Returns a list of anomaly groups.
* </p>
*
* @param listAnomalyGroupSummariesRequest
* @return A Java Future containing the result of the ListAnomalyGroupSummaries operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListAnomalyGroupSummaries
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyGroupSummaries"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyGroupSummariesResult> listAnomalyGroupSummariesAsync(
ListAnomalyGroupSummariesRequest listAnomalyGroupSummariesRequest);
/**
* <p>
* Returns a list of anomaly groups.
* </p>
*
* @param listAnomalyGroupSummariesRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListAnomalyGroupSummaries operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListAnomalyGroupSummaries
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyGroupSummaries"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyGroupSummariesResult> listAnomalyGroupSummariesAsync(
ListAnomalyGroupSummariesRequest listAnomalyGroupSummariesRequest,
com.amazonaws.handlers.AsyncHandler<ListAnomalyGroupSummariesRequest, ListAnomalyGroupSummariesResult> asyncHandler);
/**
* <p>
* Gets a list of anomalous metrics for a measure in an anomaly group.
* </p>
*
* @param listAnomalyGroupTimeSeriesRequest
* @return A Java Future containing the result of the ListAnomalyGroupTimeSeries operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListAnomalyGroupTimeSeries
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyGroupTimeSeries"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyGroupTimeSeriesResult> listAnomalyGroupTimeSeriesAsync(
ListAnomalyGroupTimeSeriesRequest listAnomalyGroupTimeSeriesRequest);
/**
* <p>
* Gets a list of anomalous metrics for a measure in an anomaly group.
* </p>
*
* @param listAnomalyGroupTimeSeriesRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListAnomalyGroupTimeSeries operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListAnomalyGroupTimeSeries
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListAnomalyGroupTimeSeries"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListAnomalyGroupTimeSeriesResult> listAnomalyGroupTimeSeriesAsync(
ListAnomalyGroupTimeSeriesRequest listAnomalyGroupTimeSeriesRequest,
com.amazonaws.handlers.AsyncHandler<ListAnomalyGroupTimeSeriesRequest, ListAnomalyGroupTimeSeriesResult> asyncHandler);
/**
* <p>
* Lists the datasets in the current AWS Region.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listMetricSetsRequest
* @return A Java Future containing the result of the ListMetricSets operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListMetricSets
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListMetricSets" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<ListMetricSetsResult> listMetricSetsAsync(ListMetricSetsRequest listMetricSetsRequest);
/**
* <p>
* Lists the datasets in the current AWS Region.
* </p>
* <p>
* Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource
* immediately after creating or modifying it, use retries to allow time for the write operation to complete.
* </p>
*
* @param listMetricSetsRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListMetricSets operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListMetricSets
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListMetricSets" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<ListMetricSetsResult> listMetricSetsAsync(ListMetricSetsRequest listMetricSetsRequest,
com.amazonaws.handlers.AsyncHandler<ListMetricSetsRequest, ListMetricSetsResult> asyncHandler);
/**
* <p>
* Gets a list of <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> for a
* detector, dataset, or alert.
* </p>
*
* @param listTagsForResourceRequest
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* @sample AmazonLookoutMetricsAsync.ListTagsForResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListTagsForResource"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(ListTagsForResourceRequest listTagsForResourceRequest);
/**
* <p>
* Gets a list of <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> for a
* detector, dataset, or alert.
* </p>
*
* @param listTagsForResourceRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.ListTagsForResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/ListTagsForResource"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(ListTagsForResourceRequest listTagsForResourceRequest,
com.amazonaws.handlers.AsyncHandler<ListTagsForResourceRequest, ListTagsForResourceResult> asyncHandler);
/**
* <p>
* Add feedback for an anomalous metric.
* </p>
*
* @param putFeedbackRequest
* @return A Java Future containing the result of the PutFeedback operation returned by the service.
* @sample AmazonLookoutMetricsAsync.PutFeedback
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/PutFeedback" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<PutFeedbackResult> putFeedbackAsync(PutFeedbackRequest putFeedbackRequest);
/**
* <p>
* Add feedback for an anomalous metric.
* </p>
*
* @param putFeedbackRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the PutFeedback operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.PutFeedback
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/PutFeedback" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<PutFeedbackResult> putFeedbackAsync(PutFeedbackRequest putFeedbackRequest,
com.amazonaws.handlers.AsyncHandler<PutFeedbackRequest, PutFeedbackResult> asyncHandler);
/**
* <p>
* Adds <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> to a detector,
* dataset, or alert.
* </p>
*
* @param tagResourceRequest
* @return A Java Future containing the result of the TagResource operation returned by the service.
* @sample AmazonLookoutMetricsAsync.TagResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/TagResource" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<TagResourceResult> tagResourceAsync(TagResourceRequest tagResourceRequest);
/**
* <p>
* Adds <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> to a detector,
* dataset, or alert.
* </p>
*
* @param tagResourceRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the TagResource operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.TagResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/TagResource" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<TagResourceResult> tagResourceAsync(TagResourceRequest tagResourceRequest,
com.amazonaws.handlers.AsyncHandler<TagResourceRequest, TagResourceResult> asyncHandler);
/**
* <p>
* Removes <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> from a
* detector, dataset, or alert.
* </p>
*
* @param untagResourceRequest
* @return A Java Future containing the result of the UntagResource operation returned by the service.
* @sample AmazonLookoutMetricsAsync.UntagResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UntagResource" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest untagResourceRequest);
/**
* <p>
* Removes <a href="https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html">tags</a> from a
* detector, dataset, or alert.
* </p>
*
* @param untagResourceRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the UntagResource operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.UntagResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UntagResource" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest untagResourceRequest,
com.amazonaws.handlers.AsyncHandler<UntagResourceRequest, UntagResourceResult> asyncHandler);
/**
* <p>
* Updates a detector. After activation, you can only change a detector's ingestion delay and description.
* </p>
*
* @param updateAnomalyDetectorRequest
* @return A Java Future containing the result of the UpdateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsync.UpdateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UpdateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<UpdateAnomalyDetectorResult> updateAnomalyDetectorAsync(UpdateAnomalyDetectorRequest updateAnomalyDetectorRequest);
/**
* <p>
* Updates a detector. After activation, you can only change a detector's ingestion delay and description.
* </p>
*
* @param updateAnomalyDetectorRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the UpdateAnomalyDetector operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.UpdateAnomalyDetector
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UpdateAnomalyDetector"
* target="_top">AWS API Documentation</a>
*/
java.util.concurrent.Future<UpdateAnomalyDetectorResult> updateAnomalyDetectorAsync(UpdateAnomalyDetectorRequest updateAnomalyDetectorRequest,
com.amazonaws.handlers.AsyncHandler<UpdateAnomalyDetectorRequest, UpdateAnomalyDetectorResult> asyncHandler);
/**
* <p>
* Updates a dataset.
* </p>
*
* @param updateMetricSetRequest
* @return A Java Future containing the result of the UpdateMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsync.UpdateMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UpdateMetricSet" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<UpdateMetricSetResult> updateMetricSetAsync(UpdateMetricSetRequest updateMetricSetRequest);
/**
* <p>
* Updates a dataset.
* </p>
*
* @param updateMetricSetRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the UpdateMetricSet operation returned by the service.
* @sample AmazonLookoutMetricsAsyncHandler.UpdateMetricSet
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lookoutmetrics-2017-07-25/UpdateMetricSet" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<UpdateMetricSetResult> updateMetricSetAsync(UpdateMetricSetRequest updateMetricSetRequest,
com.amazonaws.handlers.AsyncHandler<UpdateMetricSetRequest, UpdateMetricSetResult> asyncHandler);
}
|
thebrubaker/colony
|
game/needs/controller.go
|
package needs
import (
"errors"
"math"
"github.com/thebrubaker/colony/keys"
)
type needType string
// Constants for each need type
const (
Rest needType = "Rest"
Food needType = "Food"
Water needType = "Water"
Security needType = "Security"
Belonging needType = "Belonging"
Fulfillment needType = "Fulfillment"
Power needType = "Power"
Joy needType = "Joy"
Wealth needType = "Wealth"
Status needType = "Status"
)
// Controller manages all of the colonist needs within the same game tick world.
type Controller struct {
state map[keys.ColonistKey]map[needType]*need
actionc chan func()
quitc chan struct{}
}
// NewController returns a controller for managing all changes to
// colonist needs within the same game tick world.
func NewController(k keys.ColonistKey) *Controller {
nc := &Controller{
actionc: make(chan func()),
quitc: make(chan struct{}),
}
go nc.start()
return nc
}
func (nc *Controller) start() {
for {
select {
case f := <-nc.actionc:
f()
case <-nc.quitc:
return
}
}
}
func (nc *Controller) update(tickElapsed float64) {
c := make(chan struct{})
nc.actionc <- func() {
var size int
for _, needs := range nc.state {
for range needs {
size++
}
}
d := make(chan bool, size)
for _, needs := range nc.state {
for _, n := range needs {
go func(n *need) {
n.update(tickElapsed)
d <- true
}(n)
}
}
for i := 0; i < size; i++ {
<-d
}
close(c)
}
<-c
}
// Stop will shut down all colonist needs and then close the controller loop.
func (nc *Controller) Stop() {
c := make(chan struct{})
nc.actionc <- func() {
var size int
for _, needs := range nc.state {
for range needs {
size++
}
}
d := make(chan bool, size)
for _, needs := range nc.state {
for _, n := range needs {
go func(n *need) {
n.stop()
d <- true
}(n)
}
}
for i := 0; i < size; i++ {
<-d
}
close(c)
}
<-c
close(nc.quitc)
}
// NewColonist registers a new set of colonist needs with the controller
func (nc *Controller) NewColonist(k keys.ColonistKey) {
c := make(chan struct{})
nc.actionc <- func() {
nc.state[k] = map[needType]*need{
Rest: newNeed(50, -0.1),
Food: newNeed(50, -0.1),
Water: newNeed(50, -0.1),
Security: newNeed(50, -0.1),
Belonging: newNeed(50, -0.1),
Fulfillment: newNeed(50, -0.1),
Power: newNeed(50, -0.1),
Joy: newNeed(50, -0.1),
Wealth: newNeed(50, -0.1),
Status: newNeed(50, -0.1),
}
close(c)
}
<-c
}
// GetValue returns the current value for the given colonist and need type.
func (nc *Controller) GetValue(k keys.ColonistKey, t needType) float64 {
c := make(chan float64)
nc.actionc <- func() {
n := nc.state[k][t]
c <- n.getValue()
}
return <-c
}
// Adjust alters the given colonist key and need type by the given adjustment value (+/-). Adjustments
// are capped by any ceilings or floors active on the given need.
func (nc *Controller) Adjust(k keys.ColonistKey, t needType, adjustment float64) float64 {
c := make(chan float64)
nc.actionc <- func() {
n := nc.state[k][t]
n.setValue(n.getValue() + adjustment)
c <- n.getValue()
}
return <-c
}
// Rate applies a given rate value for an optional duration to the given colonist and need type. A rate is applied
// per tick. All active rates are applied per tick, meaning if one rate is supposed to increase the need by +10
// per tick, and another is to decrease it by -1, the resulting adjustment will be +9 per tick.
func (nc *Controller) Rate(k keys.ColonistKey, t needType, rate float64, duration float64) (cancel func()) {
c := make(chan func())
nc.actionc <- func() {
n := nc.state[k][t]
c <- n.addRate(rate, duration)
}
return <-c
}
// Target applies a given target value over a required duration (greater than 0) to the need, progressing the need toward
// that target over the duration. Targets are also capped by active floors and ceilings on the need.
func (nc *Controller) Target(k keys.ColonistKey, t needType, target float64, duration float64) (cancel func(), err error) {
if duration <= 0 {
return nil, errors.New("duration for a target must be greater than zero")
}
c := make(chan func())
nc.actionc <- func() {
n := nc.state[k][t]
c <- n.addTarget(target, duration)
}
return <-c, nil
}
// Ceiling applies a given ceiling value to the given colonist and need type which caps how high the need can be set. If
// there is more than one active ceiling, the lowest ceiling will be applied.
func (nc *Controller) Ceiling(k keys.ColonistKey, t needType, ceiling float64, duration float64) (cancel func()) {
c := make(chan func())
nc.actionc <- func() {
n := nc.state[k][t]
c <- n.addCeiling(ceiling, duration)
}
return <-c
}
// Floor applies a given floor value to the given colonist and need type which limits how low the need can be set. If
// there is more than one active floor, the highest floor will be applied.
func (nc *Controller) Floor(k keys.ColonistKey, t needType, floor float64, duration float64) (cancel func()) {
c := make(chan func())
nc.actionc <- func() {
n := nc.state[k][t]
c <- n.addFloor(floor, duration)
}
return <-c
}
type need struct {
state *needState
actionc chan func()
quitc chan struct{}
}
type needState struct {
value float64
baseRate float64
rates []*expiringValue
ceilings []*expiringValue
floors []*expiringValue
}
type expiringValue struct {
value float64
duration float64
elapsed float64
}
func newNeed(startingValue float64, baseRate float64) *need {
n := &need{
state: &needState{
value: startingValue,
baseRate: baseRate,
},
actionc: make(chan func()),
quitc: make(chan struct{}),
}
go n.start()
return n
}
func (n *need) start() {
for {
select {
case f := <-n.actionc:
f()
case <-n.quitc:
return
}
}
}
func (n *need) stop() {
close(n.quitc)
}
// update processes how the need should be adjusted for the amount of tick time
// that has elapsed. Various rates, ceilings and floors may expire.
func (n *need) update(tickElapsed float64) {
c := make(chan struct{})
n.actionc <- func() {
n.state.rates = updateExpiringValues(n.state.rates, tickElapsed)
n.state.ceilings = updateExpiringValues(n.state.ceilings, tickElapsed)
n.state.floors = updateExpiringValues(n.state.floors, tickElapsed)
adjustment := (n.state.baseRate + sumExpiringValues(n.state.rates)) * tickElapsed
ceiling := minExpiringValue(n.state.ceilings)
floor := maxExpiringValue(n.state.floors)
n.state.value = math.Min(ceiling, math.Max(floor, n.state.value+adjustment))
close(c)
}
<-c
}
// addTarget adds a new target for a given duration and returns a cancel callback to remove the target.
func (n *need) addTarget(target float64, duration float64) (cancel func()) {
c := make(chan func())
n.actionc <- func() {
// convert target to rate
r := (n.state.value - target) / duration
v := &expiringValue{
value: r,
duration: duration,
}
cancel := func() {
n.removeRate(v)
}
// add rate
n.state.rates = append(n.state.rates, v)
c <- cancel
}
return <-c
}
// addRate adds a new rate for a given duration and returns a cancel callback to remove the rate.
func (n *need) addRate(r float64, duration float64) (cancel func()) {
c := make(chan func())
n.actionc <- func() {
// convert target to rate
v := &expiringValue{
value: r,
duration: duration,
}
cancel := func() {
n.removeRate(v)
}
// add rate
n.state.rates = append(n.state.rates, v)
c <- cancel
}
return <-c
}
func (n *need) removeRate(v *expiringValue) {
c := make(chan struct{})
n.actionc <- func() {
n.state.rates = removeExpiringValue(n.state.rates, v)
close(c)
}
<-c
}
// addCeiling adds a new ceiling for an optional duration and returns a cancel callback to remove the ceiling.
func (n *need) addCeiling(ceiling float64, duration float64) (cancel func()) {
c := make(chan func())
n.actionc <- func() {
// convert target to rate
v := &expiringValue{
value: ceiling,
duration: duration,
}
cancel := func() {
n.removeCeiling(v)
}
n.state.ceilings = append(n.state.ceilings, v)
c <- cancel
}
return <-c
}
func (n *need) removeCeiling(v *expiringValue) {
c := make(chan struct{})
n.actionc <- func() {
n.state.ceilings = removeExpiringValue(n.state.ceilings, v)
close(c)
}
<-c
}
// addFloor adds a new floor for an optional duration and returns a cancel callback to remove the floor.
func (n *need) addFloor(floor float64, duration float64) (cancel func()) {
c := make(chan func())
n.actionc <- func() {
// convert target to rate
v := &expiringValue{
value: floor,
duration: duration,
}
cancel := func() {
n.removeFloor(v)
}
n.state.floors = append(n.state.floors, v)
c <- cancel
}
return <-c
}
func (n *need) removeFloor(v *expiringValue) {
c := make(chan struct{})
n.actionc <- func() {
n.state.floors = removeExpiringValue(n.state.floors, v)
close(c)
}
<-c
}
// getValue returns the current value of the need.
func (n *need) getValue() float64 {
c := make(chan float64)
n.actionc <- func() {
c <- n.state.value
}
return <-c
}
// setValue sets the value of the need within a set ceiling and floor
func (n *need) setValue(v float64) {
c := make(chan struct{})
n.actionc <- func() {
ceiling := minExpiringValue(n.state.ceilings)
floor := maxExpiringValue(n.state.floors)
n.state.value = math.Min(ceiling, math.Max(floor, v))
close(c)
}
<-c
}
func sumExpiringValues(values []*expiringValue) float64 {
var sum float64
for _, v := range values {
sum += v.value
}
return sum
}
// Returns the floor of this need (the need cannot go any lower than this value)
// If there is more than one floor, this method returns the highest floor.
func maxExpiringValue(values []*expiringValue) float64 {
max := float64(0)
for _, v := range values {
if v.value > max {
max = v.value
}
}
return max
}
// Returns the ceiling of this need (the need cannot go any higher than this value)
// If there is more than one ceiling, this method returns the lowest ceiling.
// A default value of 100 is returned which is the default ceiling for all expiring values
func minExpiringValue(values []*expiringValue) float64 {
min := float64(100)
for _, v := range values {
if v.value < min {
min = v.value
}
}
return min
}
func updateExpiringValues(values []*expiringValue, tickElapsed float64) []*expiringValue {
var nonExpiredValues []*expiringValue
for i, v := range values {
if v.duration == 0 || v.elapsed < v.duration {
v.elapsed += tickElapsed
nonExpiredValues[i] = v
}
}
return nonExpiredValues
}
func removeExpiringValue(values []*expiringValue, targetValue *expiringValue) []*expiringValue {
for i, v := range values {
if v == targetValue {
values[i] = values[len(values)-1]
values[len(values)-1] = v
values = values[:len(values)-1]
}
}
return values
}
|
chenying-wang/usc-ee-coursework-public
|
ee450/project/common/logger.h
|
#include <iostream>
#include <string>
#include <chrono>
#include <pthread.h>
#ifndef __EE450_LOGGER
#define __EE450_LOGGER
class Logger {
private:
const static std::string ERROR;
const static std::string INFO;
const static std::string DEBUG;
const static std::chrono::time_point<std::chrono::high_resolution_clock> start;
static pthread_mutex_t mtx;
Logger();
virtual ~Logger();
static std::string format(const std::string &msg, const std::string &level);
public:
static void init();
static void error(const std::string &msg);
static void info(const std::string &msg);
static void debug(const std::string &msg);
};
#endif
|
115vidit/C133-Java
|
Main.java
|
<filename>Main.java<gh_stars>1-10
import java.util.Arrays;
public class Main {
static String[] argv;
Main(String[] abc) {
argv = abc;
}
// Utility function
public static void main() {
System.out.println("Fake main");
System.out.println(Arrays.toString(argv));
}
// Driver function
public static void main(String... args) {
System.out.println("And.I.am.main");
// main(new String[] { "" });
Main obj = new Main(new String[] { "a", "b", "c", "d" });
Main.main();
}
}
|
JaDogg/__py_playground
|
reference/TPG-3.2.2/tpg_tests_py2.py
|
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
import unittest
import tpg
print("*"*70)
print("*")
print("* Unit tests for %(__name__)s %(__version__)s (%(__date__)s)"%tpg.__dict__)
print("*")
print("* Platform : %s"%sys.platform.replace('\n', ' '))
print("* Version : %s"%sys.version.replace('\n', ' '))
print("*")
print("* Please report bug to %(__author__)s (%(__email__)s)"%tpg.__dict__)
print("* for further detail read %(__url__)s"%tpg.__dict__)
print("*")
print("*"*70)
for PARSER, VERBOSE in ( (tpg.Parser, None),
(tpg.VerboseParser, 0),
(tpg.VerboseParser, 1),
(tpg.VerboseParser, 2),
):
for LEXER in tpg.TPGParser.Options.option_dict['lexer'][0]:
print("*"*70)
if VERBOSE is None:
print("* %s %s"%(PARSER.__name__, LEXER))
else:
print("* %s verbose=%s %s"%(PARSER.__name__, VERBOSE, LEXER))
print("*"*70)
class UnicodeTestCase(unittest.TestCase):
class Parser(PARSER):
__doc__ = ur"""
set lexer = %(LEXER)s
set lexer_unicode = True
token single_quote '[‘’]' ;
token double_quote '["“”]' ;
token word '\w+' ;
START/x -> double_quote word/x double_quote
| single_quote word/x single_quote
| '`' word/x '´'
;
"""%tpg.Py()
def testExpr(self):
p = self.Parser()
self.assertEquals(p(u'"woah"'), "woah")
self.assertEquals(p(u"“woah”"), "woah")
self.assertEquals(p(u"‘woah’"), "woah")
self.assertEquals(p(u"`woah´"), "woah")
try:
unittest.main()
except SystemExit:
if tpg.exc().args[0]:
raise
|
ccetc/mahaplatform.com
|
src/apps/maha/services/versions/update_version.js
|
import Version from '@apps/maha/models/version'
import moment from 'moment'
const getVersion = async (req, { versionable_type, versionable_id, key }) => {
const version = await Version.query(qb => {
qb.where('versionable_type', versionable_type)
qb.where('versionable_id', versionable_id)
qb.where('key', key)
qb.orderBy('created_at', 'desc')
}).fetch({
transacting: req.trx
})
if(version && !version.get('is_published')) return version
return await Version.forge({
team_id: req.team.get('id'),
versionable_type,
versionable_id,
user_id: req.user.get('id'),
key,
published_at: null,
unpublished_at: null
}).save(null, {
transacting: req.trx
})
}
const publishVersion = async (req, { version }) => {
await version.save({
published_at: moment()
}, {
transacting: req.trx,
patch: true
})
const oldversions = await Version.query(qb => {
qb.where('versionable_type', version.get('versionable_type'))
qb.where('versionable_id', version.get('versionable_id'))
qb.where('key', version.get('key'))
qb.whereNotNull('published_at')
qb.whereNull('unpublished_at')
qb.whereNot('id', version.get('id'))
}).fetchAll({
transacting: req.trx
})
await Promise.map(oldversions, async (oldversion) => {
await oldversion.save({
unpublished_at: moment()
}, {
transacting: req.trx,
patch: true
})
})
}
const updateVersion = async (req, params) => {
const { versionable_type, versionable_id, key, value, publish } = params
const version = await getVersion(req, {
versionable_type,
versionable_id,
value,
key
})
await version.save({
user_id: req.user.get('id'),
value
}, {
transacting: req.trx,
patch: true
})
if(publish) {
await publishVersion(req, {
version
})
}
await version.load(['user'], {
transacting: req.trx
})
return version
}
export default updateVersion
|
randolphwong/mcsema
|
boost/libs/math/example/policy_ref_snip9.cpp
|
// Copyright <NAME> 2007.
// Copyright <NAME> 2010
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Note that this file contains quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
#include <iostream>
using std::cout; using std::endl;
//[policy_ref_snip9
#include <boost/math/special_functions/gamma.hpp>
using boost::math::tgamma;
using boost::math::policies::policy;
using boost::math::policies::digits10;
typedef policy<digits10<5> > my_pol_5; // Define a new, non-default, policy
// to calculate tgamma to accuracy of approximately 5 decimal digits.
//]
int main()
{
cout.precision(5); // To only show 5 (hopefully) accurate decimal digits.
double t = tgamma(12, my_pol_5()); // Apply the 5 decimal digits accuracy policy to use of tgamma.
cout << "tgamma(12, my_pol_5() = " << t << endl;
}
/*
Output:
tgamma(12, my_pol_5() = 3.9917e+007
*/
|
copolat/mern
|
7.LessonSeven/reduxcounter/src/actions/counterAction.js
|
<reponame>copolat/mern
import { INCREASE_COUNT, DECREASE_COUNT } from './actionTypes'
export const increaseCount = ()=>{
return {type: INCREASE_COUNT}
}
export const decreaseCount = ()=>{
return {type: DECREASE_COUNT}
}
|
mohammadne/bookman
|
services/library/cmd/migrate/main.go
|
package migrate
import (
"os"
"github.com/mohammadne/bookman/library/internal/configs"
"github.com/mohammadne/bookman/library/internal/database"
"github.com/mohammadne/bookman/library/pkg/logger"
"github.com/mohammadne/bookman/library/pkg/tracer"
"github.com/spf13/cobra"
)
const (
use = "migrate"
short = "run migration"
)
func Command() *cobra.Command {
cmd := &cobra.Command{Use: use, Short: short, Run: main}
envFlag := "set config environment, default is dev"
cmd.Flags().StringP("env", "e", "", envFlag)
previewFlag := "if set to true, it will only preview changes and doesn't execute them"
cmd.Flags().BoolP("preview", "p", false, previewFlag)
return cmd
}
func main(cmd *cobra.Command, args []string) {
env := cmd.Flag("env").Value.String()
config := configs.Migrate(env)
lg := logger.NewZap(config.Logger)
tracer, err := tracer.New(config.Tracer)
if err != nil {
lg.Panic("error getting tracer object", logger.Error(err))
}
db, err := database.NewClient(config.Database, lg, tracer)
if err != nil {
lg.Panic("", logger.Error(err))
}
lg.Info("following changes will be executed to database")
if err := db.MigratePreview(os.Stdout); err != nil {
lg.Panic("error while previewing migration", logger.Error(err))
}
preview, err := cmd.Flags().GetBool("preview")
if err != nil {
lg.Panic("", logger.Error(err))
}
if !preview {
if err := db.Migrate(); err != nil {
lg.Panic("error while running migration", logger.Error(err))
}
lg.Info("schemas successfully migrated to database")
}
}
|
TomographyLab/NiftyRec
|
teem/src/ten/modelBall1Stick.c
|
/*
Teem: Tools to process and visualize scientific data and images
Copyright (C) 2008, 2007, 2006, 2005 <NAME>
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
(LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The terms of redistributing and/or modifying this software also
include exceptions to the LGPL that facilitate static linking.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ten.h"
#include "privateTen.h"
#define DOF_NUM 6
#define PARM_NUM 7
static const tenModelParmDesc
parmDesc[] = {
/* 0 */ {"B0", 0.0, TEN_MODEL_B0_MAX, AIR_FALSE, 0},
/* 1 */ {"diff_ball", 0.0, TEN_MODEL_DIFF_MAX, AIR_FALSE, 0},
/* 2 */ {"fraction", 0.0, 1.0, AIR_FALSE, 0},
/* 3 */ {"diff_stick", 0.0, TEN_MODEL_DIFF_MAX, AIR_FALSE, 0},
/* 4 */ {"x", -1.0, 1.0, AIR_TRUE, 0},
/* 5 */ {"y", -1.0, 1.0, AIR_TRUE, 1},
/* 6 */ {"z", -1.0, 1.0, AIR_TRUE, 2}
};
static void
simulate(double *dwiSim, const double *parm, const tenExperSpec *espec) {
unsigned int ii;
double b0, diffBall, diffStick, frac, vec[3];
b0 = parm[0];
diffBall = parm[1];
frac = parm[2];
diffStick = parm[3];
vec[0] = parm[4];
vec[1] = parm[5];
vec[2] = parm[6];
for (ii=0; ii<espec->imgNum; ii++) {
double dwiBall, dwiStick, dot, bb;
bb = espec->bval[ii];
dwiBall = exp(-bb*diffBall);
dot = ELL_3V_DOT(vec, espec->grad + 3*ii);
dwiStick = exp(-bb*diffStick*dot*dot);
dwiSim[ii] = b0*(AIR_LERP(frac, dwiBall, dwiStick));
}
return;
}
static char *
parmSprint(char str[AIR_STRLEN_MED], const double *parm) {
sprintf(str, "(%g) (1-f)*%g + (f=%g)*(%g @ (%g,%g,%g))", parm[0],
parm[1], parm[2], parm[3], parm[4], parm[5], parm[6]);
return str;
}
_TEN_PARM_ALLOC
_TEN_PARM_RAND
_TEN_PARM_STEP
_TEN_PARM_DIST
_TEN_PARM_COPY
static int
parmConvert(double *parmDst, const double *parmSrc,
const tenModel *modelSrc) {
int ret;
ret = 0;
parmDst[0] = parmSrc[0];
if (modelSrc == tenModelBall) {
} else if (modelSrc == tenModel1Stick) {
} else if (modelSrc == tenModelBall1Stick) {
} else if (modelSrc == tenModel1Cylinder) {
} else if (modelSrc == tenModel1Tensor2) {
} else {
unsigned int ii;
for (ii=0; ii<PARM_NUM; ii++) {
parmDst[ii] = AIR_NAN;
}
ret = 2;
}
return ret;
}
_TEN_SQE
_TEN_SQE_GRAD_CENTDIFF
_TEN_SQE_FIT(tenModelBall1Stick)
_TEN_NLL
_TEN_NLL_GRAD_STUB
_TEN_NLL_FIT_STUB
tenModel
_tenModelBall1Stick = {
TEN_MODEL_STR_BALL1STICK,
_TEN_MODEL_FIELDS
};
const tenModel *const tenModelBall1Stick = &_tenModelBall1Stick;
|
2719969254/leyou
|
leyou/ly-item/ly-item-interface/src/main/java/com/leyou/item/api/SpecificationApi.java
|
<filename>leyou/ly-item/ly-item-interface/src/main/java/com/leyou/item/api/SpecificationApi.java<gh_stars>0
package com.leyou.item.api;
import com.leyou.item.pojo.SpecGroup;
import com.leyou.item.pojo.SpecParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author VicterTian
* @version V1.0
* @Date 2018/12/22
*/
public interface SpecificationApi {
/**
* 根据id查询参数集合
* @param gid 组id
* @param cid 分类id
* @param searching 是否搜索
* @return 参数集合
*/
@GetMapping("spec/params")
List<SpecParam> queryParam(
@RequestParam(value = "gid",required = false)Long gid,
@RequestParam(value = "cid",required = false)Long cid,
@RequestParam(value = "searching",required = false) Boolean searching
);
@GetMapping("spec/group")
List<SpecGroup> queryGroupByCid(@RequestParam("cid") Long cid);
}
|
xcgx/streamlink
|
src/streamlink/plugins/vk.py
|
import logging
import re
from html import unescape as html_unescape
from urllib.parse import parse_qsl, unquote, urlparse
from streamlink.exceptions import NoStreamsError
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import useragents
from streamlink.plugin.api.utils import itertags
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
from streamlink.utils.url import update_scheme
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r"https?://(?:\w+\.)?vk\.com/video(?:\?z=video)?(?P<video_id>-?\d*_\d*)"
))
@pluginmatcher(re.compile(
r"https?://(\w+\.)?vk\.com/videos-?\d*"
))
class VK(Plugin):
API_URL = 'https://vk.com/al_video.php'
_vod_quality_re = re.compile(r"\.([0-9]*?)\.mp4")
def follow_vk_redirect(self):
# If this is a 'videos' catalog URL
# with an video ID in the GET request, get that instead
if self.matches[1]:
try:
parsed_url = urlparse(self.url)
true_path = next(unquote(v).split('/')[0] for k, v in parse_qsl(parsed_url.query) if k == "z")
self.url = parsed_url.scheme + '://' + parsed_url.netloc + '/' + true_path
except StopIteration:
raise NoStreamsError(self.url)
def _get_streams(self):
self.session.http.headers.update({'User-Agent': useragents.IPHONE_6})
self.follow_vk_redirect()
video_id = self.match.group('video_id')
log.debug('video ID: {0}'.format(video_id))
params = {
'act': 'show_inline',
'al': '1',
'video': video_id,
}
res = self.session.http.post(self.API_URL, params=params)
for _i in itertags(res.text, 'iframe'):
if _i.attributes.get('src'):
iframe_url = update_scheme("https://", _i.attributes["src"])
log.debug('Found iframe: {0}'.format(iframe_url))
yield from self.session.streams(iframe_url).items()
for _i in itertags(res.text.replace('\\', ''), 'source'):
if _i.attributes.get('type') == 'application/vnd.apple.mpegurl':
video_url = html_unescape(_i.attributes['src'])
streams = HLSStream.parse_variant_playlist(self.session,
video_url)
if not streams:
yield 'live', HLSStream(self.session, video_url)
else:
yield from streams.items()
elif _i.attributes.get('type') == 'video/mp4':
q = 'vod'
video_url = _i.attributes['src']
m = self._vod_quality_re.search(video_url)
if m:
q = '{0}p'.format(m.group(1))
yield q, HTTPStream(self.session, video_url)
__plugin__ = VK
|
zhangrui95/BigShow1
|
src/pages/MiddlePlatform/EquipmentUnitTable.js
|
// 办案区- 硬件设备单元表格 by zhangying 2018-02-27
import React, { PureComponent } from 'react';
import moment from 'moment';
import { Table, Button, Badge, Divider, Popconfirm, Tooltip } from 'antd';
import styles from './EquipmentUnitTable.less';
class EquipmentUnitTable extends PureComponent {
state = {
selectedRowKeys: [],
totalCallNo: 0,
recordInfo: null,//用于改变整条状态
};
handleTableChange = (page) => {
this.props.onChange(page);
}
render() {
const { selectedRowKeys, totalCallNo } = this.state;
const { data, loading } = this.props;
const columns = [
{
title: '序号',
dataIndex: 'xh',
key: 'xh'
},
{
title: '名称',
dataIndex: 'name',
key: 'name'
},
{
title: 'IP',
dataIndex: 'ip',
key: 'ip'
},
{
title: 'ID',
dataIndex: 'id',
key: 'id'
},
{
title: '设备单元类型',
dataIndex: 'deviceunit_typename',
key: 'deviceunit_typename'
},
{
title: '运行状态',
dataIndex: 'zt',
key: 'zt',
render: (text,record) => {
return text === 1 ? <span><Badge status="success" />正常</span> :
( text === 0 ? <span>
{/* <Badge status="error" />异常<Ellipsis length={10} tooltip>{record.event_desc}</Ellipsis> */}
<Tooltip title={`${record.event_desc}`}><Badge status="error" />异常</Tooltip>
</span>
:<span><Badge status="default" />停止</span>);
},
},
];
const pageProps = {
// showSizeChanger: true,
// showQuickJumper: true,
// ...page,
current: data.page.currentPage,
total: data.page.totalResult,
pageSize: data.page.showCount
};
return (
<div className={styles.standardTable}>
<Table
size={'middle'}
loading={loading}
rowKey={record => record.id}
dataSource={data.list}
columns={columns}
pagination={pageProps}
onChange={this.handleTableChange}
/>
</div>
);
}
}
export default EquipmentUnitTable;
|
anshsarkar/TailBench
|
moses/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.h
|
<filename>moses/moses/TranslationModel/RuleTable/PhraseDictionaryALSuffixArray.h
//
// PhraseDictionaryALSuffixArray.h
// moses
//
// Created by <NAME> on 06/11/2011.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#ifndef moses_PhraseDictionaryALSuffixArray_h
#define moses_PhraseDictionaryALSuffixArray_h
#include "PhraseDictionarySCFG.h"
namespace Moses {
/** Implementation of in-memory phrase table for use with Adam Lopez's suffix array.
* Does 2 things that the normal in-memory pt doesn't do:
* 1. Loads grammar for a sentence to be decoded only when the sentence is being decoded. Unload afterwards
2. Format of the pt file follows Hiero, rather than Moses
*/
class PhraseDictionaryALSuffixArray : public PhraseDictionarySCFG
{
public:
PhraseDictionaryALSuffixArray(size_t numScoreComponent, PhraseDictionaryFeature* feature)
: PhraseDictionarySCFG(numScoreComponent,feature) {}
bool Load(const std::vector<FactorType> &input
, const std::vector<FactorType> &output
, const std::string &filePath
, const std::vector<float> &weight
, size_t tableLimit
, const LMList &languageModels
, const WordPenaltyProducer* wpProducer);
void InitializeForInput(InputType const& source);
protected:
const std::vector<FactorType> *m_input, *m_output;
const LMList *m_languageModels;
const WordPenaltyProducer *m_wpProducer;
const std::vector<float> *m_weight;
};
}
#endif
|
CraigRichards/healenium-web
|
src/main/java/com/epam/healenium/processor/HealingElementsProcessor.java
|
package com.epam.healenium.processor;
import com.epam.healenium.model.LastHealingDataDto;
import com.epam.healenium.treecomparing.Node;
import lombok.extern.slf4j.Slf4j;
import org.openqa.selenium.WebElement;
import java.util.List;
/**
* Healing Elements Processor
*/
@Slf4j
public class HealingElementsProcessor extends BaseProcessor {
public HealingElementsProcessor(BaseProcessor nextProcessor) {
super(nextProcessor);
}
@Override
public boolean validate() {
LastHealingDataDto lastHealingData = context.getLastHealingData();
if (lastHealingData == null || lastHealingData.getPaths().isEmpty()) {
if (!context.getElements().isEmpty()) {
engine.saveElements(context.getPageAwareBy(), context.getElements());
} else {
log.warn("New element locator have not been found. There is a lack of reference data.");
}
return false;
}
return true;
}
@Override
public void execute() {
List<List<Node>> nodesFromDb = context.getLastHealingData().getPaths();
splitDbNodes(nodesFromDb);
String targetPage = engine.pageSource();
Node destination = engine.parseTree(targetPage);
context.setPageContent(targetPage);
nodesFromDb.stream()
.filter(nodes -> !context.getNewElementsToNodes().containsValue(nodes) && !context.getExistElementsToNodes().containsValue(nodes))
.forEach(nodes -> healingService.findNewLocations(nodes, destination, context));
}
private void splitDbNodes(List<List<Node>> nodesFromDb) {
for (WebElement webElement : context.getElements()) {
List<Node> nodePath = engine.getNodeService().getNodePath(webElement);
if (!nodesFromDb.contains(nodePath)) {
context.getNewElementsToNodes().put(webElement, nodePath);
} else {
context.getExistElementsToNodes().put(webElement, nodePath);
}
}
}
}
|
mphan6/30-seconds-of-code
|
test/sumBy/sumBy.test.js
|
const expect = require('expect');
const sumBy = require('./sumBy.js');
test('sumBy is a Function', () => {
expect(sumBy).toBeInstanceOf(Function);
});
|
ASangarin/MonHun
|
src/main/java/eu/asangarin/monhun/util/enums/MHBreakablePart.java
|
package eu.asangarin.monhun.util.enums;
public enum MHBreakablePart {
HEAD,
WING,
BACK,
UNSPECIFIED;
public static MHBreakablePart fromString(String key) {
for(MHBreakablePart part : MHBreakablePart.values())
if(part.name().equalsIgnoreCase(key)) return part;
return MHBreakablePart.UNSPECIFIED;
}
}
|
TDesjardins/vue-gwt
|
processors/src/test/java/com/axellience/vuegwt/processors/component/propertybinding/PropertyBindingTest.java
|
<reponame>TDesjardins/vue-gwt
package com.axellience.vuegwt.processors.component.propertybinding;
import static com.google.testing.compile.CompilationSubject.assertThat;
import static com.google.testing.compile.Compiler.javac;
import com.axellience.vuegwt.processors.VueGwtProcessor;
import com.google.testing.compile.Compilation;
import com.google.testing.compile.JavaFileObjects;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class PropertyBindingTest {
@Test
@DisplayName("should enforce types for DOM element property binding")
void propsAreRegisteredInOptionsCorrectly() {
Compilation compilation =
javac()
.withProcessors(new VueGwtProcessor())
.compile(JavaFileObjects.forResource("propertybinding/PropertyBindingComponent.java"));
assertThat(compilation)
.generatedSourceFile("propertybinding.PropertyBindingComponentExposedType")
.containsElementsIn(JavaFileObjects.forResource(
"propertybinding/compileresult/PropertyBindingComponentExposedType.java"));
}
}
|
rafaelmotaalves/titan
|
titan-cassandra/src/test/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/ThriftDistributedStoreManagerTest.java
|
<reponame>rafaelmotaalves/titan
package com.thinkaurelius.titan.diskstorage.cassandra.thrift;
import com.thinkaurelius.titan.diskstorage.BackendException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import com.thinkaurelius.titan.CassandraStorageSetup;
import com.thinkaurelius.titan.diskstorage.DistributedStoreManagerTest;
public class ThriftDistributedStoreManagerTest extends DistributedStoreManagerTest<CassandraThriftStoreManager> {
@BeforeClass
public static void startCassandra() {
CassandraStorageSetup.startCleanEmbedded();
}
@Before
public void setUp() throws BackendException {
manager = new CassandraThriftStoreManager(
CassandraStorageSetup.getCassandraThriftConfiguration(this.getClass().getSimpleName()));
store = manager.openDatabase("distributedcf");
}
@After
public void tearDown() throws BackendException {
if (null != manager)
manager.close();
}
}
|
truemrwalker/wblwrld3
|
serverside/bootstrap/webbles.js
|
<gh_stars>1-10
//
// Webble World 3.0 (IntelligentPad system for the web)
//
// Copyright (c) 2010-2015 <NAME>, <NAME>, <NAME>aka
// in Meme Media R&D Group of Hokkaido University, Japan. All rights reserved.
//
// 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.
//
// Additional restrictions may apply. See the LICENSE file for more information.
//
/**
* @overview This file was used to create programmatically a webble for testing purposes.
*
* At this point of Webble World development, however, we don't need it anymore. Nonetheless,
* the file is left here in case we do need, in the future, to actually bootstrap a new
* deployment of Webble World with some standard webbles.
*
* @author <NAME>
*/
var Promise = require("bluebird");
module.exports = function(app, config, mongoose, gettext) {
// We don't need to generate fake webbles anymore
//
return console.log("Bootstrap: Skipped generation of fake webbles");
// Create entries in db
//
var User = mongoose.model('User');
var Webble = mongoose.model('Webble');
var w = new Webble({
"webble": {
"instanceid": 1, //"00000000_0000_0000_0000_000000000000",
"defid": "fundamental",
"templateid": "fundamental",
"templaterevision": 1,
"displayname": "Fundamental Webble",
"description": "Webble def file generated from fake data",
"keywords": "simple basic",
"author": "MickeNicanderKuwahara",
"image": "http://icons.iconarchive.com/icons/ampeross/lamond/256/assassins-creed-icon.png",
"protectflags": 0,
"slotdata": {
"send": true,
"receive": true,
"selectslot": "",
"connslot": "",
"mcdata": [],
"slots": [
{
"name": "superslot",
"category": "custom",
"value": "1000",
"metadata": "null"
},
{
"name": "coolslot",
"category": "custom",
"value": "King of the jungle",
"metadata": "null"
}
]
},
"children": [
//{"webble": {}},
],
"private": {}
}
});
return w.save();
};
|
tiagoros/gravitee-api-management
|
gravitee-apim-rest-api/gravitee-apim-rest-api-management/gravitee-apim-rest-api-management-rest/src/main/java/io/gravitee/rest/api/management/rest/mapper/ObjectMapperResolver.java
|
<reponame>tiagoros/gravitee-api-management
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.rest.api.management.rest.mapper;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.PropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import io.gravitee.definition.jackson.datatype.GraviteeMapper;
import io.gravitee.rest.api.service.jackson.filter.ApiPermissionFilter;
import java.io.IOException;
import java.util.Collections;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
/**
* @author <NAME> (david.brassely at graviteesource.com)
* @author <NAME> (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
@Provider
public class ObjectMapperResolver implements ContextResolver<ObjectMapper> {
private final ObjectMapper mapper;
public ObjectMapperResolver() {
mapper = new GraviteeMapper();
//because Permissions are represented as char[]
mapper.enable(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS);
// register filter provider
registerFilterProvider();
}
@Override
public ObjectMapper getContext(Class<?> type) {
return mapper;
}
private void registerFilterProvider() {
PropertyFilter apiMembershipTypeFilter = new ApiPermissionFilter();
mapper.setFilterProvider(new SimpleFilterProvider(Collections.singletonMap("apiMembershipTypeFilter", apiMembershipTypeFilter)));
}
}
|
salmanahmedshaikh/streamOLAPOptimization
|
code/src/Dispatcher/DispatcherManager.h
|
<gh_stars>1-10
//////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 KDE Laboratory, University of Tsukuba, Tsukuba, Japan. //
// //
// The JsSpinnerSPE/StreamingCube and the accompanying materials are made available //
// under the terms of Eclipse Public License v1.0 which accompanies this distribution //
// and is available at <https://eclipse.org/org/documents/epl-v10.php> //
//////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../Common/stdafx.h"
#include "../Common/Types.h"
#include <cstdlib>
#include <boost/noncopyable.hpp>
#include <event2/event.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
//#include "../IO/IOManager.h"
class DispatcherManager:private boost::noncopyable
{
private:
static DispatcherManager* dispatcherManager;
DispatcherManager(void);
void initialize(void);
public:
static DispatcherManager* getInstance(void);
~DispatcherManager(void);
void execute(std::map<std::string, int> workerIPIDMap, std::vector<std::string> dispatcherQueryVec);
};
|
enyojs/ares-project
|
scripts/postpublish.js
|
<gh_stars>10-100
/*jshint node:true*/
/*global console, require*/
var shell = require('shelljs'),
deploys = require('./common.js').deploys;
deploys.forEach(function(app) {
console.log("> rm -rf " + app.o);
shell.rm("-rf", app.o);
});
|
Samer-Alnajjar/data-structures-and-algorithms
|
javascript/code-challenges/fizzBuzzTree/fizz-buzz-tree.js
|
<filename>javascript/code-challenges/fizzBuzzTree/fizz-buzz-tree.js
"use strict"
class Node {
constructor(value) {
this.value = value;
this.children = [];
}
}
class BinaryTree {
constructor(root = null) {
this.root = root;
}
}
function fizzBuzzTree(node) {
let i = 0;
if (!node) {
return "Exception";
}
let _traverse = (node) => {
if(node) {
if (node.value % 3 === 0 && node.value % 5 === 0) {
node.value = 'FizzBuzz';
} else if (node.value % 3 === 0) {
node.value = 'Fizz';
} else if (node.value % 5 === 0) {
node.value = 'Buzz';
} else {
node.value = 'Not divisible by 3 or 5';
}
}
};
if (node.children.length && node.value) {
while (i < node.children.length) {
_traverse(node.children[i]);
i++;
}
}
_traverse(node.root);
return node;
};
// let tree = new BinaryTree(new Node(1));
// tree.root.children.push(new Node(3));
// tree.root.children[0].parent = tree;
// tree.root.children.push(new Node(2));
// tree.root.children[1].parent = tree;
// tree.root.children.push(new Node(4));
// tree.root.children[2].parent = tree;
// tree.root.children[0].children.push(new Node(5));
// tree.root.children[0].children[0].parent = tree.root.children[0];
// tree.root.children[0].children.push(new Node(6));
// tree.root.children[0].children[1].parent = tree.root.children[0];
// console.log(tree);
// console.log(fizzBuzzTree(tree.root).root.children);
module.exports = {
Node: Node,
BinaryTree: BinaryTree,
fizzBuzzTree: fizzBuzzTree
}
|
ministryofjustice/opg-lpa-front
|
assets/js/moj/moj.modules/moj.analytics.js
|
// Analytics module for LPA
// Dependencies: moj, jQuery
(function () {
'use strict';
if (typeof(gaConfig) === 'undefined') {
moj.log('gaConfig not set. skipping Google Analytics tracking.');
return;
}
moj.Modules.Analytics = {
init: function () {
GOVUK.Analytics.load();
this.setup();
},
setup: function() {
// Use document.domain in dev, preview and staging so that tracking works
// Otherwise explicitly set the domain as lastingpowerofattorney.service.justice.gov.uk.
var cookieDomain = (document.domain === 'lastingpowerofattorney.service.justice.gov.uk') ? '.lastingpowerofattorney.service.justice.gov.uk' : document.domain;
// Configure profiles and make interface public
// for custom dimensions, virtual pageviews and events
GOVUK.analytics = new GOVUK.Analytics({
universalId: gaConfig.universalId || '',
cookieDomain: cookieDomain,
allowLinker: true,
allowAnchor: true
});
// Track initial pageview
if (typeof GOVUK.pageviewOptions !== 'undefined') {
GOVUK.analytics.trackPageview(null, null, GOVUK.pageviewOptions);
}
else {
GOVUK.analytics.trackPageview();
}
}
};
})();
|
Mouned/esigate
|
esigate-servlet/src/main/java/org/esigate/servlet/impl/HttpServletRequestEntity.java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.esigate.servlet.impl;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.http.HttpServletRequest;
import org.apache.http.HttpHeaders;
import org.apache.http.entity.AbstractHttpEntity;
import org.esigate.http.HttpResponseUtils;
public class HttpServletRequestEntity extends AbstractHttpEntity {
private final HttpServletRequest request;
private final long length;
HttpServletRequestEntity(HttpServletRequest request) {
this.request = request;
String contentLengthHeader = request.getHeader(HttpHeaders.CONTENT_LENGTH);
if (contentLengthHeader != null) {
length = Long.parseLong(contentLengthHeader);
} else {
length = -1;
}
String contentTypeHeader = request.getHeader(HttpHeaders.CONTENT_TYPE);
if (contentTypeHeader != null) {
this.setContentType(contentTypeHeader);
}
String contentEncodingHeader = request.getHeader(HttpHeaders.CONTENT_ENCODING);
if (contentEncodingHeader != null) {
this.setContentEncoding(contentEncodingHeader);
}
}
@Override
public boolean isRepeatable() {
return false;
}
@Override
public long getContentLength() {
return length;
}
@Override
public InputStream getContent() throws IOException, IllegalStateException {
return request.getInputStream();
}
@Override
public void writeTo(OutputStream outstream) throws IOException {
HttpResponseUtils.writeTo(this, outstream);
}
@Override
public boolean isStreaming() {
return true;
}
}
|
georghe-crihan/ext2fsx
|
src/ext2_byteorder.h
|
<filename>src/ext2_byteorder.h
/*
* Copyright 2003,2006 <NAME>.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Revision$
*/
#ifndef _EXT2_BYTEORDER_H
#define _EXT2_BYTEORDER_H
#include <sys/types.h>
#ifndef OSX4
#include <stdint.h>
#endif
#if BYTE_ORDER == BIG_ENDIAN
#include <ext2_bigendian.h>
#define E2Q_HIGH 0
#define E2Q_LOW 1
#elif BYTE_ORDER == LITTLE_ENDIAN
#include <ext2_littleendian.h>
#define E2Q_HIGH 1
#define E2Q_LOW 0
#else
#error "Unknown architecture!"
#endif
static __inline__ __attribute__((__const__))
u_int16_t e2_swap16 (u_int16_t val)
{
u_int16_t n;
__arch_swap_16(val, &n);
return (n);
}
static __inline__
u_int16_t e2_swap16p (const u_int16_t *val)
{
u_int16_t n,v;
v = *val;
__arch_swap_16(v, &n);
return (n);
}
static __inline__ __attribute__((__const__))
u_int32_t e2_swap32 (u_int32_t val)
{
u_int32_t n;
__arch_swap_32(val, &n);
return (n);
}
static __inline__
u_int32_t e2_swap32p (const u_int32_t *val)
{
u_int32_t n,v;
v = *val;
__arch_swap_32(v, &n);
return (n);
}
typedef union {
uint64_t eq;
uint32_t el[2];
} e2q;
static __inline__ __attribute__((__const__))
u_int64_t e2_swap64 (u_int64_t val)
{
e2q n;
__arch_swap_32(((e2q*)&val)->el[E2Q_HIGH], &n.el[E2Q_LOW]);
__arch_swap_32(((e2q*)&val)->el[E2Q_LOW], &n.el[E2Q_HIGH]);
return (n.eq);
}
static __inline__
u_int64_t e2_swap64p (const u_int64_t *val)
{
e2q n;
__arch_swap_32(((e2q*)val)->el[E2Q_HIGH], &n.el[E2Q_LOW]);
__arch_swap_32(((e2q*)val)->el[E2Q_LOW], &n.el[E2Q_HIGH]);
return (n.eq);
}
#endif // _EXT2_BYTEORDER_H
|
L-Net-1992/DALI
|
dali/kernels/signal/resampling_cpu.h
|
<gh_stars>0
// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// 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.
#ifndef DALI_KERNELS_SIGNAL_RESAMPLING_CPU_H_
#define DALI_KERNELS_SIGNAL_RESAMPLING_CPU_H_
#include "dali/kernels/signal/resampling.h"
#include "dali/core/api_helper.h"
namespace dali {
namespace kernels {
namespace signal {
namespace resampling {
template <typename Out>
DLL_PUBLIC void ResampleCPUImpl(ResamplingWindow window, Out *__restrict__ out, int64_t out_begin,
int64_t out_end, double out_rate, const float *__restrict__ in,
int64_t n_in, double in_rate, int num_channels);
struct DLL_PUBLIC ResamplerCPU {
ResamplingWindowCPU window;
inline void Initialize(int lobes = 16, int lookup_size = 2048) {
windowed_sinc(window, lookup_size, lobes);
}
/**
* @brief Resample multi-channel (or single channel) signal and convert to Out
*
* Calculates a range of resampled signal.
* The function can resample a region-of-interest (ROI) of the output, specified by `out_begin` and
* `out_end`. In this case, the output pointer points to the beginning of the ROI.
*/
template <typename Out>
void Resample(Out *__restrict__ out, int64_t out_begin, int64_t out_end, double out_rate,
const float *__restrict__ in, int64_t n_in, double in_rate, int num_channels) {
ResampleCPUImpl(window, out, out_begin, out_end, out_rate, in, n_in, in_rate, num_channels);
}
};
} // namespace resampling
} // namespace signal
} // namespace kernels
} // namespace dali
#endif // DALI_KERNELS_SIGNAL_RESAMPLING_CPU_H_
|
Sinope-Nanto/city_house
|
city_housing_index/local_auth/models.py
|
<gh_stars>0
import random
import uuid
from django.db import models
from django.contrib.auth.models import User
from .enum import UserRole, UserStatus
# Create your models here.
from django.db.models import SET_NULL
from city.models import City
class UserProfile(models.Model):
user_id = models.ForeignKey(User, on_delete=SET_NULL, null=True)
name = models.CharField(default="", max_length=100, blank=True, null=False, help_text="姓名")
mobile = models.CharField(default="", max_length=100, blank=True, null=False, help_text="手机号", unique=True)
city = models.ForeignKey(City, on_delete=SET_NULL, null=True)
identity = models.CharField(default="", max_length=100, blank=True, null=False, help_text="身份证号")
identity_image = models.ImageField(upload_to="users")
role = models.IntegerField(default=UserRole.CUSTOMER, help_text="身份")
status = models.IntegerField(default=UserStatus.WAIT_CHECK)
def set_to_wait(self):
self.status = UserStatus.WAIT_CHECK
self.save()
def set_to_accept(self):
self.status = UserStatus.REGISTERED
self.save()
def set_to_refuse(self):
self.status = UserStatus.REFUSED
self.save()
def is_admin(self):
return self.role == UserRole.ADMIN
@classmethod
def get_waiting_list(cls):
return cls.objects.filter(status=UserStatus.WAIT_CHECK)
@classmethod
def get_by_user(cls, user_id):
return cls.objects.get(user_id=user_id)
@classmethod
def get_by_user_id(cls, user_id_id):
return cls.objects.get(user_id_id=user_id_id)
class UserSession(models.Model):
user = models.ForeignKey(User, on_delete=SET_NULL, null=True)
token = models.CharField(default="", max_length=200, null=False)
expire = models.DateTimeField(auto_now_add=True)
@classmethod
def generate_token(cls):
return uuid.uuid4().hex
class UserSMSCode(models.Model):
user = models.ForeignKey(User, on_delete=SET_NULL, null=True)
code = models.CharField(default="", max_length=100, null=False)
expire = models.DateTimeField(auto_now_add=False, auto_now=False)
@classmethod
def generate_verify_code(cls):
return "".join([str(random.randint(0, 9)) for i in range(6)])
|
md2manoppello/MDEForge
|
mdeforge.client/src/main/java/org/mdeforge/business/model/ATLTransformationTestServiceError.java
|
<filename>mdeforge.client/src/main/java/org/mdeforge/business/model/ATLTransformationTestServiceError.java
package org.mdeforge.business.model;
import java.io.Serializable;
public class ATLTransformationTestServiceError implements Serializable{
//INNER CLASS AND ENUMERATES
/** attributes */
private Model model = null;
private String errorMessage = "";
public String getErrorMessage() {
return errorMessage;
}
private String errorKind = null;
public String getErrorKind() {
return errorKind;
}
public void setErrorKind(String errorKind) {
this.errorKind = errorKind;
}
// public Record (Model model) {
// this.model = model;
// }
//
// public Record (Model model, String error, ERROR_KIND kind) {
// this(model);
// this.errorMessage = error;
// this.errorKind = kind;
// }
public void setErrorMessage (String errorMessage) {this.errorMessage = errorMessage;}
public Model getModel() { return model; }
public void setModel(Model model) {this.model = model;}
public String getError() { return (model!=null? "[witness model "+model+"]: " : "") + errorMessage; }
public boolean getExecutionRaisesException () { return errorKind.equals("ERROR_KIND.EXECUTION_RAISES_EXCEPTION;"); }
public boolean getExecutionYieldsIllTarget () { return errorKind.equals("ERROR_KIND.EXECUTION_YIELDS_ILL_TARGET;"); }
public boolean getAnatlyserNotifiesError () { return errorKind.equals("ERROR_KIND.ANATLYZER_DETECTED_ERROR;"); }
public boolean getAnatlyserDoesNotFinish () { return errorKind.equals("ANATLYZER_DOES_NOT_FINISH;"); }
}
|
Ouranosinc/Magpie
|
magpie/ui/home/__init__.py
|
<filename>magpie/ui/home/__init__.py
from magpie.utils import get_logger
LOGGER = get_logger(__name__)
def includeme(config):
LOGGER.info("Adding UI home...")
config.add_route("home", "/")
config.add_route("home_ui", "/ui")
config.add_route("error", "/ui/error")
config.add_static_view("static", "static/", cache_max_age=3600)
config.scan()
|
mpol/iis
|
iis-common/src/main/java/eu/dnetlib/iis/common/spark/pipe/PipeExecutionEnvironment.java
|
package eu.dnetlib.iis.common.spark.pipe;
import java.io.IOException;
/**
* Abstraction of execution environment for scripts and commands run using 'pipe' method on RDD.
* <p>
* Classes implementing this interface should propagate any necessary files and directories to cluster nodes and define
* the command to be run by 'pipe' method. This interface allows to separate production code and test code by providing
* different implementation for each execution environment.
*/
public interface PipeExecutionEnvironment {
/**
* Returns the string command to be run by RDD 'pipe' method. The command executes in the context of each node's
* local worker dir. Must not reference files or dir by absolute paths. Instead a relative path within worker dir
* should be used or explicit file path retrieval using 'SparkFiles.get' method.
*
* @return String representing the command to be run by RDD 'pipe' method.
* @throws IOException
*/
String pipeCommand() throws IOException;
}
|
opencollective/cloud
|
cloud2cloud-gateway/service/config.go
|
package service
import (
"encoding/json"
"fmt"
"time"
"github.com/go-ocf/kit/net/grpc"
)
//Config represent application configuration
type Config struct {
grpc.Config
AuthServerAddr string `envconfig:"AUTH_SERVER_ADDRESS" default:"127.0.0.1:9100"`
ResourceAggregateAddr string `envconfig:"RESOURCE_AGGREGATE_ADDRESS" default:"127.0.0.1:9100"`
ResourceDirectoryAddr string `envconfig:"RESOURCE_DIRECTORY_ADDRESS" default:"127.0.0.1:9100"`
FQDN string `envconfig:"FQDN" default:"cloud2cloud.pluggedin.cloud"`
DevicesCheckInterval time.Duration `envconfig:"ALL_DEVICES_CHECK_INTERVAL" default:"3s"`
TimeoutForRequests time.Duration `envconfig:"TIMEOUT_FOR_REQUESTS" default:"10s"`
}
//String return string representation of Config
func (c Config) String() string {
b, _ := json.MarshalIndent(c, "", " ")
return fmt.Sprintf("config: \n%v\n", string(b))
}
|
doriandrn/rxdb
|
dist/lib/plugins/update.js
|
<reponame>doriandrn/rxdb
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prototypes = exports.rxdb = exports.RxQueryUpdate = undefined;
var _regenerator = require('babel-runtime/regenerator');
var _regenerator2 = _interopRequireDefault(_regenerator);
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
var RxQueryUpdate = exports.RxQueryUpdate = function () {
var _ref = (0, _asyncToGenerator3['default'])( /*#__PURE__*/_regenerator2['default'].mark(function _callee(updateObj) {
var docs;
return _regenerator2['default'].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.exec();
case 2:
docs = _context.sent;
if (docs) {
_context.next = 5;
break;
}
return _context.abrupt('return', null);
case 5:
if (!Array.isArray(docs)) {
_context.next = 10;
break;
}
_context.next = 8;
return Promise.all(docs.map(function (doc) {
return doc.update(updateObj);
}));
case 8:
_context.next = 12;
break;
case 10:
_context.next = 12;
return docs.update(updateObj);
case 12:
return _context.abrupt('return', docs);
case 13:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
return function RxQueryUpdate(_x) {
return _ref.apply(this, arguments);
};
}();
exports.update = update;
var _modifyjs = require('modifyjs');
var _modifyjs2 = _interopRequireDefault(_modifyjs);
var _deepEqual = require('deep-equal');
var _deepEqual2 = _interopRequireDefault(_deepEqual);
var _util = require('../util.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function update(updateObj) {
var _this = this;
var oldDocData = (0, _util.clone)(this._data);
var newDoc = (0, _modifyjs2['default'])(this._data, updateObj);
Object.keys(this._data).forEach(function (previousPropName) {
if (newDoc[previousPropName]) {
// if we don't check inequality, it triggers an update attempt on fields that didn't really change,
// which causes problems with "readonly" fields
if (!(0, _deepEqual2['default'])(_this._data[previousPropName], newDoc[previousPropName])) _this._data[previousPropName] = newDoc[previousPropName];
} else delete _this._data[previousPropName];
});
delete newDoc._rev;
delete newDoc._id;
Object.keys(newDoc).filter(function (newPropName) {
return !(0, _deepEqual2['default'])(_this._data[newPropName], newDoc[newPropName]);
}).forEach(function (newPropName) {
return _this._data[newPropName] = newDoc[newPropName];
});
return this.save().then(function () {
return _this;
})['catch'](function (err) {
// save was not successfull, reset doc-data
_this._data = oldDocData;
throw err;
});
} /**
* this plugin allows delta-updates with mongo-like-syntax
* It's using modifyjs internally
* @link https://github.com/lgandecki/modifyjs
*/
var rxdb = exports.rxdb = true;
var prototypes = exports.prototypes = {
RxDocument: function RxDocument(proto) {
proto.update = update;
},
RxQuery: function RxQuery(proto) {
proto.update = RxQueryUpdate;
}
};
exports['default'] = {
rxdb: rxdb,
prototypes: prototypes
};
|
DN-debug/bauh
|
bauh/gems/snap/snapd.py
|
import socket
import traceback
from logging import Logger
from typing import Optional, List
from requests import Session
from requests.adapters import HTTPAdapter
from urllib3.connection import HTTPConnection
from urllib3.connectionpool import HTTPConnectionPool
from bauh.commons.system import run_cmd
URL_BASE = 'http://snapd/v2'
class SnapdConnection(HTTPConnection):
def __init__(self):
super(SnapdConnection, self).__init__('localhost')
def connect(self):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect("/run/snapd.socket")
class SnapdConnectionPool(HTTPConnectionPool):
def __init__(self):
super(SnapdConnectionPool, self).__init__('localhost')
def _new_conn(self):
return SnapdConnection()
class SnapdAdapter(HTTPAdapter):
def get_connection(self, url, proxies=None):
return SnapdConnectionPool()
class SnapdClient:
def __init__(self, logger: Logger):
self.logger = logger
self.session = self._new_session()
def _new_session(self) -> Optional[Session]:
try:
session = Session()
session.mount("http://snapd/", SnapdAdapter())
return session
except:
self.logger.error("Could not establish a connection to 'snapd.socker'")
traceback.print_exc()
def query(self, query: str) -> Optional[List[dict]]:
final_query = query.strip()
if final_query and self.session:
res = self.session.get(url=f'{URL_BASE}/find', params={'q': final_query})
if res.status_code == 200:
json_res = res.json()
if json_res['status-code'] == 200:
return json_res['result']
def find_by_name(self, name: str) -> Optional[List[dict]]:
if name and self.session:
res = self.session.get(f'{URL_BASE}/find?name={name}')
if res.status_code == 200:
json_res = res.json()
if json_res['status-code'] == 200:
return json_res['result']
def list_all_snaps(self) -> List[dict]:
if self.session:
res = self.session.get(f'{URL_BASE}/snaps')
if res.status_code == 200:
json_res = res.json()
if json_res['status-code'] == 200:
return json_res['result']
return []
def list_only_apps(self) -> List[dict]:
if self.session:
res = self.session.get(f'{URL_BASE}/apps')
if res.status_code == 200:
json_res = res.json()
if json_res['status-code'] == 200:
return json_res['result']
return []
def list_commands(self, name: str) -> List[dict]:
if self.session:
res = self.session.get(f'{URL_BASE}/apps?names={name}')
if res.status_code == 200:
json_res = res.json()
if json_res['status-code'] == 200:
return [r for r in json_res['result'] if r['snap'] == name]
return []
def is_running() -> bool:
status = run_cmd('systemctl is-active snapd.service snapd.socket', print_error=False)
if not status:
return False
else:
for status in status.split('\n'):
if status.strip().lower() == 'active':
return True
return False
|
acelaya/android-course
|
Fragments2/app/src/main/java/com/alejandrocelaya/fragments2/ListFragment.java
|
<reponame>acelaya/android-course
package com.alejandrocelaya.fragments2;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import com.alejandrocelaya.fragments2.entities.Email;
import java.util.Arrays;
import java.util.List;
/**
* Created by cta on 27/04/2015.
*/
public class ListFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.list_fragment, container, false);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
List<Email> emails = Arrays.asList(
new Email("Pepe", "First message", "Body one"),
new Email("Luis", "Very urgent!!", "Body two"),
new Email("Juan", "Hello!!", "You have won an iPad")
);
super.onActivityCreated(savedInstanceState);
}
private class EmailsAdapter extends ArrayAdapter<Email> {
public EmailsAdapter(Context context, int resource, List<Email> objects) {
super(context, resource, objects);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// LayoutInflater inflater = (LayoutInflater)
// getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// View row = inflater.inflate(R.layout.list_item, parent, false);
//
// return row;
return super.getView(position, convertView, parent);
}
}
}
|
SensiEDGE/SensiSUB6LoWPANGateway
|
Projects/Multi/Applications/LWM2M_to_IBM/Src/lwm2m-simple-server.c
|
<filename>Projects/Multi/Applications/LWM2M_to_IBM/Src/lwm2m-simple-server.c
/**
******************************************************************************
* @file lwm2m-simple-server.c
* @author Central LAB
* @version V1.0.0
* @date 11-April-2017
* @brief LWM2M simple server
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/*---------------------------------------------------------------------------*/
/* This file implements the Simple LWM2M Server core, so here we manage the
* Observations / Notifications, the loop of periodic GETs with their answers
* and we also process the command received from cloud and, in case it is a
* READ, the relevant one shot GET is sent and its response is processed.
* */
/*---------------------------------------------------------------------------*/
#include "ipso-objects.h"
#include "contiki-lib.h"
#include "contiki-net.h"
#include "uip-ds6.h"
#include "net/ip/resolv.h"
#include "net/ip/ip64-addr.h"
#include "rest-engine.h"
#include "net/ip/uip-debug.h"
#include "dev/temperature-sensor.h"
#include "er-coap.h"
#include "contiki.h"
#include "net/ip/uip.h"
#include "net/rpl/rpl.h"
#include "net/netstack.h"
#include "net/ip/uip-debug.h"
#include "er-coap-constants.h"
#include "er-coap-engine.h"
#include "er-coap-observe-client.h"
#include "lwm2m-engine.h"
#include "oma-tlv.h"
#include "dev/serial-line.h"
#include "serial-protocol.h"
#include "lwm2m-simple-server.h"
#include "json.h"
#include "jsonparse.h"
#include "lwm2m-data.h"
/*---------------------------------------------------------------------------*/
/** @addtogroup FP-NET-6LPWIFI1_Applications
* @{
*/
/** @addtogroup LWM2M_to_IBM
* @{
*/
/** @defgroup LWM2M_to_IBM_simple_server
* @{
*/
#define DEBUG DEBUG_NONE
// #define DEBUG DEBUG_PRINT
#if DEBUG
#include <stdio.h>
#define LWM2M_PRINTF(...) printf(__VA_ARGS__)
#else
#define LWM2M_PRINTF(...)
#endif
/*---------------------------------------------------------------------------*/
#define LWM2M_SERVER_ADDRESS_v6 "fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b:fe00:1"
#undef UIP_DS6_DEFAULT_PREFIX
#define UIP_DS6_DEFAULT_PREFIX 0xaaaa
/*---------------------------------------------------------------------------*/
#define ROUTER_PROCESS_TIMER 1 //in sec
#define JSON_VALUE_STRING_LEN 20
#define JSON_VALUE_NUM_LEN 10
/*---------------------------------------------------------------------------*/
typedef enum { Node, Path, Operation, Type, Value, Nd} state_value_t;
/*---------------------------------------------------------------------------*/
extern resource_t res_rd; /* RD "/rd" resource defined in lwm2m-resource-directory.c */
/*---------------------------------------------------------------------------*/
//Extern Data, from lwm2m-resource-directory.c
extern nodeInfo_t nodes_array[MAX_NODES_]; // Nodes Array structure to store all the information for each registered node
extern uint32_t numNode; // Number of registered nodes
/*---------------------------------------------------------------------------*/
//Extern declarations for data structures, from lwm2m-data.c
extern lwm2m_srv_data_res_t active_observations[MAX_OBS_];// Array of all the observable resources according to the Template
extern uint32_t numObs; // Number of Objects/Resources to be observed
extern lwm2m_srv_data_res_t active_get[MAX_GET_]; // Array of all the "gettable" resources according to the Template
extern uint32_t numGet; // Number of Objects/Resources to be periodically gotten
extern lwm2m_srv_cmd_res_t cmd_get[MAX_CMD_]; // Array of the commands for GETs coming from the cloud.
/*---------------------------------------------------------------------------*/
/*********** Variables and functions from main.c **************************/
extern char cloud_command_str[CMD_BUFFER_LEN];
/*---------------------------------------------------------------------------*/
static coap_observee_t *obs = NULL;
static uint32_t index_GET = 0;
static uint8_t cmd_id = 0;
static struct jsonparse_state state;
uint8_t type_value_ = RES_NONE;
/*---------------------------------------------------------------------------*/
PROCESS(oma_lwm2m_light_server, "OMA-LWM2M Light Server process");
PROCESS(command_process, "Command IBM process");
AUTOSTART_PROCESSES(&oma_lwm2m_light_server, &command_process);
/*---------------------------------------------------------------------------*/
/**
* @brief notification_callback
* Notification Callback to manage responses to observe requests, i.e.
* "Notifications".
* @param coap_observee_t *obs: Pointer to the observee structure related to this observation
* @param void *notification: Pointer to the notification (CoAP Response)
* @param coap_notification_flag_t flag: Response Code
* @retval None
*/
static void
notification_callback(coap_observee_t *obs, void *notification,
coap_notification_flag_t flag)
{
int len = 0;
oma_tlv_t tlv_notif_value;
const uint8_t *payload = NULL;
unsigned int format = 0;
int32_t value_obs = 0;
uint32_t curr_obs = 0;
LWM2M_PRINTF("[NOTIFICATION HANDLER]\n");
if (obs == NULL){
ERROR_OUT("Unexpected error, observee pointer is null.\n");
return ;
}
LWM2M_PRINTF("Observee URI: '%s'\n", obs->url);
if(notification) {
len = coap_get_payload(notification, &payload);
} else {
ERROR_OUT("ERROR IN NOTIFICATION CALLBACK: notification pointer is null.\n");
return ;
}
switch(flag) {
case OBSERVE_OK: /* server accepted observation request, First notification is handled here */
case NOTIFICATION_OK: /* notifications to handle, in the same way as the first reply */
LWM2M_PRINTF("NOTIFICATION OK\n");
LWM2M_PRINTF("CoAP notification packet from: ");
#if DEBUG
uip_debug_ipaddr_print(&obs->addr);
#endif
LWM2M_PRINTF(" , path: '%s', Observe: '%lu'\n", (char *) obs->url, obs->last_observe);
if (!get_observation_by_url(&obs->addr, obs->url, &curr_obs)){
printf("Unexpected error, no active observation for \n");
uip_debug_ipaddr_print(&obs->addr);
printf("/%s found.\n", obs->url);
return;
}
active_observations[curr_obs].flags = OPR_OBSERVED ;
LWM2M_PRINTF("Observation %lu, uri '%s', node_id %lu set to OPR_OBSERVED\n", curr_obs, active_observations[curr_obs].uri, active_observations[curr_obs].node_id );
coap_get_header_content_format(notification, &format);
if(format == LWM2M_TLV) {
if(oma_tlv_read(&tlv_notif_value, payload, len) > 0){
LWM2M_PRINTF("TLV.type='%d' len='%lu' id='%d' value='%ld'\n",
tlv_notif_value.type, tlv_notif_value.length, tlv_notif_value.id,
(int32_t)(*((int32_t *)tlv_notif_value.value)));
switch(active_observations[curr_obs].res_type) {
case RES_INT:
value_obs = oma_tlv_get_int32(&tlv_notif_value);
LWM2M_PRINTF("TLV_INT value: %ld\n", value_obs);
active_observations[curr_obs].value.valueInt = value_obs;
break;
case RES_FLOAT:
oma_tlv_float32_to_fix(&tlv_notif_value, &value_obs, LWM2M_FLOAT32_BITS);
LWM2M_PRINTF("TLV_FLOATFIX value: %ld\n", value_obs);
active_observations[curr_obs].value.valueFloat = value_obs;
break;
default:
LWM2M_PRINTF("Resource type error ('%d') in notification_callback()\n", active_observations[curr_obs].res_type);
break;
}
}
} else if(format == LWM2M_TEXT_PLAIN) {
switch(active_observations[curr_obs].res_type){
case RES_STRING:
LWM2M_PRINTF("STRING: '%*s'\n", len, (char*) payload);
strcpy(active_observations[curr_obs].value.valueString, (char *) payload);
break;
default:
LWM2M_PRINTF("Error in notification_callback()-> Format is TEXT PLAIN but argument ('%d') is not String\n", active_observations[curr_obs].res_type);
break;
}
}
break;
case OBSERVE_NOT_SUPPORTED:
printf("OBSERVE_NOT_SUPPORTED: %*s\n", len, (char *)payload);
obs = NULL;
break;
case ERROR_RESPONSE_CODE:
printf("ERROR_RESPONSE_CODE: %*s\n", len, (char *)payload);
obs = NULL;
break;
case NO_REPLY_FROM_SERVER:
printf("NO_REPLY_FROM_SERVER: "
"removing observe registration with token %x%x\n",
obs->token[0], obs->token[1]);
obs = NULL;
break;
}
}
/*----------------------------------------------------------------------------*/
/**
* @brief periodic_get_callback
* The callback for the periodic GETs, currently index_GET is used to
* identify the correct slot: it would be possible and clean to use the CoAP
* token, instead.
* @param void *response: Pointer to the CoAP Response
* @retval None
*/
static void
periodic_get_callback(void *response)
{
const uint8_t *chunk;
unsigned int format = 0;
char value_get_str[RES_STRING_LEN] = "";
int32_t value_get = 0;
int len = coap_get_payload(response, &chunk);
oma_tlv_t tlv;
LWM2M_PRINTF("[PERIODIC GET HANDLE] For request %lu\n", index_GET);
coap_get_header_content_format(response, &format);
if(len > 0) {
if(format == LWM2M_TLV){
if(oma_tlv_read(&tlv, chunk, len) > 0){
switch(active_get[index_GET].res_type) {
case RES_INT:
value_get = oma_tlv_get_int32(&tlv);
active_get[index_GET].value.valueInt = value_get;
break;
case RES_FLOAT:
oma_tlv_float32_to_fix(&tlv, &value_get, LWM2M_FLOAT32_BITS);
active_get[index_GET].value.valueFloat = value_get;
break;
default:
LWM2M_PRINTF("[PERIODIC GET HANDLE] Type Error ('%d')\n", active_get[index_GET].res_type);
}
LWM2M_PRINTF("[PERIODIC GET HANDLE] Value: '%ld'\n", (int32_t) value_get);
}
} else if(format == LWM2M_TEXT_PLAIN) {
if(active_get[index_GET].res_type == RES_STRING) {
memset(value_get_str, 0x00, sizeof(value_get_str));
strncpy(value_get_str, (char *) chunk, len);
strcpy((char*)active_get[index_GET].value.valueString, value_get_str);
LWM2M_PRINTF("Value_string '%*s'\n", len, value_get_str);
} else {
LWM2M_PRINTF("[PERIODIC GET HANDLE] Type Error ('%d')\n", active_get[index_GET].res_type);
}
}
}
}
/*----------------------------------------------------------------------------*/
/**
* @brief client_get_handle
* The callback for the GETs that are issued as per a single command
* received from cloud.
* @param void *response: Pointer to the CoAP Response
* @retval None
*/
static void
client_get_handle(void *response)
{
const uint8_t *chunk;
unsigned int format;
char value_get_str[RES_STRING_LEN] = "";
int32_t value_get = 0;
int len = coap_get_payload(response, &chunk);
oma_tlv_t tlv;
if (cmd_id >= MAX_CMD_){
ERROR_OUT("Unexpected value for cmd_id (%d), must be [0,%d]\n", (int) cmd_id, MAX_CMD_-1);
}
coap_get_header_content_format(response, &format);
LWM2M_PRINTF("[CLIENT GET HANDLE] --> (format = %d)\n", format);
if (len > 0) {
if(format == LWM2M_TLV) {
if(oma_tlv_read(&tlv,chunk,len) > 0) {
switch(cmd_get[cmd_id].res_type) {
case RES_INT:
value_get = oma_tlv_get_int32(&tlv);
add_command_get_response(cmd_id, (int32_t*)&value_get);
LWM2M_PRINTF("[CLIENT GET HANDLE] Value as Integer: '%ld'\n",value_get);
break;
case RES_FLOAT:
oma_tlv_float32_to_fix(&tlv, &value_get, LWM2M_FLOAT32_BITS);
add_command_get_response(cmd_id, (floatfix32_t *)&value_get);
LWM2M_PRINTF("[CLIENT GET HANDLE] Value as Float: '%ld'\n",value_get);
break;
case RES_STRING:
memcpy(value_get_str, tlv.value, MIN(tlv.length,sizeof(value_get_str)));
value_get_str[tlv.length] = '\0';
add_command_get_response(cmd_id, (char *)value_get_str);
LWM2M_PRINTF("[CLIENT GET HANDLE] Value as String: '%*s'",len,(char*)value_get_str);
break;
default:
ERROR_OUT("Unexpected error in res_type %d\n", cmd_get[cmd_id].res_type);
}
} else {
LWM2M_PRINTF("[CLIENT GET HANDLE] Failed to read TLV numeric response\n");
}
} else if(format == LWM2M_TEXT_PLAIN) {
if(cmd_get[cmd_id].res_type == RES_STRING){
memset(value_get_str, 0x00, sizeof(value_get_str));
strncpy(value_get_str, (char *) chunk, len);
add_command_get_response(cmd_id, (char *)value_get_str);
LWM2M_PRINTF("[CLIENT GET HANDLE] Value as String: '%*s'",len,(char*)value_get_str);
} else {
LWM2M_PRINTF("[CLIENT GET HANDLE] Type (%d) not accepted in TEXT PLAIN format\n", (int) cmd_get[cmd_id].res_type);
}
} else {
printf("[CLIENT GET HANDLE] Error Format : '%d'\n", format);
}
}
}
/*----------------------------------------------------------------------------*/
/**
* @brief client_put_handle
* The callback for the PUTs that are issued as per a single command
* received from cloud.
* @param void *response: Pointer to the CoAP Response
* @retval None
*/
static void
client_put_handle(void *response)
{
LWM2M_PRINTF("[WRITE COMMAND RESPONSE] Response to the PUT request -> ");
switch(((coap_packet_t *)response)->code){
case CHANGED_2_04:
LWM2M_PRINTF("CHANGED_2_04\n");
break;
case NOT_ACCEPTABLE_4_06:
LWM2M_PRINTF("NON_ACCEPTABLE_4_06: Format not acceptable\n");
break;
case METHOD_NOT_ALLOWED_4_05:
LWM2M_PRINTF("METHOD_NOT_ALLOWED_4_05: No Callback or Resource found\n");
}
}
/*----------------------------------------------------------------------------*/
/**
* @brief client_post_handler
* The callback for the POSTs that are issued as per a single command
* received from cloud.
* @param void *response: Pointer to the CoAP Response
* @retval None
*/
static void
client_post_handler(void *response)
{
LWM2M_PRINTF("[EXECUTE COMMAND RESPONSE] Response to the POST request -> ");
switch(((coap_packet_t *)response)->code){
case CHANGED_2_04:
LWM2M_PRINTF("CHANGED_2_04\n");
break;
case METHOD_NOT_ALLOWED_4_05:
LWM2M_PRINTF("METHOD_NOT_ALLOWED_4_05: No Callback or Resource found\n");
}
}
/*---------------------------------------------------------------------------*/
/**
* @brief setup_network
* Sets the Wireless Sensor Network (using the SPIRIT1 radio) up, by
* assigning to the LWM2M to IBM Gateway the predefined address and
* calling the RPL initialization function, in order to set this node
* as Root of the RPL tree.
* @param None
* @retval None
*/
static void
setup_network(void)
{
uip_ipaddr_t ipaddr;
struct uip_ds6_addr *root_if;
rpl_dag_t *dag;
int i;
uint8_t state;
#if UIP_CONF_ROUTER
/**
* The choice of server address determines its 6LoWPAN header compression.
* Obviously the choice made here must also be selected in udp-client.c.
*
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
* e.g. set Context 0 to fd00::. At present Wireshark copies Context/128 and then overwrites it.
* (Setting Context 0 to fdfd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b:2222:3333:4444 will report a 16 bit compressed address of fdfd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b:22ff:fe33:xxxx)
* Note Wireshark's IPCMV6 checksum verification depends on the correct uncompressed addresses.
*/
#if 0
/* Mode 1 - 64 bits inline */
uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 1);
#elif 1
/* Mode 2 - 16 bits inline */
// uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
//Serevr address is moved in a string defined at the beginning of the file, like in the code that is currently used for the nodes.
if(! uiplib_ip6addrconv(LWM2M_SERVER_ADDRESS_v6, &ipaddr)) {
printf("ERROR: the provided IPv6 address '%s' for LWM2M Server is not valid.\r\n", LWM2M_SERVER_ADDRESS_v6);
}
#else
/* Mode 3 - derived from link local (MAC) address */
uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif
uip_ds6_addr_add(&ipaddr, 0, ADDR_MANUAL);
root_if = uip_ds6_addr_lookup(&ipaddr);
if(root_if != NULL) {
dag = rpl_set_root(RPL_DEFAULT_INSTANCE, &ipaddr);
uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
rpl_set_prefix(dag, &ipaddr, 64);
LWM2M_PRINTF("created a new RPL dag\n");
} else {
LWM2M_PRINTF("failed to create a new RPL DAG\n");
}
#endif /* UIP_CONF_ROUTER */
printf("\r\nIPv6 addresses: \r\n");
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
if(state == ADDR_TENTATIVE || state == ADDR_PREFERRED) {
uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
printf("\r\n");
printf("\r\n");
/* hack to make address "final" */
if (state == ADDR_TENTATIVE) {
uip_ds6_if.addr_list[i].state = ADDR_PREFERRED;
}
}
}
}
/*---------------------------------------------------------------------------*/
/**
* @brief oma_lwm2m_light_server
* Contiki PROCESS_THREAD that implements the OMA LWM2M server that
* manages GETs and Observations
* @param process_event_t ev: As per Contiki Thread API
* @param process_data_t data: As per Contiki Thread API
* @retval None
*/
PROCESS_THREAD(oma_lwm2m_light_server, ev, data)
{
static uint32_t i = 0;
static uint32_t j = 0;
static coap_packet_t request[1];
static struct etimer timer;
PROCESS_BEGIN();
PROCESS_PAUSE();
/* receives all CoAP messages */
coap_init_engine();
setup_network();
/* The data sink runs with a 100% duty cycle in order to ensure high
packet reception rates. */
NETSTACK_MAC.off(1);
/* Initializes and starts the REST engine process*/
rest_init_engine();
/*Activates the resource*/
rest_activate_resource(&res_rd, LWM2M_RD_RESOURCE);
while(1) {
etimer_set(&timer, CLOCK_SECOND * ROUTER_PROCESS_TIMER);
PROCESS_YIELD();
LWM2M_PRINTF("[ROUTER_PROCESS] Executing OMA LWM2M Server process...\n");
/*Loop over all the object_resource elements contained in active_observation list
* - If the object_resource has to be observed, and is valid, an observe request is sent
* - If the object_resource has been observed (so an observation is running) but is
* not valid any more (because a cancellation has been requested from cloud),
* an observe cancellation is issued
* */
if(etimer_expired(&timer)){
for(i = 0; i < numObs; i++){
/*Here we send observation requests or we cancel them. */
if(active_observations[i].flags & OPR_TO_OBSERVE){
if (active_observations[i].valid == 1){
LWM2M_PRINTF("Sending observe request (%lu) for uri '%s' on node %lu\n",
i, active_observations[i].uri, active_observations[i].node_id);
obs = coap_obs_request_registration(&(active_observations[i].ipaddr),
REMOTE_PORT, active_observations[i].uri, notification_callback, NULL);
//active_observations[i].flags = OPR_OBSERVED;//moved in the callback to be on the safe side...
}
} else if (active_observations[i].flags & OPR_OBSERVED){
if (active_observations[i].valid == 0){
LWM2M_PRINTF("Removing observation (%lu) for uri '%s' on node %lu\n",
i, active_observations[i].uri, active_observations[i].node_id);
coap_obs_remove_observee_by_url(&(active_observations[i].ipaddr),
REMOTE_PORT, active_observations[i].uri);
active_observations[i].flags = OPR_NONE;
}
}
}
/*Loop over all the elements of active_get array and issue a CoAP GET for the valid ones. */
for(j = 0; j < numGet; j++){
if (active_get[j].valid == 1) {
LWM2M_PRINTF("[GET REQUEST %lu] Preparing the GET request at '%s'... \n", j, active_get[j].uri);
coap_init_message(request, COAP_TYPE_CON, COAP_GET, 0);
coap_set_header_uri_path(request, active_get[j].uri);
/*{ //In case we want to use the token to match the response, instead of index_GET...
uint8_t * token = NULL;
int token_len = coap_generate_token(&token);
coap_set_token(request, local_token, 8);
}*/
index_GET = j;
COAP_BLOCKING_REQUEST(&(active_get[j].ipaddr),
REMOTE_PORT, request, periodic_get_callback);
}
}
}
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/**
* @brief command_process
* Contiki PROCESS_THREAD that implements the parser for the JSON
* buffer containing a command from the cloud.
* @param process_event_t ev: As per Contiki Thread API
* @param process_data_t data: As per Contiki Thread API
* @retval None
*/
PROCESS_THREAD(command_process, ev, data)
{
PROCESS_BEGIN();
static coap_packet_t request[1];
int type = -1;
char str[JSON_VALUE_STRING_LEN]= "";
char path[JSON_VALUE_STRING_LEN] = "";
char cmd_value[JSON_VALUE_NUM_LEN] = "";
state_value_t current_Value = Nd;
int node_id = -1;
cloud_command_t cloud_command;
int value = 0;
LWM2M_PRINTF("[COMMAND PROCESS]\n");
while(1){
PROCESS_YIELD_UNTIL(ev == PROCESS_EVENT_POLL);
printf("\r\nProcessing IBM command: '%s'\r\n", cloud_command_str);
jsonparse_setup(&state, cloud_command_str, strlen(cloud_command_str));
/* Message Template: {"Node":node_id,
* "Path":"resource_path", (i.e. "object_id/isntance_id/resource_id")
* "Operation":"Read|Write|Execute|Observe|Cancel|PRead|CRead",
* "Type":"Int|Float|String",
* "Value":value}
*/
while((type = jsonparse_next(&state)) != 0){
if(type == JSON_TYPE_PAIR_NAME) {
if(jsonparse_strcmp_value(&state,"Node")==0){
current_Value = Node;
jsonparse_next(&state); // Parses the :
node_id = jsonparse_get_value_as_int(&state);
LWM2M_PRINTF("Node: %d\n", node_id);
} else if(jsonparse_strcmp_value(&state,"Path")==0){
current_Value = Path;
jsonparse_next(&state); //Parses the :
memset(path, 0x00, sizeof(path));
jsonparse_copy_value(&state,path,sizeof(path));
LWM2M_PRINTF("Path: '%*s'\n", strlen(path),path);
} else if(jsonparse_strcmp_value(&state,"Operation")==0){
current_Value = Operation;
jsonparse_next(&state); //Parses the :
memset(str, 0x00, sizeof(str));
jsonparse_copy_value(&state, str, sizeof(str));
if(!strcmp(str, "Read")){
cloud_command = Read;
LWM2M_PRINTF("Read Operation\n");
} else if(!strcmp(str, "Write")){
cloud_command = Write;
LWM2M_PRINTF("Write Operation\n");
} else if(!strcmp(str,"Execute")){
cloud_command = Execute;
LWM2M_PRINTF("Execute Operation\n");
} else if(!strcmp(str,"Cancel")){
cloud_command = Cancel;
LWM2M_PRINTF("Cancel Observation Operation\n");
} else if(!strcmp(str,"Observe")){
cloud_command = Observe;
LWM2M_PRINTF("Observe Operation\n");
} else if(!strcmp(str,"PRead")){
cloud_command = PeriodicRead;
LWM2M_PRINTF("Periodic Read Operation\n");
} else if(!strcmp(str,"CRead")){
cloud_command = CancelPeriodicRead;
LWM2M_PRINTF("Cancel Periodic Read Operation\n");
}
} else if(jsonparse_strcmp_value(&state,"Type")==0){
current_Value = Type;
jsonparse_next(&state); //Parses the :
memset(str, 0x00, sizeof(str));
jsonparse_copy_value(&state, str, sizeof(str));
if(!strcmp(str, "Int")){
type_value_ = RES_INT;
LWM2M_PRINTF("Int Type\n");
} else if(!strcmp(str, "Float")){
type_value_ = RES_FLOAT;
LWM2M_PRINTF("Float Type\n");
} else if(!strcmp(str,"String")){
type_value_ = RES_STRING;
LWM2M_PRINTF("String type\n");
}
} else if(jsonparse_strcmp_value(&state,"Value")==0){
current_Value = Value;
}
} else if(type == JSON_TYPE_NUMBER){
if(current_Value == Node){
node_id = jsonparse_get_value_as_int(&state);
LWM2M_PRINTF("Node: %d\n", node_id);
} else if(current_Value == Value){
value = jsonparse_get_value_as_int(&state);
LWM2M_PRINTF("Value: %d\n",value);
} else{
LWM2M_PRINTF("[COMMAND_PROCESS] Error in JSON\n");
}
}
}
/*We have parsed the JSON with the command from IBM Cloud, now we can translate this to the corresponding
* OMA LWM2M operation, i.e. CoAP Request. */
if((node_id >= 0) && (node_id < numNode)){
if(cloud_command == Read) {
LWM2M_PRINTF("GET request to '%s'...\n",path);
cmd_id = add_command_get(node_id, path, RES_FLOAT);
coap_init_message(request, COAP_TYPE_CON, COAP_GET, 0);
coap_set_header_content_format(request, LWM2M_TLV);
coap_set_header_uri_path(request, path);
COAP_BLOCKING_REQUEST(&nodes_array[node_id].ipaddr, REMOTE_PORT, request, client_get_handle);
} else if(cloud_command == Write) {
LWM2M_PRINTF("PUT request to '%s'...\n", path);
coap_init_message(request, COAP_TYPE_CON, COAP_PUT, 0);
coap_set_header_uri_path(request, path);
memset(cmd_value, 0x00, sizeof(cmd_value));
sprintf(cmd_value, "%d", value);
coap_set_header_content_format(request, LWM2M_TEXT_PLAIN);
coap_set_payload(request,cmd_value,sizeof(cmd_value));
COAP_BLOCKING_REQUEST(&nodes_array[node_id].ipaddr, REMOTE_PORT, request, client_put_handle);
} else if(cloud_command == Execute) {
LWM2M_PRINTF("POST request on '%s'...\n",path);
coap_init_message(request, COAP_TYPE_CON, COAP_POST, 0);
coap_set_header_uri_path(request, path);
memset(cmd_value, 0x00, sizeof(cmd_value));
sprintf(cmd_value, "%d", value);
coap_set_payload(request,cmd_value, sizeof(cmd_value));
COAP_BLOCKING_REQUEST(&nodes_array[node_id].ipaddr, REMOTE_PORT, request, client_post_handler);
} else if(cloud_command == Cancel) {
LWM2M_PRINTF("Cancel Observation request to '%s'\n",path);
if (!remove_observation(node_id, path)){
printf("ERROR: unable to cancel '%s' path from the Observations list.\n", path);
}
} else if(cloud_command == Observe) {
LWM2M_PRINTF("Observe request to '%s'...\n", path);
if (!add_observation(node_id, path, type_value_, path)){
printf("ERROR: unable to add '%s' path in the Observations list.\n", path);
}
} else if(cloud_command == PeriodicRead) {
LWM2M_PRINTF("New periodic Read request for '%s'...\n", path);
if (!add_periodic_read(node_id, path, type_value_, path)){
printf("ERROR: unable to add '%s' path in the periodic READ list.\n", path);
}
} else if(cloud_command == CancelPeriodicRead) {
LWM2M_PRINTF("Cancel Read request for '%s'...\n", path);
if (!remove_periodic_read(node_id, path)){
printf("ERROR: unable to cancel '%s' path from the periodic READ list.\n", path);
}
}
} else {
LWM2M_PRINTF("[COMMAND_PROCESS] Error: selected node ('%d') does not exist!!\n", node_id);
}
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
|
tonychew1986/algorand-ide
|
app/components/MainnetDisclaimer/messages.js
|
/*
* MainnetDisclaimer Messages
*
* This contains all the text for the MainnetDisclaimer component.
*/
import { defineMessages } from 'react-intl';
export const scope = 'app.components.MainnetDisclaimer';
export default defineMessages({
header: {
id: `${scope}.header`,
defaultMessage: 'This is the MainnetDisclaimer component!',
},
});
|
Will-Robin/NorthNet
|
NorthNet/Classes/data_classes.py
|
import numpy as np
from pathlib import Path
class Experiment_Information:
def __init__(self, name, path, parameters, modulation):
'''
name: str
path: str
parameters: dict
'''
self.name = name
self.path = path
self.parameters = parameters
self.modulation = modulation
class DataReport:
def __init__(self, file = ''):
'''
file: pathlib Path or str
Path to file
'''
self.filename = 'not specified'
self.experiment_code = 'not specified'
self.conditions = {}
self.analysis_details = {}
self.series_values = np.array([])
self.series_unit = 'not specified'
self.data = {}
self.errors = {}
if file == '':
pass
else:
self.read_from_file(file)
def import_file_section(self, file, start_token, end_token):
'''
Parameters
----------
file: path to file
start_token: str
String in line to start reading file from.
end_token:
String in line to end reading file from.
'''
spl_lin = lambda x : [e for e in x.strip('\n').split(',') if e != '']
readstate = False
c_set = []
with open(file, 'r', encoding = 'latin-1') as f:
for c,line in enumerate(f):
if start_token in line:
readstate = True
line = next(f)
if end_token in line:
readstate = False
if readstate:
newline = spl_lin(line)
c_set.append(newline)
return c_set
def read_from_file(self, file):
'''
Parameters
----------
file: pathlib Path or str
'''
spl_lin = lambda x : [e for e in x.strip('\n').split(',') if e != '']
if type(file) == str:
file = Path(file)
self.filename = file.name
with open(file, 'r', encoding = 'latin-1') as f:
for line in f:
ins = spl_lin(line)
if 'Dataset' in line:
self.experiment_code = ins[1]
condset = self.import_file_section(file, "start_conditions",
"end_conditions")
c_out = {}
for c in condset:
entry = [float(x) for x in c[1:]]
if len(entry) == 1:
self.conditions[c[0]] = entry[0]
else:
self.conditions[c[0]] = np.array(entry)
dataset = self.import_file_section(file, "start_data", "end_data")
transposed_datalines = [list(i) for i in zip(*dataset)]
d_out = {}
for s in transposed_datalines:
d_out[s[0]] = np.array([0 if x == 'nan' else float(x) for x in s[1:]])
self.series_unit = dataset[0][0]
self.series_values = d_out[self.series_unit]
del d_out[self.series_unit]
self.data = d_out
errors = self.import_file_section(file, "start_errors", "end_errors")
if len(errors) == 0:
self.errors = {d:np.zeros(len(self.series_values)) for d in self.data}
else:
transposed_error_lines = [list(i) for i in zip(*errors)]
errors_out = {}
for s in transposed_error_lines:
errors_out[s[0]] = np.array([0 if x == 'nan' else float(x) for x in s[1:]])
del errors_out[self.series_unit]
self.errors = errors_out
analysis = self.import_file_section(file, "start_analysis_details",
"end_analysis_details")
for a in analysis:
self.analysis_details[a[0]] = [x for x in a[1:]]
def rows_from_dict(self, dict_container):
'''
Converts the keys and values in a dict_container
into rows of a .csv file, organised in a list.
The values of dict_container are expected to be either iterable
(e.g. list of numpy array) or float/string variables.
Output is a list of strings
Parameters
----------
dict_container: dict
Returns
-------
output_lines: list
'''
output_lines = []
for c in dict_container:
line_str = f'{c},'
if type(dict_container[c]) == float:
line_str += f"{dict_container[c]}"
else:
for x in dict_container[c]:
line_str += f"{x},"
line_str = line_str.strip(',')
output_lines.append(line_str)
return output_lines
def columns_from_dict(self, dict_container):
'''
Converts the keys and values in a dict_container
into columns of a .csv file, organised in a list.
The values of dict_container are expected to be iterable
(e.g. list of numpy array).
Output is a list of strings
Parameters
----------
dict_container: dict
Returns
-------
output_lines: list
'''
output_lines = []
header = [*dict_container]
output_lines.append(','.join(header))
for c, v in enumerate(dict_container[header[0]]):
line_str = ''
for h in header:
line_str += f"{dict_container[h][c]},"
line_str = line_str.strip(',')
output_lines.append(line_str)
return output_lines
def to_string(self):
import numpy as np
if 'Chromatography_method' in self.analysis_details:
an_type = self.analysis_details['Chromatography_method'][0]
else:
an_type = 'not specified'
sorted_keys = sorted([*self.data], key = lambda x:x.count('C'))
p_header = [self.series_unit]
data_section = {self.series_unit: self.series_values}
for d in self.data:
data_section[d] = self.data[d]
error_section = {self.series_unit: self.series_values}
for e in self.errors:
error_section[d] = self.errors[d]
output_lines = []
output_lines.append(f"Dataset,{self.experiment_code}")
output_lines.append("start_conditions")
output_lines.extend(self.rows_from_dict(self.conditions))
output_lines.append("end_conditions")
output_lines.append("start_analysis_details")
output_lines.extend(self.rows_from_dict(self.analysis_details))
output_lines.append("end_analysis_details")
output_lines.append("start_data")
output_lines.extend(self.columns_from_dict(data_section))
output_lines.append("end_data")
output_lines.append("start_errors")
output_lines.extend(self.columns_from_dict(error_section))
output_lines.append("end_errors")
text = '\n'.join(output_lines)
return text
def write_to_file(self, filename = '', path = None):
'''
Parameters
----------
filename: str
name for file
path: pathlib Path object
Path to folder for file storage.
'''
if filename == '':
filename = self.filename
elif not filename.endswith('.csv'):
filename = filename + '.csv'
if path == None:
fname = filename
else:
fname = path/filename
with open(fname, 'w') as outfile:
f.write(self.to_string())
def find_repeat_data_entries(self):
'''
Find compound entries which are repeated in self.data
'''
entries = []
repeat_entries = []
for d in self.data:
token = d.split(' ')[0]
if token in entries:
repeat_entries.append(token)
entries.append(token)
return list(set(repeat_entries))
def remove_repeat_entries(self):
'''
Remove compound entries which are repeated in self.data
'''
import numpy as np
# deleting duplicate entries: taking the entry with the higher signal using the
# signal sum as a discriminant.
repeat_entries = self.find_repeat_data_entries()
for r in repeat_entries:
compare_keys = []
for d in self.data:
if r in d:
compare_keys.append(d)
checkline = np.zeros(len(compare_keys))
for c,comp in enumerate(compare_keys):
checkline[c] = np.sum(self.data[comp])
i_min = np.argmin(checkline)
del self.data[compare_keys[i_min]]
def remove_specific_entries(self,remove_list):
'''
remove entries in remove list from self.data
Parameters
----------
remove_list: list
List of entries to remove from self.data
'''
for r in remove_list:
del self.data[r]
def remove_entries_below_threshold(self, threshold):
'''
remove entries whose maximum value does not exceed threshold
Parameters
----------
threshold: float
threshold below which entries will be removed.
'''
import numpy as np
# remove entries whose concentrations/integrals do not cross a defined boundary
del_list = []
for d in self.data:
if np.amax(self.data[d]) < threshold:
del_list.append(d)
self.remove_specific_entries(del_list)
class DataSet:
'''
Container for multiple data reports
'''
def __init__(self, data_reports = []):
'''
data_reports: list of NorthNet DataReport objects
data reports to create the data set
'''
self.data_reports = {}
self.compounds = []
if len(data_reports) == 0:
pass
else:
for d in data_reports:
self.add_data_report(d)
def add_data_report(self, data_report):
'''
Add data report to DataSet
data_report: NorthNet DataReport
DataReport to be added.
'''
self.data_reports[len(self.data_reports)+1] = data_report
for d in data_report.data:
if d not in self.compounds:
self.compounds.append(d)
def find_entry(self,entry_name):
'''
Get the series_values and values of a given compound.
entry_name: str
Key to the compound in DataReport.data, e.g. [C=O]/ M
Returns: tuple of 1D numpy arrays
(series_values, variable)
'''
x_ax = np.array([])
y_ax = np.array([])
for d in self.data_reports:
if entry_name in self.data_reports[d].data:
y_ax = np.hstack((y_ax, self.data_reports[d].data[entry_name]))
x_ax = np.hstack((x_ax, self.data_reports[d].series_values))
return x_ax, y_ax
def get_entry(self, entry_name):
'''
Wrapper for find_entry(). Sorts the arrays so x_ax values are increasing
with increasing index.
entry_name: str
Key to the compound in DataReport.data, e.g. [C=O]/ M
Returns: tuple of 1D numpy arrays
(series_values, variable)
'''
x_ax, y_ax = self.find_entry(entry_name)
i = np.argsort(x_ax)
x_ax = x_ax[i]
y_ax = y_ax[i]
return x_ax, y_ax
def get_entry_indices(self,entry):
'''
Get the indices which order the data so x_ax values are increasing
with increasing index.
entry: str
Key to the compound in DataReport.data, e.g. [C=O]/ M
returns: i
numpy array of int
'''
x_ax, y_ax = self.find_entry(entry)
i = np.argsort(x_ax)
return i
|
JrGoodle/djinni
|
test-suite/generated-src/objc/DBPrimitiveList.h
|
<gh_stars>1000+
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primitive_list.djinni
#import <Foundation/Foundation.h>
@interface DBPrimitiveList : NSObject
- (nonnull instancetype)initWithList:(nonnull NSArray<NSNumber *> *)list;
+ (nonnull instancetype)primitiveListWithList:(nonnull NSArray<NSNumber *> *)list;
@property (nonatomic, readonly, nonnull) NSArray<NSNumber *> * list;
@end
|
pcaston/core
|
openpeerpower/components/thethingsnetwork/__init__.py
|
<reponame>pcaston/core
"""Support for The Things network."""
import voluptuous as vol
import openpeerpower.helpers.config_validation as cv
CONF_ACCESS_KEY = "access_key"
CONF_APP_ID = "app_id"
DATA_TTN = "data_thethingsnetwork"
DOMAIN = "thethingsnetwork"
TTN_ACCESS_KEY = "ttn_access_key"
TTN_APP_ID = "ttn_app_id"
TTN_DATA_STORAGE_URL = (
"https://{app_id}.data.thethingsnetwork.org/{endpoint}/{device_id}"
)
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Schema(
{
vol.Required(CONF_APP_ID): cv.string,
vol.Required(CONF_ACCESS_KEY): cv.string,
}
)
},
extra=vol.ALLOW_EXTRA,
)
async def async_setup(opp, config):
"""Initialize of The Things Network component."""
conf = config[DOMAIN]
app_id = conf.get(CONF_APP_ID)
access_key = conf.get(CONF_ACCESS_KEY)
opp.data[DATA_TTN] = {TTN_ACCESS_KEY: access_key, TTN_APP_ID: app_id}
return True
|
leoclee/agent
|
src/main/java/org/nhindirect/stagent/cert/impl/UniformCertificateStore.java
|
/*
Copyright (c) 2010, NHIN Direct Project
All rights reserved.
Authors:
<NAME> <EMAIL>
<NAME> <EMAIL>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution. Neither the name of the The NHIN Direct Project (nhindirect.org).
nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.nhindirect.stagent.cert.impl;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import javax.mail.internet.InternetAddress;
import org.nhindirect.stagent.cert.CertificateResolver;
import org.nhindirect.stagent.cert.X509Store;
/**
* Certificate store when an entire organization is represented by a single certificate. This should not be used if a single agent instance is
* used to manage multiple organizations/domains.
* @author <NAME>
*
*/
public class UniformCertificateStore implements CertificateResolver
{
private Collection<X509Certificate> certs;
public UniformCertificateStore(X509Certificate cert)
{
certs = new ArrayList<X509Certificate>();
certs.add(cert);
}
public UniformCertificateStore(Collection<X509Certificate> certs)
{
setCertificates(certs);
}
public UniformCertificateStore(X509Store certs)
{
if (certs == null)
{
throw new IllegalArgumentException();
}
this.setCertificates(certs.getAllCertificates());
}
public void setCertificates(Collection<X509Certificate> certs)
{
if (certs == null || certs.size() == 0)
{
throw new IllegalArgumentException("Empty or null certificates are not allowed");
}
this.certs = new ArrayList<X509Certificate>(certs);
}
public Collection<X509Certificate> getCertificates(InternetAddress address)
{
if (address == null)
{
throw new IllegalArgumentException();
}
return Collections.unmodifiableCollection(certs);
}
}
|
lanpinguo/apple-sauce
|
util/rpc/rpcclt/include/rpcclt_support.h
|
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2001-2014
*
**********************************************************************
*
* @filename rpcclt_support.h
*
* @purpose RPC client wrapper support header file.
*
* @component luaweb
*
* @comments
*
* @end
*
**********************************************************************/
#ifndef _RPCCLT_SUPPORT_H
#define _RPCCLT_SUPPORT_H
#include "ofdpa_datatypes.h"
#include "rpcclt_api.h"
#include "rpcclt_msg.h"
#include "rpccom_support.h"
#include "rpc_common.h"
/* predefined macros to manipulate the output parms mask field */
#define RPCCLT_OUTPARMSMASK_FLAG_GET(_ptr, _pos) \
((_ptr)->outParmsMask & (0x80000000 >> (_pos)))
#define RPCCLT_OUTPARMSMASK_FLAG_SET(_ptr, _pos) \
((_ptr)->outParmsMask | (0x80000000 >> (_pos)))
#define RPCCLT_OUTPARMSMASK_FLAG_CLR(_ptr, _pos) \
((_ptr)->outParmsMask & ~(0x80000000 >> (_pos)))
typedef void * rpccltVaParm_t; /* type used for variable arg pointers */
/* input parameter description definition */
typedef struct
{
int16_t fieldSize; /* message field size for parm */
} rpccltParmDesc_t;
/* function table entry definition */
typedef struct
{
void *cltfn; /* client function name (generic, for identification only) */
RPCCOM_DEVMSG_FLAGS_t flags; /* message flags */
uint32_t outParmsMask; /* bit mask denoting output parameters */
int32_t numParms; /* number of input parameters */
rpccltParmDesc_t parmIdx[RPC_DEVMSG_PARMS_MAX]; /* index list of each input parameter */
} rpccltFtableEnt_t;
/* function prototypes -- client side */
extern OFDPA_ERROR_t rpccltMsgAlloc(rpccltProcParms_t *proc,
rpccomDevmsg_t **ppmsg);
extern void rpccltMsgFree(rpccltProcParms_t *proc,
rpccomDevmsg_t **ppmsg);
extern void rpccltMsgBegin(rpccltProcParms_t *proc,
rpccomDevmsg_t *pmsg, RPCCOM_DEVMSG_GRP_t group,
uint32_t type, RPCCOM_DEVMSG_FLAGS_t flags);
extern void rpccltMsgParmAdd(rpccltProcParms_t *proc,
rpccomDevmsg_t *pmsg, int32_t fieldSize,
uint8_t *parmVal, BOOL isBufferArg);
extern void rpccltMsgEnd(rpccltProcParms_t *proc, rpccomDevmsg_t *pmsg);
extern OFDPA_ERROR_t rpccltMsgSend(rpccltProcParms_t *proc, rpccomDevmsg_t *pmsg);
extern void rpccltMsgDump(rpccltProcParms_t *proc, rpccomDevmsg_t *pmsg, int8_t *title);
extern void rpccltMsgFlagsConvert(RPCCOM_DEVMSG_FLAGS_t flags,
rpccltDevmsgFlg_e *msgflags);
extern void rpccltSuppWrapperCommon(int fid, va_list args, RPCCOM_DEVMSG_GRP_t msgGrp, rpccltFtableEnt_t **ftable);
/* Group-specific declarations follow */
/* OFDPA group -- client side */
extern rpccltFtableEnt_t *rpcclt_ofdpa_ftable_g[];
extern void rpccltOfdpaFtableInit(void);
extern void rpccltSuppWrapperOfdpa(int fid, ...);
#endif /* _RPCCLT_SUPPORT_H */
|
sundayios/DTCoreTextLayout
|
Pods/Headers/Public/DTRichTextEditor/DTTextSelectionView.h
|
<filename>Pods/Headers/Public/DTRichTextEditor/DTTextSelectionView.h
//
// DTTextSelectionView.h
// DTRichTextEditor
//
// Created by <NAME> on 7/7/11.
// Copyright 2011 Cocoanetics. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
The type of a selection
*/
typedef NS_ENUM(NSUInteger, DTTextSelectionStyle)
{
/**
Selection is a regular selection range
*/
DTTextSelectionStyleSelection = 0,
/**
Selection is marking range, as for multi-stage text input
*/
DTTextSelectionStyleMarking
};
@class DTTextSelectionView;
/**
A view that shows selection rectangles for an editor.
*/
@interface DTTextSelectionView : UIView
/**
@name Creating a Selection View
*/
/**
Designated Initializer. Creates a selection view for a given text view
@param view The text view that this selection view shows selections for
@returns An initialized selection view
*/
- (id)initWithTextView:(UIView *)view;
/**
@name Accessing Subviews
*/
/**
The text view that the receiver belongs to
*/
@property (nonatomic, readonly) UIView *textView;
/**
The image view that represents the left drag handle.
*/
@property (nonatomic, retain) UIImageView *dragHandleLeft;
/**
The image view that represents the right drag handle.
*/
@property (nonatomic, retain) UIImageView *dragHandleRight;
/**
@name Customizing the Look
*/
/**
The current selection style of the receiver.
Support are blue selection and green marking style.
- DTTextSelectionStyleSelection
- DTTextSelectionStyleMarking
*/
@property (nonatomic, assign) DTTextSelectionStyle style;
/**
The caret color to use next to the ranged selection drag handles
*/
@property (nonatomic, retain) UIColor *cursorColor;
/**
@name Working with Selection Rectangles
*/
/**
The selection rectangles to display in the receiver
*/
@property (nonatomic, retain) NSArray *selectionRectangles;
/**
Customized setter for selectionRectangles that optionally animates the selection change
@param selectionRectangles The selection rectangles to set
@param animated Whether the change of selection rectangles should be animated
*/
- (void)setSelectionRectangles:(NSArray *)selectionRectangles animated:(BOOL)animated;
/**
@name Working with Drag Handles
*/
/**
Specifies whether the drag handles are visible
*/
@property (nonatomic, assign) BOOL dragHandlesVisible;
/**
Customized setter to optionally show/hide the drag handles with a fading animation
@param dragHandlesVisible `YES` to make the drag handles visible, `NO` to hide them
@param animated Whether the change of visibility of the drag handles should be animated
*/
- (void)setDragHandlesVisible:(BOOL)dragHandlesVisible animated:(BOOL)animated;
/**
@name Getting Information
*/
/**
The frame rectangle of the beginning caret of a selected range
*/
- (CGRect)beginCaretRect;
/**
The frame rectangle of the ending caret of a selected range
*/
- (CGRect)endCaretRect;
/**
A frame rectangle the envelops the entire selection
*/
- (CGRect)selectionEnvelope;
/**
@name Layout
*/
/**
Lays out the subviews of the receiver with a provided visible rectangle
@param rect The rectangle in which to lay out the subviews
*/
- (void)layoutSubviewsInRect:(CGRect)rect;
@end
|
alpaca-tc/language_server-rails
|
spec/language_server_rails/service/hover_service_spec.rb
|
<filename>spec/language_server_rails/service/hover_service_spec.rb
# frozen_string_literal: true
RSpec.describe LanguageServerRails::Service::HoverService do
describe do
shared_context 'jsonrpc fixture' do |path, prefix: ''|
fixture_path = File.expand_path('../../../fixtures/jsonrpc', __FILE__)
let(:"#{prefix}params") do
deep_replace(public_send("#{prefix}jsonrpc_content"), '$FILE', public_send("#{prefix}file_path"))
end
let(:"#{prefix}jsonrpc_path") do
File.join(fixture_path, path, 'jsonrpc.json')
end
let(:"#{prefix}jsonrpc_content") do
JSON.parse(File.read(public_send("#{prefix}jsonrpc_path")), symbolize_names: true)
end
let(:"#{prefix}file_path") do
'file://' + File.join(fixture_path, path, 'file.rb')
end
let(:"#{prefix}file_content") do
File.read(public_send("#{prefix}file_path"))
end
def deep_replace(hash, target, string)
new_hash = {}
hash.each do |key, value|
new_hash[key] = if value.is_a?(Hash)
deep_replace(value, target, string)
elsif value == target
string
else
value
end
end
new_hash
end
end
describe '#do_hover' do
include_context 'jsonrpc fixture', 'hover/single_file'
subject { described_class.new(params).do_hover }
it do |_example|
subject
end
# let(:params) do
# {
# jsonrpc: '2.0',
# method: 'textDocument/hover',
# id: 1,
# params: {
# textDocument: {
# uri: '$FILE'
# },
# position: {
# line: 1,
# character: 3
# }
# }
# }
# end
end
end
end
|
webdevhub42/Lambda
|
WEEKS/CD_Sata-Structures/general/practice/minimumOnStack/solution.py
|
import re
def minimumOnStack(operations):
l = []
out = []
for i in operations:
if "push" in i:
l.append(int(i[i.index(" ") + 1 :]))
elif "pop" in i:
l.pop()
else:
out.append(min(l))
return out
operations = [
"push 10",
"min",
"push 5",
"min",
"push 8",
"min",
"pop",
"min",
"pop",
"min",
]
print(minimumOnStack(operations))
|
Swan-Finance-Inc/swan_ico
|
app/containers/SecurityPage/index.js
|
<filename>app/containers/SecurityPage/index.js
/**
*
* SecurityPage
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
import { Redirect } from 'react-router';
import { Helmet } from 'react-helmet';
import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer';
import makeSelectSecurityPage, { makeSelectEnable, makeSelectResponse, makeSelectDisable, makeSelectQr,
makeSelectVerified, makeSelectQrKey, makeSelectActivityRet, makeSelectLoadActivitySuccess, makeSelectActivityStatus } from './selectors';
import { enable2fa, disable2fa, success2fa, verify2fa, saveActivity, removeActivitySuccess, loadActivityStatus } from './actions';
import reducer from './reducer';
import saga from './saga';
import { makeGlobalParent } from '../App/selectors';
import { ToastContainer, toast } from 'react-toastify';
import {CopyToClipboard} from 'react-copy-to-clipboard';
import Activity from 'containers/Activity/Loadable';
import Info from "../../components/Info";
import Switch from 'react-toggle-switch';
export class SecurityPage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
constructor(props) {
super(props);
this.securityCheck = this.securityCheck.bind(this);
this.disableCheck = this.disableCheck.bind(this);
this.state = {
//@aj
infoShow: false,
imageBase64: '',
check: false,
enabled: false,
copy: false,
activityLog:false,
withdrawlSwitch:false,
loginSwitch:false,
resetPasswordSwitch:false,
showLogs:false
};
this.verifyAuth = this.verifyAuth.bind(this);
this.disableAuth = this.disableAuth.bind(this);
}
handleInfoModal = () => {
this.setState({
infoShow: !this.state.infoShow
});
console.log('infoShow : ', this.state.infoShow);
}
componentDidMount() {
// console.log(this.props.verified)
// console.log(this.props.global.fa_enabled)
// console.log(this.props.global.fa_disabled)
// console.log(this.state.enabled)
// this.props.loadActivityStatus()
if (this.props.global.fa_enabled) {
document.getElementById('2fa').checked = true;
this.setState({
enabled: true,
});
}
if(this.props.ActivityStatus){
this.setState({
activityLog:true
})
}
// else if(this.props.activityStatus) {
// this.setState({
// activityLog:this.props.activityStatus
// })
// }
else{
this.setState({
activityLog:this.props.activityStatus
})
}
// if(this.props.activityStatus || this.props.ActivityStatus){
// document.getElementById('activityLog').checked = true;
//
// }
}
componentWillReceiveProps(nextProps) {
if(nextProps.saveActivityRet){
if(nextProps.saveActivityRet.success){
toast.success(nextProps.saveActivityRet.message)
this.setState({
activityLog:nextProps.saveActivityRet.saveActivityLogs
})
nextProps.removeActivitySuccess()
}
else{
toast.error(nextProps.saveActivityRet.message)
nextProps.removeActivitySuccess()
}
}
// console.log(nextProps)
this.setState({
imageBase64: nextProps.qrCode,
});
}
notifySuccess(message) {
toast.success(message);
}
notifyError(message) {
toast.error(message);
}
securityCheck() {
// console.log("selected")
this.setState({
copy : false
})
const fa = document.getElementById('2fa');
this.props.enable2fa();
if (fa.checked && !this.state.check) {
this.setState({
check: true,
});
// console.log(this.props.global.fa_disabled)
} else if ((!fa.checked)) {
this.setState({
check: false,
});
}
}
disableCheck() {
if (this.state.check) {
this.setState({
check: false,
enabled: false,
});
// console.log(this.props.global.fa_disabled)
}
}
verifyAuth(e) {
e.preventDefault();
this.setState({
check: true,
enabled: true,
});
this.props.verify2fa(e.target[0].value);
}
disableAuth() {
this.props.disable2fa();
this.setState({
enabled: false,
check: false,
});
}
handleSaveActivityLog=(e)=>{
console.log(" inside save Activity log Handler")
this.props.saveActivity({
saveActivityLogs:!this.state.activityLog
})
}
handleShowLogs=(e)=>{
this.setState({
showLogs:!this.state.showLogs
})
}
resetInfo=()=>{
this.props.toggleInfo()
}
render() {
console.log(this.state," State in security Page")
console.log(this.props," props in security Page")
if(this.props.response){
if(this.props.response.success){
this.notifySuccess(this.props.response.message);
// this.props.resetSuccess();
}
if(!this.props.response.success){
this.notifyError(this.props.response.message);
}
}
if (!localStorage.token) {
return <Redirect to="/" />;
}
return (
<div id="content" className="ui-content ui-content-aside-overlay">
<div className="ui-content-body">
<Helmet>
<title>Security</title>
<meta name="description" content="Description of Security" />
</Helmet>
<div className="ui-container container-fluid">
<div className="" style={{ marginBottom: '500px' }}>
{/* <div className="panel panel-default" style={{boxShadow:'0px 3px 6px #2D6DCD6E'}}>
<div className="setting-panel-heading" >
2FA
</div>
<div className = "panel-body first-card" >
<div className="row" style={{borderBottom:'1px solid #2D6DCD6E',padding:'20px 10px'}} >
<div className="col col-md-12" >
<div>
<span style={{color:'#00296B',fontWeight:'bold'}} >Security Key </span>Recommended: YubiKey
<button className="security-button" > Setup</button>
</div>
<a style={{color:'#465490',textDecoration:'underline'}} >What is security Key</a>
<div style={{color:'#7C7C7C',padding:'10px 0px',fontSize:'12px'}} >Protected Action</div>
<div className="row" >
<div className="col col-md-2" style={{borderRight:'1px solid #2D6DCD6E'}} >
<span style={{color:'#7C7C7C',fontSize:'12px'}}>
withdrawl & API
</span>
<div style={{float:'right'}} >
<Switch onClick={()=>this.setState((prevState)=>({withdrawlSwitch:!prevState.withdrawlSwitch}))} on = {this.state.withdrawlSwitch} />
</div>
</div>
<div className="col col-md-2" style={{color:'#7C7C7C',borderRight:'1px solid #2D6DCD6E',fontSize:'12px'}} >
Login
<div style={{float:'right'}}>
<Switch onClick={()=>this.setState((prevState)=>({loginSwitch:!prevState.loginSwitch}))} on = {this.state.loginSwitch}/>
</div>
</div>
<div className="col col-md-2" style={{color:'#7C7C7C',fontSize:'12px'}}>
Reset Password
<div style={{float:'right'}}>
<Switch onClick={()=>this.setState((prevState)=>({resetPasswordSwitch:!prevState.resetPasswordSwitch}))} on = {this.state.resetPasswordSwitch}/>
</div>
</div>
</div>
</div>
</div>
<div className="row" style={{borderBottom:'1px solid #2D6DCD6E',padding:'20px 10px'}} >
<div className ='col col-md-6' >
<div>
<span style={{color:'#00296B',fontWeight:'bold'}} >
Google Authentication
</span>
<br/>
<span style={{color:'#7C7C7C'}} >
Used for withdrawals and security modifications
</span>
<br/>
<a style={{color:'#465490',textDecoration:'underline'}} >
Having trouble with your Google Authenticator?
</a>
</div>
</div>
<div className='col col-md-6'>
<div>
<button className="security-button">Enable</button>
</div>
</div>
</div>
<div className="row" style={{padding:'20px 10px'}} >
<div className="col col-md-12" >
<span style={{color:'#00296B'}} >
SMS Authentication
</span>
<br/>
<span style={{color:'#7C7C7C'}} >
Used for withdrawals and security modifications
</span>
<div>
<button className="security-button">ON</button>
</div>
</div>
</div>
</div>
</div> */}
<div className="panel panel-default">
<div className="setting-panel-heading">
{
!!this.props.flag ?
<Info hanldeToggle={this.resetInfo} toggleFlag={this.state.infoShow} />
:
null
}
2FA
</div>
<div className="panel-body" style={{fontSize:'16px'}}>
<div className="row">
<div className="col-sm-12">
{
(this.props.global.fa_enabled && this.state.enabled) ?
<div>
<button onClick={this.disableAuth} className="form-button" style={{ marginTop: '10px' }}>Disable 2fa</button>
</div> :
(!this.state.check) ? <form>
<div className="checkbox">
<label>
<input id="2fa" type="checkbox" onChange={this.securityCheck} />
Enable Two-Factor Authentication via Google Authenticator
</label>
</div>
</form> :
(this.state.check) ?
<div>
<form>
<div className="checkbox">
<label>
<input id="2fa2" type="checkbox" checked onChange={this.disableCheck} />
Enable Two-Factor Authentication via Google Authenticator
</label>
</div>
</form>
<form onSubmit={this.verifyAuth}>
<div className="row">
<div className="col-sm-6 text-center">
<img src={`data:image/jpeg;${this.state.imageBase64}`} />
</div>
<div className="col-sm-5 bal-card qrKey">
<h3>Manual Key : </h3>
<span><h4 style={{wordWrap: 'break-word'}} id="qrKey">{this.props.qrKey}</h4></span>
<CopyToClipboard text={this.props.qrKey}
onCopy={() => this.setState({copy: true})}>
<span className="btn btn-primary">Copy</span>
</CopyToClipboard>
<h4>{ this.state.copy ? 'Key copied' : '' }</h4>
</div>
</div>
<div className="form-group">
<label htmlFor="otp" className="form-label"> Scan QR code from authenticator app to get your 2FA code</label>
<input id="otp" type="number" name="otp" className="form-input form-control" placeholder="Your 2fa code" required />
</div>
<div className="text-center">
<button type="submit" className="form-button" style={{ marginTop: '10px',backgroundColor:'#2498D5' }}>Verify</button>
</div>
</form>
</div>
: <div></div>
}
</div>
</div>
</div>
</div>
<div className="panel panel-default" style={{boxShadow:'0px 3px 6px #2D6DCD6E'}}>
{/*<div className="panel-heading">Save Activity Log</div>*/}
<div className="setting-panel-heading">
{/* <Info hanldeToggle={this.resetInfo} toggleFlag={this.state.infoShow} /> */}
{
!!this.props.flag ?
<Info hanldeToggle={this.resetInfo} toggleFlag={this.state.infoShow} />
:
null
}
Save Activity Log
</div>
<div className="panel-body" style={{fontSize:'16px'}}>
<div className="row">
<div className="col-sm-12">
<div className="checkbox">
{/* <input id="activityLog" checked={this.state.activityLog} type="checkbox" onChange={this.handleSaveActivityLog} /> */}
<div style={{display:'flex'}} >
<div className='first-card' style={{color:'#7C7C7C',fontWeight:'bold'}}> Save My Activity Log</div>
<div style={{marginLeft:'50px'}}>
<Switch onClick={this.handleSaveActivityLog} on={this.state.activityLog}/>
</div>
</div>
</div>
</div>
</div>
<div className='row'>
<div className='text-center'>
<button className="invest" style={{background : '#2498D5',fontSize:'20px',fontWeight:'bold'}} onClick={this.handleShowLogs} >{this.state.showLogs?'Hide Log':'Show Log'}</button>
</div>
</div>
<div className='row'>
{this.state.showLogs && <Activity />}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
}
SecurityPage.propTypes = {
dispatch: PropTypes.func.isRequired,
};
const mapStateToProps = createStructuredSelector({
securitypage: makeSelectSecurityPage(),
enabled: makeSelectEnable(),
qrCode: makeSelectQr(),
global: makeGlobalParent(),
disabled: makeSelectDisable(),
verified: makeSelectVerified(),
response: makeSelectResponse(),
qrKey: makeSelectQrKey(),
saveActivityRet:makeSelectActivityRet(),
loadActivitySucces:makeSelectLoadActivitySuccess(),
ActivityStatus:makeSelectActivityStatus()
});
function mapDispatchToProps(dispatch) {
return {
dispatch,
enable2fa: () => dispatch(enable2fa()),
disable2fa: () => dispatch(disable2fa()),
success2fa: (data) => dispatch(success2fa(data)),
verify2fa: (data) => dispatch(verify2fa(data)),
saveActivity: (data) => dispatch(saveActivity(data)),
removeActivitySuccess: (data) => dispatch(removeActivitySuccess(data)),
loadActivityStatus: (data) => dispatch(loadActivityStatus(data))
};
}
const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withReducer = injectReducer({ key: 'securityPage', reducer });
const withSaga = injectSaga({ key: 'securityPage', saga });
export default compose(
withReducer,
withSaga,
withConnect,
)(SecurityPage);
|
SUSE/azure-sdk-for-python
|
azure-mgmt/tests/test_mgmt_recoveryservices_backup.py
|
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import unittest
import azure.mgmt.recoveryservicesbackup
from testutils.common_recordingtestcase import record
from tests.mgmt_testcase import AzureMgmtTestCase
from tests.recoveryservicesbackup_testcase import MgmtRecoveryServicesBackupTestDefinition, MgmtRecoveryServicesBackupTestHelper
class MgmtRecoveryServicesBackupTests(AzureMgmtTestCase):
def setUp(self):
super(MgmtRecoveryServicesBackupTests, self).setUp()
self.client = self.create_mgmt_client(
azure.mgmt.recoveryservicesbackup.RecoveryServicesBackupClient
)
# Using pre-existing vault until vault client is available
self.resource_group = "PythonSDKBackupTestRg"
self.vault_name = "PySDKBackupTestRsVault"
self.test_definition = MgmtRecoveryServicesBackupTestDefinition(self.settings.SUBSCRIPTION_ID, self.vault_name, self.resource_group)
self.test_helper = MgmtRecoveryServicesBackupTestHelper(self)
@record
def test_iaasvm_e2e(self):
self.test_helper.enable_protection(self.test_definition.container_name, self.test_definition.vm_name, "DefaultPolicy")
protected_items = self.test_helper.list_protected_items()
self.assertIsNotNone(protected_items)
protected_items = list(protected_items)
protected_item = next(protected_item for protected_item in protected_items if protected_item.name.lower() == self.test_definition.container_name.lower()).properties
# Trigger Backup
backup_job_id = self.test_helper.trigger_backup(self.test_definition.container_name, self.test_definition.vm_name)
# self.test_helper.wait_for_job_completion(backup_job_id)
self.sleep(45 * 60) # Sleep for 45 minutes to let backup complete
# TODO: Once backup jobs API is fixed. Remove this hack
recovery_points = self.test_helper.list_recovery_points(self.test_definition.container_name, self.test_definition.vm_name)
self.assertIsNotNone(recovery_points)
recovery_points = list(recovery_points)
self.assertTrue(any(recovery_points))
recovery_point = recovery_points[0]
self.assertIsNotNone(recovery_point)
# Trigger Restore
restore_job_id = self.test_helper.trigger_restore(self.test_definition.container_name, self.test_definition.vm_name, recovery_point.name, protected_item.virtual_machine_id, self.test_definition.storage_account_id)
# self.test_helper.wait_for_job_completion(restore_job_id)
self.sleep(45 * 60) # Sleep for 45 minutes to let restore complete
# TODO: Once backup jobs API is fixed. Remove this hack
# Provision ILR
ilr_extended_info = self.test_helper.provision_item_level_recovery(self.test_definition.container_name, self.test_definition.vm_name, recovery_point.name, protected_item.virtual_machine_id)
# Revoke ILR
self.test_helper.revoke_item_level_recovery(self.test_definition.container_name, self.test_definition.vm_name, recovery_point.name)
# Disable Protection
self.test_helper.disable_protection(self.test_definition.container_name, self.test_definition.vm_name)
@record
def test_operations_api(self):
operations = self.test_helper.list_operations()
self.assertIsNotNone(operations)
self.assertTrue(any(operations))
|
dimitarp/basex
|
basex-core/src/main/java/org/basex/query/expr/constr/CArray.java
|
<reponame>dimitarp/basex<filename>basex-core/src/main/java/org/basex/query/expr/constr/CArray.java
package org.basex.query.expr.constr;
import org.basex.query.*;
import org.basex.query.expr.*;
import org.basex.query.iter.*;
import org.basex.query.value.array.*;
import org.basex.query.value.item.*;
import org.basex.query.value.type.*;
import org.basex.query.var.*;
import org.basex.util.*;
import org.basex.util.hash.*;
/**
* Array constructor.
*
* @author BaseX Team 2005-20, BSD License
* @author <NAME>
*/
public final class CArray extends Arr {
/** Create sequences as array members. */
private final boolean seq;
/**
* Constructor.
* @param info input info
* @param seq create sequences
* @param exprs array expressions
*/
public CArray(final InputInfo info, final boolean seq, final Expr... exprs) {
super(info, SeqType.ARRAY_O, exprs);
this.seq = seq;
}
@Override
public Expr optimize(final CompileContext cc) throws QueryException {
SeqType dt = null;
for(final Expr expr : exprs) {
SeqType st = expr.seqType();
if(!seq) st = st.with(Occ.ONE);
dt = dt == null ? st : dt.union(st);
}
if(dt != null) exprType.assign(ArrayType.get(dt));
return allAreValues(true) ? cc.preEval(this) : this;
}
@Override
public XQArray item(final QueryContext qc, final InputInfo ii) throws QueryException {
final ArrayBuilder builder = new ArrayBuilder();
if(seq) {
for(final Expr expr : exprs) {
builder.append(expr.value(qc));
}
} else {
for(final Expr expr : exprs) {
final Iter iter = expr.iter(qc);
for(Item item; (item = qc.next(iter)) != null;) builder.append(item);
}
}
return builder.freeze();
}
@Override
public Expr copy(final CompileContext cc, final IntObjMap<Var> vm) {
return copyType(new CArray(info, seq, copyAll(cc, vm, exprs)));
}
@Override
public boolean equals(final Object obj) {
return obj instanceof CArray && seq == ((CArray) obj).seq && super.equals(obj);
}
@Override
public String description() {
return QueryText.ARRAY;
}
@Override
public String toString() {
final int el = exprs.length;
if(seq && el == 0) return "[]";
final TokenBuilder tb = new TokenBuilder().add(seq ? "[" : QueryText.ARRAY + " {");
for(int e = 0; e < el; e++) {
if(e != 0) tb.add(',');
tb.add(' ').add(exprs[e]);
}
return tb.add(seq ? " ]" : " }").toString();
}
}
|
kepac122/ringteki
|
test/server/cards/13-CW/ImbuedWithShadows.spec.js
|
<reponame>kepac122/ringteki<gh_stars>10-100
describe('Imbued with Shadows', function() {
integration(function() {
describe('Imbued with Shadows\'s ability', function() {
beforeEach(function() {
this.setupTest({
phase: 'conflict',
player1: {
inPlay: ['moto-youth', 'doji-whisperer', 'shinjo-ambusher', 'callow-delegate', 'young-harrier', 'steward-of-law'],
hand: ['above-question', 'finger-of-jade']
},
player2: {
inPlay: ['bayushi-liar'],
hand: ['imbued-with-shadows']
}
});
this.ambusher = this.player1.findCardByName('shinjo-ambusher');
this.youth = this.player1.findCardByName('moto-youth');
this.whisperer = this.player1.findCardByName('doji-whisperer');
this.callow = this.player1.findCardByName('callow-delegate');
this.harrier = this.player1.findCardByName('young-harrier');
this.steward = this.player1.findCardByName('steward-of-law');
this.aboveQuestion = this.player1.findCardByName('above-question');
this.jade = this.player1.findCardByName('finger-of-jade');
this.liar = this.player2.findCardByName('bayushi-liar');
this.shadows = this.player2.findCardByName('imbued-with-shadows');
this.ambusher.dishonor();
this.youth.dishonor();
this.whisperer.honor();
this.steward.honor();
this.liar.dishonor();
});
it('Should force you to choose target equal to the amount of honor lost', function() {
this.player1.pass();
this.player2.clickCard(this.shadows);
expect(this.player2).toHavePrompt('Choose how much honor to pay');
expect(this.player2).toHavePromptButton('1');
expect(this.player2).toHavePromptButton('2');
expect(this.player2).toHavePromptButton('3');
expect(this.player2).toHavePromptButton('4');
expect(this.player2).toHavePromptButton('5');
this.player2.clickPrompt('3');
expect(this.player2).toHavePrompt('Choose 3 characters');
});
it('Should not let you lose more honor than you have', function() {
this.player2.honor = 3;
this.player1.pass();
this.player2.clickCard(this.shadows);
expect(this.player2).toHavePrompt('Choose how much honor to pay');
expect(this.player2).toHavePromptButton('1');
expect(this.player2).toHavePromptButton('2');
expect(this.player2).toHavePromptButton('3');
expect(this.player2).not.toHavePromptButton('4');
expect(this.player2).not.toHavePromptButton('5');
});
it('Should not let you choose invalid targets (Above Question)', function() {
this.player1.playAttachment(this.aboveQuestion, this.ambusher);
this.player2.clickCard(this.shadows);
expect(this.player2).toHavePrompt('Choose how much honor to pay');
expect(this.player2).toHavePromptButton('1');
expect(this.player2).toHavePromptButton('2');
expect(this.player2).toHavePromptButton('3');
expect(this.player2).toHavePromptButton('4');
expect(this.player2).not.toHavePromptButton('5');
this.player2.clickPrompt('3');
expect(this.player2).toHavePrompt('Choose 3 characters');
});
it('Should not let you trigger if there are no valid targets', function() {
this.ambusher.honor();
this.youth.honor();
this.whisperer.dishonor();
this.steward.dishonor();
this.liar.honor();
this.player1.pass();
expect(this.player2).toHavePrompt('Action Window');
this.player2.clickCard(this.shadows);
expect(this.player2).toHavePrompt('Action Window');
});
it('Should remove the honor and the status tokens from the chosen characters', function() {
let honor = this.player2.honor;
this.player1.pass();
this.player2.clickCard(this.shadows);
this.player2.clickPrompt('3');
expect(this.player2).toHavePrompt('Choose 3 characters');
expect(this.player2).toBeAbleToSelect(this.ambusher);
expect(this.player2).toBeAbleToSelect(this.youth);
expect(this.player2).toBeAbleToSelect(this.whisperer);
expect(this.player2).toBeAbleToSelect(this.steward);
expect(this.player2).toBeAbleToSelect(this.liar);
this.player2.clickCard(this.whisperer);
this.player2.clickCard(this.youth);
this.player2.clickCard(this.liar);
this.player2.clickPrompt('Done');
expect(this.whisperer.isDishonored).toBe(false);
expect(this.youth.isDishonored).toBe(false);
expect(this.liar.isDishonored).toBe(false);
expect(this.whisperer.isHonored).toBe(false);
expect(this.youth.isHonored).toBe(false);
expect(this.liar.isHonored).toBe(false);
expect(this.player2.honor).toBe(honor - 3);
expect(this.getChatLogs(10)).toContain('player2 plays Imbued With Shadows to lose 3 honor to discard status tokens from Doji Whisperer, Moto Youth and Bayushi Liar');
expect(this.getChatLogs(10)).toContain('player2 discards Honored Token from Doji Whisperer');
expect(this.getChatLogs(10)).toContain('player2 discards Dishonored Token from Moto Youth');
expect(this.getChatLogs(10)).toContain('player2 discards Dishonored Token from Bayushi Liar');
});
it('Should not let you choose more characters than you chose to lose honor', function() {
let honor = this.player2.honor;
this.player1.pass();
this.player2.clickCard(this.shadows);
this.player2.clickPrompt('2');
expect(this.player2).toHavePrompt('Choose 2 characters');
this.player2.clickCard(this.whisperer);
this.player2.clickCard(this.youth);
this.player2.clickCard(this.liar);
this.player2.clickPrompt('Done');
expect(this.whisperer.isDishonored).toBe(false);
expect(this.youth.isDishonored).toBe(false);
expect(this.liar.isDishonored).toBe(true);
expect(this.whisperer.isHonored).toBe(false);
expect(this.youth.isHonored).toBe(false);
expect(this.player2.honor).toBe(honor - 2);
expect(this.getChatLogs(10)).toContain('player2 plays Imbued With Shadows to lose 2 honor to discard status tokens from Doji Whisperer and Moto Youth');
expect(this.getChatLogs(10)).toContain('player2 discards Honored Token from Doji Whisperer');
expect(this.getChatLogs(10)).toContain('player2 discards Dishonored Token from Moto Youth');
});
it('Should not let you choose less characters than you lost honor', function() {
this.player1.pass();
this.player2.clickCard(this.shadows);
this.player2.clickPrompt('3');
expect(this.player2).toHavePrompt('Choose 3 characters');
expect(this.player2).toBeAbleToSelect(this.ambusher);
expect(this.player2).toBeAbleToSelect(this.youth);
expect(this.player2).toBeAbleToSelect(this.whisperer);
expect(this.player2).toBeAbleToSelect(this.steward);
expect(this.player2).toBeAbleToSelect(this.liar);
this.player2.clickCard(this.whisperer);
this.player2.clickCard(this.youth);
expect(this.player2).not.toHavePromptButton('Done');
this.player2.clickCard(this.liar);
expect(this.player2).toHavePromptButton('Done');
});
it('should allow Finger of Jade to cancel', function() {
let honor = this.player2.honor;
this.player1.playAttachment(this.jade, this.ambusher);
this.player2.clickCard(this.shadows);
this.player2.clickPrompt(3);
expect(this.player2).toHavePrompt('Choose 3 characters');
this.player2.clickCard(this.whisperer);
this.player2.clickCard(this.youth);
this.player2.clickCard(this.ambusher);
this.player2.clickPrompt('Done');
expect(this.player1).toHavePrompt('Triggered Abilities');
expect(this.player1).toBeAbleToSelect(this.jade);
this.player1.clickCard(this.jade);
expect(this.whisperer.isHonored).toBe(true);
expect(this.youth.isDishonored).toBe(true);
expect(this.ambusher.isDishonored).toBe(true);
expect(this.player2.honor).toBe(honor - 3);
});
it('Should prompt you if a character has multiple status tokens', function() {
let honor = this.player2.honor;
this.youth.taint();
this.liar.taint();
this.player1.pass();
this.player2.clickCard(this.shadows);
this.player2.clickPrompt('3');
this.player2.clickCard(this.whisperer);
this.player2.clickCard(this.youth);
this.player2.clickCard(this.liar);
this.player2.clickPrompt('Done');
expect(this.player2.honor).toBe(honor - 3);
expect(this.getChatLogs(10)).toContain('player2 plays Imbued With Shadows to lose 3 honor to discard status tokens from Doji Whisperer, Moto Youth and Bayushi Liar');
expect(this.getChatLogs(10)).toContain('player2 discards Honored Token from Doji Whisperer');
expect(this.player2).toHavePrompt('Which token do you wish to discard from Moto Youth?');
expect(this.player2).toHavePromptButton('Dishonored Token');
expect(this.player2).toHavePromptButton('Tainted Token');
this.player2.clickPrompt('Tainted Token');
expect(this.getChatLogs(10)).toContain('player2 discards Tainted Token from Moto Youth');
expect(this.player2).toHavePrompt('Which token do you wish to discard from Bayushi Liar?');
expect(this.player2).toHavePromptButton('Dishonored Token');
expect(this.player2).toHavePromptButton('Tainted Token');
this.player2.clickPrompt('Dishonored Token');
expect(this.getChatLogs(10)).toContain('player2 discards Dishonored Token from Bayushi Liar');
expect(this.whisperer.isDishonored).toBe(false);
expect(this.whisperer.isHonored).toBe(false);
expect(this.whisperer.isTainted).toBe(false);
expect(this.youth.isDishonored).toBe(true);
expect(this.youth.isHonored).toBe(false);
expect(this.youth.isTainted).toBe(false);
expect(this.liar.isDishonored).toBe(false);
expect(this.liar.isHonored).toBe(false);
expect(this.liar.isTainted).toBe(true);
});
});
// describe('Imbued with Shadows\'s ability (Monastery Protector)', function() {
// beforeEach(function() {
// this.setupTest({
// phase: 'conflict',
// player1: {
// inPlay: ['monastery-protector', 'togashi-mitsu', 'ancient-master', 'doji-challenger']
// },
// player2: {
// fate: 2,
// hand: ['imbued-with-shadows']
// }
// });
// this.protector = this.player1.findCardByName('monastery-protector');
// this.mitsu = this.player1.findCardByName('togashi-mitsu');
// this.challenger = this.player1.findCardByName('doji-challenger');
// this.master = this.player1.findCardByName('ancient-master');
// this.shadows = this.player2.findCardByName('imbued-with-shadows');
// this.protector.dishonor();
// this.mitsu.dishonor();
// this.master.dishonor();
// this.challenger.dishonor();
// this.player1.pass();
// });
// it('Should work with Monastery Protector - needs a merge from dev and then some work', function() {
// let honor = this.player2.honor;
// let fate = this.player2.fate;
// this.player2.clickCard(this.shadows);
// //Can only targe 2 tattooed + the challenger, so we should only be able to lose 3 honor
// expect(this.player2).toHavePrompt('Choose how much honor to pay');
// expect(this.player2).toHavePromptButton('1');
// expect(this.player2).toHavePromptButton('2');
// expect(this.player2).toHavePromptButton('3');
// expect(this.player2).not.toHavePromptButton('4');
// this.player2.clickPrompt(3);
// expect(this.player2).toBeAbleToSelect(this.protector);
// expect(this.player2).toBeAbleToSelect(this.mitsu);
// expect(this.player2).toBeAbleToSelect(this.master);
// expect(this.player2).toBeAbleToSelect(this.challenger);
// this.player2.clickCard(this.protector);
// expect(this.player2).toBeAbleToSelect(this.mitsu);
// expect(this.player2).toBeAbleToSelect(this.master);
// expect(this.player2).toBeAbleToSelect(this.challenger);
// this.player2.clickCard(this.mitsu);
// expect(this.player2).not.toBeAbleToSelect(this.master);
// expect(this.player2).toBeAbleToSelect(this.challenger);
// this.player2.clickCard(this.challenger);
// this.player2.clickPrompt('Done');
// expect(this.mitsu.isDishonored).toBe(false);
// expect(this.protector.isDishonored).toBe(false);
// expect(this.challenger.isDishonored).toBe(false);
// expect(this.master.isDishonored).toBe(true);
// expect(this.player2.honor).toBe(honor - 3);
// expect(this.player2.fate).toBe(fate - 2);
// });
// });
});
});
|
zzzpre/movielib
|
movieLibrary/src/main/java/com/kanba/movie/event/MainTabChangeEvent.java
|
<filename>movieLibrary/src/main/java/com/kanba/movie/event/MainTabChangeEvent.java<gh_stars>0
package com.kanba.movie.event;
public class MainTabChangeEvent {
private int index;
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public MainTabChangeEvent(int index) {
this.index = index;
}
}
|
hashgraph/hedera-stable-coin-demo
|
stable-coin-platform/src/main/java/com/hedera/hashgraph/stablecoin/platform/db/Public.java
|
/*
* This file is generated by jOOQ.
*/
package com.hedera.hashgraph.stablecoin.platform.db;
import com.hedera.hashgraph.stablecoin.platform.db.tables.Account;
import com.hedera.hashgraph.stablecoin.platform.db.tables.AddDimension;
import com.hedera.hashgraph.stablecoin.platform.db.tables.AlterJobSchedule;
import com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSize;
import com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSizePretty;
import com.hedera.hashgraph.stablecoin.platform.db.tables.CreateHypertable;
import com.hedera.hashgraph.stablecoin.platform.db.tables.DropChunks;
import com.hedera.hashgraph.stablecoin.platform.db.tables.FlywaySchemaHistory;
import com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableApproximateRowCount;
import com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSize;
import com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSizePretty;
import com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSize;
import com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSizePretty;
import com.hedera.hashgraph.stablecoin.platform.db.tables.Petition;
import com.hedera.hashgraph.stablecoin.platform.db.tables.ShowChunks;
import com.hedera.hashgraph.stablecoin.platform.db.tables.ShowTablespaces;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.List;
import org.jooq.Catalog;
import org.jooq.Configuration;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.Result;
import org.jooq.Sequence;
import org.jooq.Table;
import org.jooq.impl.SchemaImpl;
import org.jooq.types.YearToSecond;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Public extends SchemaImpl {
private static final long serialVersionUID = -1598132279;
/**
* The reference instance of <code>public</code>
*/
public static final Public PUBLIC = new Public();
/**
* The table <code>public.account</code>.
*/
public final Account ACCOUNT = Account.ACCOUNT;
/**
* The table <code>public.add_dimension</code>.
*/
public final AddDimension ADD_DIMENSION = AddDimension.ADD_DIMENSION;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> ADD_DIMENSION(Configuration configuration, Object mainTable, String columnName, Integer numberPartitions, Object chunkTimeInterval, String partitioningFunc, Boolean ifNotExists) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.AddDimension.ADD_DIMENSION.call(mainTable, columnName, numberPartitions, chunkTimeInterval, partitioningFunc, ifNotExists)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static AddDimension ADD_DIMENSION(Object mainTable, String columnName, Integer numberPartitions, Object chunkTimeInterval, String partitioningFunc, Boolean ifNotExists) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.AddDimension.ADD_DIMENSION.call(mainTable, columnName, numberPartitions, chunkTimeInterval, partitioningFunc, ifNotExists);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static AddDimension ADD_DIMENSION(Field<Object> mainTable, Field<String> columnName, Field<Integer> numberPartitions, Field<Object> chunkTimeInterval, Field<String> partitioningFunc, Field<Boolean> ifNotExists) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.AddDimension.ADD_DIMENSION.call(mainTable, columnName, numberPartitions, chunkTimeInterval, partitioningFunc, ifNotExists);
}
/**
* The table <code>public.alter_job_schedule</code>.
*/
public final AlterJobSchedule ALTER_JOB_SCHEDULE = AlterJobSchedule.ALTER_JOB_SCHEDULE;
/**
* Call <code>public.alter_job_schedule</code>.
*/
public static Result<Record> ALTER_JOB_SCHEDULE(Configuration configuration, Integer jobId, YearToSecond scheduleInterval, YearToSecond maxRuntime, Integer maxRetries, YearToSecond retryPeriod, Boolean ifExists, OffsetDateTime nextStart) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.AlterJobSchedule.ALTER_JOB_SCHEDULE.call(jobId, scheduleInterval, maxRuntime, maxRetries, retryPeriod, ifExists, nextStart)).fetch();
}
/**
* Get <code>public.alter_job_schedule</code> as a table.
*/
public static AlterJobSchedule ALTER_JOB_SCHEDULE(Integer jobId, YearToSecond scheduleInterval, YearToSecond maxRuntime, Integer maxRetries, YearToSecond retryPeriod, Boolean ifExists, OffsetDateTime nextStart) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.AlterJobSchedule.ALTER_JOB_SCHEDULE.call(jobId, scheduleInterval, maxRuntime, maxRetries, retryPeriod, ifExists, nextStart);
}
/**
* Get <code>public.alter_job_schedule</code> as a table.
*/
public static AlterJobSchedule ALTER_JOB_SCHEDULE(Field<Integer> jobId, Field<YearToSecond> scheduleInterval, Field<YearToSecond> maxRuntime, Field<Integer> maxRetries, Field<YearToSecond> retryPeriod, Field<Boolean> ifExists, Field<OffsetDateTime> nextStart) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.AlterJobSchedule.ALTER_JOB_SCHEDULE.call(jobId, scheduleInterval, maxRuntime, maxRetries, retryPeriod, ifExists, nextStart);
}
/**
* The table <code>public.chunk_relation_size</code>.
*/
public final ChunkRelationSize CHUNK_RELATION_SIZE = ChunkRelationSize.CHUNK_RELATION_SIZE;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> CHUNK_RELATION_SIZE(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSize.CHUNK_RELATION_SIZE.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ChunkRelationSize CHUNK_RELATION_SIZE(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSize.CHUNK_RELATION_SIZE.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ChunkRelationSize CHUNK_RELATION_SIZE(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSize.CHUNK_RELATION_SIZE.call(mainTable);
}
/**
* The table <code>public.chunk_relation_size_pretty</code>.
*/
public final ChunkRelationSizePretty CHUNK_RELATION_SIZE_PRETTY = ChunkRelationSizePretty.CHUNK_RELATION_SIZE_PRETTY;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> CHUNK_RELATION_SIZE_PRETTY(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSizePretty.CHUNK_RELATION_SIZE_PRETTY.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ChunkRelationSizePretty CHUNK_RELATION_SIZE_PRETTY(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSizePretty.CHUNK_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ChunkRelationSizePretty CHUNK_RELATION_SIZE_PRETTY(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ChunkRelationSizePretty.CHUNK_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* The table <code>public.create_hypertable</code>.
*/
public final CreateHypertable CREATE_HYPERTABLE = CreateHypertable.CREATE_HYPERTABLE;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> CREATE_HYPERTABLE(Configuration configuration, Object mainTable, String timeColumnName, String partitioningColumn, Integer numberPartitions, String associatedSchemaName, String associatedTablePrefix, Object chunkTimeInterval, Boolean createDefaultIndexes, Boolean ifNotExists, String partitioningFunc, Boolean migrateData, String chunkTargetSize, String chunkSizingFunc, String timePartitioningFunc) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.CreateHypertable.CREATE_HYPERTABLE.call(mainTable, timeColumnName, partitioningColumn, numberPartitions, associatedSchemaName, associatedTablePrefix, chunkTimeInterval, createDefaultIndexes, ifNotExists, partitioningFunc, migrateData, chunkTargetSize, chunkSizingFunc, timePartitioningFunc)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static CreateHypertable CREATE_HYPERTABLE(Object mainTable, String timeColumnName, String partitioningColumn, Integer numberPartitions, String associatedSchemaName, String associatedTablePrefix, Object chunkTimeInterval, Boolean createDefaultIndexes, Boolean ifNotExists, String partitioningFunc, Boolean migrateData, String chunkTargetSize, String chunkSizingFunc, String timePartitioningFunc) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.CreateHypertable.CREATE_HYPERTABLE.call(mainTable, timeColumnName, partitioningColumn, numberPartitions, associatedSchemaName, associatedTablePrefix, chunkTimeInterval, createDefaultIndexes, ifNotExists, partitioningFunc, migrateData, chunkTargetSize, chunkSizingFunc, timePartitioningFunc);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static CreateHypertable CREATE_HYPERTABLE(Field<Object> mainTable, Field<String> timeColumnName, Field<String> partitioningColumn, Field<Integer> numberPartitions, Field<String> associatedSchemaName, Field<String> associatedTablePrefix, Field<Object> chunkTimeInterval, Field<Boolean> createDefaultIndexes, Field<Boolean> ifNotExists, Field<String> partitioningFunc, Field<Boolean> migrateData, Field<String> chunkTargetSize, Field<String> chunkSizingFunc, Field<String> timePartitioningFunc) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.CreateHypertable.CREATE_HYPERTABLE.call(mainTable, timeColumnName, partitioningColumn, numberPartitions, associatedSchemaName, associatedTablePrefix, chunkTimeInterval, createDefaultIndexes, ifNotExists, partitioningFunc, migrateData, chunkTargetSize, chunkSizingFunc, timePartitioningFunc);
}
/**
* The table <code>public.drop_chunks</code>.
*/
public final DropChunks DROP_CHUNKS = DropChunks.DROP_CHUNKS;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> DROP_CHUNKS(Configuration configuration, Object olderThan, String tableName, String schemaName, Boolean cascade, Object newerThan, Boolean verbose, Boolean cascadeToMaterializations) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.DropChunks.DROP_CHUNKS.call(olderThan, tableName, schemaName, cascade, newerThan, verbose, cascadeToMaterializations)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static DropChunks DROP_CHUNKS(Object olderThan, String tableName, String schemaName, Boolean cascade, Object newerThan, Boolean verbose, Boolean cascadeToMaterializations) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.DropChunks.DROP_CHUNKS.call(olderThan, tableName, schemaName, cascade, newerThan, verbose, cascadeToMaterializations);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static DropChunks DROP_CHUNKS(Field<Object> olderThan, Field<String> tableName, Field<String> schemaName, Field<Boolean> cascade, Field<Object> newerThan, Field<Boolean> verbose, Field<Boolean> cascadeToMaterializations) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.DropChunks.DROP_CHUNKS.call(olderThan, tableName, schemaName, cascade, newerThan, verbose, cascadeToMaterializations);
}
/**
* The table <code>public.flyway_schema_history</code>.
*/
public final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY;
/**
* The table <code>public.hypertable_approximate_row_count</code>.
*/
public final HypertableApproximateRowCount HYPERTABLE_APPROXIMATE_ROW_COUNT = HypertableApproximateRowCount.HYPERTABLE_APPROXIMATE_ROW_COUNT;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> HYPERTABLE_APPROXIMATE_ROW_COUNT(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableApproximateRowCount.HYPERTABLE_APPROXIMATE_ROW_COUNT.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableApproximateRowCount HYPERTABLE_APPROXIMATE_ROW_COUNT(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableApproximateRowCount.HYPERTABLE_APPROXIMATE_ROW_COUNT.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableApproximateRowCount HYPERTABLE_APPROXIMATE_ROW_COUNT(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableApproximateRowCount.HYPERTABLE_APPROXIMATE_ROW_COUNT.call(mainTable);
}
/**
* The table <code>public.hypertable_relation_size</code>.
*/
public final HypertableRelationSize HYPERTABLE_RELATION_SIZE = HypertableRelationSize.HYPERTABLE_RELATION_SIZE;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> HYPERTABLE_RELATION_SIZE(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSize.HYPERTABLE_RELATION_SIZE.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableRelationSize HYPERTABLE_RELATION_SIZE(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSize.HYPERTABLE_RELATION_SIZE.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableRelationSize HYPERTABLE_RELATION_SIZE(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSize.HYPERTABLE_RELATION_SIZE.call(mainTable);
}
/**
* The table <code>public.hypertable_relation_size_pretty</code>.
*/
public final HypertableRelationSizePretty HYPERTABLE_RELATION_SIZE_PRETTY = HypertableRelationSizePretty.HYPERTABLE_RELATION_SIZE_PRETTY;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> HYPERTABLE_RELATION_SIZE_PRETTY(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSizePretty.HYPERTABLE_RELATION_SIZE_PRETTY.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableRelationSizePretty HYPERTABLE_RELATION_SIZE_PRETTY(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSizePretty.HYPERTABLE_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static HypertableRelationSizePretty HYPERTABLE_RELATION_SIZE_PRETTY(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.HypertableRelationSizePretty.HYPERTABLE_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* The table <code>public.indexes_relation_size</code>.
*/
public final IndexesRelationSize INDEXES_RELATION_SIZE = IndexesRelationSize.INDEXES_RELATION_SIZE;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> INDEXES_RELATION_SIZE(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSize.INDEXES_RELATION_SIZE.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static IndexesRelationSize INDEXES_RELATION_SIZE(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSize.INDEXES_RELATION_SIZE.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static IndexesRelationSize INDEXES_RELATION_SIZE(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSize.INDEXES_RELATION_SIZE.call(mainTable);
}
/**
* The table <code>public.indexes_relation_size_pretty</code>.
*/
public final IndexesRelationSizePretty INDEXES_RELATION_SIZE_PRETTY = IndexesRelationSizePretty.INDEXES_RELATION_SIZE_PRETTY;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> INDEXES_RELATION_SIZE_PRETTY(Configuration configuration, Object mainTable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSizePretty.INDEXES_RELATION_SIZE_PRETTY.call(mainTable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static IndexesRelationSizePretty INDEXES_RELATION_SIZE_PRETTY(Object mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSizePretty.INDEXES_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static IndexesRelationSizePretty INDEXES_RELATION_SIZE_PRETTY(Field<Object> mainTable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.IndexesRelationSizePretty.INDEXES_RELATION_SIZE_PRETTY.call(mainTable);
}
/**
* The table <code>public.petition</code>.
*/
public final Petition PETITION = Petition.PETITION;
/**
* The table <code>public.show_chunks</code>.
*/
public final ShowChunks SHOW_CHUNKS = ShowChunks.SHOW_CHUNKS;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> SHOW_CHUNKS(Configuration configuration, Object hypertable, Object olderThan, Object newerThan) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.ShowChunks.SHOW_CHUNKS.call(hypertable, olderThan, newerThan)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ShowChunks SHOW_CHUNKS(Object hypertable, Object olderThan, Object newerThan) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ShowChunks.SHOW_CHUNKS.call(hypertable, olderThan, newerThan);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ShowChunks SHOW_CHUNKS(Field<Object> hypertable, Field<Object> olderThan, Field<Object> newerThan) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ShowChunks.SHOW_CHUNKS.call(hypertable, olderThan, newerThan);
}
/**
* The table <code>public.show_tablespaces</code>.
*/
public final ShowTablespaces SHOW_TABLESPACES = ShowTablespaces.SHOW_TABLESPACES;
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static Result<Record> SHOW_TABLESPACES(Configuration configuration, Object hypertable) {
return configuration.dsl().selectFrom(com.hedera.hashgraph.stablecoin.platform.db.tables.ShowTablespaces.SHOW_TABLESPACES.call(hypertable)).fetch();
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ShowTablespaces SHOW_TABLESPACES(Object hypertable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ShowTablespaces.SHOW_TABLESPACES.call(hypertable);
}
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
*/
@java.lang.Deprecated
public static ShowTablespaces SHOW_TABLESPACES(Field<Object> hypertable) {
return com.hedera.hashgraph.stablecoin.platform.db.tables.ShowTablespaces.SHOW_TABLESPACES.call(hypertable);
}
/**
* No further instances allowed
*/
private Public() {
super("public", null);
}
@Override
public Catalog getCatalog() {
return DefaultCatalog.DEFAULT_CATALOG;
}
@Override
public final List<Sequence<?>> getSequences() {
return Arrays.<Sequence<?>>asList(
Sequences.ACCOUNT_ID_SEQ,
Sequences.PETITION_ID_SEQ);
}
@Override
public final List<Table<?>> getTables() {
return Arrays.<Table<?>>asList(
Account.ACCOUNT,
AddDimension.ADD_DIMENSION,
AlterJobSchedule.ALTER_JOB_SCHEDULE,
ChunkRelationSize.CHUNK_RELATION_SIZE,
ChunkRelationSizePretty.CHUNK_RELATION_SIZE_PRETTY,
CreateHypertable.CREATE_HYPERTABLE,
DropChunks.DROP_CHUNKS,
FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY,
HypertableApproximateRowCount.HYPERTABLE_APPROXIMATE_ROW_COUNT,
HypertableRelationSize.HYPERTABLE_RELATION_SIZE,
HypertableRelationSizePretty.HYPERTABLE_RELATION_SIZE_PRETTY,
IndexesRelationSize.INDEXES_RELATION_SIZE,
IndexesRelationSizePretty.INDEXES_RELATION_SIZE_PRETTY,
Petition.PETITION,
ShowChunks.SHOW_CHUNKS,
ShowTablespaces.SHOW_TABLESPACES);
}
}
|
Oroles/Hlin-PasswordManager
|
Phone/app/src/main/java/com/example/oroles/hlin/ReceivedMessage/ReceivedErrorMessage.java
|
<gh_stars>0
package com.example.oroles.hlin.ReceivedMessage;
import com.example.oroles.hlin.Controllers.ReceivedProcessorController;
import com.example.oroles.hlin.InterfacesControllers.IStore;
public class ReceivedErrorMessage extends ReceivedMessage {
public ReceivedErrorMessage(IStore store, ReceivedProcessorController receivedProcessorController, String message) {
super(store, receivedProcessorController, message);
}
@Override
public void execute() {
mReceivedProcessorController.notifyReceivedStoredInBufferListeners(mMessage);
}
}
|
WelcomerTeam/Discord
|
discord/emoji.go
|
package discord
// emoji.go contains all structures for emojis.
// Emoji represents an Emoji on discord.
type Emoji struct {
ID Snowflake `json:"id"`
GuildID *Snowflake `json:"guild_id,omitempty"`
Name string `json:"name"`
Roles []Snowflake `json:"roles,omitempty"`
User *User `json:"user,omitempty"`
RequireColons bool `json:"require_colons"`
Managed bool `json:"managed"`
Animated bool `json:"animated"`
Available bool `json:"available"`
}
// Delete deletes the emoji.
// reason: Reason for deleting the emoji.
func (e *Emoji) Delete(s *Session, reason *string) (err error) {
return DeleteGuildEmoji(s, *e.GuildID, e.ID, reason)
}
// Edit edits the emoji.
// name: The name of the emoji
// roles: Roles this emoji is limited to.
// reason: Reason for editing the emoji.
func (e *Emoji) Edit(s *Session, name string, roles []*Snowflake, reason *string) (err error) {
params := EmojiParams{
Name: name,
Roles: roles,
}
newEmoji, err := ModifyGuildEmoji(s, *e.GuildID, e.ID, params, reason)
if err != nil {
return
}
*e = *newEmoji
return
}
// EmojiParams represents the payload sent to discord.
type EmojiParams struct {
Name string `json:"name"`
Image string `json:"image,omitempty"`
Roles []*Snowflake `json:"roles"`
}
|
benety/mongo
|
jstests/replsets/standalone_replication_recovery_prepare_only.js
|
/**
* Tests that we can recover a transaction that was prepared (but not yet committed) using the
* 'recoverFromOplogAsStandalone' flag.
*
* This test only makes sense for storage engines that support recover to stable timestamp.
* @tags: [requires_persistence, requires_journaling, requires_replication,
* requires_majority_read_concern, uses_transactions, uses_prepare_transaction]
*/
(function() {
"use strict";
load("jstests/replsets/libs/prepare_standalone_replication_recovery.js");
const testName = "standalone_replication_recovery_prepare_only";
// This test completes with a prepared transaction still active, so we cannot enforce an accurate
// fast count.
TestData.skipEnforceFastCountOnValidate = true;
testPrepareRecoverFromOplogAsStandalone(testName, /* commitBeforeRecovery */ false);
})();
|
insaneFactory/conan-geos
|
test_package/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
|
<reponame>insaneFactory/conan-geos
//
// Test Suite for C-API GEOSGeom_createCollection
#include <tut/tut.hpp>
// geos
#include <geos_c.h>
// std
#if (defined(_MSC_VER) && _MSC_VER >= 1600) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#include <array>
#endif
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
namespace tut {
//
// Test Group
//
// Common data used in test cases.
struct test_capigeosgeom_createcollection_data {
GEOSContextHandle_t handle_;
GEOSGeom geom_; // collection result
enum { geom_size = 3 };
static void
notice(const char* fmt, ...)
{
std::fprintf(stdout, "NOTICE: ");
va_list ap;
va_start(ap, fmt);
std::vfprintf(stdout, fmt, ap);
va_end(ap);
std::fprintf(stdout, "\n");
}
test_capigeosgeom_createcollection_data()
: handle_(initGEOS_r(notice, notice)), geom_(nullptr)
{
}
~test_capigeosgeom_createcollection_data()
{
GEOSGeom_destroy(geom_);
geom_ = nullptr;
finishGEOS_r(handle_);
}
};
typedef test_group<test_capigeosgeom_createcollection_data> group;
typedef group::object object;
group test_capigeosgeom_createcollection_group("capi::GEOSGeom_createCollection");
//
// Test Cases
//
// Create collection from constant length C-array
template<>
template<>
void object::test<1>
()
{
GEOSGeom geoms[geom_size];
geoms[0] = GEOSGeom_createEmptyPoint_r(handle_);
geoms[1] = GEOSGeom_createEmptyPoint_r(handle_);
geoms[2] = GEOSGeom_createEmptyPoint_r(handle_);
// takes ownership of individual geometries
geom_ = GEOSGeom_createCollection_r(handle_, GEOS_MULTIPOINT, geoms, geom_size);
ensure_equals(GEOSGetNumGeometries_r(handle_, geom_), (int)geom_size);
}
#if (defined(_MSC_VER) && _MSC_VER >= 1600) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
// Create collection from constant length std::array
template<>
template<>
void object::test<2>
()
{
std::array<GEOSGeom, geom_size> geoms = {
GEOSGeom_createEmptyPoint_r(handle_),
GEOSGeom_createEmptyPoint_r(handle_),
GEOSGeom_createEmptyPoint_r(handle_)
};
// takes ownership of individual geometries
geom_ = GEOSGeom_createCollection_r(handle_, GEOS_MULTIPOINT,
geoms.data(), static_cast<int>(geoms.size()));
ensure_equals(GEOSGetNumGeometries_r(handle_, geom_), geom_size);
}
#endif
// Create collection from dynamic length std::vector of geometries
template<>
template<>
void object::test<3>
()
{
std::vector<GEOSGeom> geoms;
geoms.push_back(GEOSGeom_createEmptyPoint_r(handle_));
geoms.push_back(GEOSGeom_createEmptyPoint_r(handle_));
geoms.push_back(GEOSGeom_createEmptyPoint_r(handle_));
geoms.push_back(GEOSGeom_createEmptyPoint_r(handle_));
geoms.push_back(GEOSGeom_createEmptyPoint_r(handle_));
// takes ownership of individual geometries
geom_ = GEOSGeom_createCollection_r(handle_, GEOS_MULTIPOINT,
geoms.data(), static_cast<int>(geoms.size()));
ensure_equals(static_cast<size_t>(GEOSGetNumGeometries_r(handle_, geom_)), geoms.size());
}
} // namespace tut
|
Robert-byte-s/mall-project
|
mall-product/src/main/java/org/june/product/dao/SpuImagesDao.java
|
package org.june.product.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.june.product.entity.SpuImagesEntity;
/**
* spu图片
*
* @author lishaobo
* @email <EMAIL>
* @date 2022-02-06 18:53:44
*/
@Mapper
public interface SpuImagesDao extends BaseMapper<SpuImagesEntity> {
}
|
paulyc/ghidra
|
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/ClearExternalNameAssociationAction.java
|
<gh_stars>1-10
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.app.plugin.core.references;
import ghidra.app.cmd.refs.ClearExternalNameCmd;
import ghidra.framework.cmd.CompoundCmd;
import ghidra.program.model.listing.Program;
import java.util.List;
import javax.swing.ImageIcon;
import resources.ResourceManager;
import docking.ActionContext;
import docking.action.*;
public class ClearExternalNameAssociationAction extends DockingAction {
private static ImageIcon CLEAR_ICON = ResourceManager.loadImage("images/erase16.png");
private final ExternalReferencesProvider provider;
public ClearExternalNameAssociationAction(ExternalReferencesProvider provider) {
super("Clear External Name Association", provider.getOwner());
this.provider = provider;
this.setPopupMenuData( new MenuData(
new String[] {"Clear External Name Association"}, CLEAR_ICON, null ) );
this.setToolBarData( new ToolBarData(CLEAR_ICON, null ) );
setEnabled(true);
}
@Override
public boolean isAddToPopup(ActionContext context) {
return true;
}
@Override
public void actionPerformed(ActionContext context) {
Program program = provider.getProgram();
List<String> externalNames = provider.getSelectedExternalNames();
CompoundCmd cmd = new CompoundCmd("Clear External Program Associations");
for (String externalName : externalNames) {
cmd.add(new ClearExternalNameCmd(externalName));
}
provider.getTool().execute(cmd, program);
}
}
|
Jrgriss2/chi-tech
|
ChiTech/ChiMath/Quadratures/SLDFESQ/lua/create_sldfesq_quadrature.cc
|
#include "ChiLua/chi_lua.h"
#include "../sldfe_sq.h"
#include "ChiMath/chi_math.h"
extern ChiMath& chi_math_handler;
//###################################################################
/** Creates a Simplified Linear Discontinuous Finite Element (SLDFE)
quadrature based on Spherical Quadrilaterals (SQ). Hence SLDFE-SQ.
\param initial_refinement_level int Initial refinement level, \f$n\f$ to
be used. The total number of angles will be \f$ 8{\times}12(n+1)^2 \f$.
##_
###Example:
Example with refinement level 2.
\code
pquad = chiCreateSLDFESQAngularQuadrature(2)
\endcode
\image html "SLDFESQBasen2.png" width=500px
With direction points:
\image html "SLDFESQBasen2Oct2.png" width=500px
\ingroup LuaSLDFESQ
\author Jan */
int chiCreateSLDFESQAngularQuadrature(lua_State* L)
{
int num_args = lua_gettop(L);
if (num_args != 1)
LuaPostArgAmountError("chiCreateSLDFESQAngularQuadrature",1,num_args);
int init_refinement_level = lua_tonumber(L,1);
auto sldfesq = new chi_math::SimplifiedLDFESQ::Quadrature;
sldfesq->GenerateInitialRefinement(init_refinement_level);
std::shared_ptr<chi_math::AngularQuadrature> new_ang_quad =
std::shared_ptr<chi_math::SimplifiedLDFESQ::Quadrature>(sldfesq);
chi_math_handler.angular_quadratures.push_back(new_ang_quad);
int index = chi_math_handler.angular_quadratures.size() - 1;
lua_pushnumber(L,index);
return 1;
}
|
bealbrown/allhours
|
locations/spiders/noted/ross_dress.py
|
<gh_stars>0
# -*- coding: utf-8 -*-
import scrapy
import json
from locations.hourstudy import inputoutput
class RossDressSpider(scrapy.Spider):
name = "ross_dress"
allowed_domains = ["hosted.where2getit.com"]
start_urls = (
'https://hosted.where2getit.com/rossdressforless/2014/ajax?&xml_request=<request><appkey>1F663E4E-1B64-11E5-B356-3DAF58203F82</appkey><formdata id="locatorsearch"><dataview>store_default</dataview><limit>99999</limit><geolocs><geoloc><longitude>-98.5795</longitude><latitude>39.8283</latitude></geoloc></geolocs><searchradius>4000|2500</searchradius><where><clientkey><eq></eq></clientkey><opendate><eq></eq></opendate><shopping_spree><eq></eq></shopping_spree></where></formdata></request>',
'https://hosted.where2getit.com/rossdressforless/2014/ajax?&xml_request=<request><appkey>1F663E4E-1B64-11E5-B356-3DAF58203F82</appkey><formdata id="locatorsearch"><dataview>store_default</dataview><limit>99999</limit><geolocs><geoloc><longitude>-84.5947</longitude><latitude>40.6577</latitude></geoloc></geolocs><searchradius>4000|2500</searchradius><where><clientkey><eq></eq></clientkey><opendate><eq></eq></opendate><shopping_spree><eq></eq></shopping_spree></where></formdata></request>',
)
def store_hours(self, store_hours):
day_groups = []
this_day_group = None
days = ('Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su')
for day, hours in zip(days, store_hours):
hour_intervals = []
(f_time, t_time) = hours.split('-')
if len(f_time) > 0 and len(t_time)> 0:
f_ampm = f_time[-2:]
f_hr = f_time[:2]
t_ampm = t_time[-2:]
t_hr = t_time[:2]
f_hr = int(f_hr)
t_hr = int(t_hr)
if f_ampm == 'PM':
f_hr += 12
if f_ampm == 'AM' and f_hr == 12:
f_hr -= 12
if t_ampm == 'PM':
t_hr += 12
if t_ampm == 'AM' and t_hr == 12:
t_hr -= 12
hour_intervals.append('{}:{}-{}:{}'.format(
f_hr,
f_time[3:5],
t_hr,
t_time[3:5],
))
hours = ','.join(hour_intervals)
if not this_day_group:
this_day_group = {
'from_day': day,
'to_day': day,
'hours': hours
}
elif this_day_group['hours'] != hours:
day_groups.append(this_day_group)
this_day_group = {
'from_day': day,
'to_day': day,
'hours': hours
}
elif this_day_group['hours'] == hours:
this_day_group['to_day'] = day
day_groups.append(this_day_group)
opening_hours = ""
if len(day_groups) == 1 and day_groups[0]['hours'] in ('00:00-23:59', '00:00-00:00'):
opening_hours = '24/7'
else:
for day_group in day_groups:
if day_group['from_day'] == day_group['to_day']:
opening_hours += '{from_day} {hours}; '.format(**day_group)
elif day_group['from_day'] == 'Su' and day_group['to_day'] == 'Sa':
opening_hours += '{hours}; '.format(**day_group)
else:
opening_hours += '{from_day}-{to_day} {hours}; '.format(**day_group)
opening_hours = opening_hours[:-2]
return opening_hours
def parse(self, response):
data = response.xpath('//poi')
for store in data:
properties = {
"ref": str(store.xpath('clientkey/text()').extract_first()),
"name": store.xpath('name/text()').extract_first(),
"website": store.xpath('website/text()').extract_first(),
"addr_full": store.xpath('address1/text()').extract_first(),
"city": store.xpath('city/text()').extract_first(),
"state": store.xpath('state/text()').extract_first(),
"postcode": store.xpath('postalcode/text()').extract_first(),
"country": store.xpath('country/text()').extract_first(),
"lon": float(store.xpath('longitude/text()').extract_first()),
"lat": float(store.xpath('latitude/text()').extract_first()),
}
phone = store.xpath('phone/text()')
if phone:
properties['phone'] = phone.extract_first()
hours = [store.xpath('monday/text()').extract_first(),
store.xpath('tuesday/text()').extract_first(),
store.xpath('wednesday/text()').extract_first(),
store.xpath('thursday/text()').extract_first(),
store.xpath('friday/text()').extract_first(),
store.xpath('saturday/text()').extract_first(),
store.xpath('sunday/text()').extract_first(),
]
if hours:
properties['opening_hours'] = self.store_hours(hours)
yield inputoutput(**properties)
else:
self.logger.info("No results")
|
janforp/mybatis
|
src/test/java/org/apache/ibatis/type/GenericTypeSupportedInHierarchiesTestCase.java
|
package org.apache.ibatis.type;
import org.junit.Test;
import java.lang.reflect.Type;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import static org.junit.Assert.assertEquals;
public class GenericTypeSupportedInHierarchiesTestCase {
@Test
public void detectsTheGenericTypeTraversingTheHierarchy() {
Type rawType = new CustomStringTypeHandler().getRawType();
assertEquals(String.class, rawType);
}
public static final class CustomStringTypeHandler extends StringTypeHandler {
/**
* Defined as reported in #581
*/
@Override
public void setNonNullParameter(PreparedStatement preparedStatement, int parameterIndex, String parameter, JdbcType jdbcType) throws SQLException {
// do something
super.setNonNullParameter(preparedStatement, parameterIndex, parameter, jdbcType);
}
}
}
|
waleedsamy/GPGMail
|
MailHeaders/HighSierra-10.13_17A362a_CLEANUP/IMAP/IMAPEnableCommand.h
|
<gh_stars>0
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import <IMAPSingleCommand.h>
@class NSArray;
@interface IMAPEnableCommand : IMAPSingleCommand
{
NSArray *_capabilities;
}
@property(readonly, copy, nonatomic) NSArray *capabilities; // @synthesize capabilities=_capabilities;
//- (void).cxx_destruct;
- (BOOL)handlesAllUntaggedResponses;
- (long long)maxAllowedConnectionState;
- (long long)minRequiredConnectionState;
- (BOOL)executeOnConnection:(id)arg1;
- (id)newCommandDataForLiteralPlus:(BOOL)arg1;
- (id)activityString;
- (id)commandTypeString;
- (id)init;
- (id)initWithCapabilities:(id)arg1;
@end
|
RockerHX/FishChat
|
WeChat-Headers/FTSFavUtil.h
|
<filename>WeChat-Headers/FTSFavUtil.h
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSObject.h"
@interface FTSFavUtil : NSObject
{
}
+ (id)getLastFavItem;
+ (id)getChatRoomDisplayName:(id)arg1;
+ (id)getNormalContactDisplayName:(id)arg1;
+ (id)GetFavItemSourceSearchString:(id)arg1;
+ (id)GetRecordDataSearchString:(id)arg1;
+ (id)ConvertFavItem2FTSFavSearchItem:(id)arg1;
+ (id)getFavSearchItemsByLocalIds:(id)arg1;
+ (id)getFavSearchItemsFrom:(unsigned int)arg1 limit:(unsigned int)arg2;
@end
|
software-fundamentals/WraithEngine3
|
WraithEngine/src/main/java/net/whg/we/rendering/VertexData.java
|
package net.whg.we.rendering;
public class VertexData
{
private float[] _data;
private short[] _triangles;
private ShaderAttributes _attributes;
public VertexData(float[] data, short[] triangles, ShaderAttributes attributes)
{
_data = data;
_triangles = triangles;
_attributes = attributes;
}
public float[] getDataArray()
{
return _data;
}
public int getVertexSize()
{
return _attributes.getVertexSize();
}
public int getVertexByteSize()
{
return _attributes.getVertexByteSize();
}
public short[] getTriangles()
{
return _triangles;
}
public int getTriangleCount()
{
return _triangles.length;
}
public int getVertexCount()
{
return _data.length / getVertexSize();
}
public ShaderAttributes getAttributeSizes()
{
return _attributes;
}
}
|
darylf/Longbox-rails
|
api/app/graphql/resolvers/truncatable.rb
|
<filename>api/app/graphql/resolvers/truncatable.rb
module Resolvers
module Truncatable
def trunc_list(items, limit)
return items if limit.nil?
items.take(limit)
end
end
end
|
shane-kercheval/oo-learning
|
oolearning/evaluators/ScoreActualPredictedBase.py
|
from abc import abstractmethod
from typing import Union
import numpy as np
import pandas as pd
from oolearning.evaluators.ScoreBase import ScoreBase
class ScoreActualPredictedBase(ScoreBase):
def _execute(self,
actual_values: np.ndarray,
predicted_values: Union[np.ndarray, pd.DataFrame]) -> float:
"""
given the actual and predicted values, this function calculates the corresponding value/score
:param actual_values: actual values
:param predicted_values: predicted values (from a trained model)
:return: calculated score
"""
assert len(actual_values) == len(predicted_values)
self._value = self._calculate(actual_values, predicted_values)
assert isinstance(self._value, float) or isinstance(self._value, int)
return self._value
def calculate(self,
actual_values: np.ndarray,
predicted_values: Union[np.ndarray, pd.DataFrame]) -> float:
"""
`calculate()` is friendly name for SingleUseObjectMixin.execute() but both should do the same thing
:param actual_values: actual values
:param predicted_values: predicted values (from a trained model)
:return: calculated score
"""
# noinspection PyTypeChecker,PyArgumentList
return self.execute(actual_values=actual_values, predicted_values=predicted_values)
@abstractmethod
def _calculate(self,
actual_values: np.ndarray,
predicted_values: Union[np.ndarray, pd.DataFrame]) -> float:
"""
This method calculates the value of the metric/Score.
:param actual_values: the actual values of the target variable
:param predicted_values: the predicted values of the target variable
:return: the Score's value
"""
pass
|
JoachimFalk/dse-opendse
|
opendse-encoding/src/main/java/net/sf/opendse/encoding/routing/EndNodeEncoder.java
|
<gh_stars>1-10
package net.sf.opendse.encoding.routing;
import java.util.Set;
import org.opt4j.satdecoding.Constraint;
import com.google.inject.ImplementedBy;
import net.sf.opendse.encoding.MappingEncoding;
import net.sf.opendse.encoding.variables.DDdR;
import net.sf.opendse.encoding.variables.DDsR;
import net.sf.opendse.encoding.variables.MappingVariable;
import net.sf.opendse.model.Architecture;
import net.sf.opendse.model.Link;
import net.sf.opendse.model.Resource;
/**
* The {@link EndNodeEncoder} formulates the constraints that encode the source
* and the destination nodes of the routed communication flows by encoding the
* {@link DDsR} and the {@link DDdR} variables.
*
* @author <NAME>
*
*/
@ImplementedBy(EndNodeEncoderMapping.class)
public interface EndNodeEncoder {
/**
* Formulates the constraints encoding the {@link DDsR} and the {@link DDdR}
* variables.
*
* @param communicationFlow
* the {@link CommunicationFlow} that is being routed
* @param routing
* the {@link Architecture} representing the routing possibilities of
* the communication
* @param mappingVariables
* the set of {@link MappingVariable}s encoded by the
* {@link MappingEncoding}
* @return the set of constraints encoding the {@link DDsR} and the {@link DDdR}
* variables.
*/
public Set<Constraint> toConstraints(CommunicationFlow communicationFlow, Architecture<Resource, Link> routing,
Set<MappingVariable> mappingVariables);
}
|
Rouche/Utilities
|
src/org/kitfox/mvel/TestMvel.java
|
<gh_stars>0
package org.kitfox.mvel;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.mvel2.MVEL;
import org.mvel2.Macro;
import org.mvel2.MacroProcessor;
import org.mvel2.ParserContext;
import org.mvel2.ast.ASTNode;
import org.mvel2.integration.Interceptor;
import org.mvel2.integration.VariableResolverFactory;
import org.mvel2.integration.impl.DefaultLocalVariableResolverFactory;
import org.mvel2.templates.CompiledTemplate;
import org.mvel2.templates.TemplateCompiler;
import org.mvel2.templates.TemplateRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import junit.framework.TestCase;
public class TestMvel extends TestCase {
private static final Logger LOGGER = LoggerFactory.getLogger(TestMvel.class);
@Test
public void testSimple() {
ParserContext context = new ParserContext();
context.addPackageImport("java.util");
context.addPackageImport("org.kitfox.mvel");
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("user2", new User());
String expression =
// Construire la memoire
"user = new User();" +
"user.id = 'gilles';" +
"rolex = new Role(); rolex.role = 'admin';" +
"user.roles = [rolex];" +
"rolex = new Role(); rolex.role = 'factu';" +
"user.roles.add(rolex);" +
// "for(role : user.roles) { if(role.role == 'admin') return true; }" +
// "allRoles = (role in user.roles);" +
// Ceci est la simple ligne a effectuer pour tester le role admin!
"return ($ in user.roles if $.role == 'admin') != empty;";
// "return admin != empty;";
Serializable s = MVEL.compileExpression(expression, context); // compile the expresion
Object o = MVEL.executeExpression(s, vars);
LOGGER.debug("testSimple {}", o);
}
@Test
public void testFunction() {
ParserContext context = new ParserContext();
context.addPackageImport("java.util");
context.addPackageImport("org.kitfox.mvel");
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("user2", new User());
vars.put("LOGGER", LOGGER);
String expression =
"def hello(a) { LOGGER.debug(\"Wow {}\", a); }" +
"hello('Hello!');" +
"def sum(a, b) { return a + b; }" +
"hello(sum( 5, 5));";
Serializable s = MVEL.compileExpression(expression, context); // compile the expresion
Object o = MVEL.executeExpression(s, vars);
LOGGER.debug("testFunction {}", o);
}
@Test
public void testLabmbda() {
VariableResolverFactory factory = new DefaultLocalVariableResolverFactory();
String expression =
"threshold = def (x) { x >= 10 ? x : 0 }; " +
"result = 5 + threshold(12);";
LOGGER.debug("testLabmbda {}", MVEL.eval(expression, factory));
}
@Test
public void testMacro() {
Map<String, Macro> myMacros = new HashMap<String, Macro>();
Macro modifyMacro = new Macro() {
@Override
public String doMacro() {
return "@Modify with";
}
};
// Add modifyMacro to the Map
myMacros.put("modify", modifyMacro);
// Create the macro processor
MacroProcessor macroProcessor = new MacroProcessor();
// Add the macro map to the macro processor
macroProcessor.setMacros(myMacros);
// Now we pre-parse our expression
String expression = "modify (obj) { value = 'foo' };";
String parsedExpression = macroProcessor.parse(expression);
LOGGER.debug("testMacro {}", parsedExpression);
}
@Test
public void testInterceptors() {
ParserContext context = new ParserContext();
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Macro> myMacros = new HashMap<String, Macro>();
Map<String, Interceptor> myInterceptors = new HashMap<String, Interceptor>();
Macro modifyMacro = new Macro() {
@Override
public String doMacro() {
return "@Modify with";
}
};
// Add modifyMacro to the Map
myMacros.put("modify", modifyMacro);
// Create the macro processor
MacroProcessor macroProcessor = new MacroProcessor();
// Add the macro map to the macro processor
macroProcessor.setMacros(myMacros);
// Create a simple interceptor.
Interceptor myInterceptor = new Interceptor() {
@Override
public int doAfter(Object arg0, ASTNode arg1, VariableResolverFactory arg2) {
LOGGER.debug("After! {} {} {}", arg0, arg1, arg2);
return 0;
}
@Override
public int doBefore(ASTNode arg0, VariableResolverFactory arg1) {
LOGGER.debug("Before! {} {}", arg0, arg1);
return 0;
}
};
// Now add the interceptor to the map.
myInterceptors.put("Intercept", myInterceptor);
// Add the interceptors map to the parser context.
context.setInterceptors(myInterceptors);
context.setStrongTyping(true);
// Now we pre-parse our expression
String expression = "int total = 0; " +
"@Intercept " +
"foreach(int item : [1,2,3,4,5,6]) {" +
" total += item;" +
"}" +
"total;";
Serializable s = MVEL.compileExpression(expression, context); // compile the expresion
Object o = MVEL.executeExpression(s, vars);
LOGGER.debug("testInterceptors {}", o);
}
@Test
public void testSwing() {
ParserContext context = new ParserContext();
context.addImport(javax.swing.JFrame.class);
context.addImport(javax.swing.JLabel.class);
String expression = "" +
"with (frame = new JFrame()) {" +
" title = 'My Swing Frame'," +
" resizable = true" +
"}" +
"frame.contentPane.add(new JLabel('My Label'));" +
"frame.pack();" +
"frame.visible = true;";
VariableResolverFactory factory = new DefaultLocalVariableResolverFactory();
Serializable s = MVEL.compileExpression(expression, context); // compile the expresion
Object o = MVEL.executeExpression(s, factory);
LOGGER.debug("testSwing {}", o);
}
@Test
public void testTemplate() {
String template = "1 + 1 = @{1+1}";
// compile the template
CompiledTemplate compiled = TemplateCompiler.compileTemplate(template);
// execute the template
String output = (String) TemplateRuntime.execute(compiled);
LOGGER.debug("testTemplate {}", output);
}
}
|
jonboland/colosseum
|
tests/web_platform/css_grid_1/grid_items/test_grid_layout_z_order_a.py
|
from tests.utils import W3CTestCase
class TestGridLayoutZOrderA(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'grid-layout-z-order-a'))
|
johanngoltz/graphql-maven-plugin-project
|
graphql-maven-plugin-samples/graphql-maven-plugin-samples-Forum-client/src/main/java/com/graphql_java_generator/samples/forum/client/Main.java
|
package com.graphql_java_generator.samples.forum.client;
import java.util.Calendar;
import com.graphql_java_generator.exception.GraphQLRequestExecutionException;
import com.graphql_java_generator.exception.GraphQLRequestPreparationException;
import com.graphql_java_generator.samples.forum.client.graphql.PartialDirectRequests;
import com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequests;
/**
* The main class, which executes the same queries, built by three different methods. See {@link PartialDirectRequests},
* {@link PartialPreparedRequests}, {@link WithBuilder}
*
* @author etienne-sf
*/
public class Main {
public static String GRAPHQL_ENDPOINT_URL = "http://localhost:8180/graphql";
public static void main(String[] args) throws GraphQLRequestPreparationException, GraphQLRequestExecutionException {
System.out.println("");
System.out.println("============================================================================");
System.out.println("======= SIMPLEST WAY: DIRECT QUERIES =======================================");
System.out.println("============================================================================");
exec(new PartialDirectRequests(), null);
System.out.println("");
System.out.println("============================================================================");
System.out.println("======= MOST SECURE WAY: PREPARED QUERIES ==================================");
System.out.println("============================================================================");
exec(new PartialPreparedRequests(), null);
System.out.println("");
System.out.println("");
System.out.println("Sample application finished ... enjoy ! :)");
System.out.println("");
System.out.println("(please take a look at the other samples, for other use cases)");
}
static void exec(Queries client, String name)
throws GraphQLRequestPreparationException, GraphQLRequestExecutionException {
try {
System.out.println("----------------------------------------------------------------------------");
System.out.println("---------------- boardsSimple --------------------------------------------");
System.out.println(client.boardsSimple());
System.out.println("----------------------------------------------------------------------------");
System.out.println("---------------- topicAuthorPostAuthor -----------------------------------");
Calendar cal = Calendar.getInstance();
cal.set(2018, 12, 20);
System.out.println(client.topicAuthorPostAuthor("Board name 2", cal.getTime()));
System.out.println("----------------------------------------------------------------------------");
System.out.println("---------------- createBoard ---------------------------------------------");
// We need a unique name. Let's use a random name for that, if none was provided.
name = (name != null) ? name : "Name " + Float.floatToIntBits((float) Math.random() * Integer.MAX_VALUE);
System.out.println(client.createBoard(name, true));
} catch (javax.ws.rs.ProcessingException e) {
System.out.println("");
System.out.println("ERROR");
System.out.println("");
System.out.println(
"Please start the server from the project graphql-maven-plugin-samples-StarWars-server, before executing the client part");
}
}
}
|
DriftyDev/-CLEAN_Kami5-1.8-BUILDABLE_SRC
|
src/main/java/tech/mmmax/kami/mixin/mixins/access/ISPacketPlayerPosLook.java
|
<filename>src/main/java/tech/mmmax/kami/mixin/mixins/access/ISPacketPlayerPosLook.java
/*
* Decompiled with CFR 0.151.
*
* Could not load the following classes:
* net.minecraft.network.play.server.SPacketPlayerPosLook
*/
package tech.mmmax.kami.mixin.mixins.access;
import net.minecraft.network.play.server.SPacketPlayerPosLook;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(value={SPacketPlayerPosLook.class})
public interface ISPacketPlayerPosLook {
@Accessor(value="yaw")
public void setYaw(float var1);
@Accessor(value="pitch")
public void setPitch(float var1);
@Accessor(value="x")
public void setX(double var1);
@Accessor(value="y")
public void setY(double var1);
@Accessor(value="z")
public void setZ(double var1);
}
|
Mu-L/Castor3D
|
source/Core/Castor3D/Buffer/UniformBufferPool.cpp
|
#include "Castor3D/Buffer/UniformBufferPool.hpp"
#include "Castor3D/Engine.hpp"
#include "Castor3D/Render/RenderSystem.hpp"
#include <ashespp/Buffer/StagingBuffer.hpp>
#include <ashespp/Command/CommandBuffer.hpp>
#include <ashespp/Core/Device.hpp>
namespace castor3d
{
namespace details
{
inline void copyBuffer( ashes::CommandBuffer const & commandBuffer
, ashes::BufferBase const & src
, ashes::BufferBase const & dst
, VkDeviceSize offset
, VkDeviceSize size
, VkPipelineStageFlags flags )
{
auto dstSrcStage = dst.getCompatibleStageFlags();
commandBuffer.memoryBarrier( dstSrcStage
, VK_PIPELINE_STAGE_TRANSFER_BIT
, dst.makeTransferDestination() );
commandBuffer.copyBuffer( src
, dst
, uint32_t( size )
, uint32_t( offset ) );
dstSrcStage = dst.getCompatibleStageFlags();
commandBuffer.memoryBarrier( dstSrcStage
, flags
, dst.makeUniformBufferInput() );
}
}
UniformBufferPool::UniformBufferPool( RenderSystem & renderSystem
, RenderDevice const & device
, castor::String debugName )
: castor::OwnedBy< RenderSystem >{ renderSystem }
, m_device{ device }
, m_debugName{ std::move( debugName ) }
{
}
void UniformBufferPool::cleanup()
{
m_buffers.clear();
if ( m_stagingBuffer )
{
m_stagingBuffer->getBuffer().unlock();
m_stagingBuffer.reset();
}
}
void UniformBufferPool::upload( ashes::CommandBuffer const & commandBuffer )const
{
if ( m_stagingBuffer )
{
m_stagingBuffer->getBuffer().flush( 0u, m_currentUboIndex * m_maxUboSize );
auto stgSrcStage = m_stagingBuffer->getBuffer().getCompatibleStageFlags();
commandBuffer.memoryBarrier( stgSrcStage
, VK_PIPELINE_STAGE_TRANSFER_BIT
, m_stagingBuffer->getBuffer().makeTransferSource() );
for ( auto & bufferIt : m_buffers )
{
for ( auto & buffer : bufferIt.second )
{
if ( buffer.buffer->hasAllocated() )
{
details::copyBuffer( commandBuffer
, m_stagingBuffer->getBuffer()
, buffer.buffer->getBuffer().getBuffer()
, buffer.index * m_maxUboSize
, m_maxUboSize
, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT );
}
}
}
auto stgDstStage = m_stagingBuffer->getBuffer().getCompatibleStageFlags();
commandBuffer.memoryBarrier( stgDstStage
, VK_PIPELINE_STAGE_HOST_BIT
, m_stagingBuffer->getBuffer().makeHostWrite() );
}
}
uint32_t UniformBufferPool::getBufferCount()const
{
if ( !m_stagingBuffer )
{
return 0u;
}
uint32_t result = 0u;
for ( auto & bufferIt : m_buffers )
{
result += uint32_t( bufferIt.second.size() );
}
return result;
}
UniformBufferPool::BufferArray::iterator UniformBufferPool::doFindBuffer( UniformBufferPool::BufferArray & array
, VkDeviceSize alignedSize )
{
auto it = array.begin();
while ( it != array.end() && !it->buffer->hasAvailable( alignedSize ) )
{
++it;
}
return it;
}
void UniformBufferPool::doCreateStagingBuffer()
{
auto & renderSystem = *getRenderSystem();
auto & device = renderSystem.getRenderDevice();
ashes::QueueShare sharingMode
{
{
device.getGraphicsQueueFamilyIndex(),
device.getComputeQueueFamilyIndex(),
device.getTransferQueueFamilyIndex(),
}
};
auto maxSize = std::min( 65536u, renderSystem.getValue( GpuMax::eUniformBufferSize ) );
auto elementSize = renderSystem.getValue( GpuMin::eUniformBufferOffsetAlignment );
m_maxUboElemCount = uint32_t( std::floor( float( maxSize ) / float( elementSize ) ) );
m_maxUboSize = m_maxUboElemCount * elementSize;
m_stagingBuffer = std::make_unique< ashes::StagingBuffer >( *device
, VK_BUFFER_USAGE_TRANSFER_SRC_BIT
, m_maxUboSize * m_maxPoolUboCount
, sharingMode );
m_stagingData = m_stagingBuffer->getBuffer().lock( 0u
, m_maxUboSize * m_maxPoolUboCount
, 0u );
assert( m_stagingData );
}
UniformBufferPool::BufferArray::iterator UniformBufferPool::doCreatePoolBuffer( VkMemoryPropertyFlags flags
, UniformBufferPool::BufferArray & buffers )
{
auto & renderSystem = *getRenderSystem();
auto & device = renderSystem.getRenderDevice();
ashes::QueueShare sharingMode
{
{
device.getGraphicsQueueFamilyIndex(),
device.getComputeQueueFamilyIndex(),
device.getTransferQueueFamilyIndex(),
}
};
auto index = m_maxUboSize * m_currentUboIndex;
auto buffer = makePoolUniformBuffer( renderSystem
, castor::makeArrayView( m_stagingData + index
, m_stagingData + index + m_maxUboSize )
, VK_BUFFER_USAGE_TRANSFER_DST_BIT
, flags
, m_debugName
, sharingMode );
buffers.push_back( { m_currentUboIndex, std::move( buffer ) } );
++m_currentUboIndex;
auto itB = std::next( buffers.begin()
, ptrdiff_t( buffers.size() - 1 ) );
m_maxUboSize = itB->buffer->initialise( m_device );
return itB;
}
}
|
pegnet/PegNetPool
|
pegnet/pegnet.go
|
<filename>pegnet/pegnet.go<gh_stars>1-10
package pegnet
import (
"github.com/jinzhu/gorm"
"github.com/Factom-Asset-Tokens/factom"
"github.com/FactomWyomingEntity/prosper-pool/config"
"github.com/FactomWyomingEntity/prosper-pool/database"
"github.com/FactomWyomingEntity/prosper-pool/factomclient"
"github.com/pegnet/pegnet/modules/grader"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
var (
pegdLog = log.WithField("mod", "pegd")
)
type Node struct {
FactomClient *factom.Client
config *viper.Viper
db *database.SqlDatabase
Sync *database.BlockSync
hooks []chan<- PegnetdHook
// Indicate a fresh boot
justBooted bool
}
func NewPegnetNode(conf *viper.Viper, db *database.SqlDatabase) (*Node, error) {
n := new(Node)
n.FactomClient = factomclient.FactomClientFromConfig(conf)
n.config = conf
n.db = db
if sync, err := n.SelectSynced(); err != nil {
if err == gorm.ErrRecordNotFound {
n.Sync = new(database.BlockSync)
n.Sync.Synced = int32(config.PegnetActivation)
pegdLog.Debug("connected to a fresh database")
} else {
return nil, err
}
} else {
n.Sync = sync
}
grader.InitLX()
return n, nil
}
// PegnetdHook contains all the info (aside from assets) needed to make
// and opr for mining
type PegnetdHook struct {
Height int32
// Top means the block is the latest block
Top bool
GradedBlock grader.GradedBlock
}
func (n *Node) GetHook() <-chan PegnetdHook {
hook := make(chan PegnetdHook, 10)
n.AddHook(hook)
return hook
}
// AddHook does not need to be thread safe, as it is called before
// the node is running
func (n *Node) AddHook(hook chan<- PegnetdHook) {
n.hooks = append(n.hooks, hook)
}
func (n Node) SelectSynced() (*database.BlockSync, error) {
var s database.BlockSync
// TODO: Ensure this is max() equivalent
dbErr := n.db.Order("synced desc").First(&s)
return &s, dbErr.Error
}
|
Silwings-git/silwings-aliutils
|
alioss-spring-boot-starter/src/main/java/com/silwings/img/starter/service/impl/DefaultImgServiceImpl.java
|
package com.silwings.img.starter.service.impl;
import com.silwings.img.starter.service.ImgService;
import com.silwings.img.starter.service.ImgUpLoader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.Random;
/**
* @author CuiYiXiang
* @Classname DefaultImgServiceImpl
* @Description 默认图片服务实现
* @Date 2020/8/2
*/
public class DefaultImgServiceImpl implements ImgService {
@Autowired
private ImgUpLoader ossImgUpLoader;
/**
* description: 创建新的系统文件名
* version: 1.0
* date: 2020/8/2 17:05
* author: 崔益翔
*
* @param upFile
* @return java.lang.String
*/
@Override
public String createNewFileName(MultipartFile upFile) {
String fileName = upFile.getOriginalFilename();
String substring = fileName.substring(fileName.lastIndexOf("/") + 1);
String newName = substring.substring(substring.lastIndexOf("\\") + 1);
//新文件名
return createNonceStr() + "_" + newName;
}
/**
* 随机数生成
*
* @return
*/
public String createNonceStr() {
String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
String res = "";
for (int i = 0; i < 16; i++) {
Random rd = new Random();
res += chars.charAt(rd.nextInt(chars.length() - 1));
}
return res;
}
@Override
public String upFile(MultipartFile upFile, Integer compressLevel,String fileName) throws RuntimeException {
String url = null;
try {
InputStream input = upFile.getInputStream();
url = ossImgUpLoader.upFile(input, fileName);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return url;
}
}
|
davidarnarsson/GUnit
|
gunit-maven-plugin/src/main/java/edu/chl/gunit/plugin/GUnitMojo.java
|
package edu.chl.gunit.plugin;
import edu.chl.gunit.commons.api.*;
import edu.chl.gunit.commons.input.jacoco.JaCoCoCSVReader;
import edu.chl.gunit.commons.input.jacoco.JaCoCoResultException;
import edu.chl.gunit.commons.input.junit.JUnitResultException;
import edu.chl.gunit.commons.input.junit.JUnitXMLReader;
import edu.chl.gunit.commons.input.testhound.TesthoundXMLReader;
import edu.chl.gunit.service.client.Client;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.FileUtils;
import javax.xml.xpath.XPathExpressionException;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
*
* Created by davida on 4.2.2015.
*/
@Mojo( name = "send-reports" )
public class GUnitMojo extends AbstractMojo {
@Parameter(property = "developerName")
protected String developerName;
@Parameter(property = "jacocoReports")
private File jacocoReportCsvFolder;
@Parameter(property = "testhoundReports")
private File testHoundReportDirectory;
@Parameter(property = "unitTestReports")
private File unitTestReportsFolder;
@Parameter(property = "gunitWsLocation")
private String gunitWsLocation;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Hi there, " + (developerName != null ? developerName : "Unnamed" + "!"));
if (developerName == null || "".equals(developerName)) {
throw new MojoExecutionException("Developer name not set!");
}
TestRunRequest req = new TestRunRequest();
req.setUser(developerName);
if (unitTestReportsFolder != null && unitTestReportsFolder.isDirectory()) {
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("TEST") && name.endsWith("xml");
}
};
List<File> junitTestFiles = new ArrayList<File>();
crawlDirectory(unitTestReportsFolder, filter, junitTestFiles);
JUnitXMLReader reader = new JUnitXMLReader();
for (File f : junitTestFiles) {
try {
ApiTestSuiteResults results = reader.read(f.getAbsolutePath());
req.getTestResults().add(results);
} catch (JUnitResultException e) {
e.printStackTrace();
}
}
}
else {
getLog().warn("Could not read unit test reports folder!");
}
if (jacocoReportCsvFolder != null && jacocoReportCsvFolder.isDirectory()) {
JaCoCoCSVReader reader = new JaCoCoCSVReader();
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.equalsIgnoreCase("jacoco.csv");
}
};
List<File> jacocoFiles = new ArrayList<File>();
crawlDirectory(jacocoReportCsvFolder, filter, jacocoFiles);
for (File jacocoFile : jacocoFiles) {
try {
List<ApiJaCoCoResult> coverageResultList = reader.read(jacocoFile);
for (ApiJaCoCoResult result : coverageResultList) {
req.getCoverageResults().add(result);
}
} catch (JaCoCoResultException e) {
e.printStackTrace();
}
}
} else {
getLog().warn("Could not read coverage reports folder!");
}
if (testHoundReportDirectory != null && testHoundReportDirectory.isDirectory()) {
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("report") && name.endsWith("xml");
}
};
List<File> testhoundfiles = new ArrayList<File>();
crawlDirectory(testHoundReportDirectory, filter, testhoundfiles);
TesthoundXMLReader testhoundXMLReader = new TesthoundXMLReader();
for (File f: testhoundfiles) {
try {
TesthoundResult r = testhoundXMLReader.readTesthoundData(f);
if (r != null) {
req.getTesthoundResults().add(r);
}
} catch (XPathExpressionException e) {
e.printStackTrace();
}
}
}
Client client = new Client(gunitWsLocation);
try {
int uniqueId = client.submitTestRun(req);
getLog().info("Sent test run info to GUnit server, got unique tracking ID: " + uniqueId);
}catch (Exception e) {
getLog().warn("Unable to submit test run to gamification server!");
StringWriter writer = new StringWriter();
PrintWriter w = new PrintWriter(writer);
e.printStackTrace(w);
getLog().warn("Stacktrace: \n" + writer.toString());
}
// sækja gögn
// kalla í vefþjónustu með gögn + developername
// 1. kalla í vefþjónustu með user + project info + date á síðustu gögnum
// 2. ef meðtekið þá
// 3. birta gögn fyrir user
// 5. annars
// 6. sofa í 1000ms og goto 1
}
private void crawlDirectory(File directory, FilenameFilter filter, List<File> filesFound) {
crawlDirectory(directory,filter, filesFound,0, 5);
}
private void crawlDirectory(File directory, FilenameFilter filter, List<File> filesFound, int level, int max) {
if (level >= max) return;
filesFound.addAll(Arrays.asList(directory.listFiles(filter)));
File[] subDirectories = directory.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isDirectory();
}
});
for (File subDirectory : subDirectories) {
crawlDirectory(subDirectory, filter, filesFound,level + 1, max);
}
}
}
|
vito/atomy
|
lib/atomy/compiler.rb
|
<reponame>vito/atomy
require "atomy/locals"
require "rubinius/code/compiler"
module Atomy
module Compiler
module_function
def compile(node, mod, state = LocalState.new)
package(mod.file, 0, state) do |gen|
mod.compile(gen, node)
end
end
def package(file, line = 0, state = LocalState.new, &blk)
generate(file, line, state, &blk).package(Rubinius::CompiledCode).tap do |code|
if ENV["DEBUG"]
printer = CodeTools::Compiler::MethodPrinter.new
printer.bytecode = true
printer.print_method(code)
end
end
end
def generate(file, line = 0, state = LocalState.new)
gen = CodeTools::Generator.new
gen.file = file
gen.set_line(line)
gen.push_state(state)
yield gen
gen.ret
gen.close
gen.local_count = gen.state.scope.local_count
gen.local_names = gen.state.scope.local_names
gen.encode
gen
end
def construct_block(code, binding)
code = code.dup
code.scope = binding.lexical_scope
code.name = binding.variables.method.name
code.scope.script =
Rubinius::CompiledCode::Script.new(code, code.file.to_s, true)
block = Rubinius::BlockEnvironment.new
block.under_context(binding.variables, code)
block
end
end
end
|
ScalablyTyped/SlinkyTyped
|
k/kythe/src/main/scala/typingsSlinky/kythe/mod/Entry.scala
|
<filename>k/kythe/src/main/scala/typingsSlinky/kythe/mod/Entry.scala<gh_stars>10-100
package typingsSlinky.kythe.mod
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
@js.native
trait Entry extends StObject {
var label: String = js.native
var source: VName = js.native
}
object Entry {
@scala.inline
def apply(label: String, source: VName): Entry = {
val __obj = js.Dynamic.literal(label = label.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any])
__obj.asInstanceOf[Entry]
}
@scala.inline
implicit class EntryMutableBuilder[Self <: Entry] (val x: Self) extends AnyVal {
@scala.inline
def setLabel(value: String): Self = StObject.set(x, "label", value.asInstanceOf[js.Any])
@scala.inline
def setSource(value: VName): Self = StObject.set(x, "source", value.asInstanceOf[js.Any])
}
}
|
mohdab98/cmps252_hw4.2
|
src/cmps252/HW4_2/UnitTesting/record_584.java
|
<reponame>mohdab98/cmps252_hw4.2
package cmps252.HW4_2.UnitTesting;
import static org.junit.jupiter.api.Assertions.*;
import java.io.FileNotFoundException;
import java.util.List;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import cmps252.HW4_2.Customer;
import cmps252.HW4_2.FileParser;
@Tag("9")
class Record_584 {
private static List<Customer> customers;
@BeforeAll
public static void init() throws FileNotFoundException {
customers = FileParser.getCustomers(Configuration.CSV_File);
}
@Test
@DisplayName("Record 584: FirstName is Alisa")
void FirstNameOfRecord584() {
assertEquals("Alisa", customers.get(583).getFirstName());
}
@Test
@DisplayName("Record 584: LastName is Racina")
void LastNameOfRecord584() {
assertEquals("Racina", customers.get(583).getLastName());
}
@Test
@DisplayName("Record 584: Company is Diamond, Philip R Esq")
void CompanyOfRecord584() {
assertEquals("Diamond, Philip R Esq", customers.get(583).getCompany());
}
@Test
@DisplayName("Record 584: Address is Box #-4071")
void AddressOfRecord584() {
assertEquals("Box #-4071", customers.get(583).getAddress());
}
@Test
@DisplayName("Record 584: City is Salinas")
void CityOfRecord584() {
assertEquals("Salinas", customers.get(583).getCity());
}
@Test
@DisplayName("Record 584: County is Monterey")
void CountyOfRecord584() {
assertEquals("Monterey", customers.get(583).getCounty());
}
@Test
@DisplayName("Record 584: State is CA")
void StateOfRecord584() {
assertEquals("CA", customers.get(583).getState());
}
@Test
@DisplayName("Record 584: ZIP is 93912")
void ZIPOfRecord584() {
assertEquals("93912", customers.get(583).getZIP());
}
@Test
@DisplayName("Record 584: Phone is 831-663-5584")
void PhoneOfRecord584() {
assertEquals("831-663-5584", customers.get(583).getPhone());
}
@Test
@DisplayName("Record 584: Fax is 831-663-7636")
void FaxOfRecord584() {
assertEquals("831-663-7636", customers.get(583).getFax());
}
@Test
@DisplayName("Record 584: Email is <EMAIL>")
void EmailOfRecord584() {
assertEquals("<EMAIL>", customers.get(583).getEmail());
}
@Test
@DisplayName("Record 584: Web is http://www.alisaracina.com")
void WebOfRecord584() {
assertEquals("http://www.alisaracina.com", customers.get(583).getWeb());
}
}
|
CynthiaProtector/helo
|
nnvm/tvm/src/codegen/intrin_rule_opencl.cc
|
/*!
* Copyright (c) 2017 by Contributors
* \file intrin_rule_opencl.cc
* \brief OpenCL intrinsic rules.
*/
#include "./intrin_rule.h"
namespace tvm {
namespace codegen {
namespace intrin {
TVM_REGISTER_GLOBAL("tvm.intrin.rule.opencl.exp")
.set_body(DispatchExtern<FloatDirect>);
TVM_REGISTER_GLOBAL("tvm.intrin.rule.opencl.log")
.set_body(DispatchExtern<FloatDirect>);
TVM_REGISTER_GLOBAL("tvm.intrin.rule.opencl.tanh")
.set_body(DispatchExtern<FloatDirect>);
TVM_REGISTER_GLOBAL("tvm.intrin.rule.opencl.sqrt")
.set_body(DispatchExtern<FloatDirect>);
TVM_REGISTER_GLOBAL("tvm.intrin.rule.opencl.pow")
.set_body(DispatchExtern<FloatDirect>);
} // namespace intrin
} // namespace codegen
} // namespace tvm
|
mrgiser/BBS
|
src/main/java/cn/he/zhao/bbs/entityUtil/my/Pagination.java
|
package cn.he.zhao.bbs.entityUtil.my;
/**
* 描述:
* Pagination
*
* @Author HeFeng
* @Create 2018-07-27 17:35
*/
public final class Pagination {
public static final String PAGINATION = "pagination";
public static final String PAGINATION_PAGE_COUNT = "paginationPageCount";
public static final String PAGINATION_RECORD_COUNT = "paginationRecordCount";
public static final String PAGINATION_CURRENT_PAGE_NUM = "paginationCurrentPageNum";
public static final String PAGINATION_PAGE_SIZE = "paginationPageSize";
public static final String PAGINATION_WINDOW_SIZE = "paginationWindowSize";
public static final String PAGINATION_PAGE_NUMS = "paginationPageNums";
public static final String PAGINATION_FIRST_PAGE_NUM = "paginationFirstPageNum";
public static final String PAGINATION_LAST_PAGE_NUM = "paginationLastPageNum";
public static final String PAGINATION_PREVIOUS_PAGE_NUM = "paginationPreviousPageNum";
public static final String PAGINATION_NEXT_PAGE_NUM = "paginationNextPageNum";
private Pagination() {
}
}
|
gomatcha/mochi
|
comm/notify.go
|
<gh_stars>1-10
package comm
import (
"image/color"
"time"
)
type Id int64
type Notifier interface {
Notify(func()) Id
Unnotify(Id)
}
type ColorNotifier interface {
Notifier
Value() color.Color
}
type InterfaceNotifier interface {
Notifier
Value() interface{}
}
type BoolNotifier interface {
Notifier
Value() bool
}
type IntNotifier interface {
Notifier
Value() int
}
type UintNotifier interface {
Notifier
Value() uint
}
type Int64Notifier interface {
Notifier
Value() int64
}
type Uint64Notifier interface {
Notifier
Value() uint64
}
type Float64Notifier interface {
Notifier
Value() float64
}
type StringNotifier interface {
Notifier
Value() string
}
type BytesNotifier interface {
Notifier
Value() []byte
}
type DurationNotifier interface {
Notifier
Value() time.Duration
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.