code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.asterix.runtime.evaluators.functions;
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
@MissingNullInOutFunction
public class StringContainsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@Override
public IFunctionDescriptor createFunctionDescriptor() {
return new StringContainsDescriptor();
}
};
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
@Override
public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
return new AbstractBinaryStringBoolEval(ctx, args[0], args[1], BuiltinFunctions.STRING_CONTAINS,
sourceLoc) {
@Override
protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) {
return UTF8StringPointable.contains(left, right, false);
}
};
}
};
}
@Override
public FunctionIdentifier getIdentifier() {
return BuiltinFunctions.STRING_CONTAINS;
}
}
|
apache/incubator-asterixdb
|
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringContainsDescriptor.java
|
Java
|
apache-2.0
| 2,959
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
<meta name="generator" content="FreeMarker Docgen (DocBook 5)">
<title>
FreeMarker Manual - Imperative XML processing
</title>
<script type="text/javascript" src="docgen-resources/jquery.js"></script>
<script type="text/javascript" src="docgen-resources/linktargetmarker.js"></script>
</head>
<body>
<div class="navigation">
<div class="breadcrumb">
<span class="breadcrumb"> You are here:
<a href="index.html">FreeMarker Manual</a>
<b>></b>
<a href="xgui.html">XML Processing Guide</a>
<b>></b>
Imperative XML processing
</span> </div>
<div class="bookmarks">
<span class="bookmarks">Bookmarks:
<a href="alphaidx.html">Alpha. index</a>, <a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a>, <a href="ref_builtins_alphaidx.html">?builtins</a>, <a href="ref_directive_alphaidx.html">#directives</a>, <a href="ref_specvar.html">.spec_vars</a>, <a href="app_faq.html">FAQ</a>, <a href="gloss.html">Glossary</a>, <a href="api/index.html">API</a>, <a href="../index.html">Home</a></span> </div>
<div class="pagers">
<div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="xgui_imperative_learn.html"><span class="hideA">Next page: </span>Basics</a></div><div class="pagerButton"><a href="xgui_expose_put.html">Previous page</a></div><div class="pagerButton"><a href="xgui.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div> <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
</div>
</div>
<div id="mainContent">
<h1 class="rank_chapter"
id="pageTopTitle">
<a name="xgui_imperative"></a>Chapter 2 Imperative XML processing </h1>
<div class="toc">
<p>
<b>
Chapter Contents
</b>
</p>
<ul class="noMargin">
<li>
<a href="xgui_imperative_learn.html">Basics</a>
</li>
<li>
<a href="xgui_imperative_formal.html">Details</a>
</li>
</ul>
</div>
<a name="docgen_afterTheTOC"></a>
</div>
<div class="navigation">
<div class="pagers">
<div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="xgui_imperative_learn.html"><span class="hideA">Next page: </span>Basics</a></div><div class="pagerButton"><a href="xgui_expose_put.html">Previous page</a></div><div class="pagerButton"><a href="xgui.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div> <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
</div>
<div class="breadcrumb">
<span class="breadcrumb"> You are here:
<a href="index.html">FreeMarker Manual</a>
<b>></b>
<a href="xgui.html">XML Processing Guide</a>
<b>></b>
Imperative XML processing
</span> </div>
</div>
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr>
<td colspan=2><img src="docgen-resources/img/none.gif" width=1 height=8 alt=""></td>
<tr>
<td align="left" valign="top"><span class="smallFooter">
FreeMarker Manual -- For FreeMarker 2.3.21
<br>
HTML generated: 2014-10-12 18:53:30 GMT
</span></td>
<td align="right" valign="top"><span class="smallFooter">
<a href="http://www.xmlmind.com/xmleditor/">
<img src="docgen-resources/img/xxe.gif" alt="Edited with XMLMind XML Editor">
</a>
</span></td>
</tr>
</table>
<!-- Put pre-loaded images here: -->
<div style="display: none">
<img src="docgen-resources/img/linktargetmarker.gif" alt="Here!" />
</div>
</body>
</html>
|
vicre/dsl-appliance
|
appliance/com.datascilab.core.codeGenerator/doc/_html/xgui_imperative.html
|
HTML
|
apache-2.0
| 4,354
|
package database
import "database/sql"
var db *sql.DB
// OpenDB opens database connection
func OpenDB() {
openSQLite()
}
// openSQLite opens SQLite connection
func openSQLite() {
var err error
db, err = sql.Open("sqlite3", "adnalerts.db?loc.auto")
if err != nil {
panic(err)
}
err = db.Ping()
if err != nil {
panic(err)
}
}
// Query any given SQL
func Query(s string, args ...interface{}) (*sql.Rows, error) {
rows, err := db.Query(s, args...)
if err != nil {
return nil, err
}
return rows, nil
}
// Exec any given SQL
func Exec(s string, args ...interface{}) (sql.Result, error) {
res, err := db.Exec(s, args...)
if err != nil {
return nil, err
}
return res, nil
}
|
AndoniFdez/adnalerts
|
database/sqllite.go
|
GO
|
apache-2.0
| 696
|
package com.minemarket.api;
import com.minemarket.api.types.PendingCommand;
import java.util.UUID;
/**
* Esta interface deve ser implementada para realizar a execu��o dos {@link PendingCommand}s.
*/
public interface BaseCommandExecutor {
/**
* Retorna a linha de comando que deve ser executada, substituindo os devidos valores de %name%, %uuid% ou %custom%
*
* @param command {@link PendingCommand} contendo as informa��es a serem utilizadas na substitui��o.
* @return Uma {@link String} onde as express�es vari�veis foram substituidas de acordo com o comando.
*/
default String getCommandLine(PendingCommand command) {
String cmd = command.getCommandLine();
String[] playerNameAlias = new String[]{"%name%", "%nick%", "%player%", "%nickname%", "%credits%"}; // Lista de aliases para a vari�vel do nome do jogador.
for (String alias : playerNameAlias)
cmd = cmd.replaceAll(alias, command.getPlayerName());
if (command.getPlayerUUID() != null)
cmd = cmd.replaceAll("%uuid%", command.getPlayerUUID().toString());
if (command.getCredits() != null)
cmd = cmd.replaceAll("%credits%", command.getCredits().toString());
cmd = cmd.replaceAll("%custom%", command.getCustom());
return cmd;
}
/**
* @param command O comando a ser executado
* @return <b>true</b> Se o comando for executado com sucesso <br>
* <b>false</b> Caso ocorra alguma falha durante a execu��o
*/
boolean executeCommand(PendingCommand command);
boolean isPlayerOnline(UUID uuid);
boolean isPlayerOnline(String name);
default boolean isPlayerOnline(UUID uuid, String name) {
return uuid == null ? isPlayerOnline(name) : isPlayerOnline(uuid);
}
}
|
MineMarketTeam/MineMarketAPI
|
api_base/src/main/java/com/minemarket/api/BaseCommandExecutor.java
|
Java
|
apache-2.0
| 1,824
|
/*
* 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.facebook.presto.operator.index;
import com.facebook.presto.ExceededMemoryLimitException;
import com.facebook.presto.ScheduledSplit;
import com.facebook.presto.TaskSource;
import com.facebook.presto.metadata.Split;
import com.facebook.presto.operator.Driver;
import com.facebook.presto.operator.DriverFactory;
import com.facebook.presto.operator.LookupSource;
import com.facebook.presto.spi.PageBuilder;
import com.facebook.presto.operator.PipelineContext;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.operator.index.PagesIndexBuilderOperator.PagesIndexBuilderOperatorFactory;
import com.facebook.presto.spi.block.Block;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.sql.planner.plan.PlanNodeId;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.ListenableFuture;
import io.airlift.units.DataSize;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.NotThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicReference;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Predicates.equalTo;
import static com.google.common.base.Predicates.not;
import static com.google.common.collect.Iterables.filter;
@ThreadSafe
public class IndexLoader
{
private final BlockingQueue<UpdateRequest> updateRequests = new LinkedBlockingQueue<>();
private final List<Type> outputTypes;
private final DriverFactory driverFactory;
private final PlanNodeId sourcePlanNodeId;
private final PagesIndexBuilderOperatorFactory pagesIndexOutput;
private final int expectedPositions;
private final DataSize maxIndexMemorySize;
private final IndexJoinLookupStats stats;
private final AtomicReference<TaskContext> taskContextReference = new AtomicReference<>();
private final List<Integer> indexChannels;
@GuardedBy("this")
private IndexSnapshotLoader indexSnapshotLoader; // Lazily initialized
@GuardedBy("this")
private final AtomicReference<IndexSnapshot> indexSnapshotReference;
public IndexLoader(List<Integer> indexChannels,
List<Type> types,
DriverFactory driverFactory,
PagesIndexBuilderOperatorFactory pagesIndexOutput,
int expectedPositions,
DataSize maxIndexMemorySize,
IndexJoinLookupStats stats)
{
checkArgument(!indexChannels.isEmpty(), "indexChannels must not be empty");
this.indexChannels = ImmutableList.copyOf(checkNotNull(indexChannels, "indexChannels is null"));
this.outputTypes = ImmutableList.copyOf(checkNotNull(types, "types is null"));
this.driverFactory = checkNotNull(driverFactory, "driverFactory is null");
this.sourcePlanNodeId = Iterables.getOnlyElement(driverFactory.getSourceIds());
this.pagesIndexOutput = checkNotNull(pagesIndexOutput, "pagesIndexOutput is null");
this.expectedPositions = checkNotNull(expectedPositions, "expectedPositions is null");
this.maxIndexMemorySize = checkNotNull(maxIndexMemorySize, "maxIndexMemorySize is null");
this.stats = checkNotNull(stats, "stats is null");
// start with an empty source
indexSnapshotReference = new AtomicReference<>(new IndexSnapshot(new EmptyLookupSource(types.size()), new EmptyLookupSource(indexChannels.size())));
}
// This is a ghetto way to acquire a TaskContext at runtime (unavailable at planning)
public void setContext(TaskContext taskContext)
{
taskContextReference.compareAndSet(null, taskContext);
}
public int getChannelCount()
{
return outputTypes.size();
}
public List<Type> getOutputTypes()
{
return outputTypes;
}
public IndexSnapshot getIndexSnapshot()
{
return indexSnapshotReference.get();
}
private static Block[] sliceBlocks(Block[] indexBlocks, int startPosition, int length)
{
Block[] slicedIndexBlocks = new Block[indexBlocks.length];
for (int i = 0; i < indexBlocks.length; i++) {
slicedIndexBlocks[i] = indexBlocks[i].getRegion(startPosition, length);
}
return slicedIndexBlocks;
}
public IndexSnapshot getIndexSnapshotForKeys(int position, Block[] indexBlocks)
{
// Normalize the indexBlocks so that they only encompass the unloaded positions
int totalPositions = indexBlocks[0].getPositionCount();
int remainingPositions = totalPositions - position;
return getIndexSnapshotForKeys(sliceBlocks(indexBlocks, position, remainingPositions));
}
private IndexSnapshot getIndexSnapshotForKeys(Block[] indexBlocks)
{
UpdateRequest myUpdateRequest = new UpdateRequest(indexBlocks);
updateRequests.add(myUpdateRequest);
synchronized (this) {
if (!myUpdateRequest.isFinished()) {
stats.recordIndexJoinLookup();
initializeIndexSnapshotLoaderIfNecessary();
List<UpdateRequest> requests = new ArrayList<>();
updateRequests.drainTo(requests);
long initialCacheSizeInBytes = indexSnapshotLoader.getCacheSizeInBytes();
// TODO: add heuristic to jump to load strategy that is most likely to succeed
// Try to load all the requests
if (indexSnapshotLoader.load(requests)) {
return myUpdateRequest.getFinishedIndexSnapshot();
}
// Retry again if there was initial data (load failures will clear the cache automatically)
if (initialCacheSizeInBytes > 0 && indexSnapshotLoader.load(requests)) {
stats.recordSuccessfulIndexJoinLookupByCacheReset();
return myUpdateRequest.getFinishedIndexSnapshot();
}
// Try loading just my request
if (requests.size() > 1) {
// Add all other requests back into the queue
Iterables.addAll(updateRequests, filter(requests, not(equalTo(myUpdateRequest))));
if (indexSnapshotLoader.load(ImmutableList.of(myUpdateRequest))) {
stats.recordSuccessfulIndexJoinLookupBySingleRequest();
return myUpdateRequest.getFinishedIndexSnapshot();
}
}
// Repeatedly decrease the number of rows to load by a factor of 10
int totalPositions = indexBlocks[0].getPositionCount();
int attemptedPositions = totalPositions / 10;
while (attemptedPositions > 1) {
myUpdateRequest = new UpdateRequest(sliceBlocks(indexBlocks, 0, attemptedPositions));
if (indexSnapshotLoader.load(ImmutableList.of(myUpdateRequest))) {
stats.recordSuccessfulIndexJoinLookupByLimitedRequest();
return myUpdateRequest.getFinishedIndexSnapshot();
}
attemptedPositions /= 10;
}
// Try just loading a single row
if (totalPositions > 1) { // If positionCount == 1, then we've already tried with just one row
myUpdateRequest = new UpdateRequest(sliceBlocks(indexBlocks, 0, 1));
if (indexSnapshotLoader.load(ImmutableList.of(myUpdateRequest))) {
stats.recordSuccessfulIndexJoinLookupByLimitedRequest();
return myUpdateRequest.getFinishedIndexSnapshot();
}
}
stats.recordFailedIndexJoinLookup();
throw new ExceededMemoryLimitException(maxIndexMemorySize, "Index");
}
}
// return the snapshot from the update request as another thread may have already flushed the request
return myUpdateRequest.getFinishedIndexSnapshot();
}
private synchronized void initializeIndexSnapshotLoaderIfNecessary()
{
if (indexSnapshotLoader == null) {
TaskContext taskContext = taskContextReference.get();
checkState(taskContext != null, "Task context must be set before index can be built");
PipelineContext pipelineContext = taskContext.addPipelineContext(false, false);
indexSnapshotLoader = new IndexSnapshotLoader(
driverFactory,
pipelineContext,
sourcePlanNodeId,
pagesIndexOutput,
indexSnapshotReference,
indexChannels,
expectedPositions,
maxIndexMemorySize);
}
}
@NotThreadSafe
private static class IndexSnapshotLoader
{
private final DriverFactory driverFactory;
private final PipelineContext pipelineContext;
private final PlanNodeId sourcePlanNodeId;
private final List<Integer> indexChannels;
private final List<Type> types;
private final List<Type> indexTypes;
private final AtomicReference<IndexSnapshot> indexSnapshotReference;
private final IndexSnapshotBuilder indexSnapshotBuilder;
private IndexSnapshotLoader(DriverFactory driverFactory,
PipelineContext pipelineContext,
PlanNodeId sourcePlanNodeId,
PagesIndexBuilderOperatorFactory pagesIndexOutput,
AtomicReference<IndexSnapshot> indexSnapshotReference,
List<Integer> indexChannels,
int expectedPositions,
DataSize maxIndexMemorySize)
{
this.driverFactory = driverFactory;
this.pipelineContext = pipelineContext;
this.sourcePlanNodeId = sourcePlanNodeId;
this.indexSnapshotReference = indexSnapshotReference;
this.indexChannels = indexChannels;
this.types = pagesIndexOutput.getTypes();
ImmutableList.Builder<Type> typeBuilder = ImmutableList.builder();
for (Integer outputIndexChannel : indexChannels) {
typeBuilder.add(pagesIndexOutput.getTypes().get(outputIndexChannel));
}
this.indexTypes = typeBuilder.build();
this.indexSnapshotBuilder = new IndexSnapshotBuilder(
pagesIndexOutput.getTypes(),
indexChannels,
pipelineContext.addDriverContext(),
maxIndexMemorySize,
expectedPositions);
pagesIndexOutput.setPagesIndexBuilder(indexSnapshotBuilder);
}
public long getCacheSizeInBytes()
{
return indexSnapshotBuilder.getMemoryInBytes();
}
public boolean load(List<UpdateRequest> requests)
{
UnloadedIndexKeyRecordSet unloadedKeysRecordSet = new UnloadedIndexKeyRecordSet(indexSnapshotReference.get(), indexTypes, requests);
// Drive index lookup to produce the output (landing in pagesIndexOutput)
Driver driver = driverFactory.createDriver(pipelineContext.addDriverContext());
driver.updateSource(new TaskSource(sourcePlanNodeId, ImmutableSet.of(new ScheduledSplit(0, new Split("index", new IndexSplit(unloadedKeysRecordSet)))), true));
while (!driver.isFinished()) {
ListenableFuture<?> process = driver.process();
checkState(process.isDone(), "Driver should never block");
}
if (indexSnapshotBuilder.isMemoryExceeded()) {
clearCachedData();
return false;
}
// Create lookup source with new data
IndexSnapshot newValue = indexSnapshotBuilder.createIndexSnapshot(unloadedKeysRecordSet);
if (newValue == null) {
clearCachedData();
return false;
}
indexSnapshotReference.set(newValue);
for (UpdateRequest request : requests) {
request.finished(newValue);
}
return true;
}
private void clearCachedData()
{
indexSnapshotReference.set(new IndexSnapshot(new EmptyLookupSource(types.size()), new EmptyLookupSource(indexChannels.size())));
indexSnapshotBuilder.reset();
}
}
private static class EmptyLookupSource
implements LookupSource
{
private final int channelCount;
public EmptyLookupSource(int channelCount)
{
this.channelCount = channelCount;
}
@Override
public int getChannelCount()
{
return channelCount;
}
@Override
public long getJoinPosition(int position, Block... blocks)
{
return IndexSnapshot.UNLOADED_INDEX_KEY;
}
@Override
public long getNextJoinPosition(long currentPosition)
{
return IndexSnapshot.UNLOADED_INDEX_KEY;
}
@Override
public void appendTo(long position, PageBuilder pageBuilder, int outputChannelOffset)
{
throw new UnsupportedOperationException();
}
}
}
|
stagraqubole/presto
|
presto-main/src/main/java/com/facebook/presto/operator/index/IndexLoader.java
|
Java
|
apache-2.0
| 14,266
|
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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.
#
from collections import deque
from proboscis import test
from proboscis import asserts
from proboscis import after_class
from proboscis import before_class
from trove.tests.config import CONFIG
from trove.tests.api.instances import instance_info
from trove.tests.api.instances import VOLUME_SUPPORT
from trove.tests.util.users import Requirements
from trove.tests.util import assert_contains
from trove.tests.util import create_dbaas_client
from trove.common.utils import poll_until
@test(groups=["dbaas.api.mgmt.malformed_json"])
class MalformedJson(object):
@before_class
def setUp(self):
self.reqs = Requirements(is_admin=False)
self.user = CONFIG.users.find_user(self.reqs)
self.dbaas = create_dbaas_client(self.user)
volume = None
if VOLUME_SUPPORT:
volume = {"size": 1}
self.instance = self.dbaas.instances.create(
name="qe_instance",
flavor_id=instance_info.dbaas_flavor_href,
volume=volume,
databases=[{"name": "firstdb", "character_set": "latin2",
"collate": "latin2_general_ci"}])
@after_class
def tearDown(self):
self.dbaas.instances.delete(self.instance)
@test
def test_bad_instance_data(self):
databases = "foo"
users = "bar"
try:
self.dbaas.instances.create("bad_instance", 3, 3,
databases=databases, users=users)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create instance failed with code %s,"
" exception %s" % (httpCode, e))
databases = "u'foo'"
users = "u'bar'"
assert_contains(
e.message,
["Validation error:",
"instance['databases'] %s is not of type 'array'" % databases,
"instance['users'] %s is not of type 'array'" % users,
"instance['volume'] 3 is not of type 'object'"])
@test
def test_bad_database_data(self):
_bad_db_data = "{foo}"
try:
self.dbaas.databases.create(self.instance.id, _bad_db_data)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create database failed with code %s, "
"exception %s" % (httpCode, e))
_bad_db_data = "u'{foo}'"
asserts.assert_equal(e.message,
"Validation error: "
"databases %s is not of type 'array'" %
_bad_db_data)
@test
def test_bad_user_data(self):
def format_path(values):
values = list(values)
msg = "%s%s" % (values[0],
''.join(['[%r]' % i for i in values[1:]]))
return msg
_user = []
_user_name = "F343jasdf"
_user.append({"name12": _user_name,
"password12": "password"})
try:
self.dbaas.users.create(self.instance.id, _user)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create user failed with code %s, "
"exception %s" % (httpCode, e))
err_1 = format_path(deque(('users', 0)))
assert_contains(
e.message,
["Validation error:",
"%(err_1)s 'name' is a required property" % {'err_1': err_1},
"%(err_1)s 'password' is a required property"
% {'err_1': err_1}])
@test
def test_bad_resize_instance_data(self):
def _check_instance_status():
inst = self.dbaas.instances.get(self.instance)
if inst.status == "ACTIVE":
return True
else:
return False
poll_until(_check_instance_status)
try:
self.dbaas.instances.resize_instance(self.instance.id, "bad data")
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Resize instance failed with code %s, "
"exception %s" % (httpCode, e))
@test
def test_bad_resize_vol_data(self):
def _check_instance_status():
inst = self.dbaas.instances.get(self.instance)
if inst.status == "ACTIVE":
return True
else:
return False
poll_until(_check_instance_status)
data = "bad data"
try:
self.dbaas.instances.resize_volume(self.instance.id, data)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Resize instance failed with code %s, "
"exception %s" % (httpCode, e))
data = "u'bad data'"
assert_contains(
e.message,
["Validation error:",
"resize['volume']['size'] %s is not valid under "
"any of the given schemas" % data,
"%s is not of type 'integer'" % data,
"%s does not match '[0-9]+'" % data])
@test
def test_bad_change_user_password(self):
password = ""
users = [{"name": password}]
def _check_instance_status():
inst = self.dbaas.instances.get(self.instance)
if inst.status == "ACTIVE":
return True
else:
return False
poll_until(_check_instance_status)
try:
self.dbaas.users.change_passwords(self.instance, users)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Change usr/passwd failed with code %s, "
"exception %s" % (httpCode, e))
password = "u''"
assert_contains(
e.message,
["Validation error: users[0] 'password' "
"is a required property",
"users[0]['name'] %s is too short" % password,
"users[0]['name'] %s does not match "
"'^.*[0-9a-zA-Z]+.*$'" % password])
@test
def test_bad_grant_user_access(self):
dbs = []
def _check_instance_status():
inst = self.dbaas.instances.get(self.instance)
if inst.status == "ACTIVE":
return True
else:
return False
poll_until(_check_instance_status)
try:
self.dbaas.users.grant(self.instance, self.user, dbs)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Grant user access failed with code %s, "
"exception %s" % (httpCode, e))
@test
def test_bad_revoke_user_access(self):
db = ""
def _check_instance_status():
inst = self.dbaas.instances.get(self.instance)
if inst.status == "ACTIVE":
return True
else:
return False
poll_until(_check_instance_status)
try:
self.dbaas.users.revoke(self.instance, self.user, db)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 404,
"Revoke user access failed w/code %s, "
"exception %s" % (httpCode, e))
asserts.assert_equal(e.message, "The resource could not be found.")
@test
def test_bad_body_flavorid_create_instance(self):
flavorId = ["?"]
try:
self.dbaas.instances.create("test_instance",
flavorId,
2)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create instance failed with code %s, "
"exception %s" % (httpCode, e))
flavorId = [u'?']
assert_contains(
e.message,
["Validation error:",
"instance['flavorRef'] %s is not valid "
"under any of the given schemas" % flavorId,
"%s is not of type 'string'" % flavorId,
"%s is not of type 'string'" % flavorId,
"%s is not of type 'integer'" % flavorId,
"instance['volume'] 2 is not of type 'object'"])
@test
def test_bad_body_datastore_create_instance(self):
datastore = "*"
datastore_version = "*"
try:
self.dbaas.instances.create("test_instance",
3, {"size": 2},
datastore=datastore,
datastore_version=datastore_version)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create instance failed with code %s, "
"exception %s" % (httpCode, e))
assert_contains(
e.message,
["Validation error:",
"instance['datastore']['type']"
" u'%s' does not match"
" '^.*[0-9a-zA-Z]+.*$'" % datastore,
"instance['datastore']['version'] u'%s' "
"does not match '^.*[0-9a-zA-Z]+.*$'" % datastore_version])
@test
def test_bad_body_volsize_create_instance(self):
volsize = "h3ll0"
try:
self.dbaas.instances.create("test_instance",
"1",
volsize)
except Exception as e:
resp, body = self.dbaas.client.last_response
httpCode = resp.status
asserts.assert_equal(httpCode, 400,
"Create instance failed with code %s, "
"exception %s" % (httpCode, e))
volsize = "u'h3ll0'"
asserts.assert_equal(e.message,
"Validation error: "
"instance['volume'] %s is not of "
"type 'object'" % volsize)
|
changsimon/trove
|
trove/tests/api/mgmt/malformed_json.py
|
Python
|
apache-2.0
| 12,085
|
# Pseuderemostachys sewerzovii (severtzovii) (Herd.) Popov, SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Pseuderemostachys/Pseuderemostachys sewerzovii/README.md
|
Markdown
|
apache-2.0
| 207
|
package com.twitter.finagle.http
import com.twitter.finagle.Service
import com.twitter.util.{Await, Duration, Future}
import org.mockito.Matchers.any
import org.mockito.Mockito.{never, stub, verify}
import org.scalatest.FunSuite
import org.scalatestplus.mockito.MockitoSugar
class DelayedReleaseServiceTest extends FunSuite with MockitoSugar {
def await[A](f: Future[A]): A = Await.result(f, Duration.fromSeconds(30))
test("close closes underlying") {
val service = mock[Service[Request, Response]]
val proxy = new DelayedReleaseService(service)
stub(service.close()).toReturn(Future.Done)
proxy.close()
verify(service).close()
}
test("close waits for response completion") {
val response = Response()
response.setChunked(true)
response.writer.close()
val service = mock[Service[Request, Response]]
stub(service.close()).toReturn(Future.Done)
stub(service.apply(any[Request])).toReturn(Future.value(response))
val proxy = new DelayedReleaseService(service)
val result = proxy(Request()).flatMap { _ =>
proxy.close()
verify(service, never).close()
response.reader.read()
}
assert(await(result).isEmpty)
verify(service).close()
}
test("close waits for request completion") {
val request = Request()
request.setChunked(true)
request.writer.close()
val service = mock[Service[Request, Response]]
stub(service.close()).toReturn(Future.Done)
stub(service.apply(any[Request])).toReturn(Future.value(Response()))
val proxy = new DelayedReleaseService(service)
val result = proxy(request).flatMap { _ =>
proxy.close()
verify(service, never).close()
request.reader.read()
}
assert(await(result).isEmpty)
verify(service).close()
}
test("close waits for request & response completion") {
val request = Request()
request.setChunked(true)
request.writer.close()
val response = Response()
response.setChunked(true)
response.writer.close()
val service = mock[Service[Request, Response]]
stub(service.close()).toReturn(Future.Done)
stub(service.apply(any[Request])).toReturn(Future.value(response))
val proxy = new DelayedReleaseService(service)
val result = proxy(request).flatMap { _ =>
proxy.close()
verify(service, never).close()
request.reader.read().flatMap { _ =>
verify(service, never).close()
response.reader.read()
}
}
assert(await(result).isEmpty)
verify(service).close()
}
test("inner service failure") {
val service = mock[Service[Request, Response]]
val proxy = new DelayedReleaseService(service)
stub(service.close()).toReturn(Future.Done)
stub(service.apply(any[Request])).toReturn(Future.exception(new Exception))
val request = Request()
proxy(request)
proxy.close()
verify(service).close()
}
}
|
luciferous/finagle
|
finagle-base-http/src/test/scala/com/twitter/finagle/http/DelayedReleaseServiceTest.scala
|
Scala
|
apache-2.0
| 2,915
|
package com.dhl.serv.service;
import com.dhl.serv.config.audit.AuditEventConverter;
import com.dhl.serv.repository.PersistenceAuditEventRepository;
import java.time.LocalDateTime;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.inject.Inject;
import java.util.Optional;
/**
* Service for managing audit events.
* <p>
* This is the default implementation to support SpringBoot Actuator AuditEventRepository
* </p>
*/
@Service
@Transactional
public class AuditEventService {
private PersistenceAuditEventRepository persistenceAuditEventRepository;
private AuditEventConverter auditEventConverter;
@Inject
public AuditEventService(
PersistenceAuditEventRepository persistenceAuditEventRepository,
AuditEventConverter auditEventConverter) {
this.persistenceAuditEventRepository = persistenceAuditEventRepository;
this.auditEventConverter = auditEventConverter;
}
public Page<AuditEvent> findAll(Pageable pageable) {
return persistenceAuditEventRepository.findAll(pageable)
.map(persistentAuditEvents -> auditEventConverter.convertToAuditEvent(persistentAuditEvents));
}
public Page<AuditEvent> findByDates(LocalDateTime fromDate, LocalDateTime toDate, Pageable pageable) {
return persistenceAuditEventRepository.findAllByAuditEventDateBetween(fromDate, toDate, pageable)
.map(persistentAuditEvents -> auditEventConverter.convertToAuditEvent(persistentAuditEvents));
}
public Optional<AuditEvent> find(Long id) {
return Optional.ofNullable(persistenceAuditEventRepository.findOne(id)).map
(auditEventConverter::convertToAuditEvent);
}
}
|
gcorreageek/dhl
|
backend/ProyService1/src/main/java/com/dhl/serv/service/AuditEventService.java
|
Java
|
apache-2.0
| 1,912
|
# Benchmark Results
Benchmarked locally with increased ulimit and tcp_mem
Server is running the strawpoll app
## 100 concurrent connections
### Performance | connections per ms
* uWebSockets: 6.3, 5.6, 5.2, 5.6, 6.7, 7.1, 5.6, 6,3, 11.1, 5.6
* Beast:
* IncludeOS:
### Memory Usage | user space in mb
* uWebSockets: 4.6, 4.6, 4.6, 4.6, 4.6, 4.6, 4.6, 4.6, 4.6, 4.6
* Beast:
* IncludeOS:
## 10.000 concurrent connections
### Performance | connections per ms
* uWebSockets: 35.1, 32.8, 35.0, 32.9, 34.0
* Beast:
* IncludeOS:
### Memory Usage | user space in mb
* uWebSockets: 6.4, 6.4, 6.2, 6.5, 6.3
* Beast:
* IncludeOS:
## Compile Time
### Top level change | Time in seconds
Debug:
* uWebSockets: 1.4, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4
* Beast: 6.9, 8.7, 8.5, 7.3, 8.7, 8.5, 7.0
* IncludeOS:
Release:
* uWebSockets: 1.8, 1.9, 2.1, 1.7, 1.7, 1.7
* Beast: 14.4, 17.1, 14.5, 16,3, 18.0, 15.5, 16.4
* IncludeOS: 2.0, 2.5, 2.2, 2.9, 2.0, 2.9, 2.2, 3.0, 2.2
## Code Size
* uWebSockets | ~1.6kb
* Beast | ~9kb
* IncludeOS | ~3kb
### Beast example Comparison | 100 concurrent connections
* sync 5mb | 4.5c/ms
* stackless 2mb | 5.5c/ms
* fast 9mb | 6.2c/ms
* coro 6mb | 5.5c/ms
* async 4mb | 5.2c/ms
### Beast example Comparison | 10.000 concurrent connections
* sync 100mb | 17c/ms
* stackless 50mb | 26c/ms
* fast 150mb | 17c/ms
* coro 140mb | 22c/ms
* async 50mb | 25c/ms
|
Voultapher/Presentations
|
old/cppcon-2017-web-service/example/server/Benchmark.md
|
Markdown
|
apache-2.0
| 1,434
|
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
testRecipe1 = """\
class TestRecipe1(PackageRecipe):
name = 'testcase'
version = '1.0'
clearBuildReqs()
owner = 'root'
group = 'root'
withBinary = True
withUse = False
changedconfig = '%(sysconfdir)s/changedconfig'
unchangedconfig = '%(sysconfdir)s/unchangedconfig'
changed = '%(datadir)s/changed'
unchanged = '%(datadir)s/unchanged'
initialFileText = '\\n'.join([str(x) for x in range(0,10)]) + '\\n'
fileText = initialFileText
def modifyFiles(self):
pass
def setup(self):
if self.withUse:
if Use.readline:
pass
if self.withBinary:
self.Run('''
cat > hello.c <<'EOF'
#include <stdio.h>
int main(void) {
return printf("Hello, world.\\\\n");
}
EOF
''')
self.Make('hello', preMake='LDFLAGS="-static"')
self.Install('hello', '%(bindir)s/')
self.Create(self.changedconfig, self.unchangedconfig,
self.changed, self.unchanged, contents=self.initialFileText)
self.modifyFiles()
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(datadir)s/', '%(sysconfdir)s/')
self.Strip(debuginfo=False)
"""
testRecipe2="""\
class TestRecipe2(TestRecipe1):
version = '1.1'
fileText = TestRecipe1.fileText.replace("5", "1")
def modifyFile(self, path):
return 'sed -i s/^5/1/g %(destdir)s'+path
def modifyFiles(self):
for path in (self.changedconfig, self.changed):
self.Run(self.modifyFile(path))
def setup(self):
TestRecipe1.setup(self)
"""
testRecipe3="""\
class TestRecipe3(TestRecipe1):
version = '1.2'
fileText = TestRecipe1.fileText.replace("6", "2")
def modifyFile(self, path):
return 'sed -i s/^6/2/g %(destdir)s'+path
def modifyFiles(self):
for path in (self.changedconfig,):
self.Run(self.modifyFile(path))
def setup(self):
TestRecipe1.setup(self)
"""
testRecipe4="""\
class TestRecipe4(TestRecipe1):
version = '1.3'
def setup(self):
TestRecipe1.setup(self)
self.Config(exceptions = "/etc/.*")
"""
# like TestRecipe1, but only includes /usr/bin/hello
testRecipe5="""\
class TestRecipe5(TestRecipe1):
version = '1.4'
def setup(r):
TestRecipe1.setup(r)
r.Remove(r.changed)
r.Remove(r.unchanged)
r.Remove(r.changedconfig)
r.Remove(r.unchangedconfig)
"""
testTransientRecipe1=r"""\
class TransientRecipe1(PackageRecipe):
name = 'testcase'
version = '1.0'
clearBuildReqs()
fileText = 'bar\n'
def setup(r):
r.Create('/foo', contents=r.fileText)
r.Transient('/foo')
"""
testTransientRecipe2=r"""\
class TransientRecipe2(PackageRecipe):
name = 'testcase'
version = '1.1'
clearBuildReqs()
fileText = 'blah\n'
def setup(r):
r.Create('/foo', contents=r.fileText)
r.Transient('/foo')
"""
testTransientRecipe3=r"""\
class TransientRecipe3(PackageRecipe):
name = 'testcase'
version = '1.2'
clearBuildReqs()
fileText = 'blah\n'
def setup(r):
#don't create foo
r.Create('/foo2', contents=r.fileText)
r.Transient('/foo2')
"""
testTransientRecipe4=r"""\
class TransientRecipe4(PackageRecipe):
name = 'testcase'
version = '1.3'
clearBuildReqs()
fileText = 'blahblech\n'
def setup(r):
#don't create foo
r.Create('/foo3', contents=r.fileText)
r.Transient('/foo3')
"""
libhelloRecipePreface="""\
class Libhello(PackageRecipe):
name = 'libhello'
version = '0'
clearBuildReqs()
def setup(self):
# NormalizeInterpreterPaths not the purpose of these tests,
# and dealing with it running would make tests needlessly
# and uselessly more verbose.
del self.NormalizeInterpreterPaths
self.Create('libhello.c', contents='''
/* libhello.c - Simple example of a shared library */
void return_one(void) {
return 1;
}
''')
self.Create('true.c', contents='''
int main() {
return 0;
}
''')
self.Create('user.c', contents='''
int main() {
return return_one();
}
''')
"""
libhelloRecipe = libhelloRecipePreface + r"""
self.Run('%(cc)s %(ldflags)s -fPIC -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.c -nostdlib')
self.Run('%(cc)s %(ldflags)s -static -o true true.c')
self.Run('%(cc)s %(ldflags)s -nostdlib -o user user.c libhello.so.0.0')
self.Install('libhello.so.0.0', '%(libdir)s/libhello.so.0.0')
self.Install('true', '%(essentialsbindir)s/ldconfig', mode=0755)
self.Install('user', '%(essentialsbindir)s/user', mode=0755)
self.Create('/etc/ld.so.conf', contents='/%(lib)s')
self.Create('%(essentialbindir)s/script',
contents='#!%(essentialsbindir)s/user', mode = 0755)
self.Provides('file', '%(essentialsbindir)s/user')
self.ComponentSpec('runtime', '%(essentialsbindir)s/ldconfig',
'%(libdir)s/libhello.so.0.*',
'%(sysconfdir)s/')
self.ComponentSpec('user', '%(essentialsbindir)s/user')
self.ComponentSpec('script', '%(essentialbindir)s/script')
self.Strip(debuginfo=False)
"""
libhelloRecipeLdConfD = libhelloRecipePreface + r"""
self.Run('%(cc)s %(ldflags)s -fPIC -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.c -nostdlib')
self.Run('%(cc)s %(ldflags)s -static -o true true.c')
self.Run('%(cc)s %(ldflags)s -nostdlib -o user user.c libhello.so.0.0')
self.Install('libhello.so.0.0', '%(libdir)s/libhello.so.0.0')
self.Install('libhello.so.0.0', '%(essentiallibdir)s/libhello.so.0.0')
self.Install('true', '%(essentialsbindir)s/ldconfig', mode=0755)
self.Install('user', '%(essentialsbindir)s/user', mode=0755)
self.Create('/etc/ld.so.conf', contents='/opt/foo')
self.Create('/etc/ld.so.conf.d/first.conf', contents='%(essentiallibdir)s')
self.Create('%(essentialbindir)s/script',
contents='#!%(essentialsbindir)s/user', mode = 0755)
self.Provides('file', '%(essentialsbindir)s/user')
self.ComponentSpec('runtime', '%(essentialsbindir)s/ldconfig',
'%(libdir)s/libhello.so.0.*',
'%(essentiallibdir)s/libhello.so.0.*',
'/etc/ld.so.conf.d/first.conf',
'%(sysconfdir)s/')
self.ComponentSpec('user', '%(essentialsbindir)s/user')
self.ComponentSpec('script', '%(essentialbindir)s/script')
self.Strip(debuginfo=False)
"""
libhelloRecipeNoVersion = libhelloRecipePreface + """\
self.Run('%(cc)s %(ldflags)s -fPIC -shared -Wl,-soname,libhello.so -o libhello.so libhello.c -nostdlib')
self.Run('%(cc)s %(ldflags)s -static -o true true.c')
self.Run('%(cc)s %(ldflags)s -nostdlib -o user user.c libhello.so')
self.Install('libhello.so', '%(libdir)s/libhello.so', mode=0644)
self.Install('true', '%(essentialsbindir)s/ldconfig', mode=0755)
self.Install('user', '%(essentialsbindir)s/user', mode=0755)
self.Create('/etc/ld.so.conf', contents='/lib')
self.Create('%(essentialbindir)s/script',
contents='#!%(essentialsbindir)s/user', mode = 0755)
self.Provides('file', '%(essentialsbindir)s/user')
self.ComponentSpec('runtime', '%(essentialsbindir)s/ldconfig',
'%(libdir)s/libhello.so',
'%(sysconfdir)s/')
self.ComponentSpec('user', '%(essentialsbindir)s/user')
self.ComponentSpec('script', '%(essentialbindir)s/script')
self.Strip(debuginfo=False)
"""
bashRecipe="""\
class Bash(PackageRecipe):
name = 'bash'
version = '0'
clearBuildReqs()
def setup(r):
del r.NormalizeInterpreterPaths
r.Create('%(essentialbindir)s/bash', mode=0755)
r.Create('%(essentialbindir)s/conflict', mode=0755)
r.Provides('file', '%(essentialbindir)s/(ba)?sh')
if Use.ssl:
# turn on this use flag; we use this in the tests for flavor
# dependent resolution
pass
"""
bashMissingRecipe="""\
class Bash(PackageRecipe):
name = 'bash'
version = '1'
clearBuildReqs()
def setup(r):
del r.NormalizeInterpreterPaths
r.Create('%(essentialbindir)s/conflict', mode=0755)
if Use.ssl:
# turn on this use flag; we use this in the tests for flavor
# dependent resolution
pass
"""
bashUserRecipe="""\
class BashUser(PackageRecipe):
name = 'bashuser'
version = '0'
clearBuildReqs()
def setup(r):
del r.NormalizeInterpreterPaths
r.Create('%(essentialbindir)s/script', mode=0755,
contents = '#!/bin/bash')
"""
bashTroveUserRecipe="""\
class BashTroveUser(PackageRecipe):
name = 'bashtroveuser'
version = '0'
clearBuildReqs()
def setup(r):
del r.NormalizeInterpreterPaths
r.Create('%(essentiallibdir)s/empty', mode=0644)
r.Requires('bash:runtime', '%(essentiallibdir)s/empty')
"""
gconfRecipe="""\
class Gconf(PackageRecipe):
name = 'gconf'
version = '0'
clearBuildReqs()
def setup(r):
r.Create('%(sysconfdir)s/gconf/schemas/foo')
r.Install('/bin/true', '%(bindir)s/gconftool-2', mode=0755)
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
chkconfigRecipe="""\
class ChkconfigTest(PackageRecipe):
name = 'testchk'
version = '0'
clearBuildReqs()
def setup(self):
self.Run('''
cat > chkconfig.c <<'EOF'
int main(int argc, char ** argv) {
int fd;
char ** chptr;
fd = open(\"OUT\", 0102, 0666);
for (chptr = argv; *chptr; chptr++) {
write(fd, *chptr, strlen(*chptr));
if (*(chptr + 1)) write(fd, \" \", 1);
}
write(fd, \"\\\\n\", 1);
close(fd);
}
EOF
''')
self.Run('''
cat > testchk <<'EOF'
# chkconfig: 345 95 5
# description: Runs commands scheduled by the at command at the time \
# specified when at was run, and runs batch commands when the load \
# average is low enough.
# processname: atd
EOF
''')
self.Run('%(cc)s %(ldflags)s -static -o chkconfig chkconfig.c')
self.Install("chkconfig", "%(essentialsbindir)s/", mode = 0755)
self.Install("testchk", "%(initdir)s/", mode = 0755)
self.Strip(debuginfo=False)
"""
doubleRecipe1 = """
class Double(PackageRecipe):
name = 'double'
version = '1.0'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo1", contents = "text1")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
doubleRecipe1_1 = """
class Double(PackageRecipe):
name = 'double'
version = '1.1'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo1.1", contents = "text1.1")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
doubleRecipe1_2 = """
class Double(PackageRecipe):
name = 'double'
version = '1.2'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo1.2", contents = "text1.2")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
doubleRecipe1_3 = """
class Double(PackageRecipe):
name = 'double'
version = '1.3'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo1.3", contents = "text1.3")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
doubleRecipe2 = """
class Double(PackageRecipe):
name = 'double'
version = '2.0'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo2", contents = "text2")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
doubleRecipe2_1 = """
class Double(PackageRecipe):
name = 'double'
version = '2.1'
clearBuildReqs()
owner = 'root'
group = 'root'
def setup(self):
self.Create("/etc/foo2.1", contents = "text2.1")
self.Ownership(self.owner, self.group, '.*')
self.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
simpleTagHandler = """r.Run('''
cat > testtag.taghandler.c <<'EOF'
int main(int argc, char ** argv) {
int fd;
char ** chptr;
fd = open(\"OUT%s\", 0102, 0666);
for (chptr = argv; *chptr; chptr++) {
write(fd, *chptr, strlen(*chptr));
if (*(chptr + 1)) write(fd, \" \", 1);
}
write(fd, \"\\\\n\", 1);
close(fd);
}
EOF
''')
r.Run('%%(cc)s %%(ldflags)s -static -o testtag.taghandler testtag.taghandler.c')
r.Strip(debuginfo=False)"""
tagProviderRecipe1 = """
class TagProvider(PackageRecipe):
name = 'tagprovider'
version = '0'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testtag.tagdescription <<EOF
file /usr/libexec/conary/tags/testtag
implements files update
implements files remove
include /etc/test.*
EOF
''')
%(simpleTagHandler)s
r.Install('testtag.tagdescription',
'%%(tagdescriptiondir)s/testtag')
r.Install('testtag.taghandler',
'%%(taghandlerdir)s/testtag')
# Also test tagging our own files
r.Create('/etc/testself.1')
r.ComponentSpec('runtime', '%%(sysconfdir)s/')
""" % { 'simpleTagHandler' : (simpleTagHandler % "") }
tagProviderRecipe2 = """
class TagProvider(PackageRecipe):
name = 'tagprovider'
version = '1'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testtag.tagdescription <<EOF
file /usr/libexec/conary/tags/testtag
implements files update
implements files preremove
implements files remove
implements files preupdate
implements handler update
implements handler preremove
datasource args
include /etc/test.*
EOF
''')
%(simpleTagHandler)s
r.Install('testtag.tagdescription',
'%%(tagdescriptiondir)s/testtag')
r.Install('testtag.taghandler',
'%%(taghandlerdir)s/testtag')
# Also test tagging our own files
r.Create('/etc/testself.1')
r.ComponentSpec('runtime', '%%(sysconfdir)s/')
""" % { 'simpleTagHandler' : (simpleTagHandler % "") }
tagProviderRecipe3 = """
class TagProvider(PackageRecipe):
name = 'tagprovider'
version = '1'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testtag.tagdescription <<EOF
file /usr/libexec/conary/tags/testtag
implements files update
datasource stdin
include /etc/test.*
EOF
''')
%(simpleTagHandler)s
r.Install('testtag.tagdescription',
'%%(tagdescriptiondir)s/testtag')
r.Install('testtag.taghandler',
'%%(taghandlerdir)s/testtag')
""" % { 'simpleTagHandler' : (simpleTagHandler % "") }
# this is just like tagProviderRecipe2, but the tagdescription will create
# /tmp/OUT2 instead of /tmp/OUT
tagProviderRecipe4 = """
class TagProvider(PackageRecipe):
name = 'tagprovider'
version = '1'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testtag.tagdescription <<EOF
file /usr/libexec/conary/tags/testtag
implements files update
implements files preremove
implements files remove
implements handler update
implements handler preremove
datasource args
include /etc/test.*
EOF
''')
%(simpleTagHandler)s
r.Install('testtag.tagdescription',
'%%(tagdescriptiondir)s/testtag')
r.Install('testtag.taghandler',
'%%(taghandlerdir)s/testtag')
# Also test tagging our own files
r.Create('/etc/testself.1')
r.ComponentSpec('runtime', '%%(sysconfdir)s/')
""" % { 'simpleTagHandler' : (simpleTagHandler % "2") }
# this is just like tagProviderRecipe2, but it has a more limited implements
# set
tagProviderRecipe5 = """
class TagProvider(PackageRecipe):
name = 'tagprovider'
version = '1'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testtag.tagdescription <<EOF
file /usr/libexec/conary/tags/testtag
implements files remove
datasource args
include /etc/test.*
EOF
''')
%(simpleTagHandler)s
r.Install('testtag.tagdescription',
'%%(tagdescriptiondir)s/testtag')
r.Install('testtag.taghandler',
'%%(taghandlerdir)s/testtag')
# Also test tagging our own files
r.Create('/etc/testself.1')
r.ComponentSpec('runtime', '%%(sysconfdir)s/')
""" % { 'simpleTagHandler' : (simpleTagHandler % "") }
firstTagUserRecipe1 = """
class FirstTagUser(PackageRecipe):
name = 'firsttaguser'
version = '0'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testfirst.1 <<EOF
first.1
EOF
''')
r.Run('''
cat > testfirst.2 <<EOF
first.2
EOF
''')
r.Install('testfirst.1', '/etc/testfirst.1')
r.Install('testfirst.2', '/etc/testfirst.2')
r.TagSpec('testtag', '/etc/test.*')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
secondTagUserRecipe1 = """
class SecondTagUser(PackageRecipe):
name = 'secondtaguser'
version = '0'
clearBuildReqs()
def setup(r):
r.Run('''
cat > testsecond.1 <<EOF
second.1
EOF
''')
r.Install('testsecond.1', '/etc/testsecond.1')
r.TagSpec('testtag', '/etc/test.*')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
multiTagRecipe0 = """
class MultiTag(PackageRecipe):
name = 'multitag'
version = '0'
clearBuildReqs()
def setup(r):
r.Create('%(tagdescriptiondir)s/foo', contents='''file %(taghandlerdir)s/foo
implements files update
implements files remove
datasource multitag
''')
r.Create('%(tagdescriptiondir)s/bar', contents='''file %(taghandlerdir)s/foo
implements files update
implements files remove
datasource multitag
''')
r.Create('%(taghandlerdir)s/foo', mode=0755, contents='''\
#!/bin/bash
exit 0
''')
r.Create('/foo')
r.TagSpec('foo', '/foo')
"""
multiTagRecipe = multiTagRecipe0 + """
r.TagSpec('bar', '/foo')
"""
multiTagRecipe2 = multiTagRecipe0
# Test
multiTagRecipe3 = multiTagRecipe0.replace("exit 0",
"echo ${SOMEVAR:-UNDEFINED}; exit 0")
linkRecipe1 = """\
class LinkRecipe(PackageRecipe):
name = 'linktest'
version = '1.0'
clearBuildReqs()
hard = 1
paths = ("/usr/share/foo", "/usr/share/bar")
initialFileText = '\\n'.join([str(x) for x in range(0,10)]) + '\\n'
fileText = initialFileText
def setup(r):
r.Create(r.paths[0], contents=r.initialFileText)
for path in r.paths[1:]:
if r.hard:
r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.paths[0], path))
else:
r.Run("ln -s %s %%(destdir)s/%s" % (r.paths[0], path))
"""
linkRecipe2 = """\
class LinkRecipe2(LinkRecipe):
name = 'linktest'
version = '1.1'
"""
linkRecipe3 = """\
class LinkRecipe3(LinkRecipe):
name = 'linktest'
version = '1.2'
paths = ("/usr/share/foo", "/usr/share/bar", "/usr/share/foobar")
"""
# two link groups, both linkgroups have the same contents sha1
linkRecipe4 = """\
class LinkRecipe(PackageRecipe):
name = 'linktest'
version = '1.0'
clearBuildReqs()
hard = 1
paths = ('/usr/share/lg1-1',
'/usr/share/lg1-2',
'/usr/share/lg2-1',
'/usr/share/lg2-2')
initialFileText = '\\n'.join([str(x) for x in range(0,10)]) + '\\n'
fileText = initialFileText
def setup(r):
r.Create(r.paths[0], contents=r.initialFileText)
r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.paths[0],
r.paths[1]))
r.Create(r.paths[2], contents=r.initialFileText)
r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.paths[2],
r.paths[3]))
"""
idChange1 = """\
class IdChange1(PackageRecipe):
name = 'idchange'
version = '1.0'
clearBuildReqs()
paths = [ "/etc/foo", "/etc/bar" ]
fileText = '\\n'.join([str(x) for x in range(0,10)]) + '\\n'
def setup(r):
for path in r.paths:
r.Create(path, contents=r.fileText)
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
idChange2 = """\
class IdChange2(IdChange1):
paths = [ "/etc/foo" ]
fileText = IdChange1.fileText
fileText.replace("5", "10")
version = '1.1'
"""
idChange3 = """\
class IdChange3(IdChange1):
paths = [ "/etc/foo", "/etc/bar" ]
fileText = IdChange1.fileText
fileText.replace("6", "11")
version = '1.2'
"""
testUnresolved = """\
class Unresolved(PackageRecipe):
name = 'testcase'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/bin/test', mode=0755)
r.Requires('bar:foo', '/usr/bin/test')
"""
testTroveDepA = """\
class A(PackageRecipe):
name = 'a'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/bin/a', mode=0755)
"""
testTroveDepB = """\
class B(PackageRecipe):
name = 'b'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/bin/b', mode=0755)
r.Requires('a:runtime', '/usr/bin/b')
"""
# these test updating a config file from a version which will no longer
# exist (and be cleared from the content store) to a new one
simpleConfig1 = """\
class SimpleConfig1(PackageRecipe):
name = 'simpleconfig'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create("/etc/foo", contents = "text 1")
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
simpleConfig2 = """\
class SimpleConfig2(PackageRecipe):
name = 'simpleconfig'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create("/etc/foo", contents = "text 2")
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
testRecipeTemplate = """\
class TestRecipe%(num)d(PackageRecipe):
name = 'test%(num)d'
version = '%(version)s'
clearBuildReqs()
buildRequires = [ %(requires)s ]
%(header)s
%(flags)s
def setup(r):
%(flavor)s
r.Create('/usr/bin/test%(num)s',contents='''\
#!/bin/sh
echo "This is test%(num)s"
%(fileContents)s
''', mode=0755)
del r.NormalizeInterpreterPaths
if %(binary)s:
r.Run('''
cat > hello.c <<'EOF'
#include <stdio.h>
int main(void) {
return printf("Hello, world.\\\\n");
}
EOF
''')
r.Make('hello', preMake='LDFLAGS="-static"')
r.Install('hello', '%%(bindir)s/')
%(content)s
%(subpkgs)s
%(tagspec)s
%(fail)s
# override :config
r.ComponentSpec('runtime', '.*')
"""
def createRecipe(num, requires=[], fail=False, content='',
packageSpecs=[],
subPackages = [], version='1.0', localflags=[], flags=[],
header='', fileContents='', tag=None, binary=False):
reqList = []
for req in requires:
reqList.append("'test%d:runtime'" % req)
subs = {}
subs['requires'] = ', '.join(reqList)
subs['version'] = version
subs['num'] = num
subs['content'] = content
subs['fileContents'] = fileContents
subs['header'] = header
subs['binary'] = binary
subpkgStrs = []
flagStrs = []
flavorStrs = []
if localflags and not isinstance(localflags, (tuple, list)):
localflags = [localflags]
for flag in localflags:
flagStr = 'Flags.%s = True' % flag
flavorStr = 'if Flags.%s: pass' % flag
flagStrs.append(flagStr)
flavorStrs.append(flavorStr)
if tag:
subs['tagspec'] = "r.TagSpec('%s', '/usr/bin/test1')" % tag
else:
subs['tagspec'] = ''
if flags and not isinstance(flags, (tuple, list)):
flags = [flags]
for flag in flags:
flavorStr = 'if %s: pass' % flag
flavorStrs.append(flavorStr)
subs['flags'] = '\n '.join(flagStrs)
subs['flavor'] = '\n '.join(flavorStrs)
# add indentation
subpkgStrs.append('\n '.join(packageSpecs))
for subpkg in subPackages:
subpkgStr = '''
r.Create('%%(thisdocdir)s/README-%(subpkg)s')
r.Create('/asdf/runtime-%(subpkg)s')
r.PackageSpec('%(name)s-%(subpkg)s', 'README-%(subpkg)s')
r.PackageSpec('%(name)s-%(subpkg)s', 'runtime-%(subpkg)s')
''' % { 'name' : ('test%d' % num), 'subpkg' : subpkg }
subpkgStrs.append(subpkgStr)
subs['subpkgs'] = '\n'.join(subpkgStrs)
if fail:
subs['fail'] = 'r.Run("exit 1")'
else:
subs['fail'] = ''
return testRecipeTemplate % subs
fileTypeChangeRecipe1="""\
class FileTypeChange(PackageRecipe):
name = 'filetypechange'
version = '1'
clearBuildReqs()
def setup(r):
r.Create('%(essentialbindir)s/foo', mode=0755, contents = 'some text')
"""
fileTypeChangeRecipe2="""\
class FileTypeChange(PackageRecipe):
name = 'filetypechange'
version = '2'
clearBuildReqs()
def setup(r):
r.Run("mkdir %(destdir)s%(essentialbindir)s")
r.Run("ln -s foo %(destdir)s%(essentialbindir)s/foo")
"""
manyFlavors = """\
class ManyFlavors(PackageRecipe):
name = 'manyflavors'
version = '1.0'
clearBuildReqs()
def setup(r):
if Use.readline:
r.Create("/etc/readline", contents = "text 1")
if Use.ssl:
r.Create("/etc/ssl", contents = "text 1")
if not Use.ssl and not Use.readline:
r.Create("/etc/none", contents = "text 1")
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
manyFlavors2 = """\
class ManyFlavors(PackageRecipe):
name = 'manyflavors'
version = '2.0'
clearBuildReqs()
def setup(r):
if Use.readline:
r.Create("/etc/readline", contents = "text 1")
if Use.ssl:
r.Create("/etc/ssl", contents = "text 1")
if not Use.ssl and not Use.readline:
r.Create("/etc/none", contents = "text 1")
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
autoSource0 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '1.0'
clearBuildReqs()
def setup(r):
r.addSource('localfile')
"""
autoSource1 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '1.0'
clearBuildReqs()
def setup(r):
r.addSource('distcc-2.9.tar.bz2')
r.addSource('localfile')
"""
autoSource2 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '2.0'
clearBuildReqs()
def setup(r):
r.addSource('multilib-sample.tar.bz2')
r.addSource('localfile')
"""
autoSource3 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '3.0'
clearBuildReqs()
def setup(r):
r.addSource('multilib-sample.tar.bz2')
r.addSource('localfile')
r.Create('/foo')
"""
autoSource4 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '1.0'
clearBuildReqs()
def setup(r):
r.addSource('distcache-1.4.5.tar.bz2')
r.Create('/foo')
"""
autoSource5 = """\
class AutoSource(PackageRecipe):
name = 'autosource'
version = '1.0'
clearBuildReqs()
def setup(r):
r.addSource('distcache-1.4.5.tar.bz2', rpm='distcache-1.4.5-2.src.rpm')
r.Create('/bar')
"""
configFileGoesEmpty1 = """\
class Config(PackageRecipe):
name = 'config'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/config', contents='test 123')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
configFileGoesEmpty2 = """\
class Config(PackageRecipe):
name = 'config'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/config')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
testRemove1 = """\
class Remove(PackageRecipe):
name = 'remove'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/config')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
testRemove2 = """\
class Remove(PackageRecipe):
name = 'remove'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/blah')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
configFileBecomesSymlink1 = """\
class Config(PackageRecipe):
name = 'config'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/config', contents='test 123')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
configFileBecomesSymlink2 = """\
class Config(PackageRecipe):
name = 'config'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/foo', contents='test 234')
r.Symlink('foo', '/etc/config')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
symlinkBecomesFile1 = """\
class Test(PackageRecipe):
name = 'test'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/man/man1/bar.1', contents='test 234')
r.Symlink('bar.1', '/usr/share/man/man1/foo.1')
"""
symlinkBecomesFile2 = """\
class Test(PackageRecipe):
name = 'test'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/man/man1/foo.1', contents='test 123')
"""
branchedFileIdTest1 = """
class BranchedFileId(PackageRecipe):
name = 'branchedFileId'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/first', 'unchanged')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
branchedFileIdTest2 = """
class BranchedFileId(PackageRecipe):
name = 'branchedFileId'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/second', 'unchanged')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
pathIdTest1 = """
class PathIdTest(PackageRecipe):
name = 'PathIdTest'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create("/lib/1")
r.Create("/lib/first")
r.Create("/lib/non-utf8" + '\200')
r.NonUTF8Filenames(exceptions="/lib/non-utf8" + '\200')
"""
pathIdTest2 = """
class PathIdTest(PackageRecipe):
name = 'PathIdTest'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create("/lib/1")
r.Create("/lib/2")
"""
pathIdTest3 = """
class PathIdTest(PackageRecipe):
name = 'PathIdTest'
version = '3.0'
clearBuildReqs()
def setup(r):
r.Create("/lib/1")
r.Create("/lib/2")
r.Create("/lib/3")
"""
pathIdTest4 = """
class PathIdTest(PackageRecipe):
name = 'PathIdTest'
version = '4.0'
clearBuildReqs()
def setup(r):
r.Create("/lib/1")
r.Create("/lib/2")
r.Create("/lib/3")
r.Create("/lib/4")
"""
depsMultiVersionTest1 = """
class Foo(PackageRecipe):
name = 'foo'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('%(libdir)s/libfoo.so.1')
r.Provides('file', '%(libdir)s/libfoo.so.1')
"""
depsMultiVersionTest2 = """
class Foo(PackageRecipe):
name = 'foo'
version = '2.0'
clearBuildReqs()
def setup(r):
r.Create('%(libdir)s/libfoo.so.2')
r.Provides('file', '%(libdir)s/libfoo.so.2')
"""
depsMultiVersionUser1 = """
class Bar(PackageRecipe):
name = 'bar'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('%(bindir)s/bar', mode=0755)
r.Requires('%(libdir)s/libfoo.so.1' %r.macros, '%(bindir)s/bar')
"""
depsMultiVersionUser2 = """
class Baz(PackageRecipe):
name = 'baz'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('%(bindir)s/baz', mode=0755)
r.Requires('%(libdir)s/libfoo.so.2' %r.macros, '%(bindir)s/baz')
"""
testSuiteRecipe = """
class TestSuiteRecipe(PackageRecipe):
name = 'testcase'
version = '1'
clearBuildReqs()
def setup(r):
r.Run('mkdir test; echo -e \#\!/bin/notthere\\nhi > test/foo; chmod 755 test/foo')
r.TestSuite('test', autoBuildMakeDependencies=False)
r.Create('/etc/foo')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
dependencyGroup = """
class DependencyGroup(GroupRecipe):
name = 'group-test'
version = '1.0'
clearBuildRequires()
def setup(self):
self.Requires('other')
self.addTrove('test:runtime')
"""
initialContentsRecipe0 = """
class InitialContentsTest(PackageRecipe):
name = 'initcontents'
version = '0'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='initialtransientcontents')
r.Transient('/foo')
"""
initialContentsRecipe01 = """
class InitialContentsTest(PackageRecipe):
name = 'initcontents'
version = '0.1'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='initialregularcontents')
"""
initialContentsRecipe02 = """
class InitialContentsTest(PackageRecipe):
name = 'initcontents'
version = '0.1'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='initialconfigcontents')
r.Config('/foo')
r.ComponentSpec('runtime', '/foo')
"""
initialContentsRecipe1 = """
class InitialContentsTest(PackageRecipe):
name = 'initcontents'
version = '1'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='initialrecipecontents')
r.InitialContents('/foo')
"""
initialContentsRecipe2 = """
class InitialContentsTest(PackageRecipe):
name = 'initcontents'
version = '2'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='secondrecipecontents')
r.InitialContents('/foo')
"""
otherRecipe = """
class Other(PackageRecipe):
name = 'other'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/etc/other', contents='secondrecipecontents')
r.Requires('test:config', '/etc/other')
r.ComponentSpec('runtime', '%(sysconfdir)s/')
"""
testGroup1 = """
class TestGroup(GroupRecipe):
name = 'group-test'
version = '1.0'
clearBuildRequires()
def setup(self):
self.addTrove('test1', '1.0')
"""
testGroup2 = """
class TestGroup(GroupRecipe):
name = 'group-test'
version = '1.0'
clearBuildRequires()
def setup(self):
self.addTrove('test1', '1.1')
"""
testGroup3 = """
class TestGroup(GroupRecipe):
name = 'group-test'
version = '1.0'
clearBuildRequires()
checkPathConflicts = True
def setup(self):
self.startGroup('group-test2', checkPathConflicts=False, groupName='group-test')
self.addTrove('test1', '1.0')
self.startGroup('group-test3', groupName='group-test')
self.addTrove('test2', '1.0')
"""
userInfoRecipe = """
class UserMe(UserInfoRecipe):
name = 'info-%(user)s'
version = '1'
clearBuildReqs()
def setup(r):
r.User('%(user)s', %(uid)s)
"""
syncGroupRecipe1 = """
class SyncGroup(GroupRecipe):
name = 'group-sync'
version = '1'
imageGroup = False
clearBuildRequires()
def setup(r):
r.addTrove('synctrove', '1', byDefault=False)
"""
syncGroupRecipe2 = """
class SyncGroup(GroupRecipe):
name = 'group-sync'
version = '2'
imageGroup = False
clearBuildRequires()
def setup(r):
r.addTrove('synctrove', '2', byDefault=False)
"""
syncTroveRecipe1 = """
class SyncTrove(PackageRecipe):
name = 'synctrove'
version = '1'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/foo1')
r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo1')
"""
syncTroveRecipe2 = """
class SyncTrove(PackageRecipe):
name = 'synctrove'
version = '2'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/foo2')
r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo2')
"""
notByDefaultRecipe = """
class NotByDefault(PackageRecipe):
name = 'testcase'
version = '1.0'
clearBuildReqs()
def setup(r):
if Use.readline: pass
r.Create('/usr/share/foo2')
r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo2')
"""
sourceSuperClass1 = """
class SourceSuperClass(PackageRecipe):
name = 'superclass'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/foo2')
"""
sourceSuperClass2 = """
class SourceSuperClass(PackageRecipe):
name = 'superclass'
version = '1.0'
clearBuildReqs()
def setup(r):
r.Create('/usr/share/foo2')
r.addSource('newsource')
r.Install('newsource', '/usr/share/foo3')
"""
sourceSubClass1 = """
loadRecipe('superclass')
class sourceSubClass(SourceSuperClass):
name = 'subclass'
version = '1.0'
clearBuildReqs()
"""
simpleRecipe = """
class SimpleRecipe(PackageRecipe):
name = 'simple'
version = '1'
clearBuildReqs()
def setup(r):
r.Create('/foo', contents='simple')
"""
basicSplitGroup = """
class splitGroup(GroupRecipe):
name = 'group-first'
version = '1.0'
checkPathConflicts = False
clearBuildRequires()
def setup(self):
self.add("test", "@rpl:linux")
self.createGroup('group-second')
self.createGroup('group-third')
self.add("test", "@rpl:linux",
groupName = ['group-second', 'group-third'])
# add group-second to group-first
self.addNewGroup('group-second')
"""
buildReqTest1 = """\
class BuildReqTest(PackageRecipe):
name = 'foo'
version = '1.0'
clearBuildReqs()
buildRequires = ['blah']
def setup(r):
r.addSource('distcc-2.9.tar.bz2')
"""
unknownFlagRecipe = """\
class BuildReqTest(PackageRecipe):
name = 'foo'
version = '1.0'
clearBuildReqs()
if Use.ffff:
pass
def setup(r):
if Use.ffff:
r.Create('/foo', contents='simple')
else:
r.Create('/bar', contents='simple')
"""
simpleFactory = """\
class SimpleFactory(Factory):
name = "factory-simple"
version = "1.0"
def getRecipeClass(self):
class Subclass(PackageRecipe):
internalAbstractBaseClass = True
name = "subclass"
version = "1.0"
return Subclass
"""
simpleFactoryWithSources = """\
class SimpleFactory(Factory):
name = "factory-simple"
version = "1.0"
def getRecipeClass(self):
clearBuildRequires()
f = self.openSourceFile('VERSION')
readVersion = f.read()[:-1]
f.close()
class RealRecipe(PackageRecipe):
name = self.packageName
version = readVersion
def setup(r):
if False:
# make sure FactoryException is available
raise FactoryException
r.Create("/foo", contents = readVersion + "\\n")
return RealRecipe
"""
|
sassoftware/conary
|
conary_test/recipes.py
|
Python
|
apache-2.0
| 40,164
|
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
/*
* AvaTax API Client Library
*
* (c) 2004-2019 Avalara, Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Genevieve Conty
* @author Greg Hester
* Swagger name: AvaTaxClient
*/
namespace Avalara.AvaTax.RestClient
{
/// <summary>
/// Represents a language-specific localized name of a particular geographic entity such
/// as a country or a region.
/// </summary>
public class IsoLocalizedName
{
/// <summary>
/// The two-character alphanumeric code identifying the language in which this name is used.
///
/// Note that languageAlpha2Code and language3AlphaCode refer to the same language.
/// </summary>
public String languageAlpha2Code { get; set; }
/// <summary>
/// The three-character alphanumeric code identifying the language in which this name is used.
///
/// Note that languageAlpha2Code and language3AlphaCode refer to the same language.
/// </summary>
public String languageAlpha3Code { get; set; }
/// <summary>
/// The name of this geographic entity as known in this language.
/// </summary>
public String name { get; set; }
/// <summary>
/// Convert this object to a JSON string of itself
/// </summary>
/// <returns>A JSON string of this object</returns>
public override string ToString()
{
return JsonConvert.SerializeObject(this, new JsonSerializerSettings() { Formatting = Formatting.Indented });
}
}
}
|
avadev/AvaTax-REST-V2-DotNet-SDK
|
src/models/IsoLocalizedName.cs
|
C#
|
apache-2.0
| 1,753
|
# Aerides taeniale Lindl. SPECIES
#### Status
SYNONYM
#### According to
GRIN Taxonomy for Plants
#### Published in
Gen. & Sp. Orch. Pl. 239. 1833
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Phalaenopsis/Phalaenopsis taenialis/ Syn. Aerides taeniale/README.md
|
Markdown
|
apache-2.0
| 191
|
# Agropyron cristatum subsp. badamense SUBSPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Agropyron/Agropyron badamense/ Syn. Agropyron cristatum badamense/README.md
|
Markdown
|
apache-2.0
| 196
|
# Stoebe stenostachya Sch.Bip. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Stoebe/Stoebe stenostachya/README.md
|
Markdown
|
apache-2.0
| 178
|
# Asplenium scolopendrioides J.Sm. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Aspleniaceae/Asplenium/Asplenium scolopendrioides/README.md
|
Markdown
|
apache-2.0
| 182
|
# Aster prenanthoides var. longifolius Porter VARIETY
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Symphyotrichum/Symphyotrichum prenanthoides/Aster prenanthoides longifolius/README.md
|
Markdown
|
apache-2.0
| 193
|
# Freycinetia vulgaris Merr. & L.M.Perry SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Pandanales/Pandanaceae/Freycinetia/Freycinetia vulgaris/README.md
|
Markdown
|
apache-2.0
| 196
|
# Leucosyris spinosa (Benth.) Greene SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Pittonia 3:244. 1897
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Chloracantha/Chloracantha spinosa/ Syn. Leucosyris spinosa/README.md
|
Markdown
|
apache-2.0
| 207
|
# Phoma saxifragarum Westend., 1877 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Not. 6: 23 (1877)
#### Original name
Phoma saxifragarum Westend., 1877
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Phoma/Phoma saxifragarum/README.md
|
Markdown
|
apache-2.0
| 233
|
# Lindsaea tropidorachis Alderw. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Dennstaedtiaceae/Lindsaea/Lindsaea tropidorachis/README.md
|
Markdown
|
apache-2.0
| 180
|
# Dioscorea revillae Ayala SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Dioscoreales/Dioscoreaceae/Dioscorea/Dioscorea altissima/ Syn. Dioscorea revillae/README.md
|
Markdown
|
apache-2.0
| 181
|
# Coryphidium tadlum Cramer & Díez, 1976 SPECIES
#### Status
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Protozoa/Acritarcha/Coryphidium/Coryphidium tadlum/README.md
|
Markdown
|
apache-2.0
| 205
|
# Himantia candida var. albida (Pers.) Pers. VARIETY
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Syn. meth. fung. (Göttingen) 2: 704 (1801)
#### Original name
Himantia albida Pers.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Himantia/Himantia candida/Himantia candida albida/README.md
|
Markdown
|
apache-2.0
| 231
|
# Alloplectus pubescens (Griseb.) Fawc. SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Gesneriaceae/Columnea/Columnea pubescens/ Syn. Alloplectus pubescens/README.md
|
Markdown
|
apache-2.0
| 194
|
/***************************************************************************
* Copyright 2021 Kieker Project (http://kieker-monitoring.net)
*
* 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 kieker.analysis.plugin.reader.newio;
import java.nio.ByteBuffer;
/**
* Interface for raw data processors, i.e. classes which decode raw data to
* records and feed them into a processing pipeline.
*
* @author Holger Knoche
*
* @since 1.13
*/
public interface IRawDataProcessor {
/**
* Decodes the given raw data and delivers the decoded records.
*
* @param rawData
* The raw data to decode
*
* @since 1.13
*/
public void decodeAndDeliverRecords(byte[] rawData);
/**
* Decodes the given raw data and delivers the decoded records.
*
* @param rawData
* The raw data to decode
* @param dataSize
* The size of the contained data
*
* @since 1.13
*/
public void decodeAndDeliverRecords(final ByteBuffer rawData, final int dataSize);
}
|
kieker-monitoring/kieker
|
kieker-analysis/src/kieker/analysis/plugin/reader/newio/IRawDataProcessor.java
|
Java
|
apache-2.0
| 1,598
|
# Hibiscus rhodopetalus (F.Muell.) Benth. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
Abelmoschus rhodopetalus F.Muell.
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/Hibiscus/Hibiscus rhodopetalus/README.md
|
Markdown
|
apache-2.0
| 218
|
# Borago officinalis L. SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Sp. pl. 1:137. 1753
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Boraginales/Boraginaceae/Borago/Borago officinalis/README.md
|
Markdown
|
apache-2.0
| 194
|
# Copyright 2020 Tensorforce Team. 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.
# ==============================================================================
import tensorflow as tf
from tensorforce import TensorforceError
from tensorforce.core import TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util
from tensorforce.core.optimizers import UpdateModifier
from tensorforce.core.optimizers.solvers import solver_modules
class LinesearchStep(UpdateModifier):
"""
Line-search-step update modifier, which performs a line search on the update step returned by
the given optimizer to find a potentially superior smaller step size
(specification key: `linesearch_step`).
Args:
optimizer (specification): Optimizer configuration
(<span style="color:#C00000"><b>required</b></span>).
max_iterations (parameter, int >= 1): Maximum number of line search iterations
(<span style="color:#C00000"><b>required</b></span>).
backtracking_factor (parameter, 0.0 < float < 1.0): Line search backtracking factor
(<span style="color:#00C000"><b>default</b></span>: 0.75).
name (string): (<span style="color:#0000C0"><b>internal use</b></span>).
arguments_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
"""
def __init__(
self, *, optimizer, max_iterations, backtracking_factor=0.75, name=None, arguments_spec=None
):
super().__init__(optimizer=optimizer, name=name, arguments_spec=arguments_spec)
self.line_search = self.submodule(
name='line_search', module='line_search', modules=solver_modules,
max_iterations=max_iterations, backtracking_factor=backtracking_factor
)
def initialize_given_variables(self, *, variables):
super().initialize_given_variables(variables=variables)
self.line_search.complete_initialize(
arguments_spec=self.arguments_spec, values_spec=self.variables_spec
)
@tf_function(num_args=1)
def step(self, *, arguments, variables, fn_loss, **kwargs):
loss_before = fn_loss(**arguments.to_kwargs())
with tf.control_dependencies(control_inputs=(loss_before,)):
deltas = self.optimizer.step(
arguments=arguments, variables=variables, fn_loss=fn_loss, **kwargs
)
with tf.control_dependencies(control_inputs=deltas):
def linesearch():
loss_after = fn_loss(**arguments.to_kwargs())
with tf.control_dependencies(control_inputs=(loss_after,)):
# Replace "/" with "_" to ensure TensorDict is flat
_deltas = TensorDict((
(var.name[:-2].replace('/', '_'), delta)
for var, delta in zip(variables, deltas)
))
# TODO: should be moved to initialize_given_variables, but fn_loss...
def evaluate_step(arguments, deltas):
assignments = list()
for variable, delta in zip(variables, deltas.values()):
assignments.append(variable.assign_add(delta=delta, read_value=False))
with tf.control_dependencies(control_inputs=assignments):
return fn_loss(**arguments.to_kwargs())
_deltas = self.line_search.solve(
arguments=arguments, x_init=_deltas, base_value=loss_before,
zero_value=loss_after, fn_x=evaluate_step
)
return tuple(_deltas.values())
num_nonzero = list()
for delta in deltas:
num_nonzero.append(tf.math.count_nonzero(input=delta))
num_nonzero = tf.math.add_n(inputs=num_nonzero)
return tf.cond(pred=(num_nonzero == 0), true_fn=(lambda: deltas), false_fn=linesearch)
|
reinforceio/tensorforce
|
tensorforce/core/optimizers/linesearch_step.py
|
Python
|
apache-2.0
| 4,502
|
package SpritesAndBackground;
import Graphics.Texture;
import Main.Game;
import Main.Transform;
import Main.Input;
import Main.Mouse;
import Map.Decal;
import Map.Map;
import Patterns.SimpleCameraController;
import org.joml.Vector2f;
import org.lwjgl.glfw.GLFW;
import java.util.Random;
public class Main implements Runnable {
private Thread thread;
private Game game;
private static int WIDTH = 800, HEIGHT = 600,FPS = 60;
public static void setWIDTH(int WIDTH) {
Main.WIDTH = WIDTH;
}
public static void setHEIGHT(int HEIGHT) {
Main.HEIGHT = HEIGHT;
}
public static void setFPS(int FPS) {
Main.FPS = FPS;
}
public Main(){}
public Main(int WIDTH,int HEIGHT,int FPS){
this.WIDTH = WIDTH;
this.HEIGHT = HEIGHT;
this.FPS = FPS;
}
public void start() {
thread = new Thread(this, "Game");
thread.run();
}
private Random random = new Random();
private float scaleMul = 3;
public Map createMap(int shipCount, int planetCount) {
Map res = new Map();
try {
res.addActor(new SimpleCameraController(game));
float x, y, scale;
Texture[] planetTexs = {
game.textureBank.Get("planet1").getTexture(),
game.textureBank.Get("planet2").getTexture(),
game.textureBank.Get("planet3").getTexture(),
game.textureBank.Get("planet4").getTexture()
};
Texture shipTex = game.textureBank.Get("ship").getTexture();
int len = planetTexs.length;
for (int i = 0; i < planetCount; i++) {
x = scaleMul * (random.nextFloat() * WIDTH - .5f * WIDTH);
y = scaleMul * (random.nextFloat() * HEIGHT - .5f * HEIGHT);
scale = 30 + random.nextFloat() * 30;
Transform transform = new Transform().rotate((float) (2 * Math.PI * random.nextDouble()))
.translate(new Vector2f(x, y))
.setScale(new Vector2f(scale, scale));
transform.layer = (float) i / planetCount / 2;
res.addDecal(new Decal(transform, planetTexs[random.nextInt(len)]));
}
for (int i = 0; i < shipCount; i++) {
x = scaleMul * (random.nextFloat() * WIDTH - .5f * WIDTH);
y = scaleMul * (random.nextFloat() * HEIGHT - .5f * HEIGHT);
SquaredGuys a = new SquaredGuys(new Vector2f(x, y), game.mouse);
a.transform.rotate((float) (2 * Math.PI * random.nextDouble()));
a.texture = shipTex;
a.transform.layer = (float) i / shipCount / 2 + .5f;
res.addActor(a);
}
FunObject funObject = new FunObject(game.mouse);
funObject.texture = game.textureBank.Get("shape").getTexture();
res.addActor(funObject);
res.addBackground(new MyBack(game.textureBank.Get("space").getTexture()));
} catch (Exception e) {
e.printStackTrace();
throw new Error("something gone wrong");
}
return res;
}
@Override
public void run() {
game = new Game(WIDTH, HEIGHT);
game.init();
try {
game.textureBank.addFromDisk("ship", "Engine/test_resources/ship.png");
game.textureBank.addFromDisk("space", "Engine/test_resources/cassiopeia1280.jpeg");
game.textureBank.addFromDisk("planet1", "Engine/test_resources/planet1.png");
game.textureBank.addFromDisk("planet2", "Engine/test_resources/planet2.png");
game.textureBank.addFromDisk("planet3", "Engine/test_resources/planet3.png");
game.textureBank.addFromDisk("planet4", "Engine/test_resources/planet4.png");
game.textureBank.addFromDisk("shape", "Engine/test_resources/shape.png");
} catch (Exception e) {
e.printStackTrace();
return;
}
System.out.println(game.textureBank);
game.input.addKeyAction(new Input.KeyAction(GLFW.GLFW_KEY_Q, Input.KEY_PRESS,
() -> game.mouse.setMousePos(new Vector2f(0, 0))));
game.mouse.addMouseAction(new Mouse.MouseAction(Mouse.MOUSE_BUTTON_LEFT, Mouse.BUTTON_HOLD,
() -> SquaredGuys.mouseHold = true));
game.map = createMap(100, 300);
game.fps = this.FPS;
game.mainloop();
game.closeGame();
}
public static void main(String[] args) {
new Main().start();
}
}
|
dmromanov98/GameProject
|
Engine/test_programs/SpritesAndBackground/Main.java
|
Java
|
apache-2.0
| 4,619
|
import { Selection } from "d3-selection";
import { DynamicGraph } from "../model/DynamicGraph";
import { SVGAttrOpts } from "./DGLOsSVG";
export interface NodeGlyphShape {
readonly shapeType: string;
init(location: Selection<any, {}, any, {}>): Selection<any, {}, any, {}>;
initDraw(location: Selection<any, {}, any, {}>): Selection<any, {}, any, {}>;
updateDraw(location: Selection<any, {}, any, {}>, attrOpts: SVGAttrOpts): Selection<any, {}, any, {}>;
transformTo(source: Selection<any, {}, any, {}>, shape: NodeGlyphShape, target: Selection<any, {}, any, {}>): void;
draw(location: Selection<any, {}, any, {}>, data: DynamicGraph, timeStepIndex: number, attrOpts: SVGAttrOpts, duplicateNodes?: boolean, enterExit?: any): void;
}
|
chadstolper/DGLOs
|
src/ts/lib/NodeGlyphInterface.ts
|
TypeScript
|
apache-2.0
| 739
|
import React from "react";
import {waitForElementToBeRemoved, wait} from "@testing-library/react";
import render from "../../../helpers/testHelper";
import baseProps from "../../../stories/helpers/baseProps";
import Component from "./index";
import BridgeMapMock from "mocks/cards/BridgeMap.mock";
it.skip("should render", async () => {
let oldFetch = window.fetch;
window.fetch = arg => {
if (arg === "/assets/Simulator/default/bridge.svg") {
return new Promise(resolve =>
resolve({
text: () =>
Promise.resolve(`<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 550 474" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<g id="Command" transform="matrix(1.09484,0,0,1.28987,-1.3153,-65.8501)">
<rect x="221.17" y="386.877" width="58.2" height="27.4" style="fill:rgb(13,13,13);" data-name="Command" data-description= "The captain's terminal." data-client="Magellan-Command.local"/>
</g>
<g id="First-Officer" serif:id="First Officer" transform="matrix(1.0145,0,0,1.28987,-163.734,116.226)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="First Officer" data-description="Second in command, also in charge of the Magellan's navigational systems." data-client="Magellan-First-Officer.local"/>
</g>
<g id="CAG" transform="matrix(0.998018,0,0,1.28987,-228.361,116.226)">
<path d="M418.125,159.034L349.081,159.034L328.703,198.599L418.125,198.599L418.125,159.034Z" style="fill:rgb(13,13,13);" data-name="CAG" data-description="In charge of all docking systems" data-client="Magellan-Helm.local"/>
</g>
<g id="Surveillance-" serif:id="Surveillance " transform="matrix(-1.0145,1.43204e-16,1.43204e-16,1.28987,708.095,116.226)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="Surveillance" data-description="Also known as Sensors, they are in charge of the sensors array, which allows them to view the outside of the ship" data-client="Magellan-Sensors.local"/>
</g>
<g id="Counterintellligence" transform="matrix(-0.993897,1.40295e-16,1.43204e-16,1.28987,771.367,116.226)">
<path d="M418.125,159.034L349.081,159.034L328.703,198.599L418.125,198.599L418.125,159.034Z" style="fill:rgb(13,13,13);" data-name="Counterintelligence" data-description="In charge of probes, and gathering any kind of intelligence and/or scientific information" data-client="Magellan-Science.local"/>
</g>
<g id="Engineer" transform="matrix(0.779947,0,0,1.25166,-61.4422,24.463)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="Engineer" data-description="The main station of the Engineer, this allows them to control the main reactor and coolant" data-client="Magellan-Engineer.local"/>
</g>
<g id="Power-Distribution" serif:id="Power Distribution" transform="matrix(0.556,0,0,1.2356,-23.1366,27.5902)">
<path d="M418.125,158.57L349.081,158.57L310.804,198.599L418.125,198.599L418.125,158.57Z" style="fill:rgb(13,13,13);" data-name="Power Distribution" data-description="Secondary screen of the Engineer, this controls the flow of power to and from specific systems" data-client="Magellan-Power-Distribution.local"/>
</g>
<g id="Strategic-Operations" serif:id="Strategic Operations" transform="matrix(0.705274,0.705274,-0.912075,0.912075,20.4633,-215.758)">
<path d="M417.58,158.726L348.003,159.034L348.003,198.599L437.47,197.64L417.58,158.726Z" style="fill:rgb(13,13,13);" data-name="Strategic Operations" data-description="Allows the Strategic Operations officer to upgrade and maintain specific offensive and defensive systems" data-client="Magellan-Tactical.local"/>
</g>
<g id="Weapons-Control" serif:id="Weapons Control" transform="matrix(0.71314,0.71314,-0.912075,0.912075,-33.5295,-269.77)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="Weapons Control" data-description="Controls the main weapon systems on the Magellan" data-client="Magellan-Strategic-Ops.local" />
</g>
<g id="Division-Communications" serif:id="Division Communications" transform="matrix(-0.779947,7.16021e-17,4.19385e-16,1.25166,609.505,24.463)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="Division Communications" data-description="Controls the long range messaging system, and the signal jammer" data-client="Magellan-Division-Comm.local"/>
</g>
<g id="Remote-Communications" serif:id="Remote Communications" transform="matrix(-0.556,1.07403e-16,2.86408e-16,1.28987,571.265,17.1168)">
<path d="M418.125,159.971L349.081,159.971L310.804,198.315L418.125,198.363L418.125,159.971Z" style="fill:rgb(13,13,13);" data-name="Remote Communications" data-description="Allows ship to ship communication, and internal communication between decks" data-client="Magellan-Remote-Comm.local"/>
</g>
<g id="Computer-Core" serif:id="Computer Core" transform="matrix(-0.694772,0.694772,0.912075,0.912075,523.618,-211.529)">
<path d="M417.868,158.836L349.081,159.034L349.081,198.599L437.51,198.011L417.868,158.836Z" style="fill:rgb(13,13,13);" data-name="Computer Core" data-description="controls and maintains the main computer systems on the Magellan" data-client="Magellan-Computer-Core.local"/>
</g>
<g id="Chief-of-Operations" serif:id="Chief of Operations" transform="matrix(-0.761417,0.761417,0.912075,0.912075,600.382,-288.293)">
<rect x="349.081" y="159.034" width="69.044" height="39.565" style="fill:rgb(13,13,13);" data-name="Chief of Operations" data-description="Controls all general operations on board the Magellan, including, but not limited too; Cargo, Transwarp, and Transporters." data-client="Magellan-Chief-of-Ops.local"/>
</g>
<g id="Security-Scans" serif:id="Security Scans" transform="matrix(0.661241,0.661241,-0.912075,0.912075,96.5994,-292.631)">
<path d="M417.523,159.916L349.081,159.034L349.081,198.599L441.092,198.948L417.523,159.916Z" style="fill:rgb(13,13,13);" data-name="Security Scans" data-description="Used to scan different decks on the Magellan internally for any problems/security risks, along with the ability to close and evacuate decks" data-client="Magellan-Security-Scans.local"/>
</g>
<g id="Security-Chief" serif:id="Security Chief" transform="matrix(0.645994,0,0,1.28987,-2.76297,-75.8252)">
<path d="M414.108,159.161L357.003,159.034L326.02,198.717L414.108,198.717L414.108,159.161Z" style="fill:rgb(13,13,13);" data-name="Security Chief" data-description="Allows for creation and distribution of security teams throughout the Magellan" data-client="Magellan-Security-Teams.local"/>
</g>
<g id="Damage-Status" serif:id="Damage Status" transform="matrix(0.912075,-0.912075,0.912075,0.912075,-176.105,261.207)">
<rect x="386.393" y="200.648" width="48.25" height="38.5" style="fill:rgb(13,13,13);" data-name="Damage Status" data-description="Monitors all damage throughout the Magellan, and loads possible repair reports if a system is damaged, so an officer can repair it" data-client="Magellan-Damage-Status.local"/>
</g>
<g id="Damage-Teams" serif:id="Damage Teams" transform="matrix(0.92985,-0.92985,0.912075,0.912075,-228.887,313.988)">
<path d="M434.643,200.648L396.143,200.648L378.143,239.148L434.643,239.148L434.643,200.648Z" style="fill:rgb(13,13,13);" data-name="Damage Teams" data-description="Allows for creation and distribution of damage teams throughout the Magellan" data-client="Magellan-Damage-Teams.local"/>
</g>
<g id="Viewscreen" transform="matrix(1.27979,0,0,1.28987,-59.6106,-70.3431)">
<rect x="218.583" y="58.789" width="85.75" height="5.25" style="fill:rgb(13,13,13);" data-name="Main View Screen" data-description="The Main View Screen is the main display in most starships, which is used to display important details, or visuals outside or inside of the ship." data-client="Magellan-MVS"/>
</g>
<g id="Hall-Terminal" serif:id="Hall Terminal" transform="matrix(0.644934,0,0,0.907685,1.09936,-44.3002)">
<rect x="51.443" y="73.739" width="22.392" height="36" style="fill:rgb(13,13,13);" data-name="Hall Terminal" data-description="An additional terminal used by the Engineer to help prevent damage to ship systems, and allows the Engineer to perform general maintainence on most systems." data-client="Magellan-Hall-Terminal.local"/>
</g>
</svg>`),
}),
);
}
throw new Error("Network request failed");
};
const {container, getByText} = render(<Component {...baseProps} />, {
mocks: BridgeMapMock,
});
await waitForElementToBeRemoved(() => getByText("Loading..."));
await wait();
// eslint-disable-next-line require-atomic-updates
window.fetch = oldFetch;
expect(container.innerHTML).toBeTruthy();
expect(container.innerHTML).not.toBe("Error");
});
|
Thorium-Sim/thorium
|
src/components/views/BridgeMap/BridgeMap.test.js
|
JavaScript
|
apache-2.0
| 9,710
|
/*
* Copyright 2008 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* 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.kuali.kfs.module.ar.document.validation.event;
import org.kuali.kfs.module.ar.businessobject.CashControlDetail;
import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
/**
* Defines methods for all events related to cash control details
*/
public interface CashControlDetailEvent extends KualiDocumentEvent {
/**
* This method returns the customer invoice related to the event
* @return CustomerInvoiceDetail
*/
public CashControlDetail getCashControlDetail();
}
|
Ariah-Group/Finance
|
af_webapp/src/main/java/org/kuali/kfs/module/ar/document/validation/event/CashControlDetailEvent.java
|
Java
|
apache-2.0
| 1,130
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252"/>
<title></title>
<meta name="generator" content="LibreOffice 4.3.2.2 (Windows)"/>
<meta name="author" content="Chaitrali Bubane"/>
<meta name="created" content="2015-02-15T15:57:00"/>
<meta name="changed" content="2015-02-24T10:09:07.480000000"/>
<meta name="AppVersion" content="15.0000"/>
<meta name="DocSecurity" content="0"/>
<meta name="HyperlinksChanged" content="false"/>
<meta name="LinksUpToDate" content="false"/>
<meta name="ScaleCrop" content="false"/>
<meta name="ShareDoc" content="false"/>
<style type="text/css">
@page { margin: 2.54cm }
p { margin-bottom: 0.25cm; direction: ltr; line-height: 120%; text-align: left; widows: 2; orphans: 2 }
</style>
</head>
<body lang="en-GB" dir="ltr">
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>package</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
Vector;</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>import</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
java.util.Vector;</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>import</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
java.util.Collections;</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>public</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
</font></font></font><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>class</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
Sort_Elements_Of_Vector_Example {</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>public</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
</font></font></font><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>static</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
</font></font></font><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>void</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
main(String[] </font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">args</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">)
{</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">Vector
</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
= </font></font></font><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>new</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
Vector();</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.add(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"1"</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.add(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"3"</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.add(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"5"</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.add(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"2"</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.add(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"4"</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">System.</font></font></font><font color="#0000c0"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><i><b>out</b></i></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.println(</font></font></font><font color="#2a00ff"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">"Vector
elements after sorting in ascending order : "</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">);</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>for</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">(</font></font></font><font color="#7f0055"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><b>int</b></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">
</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">i</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">=0;
</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">i</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.size();
</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">i</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">++)</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">System.</font></font></font><font color="#0000c0"><font face="Consolas, serif"><font size="2" style="font-size: 10pt"><i><b>out</b></i></font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.println(</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">v</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">.get(</font></font></font><font color="#6a3e3e"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">i</font></font></font><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">));</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">}</font></font></font></p>
<p style="margin-bottom: 0.28cm; line-height: 107%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">}</font></font></font></p>
<p style="margin-bottom: 0.28cm; line-height: 107%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">Output:-</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">Vector
elements after sorting in ascending order : </font></font></font>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">1</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">3</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">5</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">2</font></font></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><a name="_GoBack"></a>
<font color="#000000"><font face="Consolas, serif"><font size="2" style="font-size: 10pt">4</font></font></font></p>
<p style="margin-bottom: 0.28cm; line-height: 107%"><br/>
<br/>
</p>
</body>
</html>
|
akashawaskar/JAVA-Programs
|
assets/Vector/10.html
|
HTML
|
apache-2.0
| 11,459
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.glaf.core.mapper;
import java.util.*;
import org.springframework.stereotype.Component;
import com.glaf.core.base.TableModel;
import com.glaf.core.domain.SysExtension;
@Component
public interface TableDataMapper {
void deleteTableData(TableModel model);
int getTableCountByConditions(TableModel query);
List<Map<String, Object>> getTableDataByConditions(TableModel query);
List<SysExtension> getExtensionDataByConditions(TableModel query);
Map<String, Object> getTableDataByPrimaryKey(TableModel query);
List<Map<String, Object>> getTableKeyMap(TableModel query);
List<Map<String, Object>> getTablePrimaryKeyMap(TableModel query);
void insertTableData(TableModel model);
void updateTableDataByPrimaryKey(TableModel model);
}
|
jior/glaf
|
workspace/glaf-core/src/main/java/com/glaf/core/mapper/TableDataMapper.java
|
Java
|
apache-2.0
| 1,565
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.rip.tester.aspect;
import java.util.Arrays;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
/**
*
* @author Hasitha Lakmal
*/
@Component
@Aspect
public class LogingAspect {
/**
* Following is the definition for a pointcut to select all the methods
* available. So advice will be called for all the methods.
*/
@Pointcut("execution(* test(..))")
private void AccessLogingpc() {
}
/**
* This is the method which I would like to execute before a selected method
* execution.
* @param joinPoint
*/
@Before("AccessLogingpc()")
public void beforeAdvice_AccessLogingpc(JoinPoint joinPoint) {
System.out.println("**************Start Method***************");
System.out.println(joinPoint.getSignature());
System.out.println(Arrays.toString(joinPoint.getArgs()));
}
/**
* This is the method which I would like to execute after a selected method
* execution.
* @param joinPoint
*/
@After("AccessLogingpc()")
public void afterAdvice_AccessLogingpc(JoinPoint joinPoint) {
System.out.println(joinPoint.getSignature());
System.out.println("**************End Method***************");
}
}
|
hasithalakmal/RIP
|
RIP_Test/src/main/java/com/rip/tester/aspect/LogingAspect.java
|
Java
|
apache-2.0
| 1,638
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.22/esri/copyright.txt for details.
//>>built
define("esri/tasks/RouteParameters","dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang ../graphicsUtils ./NATypes".split(" "),function(c,f,d,g,h,k,e,l){c=c(null,{declaredClass:"esri.tasks.RouteParameters",accumulateAttributes:null,attributeParameterValues:null,barriers:null,directionsLanguage:null,directionsLengthUnits:null,directionsOutputType:null,directionsStyleName:null,directionsTimeAttribute:null,doNotLocateOnRestrictedElements:!0,findBestSequence:null,ignoreInvalidLocations:null,
impedanceAttribute:null,outputLines:"esriNAOutputLineTrueShape",outputGeometryPrecision:null,outputGeometryPrecisionUnits:null,outSpatialReference:null,overrides:null,polygonBarriers:null,polylineBarriers:null,preserveFirstStop:null,preserveLastStop:null,restrictionAttributes:null,restrictUTurns:null,returnBarriers:!1,returnDirections:!1,returnPolygonBarriers:!1,returnPolylineBarriers:!1,returnRoutes:!0,returnStops:!1,returnZ:!0,startTime:null,startTimeIsUTC:null,timeWindowsAreUTC:null,stops:null,
useHierarchy:null,useTimeWindows:null,travelMode:null,toJson:function(c){var a={returnDirections:this.returnDirections,returnRoutes:this.returnRoutes,returnZ:this.returnZ,returnStops:this.returnStops,returnBarriers:this.returnBarriers,returnPolygonBarriers:this.returnPolygonBarriers,returnPolylineBarriers:this.returnPolylineBarriers,attributeParameterValues:this.attributeParameterValues&&d.toJson(this.attributeParameterValues),outSR:this.outSpatialReference?this.outSpatialReference.wkid||d.toJson(this.outSpatialReference.toJson()):
null,outputLines:this.outputLines,overrides:this.overrides,findBestSequence:this.findBestSequence,preserveFirstStop:this.preserveFirstStop,preserveLastStop:this.preserveLastStop,useTimeWindows:this.useTimeWindows,startTime:this.startTime?this.startTime.getTime():null,startTimeIsUTC:this.startTimeIsUTC,timeWindowsAreUTC:this.timeWindowsAreUTC,accumulateAttributeNames:this.accumulateAttributes?this.accumulateAttributes.join(","):null,ignoreInvalidLocations:this.ignoreInvalidLocations,impedanceAttributeName:this.impedanceAttribute,
restrictionAttributeNames:this.restrictionAttributes?this.restrictionAttributes.join(","):null,restrictUTurns:this.restrictUTurns,useHierarchy:this.useHierarchy,directionsLanguage:this.directionsLanguage,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:this.outputGeometryPrecisionUnits,directionsLengthUnits:l.LengthUnit[this.directionsLengthUnits],directionsTimeAttributeName:this.directionsTimeAttribute,directionsStyleName:this.directionsStyleName,travelMode:"object"===
typeof this.travelMode?d.toJson(this.travelMode):this.travelMode},b=this.stops;"esri.tasks.FeatureSet"===b.declaredClass&&0<b.features.length?a.stops=d.toJson({type:"features",features:e._encodeGraphics(b.features,c&&c["stops.features"]),doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}):"esri.tasks.DataLayer"===b.declaredClass?a.stops=b:"esri.tasks.DataFile"===b.declaredClass&&(a.stops=d.toJson({type:"features",url:b.url,doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}));
if(this.directionsOutputType)switch(this.directionsOutputType.toLowerCase()){case "complete":a.directionsOutputType="esriDOTComplete";break;case "complete-no-events":a.directionsOutputType="esriDOTCompleteNoEvents";break;case "instructions-only":a.directionsOutputType="esriDOTInstructionsOnly";break;case "standard":a.directionsOutputType="esriDOTStandard";break;case "summary-only":a.directionsOutputType="esriDOTSummaryOnly";break;default:a.directionsOutputType=this.directionsOutputType}b=function(a,
b){return a?"esri.tasks.FeatureSet"===a.declaredClass?0<a.features.length?d.toJson({type:"features",features:e._encodeGraphics(a.features,c&&c[b])}):null:"esri.tasks.DataLayer"===a.declaredClass?a:"esri.tasks.DataFile"===a.declaredClass?d.toJson({type:"features",url:a.url}):d.toJson(a):null};this.barriers&&(a.barriers=b(this.barriers,"barriers.features"));this.polygonBarriers&&(a.polygonBarriers=b(this.polygonBarriers,"polygonBarriers.features"));this.polylineBarriers&&(a.polylineBarriers=b(this.polylineBarriers,
"polylineBarriers.features"));return k.filter(a,function(a){if(null!==a)return!0})}});g("extend-esri")&&f.setObject("tasks.RouteParameters",c,h);return c});
|
wanglongbiao/webapp-tools
|
Highlander/ship-gis/src/main/webapp/js/arcgis_js_api/library/3.22/esri/tasks/RouteParameters.js
|
JavaScript
|
apache-2.0
| 4,459
|
HtmlHead
========
Add its parameters to the HTML document head
Example
-------
```
\{\{htmlhead:
<meta name="description" content="Example of HtmlHead macro" />
\}\}
```
To see the result, view the source of this page in your browser
|
Jumpscale/jumpscale_portal8
|
docs/Macros/HtmlElements/HtmlHead.md
|
Markdown
|
apache-2.0
| 238
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Function Reference: module_js()</title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Thu Oct 23 18:57:41 2014 -->
<!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='../';
subdir='_functions';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logFunction('module_js');
// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!--
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Function and Method Cross Reference</h3>
<h2><a href="index.html#module_js">module_js()</a></h2>
<b>Defined at:</b><ul>
<li><a href="../bonfire/libraries/assets.php.html#module_js">/bonfire/libraries/assets.php</a> -> <a onClick="logFunction('module_js', '/bonfire/libraries/assets.php.source.html#l853')" href="../bonfire/libraries/assets.php.source.html#l853"> line 853</a></li>
</ul>
<b>Referenced 2 times:</b><ul>
<li><a href="../bonfire/libraries/assets.php.html">/bonfire/libraries/assets.php</a> -> <a href="../bonfire/libraries/assets.php.source.html#l690"> line 690</a></li>
<li><a href="../bonfire/docs/working_with_assets.md.html">/bonfire/docs/working_with_assets.md</a> -> <a href="../bonfire/docs/working_with_assets.md.source.html#l222"> line 222</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Thu Oct 23 18:57:41 2014</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
|
inputx/code-ref-doc
|
bonfire/_functions/module_js.html
|
HTML
|
apache-2.0
| 5,019
|
---
layout: post
title: "Schottland unter den Stollen"
subtitle: "Kaum von der Fähre, schon auf dem Bike"
date: 2015-06-07
author: "Roland"
header-img: "img/2015060701-bg.jpg"
---
Die ganze Nacht verbringe ich mehr oder wenig im Halbschlaf. Das Rumpeln vom Motor dröhnt bis zu unserer Kabine herauf.
Ich beneide Stefan um seinen tiefen Schlaf und die Fähigkeit scheinbar überall innerhalb weniger Minuten einzuschlafen.
Wirklich geweckt werden wir durch eine ziemlich laute Lautsprecherdurchsage, dass wir jetzt Englische Ortszeit haben und
das Frühstück serviert ist. Wir bleiben noch was liegen, aber die Lautsprecherdurchsagen gehen erbarmungslos weiter, so
dass an Schlaf nicht mehr zu denken ist. Also machen wir uns fertig, packen unsere Sachen und verlassen unsere Kabine.
Jetzt können wir auch die Durchsagen verstehen, die sagten, dass man sich bitte nicht im Eingangsbereich von Deck 7
aufhalten soll - überall sitzen, stehen oder liegen Menschen herum. Wir gesellen uns nicht dazu, sondern gehen aufs
Deck, wo uns direkt eine ziemlich steife Brise entgegen weht. Das Wetter ist dennoch fantastisch. Unsere Fähre wird nach
wie vor (oder wieder?) von zahlreichen Möwen verfolgt. Da wir nichts besseres zu tun haben, bleiben wir oben und
beobachten das Einlaufen in den Hafen von Newcastle. Dabei lassen wir uns von zahlreichen Durchsagen berieseln, in denen Werbung
für eine Stadtrundfahrt durch Newcastle vorgetragen wird. Nachdem wir angelegt haben, holen wir dann doch unsere Taschen.
Und da wir meinen das Schiff besser zu kennen, als das Personal, gehen wir natürlich auf der falschen Seite herunter, wo
das Auto nicht steht. Wir finden den Focus trotzdem recht schnell, verladen unsere Sachen und warten darauf, dass es los
geht.
Für eine erneute Grenzkontrolle werden alle Fahrzeuge, inklusive Fahrräder und Tandems, aufgereiht und schließlich sind
wir aus dem Hafengebiet raus. Direkt angeschlossen befindet sich eine Tourist Information, an der wir anhalten, um
Informationen über Standorte der Jugenherbergen und Mountainbikegebiete zu sammeln. Da wir noch in England sind haben
wir leider kein Glück, aber der freundliche junge Mann hinter der Ladentheke versichert uns, dass wir die Informationen
bekommen, sobald wir in Schottland sind. Gut, dass wir uns im Vorfeld schon ein wenig informiert haben, so wissen wir
von den 7 Stanes und steuern das nächstgelegene in Newcastleton an. Trotz Stefans Links-Rechts-Schwäche funktioniert der
Linksverkehr hervorragend. Wir gelangen durch einen kleinen Ort mit drei Banken, bei denen wir Geld abholen und da wir
noch nicht gefrühstückt haben, kehren wir direkt in der Post-Box ein. Stefan frönt der Food-Fotografie und wir lassen
es uns schmecken.
Danach geht es weiter und wir nehmen wieder Kurs auf Newcastleton. Stefan freut sich über die Ralley-Artigen Straßen und
die jetzt schon schöne Landschaft, als wir schließlich an die Schottische Grenze kommen. Hier ist allerdings der Bär
los. Zahlreiche Busse, Motoräder und Autos stehen herum. Wir machen nur ein paar Fotos von der Landschaft, verzichten
aber darauf den Grenzstein oder den Border-Piper mitzunehmen. Natürlich im übertragenen Sinne. Kurze Zeit später
erreichen wir auch schon Newcastleton, einen kleinen Ort mitten im Nirgendwo, der nur aus einer langgezogenen Straße zu
bestehen scheint. In der Mitte gibt es einen größeren Platz, um den sich scheinbar das ganze Leben in dem Dörfchen
abspielt. Dort finden wir auch die Hinweise zu der Bike-Runde. Also ziehen wir uns um, nehmen die Bikes vom
Fahrradträger und fahren los.
Direkt macht sich Freude breit - kaum sind wir von der Fähre runter, schon sitzen wir auf dem Bike. Wir fahren über eine
Brücke, einen Berg hoch und gelangen über extra angelegte Singletracks, eine eigene Brücke und einem Aufstieg auf den Berg.
Alles ist sehr ordentlich und liebevoll angelegt. So etwas würden wir bei uns schon als Abfahrt feiern, aber das sind hier
schon die Aufstiege! Wir erreichen einen schönen Aussichtspunkt, an dem wir eine kleine Pause einlegen und das Panorama
bestaunen. Hier liegt auch die erste Abfahrt, bei der es über einen schmalen Pfad immer wieder hoch und runter geht.
Meistens kann man rollen lassen, allerdings nicht immer, so dass auch dieser Trail recht anstrengend ist. Trotzdem sehr
schöne Abschnitte mit kleinen Sprüngen und technischen Einlagen drin. Später kommen wir auch an dem Grenzstein vorbei,
der im Prospekt und der Seite schon abgebildet war. Etwas später gelangen wir an ein Waldstück, das so dicht bewachsen,
dunkel und grün von Moos und Farn ist, dass wir glauben es könnte jederzeit ein Fabelwesen aus dem Busch springen.
Echt Erstaunlich. Nach einer Abfahrt kommen wir schließlich wieder zum Aussichtspunkt, an dem wir vorher schon Pause
gemacht haben. Wir nehmen noch eine ganz nette Extra-Schleife unterhalb davon mit und kommen wieder zur selben Stelle,
an der ein älterer Mann an uns vorbei fährt. Wir schließen zu ihm auf und quatschen ein wenig mit ihm. Dabei erfahren wir,
dass er 73, aus der Nähe von Manchester und scheinbar noch ziemlich fit ist. Hut ab! Wir fahren die Tour zu Ende, auf
der uns noch eine schöne Serpentinenabfahrt mit Anliegern erwartet. Insgesamt erinnerte uns die Tour ein wenig an Brilon,
allerdings mit weniger Schotter, noch schönerer Landschaft und mehr Single-Trail-Anteil.
Wieder am Auto angekommen überlegen wir, wo wir übernachten können und fahren einfach mal Richtung Ae Forest, der auch
Teil von den 7-Stanes ist. In Gretna nehmen wir die falsche Abbiegung im Kreisverkehr und gelangen rein zufällig zu einer
Tourist Information an der wir alles bekommen was das Herz begehrt: Karten und Adressen von Jugenderherbergen,
Campingplätzen, Detailkarten zu den 7-Stanes und eine Ersatz-Rubina (Highland-Cattle-Stofftier). Daraufhin witzeln wir,
dass wir uns öfter verfahren sollten.
Wir ändern nach kurzer Orientierung auf Mabie, wo es ein Youth Hostel gibt. Das Navi versucht uns in einen komplett
zugewachsenen Feldweg zu lotsen, was uns dermaßen verunsichert, dass wir beim drehen auf der falschen Straßenseite
landen. Ein entgegenkommendes Auto erinnert uns da schnell dran und nach einer kurzen Schrecksekunde ist alles wieder
gut. Wir kommen am Parkplatz der 7-Stanes und an einem schön gelegenen Hotel an. Das Mabie Youth-Hostel zu finden gestaltet
sich allerdings als nicht ganz einfach, aber ein Einheimischer weist uns den Weg und wir fahren oberhalb vom Hotel über
eine Schotterstraße dorthin. Beim Youth Hostel angekommen suchen wir erst einmal den Empfang, finden aber niemanden.
Eine redewütiger und freundlicher Schotte namens Steve MacCormack begrüßt uns und als er erfährt, dass wir Deutsche sind
donnert er ein "Mein Deutsch ist scheiße!" los und schleift uns zum Herbergsvater. Weil aber an dem Hostel gerade ein
Recovery-Camp stattfindet (was auch immer das ist), gibt es leider keine freien Plätze mehr. Also fahren wir wieder und
suchen das Hotel auf, wo aber leider ebenfalls nichts für uns frei ist. Die sehr freundliche Dame entschuldigt sich 1.000
Mal und gibt uns den Tipp es im nächsten Ort zu versuchen. Also überlegen wir ein anderes Hostel anzufahren, was in der
Nähe liegen soll. Als wir dann durch New Abbey kommen lacht uns allerdings ein B&B dermaßen an, dass wir dort einkehren.
Inzwischen ist es ohnehin spät geworden und langsam meldet sich auch der Hunger. Wir bekommen also den Schlüssel, das
WLAN-Kennwort, laden die nötigsten Sachen für den nächsten Tag aus, duschen und essen zu Abend. Immer wieder sprechen
wir mit ein paar Einheimischen, die in der Bar sind und lassen uns weitere Tipps für unseren Aufenthalt geben. Nach dem
Essen drehen wir noch eine kleine Runde durchs Dorf und schauen uns die Ruine eines alten Klosters an, dem das Dorf wohl
seinen Namen verdankt. Ich halte noch unseren ersten Tag in Textform fest bevor ich mich schließlich ins Bette begebe.
|
jerosch/jerosch.github.io
|
_posts/2015-06-07-scotland_under_the_studs.markdown
|
Markdown
|
apache-2.0
| 7,973
|
/**
* myCarousel
*/
angular.module(PKG.name+'.directives').directive('myCarousel',
function myCarouselDirective ($interval) {
return {
restrict: 'AC',
link: function (scope, element, attrs) {
element.addClass('my-carousel');
var currentSlide = 1,
allSlides = element.find('section'),
slideCount = allSlides.length;
function boundaries() {
if(currentSlide > slideCount) {
currentSlide = 1;
}
else if(currentSlide <= 0) {
currentSlide = slideCount;
}
}
var tick = $interval(function() {
console.log('carousel tick');
scope.nextSlide();
}, 5000);
function cancelInterval() {
$interval.cancel(tick);
}
scope.$on('$destroy', cancelInterval);
function setAnimationClass (d) {
var am = 'am-slide-';
allSlides
.removeClass(am+'right '+am+'left')
.addClass(am+d);
}
scope.slideIsVisible = function(n) {
return n == currentSlide;
}
scope.nextSlide = function (event) {
if(event) {
cancelInterval();
}
setAnimationClass('right');
boundaries(currentSlide++);
}
scope.prevSlide = function (event) {
if(event) {
cancelInterval();
}
setAnimationClass('left');
boundaries(currentSlide--);
}
}
};
});
|
gaarf/ng-wpwebz
|
app/js/directives/carousel/carousel.js
|
JavaScript
|
apache-2.0
| 1,441
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_91) on Mon Jun 06 14:51:16 EDT 2016 -->
<title>EncodingStats.Serializer (apache-cassandra API)</title>
<meta name="date" content="2016-06-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EncodingStats.Serializer (apache-cassandra API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EncodingStats.Serializer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Collector.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/db/rows/LazilyInitializedUnfilteredRowIterator.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/rows/EncodingStats.Serializer.html" target="_top">Frames</a></li>
<li><a href="EncodingStats.Serializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.db.rows</div>
<h2 title="Class EncodingStats.Serializer" class="title">Class EncodingStats.Serializer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.db.rows.EncodingStats.Serializer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="typeNameLabel">EncodingStats.Serializer</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Serializer.html#Serializer--">Serializer</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Serializer.html#deserialize-org.apache.cassandra.io.util.DataInputPlus-">deserialize</a></span>(<a href="../../../../../org/apache/cassandra/io/util/DataInputPlus.html" title="interface in org.apache.cassandra.io.util">DataInputPlus</a> in)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Serializer.html#serialize-org.apache.cassandra.db.rows.EncodingStats-org.apache.cassandra.io.util.DataOutputPlus-">serialize</a></span>(<a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a> stats,
<a href="../../../../../org/apache/cassandra/io/util/DataOutputPlus.html" title="interface in org.apache.cassandra.io.util">DataOutputPlus</a> out)</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Serializer.html#serializedSize-org.apache.cassandra.db.rows.EncodingStats-">serializedSize</a></span>(<a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a> stats)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Serializer--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Serializer</h4>
<pre>public Serializer()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="serialize-org.apache.cassandra.db.rows.EncodingStats-org.apache.cassandra.io.util.DataOutputPlus-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serialize</h4>
<pre>public void serialize(<a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a> stats,
<a href="../../../../../org/apache/cassandra/io/util/DataOutputPlus.html" title="interface in org.apache.cassandra.io.util">DataOutputPlus</a> out)
throws java.io.IOException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
</dl>
</li>
</ul>
<a name="serializedSize-org.apache.cassandra.db.rows.EncodingStats-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serializedSize</h4>
<pre>public int serializedSize(<a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a> stats)</pre>
</li>
</ul>
<a name="deserialize-org.apache.cassandra.io.util.DataInputPlus-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>deserialize</h4>
<pre>public <a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows">EncodingStats</a> deserialize(<a href="../../../../../org/apache/cassandra/io/util/DataInputPlus.html" title="interface in org.apache.cassandra.io.util">DataInputPlus</a> in)
throws java.io.IOException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EncodingStats.Serializer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.Collector.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/db/rows/LazilyInitializedUnfilteredRowIterator.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/rows/EncodingStats.Serializer.html" target="_top">Frames</a></li>
<li><a href="EncodingStats.Serializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2016 The Apache Software Foundation</small></p>
</body>
</html>
|
jasonwee/videoOnCloud
|
lib/cassandra/apache-cassandra-3.7/javadoc/org/apache/cassandra/db/rows/EncodingStats.Serializer.html
|
HTML
|
apache-2.0
| 12,808
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_20) on Thu Feb 24 01:10:10 PST 2011 -->
<TITLE>
Uses of Class org.apache.hadoop.io.file.tfile.TFile.Writer (Hadoop 0.20.2-cdh3u0-SNAPSHOT API)
</TITLE>
<META NAME="date" CONTENT="2011-02-24">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.hadoop.io.file.tfile.TFile.Writer (Hadoop 0.20.2-cdh3u0-SNAPSHOT API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html" title="class in org.apache.hadoop.io.file.tfile"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/hadoop/io/file/tfile//class-useTFile.Writer.html" target="_top"><B>FRAMES</B></A>
<A HREF="TFile.Writer.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.hadoop.io.file.tfile.TFile.Writer</B></H2>
</CENTER>
No usage of org.apache.hadoop.io.file.tfile.TFile.Writer
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html" title="class in org.apache.hadoop.io.file.tfile"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/hadoop/io/file/tfile//class-useTFile.Writer.html" target="_top"><B>FRAMES</B></A>
<A HREF="TFile.Writer.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2009 The Apache Software Foundation
</BODY>
</HTML>
|
simplegeo/hadoop
|
docs/api/org/apache/hadoop/io/file/tfile/class-use/TFile.Writer.html
|
HTML
|
apache-2.0
| 6,190
|
package io.smartcat.cassandra.diagnostics.ft.basic2;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.thrift.transport.TTransportException;
import org.assertj.core.api.Assertions;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;
import io.netty.util.internal.SystemPropertyUtil;
public class FTBasic2 {
private static final String SELECT_QUERY = "SELECT * FROM test_keyspace.test_table";
private static final String CASSANDRA_LOG = "system.log";
private static Cluster cluster;
private static Session session;
private static WatchService watcher;
private static FileSystem fileSystem;
private static Path logFilePath;
@BeforeClass
public static void setUp() throws ConfigurationException, TTransportException, IOException, InterruptedException {
cluster = Cluster.builder()
.addContactPoint(SystemPropertyUtil.get("cassandra.host"))
.withPort(Integer.parseInt(SystemPropertyUtil.get("cassandra.port")))
.build();
session = cluster.connect();
session.execute("CREATE KEYSPACE IF NOT EXISTS test_keyspace "
+ "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };");
session.execute("CREATE TABLE IF NOT EXISTS test_keyspace.test_table (uid uuid PRIMARY KEY);");
fileSystem = FileSystems.getDefault();
watcher = fileSystem.newWatchService();
Path logFileDir = fileSystem.getPath(SystemPropertyUtil.get("project.build.directory"));
logFilePath = fileSystem.getPath(SystemPropertyUtil.get("project.build.directory"), CASSANDRA_LOG);
logFileDir.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY);
}
@AfterClass
public static void cleanUp() {
cluster.close();
// this is needed in order to cleanup Cassandra log file since it is mounted from build directory which means
// that on multiple runs test will show success from previous runs.
logFilePath.toFile().delete();
}
@Test
public void test() throws Exception {
session.execute(SELECT_QUERY);
verifyLogFileIsChanged();
BufferedReader reader = new BufferedReader(new FileReader(logFilePath.toFile()));
String line;
boolean queryReportFound = false;
boolean queryCountFound = false;
boolean heartbeatFound = false;
boolean requestRateFound = false;
boolean repairSessionsFound = false;
boolean compactionSettingsInfoFound = false;
boolean numberOfUnreachableNodesFound = false;
boolean nodeInfoFound = false;
boolean hiccupFound = false;
while ((line = reader.readLine()) != null) {
if (line.matches(".* QUERYREPORT_COUNT.*")) {
queryCountFound = true;
continue;
}
if (line.matches(".* QUERYREPORT.*")) {
queryReportFound = true;
continue;
}
if (line.matches(".* HEARTBEAT.*")) {
heartbeatFound = true;
continue;
}
if (line.matches(".* REQUEST_RATE.*")) {
requestRateFound = true;
continue;
}
if (line.matches(".* REPAIR_SESSIONS.*")) {
repairSessionsFound = true;
continue;
}
if (line.matches(".* COMPACTION_SETTINGS_INFO.*")) {
compactionSettingsInfoFound = true;
continue;
}
if (line.matches(".* NUMBER_OF_UNREACHABLE_NODES.*")) {
numberOfUnreachableNodesFound = true;
continue;
}
if (line.matches(".* NODE_INFO.*")) {
nodeInfoFound = true;
continue;
}
if (line.matches(".* HICCUP.*")) {
hiccupFound = true;
continue;
}
}
reader.close();
Assertions.assertThat(queryReportFound).isTrue();
Assertions.assertThat(queryCountFound).isTrue();
Assertions.assertThat(heartbeatFound).isTrue();
Assertions.assertThat(requestRateFound).isTrue();
Assertions.assertThat(repairSessionsFound).isTrue();
Assertions.assertThat(compactionSettingsInfoFound).isTrue();
Assertions.assertThat(numberOfUnreachableNodesFound).isTrue();
Assertions.assertThat(nodeInfoFound).isTrue();
Assertions.assertThat(hiccupFound).isTrue();
}
public void verifyLogFileIsChanged() throws Exception {
boolean logFileChanged = false;
WatchKey watckKey = watcher.poll(10000, TimeUnit.MILLISECONDS);
List<WatchEvent<?>> events = watckKey.pollEvents();
for (WatchEvent<?> event : events) {
final Path changed = (Path) event.context();
if (changed.endsWith(CASSANDRA_LOG)) {
logFileChanged = true;
}
}
Assertions.assertThat(logFileChanged).isTrue();
}
}
|
smartcat-labs/cassandra-diagnostics
|
cassandra-diagnostics-ft/basic2/src/functional-test/java/io/smartcat/cassandra/diagnostics/ft/basic2/FTBasic2.java
|
Java
|
apache-2.0
| 5,580
|
/**
*/
package bpsim.impl;
import bpsim.BpsimPackage;
import bpsim.Calendar;
import bpsim.ElementParameters;
import bpsim.ElementParametersType;
import bpsim.Scenario;
import bpsim.ScenarioParameters;
import bpsim.ScenarioParametersType;
import bpsim.VendorExtension;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Scenario</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link bpsim.impl.ScenarioImpl#getScenarioParameters <em>Scenario Parameters</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getElementParameters <em>Element Parameters</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getCalendar <em>Calendar</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getVendorExtension <em>Vendor Extension</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getAuthor <em>Author</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getCreated <em>Created</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getDescription <em>Description</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getId <em>Id</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getInherits <em>Inherits</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getModified <em>Modified</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getName <em>Name</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getResult <em>Result</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getVendor <em>Vendor</em>}</li>
* <li>{@link bpsim.impl.ScenarioImpl#getVersion <em>Version</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ScenarioImpl extends EObjectImpl implements Scenario {
/**
* The cached value of the '{@link #getScenarioParameters() <em>Scenario Parameters</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScenarioParameters()
* @generated
* @ordered
*/
protected ScenarioParameters scenarioParameters;
/**
* The cached value of the '{@link #getElementParameters() <em>Element Parameters</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getElementParameters()
* @generated
* @ordered
*/
protected EList<ElementParameters> elementParameters;
/**
* The cached value of the '{@link #getCalendar() <em>Calendar</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCalendar()
* @generated
* @ordered
*/
protected EList<Calendar> calendar;
/**
* The cached value of the '{@link #getVendorExtension() <em>Vendor Extension</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVendorExtension()
* @generated
* @ordered
*/
protected EList<VendorExtension> vendorExtension;
/**
* The default value of the '{@link #getAuthor() <em>Author</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected static final String AUTHOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected String author = AUTHOR_EDEFAULT;
/**
* The default value of the '{@link #getCreated() <em>Created</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCreated()
* @generated
* @ordered
*/
protected static final Object CREATED_EDEFAULT = null;
/**
* The cached value of the '{@link #getCreated() <em>Created</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCreated()
* @generated
* @ordered
*/
protected Object created = CREATED_EDEFAULT;
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getInherits() <em>Inherits</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInherits()
* @generated
* @ordered
*/
protected static final String INHERITS_EDEFAULT = null;
/**
* The cached value of the '{@link #getInherits() <em>Inherits</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInherits()
* @generated
* @ordered
*/
protected String inherits = INHERITS_EDEFAULT;
/**
* The default value of the '{@link #getModified() <em>Modified</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModified()
* @generated
* @ordered
*/
protected static final Object MODIFIED_EDEFAULT = null;
/**
* The cached value of the '{@link #getModified() <em>Modified</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModified()
* @generated
* @ordered
*/
protected Object modified = MODIFIED_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getResult() <em>Result</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResult()
* @generated
* @ordered
*/
protected static final String RESULT_EDEFAULT = null;
/**
* The cached value of the '{@link #getResult() <em>Result</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResult()
* @generated
* @ordered
*/
protected String result = RESULT_EDEFAULT;
/**
* The default value of the '{@link #getVendor() <em>Vendor</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVendor()
* @generated
* @ordered
*/
protected static final String VENDOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getVendor() <em>Vendor</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVendor()
* @generated
* @ordered
*/
protected String vendor = VENDOR_EDEFAULT;
/**
* The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected static final String VERSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected String version = VERSION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ScenarioImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpsimPackage.Literals.SCENARIO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ScenarioParameters getScenarioParameters() {
return scenarioParameters;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetScenarioParameters(ScenarioParameters newScenarioParameters, NotificationChain msgs) {
ScenarioParameters oldScenarioParameters = scenarioParameters;
scenarioParameters = newScenarioParameters;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, oldScenarioParameters, newScenarioParameters);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setScenarioParameters(ScenarioParameters newScenarioParameters) {
if (newScenarioParameters != scenarioParameters) {
NotificationChain msgs = null;
if (scenarioParameters != null)
msgs = ((InternalEObject)scenarioParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs);
if (newScenarioParameters != null)
msgs = ((InternalEObject)newScenarioParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, null, msgs);
msgs = basicSetScenarioParameters(newScenarioParameters, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__SCENARIO_PARAMETERS, newScenarioParameters, newScenarioParameters));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ElementParameters> getElementParameters() {
if (elementParameters == null) {
elementParameters = new EObjectContainmentEList<ElementParameters>(ElementParameters.class, this, BpsimPackage.SCENARIO__ELEMENT_PARAMETERS);
}
return elementParameters;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Calendar> getCalendar() {
if (calendar == null) {
calendar = new EObjectContainmentEList<Calendar>(Calendar.class, this, BpsimPackage.SCENARIO__CALENDAR);
}
return calendar;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<VendorExtension> getVendorExtension() {
if (vendorExtension == null) {
vendorExtension = new EObjectContainmentEList<VendorExtension>(VendorExtension.class, this, BpsimPackage.SCENARIO__VENDOR_EXTENSION);
}
return vendorExtension;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getAuthor() {
return author;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAuthor(String newAuthor) {
String oldAuthor = author;
author = newAuthor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__AUTHOR, oldAuthor, author));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getCreated() {
return created;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCreated(Object newCreated) {
Object oldCreated = created;
created = newCreated;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__CREATED, oldCreated, created));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(String newDescription) {
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getInherits() {
return inherits;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInherits(String newInherits) {
String oldInherits = inherits;
inherits = newInherits;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__INHERITS, oldInherits, inherits));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getModified() {
return modified;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setModified(Object newModified) {
Object oldModified = modified;
modified = newModified;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__MODIFIED, oldModified, modified));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getResult() {
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResult(String newResult) {
String oldResult = result;
result = newResult;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__RESULT, oldResult, result));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getVendor() {
return vendor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVendor(String newVendor) {
String oldVendor = vendor;
vendor = newVendor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VENDOR, oldVendor, vendor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getVersion() {
return version;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVersion(String newVersion) {
String oldVersion = version;
version = newVersion;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO__VERSION, oldVersion, version));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS:
return basicSetScenarioParameters(null, msgs);
case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS:
return ((InternalEList<?>)getElementParameters()).basicRemove(otherEnd, msgs);
case BpsimPackage.SCENARIO__CALENDAR:
return ((InternalEList<?>)getCalendar()).basicRemove(otherEnd, msgs);
case BpsimPackage.SCENARIO__VENDOR_EXTENSION:
return ((InternalEList<?>)getVendorExtension()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS:
return getScenarioParameters();
case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS:
return getElementParameters();
case BpsimPackage.SCENARIO__CALENDAR:
return getCalendar();
case BpsimPackage.SCENARIO__VENDOR_EXTENSION:
return getVendorExtension();
case BpsimPackage.SCENARIO__AUTHOR:
return getAuthor();
case BpsimPackage.SCENARIO__CREATED:
return getCreated();
case BpsimPackage.SCENARIO__DESCRIPTION:
return getDescription();
case BpsimPackage.SCENARIO__ID:
return getId();
case BpsimPackage.SCENARIO__INHERITS:
return getInherits();
case BpsimPackage.SCENARIO__MODIFIED:
return getModified();
case BpsimPackage.SCENARIO__NAME:
return getName();
case BpsimPackage.SCENARIO__RESULT:
return getResult();
case BpsimPackage.SCENARIO__VENDOR:
return getVendor();
case BpsimPackage.SCENARIO__VERSION:
return getVersion();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS:
setScenarioParameters((ScenarioParameters)newValue);
return;
case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS:
getElementParameters().clear();
getElementParameters().addAll((Collection<? extends ElementParameters>)newValue);
return;
case BpsimPackage.SCENARIO__CALENDAR:
getCalendar().clear();
getCalendar().addAll((Collection<? extends Calendar>)newValue);
return;
case BpsimPackage.SCENARIO__VENDOR_EXTENSION:
getVendorExtension().clear();
getVendorExtension().addAll((Collection<? extends VendorExtension>)newValue);
return;
case BpsimPackage.SCENARIO__AUTHOR:
setAuthor((String)newValue);
return;
case BpsimPackage.SCENARIO__CREATED:
setCreated(newValue);
return;
case BpsimPackage.SCENARIO__DESCRIPTION:
setDescription((String)newValue);
return;
case BpsimPackage.SCENARIO__ID:
setId((String)newValue);
return;
case BpsimPackage.SCENARIO__INHERITS:
setInherits((String)newValue);
return;
case BpsimPackage.SCENARIO__MODIFIED:
setModified(newValue);
return;
case BpsimPackage.SCENARIO__NAME:
setName((String)newValue);
return;
case BpsimPackage.SCENARIO__RESULT:
setResult((String)newValue);
return;
case BpsimPackage.SCENARIO__VENDOR:
setVendor((String)newValue);
return;
case BpsimPackage.SCENARIO__VERSION:
setVersion((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS:
setScenarioParameters((ScenarioParameters)null);
return;
case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS:
getElementParameters().clear();
return;
case BpsimPackage.SCENARIO__CALENDAR:
getCalendar().clear();
return;
case BpsimPackage.SCENARIO__VENDOR_EXTENSION:
getVendorExtension().clear();
return;
case BpsimPackage.SCENARIO__AUTHOR:
setAuthor(AUTHOR_EDEFAULT);
return;
case BpsimPackage.SCENARIO__CREATED:
setCreated(CREATED_EDEFAULT);
return;
case BpsimPackage.SCENARIO__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case BpsimPackage.SCENARIO__ID:
setId(ID_EDEFAULT);
return;
case BpsimPackage.SCENARIO__INHERITS:
setInherits(INHERITS_EDEFAULT);
return;
case BpsimPackage.SCENARIO__MODIFIED:
setModified(MODIFIED_EDEFAULT);
return;
case BpsimPackage.SCENARIO__NAME:
setName(NAME_EDEFAULT);
return;
case BpsimPackage.SCENARIO__RESULT:
setResult(RESULT_EDEFAULT);
return;
case BpsimPackage.SCENARIO__VENDOR:
setVendor(VENDOR_EDEFAULT);
return;
case BpsimPackage.SCENARIO__VERSION:
setVersion(VERSION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpsimPackage.SCENARIO__SCENARIO_PARAMETERS:
return scenarioParameters != null;
case BpsimPackage.SCENARIO__ELEMENT_PARAMETERS:
return elementParameters != null && !elementParameters.isEmpty();
case BpsimPackage.SCENARIO__CALENDAR:
return calendar != null && !calendar.isEmpty();
case BpsimPackage.SCENARIO__VENDOR_EXTENSION:
return vendorExtension != null && !vendorExtension.isEmpty();
case BpsimPackage.SCENARIO__AUTHOR:
return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author);
case BpsimPackage.SCENARIO__CREATED:
return CREATED_EDEFAULT == null ? created != null : !CREATED_EDEFAULT.equals(created);
case BpsimPackage.SCENARIO__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case BpsimPackage.SCENARIO__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case BpsimPackage.SCENARIO__INHERITS:
return INHERITS_EDEFAULT == null ? inherits != null : !INHERITS_EDEFAULT.equals(inherits);
case BpsimPackage.SCENARIO__MODIFIED:
return MODIFIED_EDEFAULT == null ? modified != null : !MODIFIED_EDEFAULT.equals(modified);
case BpsimPackage.SCENARIO__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case BpsimPackage.SCENARIO__RESULT:
return RESULT_EDEFAULT == null ? result != null : !RESULT_EDEFAULT.equals(result);
case BpsimPackage.SCENARIO__VENDOR:
return VENDOR_EDEFAULT == null ? vendor != null : !VENDOR_EDEFAULT.equals(vendor);
case BpsimPackage.SCENARIO__VERSION:
return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (author: ");
result.append(author);
result.append(", created: ");
result.append(created);
result.append(", description: ");
result.append(description);
result.append(", id: ");
result.append(id);
result.append(", inherits: ");
result.append(inherits);
result.append(", modified: ");
result.append(modified);
result.append(", name: ");
result.append(name);
result.append(", result: ");
result.append(result);
result.append(", vendor: ");
result.append(vendor);
result.append(", version: ");
result.append(version);
result.append(')');
return result.toString();
}
} //ScenarioImpl
|
hxf0801/jbpm
|
jbpm-bpmn2-emfextmodel/src/main/java/bpsim/impl/ScenarioImpl.java
|
Java
|
apache-2.0
| 23,500
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_02.html">Class Test_AbaRouteValidator_02</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_1711_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_02.html?line=19000#src-19000" >testAbaNumberCheck_1711_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:32:12
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_1711_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=39520#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html>
|
dcarda/aba.route.validator
|
target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_02_testAbaNumberCheck_1711_good_uhs.html
|
HTML
|
apache-2.0
| 9,178
|
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
# Namespaces
## Abstract
A Namespace is a mechanism to partition resources created by users into
a logically named group.
## Motivation
A single cluster should be able to satisfy the needs of multiple user communities.
Each user community wants to be able to work in isolation from other communities.
Each user community has its own:
1. resources (pods, services, replication controllers, etc.)
2. policies (who can or cannot perform actions in their community)
3. constraints (this community is allowed this much quota, etc.)
A cluster operator may create a Namespace for each unique user community.
The Namespace provides a unique scope for:
1. named resources (to avoid basic naming collisions)
2. delegated management authority to trusted users
3. ability to limit community resource consumption
## Use cases
1. As a cluster operator, I want to support multiple user communities on a single cluster.
2. As a cluster operator, I want to delegate authority to partitions of the cluster to trusted users
in those communities.
3. As a cluster operator, I want to limit the amount of resources each community can consume in order
to limit the impact to other communities using the cluster.
4. As a cluster user, I want to interact with resources that are pertinent to my user community in
isolation of what other user communities are doing on the cluster.
## Design
### Data Model
A *Namespace* defines a logically named group for multiple *Kind*s of resources.
```go
type Namespace struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
Spec NamespaceSpec `json:"spec,omitempty"`
Status NamespaceStatus `json:"status,omitempty"`
}
```
A *Namespace* name is a DNS compatible label.
A *Namespace* must exist prior to associating content with it.
A *Namespace* must not be deleted if there is content associated with it.
To associate a resource with a *Namespace* the following conditions must be satisfied:
1. The resource's *Kind* must be registered as having *RESTScopeNamespace* with the server
2. The resource's *TypeMeta.Namespace* field must have a value that references an existing *Namespace*
The *Name* of a resource associated with a *Namespace* is unique to that *Kind* in that *Namespace*.
It is intended to be used in resource URLs; provided by clients at creation time, and encouraged to be
human friendly; intended to facilitate idempotent creation, space-uniqueness of singleton objects,
distinguish distinct entities, and reference particular entities across operations.
### Authorization
A *Namespace* provides an authorization scope for accessing content associated with the *Namespace*.
See [Authorization plugins](../admin/authorization.md)
### Limit Resource Consumption
A *Namespace* provides a scope to limit resource consumption.
A *LimitRange* defines min/max constraints on the amount of resources a single entity can consume in
a *Namespace*.
See [Admission control: Limit Range](admission_control_limit_range.md)
A *ResourceQuota* tracks aggregate usage of resources in the *Namespace* and allows cluster operators
to define *Hard* resource usage limits that a *Namespace* may consume.
See [Admission control: Resource Quota](admission_control_resource_quota.md)
### Finalizers
Upon creation of a *Namespace*, the creator may provide a list of *Finalizer* objects.
```go
type FinalizerName string
// These are internal finalizers to Kubernetes, must be qualified name unless defined here
const (
FinalizerKubernetes FinalizerName = "kubernetes"
)
// NamespaceSpec describes the attributes on a Namespace
type NamespaceSpec struct {
// Finalizers is an opaque list of values that must be empty to permanently remove object from storage
Finalizers []FinalizerName
}
```
A *FinalizerName* is a qualified name.
The API Server enforces that a *Namespace* can only be deleted from storage if and only if
it's *Namespace.Spec.Finalizers* is empty.
A *finalize* operation is the only mechanism to modify the *Namespace.Spec.Finalizers* field post creation.
Each *Namespace* created has *kubernetes* as an item in its list of initial *Namespace.Spec.Finalizers*
set by default.
### Phases
A *Namespace* may exist in the following phases.
```go
type NamespacePhase string
const(
NamespaceActive NamespacePhase = "Active"
NamespaceTerminating NamespaceTerminating = "Terminating"
)
type NamespaceStatus struct {
...
Phase NamespacePhase
}
```
A *Namespace* is in the **Active** phase if it does not have a *ObjectMeta.DeletionTimestamp*.
A *Namespace* is in the **Terminating** phase if it has a *ObjectMeta.DeletionTimestamp*.
**Active**
Upon creation, a *Namespace* goes in the *Active* phase. This means that content may be associated with
a namespace, and all normal interactions with the namespace are allowed to occur in the cluster.
If a DELETE request occurs for a *Namespace*, the *Namespace.ObjectMeta.DeletionTimestamp* is set
to the current server time. A *namespace controller* observes the change, and sets the *Namespace.Status.Phase*
to *Terminating*.
**Terminating**
A *namespace controller* watches for *Namespace* objects that have a *Namespace.ObjectMeta.DeletionTimestamp*
value set in order to know when to initiate graceful termination of the *Namespace* associated content that
are known to the cluster.
The *namespace controller* enumerates each known resource type in that namespace and deletes it one by one.
Admission control blocks creation of new resources in that namespace in order to prevent a race-condition
where the controller could believe all of a given resource type had been deleted from the namespace,
when in fact some other rogue client agent had created new objects. Using admission control in this
scenario allows each of registry implementations for the individual objects to not need to take into account Namespace life-cycle.
Once all objects known to the *namespace controller* have been deleted, the *namespace controller*
executes a *finalize* operation on the namespace that removes the *kubernetes* value from
the *Namespace.Spec.Finalizers* list.
If the *namespace controller* sees a *Namespace* whose *ObjectMeta.DeletionTimestamp* is set, and
whose *Namespace.Spec.Finalizers* list is empty, it will signal the server to permanently remove
the *Namespace* from storage by sending a final DELETE action to the API server.
### REST API
To interact with the Namespace API:
| Action | HTTP Verb | Path | Description |
| ------ | --------- | ---- | ----------- |
| CREATE | POST | /api/{version}/namespaces | Create a namespace |
| LIST | GET | /api/{version}/namespaces | List all namespaces |
| UPDATE | PUT | /api/{version}/namespaces/{namespace} | Update namespace {namespace} |
| DELETE | DELETE | /api/{version}/namespaces/{namespace} | Delete namespace {namespace} |
| FINALIZE | POST | /api/{version}/namespaces/{namespace}/finalize | Finalize namespace {namespace} |
| WATCH | GET | /api/{version}/watch/namespaces | Watch all namespaces |
This specification reserves the name *finalize* as a sub-resource to namespace.
As a consequence, it is invalid to have a *resourceType* managed by a namespace whose kind is *finalize*.
To interact with content associated with a Namespace:
| Action | HTTP Verb | Path | Description |
| ---- | ---- | ---- | ---- |
| CREATE | POST | /api/{version}/namespaces/{namespace}/{resourceType}/ | Create instance of {resourceType} in namespace {namespace} |
| GET | GET | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Get instance of {resourceType} in namespace {namespace} with {name} |
| UPDATE | PUT | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Update instance of {resourceType} in namespace {namespace} with {name} |
| DELETE | DELETE | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Delete instance of {resourceType} in namespace {namespace} with {name} |
| LIST | GET | /api/{version}/namespaces/{namespace}/{resourceType} | List instances of {resourceType} in namespace {namespace} |
| WATCH | GET | /api/{version}/watch/namespaces/{namespace}/{resourceType} | Watch for changes to a {resourceType} in namespace {namespace} |
| WATCH | GET | /api/{version}/watch/{resourceType} | Watch for changes to a {resourceType} across all namespaces |
| LIST | GET | /api/{version}/list/{resourceType} | List instances of {resourceType} across all namespaces |
The API server verifies the *Namespace* on resource creation matches the *{namespace}* on the path.
The API server will associate a resource with a *Namespace* if not populated by the end-user based on the *Namespace* context
of the incoming request. If the *Namespace* of the resource being created, or updated does not match the *Namespace* on the request,
then the API server will reject the request.
### Storage
A namespace provides a unique identifier space and therefore must be in the storage path of a resource.
In etcd, we want to continue to still support efficient WATCH across namespaces.
Resources that persist content in etcd will have storage paths as follows:
/{k8s_storage_prefix}/{resourceType}/{resource.Namespace}/{resource.Name}
This enables consumers to WATCH /registry/{resourceType} for changes across namespace of a particular {resourceType}.
### Kubelet
The kubelet will register pod's it sources from a file or http source with a namespace associated with the
*cluster-id*
### Example: OpenShift Origin managing a Kubernetes Namespace
In this example, we demonstrate how the design allows for agents built on-top of
Kubernetes that manage their own set of resource types associated with a *Namespace*
to take part in Namespace termination.
OpenShift creates a Namespace in Kubernetes
```json
{
"apiVersion":"v1",
"kind": "Namespace",
"metadata": {
"name": "development",
},
"spec": {
"finalizers": ["openshift.com/origin", "kubernetes"],
},
"status": {
"phase": "Active",
},
"labels": {
"name": "development"
},
}
```
OpenShift then goes and creates a set of resources (pods, services, etc) associated
with the "development" namespace. It also creates its own set of resources in its
own storage associated with the "development" namespace unknown to Kubernetes.
User deletes the Namespace in Kubernetes, and Namespace now has following state:
```json
{
"apiVersion":"v1",
"kind": "Namespace",
"metadata": {
"name": "development",
"deletionTimestamp": "..."
},
"spec": {
"finalizers": ["openshift.com/origin", "kubernetes"],
},
"status": {
"phase": "Terminating",
},
"labels": {
"name": "development"
},
}
```
The Kubernetes *namespace controller* observes the namespace has a *deletionTimestamp*
and begins to terminate all of the content in the namespace that it knows about. Upon
success, it executes a *finalize* action that modifies the *Namespace* by
removing *kubernetes* from the list of finalizers:
```json
{
"apiVersion":"v1",
"kind": "Namespace",
"metadata": {
"name": "development",
"deletionTimestamp": "..."
},
"spec": {
"finalizers": ["openshift.com/origin"],
},
"status": {
"phase": "Terminating",
},
"labels": {
"name": "development"
},
}
```
OpenShift Origin has its own *namespace controller* that is observing cluster state, and
it observes the same namespace had a *deletionTimestamp* assigned to it. It too will go
and purge resources from its own storage that it manages associated with that namespace.
Upon completion, it executes a *finalize* action and removes the reference to "openshift.com/origin"
from the list of finalizers.
This results in the following state:
```json
{
"apiVersion":"v1",
"kind": "Namespace",
"metadata": {
"name": "development",
"deletionTimestamp": "..."
},
"spec": {
"finalizers": [],
},
"status": {
"phase": "Terminating",
},
"labels": {
"name": "development"
},
}
```
At this point, the Kubernetes *namespace controller* in its sync loop will see that the namespace
has a deletion timestamp and that its list of finalizers is empty. As a result, it knows all
content associated from that namespace has been purged. It performs a final DELETE action
to remove that Namespace from the storage.
At this point, all content associated with that Namespace, and the Namespace itself are gone.
<!-- BEGIN MUNGE: IS_VERSIONED -->
<!-- TAG IS_VERSIONED -->
<!-- END MUNGE: IS_VERSIONED -->
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[]()
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
ElephoneApp/kubernetes
|
docs/design/namespaces.md
|
Markdown
|
apache-2.0
| 12,779
|
package com.benayn.pre;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.benayn.ustyle.Reflecter;
import com.benayn.ustyle.base.Domain;
public class ShowGenerics {
public static void main(String[] args) {
String pName = "complex"; // prop
Field f = Reflecter.from(Domain.class).field(pName);
String typeStr = ShowGenerics.typeToString(f.getGenericType());
System.out.println(typeStr);
}
public static String typeToString(Type type) {
StringBuilder sb = new StringBuilder();
typeToString(sb, type, new HashSet<Type>());
return sb.toString();
}
private static void typeToString(StringBuilder strB, Type type, Set<Type> visited) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
final Class<?> rawType = (Class<?>) parameterizedType.getRawType();
strB.append(rawType.getName());
boolean isPair = Map.class.isAssignableFrom(rawType);
boolean first = true;
int count = 0;
Type[] types = parameterizedType.getActualTypeArguments();
for (Type typeArg : types) {
if (first) {
first = false;
} else {
strB.append(", ");
}
if (!isPair || count == 0) {
strB.append('<');
}
typeToString(strB, typeArg, visited);
if (!isPair || count == (types.length - 1)) {
strB.append('>');
}
++count;
}
} else if (type instanceof WildcardType) {
WildcardType wildcardType = (WildcardType) type;
strB.append("?");
/*
* According to
* JLS(http://java.sun.com/docs/books/jls/third_edition/
* html/typesValues.html#4.5.1): - Lower and upper can't coexist:
* (for instance, this is not allowed: <? extends List<String> &
* super MyInterface>) - Multiple bounds are not supported (for
* instance, this is not allowed: <? extends List<String> &
* MyInterface>)
*/
final Type bound;
if (wildcardType.getLowerBounds().length != 0) {
strB.append(" super ");
bound = wildcardType.getLowerBounds()[0];
} else {
strB.append(" extends ");
bound = wildcardType.getUpperBounds()[0];
}
typeToString(strB, bound, visited);
} else if (type instanceof TypeVariable<?>) {
TypeVariable<?> typeVariable = (TypeVariable<?>) type;
strB.append(typeVariable.getName());
/*
* Prevent cycles in case: <T extends List<T>>
*/
if (!visited.contains(type)) {
visited.add(type);
strB.append(" extends ");
boolean first = true;
for (Type bound : typeVariable.getBounds()) {
if (first) {
first = false;
} else {
strB.append(" & ");
}
typeToString(strB, bound, visited);
}
visited.remove(type);
}
} else if (type instanceof GenericArrayType) {
GenericArrayType genericArrayType = (GenericArrayType) type;
typeToString(genericArrayType.getGenericComponentType());
strB.append(genericArrayType.getGenericComponentType());
strB.append("[]");
} else if (type instanceof Class) {
Class<?> typeClass = (Class<?>) type;
strB.append(typeClass.getName());
} else {
throw new IllegalArgumentException("Unsupported type: " + type);
}
}
}
|
jronrun/benayn
|
benayn-ustyle-test/src/test/java/com/benayn/pre/ShowGenerics.java
|
Java
|
apache-2.0
| 3,378
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using SuperSocket.Common;
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Command;
using AnyLog;
using SuperSocket.SocketBase.Protocol;
namespace SuperSocket.SocketEngine
{
abstract class TcpSocketServerBase : SocketServerBase
{
private readonly byte[] m_KeepAliveOptionValues;
private readonly byte[] m_KeepAliveOptionOutValues;
private readonly int m_SendTimeOut;
private readonly int m_ReceiveBufferSize;
private readonly int m_SendBufferSize;
public TcpSocketServerBase(IAppServer appServer, ListenerInfo[] listeners)
: base(appServer, listeners)
{
var config = appServer.Config;
uint dummy = 0;
m_KeepAliveOptionValues = new byte[Marshal.SizeOf(dummy) * 3];
m_KeepAliveOptionOutValues = new byte[m_KeepAliveOptionValues.Length];
//whether enable KeepAlive
BitConverter.GetBytes((uint)1).CopyTo(m_KeepAliveOptionValues, 0);
//how long will start first keep alive
BitConverter.GetBytes((uint)(config.KeepAliveTime * 1000)).CopyTo(m_KeepAliveOptionValues, Marshal.SizeOf(dummy));
//keep alive interval
BitConverter.GetBytes((uint)(config.KeepAliveInterval * 1000)).CopyTo(m_KeepAliveOptionValues, Marshal.SizeOf(dummy) * 2);
m_SendTimeOut = config.SendTimeOut;
m_ReceiveBufferSize = config.ReceiveBufferSize;
m_SendBufferSize = config.SendBufferSize;
}
protected IAppSession CreateSession(Socket client, ISocketSession session)
{
if (m_SendTimeOut > 0)
client.SendTimeout = m_SendTimeOut;
if (m_ReceiveBufferSize > 0)
client.ReceiveBufferSize = m_ReceiveBufferSize;
if (m_SendBufferSize > 0)
client.SendBufferSize = m_SendBufferSize;
if (!Platform.SupportSocketIOControlByCodeEnum)
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, m_KeepAliveOptionValues);
else
client.IOControl(IOControlCode.KeepAliveValues, m_KeepAliveOptionValues, m_KeepAliveOptionOutValues);
client.NoDelay = true;
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, true);
return this.AppServer.CreateAppSession(session);
}
protected override ISocketListener CreateListener(ListenerInfo listenerInfo)
{
return new TcpAsyncSocketListener(listenerInfo);
}
}
}
|
mdavid/SuperSocket
|
SocketEngine/TcpSocketServerBase.cs
|
C#
|
apache-2.0
| 2,760
|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-06 09:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hackerspace', '0009_verbal_subcategory'),
]
operations = [
migrations.RemoveField(
model_name='programmingquestion',
name='op1',
),
migrations.RemoveField(
model_name='programmingquestion',
name='op2',
),
migrations.RemoveField(
model_name='programmingquestion',
name='op3',
),
migrations.RemoveField(
model_name='programmingquestion',
name='op4',
),
migrations.AddField(
model_name='programmingquestion',
name='Output',
field=models.CharField(default='1', max_length=200),
preserve_default=False,
),
migrations.AddField(
model_name='programmingquestion',
name='TestCases',
field=models.CharField(default='2', max_length=200, verbose_name='Test Cases'),
preserve_default=False,
),
migrations.AddField(
model_name='quiz',
name='Answer',
field=models.CharField(default='3', max_length=200),
preserve_default=False,
),
migrations.AddField(
model_name='verbal',
name='Answer',
field=models.CharField(default='3', max_length=200),
preserve_default=False,
),
migrations.AlterField(
model_name='programmingquestion',
name='subCategory',
field=models.CharField(choices=[(1, 'Strings'), (2, 'Dynamic Programming'), (3, 'Arrays'), (4, 'Data Structures')], max_length=200),
),
migrations.AlterField(
model_name='test',
name='ProgrammingTagName',
field=models.CharField(choices=[(1, 'Strings'), (2, 'Dynamic Programming'), (3, 'Arrays'), (4, 'Data Structures')], max_length=200, verbose_name='Programming Tags'),
),
migrations.AlterField(
model_name='verbal',
name='subCategory',
field=models.CharField(choices=[(1, 'Comprehension'), (2, 'Error Identification')], max_length=200),
),
]
|
SJIT-Hackerspace/SJIT-CodingPortal
|
hackerspace/migrations/0010_auto_20160906_1442.py
|
Python
|
apache-2.0
| 2,386
|
---
layout: base
title: 'Statistics of expl in UD_Italian-VIT'
udver: '2'
---
## Treebank Statistics: UD_Italian-VIT: Relations: `expl`
This relation is universal.
There are 2 language-specific subtypes of `expl`: <tt><a href="it_vit-dep-expl-impers.html">expl:impers</a></tt>, <tt><a href="it_vit-dep-expl-pass.html">expl:pass</a></tt>.
2780 nodes (1%) are attached to their parents as `expl`.
2263 instances of `expl` (81%) are right-to-left (child precedes parent).
Average distance between parent and child is 1.33992805755396.
The following 6 pairs of parts of speech are connected with `expl`: <tt><a href="it_vit-pos-VERB.html">VERB</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (2748; 99% instances), <tt><a href="it_vit-pos-PRON.html">PRON</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (12; 0% instances), <tt><a href="it_vit-pos-NOUN.html">NOUN</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (11; 0% instances), <tt><a href="it_vit-pos-ADJ.html">ADJ</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (6; 0% instances), <tt><a href="it_vit-pos-ADV.html">ADV</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (2; 0% instances), <tt><a href="it_vit-pos-INTJ.html">INTJ</a></tt>-<tt><a href="it_vit-pos-PRON.html">PRON</a></tt> (1; 0% instances).
~~~ conllu
# visual-style 9 bgColor:blue
# visual-style 9 fgColor:white
# visual-style 10 bgColor:blue
# visual-style 10 fgColor:white
# visual-style 10 9 expl color:blue
1 Ha avere VERB V Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 0 root _ _
2 l' il DET RD Definite=Def|Number=Sing|PronType=Art 3 det _ SpaceAfter=No
3 acqua acqua NOUN S Gender=Fem|Number=Sing 1 obj _ _
4 calda caldo ADJ A Gender=Fem|Number=Sing 3 amod _ SpaceAfter=No
5 , , PUNCT FF _ 10 punct _ _
6 più più ADV B _ 10 advmod _ _
7 o o CCONJ CC _ 8 cc _ _
8 meno meno ADV B _ 6 conj _ _
9 si si PRON PC Clitic=Yes|Person=3|PronType=Prs 10 expl _ _
10 veste vestire VERB V Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 1 conj _ SpaceAfter=No
11 . . PUNCT FS _ 1 punct _ _
~~~
~~~ conllu
# visual-style 2 bgColor:blue
# visual-style 2 fgColor:white
# visual-style 5 bgColor:blue
# visual-style 5 fgColor:white
# visual-style 5 2 expl color:blue
1 Spigole spigola NOUN S Gender=Fem|Number=Plur 5 nsubj _ _
2 ce ce PRON PC Clitic=Yes|Number=Plur|Person=1|PronType=Prs 5 expl _ _
3 n' ne PRON PC Clitic=Yes|Number=Plur|Person=3|PronType=Prs 5 expl _ SpaceAfter=No
4 erano essere AUX VA Mood=Ind|Number=Plur|Person=3|Tense=Imp|VerbForm=Fin 5 cop _ _
5 poche poco PRON PI Gender=Fem|Number=Plur|PronType=Ind 0 root _ SpaceAfter=No
6 . . PUNCT FS _ 5 punct _ _
~~~
~~~ conllu
# visual-style 2 bgColor:blue
# visual-style 2 fgColor:white
# visual-style 5 bgColor:blue
# visual-style 5 fgColor:white
# visual-style 5 2 expl color:blue
1 Non non ADV BN PronType=Neg 5 advmod _ _
2 c' ci PRON PC Clitic=Yes|Number=Plur|Person=1|PronType=Prs 5 expl _ SpaceAfter=No
3 è essere AUX VA Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 5 cop _ _
4 dunque dunque ADV B _ 5 advmod _ _
5 dubbio dubbio NOUN S Gender=Masc|Number=Sing 0 root _ _
6 che che SCONJ CS _ 9 mark _ _
7 Marley Marley PROPN SP _ 9 nsubj _ _
8 era essere AUX VA Mood=Ind|Number=Sing|Person=3|Tense=Imp|VerbForm=Fin 9 aux _ _
9 morto morire VERB V Gender=Masc|Number=Sing|Tense=Past|VerbForm=Part 5 acl _ SpaceAfter=No
10 . . PUNCT FS _ 5 punct _ _
~~~
|
UniversalDependencies/docs
|
treebanks/it_vit/it_vit-dep-expl.md
|
Markdown
|
apache-2.0
| 3,423
|
TornadoFaces.declareWidget('List', function() {
var widget;
function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}
this.init = function() {
widget = this;
widget.items = widget.elem.find('ul li');
widget.bindEvents();
};
this.getFilterFn = function() {
var filterFn = widget.conf.filterFn;
if (!filterFn) {
filterFn = function(item, query) {
return item.text().toUpperCase().indexOf(query.toUpperCase()) > -1;
};
widget.conf.filterFn = filterFn;
}
return filterFn;
};
this.setFilterFn = function(filterFn) {
widget.conf.filterFn = filterFn;
};
this.filter = function(query) {
var doHighlight = widget.conf.highlightFilter;
if (!query || query.length == 0 || query === '') {
widget.items.show();
if (doHighlight)
widget.items.unhighlight();
} else {
var filterFn = widget.getFilterFn();
for (var idx = 0; idx < widget.items.length; idx++) {
var item = $(widget.items[idx]);
if (doHighlight)
item.unhighlight();
if (filterFn(item, query, idx)) {
item.show();
if (doHighlight)
item.highlight(query);
} else {
item.hide();
}
}
}
};
this.bindEvents = function() {
widget.items.children('.accordion-title').click(function(event) {
var item = $(this).parent();
var itemIndex = item.index();
widget.select(itemIndex);
event.preventDefault();
return false;
});
}
});
|
edvin/tornadofaces
|
tornadofaces/src/main/resources/META-INF/resources/tornadofaces/list.js
|
JavaScript
|
apache-2.0
| 1,913
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.hyracks.storage.am.lsm.btree;
import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.util.Random;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.api.exceptions.ErrorCode;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.primitive.BooleanPointable;
import org.apache.hyracks.data.std.primitive.IntegerPointable;
import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference;
import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
import org.apache.hyracks.dataflow.common.data.accessors.PermutingTupleReference;
import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
import org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
import org.apache.hyracks.storage.am.btree.OrderedIndexTestContext;
import org.apache.hyracks.storage.am.btree.OrderedIndexTestDriver;
import org.apache.hyracks.storage.am.btree.OrderedIndexTestUtils;
import org.apache.hyracks.storage.am.btree.frames.BTreeLeafFrameType;
import org.apache.hyracks.storage.am.lsm.btree.impls.LSMBTree;
import org.apache.hyracks.storage.am.lsm.btree.util.LSMBTreeTestContext;
import org.apache.hyracks.storage.am.lsm.btree.util.LSMBTreeTestHarness;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexAccessor;
import org.apache.hyracks.storage.common.IIndexCursor;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@SuppressWarnings("rawtypes")
public class LSMBTreeScanDiskComponentsTest extends OrderedIndexTestDriver {
private final OrderedIndexTestUtils orderedIndexTestUtils;
private final LSMBTreeTestHarness harness = new LSMBTreeTestHarness();
public LSMBTreeScanDiskComponentsTest() {
super(LSMBTreeTestHarness.LEAF_FRAMES_TO_TEST);
this.orderedIndexTestUtils = new OrderedIndexTestUtils();
}
@Before
public void setUp() throws HyracksDataException {
harness.setUp();
}
@After
public void tearDown() throws HyracksDataException {
harness.tearDown();
}
@Override
protected OrderedIndexTestContext createTestContext(ISerializerDeserializer[] fieldSerdes, int numKeys,
BTreeLeafFrameType leafType, boolean filtered) throws Exception {
return LSMBTreeTestContext.create(harness.getIOManager(), harness.getVirtualBufferCaches(),
harness.getFileReference(), harness.getDiskBufferCache(), fieldSerdes, numKeys,
harness.getBoomFilterFalsePositiveRate(), harness.getMergePolicy(), harness.getOperationTracker(),
harness.getIOScheduler(), harness.getIOOperationCallbackFactory(),
harness.getPageWriteCallbackFactory(), harness.getMetadataPageManagerFactory(), false, true, false);
}
@Override
protected Random getRandom() {
return harness.getRandom();
}
@Override
protected void runTest(ISerializerDeserializer[] fieldSerdes, int numKeys, BTreeLeafFrameType leafType,
ITupleReference lowKey, ITupleReference highKey, ITupleReference prefixLowKey,
ITupleReference prefixHighKey) throws Exception {
OrderedIndexTestContext ctx = createTestContext(fieldSerdes, numKeys, leafType, false);
ctx.getIndex().create();
ctx.getIndex().activate();
// We assume all fieldSerdes are of the same type. Check the first one
// to determine which field types to generate.
if (fieldSerdes[0] instanceof IntegerSerializerDeserializer) {
test(ctx, fieldSerdes);
} else if (fieldSerdes[0] instanceof UTF8StringSerializerDeserializer) {
test(ctx, fieldSerdes);
}
ctx.getIndex().validate();
ctx.getIndex().deactivate();
ctx.getIndex().destroy();
}
protected void test(OrderedIndexTestContext ctx, ISerializerDeserializer[] fieldSerdes)
throws HyracksDataException {
ILSMIndexAccessor accessor = (ILSMIndexAccessor) ctx.getIndexAccessor();
//component 2 contains 1 and 2
upsertTuple(ctx, fieldSerdes, getValue(1, fieldSerdes));
upsertTuple(ctx, fieldSerdes, getValue(2, fieldSerdes));
accessor.scheduleFlush();
//component 1 contains 1 and -2
upsertTuple(ctx, fieldSerdes, getValue(1, fieldSerdes));
deleteTuple(ctx, fieldSerdes, getValue(2, fieldSerdes));
accessor.scheduleFlush();
//component 0 contains 2 and 3
upsertTuple(ctx, fieldSerdes, getValue(3, fieldSerdes));
upsertTuple(ctx, fieldSerdes, getValue(2, fieldSerdes));
accessor.scheduleFlush();
LSMBTree btree = (LSMBTree) ctx.getIndex();
Assert.assertEquals("Check disk components", 3, btree.getDiskComponents().size());
IIndexCursor cursor = accessor.createSearchCursor(false);
accessor.scanDiskComponents(cursor);
ITupleReference tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 2, false, getValue(1, fieldSerdes));
tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 1, false, getValue(1, fieldSerdes));
tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 2, false, getValue(2, fieldSerdes));
tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 1, true, getValue(2, fieldSerdes));
tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 0, false, getValue(2, fieldSerdes));
tuple = getNext(cursor);
checkReturnedTuple(ctx, tuple, fieldSerdes, 0, false, getValue(3, fieldSerdes));
Assert.assertFalse(cursor.hasNext());
}
protected void checkReturnedTuple(OrderedIndexTestContext ctx, ITupleReference tuple,
ISerializerDeserializer[] fieldSerdes, int componentPos, boolean antimatter, Object value)
throws HyracksDataException {
int actualComponentPos = IntegerPointable.getInteger(tuple.getFieldData(0), tuple.getFieldStart(0));
Assert.assertEquals("Check returned component position", componentPos, actualComponentPos);
boolean actualAntiMatter = BooleanPointable.getBoolean(tuple.getFieldData(1), tuple.getFieldStart(1));
Assert.assertEquals("Check returned anti-matter flag", antimatter, actualAntiMatter);
int[] permutation = new int[ctx.getFieldCount()];
for (int i = 0; i < permutation.length; i++) {
permutation[i] = i + 2;
}
PermutingTupleReference originalTuple = new PermutingTupleReference(permutation);
originalTuple.reset(tuple);
for (int i = 0; i < fieldSerdes.length; i++) {
ByteArrayInputStream inStream = new ByteArrayInputStream(originalTuple.getFieldData(i),
originalTuple.getFieldStart(i), originalTuple.getFieldLength(i));
DataInput dataIn = new DataInputStream(inStream);
Object actualObj = fieldSerdes[i].deserialize(dataIn);
if (!actualObj.equals(value)) {
fail("Actual and expected fields do not match on field " + i + ".\nExpected: " + value + "\nActual : "
+ actualObj);
}
}
}
protected ITupleReference getNext(IIndexCursor cursor) throws HyracksDataException {
Assert.assertTrue(cursor.hasNext());
cursor.next();
return cursor.getTuple();
}
@Override
protected String getTestOpName() {
return "Disk Components Scan";
}
protected void upsertTuple(OrderedIndexTestContext ctx, ISerializerDeserializer[] fieldSerdes, Object value)
throws HyracksDataException {
ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(ctx.getFieldCount());
for (int i = 0; i < ctx.getFieldCount(); i++) {
tupleBuilder.addField(fieldSerdes[i], value);
}
ArrayTupleReference tuple = new ArrayTupleReference();
tuple.reset(tupleBuilder.getFieldEndOffsets(), tupleBuilder.getByteArray());
try {
ctx.getIndexAccessor().upsert(tuple);
} catch (HyracksDataException e) {
if (e.getErrorCode() != ErrorCode.DUPLICATE_KEY) {
throw e;
}
}
}
protected void deleteTuple(OrderedIndexTestContext ctx, ISerializerDeserializer[] fieldSerdes, Object value)
throws HyracksDataException {
ArrayTupleBuilder deletedBuilder = new ArrayTupleBuilder(ctx.getKeyFieldCount());
for (int i = 0; i < ctx.getKeyFieldCount(); i++) {
deletedBuilder.addField(fieldSerdes[i], value);
}
ArrayTupleReference deleteTuple = new ArrayTupleReference();
deleteTuple.reset(deletedBuilder.getFieldEndOffsets(), deletedBuilder.getByteArray());
try {
ctx.getIndexAccessor().delete(deleteTuple);
} catch (HyracksDataException e) {
if (e.getErrorCode() != ErrorCode.DUPLICATE_KEY) {
throw e;
}
}
}
protected Object getValue(Object value, ISerializerDeserializer[] fieldSerdes) {
if (fieldSerdes[0] instanceof IntegerSerializerDeserializer) {
return value;
} else if (fieldSerdes[0] instanceof UTF8StringSerializerDeserializer) {
return String.valueOf(value);
} else {
return null;
}
}
}
|
apache/incubator-asterixdb
|
hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-btree-test/src/test/java/org/apache/hyracks/storage/am/lsm/btree/LSMBTreeScanDiskComponentsTest.java
|
Java
|
apache-2.0
| 10,447
|
using System;
namespace rosidl_generator_cs
{
public interface IMessageCodeGenerator
{
void GenerateCode(MessageDescription description);
string GetGeneratedCode();
bool TestCompileGeneratedCode(string rclcsPath, string[] referencesPaths);
}
}
|
firesurfer/rosidl_generator_cs
|
src/IMessageCodeGenerator.cs
|
C#
|
apache-2.0
| 258
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_181) on Wed Oct 17 12:12:46 PDT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.hungle.sunriise.mnyobject.EnumTransactionState (sunriise-core 0.0.1-SNAPSHOT API)</title>
<meta name="date" content="2018-10-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.hungle.sunriise.mnyobject.EnumTransactionState (sunriise-core 0.0.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/hungle/sunriise/mnyobject/class-use/EnumTransactionState.html" target="_top">Frames</a></li>
<li><a href="EnumTransactionState.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.hungle.sunriise.mnyobject.EnumTransactionState" class="title">Uses of Class<br>com.hungle.sunriise.mnyobject.EnumTransactionState</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.hungle.sunriise.mnyobject">com.hungle.sunriise.mnyobject</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#com.hungle.sunriise.mnyobject.impl">com.hungle.sunriise.mnyobject.impl</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.hungle.sunriise.mnyobject">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a> in <a href="../../../../../com/hungle/sunriise/mnyobject/package-summary.html">com.hungle.sunriise.mnyobject</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/hungle/sunriise/mnyobject/package-summary.html">com.hungle.sunriise.mnyobject</a> that return <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></code></td>
<td class="colLast"><span class="typeNameLabel">Transaction.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/Transaction.html#getState--">getState</a></span>()</code>
<div class="block">Gets the state.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></code></td>
<td class="colLast"><span class="typeNameLabel">EnumTransactionState.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html#valueOf-java.lang.String-">valueOf</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a>[]</code></td>
<td class="colLast"><span class="typeNameLabel">EnumTransactionState.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html#values--">values</a></span>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/hungle/sunriise/mnyobject/package-summary.html">com.hungle.sunriise.mnyobject</a> with parameters of type <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">Transaction.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/Transaction.html#setState-com.hungle.sunriise.mnyobject.EnumTransactionState-">setState</a></span>(<a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a> state)</code>
<div class="block">Sets the state.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="com.hungle.sunriise.mnyobject.impl">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a> in <a href="../../../../../com/hungle/sunriise/mnyobject/impl/package-summary.html">com.hungle.sunriise.mnyobject.impl</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/hungle/sunriise/mnyobject/impl/package-summary.html">com.hungle.sunriise.mnyobject.impl</a> that return <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></code></td>
<td class="colLast"><span class="typeNameLabel">DefaultTransaction.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/impl/DefaultTransaction.html#getState--">getState</a></span>()</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../com/hungle/sunriise/mnyobject/impl/package-summary.html">com.hungle.sunriise.mnyobject.impl</a> with parameters of type <a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">DefaultTransaction.</span><code><span class="memberNameLink"><a href="../../../../../com/hungle/sunriise/mnyobject/impl/DefaultTransaction.html#setState-com.hungle.sunriise.mnyobject.EnumTransactionState-">setState</a></span>(<a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">EnumTransactionState</a> state)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../com/hungle/sunriise/mnyobject/EnumTransactionState.html" title="enum in com.hungle.sunriise.mnyobject">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/hungle/sunriise/mnyobject/class-use/EnumTransactionState.html" target="_top">Frames</a></li>
<li><a href="EnumTransactionState.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018. All rights reserved.</small></p>
</body>
</html>
|
hleofxquotes/mnyjson
|
apidocs/apidocs/com/hungle/sunriise/mnyobject/class-use/EnumTransactionState.html
|
HTML
|
apache-2.0
| 12,244
|
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.activemq.bugs;
import java.io.File;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.ResourceAllocationException;
import javax.jms.Session;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQPrefetchPolicy;
import org.apache.activemq.TestSupport;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.store.kahadb.plist.PListStoreImpl;
import org.apache.activemq.usage.MemoryUsage;
import org.apache.activemq.usage.StoreUsage;
import org.apache.activemq.usage.SystemUsage;
import org.apache.activemq.usage.TempUsage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TempStorageBlockedBrokerTest extends TestSupport {
public int deliveryMode = DeliveryMode.PERSISTENT;
private static final Logger LOG = LoggerFactory.getLogger(TempStorageBlockedBrokerTest.class);
private static final int MESSAGES_COUNT = 1000;
private static byte[] buf = new byte[4 * 1024];
private BrokerService broker;
AtomicInteger messagesSent = new AtomicInteger(0);
AtomicInteger messagesConsumed = new AtomicInteger(0);
protected long messageReceiveTimeout = 10000L;
Destination destination = new ActiveMQTopic("FooTwo");
private String connectionUri;
public void testRunProducerWithHungConsumer() throws Exception {
final long origTempUsage = broker.getSystemUsage().getTempUsage().getUsage();
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectionUri);
// ensure messages are spooled to disk for this consumer
ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
prefetch.setTopicPrefetch(10);
factory.setPrefetchPolicy(prefetch);
Connection consumerConnection = factory.createConnection();
consumerConnection.start();
Session consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = consumerSession.createConsumer(destination);
final Connection producerConnection = factory.createConnection();
producerConnection.start();
final CountDownLatch producerHasSentTenMessages = new CountDownLatch(10);
Thread producingThread = new Thread("Producing thread") {
@Override
public void run() {
try {
Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(destination);
producer.setDeliveryMode(deliveryMode);
for (int idx = 0; idx < MESSAGES_COUNT; ++idx) {
Message message = session.createTextMessage(new String(buf) + idx);
producer.send(message);
messagesSent.incrementAndGet();
producerHasSentTenMessages.countDown();
Thread.sleep(10);
if (idx != 0 && idx%100 == 0) {
LOG.info("Sent Message " + idx);
LOG.info("Temp Store Usage " + broker.getSystemUsage().getTempUsage().getUsage());
}
}
producer.close();
session.close();
} catch (Throwable ex) {
ex.printStackTrace();
}
}
};
producingThread.start();
assertTrue("producer has sent 10 in a reasonable time", producerHasSentTenMessages.await(30, TimeUnit.SECONDS));
int count = 0;
Message m = null;
while ((m = consumer.receive(messageReceiveTimeout)) != null) {
count++;
if (count != 0 && count%10 == 0) {
LOG.info("Received Message (" + count + "):" + m);
}
messagesConsumed.incrementAndGet();
try {
Thread.sleep(100);
} catch (Exception e) {
LOG.info("error sleeping");
}
}
LOG.info("Connection Timeout: Retrying.. count: " + count);
while ((m = consumer.receive(messageReceiveTimeout)) != null) {
count++;
if (count != 0 && count%100 == 0) {
LOG.info("Received Message (" + count + "):" + m);
}
messagesConsumed.incrementAndGet();
try {
Thread.sleep(100);
} catch (Exception e) {
LOG.info("error sleeping");
}
}
LOG.info("consumer session closing: consumed count: " + count);
consumerSession.close();
producingThread.join();
final long tempUsageBySubscription = broker.getSystemUsage().getTempUsage().getUsage();
LOG.info("Orig Usage: " + origTempUsage + ", currentUsage: " + tempUsageBySubscription);
producerConnection.close();
consumerConnection.close();
LOG.info("Subscrition Usage: " + tempUsageBySubscription + ", endUsage: "
+ broker.getSystemUsage().getTempUsage().getUsage());
// do a cleanup
((PListStoreImpl)broker.getTempDataStore()).run();
LOG.info("Subscrition Usage: " + tempUsageBySubscription + ", endUsage: "
+ broker.getSystemUsage().getTempUsage().getUsage());
assertEquals("Incorrect number of Messages Sent: " + messagesSent.get(), messagesSent.get(), MESSAGES_COUNT);
assertEquals("Incorrect number of Messages Consumed: " + messagesConsumed.get(), messagesConsumed.get(),
MESSAGES_COUNT);
}
public void testFillTempAndConsume() throws Exception {
broker.getSystemUsage().setSendFailIfNoSpace(true);
destination = new ActiveMQQueue("Foo");
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectionUri);
final ActiveMQConnection producerConnection = (ActiveMQConnection) factory.createConnection();
// so we can easily catch the ResourceAllocationException on send
producerConnection.setAlwaysSyncSend(true);
producerConnection.start();
Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(destination);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
try {
while (true) {
Message message = session.createTextMessage(new String(buf) + messagesSent.toString());
producer.send(message);
messagesSent.incrementAndGet();
if (messagesSent.get() % 100 == 0) {
LOG.info("Sent Message " + messagesSent.get());
LOG.info("Temp Store Usage " + broker.getSystemUsage().getTempUsage().getUsage());
}
}
} catch (ResourceAllocationException ex) {
LOG.info("Got resource exception : " + ex + ", after sent: " + messagesSent.get());
}
// consume all sent
Connection consumerConnection = factory.createConnection();
consumerConnection.start();
Session consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = consumerSession.createConsumer(destination);
while (consumer.receive(messageReceiveTimeout) != null) {
messagesConsumed.incrementAndGet();
if (messagesConsumed.get() % 1000 == 0) {
LOG.info("received Message " + messagesConsumed.get());
LOG.info("Temp Store Usage " + broker.getSystemUsage().getTempUsage().getUsage());
}
}
assertEquals("Incorrect number of Messages Consumed: " + messagesConsumed.get(), messagesConsumed.get(),
messagesSent.get());
}
@Override
public void setUp() throws Exception {
broker = new BrokerService();
broker.setDataDirectory("target" + File.separator + "activemq-data");
broker.setPersistent(true);
broker.setUseJmx(true);
broker.setAdvisorySupport(false);
broker.setDeleteAllMessagesOnStartup(true);
setDefaultPersistenceAdapter(broker);
SystemUsage sysUsage = broker.getSystemUsage();
MemoryUsage memUsage = new MemoryUsage();
memUsage.setLimit((1024 * 1024));
StoreUsage storeUsage = new StoreUsage();
storeUsage.setLimit((1024 * 1024) * 38);
TempUsage tmpUsage = new TempUsage();
tmpUsage.setLimit((1024 * 1024) * 38);
PolicyEntry defaultPolicy = new PolicyEntry();
// defaultPolicy.setTopic("FooTwo");
defaultPolicy.setProducerFlowControl(false);
defaultPolicy.setMemoryLimit(10 * 1024);
PolicyMap policyMap = new PolicyMap();
policyMap.setDefaultEntry(defaultPolicy);
sysUsage.setMemoryUsage(memUsage);
sysUsage.setStoreUsage(storeUsage);
sysUsage.setTempUsage(tmpUsage);
broker.setDestinationPolicy(policyMap);
broker.setSystemUsage(sysUsage);
broker.addConnector("tcp://localhost:0").setName("Default");
broker.start();
connectionUri = broker.getTransportConnectors().get(0).getPublishableConnectString();
}
@Override
public void tearDown() throws Exception {
if (broker != null) {
broker.stop();
}
}
}
|
rogerchina/activemq-artemis
|
tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/TempStorageBlockedBrokerTest.java
|
Java
|
apache-2.0
| 10,837
|
.send_container {
margin: 12px;
}
.send_input_container {
margin-bottom: 0 !important;
width: 380px !important;
}
.send_input_container_short {
margin-bottom: 0 !important;
width: 325px !important;
}
|
dimorinny/ethereum-erc20-wallet
|
src/containers/send/send.css
|
CSS
|
apache-2.0
| 222
|
This contains the web app. To run a local server, execute this
command:
```bash
mvn package appengine:run
```
|
googleinterns/step62-2020
|
project/README.md
|
Markdown
|
apache-2.0
| 111
|
from .base import Base
from .helper import select_item_by_user
from .actions import Actions
from .browser import Browser
__all__ = ['select_item_by_user', 'Base', 'Actions', 'Browser']
|
yegorshr/CDNetworksAPI
|
cdnetworks/__init__.py
|
Python
|
apache-2.0
| 186
|
/* This file is automatically generated. DO NOT EDIT! */
/* Generated from: NetBSD: mknative-gcc,v 1.70 2013/05/05 07:11:34 skrll Exp */
/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */
#ifndef GCC_TM_H
#define GCC_TM_H
#define TARGET_CPU_DEFAULT (TARGET_CPU_generic)
#ifndef LIBC_GLIBC
# define LIBC_GLIBC 1
#endif
#ifndef LIBC_UCLIBC
# define LIBC_UCLIBC 2
#endif
#ifndef LIBC_BIONIC
# define LIBC_BIONIC 3
#endif
#ifndef NETBSD_ENABLE_PTHREADS
# define NETBSD_ENABLE_PTHREADS
#endif
#ifndef TARGET_BIG_ENDIAN_DEFAULT
# define TARGET_BIG_ENDIAN_DEFAULT 1
#endif
#ifndef TARGET_DEFAULT_FLOAT_ABI
# define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
#endif
#ifdef IN_GCC
# include "options.h"
# include "insn-constants.h"
# include "config/dbxelf.h"
# include "config/elfos.h"
# include "config/netbsd.h"
# include "config/netbsd-stdint.h"
# include "config/netbsd-elf.h"
# include "config/arm/elf.h"
# include "config/arm/aout.h"
# include "config/arm/arm.h"
# include "config/arm/bpabi.h"
# include "config/arm/netbsd-elf.h"
# include "config/arm/netbsd-eabi.h"
# include "config/initfini-array.h"
#endif
#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET
# include "insn-flags.h"
#endif
# include "defaults.h"
#endif /* GCC_TM_H */
|
execunix/vinos
|
external/gpl3/gcc/usr.bin/gcc/arch/earmhfeb/tm.h
|
C
|
apache-2.0
| 1,293
|
# Copyright 2013-2015 ARM Limited
#
# 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.
#
# pylint: disable=W0613,E1101
from __future__ import division
import os
import sys
import time
import csv
import shutil
import threading
import errno
import tempfile
import collections
import re
from distutils.version import LooseVersion
try:
import pandas as pd
except ImportError:
pd = None
from wlauto import Instrument, Parameter, IterationResult
from wlauto.instrumentation import instrument_is_installed
from wlauto.exceptions import (InstrumentError, WorkerThreadError, ConfigError,
DeviceNotRespondingError, TimeoutError)
from wlauto.utils.types import boolean, numeric
from wlauto.utils.fps import (FpsProcessor, SurfaceFlingerFrame, GfxInfoFrame, GFXINFO_EXEMPT,
VSYNC_INTERVAL)
PAUSE_LATENCY = 20
EPSYLON = 0.0001
class FpsInstrument(Instrument):
name = 'fps'
description = """
Measures Frames Per Second (FPS) and associated metrics for a workload.
.. note:: This instrument depends on pandas Python library (which is not part of standard
WA dependencies), so you will need to install that first, before you can use it.
Android L and below use SurfaceFlinger to calculate the FPS data.
Android M and above use gfxinfo to calculate the FPS data.
SurfaceFlinger:
The view is specified by the workload as ``view`` attribute. This defaults
to ``'SurfaceView'`` for game workloads, and ``None`` for non-game
workloads (as for them FPS mesurement usually doesn't make sense).
Individual workloads may override this.
gfxinfo:
The view is specified by the workload as ``package`` attribute.
This is because gfxinfo already processes for all views in a package.
This instrument adds four metrics to the results:
:FPS: Frames Per Second. This is the frame rate of the workload.
:frame_count: The total number of frames rendered during the execution of
the workload.
:janks: The number of "janks" that occured during execution of the
workload. Janks are sudden shifts in frame rate. They result
in a "stuttery" UI. See http://jankfree.org/jank-busters-io
:not_at_vsync: The number of frames that did not render in a single
vsync cycle.
"""
supported_platforms = ['android']
parameters = [
Parameter('drop_threshold', kind=numeric, default=5,
description='Data points below this FPS will be dropped as they '
'do not constitute "real" gameplay. The assumption '
'being that while actually running, the FPS in the '
'game will not drop below X frames per second, '
'except on loading screens, menus, etc, which '
'should not contribute to FPS calculation. '),
Parameter('keep_raw', kind=boolean, default=False,
description='If set to ``True``, this will keep the raw dumpsys output '
'in the results directory (this is maily used for debugging) '
'Note: frames.csv with collected frames data will always be '
'generated regardless of this setting.'),
Parameter('generate_csv', kind=boolean, default=True,
description='If set to ``True``, this will produce temporal fps data '
'in the results directory, in a file named fps.csv '
'Note: fps data will appear as discrete step-like values '
'in order to produce a more meainingfull representation,'
'a rolling mean can be applied.'),
Parameter('crash_check', kind=boolean, default=True,
description="""
Specifies wither the instrument should check for crashed content by examining
frame data. If this is set, ``execution_time`` instrument must also be installed.
The check is performed by using the measured FPS and exection time to estimate the expected
frames cound and comparing that against the measured frames count. The the ratio of
measured/expected is too low, then it is assumed that the content has crashed part way
during the run. What is "too low" is determined by ``crash_threshold``.
.. note:: This is not 100\% fool-proof. If the crash occurs sufficiently close to
workload's termination, it may not be detected. If this is expected, the
threshold may be adjusted up to compensate.
"""),
Parameter('crash_threshold', kind=float, default=0.7,
description="""
Specifies the threshold used to decided whether a measured/expected frames ration indicates
a content crash. E.g. a value of ``0.75`` means the number of actual frames counted is a
quarter lower than expected, it will treated as a content crash.
"""),
Parameter('dumpsys_period', kind=float, default=2, constraint=lambda x: x > 0,
description="""
Specifies the time period between calls to ``dumpsys SurfaceFlinger --latency`` in
seconds when collecting frame data. Using a lower value improves the granularity
of timings when recording actions that take a short time to complete. Note, this
will produce duplicate frame data in the raw dumpsys output, however, this is
filtered out in frames.csv. It may also affect the overall load on the system.
The default value of 2 seconds corresponds with the NUM_FRAME_RECORDS in
android/services/surfaceflinger/FrameTracker.h (as of the time of writing
currently 128) and a frame rate of 60 fps that is applicable to most devices.
"""),
Parameter('force_surfaceflinger', kind=boolean, default=False,
description="""
By default, the method to capture fps data is based on Android version.
If this is set to true, force the instrument to use the SurfaceFlinger method
regardless of its Android version.
"""),
]
def __init__(self, device, **kwargs):
super(FpsInstrument, self).__init__(device, **kwargs)
self.collector = None
self.outfile = None
self.fps_outfile = None
self.is_enabled = True
self.fps_method = ''
def validate(self):
if not pd or LooseVersion(pd.__version__) < LooseVersion('0.13.1'):
message = ('fps instrument requires pandas Python package (version 0.13.1 or higher) to be installed.\n'
'You can install it with pip, e.g. "sudo pip install pandas"')
raise InstrumentError(message)
if self.crash_check and not instrument_is_installed('execution_time'):
raise ConfigError('execution_time instrument must be installed in order to check for content crash.')
def setup(self, context):
workload = context.workload
if hasattr(workload, 'view'):
self.fps_outfile = os.path.join(context.output_directory, 'fps.csv')
self.outfile = os.path.join(context.output_directory, 'frames.csv')
# Android M brings a new method of collecting FPS data
if not self.force_surfaceflinger and (self.device.get_sdk_version() >= 23):
# gfxinfo takes in the package name rather than a single view/activity
# so there is no 'list_command' to run and compare against a list of
# views/activities. Additionally, clearing the stats requires the package
# so we need to clear for every package in the workload.
# Usually there is only one package, but some workloads may run multiple
# packages so each one must be reset before continuing
self.fps_method = 'gfxinfo'
runcmd = 'dumpsys gfxinfo {} framestats'
lstcmd = None
params = workload.package
params = [params] if isinstance(params, basestring) else params
for pkg in params:
self.device.execute('dumpsys gfxinfo {} reset'.format(pkg))
else:
self.fps_method = 'surfaceflinger'
runcmd = 'dumpsys SurfaceFlinger --latency {}'
lstcmd = 'dumpsys SurfaceFlinger --list'
params = workload.view
self.device.execute('dumpsys SurfaceFlinger --latency-clear ')
self.collector = LatencyCollector(self.outfile, self.device, params or '',
self.keep_raw, self.logger, self.dumpsys_period,
runcmd, lstcmd, self.fps_method)
else:
self.logger.debug('Workload does not contain a view; disabling...')
self.is_enabled = False
def start(self, context):
if self.is_enabled:
self.logger.debug('Starting Frame Statistics collection...')
self.collector.start()
def stop(self, context):
if self.is_enabled and self.collector.is_alive():
self.logger.debug('Stopping Frame Statistics collection...')
self.collector.stop()
def update_result(self, context):
if self.is_enabled:
fps, frame_count, janks, not_at_vsync = float('nan'), 0, 0, 0
p90, p95, p99 = [float('nan')] * 3
data = pd.read_csv(self.outfile)
if not data.empty: # pylint: disable=maybe-no-member
# gfxinfo method has an additional file generated that contains statistics
stats_file = None
if self.fps_method == 'gfxinfo':
stats_file = os.path.join(os.path.dirname(self.outfile), 'gfxinfo.csv')
fp = FpsProcessor(data, extra_data=stats_file)
per_frame_fps, metrics = fp.process(self.collector.refresh_period, self.drop_threshold)
fps, frame_count, janks, not_at_vsync = metrics
if self.generate_csv:
per_frame_fps.to_csv(self.fps_outfile, index=False, header=True)
context.add_artifact('fps', path='fps.csv', kind='data')
p90, p95, p99 = fp.percentiles()
context.result.add_metric('FPS', fps)
context.result.add_metric('frame_count', frame_count)
context.result.add_metric('janks', janks, lower_is_better=True)
context.result.add_metric('not_at_vsync', not_at_vsync, lower_is_better=True)
context.result.add_metric('frame_time_90percentile', p90, 'ms', lower_is_better=True)
context.result.add_metric('frame_time_95percentile', p95, 'ms', lower_is_better=True)
context.result.add_metric('frame_time_99percentile', p99, 'ms', lower_is_better=True)
def slow_update_result(self, context):
result = context.result
if self.crash_check and result.has_metric('execution_time'):
self.logger.debug('Checking for crashed content.')
exec_time = result['execution_time'].value
fps = result['FPS'].value
frames = result['frame_count'].value
if all([exec_time, fps, frames]):
expected_frames = fps * exec_time
ratio = frames / expected_frames
self.logger.debug('actual/expected frames: {:.2}'.format(ratio))
if ratio < self.crash_threshold:
self.logger.error('Content for {} appears to have crashed.'.format(context.spec.label))
result.status = IterationResult.FAILED
result.add_event('Content crash detected (actual/expected frames: {:.2}).'.format(ratio))
class LatencyCollector(threading.Thread):
# Note: the size of the frames buffer for a particular surface is defined
# by NUM_FRAME_RECORDS inside android/services/surfaceflinger/FrameTracker.h.
# At the time of writing, this was hard-coded to 128. So at 60 fps
# (and there is no reason to go above that, as it matches vsync rate
# on pretty much all phones), there is just over 2 seconds' worth of
# frames in there. Hence the default sleep time of 2 seconds between dumps.
def __init__(self, outfile, device, activities, keep_raw, logger, dumpsys_period,
run_command, list_command, fps_method):
super(LatencyCollector, self).__init__()
self.outfile = outfile
self.device = device
self.keep_raw = keep_raw
self.logger = logger
self.dumpsys_period = dumpsys_period
self.stop_signal = threading.Event()
self.frames = []
self.last_ready_time = 0
self.refresh_period = VSYNC_INTERVAL
self.drop_threshold = self.refresh_period * 1000
self.exc = None
self.unresponsive_count = 0
if isinstance(activities, basestring):
activities = [activities]
self.activities = activities
self.command_template = run_command
self.list_command = list_command
self.fps_method = fps_method
# Based on the fps_method, setup the header for the csv,
# and set the process_trace_line function accordingly
if fps_method == 'surfaceflinger':
self.header = SurfaceFlingerFrame._fields
self.process_trace_line = self._process_surfaceflinger_line
else:
self.header = GfxInfoFrame._fields
self.process_trace_line = self._process_gfxinfo_line
self.re_frame = re.compile('([0-9]+,)+')
self.re_stats = re.compile('.*(percentile|frames|Number).*')
# Create a template summary text block that matches what gfxinfo gives after a reset
# - 133 is the default ms value for percentiles after reset
self.summary = collections.OrderedDict((('Total frames rendered', 0),
('Janky frames', 0),
('90th percentile', 133),
('95th percentile', 133),
('99th percentile', 133),
('Number Missed Vsync', 0),
('Number High input latency', 0),
('Number Slow UI thread', 0),
('Number Slow bitmap uploads', 0),
('Number Slow issue draw commands', 0)))
def run(self):
try:
self.logger.debug('Frame Statistics collection started. Method: ' + self.fps_method)
self.stop_signal.clear()
fd, temp_file = tempfile.mkstemp()
self.logger.debug('temp file: {}'.format(temp_file))
wfh = os.fdopen(fd, 'wb')
try:
view_list = self.activities
while not self.stop_signal.is_set():
# If a list_command is provided, set the view_list to be its output
# Then check for each activity in this list and if there is a match,
# process the output. If no command is provided, then always process.
if self.list_command:
view_list = self.device.execute(self.list_command).split()
for activity in self.activities:
if activity in view_list:
wfh.write(self.device.execute(self.command_template.format(activity)))
time.sleep(self.dumpsys_period)
finally:
wfh.close()
# TODO: this can happen after the run during results processing
with open(temp_file) as fh:
text = fh.read().replace('\r\n', '\n').replace('\r', '\n')
for line in text.split('\n'):
line = line.strip()
if line:
self.process_trace_line(line)
if self.keep_raw:
raw_file = os.path.join(os.path.dirname(self.outfile), self.fps_method + '.raw')
shutil.copy(temp_file, raw_file)
os.unlink(temp_file)
except (DeviceNotRespondingError, TimeoutError): # pylint: disable=W0703
raise
except Exception, e: # pylint: disable=W0703
self.logger.warning('Exception on collector thread: {}({})'.format(e.__class__.__name__, e))
self.exc = WorkerThreadError(self.name, sys.exc_info())
self.logger.debug('Frame Statistics collection stopped.')
with open(self.outfile, 'w') as wfh:
writer = csv.writer(wfh)
writer.writerow(self.header)
writer.writerows(self.frames)
self.logger.debug('Frames data written.')
# gfxinfo outputs its own summary statistics for the run.
# No point calculating those from the raw data, so store in its own file for later use.
if self.fps_method == 'gfxinfo':
stats_file = os.path.join(os.path.dirname(self.outfile), 'gfxinfo.csv')
with open(stats_file, 'w') as wfh:
writer = csv.writer(wfh)
writer.writerows(zip(self.summary.keys(), self.summary.values()))
self.logger.debug('Gfxinfo summary data written.')
def stop(self):
self.stop_signal.set()
self.join()
if self.unresponsive_count:
message = 'LatencyCollector was unrepsonsive {} times.'.format(self.unresponsive_count)
if self.unresponsive_count > 10:
self.logger.warning(message)
else:
self.logger.debug(message)
if self.exc:
raise self.exc # pylint: disable=E0702
self.logger.debug('Frame Statistics complete.')
def _process_surfaceflinger_line(self, line):
parts = line.split()
if len(parts) == 3:
frame = SurfaceFlingerFrame(*map(int, parts))
if frame.frame_ready_time <= self.last_ready_time:
return # duplicate frame
if (frame.frame_ready_time - frame.desired_present_time) > self.drop_threshold:
self.logger.debug('Dropping bogus frame {}.'.format(line))
return # bogus data
self.last_ready_time = frame.frame_ready_time
self.frames.append(frame)
elif len(parts) == 1:
self.refresh_period = int(parts[0])
self.drop_threshold = self.refresh_period * 1000
elif 'SurfaceFlinger appears to be unresponsive, dumping anyways' in line:
self.unresponsive_count += 1
else:
self.logger.warning('Unexpected SurfaceFlinger dump output: {}'.format(line))
def _process_gfxinfo_line(self, line):
if 'No process found for' in line:
self.unresponsive_count += 1
return
# Process lines related to the frame data
match = self.re_frame.match(line)
if match:
data = match.group(0)[:-1]
data = map(int, data.split(','))
frame = GfxInfoFrame(*data)
if frame not in self.frames:
if frame.Flags & GFXINFO_EXEMPT:
self.logger.debug('Dropping exempt frame {}.'.format(line))
else:
self.frames.append(frame)
return
# Process lines related to the summary statistics
match = self.re_stats.match(line)
if match:
data = match.group(0)
title, value = data.split(':', 1)
title = title.strip()
value = value.strip()
if title in self.summary:
if 'ms' in value:
value = value.strip('ms')
if '%' in value:
value = value.split()[0]
self.summary[title] = int(value)
|
Sticklyman1936/workload-automation
|
wlauto/instrumentation/fps/__init__.py
|
Python
|
apache-2.0
| 21,087
|
package com.xiaoneiit.definition;
import java.util.HashMap;
import android.util.Log;
import com.xiaoneiit.hotballon.R;
public class Popo {
static String tag = "Popo";
static HashMap<Integer, Integer> popos = new HashMap<Integer, Integer>();
static{
popos.put(0, R.drawable.popo1);
popos.put(1, R.drawable.popo2);
popos.put(2, R.drawable.popo3);
popos.put(3, R.drawable.popo4);
popos.put(4, R.drawable.popo5);
}
public static int getPopo(int index){
return popos.get(index);
}
public static int getSize(){
return popos.size();
}
}
|
HiCubee/hotballon-olla-imiu
|
HotBallon/src/com/xiaoneiit/definition/Popo.java
|
Java
|
apache-2.0
| 564
|
/*
Copyright 2018 Google Inc. 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.
*/
#include "platforms/wwise/wwise_room_effects_fx.h"
#include <vector>
#include "Eigen/Dense"
#include "AK/Tools/Common/AkAssert.h"
#include "platforms/common/room_effects_utils.h"
#include "platforms/common/utils.h"
#include "platforms/wwise/wwise_common.h"
#include "platforms/wwise/wwise_fx_null_params.h"
#include "platforms/wwise/wwise_room_effects_fx_attachment_params.h"
namespace vraudio {
namespace wwise {
namespace {
// |ResonanceAudioSystem| to communicate with the internal API.
static ResonanceAudioSystem* resonance_audio = nullptr;
// Additional data that needs to be stored per each input source.
struct SourceData {
// Source id.
int id;
};
// Returns the transformation matrix from the given Wwise vectors.
//
// @param position Wwise position vector.
// @param forward Wwise forward vector.
// @param up Wwise up vector.
// @return A 4x4 transformation matrix.
Eigen::Matrix4f GetTransformMatrixFromWwise(const AkVector& wwise_position,
const AkVector& wwise_forward,
const AkVector& wwise_up) {
const Eigen::Vector3f position(wwise_position.X, wwise_position.Y,
wwise_position.Z);
const Eigen::Vector3f forward(wwise_forward.X, wwise_forward.Y,
wwise_forward.Z);
const Eigen::Vector3f up(wwise_up.X, wwise_up.Y, wwise_up.Z);
return GetTransformMatrix(position, forward, up);
}
// Returns piecewise sum of two vectors.
//
// @param lhs First vector to be summed.
// @param rhs Second vector to be summed.
// @return Sum of two vectors.
AkVector VectorSum(const AkVector& lhs, const AkVector& rhs) {
return AkVector{lhs.X + rhs.X, lhs.Y + rhs.Y, lhs.Z + rhs.Z};
}
// Wwise host callback method that registers the mixer plugin.
AK::IAkPlugin* CreateResonanceAudioRoomEffectsFX(
AK::IAkPluginMemAlloc* memory_allocator) {
AKASSERT(memory_allocator != nullptr);
return AK_PLUGIN_NEW(memory_allocator, WwiseRoomEffectsFx());
}
// Wwise host callback method that registers the mixer plugin attachment
// parameter node.
AK::IAkPluginParam* CreateResonanceAudioRoomEffectsFXAttachmentParams(
AK::IAkPluginMemAlloc* memory_allocator) {
AKASSERT(memory_allocator != nullptr);
return AK_PLUGIN_NEW(memory_allocator, WwiseRoomEffectsFxAttachmentParams());
}
// Wwise host callback method that registers the mixer plugin parameter node.
AK::IAkPluginParam* CreateResonanceAudioRoomEffectsFXParams(
AK::IAkPluginMemAlloc* memory_allocator) {
AKASSERT(memory_allocator != nullptr);
// The room effects plugin does not expose any parameters.
return AK_PLUGIN_NEW(memory_allocator, WwiseFxNullParams());
}
// Wwise global registration callback that is called by the sound engine.
void RegisterResonanceAudioRoomEffectsFX(
AK::IAkGlobalPluginContext* plugin_context,
AkGlobalCallbackLocation callback_location, void* cookie) {
if (callback_location == AkGlobalCallbackLocation_Register) {
if (resonance_audio == nullptr) {
// Initialize the ResonanceAudio system.
resonance_audio = new ResonanceAudioSystem();
const size_t frames_per_buffer =
static_cast<size_t>(plugin_context->GetMaxBufferLength());
const int sample_rate = static_cast<int>(plugin_context->GetSampleRate());
resonance_audio->api.reset(CreateResonanceAudioApi(
kNumStereoChannels, frames_per_buffer, sample_rate));
}
++resonance_audio->num_instances;
// Register shutdown callback.
plugin_context->RegisterGlobalCallback(RegisterResonanceAudioRoomEffectsFX,
AkGlobalCallbackLocation_Term,
nullptr);
} else if (callback_location == AkGlobalCallbackLocation_Term) {
AKASSERT(resonance_audio != nullptr);
--resonance_audio->num_instances;
if (resonance_audio->num_instances == 0) {
// Shutdown the ResonanceAudio system.
delete resonance_audio;
resonance_audio = nullptr;
}
}
}
} // namespace
// Plugin mechanism. Instantiation methods that must be registered to the plugin
// manager.
AK::PluginRegistration ResonanceAudioRoomEffectsFXRegistration(
AkPluginTypeMixer, kCompanyId, kRoomEffectsPluginId,
CreateResonanceAudioRoomEffectsFX, CreateResonanceAudioRoomEffectsFXParams,
RegisterResonanceAudioRoomEffectsFX, nullptr);
AK::PluginRegistration ResonanceAudioRoomEffectsFXAttachmentRegistration(
AkPluginTypeEffect, kCompanyId, kRoomEffectsAttachmentPluginId, nullptr,
CreateResonanceAudioRoomEffectsFXAttachmentParams);
WwiseRoomEffectsFx::WwiseRoomEffectsFx()
: memory_allocator_(nullptr),
plugin_context_(nullptr),
instance_id_(kInvalidInstanceId) {}
AKRESULT WwiseRoomEffectsFx::Init(AK::IAkPluginMemAlloc* memory_allocator,
AK::IAkMixerPluginContext* plugin_context,
AK::IAkPluginParam* plugin_params,
AkAudioFormat& audio_format) {
if (instance_id_ == kInvalidInstanceId) {
// Assign a new id for the plugin instance.
instance_id_ = resonance_audio->instance_id_counter;
resonance_audio->instance_ids.push_back(instance_id_);
++resonance_audio->instance_id_counter;
}
memory_allocator_ = memory_allocator;
plugin_context_ = plugin_context;
// Set output channel config to stereo.
audio_format.channelConfig.SetStandard(AK_SPEAKER_SETUP_STEREO);
return AK_Success;
}
AKRESULT WwiseRoomEffectsFx::Term(AK::IAkPluginMemAlloc* memory_allocator) {
if (instance_id_ != kInvalidInstanceId) {
// Remove the plugin instance id.
resonance_audio->instance_ids.remove(instance_id_);
instance_id_ = kInvalidInstanceId;
}
// Effect must delete itself.
AK_PLUGIN_DELETE(memory_allocator, this);
return AK_Success;
}
AKRESULT WwiseRoomEffectsFx::Reset() { return AK_Success; }
AKRESULT WwiseRoomEffectsFx::GetPluginInfo(AkPluginInfo& plugin_info) {
plugin_info.eType = AkPluginTypeMixer;
plugin_info.bIsInPlace = false;
plugin_info.uBuildVersion = AK_WWISESDK_VERSION_COMBINED;
return AK_Success;
}
void WwiseRoomEffectsFx::OnInputConnected(
AK::IAkMixerInputContext* input_context) {
if (input_context->GetUserData() == nullptr) {
SourceData* source_data = AK_PLUGIN_NEW(memory_allocator_, SourceData());
source_data->id = resonance_audio->api->CreateSoundObjectSource(
RenderingMode::kRoomEffectsOnly);
input_context->SetUserData(source_data);
}
}
void WwiseRoomEffectsFx::OnInputDisconnected(
AK::IAkMixerInputContext* input_context) {
SourceData* source_data =
reinterpret_cast<SourceData*>(input_context->GetUserData());
if (source_data != nullptr) {
resonance_audio->api->DestroySource(source_data->id);
AK_PLUGIN_DELETE(memory_allocator_, source_data);
}
}
void WwiseRoomEffectsFx::ConsumeInput(AK::IAkMixerInputContext* input_context,
AkRamp base_volume,
AkRamp emitter_listener_volume,
AkAudioBuffer* input,
AkAudioBuffer* mix) {
AKASSERT(!resonance_audio->instance_ids.empty());
if (instance_id_ != resonance_audio->instance_ids.back()) {
// Skip processing if there is a newer instance running.
input->uValidFrames = 0;
return;
}
if (input->uValidFrames == 0) {
// No input buffer to consume, skip processing.
return;
}
const size_t input_num_channels = static_cast<size_t>(input->NumChannels());
AKASSERT(input_num_channels <= kNumStereoChannels);
// Pad the input buffer with zeros if necessary.
const AkUInt16 num_frames = input->MaxFrames();
input->ZeroPadToMaxFrames();
// Retrieve input source data.
SourceData* source_data =
reinterpret_cast<SourceData*>(input_context->GetUserData());
if (source_data == nullptr) {
// Return if the sound object was not initialized properly.
return;
}
const int source_id = source_data->id;
AKASSERT(source_id != ResonanceAudioApi::kInvalidSourceId);
// Set sound object properties.
if (input_context->GetNum3DPositions() > 0) {
// Set input gain.
resonance_audio->api->SetSourceVolume(source_id, base_volume.fNext);
// Set position.
AkEmitterListenerPair emitter_listener;
input_context->Get3DPosition(0, emitter_listener);
const AkVector source_position = VectorSum(
listener_transform_.Position(), emitter_listener.emitter.Position());
// Flip Z-axis to convert from left-handed to right-handed.
resonance_audio->api->SetSourcePosition(
source_id, source_position.X, source_position.Y, -source_position.Z);
// Set distance attenuation.
AkReal32 max_distance;
input_context->GetMaxAttenuationDistance(max_distance);
resonance_audio->api->SetSourceDistanceModel(
source_id, DistanceRolloffModel::kNone, 0.0f, max_distance);
AkReal32 distance_attenuation = emitter_listener.GetGainForConnectionType(
input_context->GetConnectionType());
resonance_audio->api->SetSourceDistanceAttenuation(source_id,
distance_attenuation);
// Set room effects gain.
float room_effects_gain = 0.0f;
const auto params = reinterpret_cast<WwiseRoomEffectsFxAttachmentParams*>(
input_context->GetInputParam());
if (params != nullptr && !params->bypass()) {
void* room_data = nullptr;
AkUInt32 room_data_size = 0;
plugin_context_->GetPluginCustomGameData(room_data, room_data_size);
if (room_data != nullptr) {
AKASSERT(room_data_size == sizeof(RoomProperties));
auto* room = reinterpret_cast<RoomProperties*>(room_data);
room_effects_gain = ComputeRoomEffectsGain(
WorldPosition(source_position.X, source_position.Y,
source_position.Z),
WorldPosition(room->position), WorldRotation(room->rotation),
WorldPosition(room->dimensions));
}
}
resonance_audio->api->SetSourceRoomEffectsGain(source_id,
room_effects_gain);
// Update listener transform where available.
AkListener listener;
if (input_context->GetVoiceInfo()->GetListenerData(
emitter_listener.ListenerID(), listener)) {
listener_transform_ = listener.position;
}
}
// Set the input buffer.
const auto input_channel_ptrs =
GetChannelPointerArrayFromAkAudioBuffer<const float*>(input);
resonance_audio->api->SetPlanarBuffer(source_id, input_channel_ptrs.data(),
input_num_channels, num_frames);
input->uValidFrames = 0;
mix->uValidFrames = num_frames;
}
void WwiseRoomEffectsFx::OnMixDone(AkAudioBuffer* mix) {
AKASSERT(!resonance_audio->instance_ids.empty());
if (instance_id_ != resonance_audio->instance_ids.back()) {
// Skip processing if there is a newer instance running.
mix->uValidFrames = 0;
mix->eState = AK_NoMoreData;
return;
}
const size_t num_channels = static_cast<size_t>(mix->NumChannels());
AKASSERT(num_channels == kNumStereoChannels);
const AkUInt16 num_frames = mix->MaxFrames();
// Calculate the listener transform matrix.
Eigen::Matrix4f transform_matrix = GetTransformMatrixFromWwise(
listener_transform_.Position(), listener_transform_.OrientationFront(),
listener_transform_.OrientationTop());
// Switch to right-handed coordinate system (Wwise is left-handed).
FlipZAxis(&transform_matrix);
// Set listener transform.
const Eigen::Vector3f position = GetPosition(transform_matrix);
const Eigen::Quaternionf rotation = GetQuaternion(transform_matrix);
resonance_audio->api->SetHeadPosition(position.x(), position.y(),
position.z());
resonance_audio->api->SetHeadRotation(rotation.x(), rotation.y(),
rotation.z(), rotation.w());
// Set room properties.
void* room_data = nullptr;
AkUInt32 room_data_size = 0;
plugin_context_->GetPluginCustomGameData(room_data, room_data_size);
if (room_data == nullptr) {
resonance_audio->api->SetReflectionProperties(null_reflection_properties_);
resonance_audio->api->SetReverbProperties(null_reverb_properties_);
} else {
AKASSERT(room_data_size == sizeof(RoomProperties));
auto* room = reinterpret_cast<RoomProperties*>(room_data);
resonance_audio->api->SetReflectionProperties(
ComputeReflectionProperties(*room));
resonance_audio->api->SetReverbProperties(ComputeReverbProperties(*room));
}
// Fill the output buffer.
const auto mix_channel_ptrs =
GetChannelPointerArrayFromAkAudioBuffer<float*>(mix);
if (resonance_audio->api->FillPlanarOutputBuffer(num_channels, num_frames,
mix_channel_ptrs.data())) {
// Update the output state to continue processing.
mix->uValidFrames = num_frames;
mix->eState = AK_DataReady;
} else {
// No valid output was rendered, the effect is done.
mix->uValidFrames = 0;
mix->eState = AK_NoMoreData;
}
}
void WwiseRoomEffectsFx::OnEffectsProcessed(AkAudioBuffer* mix) {}
void WwiseRoomEffectsFx::OnFrameEnd(AkAudioBuffer* mix,
AK::IAkMetering* metering) {}
} // namespace wwise
} // namespace vraudio
|
resonance-audio/resonance-audio
|
platforms/wwise/wwise_room_effects_fx.cc
|
C++
|
apache-2.0
| 14,080
|
# AUTOGENERATED FILE
FROM balenalib/asus-tinker-board-debian:buster-run
ENV NODE_VERSION 10.23.1
ENV YARN_VERSION 1.22.4
RUN buildDeps='curl libatomic1' \
&& set -x \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" \
&& echo "8f965f2757efcf3077d655bfcea36f7a29c58958355e0eb23cfb725740c3ccbe node-v$NODE_VERSION-linux-armv7l.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-armv7l.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Buster \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v10.23.1, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh
|
nghiant2710/base-images
|
balena-base-images/node/asus-tinker-board/debian/buster/10.23.1/run/Dockerfile
|
Dockerfile
|
apache-2.0
| 2,949
|
# AUTOGENERATED FILE
FROM balenalib/raspberry-pi2-alpine:3.12-run
# remove several traces of python
RUN apk del python*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apk add --no-cache ca-certificates libffi \
&& apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
# point Python at a system-provided certificate database. Otherwise, we might hit CERTIFICATE_VERIFY_FAILED.
# https://www.python.org/dev/peps/pep-0476/#trust-database
ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
ENV PYTHON_VERSION 3.5.10
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.0.1
ENV SETUPTOOLS_VERSION 56.0.0
RUN set -x \
&& buildDeps=' \
curl \
gnupg \
' \
&& apk add --no-cache --virtual .build-deps $buildDeps \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-alpine-armv7hf-openssl1.1.tar.gz" \
&& echo "85b19d06c1c69acbc9e01d19a13dc157b7c16c1bba5a600d2728456a8741d29e Python-$PYTHON_VERSION.linux-alpine-armv7hf-openssl1.1.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-openssl1.1.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-openssl1.1.tar.gz" \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.12 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.5.10, Pip v21.0.1, Setuptools v56.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh
|
nghiant2710/base-images
|
balena-base-images/python/raspberry-pi2/alpine/3.12/3.5.10/run/Dockerfile
|
Dockerfile
|
apache-2.0
| 4,135
|
/*
* Copyright 2013 University of Glasgow.
*
* 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 broadwick.utils;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
/**
* HashMap compatible Pair class (i.e. a
* <code>Collection</code> that stores exactly 2 non-null objects and is not mutable). They respect
* <code>equals</code> and may be used as indices or map keys. <p> Note that they do not protect from malevolent
* behavior: if one or another object in the tuple is mutable, then it can be changed with the usual bad effects.
* <p/>
* @param <A> the type of the first element in pair.
* @param <B> the type of the second element in the pair.
*/
@EqualsAndHashCode
public class Pair<A, B> {
@Getter
@Setter
private A first;
@Getter
@Setter
private B second;
/**
* Create the pair object with the given coordinates.
* @param first the first element in the pair
* @param second the second element in the pair
*/
public Pair(final A first, final B second) {
if (first == null || second == null) {
throw new IllegalArgumentException("Pair cannot contain null values");
}
this.first = first;
this.second = second;
}
/**
* Generate a string describing this pair object.
* @return the description of this object.
*/
@Override
public final String toString() {
final StringBuilder sb = new StringBuilder();
sb.append('<').append(first);
sb.append(':');
sb.append(second).append('>');
return sb.toString();
}
}
|
EPICScotland/Broadwick
|
Broadwick1.1/src/main/java/broadwick/utils/Pair.java
|
Java
|
apache-2.0
| 2,136
|
/*
* Copyright 2013 The Ehensin Project
*
* The Ehensin Project licenses this file to you 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.ehensin.tunnel.client.tunnel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ehensin.tunnel.client.ErrorCodeEnum;
import com.ehensin.tunnel.client.channel.ChannelConfig;
import com.ehensin.tunnel.client.channel.ChannelException;
import com.ehensin.tunnel.client.channel.ChannelHelper;
import com.ehensin.tunnel.client.channel.ChannelStatus;
import com.ehensin.tunnel.client.channel.TunnelChannel;
import com.ehensin.tunnel.client.event.EventDispatcher;
import com.ehensin.tunnel.client.event.EventTypeEnum;
import com.ehensin.tunnel.client.info.IInfoCollect;
import com.ehensin.tunnel.client.info.InfoHub;
import com.ehensin.tunnel.client.info.InfoItem;
import com.ehensin.tunnel.client.locator.GradeEnum;
import com.ehensin.tunnel.client.locator.HashLocator;
import com.ehensin.tunnel.client.locator.IGradeSupport;
import com.ehensin.tunnel.client.locator.INameSupport;
import com.ehensin.tunnel.client.locator.Locator;
import com.ehensin.tunnel.client.locator.LocatorAlgEnum;
import com.ehensin.tunnel.client.locator.NameLocator;
import com.ehensin.tunnel.client.locator.RRLocator;
import com.ehensin.tunnel.client.profile.LocatorPolicy;
import com.ehensin.tunnel.client.profile.TunnelProfile;
import com.ehensin.tunnel.client.protocol.MsgProtocol;
import com.ehensin.tunnel.client.protocol.MsgRepProtocol;
import com.ehensin.tunnel.client.statistic.TunnelStatisticIntercepter;
/*
* tunnel is a point to point communication line. one tunnel has some channels, which is a socket connection.
* tunnel support grade manager:
* 1. when tunnel cannot locate a channel, tunnel's grade will be down. or up
* 2. when tunnel reaches the follow control point, tunnel's grade will be down. or up
* */
public class Tunnel implements INameSupport, IGradeSupport, IInfoCollect{
private static final Logger logger = LoggerFactory
.getLogger(Tunnel.class);
/*tunnel profile*/
private TunnelProfile profile;
/*tunnel id*/
private long id;
/*tunnel name*/
private String name;
/*remote ip*/
private String remoteIp;
private int remotePort;
/*tunnel grade*/
private GradeEnum grade;
private InfoItem info;
/*tunnel intercepter*/
private List<ITunnelIntercepter> intercepters;
/*channel locator*/
private Locator<TunnelChannel> channelLocator;
/*all channels */
private List<TunnelChannel> channels;
/* schedule service for renew invalid channel */
private ScheduledExecutorService renewChannleService;
private TunnelFlowControllerIntercepter flowController;
private TunnelStatisticIntercepter statistic;
public Tunnel(long id, String name, String ip, int port, TunnelProfile profile){
this.id = id;
this.name = name;
this.profile = profile;
this.grade = GradeEnum.Normal;
this.remoteIp = ip;
this.remotePort = port;
/*init info*/
this.info = new InfoItem("tunnel", name + id);
Map<String, String> infoMap = new HashMap<String, String>();
infoMap.put("total", "0");
infoMap.put("day", "0");
infoMap.put("hour", "0");
infoMap.put("avg", "0");
infoMap.put("grade", grade.getDes());
this.info.setInfo(infoMap);
InfoHub.getInfoHub().register(this);
this.intercepters = new ArrayList<ITunnelIntercepter>();
/*add statistic intercepter*/
statistic = new TunnelStatisticIntercepter(name + id);
this.intercepters.add(statistic);
/*add flow controller intercepter*/
if( profile.getPolicy().getFlowControl().getSwich().equalsIgnoreCase("on") ){
flowController = new TunnelFlowControllerIntercepter(profile.getPolicy().getFlowControl().getMaxtps());
this.intercepters.add(flowController);
}
/*initialize channel*/
int channelCount = this.profile.getPolicy().getSocket().getSize();
ChannelConfig config = getChannelConfig(profile, ip, port);
if( logger.isDebugEnabled() ){
logger.debug("init channels, count : {}", channelCount);
}
channels = new ArrayList<TunnelChannel>();
for( int i = 0 ; i < channelCount; i++) {
TunnelChannel channel = ChannelHelper.buildChannel(this.id,config);
/*if channel status is not connected, set the channel grade to bad*/
if( channel.getStatus() != ChannelStatus.Normal ){
channel.setGrade(GradeEnum.Bad);
}
channels.add(channel);
}
/*init locator*/
initLocator(channels);
/*init intercepters*/
initIntercepters(this.profile.getPolicy().getInterceptors());
/*register grade event */
if( this.channelLocator instanceof IGradeSupport )
EventDispatcher.getInstance().register(EventTypeEnum.CHANNEL_GRADE, this.channelLocator);
/*schedule to renew invalid channel*/
renewChannleService = Executors.newScheduledThreadPool(1);
renewChannleService.scheduleAtFixedRate(new RenewTask(), 5, 6,
TimeUnit.SECONDS);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemoteIp() {
return remoteIp;
}
public void setRemoteIp(String remoteIp) {
this.remoteIp = remoteIp;
}
public int getRemotePort() {
return remotePort;
}
public void setRemotePort(int remotePort) {
this.remotePort = remotePort;
}
public TunnelProfile getTunnelProfile(){
return this.profile;
}
public TunnelResponse invoke(TunnelRequest req){
/*previous invoke*/
for(ITunnelIntercepter intercepter : intercepters){
boolean b = intercepter.preInvoke(req);
if( !b ){
if( intercepter instanceof TunnelFlowControllerIntercepter){
/*flow control will make this tunnel grade to low,but not to bad */
GradeEnum g = this.grade.down(this.grade);
if( g.getGrade() == GradeEnum.Bad.getGrade() )
g = GradeEnum.Low;
this.setGrade(g);
return new TunnelResponse(req.getMsgProtocal().getMsgHeader().getMsgId(), false, ErrorCodeEnum.TunnelFlowControl,
"flow control" , null);
}
return new TunnelResponse(req.getMsgProtocal().getMsgHeader().getMsgId(), false, ErrorCodeEnum.TunnelInterceptFailed,
intercepter.getIntercepterName() + " handle preInvoke failed" , null);
}
}
TunnelChannel channel = channelLocator.locate(req.getChannelLocatorFactor());
if( channel == null ){
/*grade down*/
this.setGrade(this.grade.down(this.grade));
return new TunnelResponse(req.getMsgProtocal().getMsgHeader().getMsgId(), false, ErrorCodeEnum.TunnelChannelUnavailable,
"no channel available" , null);
}
this.setGrade(this.grade.up(this.grade));
if( channel.getStatus().getStatus() != ChannelStatus.Normal.getStatus() ){
return new TunnelResponse(req.getMsgProtocal().getMsgHeader().getMsgId(), false, ErrorCodeEnum.TunnelChannelInvalid,
"channel is in invalid status" , null);
}
MsgProtocol rep = null;
try {
if( req.getIsSyncCall() != null )
rep = channel.send(req.getMsgProtocal(),req.getIsSyncCall());
else
rep = channel.send(req.getMsgProtocal(),channel.getChannelConfig().isSyncCall());
} catch (ChannelException e) {
return new TunnelResponse(req.getMsgProtocal().getMsgHeader().getMsgId(),false, ErrorCodeEnum.getErrorCodeEnum(e.getErrorCode()),
"channel exception " , e);
}
/*post invoke*/
for(ITunnelIntercepter intercepter : intercepters){
intercepter.postInvoke();
}
/*if async call the rep is null*/
if( req.getIsSyncCall() )
return new TunnelResponse(((MsgRepProtocol)rep.getBody()).getSrcMsgId(), true, null, null, rep);
else
return new TunnelResponse(null, true, null, null, rep);
}
private ChannelConfig getChannelConfig(TunnelProfile profile, String ip, int port){
ChannelConfig config = new ChannelConfig();
config.setBlocking(this.profile.getPolicy().getSocket().getBlocking().equalsIgnoreCase("bio"));
config.setConnectionTimeout(this.profile.getPolicy().getSocket().getConnectionTimeout());
config.setKeepalive(this.profile.getPolicy().getSocket().getKeeplive().equalsIgnoreCase("true"));
if(this.profile.getPolicy().getSecurity().getSslSwich().equalsIgnoreCase("on")){
config.setKeyStorePath(this.profile.getPolicy().getSecurity().getSslCofig().getKeyStore());
config.setKeyStorePwd(this.profile.getPolicy().getSecurity().getSslCofig().getPassword());
}
config.setProtocalType(this.profile.getPolicy().getSocket().getType());
config.setSocketTimeout(this.profile.getPolicy().getSocket().getSocketTimeout());
config.setSSLSupport(this.profile.getPolicy().getSecurity().getSslSwich().equalsIgnoreCase("on"));
config.setWorkThreads(this.profile.getPolicy().getSocket().getWorkThreads());
config.setIp(ip);
config.setPort(port);
if( this.profile.getPolicy().getSocket().getIsSyncCall() != null )
config.setSyncCall(this.profile.getPolicy().getSocket().getIsSyncCall().equalsIgnoreCase("sync"));
else
config.setSyncCall(false);
config.setIntercepters(profile.getPolicy().getSocket().getInterceptors());
return config;
}
private void initLocator(List<TunnelChannel> channels){
/*init locator policy */
LocatorPolicy lp = this.profile.getPolicy().getLocatorPolicy();
if( lp.getLocatorAlg().getType().equalsIgnoreCase(LocatorAlgEnum.HASH.getName()) ){
channelLocator = new HashLocator<TunnelChannel>(lp, LocatorAlgEnum.HASH, lp.getFactorType(), channels);
}else if ( lp.getLocatorAlg().getType().equalsIgnoreCase(LocatorAlgEnum.RR.getName()) ){
channelLocator = new RRLocator<TunnelChannel>(lp, LocatorAlgEnum.RR, lp.getFactorType(), channels);
}else if ( lp.getLocatorAlg().getType().equalsIgnoreCase(LocatorAlgEnum.NAME.getName()) ){
Map<String, TunnelChannel> nameChannels = Collections.synchronizedMap(new HashMap<String, TunnelChannel>());
for(TunnelChannel c : channels)
nameChannels.put(c.getName(), c);
channelLocator = new NameLocator<TunnelChannel>(lp, LocatorAlgEnum.NAME, lp.getFactorType(), nameChannels);
}else{
throw new java.lang.IllegalArgumentException("unsupported locator policy " + this.profile.getPolicy().getLocatorPolicy().getLocatorAlg().getType());
}
}
private void initIntercepters(String intercepterClass){
if( intercepterClass == null || intercepterClass.trim().isEmpty())
return;
String[] clazzs = intercepterClass.split(";");
for(String clazz : clazzs ){
try {
ITunnelIntercepter intercepter = (ITunnelIntercepter)Class.forName(clazz).newInstance();
this.addIntercepter(intercepter);
} catch (InstantiationException e) {
logger.error("cannot create tunnel intercepter {} insance", clazz, e);
} catch (IllegalAccessException e) {
logger.error("cannot create tunnel intercepter {} insance", clazz, e);
} catch (ClassNotFoundException e) {
logger.error("cannot create tunnel intercepter {} insance", clazz, e);
}
}
}
/**
* add intercepter
* */
public void addIntercepter(ITunnelIntercepter intercepter){
intercepters.add(intercepter);
}
/*Grade support function*/
@Override
public GradeEnum getGrade() {
return this.grade;
}
@Override
synchronized public GradeEnum setGrade(GradeEnum grade) {
GradeEnum oldGrad = this.grade;
if( oldGrad.getGrade() == grade.getGrade() )
return this.grade;
this.grade = grade;
TunnelGradeEvent event = new TunnelGradeEvent(oldGrad);
try {
EventDispatcher.getInstance().dispatch(this, event);
} catch (Exception e) {
logger.error("dispatch channel {} grade event failed", this.getId(), e);
}
return this.grade;
}
/**
* IInfoCollect implementation
* */
@Override
public InfoItem getInfo() {
this.info.getInfo().put("total", statistic.getTotalStatistic().getValue().toString());
this.info.getInfo().put("day", statistic.getDayStatistic().getValue().toString());
this.info.getInfo().put("hour", statistic.getHourStatistic().getValue().toString());
if( flowController != null )
this.info.getInfo().put("avg", "" + flowController.getAverageTps());
this.info.getInfo().put("grade", grade.name());
return info;
}
public String getType(){
return "tunnel";
}
public String getCollectName(){
return name + id;
}
/**
* renew task to renew invalid channel
* */
class RenewTask implements Runnable {
@Override
public void run() {
for( TunnelChannel channel : channels){
if( channel.getStatus().getStatus() == ChannelStatus.Invalid.getStatus() ){
try {
if( logger.isDebugEnabled() )
logger.debug("renew channel({} {})",new Object[]{id, channel.getId()});
channel.renew();
setGrade(grade.up(grade));
} catch (ChannelException e) {
logger.error("renew channel({} {}) failed",new Object[]{id, channel.getId()}, e);
}
}
}
}
}
}
|
ehensin/ehensin-tunnel
|
tunnel-client/src/main/java/com/ehensin/tunnel/client/tunnel/Tunnel.java
|
Java
|
apache-2.0
| 13,880
|
<?php
/**
* Returns the harmonic mean of an array of values
*
* @phpstub
*
* @param array $a
*
* @return number
*/
function stats_harmonic_mean($a)
{
}
|
schmittjoh/php-stubs
|
res/php/stats/functions/stats-harmonic-mean.php
|
PHP
|
apache-2.0
| 161
|
package br.com.truesystem.projetosweb.seguranca;
import br.com.truesystem.projetosweb.negocio.ResponsavelSession;
import java.io.IOException;
import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
*
* @author gilmario
*/
@WebServlet(urlPatterns = "/logout")
public class LogoutServlet extends HttpServlet {
@Inject
private ResponsavelSession session;
private void destruirSessao(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
session.setResponsavel(null);
HttpSession httpSession = request.getSession();
httpSession.invalidate();
request.setAttribute("mensagem", "Você foi deslogado corretamente.");
request.getRequestDispatcher("/login.xhtml").forward(request, response);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
destruirSessao(req, resp);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
destruirSessao(req, resp);
}
}
|
gilmario-kpslow/projetos
|
ProjetosWeb/src/main/java/br/com/truesystem/projetosweb/seguranca/LogoutServlet.java
|
Java
|
apache-2.0
| 1,364
|
// Copyright 2018 Google LLC
//
// 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
//
// https://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.
// AUTO-GENERATED CODE. DO NOT EDIT.
package logging_test
import (
"context"
logging "cloud.google.com/go/logging/apiv2"
"google.golang.org/api/iterator"
loggingpb "google.golang.org/genproto/googleapis/logging/v2"
)
func ExampleNewMetricsClient() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func ExampleMetricsClient_ListLogMetrics() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &loggingpb.ListLogMetricsRequest{
// TODO: Fill request struct fields.
}
it := c.ListLogMetrics(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleMetricsClient_GetLogMetric() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &loggingpb.GetLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetLogMetric(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleMetricsClient_CreateLogMetric() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &loggingpb.CreateLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateLogMetric(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleMetricsClient_UpdateLogMetric() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &loggingpb.UpdateLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateLogMetric(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleMetricsClient_DeleteLogMetric() {
ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &loggingpb.DeleteLogMetricRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteLogMetric(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
|
cloudfoundry-community/stackdriver-tools
|
src/stackdriver-spinner/vendor/cloud.google.com/go/logging/apiv2/metrics_client_example_test.go
|
GO
|
apache-2.0
| 2,853
|
package org.pentaho.di.core.metrics;
import java.util.Date;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.util.StringUtil;
public class MetricsDuration {
private Date date;
private Date endDate;
private String description;
private String subject;
private String logChannelId;
private Long duration;
private Long count;
/**
* @param date
* @param description
* @param subject
* @param logChannelId
* @param duration
*/
public MetricsDuration(Date date, String description, String subject, String logChannelId, Long duration) {
this(date, description, subject, logChannelId, duration, 1L);
}
/**
* @param date
* @param description
* @param subject
* @param logChannelId
* @param duration
*/
public MetricsDuration(Date date, String description, String subject, String logChannelId, Long duration, Long count) {
this.date = date;
this.description = description;
this.subject = subject;
this.logChannelId = logChannelId;
this.duration = duration;
this.count = count;
this.endDate = new Date(date.getTime()+duration);
}
@Override
public String toString() {
if (Const.isEmpty(subject)) {
return description + " @ " + StringUtil.getFormattedDateTime(date, true) + " : " + (duration == null ? "-" : duration.toString())+ ( count==null ? "" : " (x"+count+")" );
} else {
return description + " / " + subject + " @ " + StringUtil.getFormattedDateTime(date, true) + " : " + (duration == null ? "-" : duration.toString()) + ( count==null ? "" : " (x"+count+")" );
}
}
/**
* @return the date
*/
public Date getDate() {
return date;
}
/**
* @param date
* the date to set
*/
public void setDate(Date date) {
this.date = date;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description
* the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the duration
*/
public Long getDuration() {
return duration;
}
/**
* @param duration
* the duration to set
*/
public void setDuration(Long duration) {
this.duration = duration;
}
/**
* @return the subject
*/
public String getSubject() {
return subject;
}
/**
* @param subject
* the subject to set
*/
public void setSubject(String subject) {
this.subject = subject;
}
/**
* @return the logChannelId
*/
public String getLogChannelId() {
return logChannelId;
}
/**
* @param logChannelId
* the logChannelId to set
*/
public void setLogChannelId(String logChannelId) {
this.logChannelId = logChannelId;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public void incrementCount() {
if (count==null) {
count=Long.valueOf(1L);
} else {
count=Long.valueOf(count+1);
}
}
/**
* @return the endDate
*/
public Date getEndDate() {
return endDate;
}
/**
* @param endDate the endDate to set
*/
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
}
|
jjeb/kettle-trunk
|
core/src/org/pentaho/di/core/metrics/MetricsDuration.java
|
Java
|
apache-2.0
| 3,322
|
<?php
$tpls="includer/tpls";
include("$tpls/header.php");
include("$tpls/menu.php");
include("$tpls/hed_file.php");
include("$tpls/specials.php");
include("$tpls/footer_1.php");
include("$tpls/fixe_category.php");
include("$tpls/footer.php");
?>
|
samlanh/sengtay
|
Specials_offers.php
|
PHP
|
apache-2.0
| 266
|
# Urohelminthoida Sacco, 1888 GENUS
#### Status
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Urohelminthoida/README.md
|
Markdown
|
apache-2.0
| 191
|
# Vitex aherniana Merr. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Vitex/Vitex aherniana/README.md
|
Markdown
|
apache-2.0
| 171
|
# Placophora binderi (J. Agardh) J. Agardh SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Rhodophyta/Florideophyceae/Ceramiales/Rhodomelaceae/Placophora/Placophora binderi/README.md
|
Markdown
|
apache-2.0
| 198
|
# Conarachnium parabolicum (Popofsky) Takahashi, 1991 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Chromista/Radiozoa/Nassellaria/Theoperidae/Conarachnium/Conarachnium parabolicum/README.md
|
Markdown
|
apache-2.0
| 209
|
# Asterina paupercula Ellis & Everh. SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
J. Mycol. 4(12): 121 (1888)
#### Original name
Asterina paupercula Ellis & Everh.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Asterinaceae/Asterina/Asterina paupercula/README.md
|
Markdown
|
apache-2.0
| 220
|
# Chlorospora vastatrix Speg. SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Revista Argent. Hist. Nat. 1: (1891)
#### Original name
Chlorospora vastatrix Speg.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Sordariomycetes/Melanosporales/Ceratostomataceae/Harzia/Chlorospora vastatrix/README.md
|
Markdown
|
apache-2.0
| 215
|
<?php
function redirect($path)
{
header('Location: '.$path);
exit(0);
}
function simplematch($pattern, $string, &$result) {
return (preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '(.*)', '\?' => '.'))."$#i", $string, $result));
}
function path_to_page($path, &$match)
{
global $g_pages;
foreach ($g_pages as $name => $page)
{
if (simplematch($page[0], $path, $result))
{
array_shift($result);
$match = $result;
return ($name);
}
}
return (FALSE);
}
function array_recursive_sum(array $array)
{
$sum = 0;
foreach ($array as $value)
{
if (is_array($$value))
$sum += array_recursive_sum($value);
else
$sum += floatval($value);
}
return ($sum);
}
?>
|
ncoden/42_PHP_pool
|
rush01/functions.php
|
PHP
|
apache-2.0
| 710
|
# Hypholoma pyrotricha var. pyrotricha (Holmsk.) Quél. VARIETY
#### Status
SYNONYM
#### According to
Index Fungorum
#### Published in
null
#### Original name
Hypholoma pyrotricha var. pyrotricha (Holmsk.) Quél.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Psathyrellaceae/Lacrymaria/Lacrymaria pyrotricha/ Syn. Hypholoma pyrotricha pyrotricha/README.md
|
Markdown
|
apache-2.0
| 234
|
# Stigmidium gyrophorarum (Arnold) D. Hawksw., 1975 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Kew Bull. , Addit. Ser. 30(1): 201 (1975)
#### Original name
Arthopyrenia gyrophorarum Arnold, 1896
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Mycosphaerellaceae/Stigmidium/Stigmidium gyrophorarum/README.md
|
Markdown
|
apache-2.0
| 278
|
# Paneion buckleyanum SPECIES
#### Status
ACCEPTED
#### According to
NUB Generator [implicit canonical]
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Poa/Paneion buckleyanum/README.md
|
Markdown
|
apache-2.0
| 172
|
# Phoma occidentalis Sacc. SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Phoma occidentalis Sacc.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Phoma/Phoma occidentalis/README.md
|
Markdown
|
apache-2.0
| 177
|
# Pocillaria inocephala (Lév.) Kuntze SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Revis. gen. pl. (Leipzig) 2: 866 (1891)
#### Original name
Lentinus inocephalus Lév.
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Lentinus/Pocillaria inocephala/README.md
|
Markdown
|
apache-2.0
| 226
|
# Diospyros bullata A.C.Sm. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Ebenaceae/Diospyros/Diospyros bullata/README.md
|
Markdown
|
apache-2.0
| 175
|
# Mesua manii (King) Kosterm. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Clusiaceae/Mesua/Mesua manii/README.md
|
Markdown
|
apache-2.0
| 177
|
# Vittaria flexuosa Fée SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Vittariaceae/Haplopteris/Haplopteris flexuosa/ Syn. Vittaria flexuosa/README.md
|
Markdown
|
apache-2.0
| 179
|
/*
* Copyright 2015 OpenCB
*
* 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.
*/
db.getCollection('user').createIndex({"name": 1})
db.getCollection('user').createIndex({"sessions.id": 1})
db.getCollection('study').createIndex({"alias": 1})
db.getCollection('study').createIndex({"_projectId": 1})
db.getCollection('sample').createIndex({"name": 1})
db.getCollection('sample').createIndex({"annotationSets.variableSetId": 1})
db.getCollection('sample').createIndex({"annotationSets.annotations.id": 1})
db.getCollection('sample').createIndex({"annotationSets.annotations.value": 1})
db.getCollection('sample').createIndex({"_studyId": 1})
db.getCollection('file').createIndex({"name": 1})
db.getCollection('file').createIndex({"path": 1})
db.getCollection('file').createIndex({"jobId": 1})
db.getCollection('file').createIndex({"_studyId": 1})
|
kalyanreddyemani/opencga
|
opencga-catalog/src/main/resources/mongodb-indexes.js
|
JavaScript
|
apache-2.0
| 1,357
|
#ifndef CONTROL_HPP_
#define CONTROL_HPP_
#include <ECS/ECS.hpp>
#include <SDL.h>
#include <set>
namespace Components {
struct Control : public ECS::Component {
Control();
virtual const char* Name() const;
std::set<SDL_Keycode> DownKeys;
std::set<SDL_Keycode> ControlKeys;
private:
static const char* name;
};
}
#endif // CONTROL_HPP_
|
fishin4guitars/2d-fighting-game
|
include/Components/Control.hpp
|
C++
|
apache-2.0
| 391
|
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#include <netinet/in.h>
#include <time.h>
#include <errno.h>
#include "errLogLib.h"
#include "mfileObj.h"
#include "shrMLib.h"
#include "shrexpinfo.h"
#include "shrstatinfo.h"
#include "chanLib.h"
#include "hostAcqStructs.h"
#include "expDoneCodes.h"
#include "msgQLib.h"
#include "hostMsgChannels.h"
#include "expQfuncs.h"
#include "procQfuncs.h"
#include "data.h"
#include "dspfuncs.h"
#define IBUF_SIZE (8*XFR_SIZE)
#define S_OLD_COMPLEX 0x40
#define S_OLD_ACQPAR 0x80
#define SAVE_DATA 0
#define DELETE_DATA 1
#define DATA_ERROR -1
/*
#define XFR_SIZE (76)
#define IBUF_SIZE (8*XFR_SIZE)
*/
extern int chanId; /* Channel Id */
SHR_EXP_INFO expInfo = NULL; /* start address of shared Exp. Info Structure */
static SHR_MEM_ID ShrExpInfo = NULL; /* Shared Memory Object */
/* Vnmr Data File Header & Block Header */
static struct datafilehead fidfileheader;
static struct datablockhead fidblockheader;
static struct datafilehead acqfileheader;
static struct datablockhead acqblockheader;
/* dummy struct for now */
typedef struct {
long np;
long ct;
long bs;
long elemid;
long v1;
long v2;
long v4;
long v5[10];
} lc;
#ifdef LINUX
struct recvProcSwapbyte
{
short s1;
short s2;
short s3;
short s4;
long l1;
long l2;
long l3;
long l4;
long l5;
};
typedef union
{
struct datablockhead *in1;
struct recvProcSwapbyte *out;
} recvProcHeaderUnion;
typedef union
{
float *fval;
int *ival;
} floatInt;
#endif
/* char tmp[IBUF_SIZE+1]; */
static MSG_Q_ID pProcMsgQ = NULL;
static MSG_Q_ID pExpMsgQ = NULL;
static MFILE_ID ifile = NULL;
static char expInfoFile[512] = { '\0' };
static int dspflag = 0;
static int bbytes = 0;
void UpdateStatus(FID_STAT_BLOCK *);
void rmAcqiFiles(SHR_EXP_INFO);
static void sleepMilliSeconds(int msecs)
{
struct timespec req;
req.tv_sec = msecs / 1000;
req.tv_nsec = (msecs % 1000) * 1000000;
#ifdef __INTERIX
usleep(req.tv_nsec/1000);
#else
nanosleep( &req, NULL);
#endif
}
/**********************************************************
* calcDCoffset - calculates dc offsets for real and imaginary channel.
* calculations taken from apintfunc.c (nschk).
*
*/
static
void calcDCoffset(long *noisedata, int length, double *realdcoffset,
double *imagdcoffset, int dp)
{
register int nscnt;
register int dispctr; /* lock display data counter */
register int val;
register int *dispptr; /* lock display data pointer */
register short *sdispptr;
register double rsum,isum; /* real & imaginary sum */
isum = rsum = 0.0;
nscnt = (int) (length >> 1); /* check 128 points in noise check */
if (dp == 2)
{
sdispptr = (short *)noisedata;
for (dispctr = 0; dispctr < nscnt; dispctr++)
{
#ifdef LINUX
val = ntohs( *sdispptr );
sdispptr++;
rsum += (double) val;
val = ntohs( *sdispptr );
sdispptr++;
isum += (double) val;
#else
rsum += (double) *sdispptr++;
isum += (double) *sdispptr++;
#endif
}
}
else
{
dispptr = (int *)noisedata;
for (dispctr = 0; dispctr < nscnt; dispctr++)
{
#ifdef LINUX
val = ntohl( *dispptr );
dispptr++;
rsum += (double) val;
val = ntohl( *dispptr );
dispptr++;
isum += (double) val;
#else
rsum += (double) *dispptr++;
isum += (double) *dispptr++;
#endif
}
}
*realdcoffset = rsum / (double) nscnt;
*imagdcoffset = isum / (double) nscnt;
}
/**************************************************************
*
* recvData - get ready for Exp data
* Shared Status Struct is already mapped in
* we assume Expproc has update who,what
*
* 1. mapin Exp Info Dbm
* 2. Open the Data File.
* 3. Initialize the Data File & Block Headers.
* 4. Upload Exp. Data
* 4a. Update Exp Status (Data Written Time, FID# & CT)
* 5. Close Data on Exp. Completion
* 6. mapout Exp Info Dbm
* 7. Return
* If any Error Occurs during transfer, Send Msg to Expproc.
* Expproc will take the proper action.
*
* RETURNS:
* 0 , else -1
*
* Author Greg Brissey 8/12/94
*/
int recvData(char *argstr)
{
int uid,gid;
int datastat,stat;
char fidpath[512];
char expCmpCmd[256];
char *pInfoFile;
void resetState();
if ( ! consoleConn() )
{
errLogRet(ErrLogOp,debugInfo,
"recvData: Channel not connected to console yet, Transfer request Ignored.");
return(-1);
}
pProcMsgQ = openMsgQ("Procproc");
pExpMsgQ = openMsgQ("Expproc");
/*
if (pProcMsgQ == NULL)
return(-1);
*/
pInfoFile = strtok(NULL," ");
strcpy(expInfoFile,pInfoFile);
DPRINT1(1,"\n--------------------\nPreparing for: '%s' data.\n",pInfoFile);
/*
1st mapin the Exp Info Dbm
*/
if ( mapIn(expInfoFile) == -1)
{
errLogRet(ErrLogOp,debugInfo,
"recvData: Exp Info File %s Not Present, Transfer request Ignored.", expInfoFile);
return(-1);
}
DPRINT5(1,"Expecting: %ld FIDs, %ld NT, %d GoFlag, %ld NP, %ld - Data File Size\n",
expInfo->ArrayDim,expInfo->NumTrans,expInfo->GoFlag,
expInfo->NumDataPts,expInfo->DataSize);
/*
2nd open up the Data file to the proper size and changed the
file owner & group to the Experiment submitter.
*/
/* DPRINT1(1,"getExpData: uplink data into: '%s'\n",expInfo->DataFile); */
/* DPRINT1(1,"recvData; expInfo->GoFlag = %d\n",expInfo->GoFlag); */
if (! expInfo->GoFlag)
{
sprintf(fidpath,"%s/fid",expInfo->DataFile);
DPRINT1(1,"getExpData: uplink data into: '%s'\n",fidpath);
/* Forget Malloc and Read, we'll use the POWER of MMAP */
if ( !(expInfo->ExpFlags & RESUME_ACQ_BIT))
{
/* open new data file */
ifile = mOpen(fidpath,expInfo->DataSize,O_RDWR | O_CREAT | O_TRUNC);
}
else
{
/* open existing data file SA/RA */
ifile = mOpen(fidpath,expInfo->DataSize,O_RDWR | O_CREAT);
}
if (ifile == NULL)
{
errLogSysRet(ErrLogOp,debugInfo,"recvData: could not open %s",fidpath);
resetState();
return(-1);
}
/* get the UID & GID of exp. owner */
if ( getUserUid(expInfo->UserName,&uid,&gid) == 0)
{
int old_euid = geteuid();
seteuid( getuid() );
chown(fidpath, uid, gid);
seteuid( old_euid );
}
else
{
errLogRet(ErrLogOp,debugInfo,
"recvData: Unable to change '%s' uid for User: '%s'\n",
fidpath,expInfo->UserName);
}
/* set the access permission as directed by PSG */
chmod( fidpath, 0666 & ~(expInfo->UserUmask) );
/* Check for In-Line DSP */
if (expInfo->DspOversamp > 1)
{
dspflag = 1;
}
else
{
dspflag = 0;
}
/* ----------------------------------------------------------- */
if ( !(expInfo->ExpFlags & RESUME_ACQ_BIT))
{
DPRINT(1,"recvData: RESUME bit NOT set, InitialFileHeaders() called\n");
InitialFileHeaders(); /* set the default values for the file & block headers */
/* write fileheader to datafile (via mmap) */
memcpy((void*) ifile->offsetAddr,
(void*) &fidfileheader,sizeof(fidfileheader));
ifile->offsetAddr += sizeof(fidfileheader); /* move my file pointers */
ifile->newByteLen += sizeof(fidfileheader);
}
else
{
/* Hey if file is less than fileheader + blockheader size then forget it */
if (ifile->byteLen < (sizeof(fidfileheader) + sizeof(fidblockheader)))
{
errLogRet(ErrLogOp,debugInfo,
"recvData: Existing File Not Large enough for RA usage: %lu bytes\n",
ifile->byteLen);
resetState();
return(-1);
}
/* Set New size to it's existing size, Sure wouldn't what it to get smaller! */
ifile->newByteLen = ifile->byteLen;
/* read in file header */
memcpy((void*) &fidfileheader, (void*) ifile->offsetAddr,sizeof(fidfileheader));
/* Update Relevant Info */
fidfileheader.nblocks = htonl(expInfo->ArrayDim); /* n fids*/
/* write fileheader to datafile (via mmap) */
memcpy((void*) ifile->offsetAddr,
(void*) &fidfileheader,sizeof(fidfileheader));
/* move file pointer */
ifile->offsetAddr += sizeof(fidfileheader);
/* read in block header */
memcpy((void*) &fidblockheader,
(void*) ifile->offsetAddr,sizeof(fidblockheader));
ifile->offsetAddr += sizeof(fidblockheader); /* move my file pointers */
}
/* returns EXP_CMPLT, EXP_HALTED, EXP_STOPPED, EXP_ABORTED */
datastat = uploadData(ifile,expInfo);
DPRINT1(2,"uploadData return: %d\n",datastat);
mClose(ifile);
ifile = NULL;
}
else
{
ifile = NULL;
datastat = uploadData(ifile,expInfo);
}
closeMsgQ(pProcMsgQ);
pProcMsgQ = NULL;
/* if EXP_HALTED, EXP_STOPPED, or EXP_ABORTED, HARD_ERROR
Expproc will be told via Expproc channel
so no need to tell Expproc from Here */
/* if EXP_CMPLT, then acquisition completed tell Expproc */
if (datastat == EXP_CMPLT)
{
/* Tell Expproc that Experiment is completed Acquiring Data */
sprintf(expCmpCmd,"expdone %s",ShrExpInfo->MemPath);
if ((stat = sendMsgQ(pExpMsgQ,expCmpCmd,strlen(expCmpCmd),MSGQ_NORMAL,
WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"getExpData: Expproc is not running. Exp. Done not received: '%s'\n",
ShrExpInfo->MemPath);
}
}
closeMsgQ(pExpMsgQ);
pExpMsgQ = NULL;
activeExpQdelete(expInfoFile);
if ( mapOut(expInfoFile) == -1)
{
errLogRet(ErrLogOp,debugInfo,"getExpData: mapOut failed\n");
return(-1);
}
expInfoFile[0] = '\0';
return(0);
}
#ifdef LINUX
static void byteSwap(void *data, register int num, int isShort)
{
/* byte-swap data to Linux format */
register int cnt;
if (isShort)
{
register short *sPtr;
sPtr = (short *) data;
for (cnt = 0; cnt < num; cnt++)
{
*sPtr = ntohs( *sPtr );
sPtr++;
}
}
else
{
register int *iPtr;
iPtr = (int *) data;
for (cnt = 0; cnt < num; cnt++)
{
*iPtr = ntohl( *iPtr );
iPtr++;
}
}
}
#endif
/*--------------------------------------------------------------------*/
/* eos,ct,scan; eob,bs; eof,nt,fid; eoc,il; # - eos at modulo # */
/*--------------------------------------------------------------------*/
#define STOP_EOS 11/* sa at end of scan */
#define STOP_EOB 12/* sa at end of bs */
#define STOP_EOF 13/* sa at end of fid */
#define STOP_EOC 14/* sa at end of interleave cycle */
/*--------------------------------------------------------------------*/
/**************************************************************
*
* uploadData - Perform actual task of getting data
*
* 1. Wait on the channel for incoming Data
* 2. 1st transfer of FID is a info block. (Status, np, strtct, ct, elemid, etc)
* 3. Series of transfers at some buffering size.
* 4. Fid transfer complete, determine if any processing is required
* 5. Send Msgq to Procproc for any proccessing to be done
* 6. Return
* If any Error Occurs during transfer, Send Msg to Expproc.
* Expproc will take the proper action.
*
* RETURNS:
* 0 , else -1
*
* Author Greg Brissey 8/12/94
*/
int uploadData(MFILE_ID datafile, SHR_EXP_INFO expInfo)
{
char *fidblkhdrSpot;
char *dataPtr;
char *blksizeData;
char *discardData;
unsigned long xfrSize,bytes2xfr;
unsigned long maxFidsRecv;
unsigned long fidSize,correctedNP,correctedFidSize;
int done,bytes,sync,stat;
FID_STAT_BLOCK fidstatblk;
char acqMsg[ACQ_UPLINK_XFR_MSG_SIZE+5];
int enddata_flag;
long noisedata[256];
int iRcvr;
int nRcvrs;
int uplink_flag;
int noisesize = 0;
struct {
double r;
double i;
} dcLevel[MAX_STM_OBJECTS];
/* long *noisedata; */
DPRINT1(1,"uploadData: datafile: 0x%lx \n",datafile);
DPRINT2(1,"uploadData: expInfo->IlFlag = %d RAFlag = %d\n",
expInfo->IlFlag,expInfo->RAFlag);
for (iRcvr=0; iRcvr<MAX_STM_OBJECTS; iRcvr++){
dcLevel[iRcvr].r = dcLevel[iRcvr].i = 0;
}
/* determine fid size which will differ between inline DSP & normal operation */
if (expInfo->DspOversamp > 1)
{
DPRINT(1,"initDSP: --------------------------------\n");
initDSP(expInfo); /* initial dsp structs and read in coeff */
fidSize = ((expInfo->NumDataPts * expInfo->DspOversamp) + (expInfo->DspOsCoef - 1)) *
expInfo->DataPtSize;
noisesize = ((256 * expInfo->DspOversamp) + (expInfo->DspOsCoef - 1)) *
expInfo->DataPtSize;
/* noisedata = (long *) malloc(((noisesize*sizeof(long))) + 10); */
DPRINT2(1,"FID Size: %lu bytes, Noise Size: %ld bytes\n",fidSize,noisesize);
}
else
{
fidSize = expInfo->FidSize;
/* noisedata = (long *) malloc((256*sizeof(long))); */
}
DPRINT3(1,"uploadData: OverSample: %d, local FID buffer size: %d, Actual FID Size: %d\n",
expInfo->DspOversamp,fidSize,expInfo->FidSize);
DPRINT1(1,"uploadData: number of FIDS: %d\n", expInfo->NumFids );
/* interleave Exp or ra we must do the summing with buffer, inline DSP need buffer */
/* to hold oversampled data */
if ( (expInfo->IlFlag != 0) || (expInfo->RAFlag != 0) ||
(expInfo->DspOversamp > 1) )
{
/* Just incase np is less than noise np of 256 */
if (fidSize > noisesize)
blksizeData = (char*) malloc((fidSize) + 10);
else
blksizeData = (char*) malloc((noisesize) + 10);
DPRINT2(1,"uploadData: malloc for Il-BS, RA or DSP: %lu bytes, addr: 0x%lx\n",
fidSize,blksizeData);
if (blksizeData == NULL)
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,
"uploadData: Failed to get blksizeData\n");
}
}
else
{
blksizeData = NULL;
}
/* malloc xfersize buffer to discard data for ct < 0. SA */
/* during steady state. */
discardData = (char*) malloc(XFR_SIZE);
if (discardData == NULL)
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,"uploadData: Failed to get discardData\n");
}
done = enddata_flag = 0;
maxFidsRecv = 0L;
nRcvrs = 1; /* Default number of rcvrs */
iRcvr = -1;
while( !done )
{
/* keep reading channel till uplink msg is obtain then proceed */
/* This action is an attempt to resync channels incase there are */
/* problems on the channel, garbled, wrong # bytes, etc. */
uplink_flag = sync = 0;
/* DPRINT(-1,"At The Beginning\n"); */
while( !sync )
{
DPRINT(1,"uploadData: Waiting for Acq UPLINK Msg\n");
blockAllEvents();
bytes = readChannel(chanId,acqMsg,ACQ_UPLINK_XFR_MSG_SIZE);
unblockAllEvents();
acqMsg[ACQ_UPLINK_XFR_MSG_SIZE] = '\0';
DPRINT1(1,"uploadData: Acq UPLINK Msg: '%s'\n",acqMsg);
if (strncmp(acqMsg,ACQ_UPLINK_MSG,strlen(ACQ_UPLINK_MSG)) == 0)
{
uplink_flag = sync = 1;
}
else
{
/* test if for some reason we are to stop data transfer */
if (strncmp(acqMsg,ACQ_UPLINK_ENDDATA_MSG,strlen(ACQ_UPLINK_MSG)) == 0)
{
enddata_flag = 1;
sync = 1;
}
}
}
blockAllEvents();
bytes = readChannel(chanId,(char*)&fidstatblk,sizeof(fidstatblk));
unblockAllEvents();
if (bytes < sizeof(fidstatblk))
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,"uploadData: Failed to get fidstatblk\n");
}
#ifdef LINUX
FSB_CONVERT( fidstatblk );
#endif
if (uplink_flag) {
/* Increment rcvr with each UPLINK msg (but see IF block below) */
iRcvr++;
}
if (fidstatblk.ct > 0 && fidstatblk.elemId > 0) {
/* Not a noise FID; cycle rcvr number and fix elemId number */
if (iRcvr >= nRcvrs) { iRcvr = 0; }
fidstatblk.elemId = ((fidstatblk.elemId - 1) * nRcvrs + iRcvr + 1);
}
DPRINT5(1,">>>>>>> FIDstat Read Fid StatBlk: Fid: %ld, DataSize: %ld, CT: %ld, NP: %ld,\n State: %d\n",
fidstatblk.elemId, fidstatblk.dataSize, fidstatblk.ct,
fidstatblk.np, fidstatblk.doneCode);
DPRINT3(1,"Statblock: elemId=%d, iRcvr=%d, nRcvrs=%d\n",
fidstatblk.elemId, iRcvr, nRcvrs);
/*
Correct FidSize & NP return from console to reflect decimated sizes
Further done we'll equate fidstatblk.np & fidstatblk.dataSize to them
*/
/* DPRINT(-1,">>>>>>> AT 'AA' \n"); */
if (expInfo->DspOversamp > 1)
{
correctedNP = (fidstatblk.np - (expInfo->DspOsCoef - 1))/expInfo->DspOversamp;
correctedFidSize = correctedNP * expInfo->DataPtSize;
DPRINT4(1,"Fid StatBlk: OverSample: Factor %d, Coef %d; Corrected: DataSize %lu, NP %lu\n",
expInfo->DspOversamp, expInfo->DspOsCoef, correctedFidSize, correctedNP);
}
/* DPRINT(-1,">>>>>>> AT 'A' \n"); */
if ( fidstatblk.doneCode == WARNING_MSG )
{
DPRINT(1,"uploadData: WARNING_MSG Werr Processing\n");
/* wait because we guarantee this processing tobe done*/
procQadd(WERR, ShrExpInfo->MemPath, fidstatblk.elemId,
/* fidstatblk.ct */ 1L, fidstatblk.doneCode, fidstatblk.errorCode);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Error Process not done for FID %lu, CT: %lu\n",
fidstatblk.elemId,fidstatblk.ct);
}
enddata_flag = 0; /* don't stop just a warning */
DPRINT(1,"WARNING_MSG: continue\n");
continue;
}
/* DPRINT(-1,">>>>>>> AT 'B' \n"); */
/*********************************************************************
* If data transfer stopped permaturely use fidstatblk to find out why
* then do the right thing.
*/
if (enddata_flag)
{
/* DPRINT(-1,">>>>>>> AT 'C' \n"); */
DPRINT1(1,"--------- Enddata Flag SET ------ DoneCode: %d\n",fidstatblk.doneCode);
/* 1st update file header to proper number of FIDs present in data */
if (! expInfo->GoFlag)
{
struct datafilehead *pdatafilehead;
if ( mFidSeek(datafile, 1L, sizeof(struct datafilehead), bbytes ) == -1)
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,"uploadData: mFidSeek failed.\n");
}
pdatafilehead = (struct datafilehead *) datafile->mapStrtAddr;
pdatafilehead->nblocks = htonl(maxFidsRecv);
}
/* Always free discard buffer */
free(discardData);
discardData = NULL;
/* incase we are Interleaving, RA, or inline DSP need to free this buffer */
if (blksizeData != NULL)
{
DPRINT1(1,"Free Il BS: 0x%lx\n",blksizeData);
free(blksizeData);
blksizeData = NULL;
}
switch(fidstatblk.doneCode)
{
case STOP_CMPLT: /* result of SA, no process */
{
int SA_Type;
DPRINT(1,"uploadData: STOP_CMPLT\n");
/* A Halt is equivilent to a AA but Wexp proc not Werr */
/* full, wait because we guarantee this processing tobe done */
/* use expInfo->Celem & expInfo->CurrentTran, since they reflect last
data transfer prior to this stop message
*/
SA_Type = STOP_EOF;
switch(fidstatblk.errorCode)
{
case EXP_FID_CMPLT:
SA_Type = STOP_EOF;
break;
case BS_CMPLT:
SA_Type = STOP_EOB;
break;
case CT_CMPLT:
SA_Type = STOP_EOS;
break;
case IL_CMPLT:
SA_Type = STOP_EOC;
break;
}
if (expInfo->ProcWait > 0) /* au(wait) or just au */
{
DPRINT2(1,
"uploadData: wExp(wait): Queue FID: %ld, CT: %ld\n",
fidstatblk.elemId, fidstatblk.ct);
procQadd(WEXP_WAIT, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, SA_Type);
}
else
{
DPRINT2(1,"uploadData wExp: Queue FID: %ld, CT: %ld\n",
fidstatblk.elemId, fidstatblk.ct);
procQadd(WEXP, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, SA_Type);
}
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"uploadData: Procproc is not running. Wexp Process not done for FID %lu, CT: %lu\n",
fidstatblk.elemId,fidstatblk.ct);
}
return(EXP_STOPPED);
}
break;
case EXP_HALTED: /* result of Halt, do Wexp processing */
DPRINT(1,"uploadData: EXP_HALTED\n");
{
/* A Halt is equivilent to a AA but Wexp proc not Werr */
/* use expInfo->Celem & expInfo->CurrentTran, since they reflect last
data transfer prior to this stop message
*/
fidstatblk.doneCode = EXP_ABORTED;
/* full, wait because we guarantee this processing tobe done */
if (expInfo->ProcWait > 0) /* au(wait) or just au */
{
DPRINT2(1,
"uploadData: wExp(wait): Queue FID: %ld, CT: %ld\n",
fidstatblk.elemId, fidstatblk.ct);
procQadd(WEXP_WAIT, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, fidstatblk.errorCode);
}
else
{
DPRINT2(1,"uploadData wExp: Queue FID: %ld, CT: %ld\n",
fidstatblk.elemId, fidstatblk.ct);
procQadd(WEXP, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, fidstatblk.errorCode);
}
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"uploadData: Procproc is not running. Wexp Process not done for FID %lu, CT: %lu\n",
fidstatblk.elemId,fidstatblk.ct);
}
}
return(EXP_HALTED);
break;
case EXP_ABORTED:
DPRINT(1,"uploadData: EXP_ABORTED\n");
{
DPRINT(1,"uploadData: Werr Processing\n");
/* wait because we guarantee this processing tobe done*/
procQadd(WERR, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, fidstatblk.errorCode);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Error Process not done for FID %lu, CT: %lu\n",
fidstatblk.elemId,fidstatblk.ct);
}
}
return(EXP_ABORTED); /* result of ABORT Experiment */
break;
case HARD_ERROR:
DPRINT(1,"uploadData: HARD_ERROR\n");
{
DPRINT(1,"uploadData: Werr Processing\n");
/* wait because we guarantee this processing tobe done*/
procQadd(WERR, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, fidstatblk.errorCode);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Error Process not done for FID %lu, CT: %lu\n",
fidstatblk.elemId,fidstatblk.ct);
}
}
return(EXP_HALTED); /* result of HARD_ERROR. RPNZ */
break;
case SETUP_CMPLT:
DPRINT(1,"uploadData: SETUP_CMPLT\n");
{
procQadd(WEXP, ShrExpInfo->MemPath, expInfo->Celem,
expInfo->CurrentTran, fidstatblk.doneCode, fidstatblk.errorCode);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),
MSGQ_NORMAL,WAIT_FOREVER)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc not running. Wexp Process not done for SU\n");
}
}
return(EXP_CMPLT);
break;
default:
return(EXP_STOPPED);
break;
}
}
/* DPRINT(-1,">>>>>>> AT 'D' \n"); */
if (datafile == NULL)
return(EXP_CMPLT);
/* DPRINT(-1,">>>>>>> AT 'E' \n"); */
if ( (fidstatblk.doneCode == WARNING_MSG) )
{
/* DPRINT(-1,"uploadData: It was an Warning skip getting the FID\n"); */
continue;
}
/* if ct <= 0 it is a steady state fid and should be discarded */
/* else if fid elemid == 0 then this is the NOISE fid */
if ((long)fidstatblk.ct <= 0) /* ss FID */
{
dataPtr = (char *)discardData;
}
else if (fidstatblk.elemId == 0) /* noise element */
{
/* added test for JPSG since noise is oversampled for dsp='i'*/
if ((fidstatblk.np > 256) && (expInfo->DspOversamp > 1))
dataPtr = (char *)blksizeData; /* if np != 256 then noise has been oversampled */
else
dataPtr = (char *)noisedata;
}
else
{
if ( mFidSeek(datafile, fidstatblk.elemId, sizeof(struct datafilehead),
bbytes ) == -1)
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,"uploadData: mFidSeek failed.\n");
}
fidblkhdrSpot = datafile->offsetAddr; /* save block header position */
DPRINT2(2,"Header & Data Offset: 0x%lx, 0x%lx\n",
fidblkhdrSpot, datafile->offsetAddr + sizeof(fidblockheader));
/* Check for interleave Exp or first fid in ra. These we must do */
/* summing on the host. If DSP (inline) then need the buffer for the */
/* oversampled data */
if ( (expInfo->IlFlag != 0) || (expInfo->DspOversamp > 1) ||
((expInfo->RAFlag != 0) && (fidstatblk.elemId ==
(expInfo->CurrentElem+1))) )
{
dataPtr = blksizeData;
}
else
{
/* set to fid data position */;
dataPtr = datafile->offsetAddr + sizeof(fidblockheader);
}
}
bytes2xfr = fidstatblk.dataSize;
DPRINT(2,">>>> Data Xfr:\n");
while( bytes2xfr )
{
if (bytes2xfr < XFR_SIZE)
xfrSize = bytes2xfr;
else
xfrSize = XFR_SIZE;
DPRINT4(2,"Address: 0x%lx, Xfr Size: 0x%lx (%lu) Left: %lu\n",
dataPtr,xfrSize,xfrSize,bytes2xfr);
blockAllEvents();
bytes = readChannel(chanId,dataPtr,xfrSize);
unblockAllEvents();
if (bytes < xfrSize)
{
/* don't know how to recover, so terminate process */
mClose(datafile);
errLogQuit(ErrLogOp,debugInfo,"uploadData: Failed to get xfrSize.\n");
}
if ((long)fidstatblk.ct > 0) /* data will be discarded if ct <= 0 */
dataPtr += xfrSize;
bytes2xfr -= xfrSize;
}
if ((long)fidstatblk.ct <= 0)
{
DPRINT(1,"Do Nothing data is to be discarded\n");
continue;
}
else if ( fidstatblk.elemId == 0) /* Calculate noise values */
{
long *noisePtr;
DPRINT(1,"A Noise FID do dclevel Calc\n");
nRcvrs = iRcvr + 1; /* Count up nbr of rcvrs being used */
/* added test for JPSG since noise is oversampled for dsp='i'*/
if ((fidstatblk.np > 256) && (expInfo->DspOversamp > 1))
noisePtr = (long *)blksizeData; /* if np != 256 then noise has been oversampled */
else
noisePtr = noisedata;
/* calcDCoffset(noisedata,fidstatblk.dataSize/expInfo->DataPtSize, */
calcDCoffset(noisePtr,fidstatblk.dataSize/expInfo->DataPtSize,
&dcLevel[iRcvr].r,
&dcLevel[iRcvr].i,
expInfo->DataPtSize);
DPRINT3(1,"dcLevel[%d] = (%g, %g)\n",
iRcvr, dcLevel[iRcvr].r, dcLevel[iRcvr].i);
}
else
{
if (expInfo->DspOversamp > 1)
{
dsp_dcset((float)dcLevel[iRcvr].r, (float)dcLevel[iRcvr].i);
fidstatblk.np = correctedNP;
fidstatblk.dataSize = correctedFidSize;
DPRINT2(1,"Change fidstatblk np & dataSize to decimated values: np %lu, datasize: %lu\n",
fidstatblk.np,fidstatblk.dataSize);
}
DPRINT1(1,"expInfo->IlFlag: %d\n",expInfo->IlFlag);
DPRINT2(1,"expInfo->RAFlag: %d startelem: %d\n",expInfo->RAFlag,
expInfo->CurrentElem);
/* If interleave, or first fid of ra, or inline dsp; then we do the summing */
/* on the host. */
if ( (expInfo->IlFlag != 0) ||
((expInfo->RAFlag != 0) && (fidstatblk.elemId ==
(expInfo->CurrentElem+1))) )
{
int stat,Ra_Ct_Zero,First_Bs,Il_First_Bs,Dsp_First_Bs;
/* INLINE DSP */
if (expInfo->DspOversamp > 1)
{
DPRINT(1,"Il or RA dspExec Filter -------------------\n");
#ifdef LINUX
byteSwap(blksizeData, fidSize / expInfo->DataPtSize, (expInfo->DataPtSize == 2) );
#endif
dspExec(blksizeData, blksizeData, expInfo->NumDataPts, fidSize, fidstatblk.ct);
}
/* if RA & CT == 0 then we want to memcpy not add */
Ra_Ct_Zero = ((expInfo->RAFlag) && (expInfo->CurrentTran == 0));
/* If BS==0 then memcpy (there are no BS) otherwise
if (ct/bs) <= 1 then memcpy (i.e. 1st BS) */
First_Bs = (expInfo->NumInBS >= 1) ? (((long)fidstatblk.ct / expInfo->NumInBS) <= 1 ) : 1;
/* if Interleave and elements 1st BS then memcpy not add */
Il_First_Bs = (expInfo->RAFlag == 0) && First_Bs;
/* if inline DSP and 1st BS then memcpy not add */
Dsp_First_Bs = dspflag && First_Bs;
DPRINT4(1,"Ra_Ct_Zero: %d, First_Bs: %d, Il_First_Bs: %d, Dsp_First_Bs: %d\n",
Ra_Ct_Zero,First_Bs,Il_First_Bs,Dsp_First_Bs);
/* Check for 1st fid of interleaving to write without */
/* summing to the datafile. Note: bs >= 1 for IlFlag. */
/*
if ( ((expInfo->RAFlag) && (expInfo->CurrentTran == 0)) ||
((expInfo->RAFlag == 0) &&
(((long)fidstatblk.ct / expInfo->NumInBS) <= 1 )) ||
((dspflag) && (((long)fidstatblk.ct / expInfo->NumInBS) <= 1 )) )
*/
/* if ( Ra_Ct_Zero || Il_First_Bs || Dsp_First_Bs) */
if ( Ra_Ct_Zero || Il_First_Bs )
{
/* 1st Block size don't add just copy into file */
DPRINT3(1,"IL BS 1: memcpy(0x%lx,0x%lx,%lu)\n",(datafile->offsetAddr + sizeof(fidblockheader)),
blksizeData, fidstatblk.dataSize);
#ifdef LINUX
DPRINT4(2,"DSP NumDataPts=%d DataPtSize=%d datasize= %d size/num=%d\n",expInfo->NumDataPts,
expInfo->DataPtSize, fidstatblk.dataSize, fidstatblk.dataSize/ expInfo->NumDataPts);
if (expInfo->DspOversamp > 1)
byteSwap(datafile->offsetAddr + sizeof(fidblockheader),
expInfo->NumDataPts, (expInfo->DataPtSize == 2) );
#endif
memcpy((void*)(datafile->offsetAddr + sizeof(fidblockheader)),
(void*)blksizeData, fidstatblk.dataSize);
#ifdef DEBUG
{ /* diagnostic output */
int i;
long *lptr;
short *sptr;
if (expInfo->DataPtSize == 4)
{
for(i=0,lptr=(long*)blksizeData;i<20;i++)
{
DPRINT2(1,"data[%d]: %ld\n",i,*lptr++);
}
}
else
{
for(i=0,sptr=(short*)blksizeData;i<20;i++)
{
DPRINT2(1,"data[%d]: %hd\n",i,*sptr++);
}
}
}
#endif
}
else
{
if (expInfo->DataPtSize == 4) /* 16/32 bit data to sum ? */
{
if (expInfo->DspOversamp > 1) /* inline dsp results in floats */
{
DPRINT3(1,"sumFloatData(0x%lx, 0x%lx, %lu)\n",
(datafile->offsetAddr + sizeof(fidblockheader)), blksizeData,
fidstatblk.np );
#ifdef LINUX
byteSwap((long*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 0);
/* Incoming data was already byte-swapped for DSP operation */
#endif
stat = sumFloatData( (long*)(datafile->offsetAddr +
sizeof(fidblockheader)),(long*)blksizeData, fidstatblk.np );
#ifdef LINUX
byteSwap((long*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 0);
#endif
}
else
{
DPRINT3(1,"sumLongData(0x%lx, 0x%lx, %lu)\n",
(datafile->offsetAddr + sizeof(fidblockheader)), blksizeData,
fidstatblk.np );
#ifdef LINUX
byteSwap((long*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 0);
byteSwap((long*)blksizeData, fidstatblk.np, 0);
#endif
stat = sumLongData( (long*)(datafile->offsetAddr +
sizeof(fidblockheader)),(long*)blksizeData, fidstatblk.np);
#ifdef LINUX
byteSwap((long*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 0);
#endif
if (stat)
errLogRet(ErrLogOp,debugInfo,
"sumLongData: Imminent OverFlow Detected");
}
}
else
{
/* for oversamping use exp info NP, otherwise use np that came back from
console (i.e. might array np */
DPRINT3(1,"sumShortData(0x%lx, 0x%lx, %lu)\n",
(datafile->offsetAddr + sizeof(fidblockheader)), blksizeData,
fidstatblk.np );
#ifdef LINUX
byteSwap((short*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 1);
byteSwap((long*)blksizeData, fidstatblk.np, 1);
#endif
stat = sumShortData( (short*)(datafile->offsetAddr +
sizeof(fidblockheader)),(short*)blksizeData, fidstatblk.np );
#ifdef LINUX
byteSwap((short*)(datafile->offsetAddr + sizeof(fidblockheader)), fidstatblk.np, 1);
#endif
if (stat)
errLogRet(ErrLogOp,debugInfo,
"sumShortData: OverFlow Detected, Data Corrupted");
}
}
}
else
{
/* INLINE DSP */
if (expInfo->DspOversamp > 1)
{
DPRINT(1,"dspExec Filter ----------------------------\n");
#ifdef LINUX
byteSwap(blksizeData, fidSize / expInfo->DataPtSize, (expInfo->DataPtSize == 2) );
#endif
dspExec(blksizeData, (datafile->offsetAddr + sizeof(fidblockheader)),
expInfo->NumDataPts, fidSize, fidstatblk.ct);
#ifdef LINUX
byteSwap(datafile->offsetAddr + sizeof(fidblockheader),
expInfo->NumDataPts, (expInfo->DataPtSize == 2) );
#endif
}
}
/* keep track of largest FID element received to update datafilehead in
case of SA or some other early stopping point prior to Exp completion
*/
if (fidstatblk.elemId > maxFidsRecv)
maxFidsRecv = fidstatblk.elemId;
/* Update fid block header for this FID */
/* fidblockheader.scale = fidstatblk.scale; */
fidblockheader.index = htons(fidstatblk.elemId);
/* If acquisition is clearing data at blocksize, correct the ct */
if (expInfo->ExpFlags & CLR_AT_BS_BIT) {
fidblockheader.ctcount = htonl(expInfo->NumInBS);
} else {
fidblockheader.ctcount = htonl(fidstatblk.ct);
}
fidblockheader.lvl = (float) dcLevel[iRcvr].r;
fidblockheader.tlt = (float) dcLevel[iRcvr].i;
if ( (expInfo->DspOversamp > 1) && (fidstatblk.ct == 1) )
{
fidblockheader.lvl = 0.0; /* make sure FID offsets are zero after dsp */
fidblockheader.tlt = 0.0; /* make sure FID offsets are zero after dsp */
}
#ifdef LINUX
{
floatInt un;
un.fval = &fidblockheader.lvl;
*un.ival = htonl( *un.ival );
un.fval = &fidblockheader.tlt;
*un.ival = htonl( *un.ival );
}
#endif
if (expInfo->DspGainBits)
fidblockheader.scale = htons( -expInfo->DspGainBits );
/* Copy fid block header to Disk */
/* we copy this even for RA since the fid data may not be complete
(i.e. not all fids taken) before SA. Therefore the fidblockhead may
not be present for this FID.
*/
memcpy((void*)fidblkhdrSpot,(void*)&fidblockheader,
sizeof(fidblockheader));
/* --- Update Current CT & Current Element ----- */
expInfo->CurrentTran = fidstatblk.ct; /* Current Transient */
expInfo->Celem = fidstatblk.elemId; /* Current Element */
/* set the number of completed FIDs */
/* Note" using expInfo->NumTrans to determine if FIDs are completed
is probably not going to work in the long run, since people
will want to array NT, which means each FID would have its own
criteria for completion....
*/
if ( (fidstatblk.doneCode == EXP_FID_CMPLT) )
{
expInfo->FidsCmplt = fidstatblk.elemId;
}
/* Now the FID Xfr is complete, time to update status struct &
check on processing */
/* Update Status so that others can be aware of whats happening */
UpdateStatus(&fidstatblk);
Process(&fidstatblk);
} /* end std processing (non-noise data) */
DPRINT4(1,"eleId %ld == NFids %ld, statCT %ld == NumTrans %ld\n",
fidstatblk.elemId,expInfo->ArrayDim,fidstatblk.ct,
expInfo->NumTrans);
/* Note" using expInfo->NumTrans to determine if FIDs are completed
is probably not going to work in the long run, since people
will want to array NT, which means each FID would have its own
criteria for completion....
*/
if ( (fidstatblk.elemId == expInfo->ArrayDim) &&
(fidstatblk.doneCode == EXP_FID_CMPLT) )
{
/* check for abort at last possible moment! */
/* if abort don't set done, need to go back and read the statblock
that indicates an abort , otherwise the next exp will think it was aborted!
*/
if (expInfo->ExpState != EXPSTATE_ABORTED)
{
DPRINT(1,"Exp. Complete.\n");
done = 1;
}
}
}
if (discardData != NULL)
free(discardData);
/* incase we are Interleaving ,RA, Inline DSP, we need to free this buffer */
if (blksizeData != NULL)
free(blksizeData);
return(EXP_CMPLT);
}
/***********************************************************
*
* sumFloatData
* Sums the Interleaved BS Fid with the mmap data file fid
* dstadr is the mmap data fid addr, srdadr is the BS Fid
* np is the number of data points to be added
*/
int sumFloatData( float* dstadr, float* srdadr, unsigned long np)
{
unsigned long i;
for (i=0;i<np;i++,dstadr++)
{
#ifdef DEBUG
if (i<20)
{
DPRINT3(1,"sum: %f = %f + %f\n",*dstadr + *srdadr,*dstadr,*srdadr);
}
#endif
*dstadr += *srdadr++;
}
return(0);
}
/***********************************************************
*
* sumLongData
* Sums the Interleaved BS Fid with the mmap data file fid
* dstadr is the mmap data fid addr, srdadr is the BS Fid
* np is the number of data points to be added
*/
int sumLongData( long* dstadr, long* srdadr, unsigned long np)
{
unsigned long i;
long maxval = 0x7FFFFFFF - 0x100000; /* 2^31 - 2^20, imminent overflow */
int ovrflow = 0;
for (i=0;i<np;i++,dstadr++)
{
#ifdef DEBUG
if (i<20)
{
DPRINT3(1,"sum: %ld = %ld + %ld\n",*dstadr + *srdadr,*dstadr,*srdadr);
}
#endif
if ( (*dstadr += *srdadr++) > maxval)
ovrflow = 1;
if (*dstadr < -maxval)
ovrflow = 1;
}
return(ovrflow);
}
/***********************************************************
*
* sumShortData
* Sums the Interleaved BS Fid with the mmap data file fid
* dstadr is the mmap data fid addr, srdadr is the BS Fid
* np is the number of data points to be added
*/
int sumShortData( short* dstadr, short* srdadr, unsigned long np)
{
unsigned long i;
long sumval;
long maxval = 0x7FFF; /* 2^15 */
int ovrflow = 0;
for (i=0;i<np;i++,dstadr++)
{
if ( (sumval = (long) *dstadr + (long) *srdadr++) > maxval)
ovrflow = 1;
if (sumval < -maxval)
ovrflow = 1;
#ifdef DEBUG
if (i<20)
{
DPRINT4(1,"sum: %ld = %hd + %hd\n, ovrflow: %d",
sumval,*dstadr,*(srdadr-1),ovrflow);
}
#endif
*dstadr = (short) sumval;
}
return(ovrflow);
}
int abortCodes(char *str)
{
DPRINT(1,"abortCodes: \n");
return(0);
}
void resetState()
{
/* close msgQs if open */
if (pProcMsgQ != NULL)
{
closeMsgQ(pProcMsgQ);
pProcMsgQ = NULL;
}
if (pExpMsgQ != NULL)
{
closeMsgQ(pExpMsgQ);
pExpMsgQ = NULL;
}
/* close mmap data file if opened. */
if (ifile != NULL)
{
mClose(ifile);
ifile = NULL;
}
/* map out shared expingo info file */
if ( (int) strlen(expInfoFile) > 1)
{
mapOut(expInfoFile);
expInfoFile[0] = '\0';
}
}
void terminate(char *str)
{
DPRINT(1,"terminate: shutdown comlink, Release processing Q\n");
shutdownComm();
procQRelease();
expStatusRelease();
exit(0);
}
void ShutDownProc()
{
shutdownComm();
procQRelease();
expStatusRelease();
}
int debugLevel(char *str)
{
extern int DebugLevel;
char *value;
int val;
value = strtok(NULL," ");
val = atoi(value);
DebugLevel = val;
DPRINT1(1,"debugLevel: New DebugLevel: %d\n",val);
return(0);
}
int mapIn(char *filename)
{
DPRINT1(1,"mapIn: mapin '%s'\n",filename);
ShrExpInfo = shrmCreate(filename,SHR_EXP_INFO_RW_KEY,(unsigned long)sizeof(SHR_EXP_STRUCT));
if (ShrExpInfo == NULL)
{
errLogSysRet(ErrLogOp,debugInfo,"mapIn: shrmCreate() failed:");
return(-1);
}
if (ShrExpInfo->shrmem->byteLen < sizeof(SHR_EXP_STRUCT))
{
/* hey, this file is not a shared Exp Info file */
shrmRelease(ShrExpInfo); /* release shared Memory */
unlink(filename); /* remove filename that shared Mem created */
ShrExpInfo = NULL;
expInfo = NULL;
return(-1);
}
#ifdef DEBUG
if (DebugLevel >= 2)
shrmShow(ShrExpInfo);
#endif
expInfo = (SHR_EXP_INFO) shrmAddr(ShrExpInfo);
return(0);
}
int mapOut(char *str)
{
if (ShrExpInfo != NULL)
{
shrmRelease(ShrExpInfo);
ShrExpInfo = NULL;
expInfo = NULL;
}
return(0);
}
/**************************************************************
*
* InitialFileHeaders - initial the static file & block headers
*
* This routine initializes the file header and block header
* strcutures.
*
* RETURNS:
* 0 , else -1
*
* Author Greg Brissey 8/12/94
*/
int InitialFileHeaders()
{
/*
int decfactor = 1,
dscoeff = 1;
*/
/* datasize = expptr->DataPtSiz; data pt bytes
* fidsize = expptr->FidSiz; fid in bytes
* np = expptr->N_Pts;
* dpflag = datasize;
*/
/* decfactor = *( (int *)getDSPinfo(DSP_DECFACTOR) ); */
fidfileheader.nblocks = expInfo->ArrayDim; /* n fids*/
fidfileheader.ntraces = expInfo->NumFids; /* NF */;
/* fidfileheader.np = ( dspflag ? np / decfactor : np ); */
fidfileheader.np = expInfo->NumDataPts;
fidfileheader.ebytes = expInfo->DataPtSize; /* data pt bytes */
fidfileheader.tbytes = expInfo->DataPtSize * expInfo->NumDataPts; /* trace in bytes */
/*blk in byte*/
bbytes = (fidfileheader.tbytes * fidfileheader.ntraces)
+ sizeof(fidblockheader);
fidfileheader.bbytes = bbytes;
fidfileheader.nbheaders = 1;
fidfileheader.status = S_DATA | S_OLD_COMPLEX;/* init status FID */
fidfileheader.vers_id = 0;
#ifdef LINUX
fidfileheader.nblocks = htonl(fidfileheader.nblocks);
fidfileheader.ntraces = htonl(fidfileheader.ntraces);
fidfileheader.np = htonl(fidfileheader.np);
fidfileheader.ebytes = htonl(fidfileheader.ebytes);
fidfileheader.tbytes = htonl(fidfileheader.tbytes);
fidfileheader.bbytes = htonl(fidfileheader.bbytes);
fidfileheader.nbheaders = htonl(fidfileheader.nbheaders);
fidfileheader.vers_id = htons(fidfileheader.vers_id);
#endif
/* -------------------- FID Header ---------------------------- */
fidblockheader.scale = (short) 0;
fidblockheader.status = S_DATA | S_OLD_COMPLEX;/* init status to fid*/
fidblockheader.index = (short) 0;
fidblockheader.mode = (short) 0;
fidblockheader.ctcount = (long) 0;
fidblockheader.lpval = (float) 0.0;
fidblockheader.rpval = (float) 0.0;
fidblockheader.lvl = (float) 0.0;
fidblockheader.tlt = (float) 0.0;
if ( expInfo->DataPtSize == 4) /* dp='y' (4) */
{
if (dspflag) /* values set to S_FLOAT not S_32 */
{
fidfileheader.status |= S_FLOAT;
fidblockheader.status |= S_FLOAT;
}
else
{
fidfileheader.status |= S_32;
fidblockheader.status |= S_32;
}
}
#ifdef LINUX
{
recvProcHeaderUnion hU;
fidfileheader.status = htons(fidfileheader.status);
hU.in1 = &fidblockheader;
hU.out->s1 = htons(hU.out->s1);
hU.out->s2 = htons(hU.out->s2);
hU.out->s3 = htons(hU.out->s3);
hU.out->s4 = htons(hU.out->s4);
hU.out->l1 = htonl(hU.out->l1);
hU.out->l2 = htonl(hU.out->l2);
hU.out->l3 = htonl(hU.out->l3);
hU.out->l4 = htonl(hU.out->l4);
hU.out->l5 = htonl(hU.out->l5);
}
#endif
/* ----------------------- ACQ File Header -------------------------- */
acqfileheader.nblocks = expInfo->ArrayDim; /* n fids */
acqfileheader.ntraces = 1L;
acqfileheader.np = (long) sizeof(lc) / 2; /* total size */
acqfileheader.ebytes = 2; /* variable size in bytes */
acqfileheader.tbytes = sizeof(lc); /* Low Core parameters in bytes */
acqfileheader.bbytes = sizeof(lc) + sizeof(acqblockheader);/* blockbytes */
acqfileheader.nbheaders = 1;
acqfileheader.status = S_DATA | S_OLD_ACQPAR;/* init status to abort code */
acqfileheader.vers_id = 0;
/* ------------------------ ACQ Header ---------------------------- */
acqblockheader.scale = (short) 0;
acqblockheader.status = S_DATA | S_OLD_ACQPAR;
acqblockheader.index = (short) 0;
acqblockheader.mode = (short) 0;
acqblockheader.ctcount = (long) 0;
acqblockheader.lpval = (float) 0.0;
acqblockheader.rpval = (float) 0.0;
acqblockheader.lvl = (float) 0.0;
acqblockheader.tlt = (float) 0.0;
return(0);
}
/**************************************************************
*
* UpdateStatus - Updates appropriate members of Status Struct
*
* This routine updates the Status apprropriate for recvproc
*
* expanded to update the FID element number, taking into account
* requirements for an interleaved experiment.
*
* RETURNS:
* nothing
*
* Author Greg Brissey 10/28/94
*/
void UpdateStatus(FID_STAT_BLOCK *pFidstatblk)
{
int arraydim, bs, ctcnt, elemid, ilflag;
DPRINT(2,"UpdateStatus: \n");
setStatDataTime();
/* Avoid program failures if for some bizarre reason expInfo is NULL. */
if (expInfo == NULL) {
arraydim = 1;
bs = 1;
ilflag = 0;
}
else {
arraydim = expInfo->ArrayDim;
bs = expInfo->NumInBS;
ilflag = expInfo->IlFlag;
}
/* Only update the element ID if it might have changed */
if (pFidstatblk->doneCode == EXP_FID_CMPLT ||
(pFidstatblk->doneCode == BS_CMPLT && ilflag)) {
elemid = pFidstatblk->elemId + 1;
if (elemid > arraydim) {
if (pFidstatblk->doneCode == BS_CMPLT)
elemid = 1;
else
elemid = 0; /* the experiment is over */
}
/* Follow the logic. The done code is either EXP_FID_CMPLT or BS_CMPLT, and
if it is BS_CMPLT then interleaving is in effect. In each case the current
element has completed (temporarily for BS_CMPLT of course) and the console
has moved on to the next element. Therefore the status display also needs
to move on to the next element. If the new element ID is larger than the
number of elements and the done code is EXP_FID_CMPLT, then the experiment
has completed.
In no other case does the element ID change. */
setStatElem(elemid);
if (pFidstatblk->doneCode == BS_CMPLT) {
if (elemid > 1)
ctcnt = pFidstatblk->ct - bs;
else
ctcnt = pFidstatblk->ct; /* a new interleave cycle has started */
/* the ct count for the new cycle starts */
} /* at the value where the old one ends */
else if (ilflag && elemid > 0)
ctcnt = pFidstatblk->ct - bs; /* the final interleave cycle is completing */
else
ctcnt = 0; /* ct count is always 0 when the experiment completes, */
} /* interleaved or not */
else
ctcnt = pFidstatblk->ct;
setStatCT(ctcnt);
}
/**************************************************************
*
* Process - decides if Data Process is required
*
* This routine decides if Data Process is required.
* Then sends Procproc a message to perform the
* the appropriate processing.
*
* RETURNS:
* 0 , else -1
*
* Author Greg Brissey 8/12/94
*/
#define ERROR 0xffffffff
int Process(FID_STAT_BLOCK *pFidstatblk)
{
int stat,qstat;
/*
check for Wbs, Wnt, Wexp, Werr
*/
if (pFidstatblk->doneCode == ERROR)
{
if ( expInfo->ProcMask & WHEN_ERR_PROC )
{
DPRINT(1,"Werr Processing\n");
/* msgQ full, wait because we guarantee this processing to be done */
procQadd(WERR, ShrExpInfo->MemPath, pFidstatblk->elemId, pFidstatblk->ct,
pFidstatblk->doneCode, pFidstatblk->errorCode);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),MSGQ_NORMAL,NO_WAIT)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Error Process not done for FID %lu, CT: %lu\n",
pFidstatblk->elemId,pFidstatblk->ct);
return(-1);
}
}
return(0);
}
/* Wexp test */
if ( (pFidstatblk->elemId == expInfo->ArrayDim) &&
(pFidstatblk->doneCode == EXP_FID_CMPLT) )
/* (pFidstatblk->ct == expInfo->NumTrans) ) */
{
int count = 0;
/* Set this now, since go may check to see is acquisition is active */
setStatExpName("");
setStatGoFlag(-1); /* No Go,Su,etc acquiring */
/* wait for final statblock since processing will read
* shim and lock parameters from it.
*/
while ((count < 10) && (getStatAcqState() != ACQ_IDLE))
{
count++;
sleepMilliSeconds(100);
}
/* msgQ full, wait because we guarantee this processing to be done */
if (expInfo->ProcWait > 0) /* au(wait) or just au */
{
DPRINT2(1,"wExp(wait): Queue FID: %ld, CT: %ld\n",
pFidstatblk->elemId, pFidstatblk->ct);
procQadd(WEXP_WAIT, ShrExpInfo->MemPath, pFidstatblk->elemId,
pFidstatblk->ct, EXP_COMPLETE, pFidstatblk->errorCode);
}
else
{
DPRINT2(1,"wExp: Queue FID: %ld, CT: %ld\n",
pFidstatblk->elemId, pFidstatblk->ct);
procQadd(WEXP, ShrExpInfo->MemPath, pFidstatblk->elemId,
pFidstatblk->ct, EXP_COMPLETE, pFidstatblk->errorCode);
}
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),MSGQ_NORMAL,NO_WAIT)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Wexp Process not done for FID %lu, CT: %lu\n",
pFidstatblk->elemId,pFidstatblk->ct);
return(-1);
}
return(0);
}
/* Wnt test */
/* if ( (pFidstatblk->ct == expInfo->NumTrans) ) */
if ( (pFidstatblk->doneCode == EXP_FID_CMPLT) )
{
DPRINT(1,"Wnt Processing\n");
/* msgQ full, just come back, we can skip Wnt processing */
qstat = procQadd(WFID, ShrExpInfo->MemPath, pFidstatblk->elemId, pFidstatblk->ct,
pFidstatblk->doneCode, pFidstatblk->errorCode);
if (qstat != SKIPPED)
{
DPRINT2(1,"wNT: Queue FID: %ld, CT: %ld\n",
pFidstatblk->elemId, pFidstatblk->ct);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),MSGQ_NORMAL,NO_WAIT)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Wnt Process not done for FID %lu, CT: %lu\n",
pFidstatblk->elemId,pFidstatblk->ct);
return(-1);
}
}
return(0);
}
/* Wbs test */
if (expInfo->NumInBS != 0)
{
if ( (pFidstatblk->doneCode == BS_CMPLT) )
{
DPRINT(1,"Wbs Processing\n");
/* msgQ full, just come back, we can skip Wbs processing */
qstat = procQadd(WBS, ShrExpInfo->MemPath, pFidstatblk->elemId, pFidstatblk->ct,
pFidstatblk->doneCode, pFidstatblk->ct / expInfo->NumInBS);
if (qstat != SKIPPED)
{
DPRINT2(1,"wBS: Queue FID: %ld, CT: %ld\n",
pFidstatblk->elemId, pFidstatblk->ct);
if ((stat = sendMsgQ(pProcMsgQ,"chkQ",strlen("chkQ"),MSGQ_NORMAL,NO_WAIT)) != 0)
{
errLogRet(ErrLogOp,debugInfo,
"Process: Procproc is not running. Wbs Process not done for FID %lu, CT: %lu\n",
pFidstatblk->elemId,pFidstatblk->ct);
return(-1);
}
}
return(0);
}
}
return(0);
}
/*--------------------------------------------------------------------
| getUserUid()
| get the user's uid & gid outof the passwd file
+-------------------------------------------------------------------*/
int getUserUid(char *user, int *uid, int *gid)
{
struct passwd *pswdptr;
if ( (pswdptr = getpwnam(user)) == ((struct passwd *) NULL) )
{
*uid = *gid = -1;
DPRINT1(1,"getUserUid: user: '%s' not found\n", user);
return(-1);
}
*uid = pswdptr->pw_uid;
*gid = pswdptr->pw_gid;
DPRINT3(1,"getUserUid: user: '%s', uid = %d, gid = %d\n", user,*uid,*gid);
return(0);
}
/*##################################################################*/
/* These programs deal with Interactive data. The goal is to
ultimately put them in a separate file. */
static char interactInfoFile[512] = { '\0' };
int startInteract()
{
char *pInfoFile;
int uid,gid;
if ( ! consoleConn() ) {
errLogRet(ErrLogOp,debugInfo,
"start interact: Channel not connected to console yet, start request ignored.");
return(-1);
}
pExpMsgQ = openMsgQ("Expproc"); /* pExpMsgQ is a static defined at the top */
if (pExpMsgQ == NULL) {
errLogRet(ErrLogOp,debugInfo,
"start interact: Channel not connected to console yet, start request ignored.");
return(-1);
}
pInfoFile = strtok(NULL," ");
strcpy(interactInfoFile,pInfoFile);
DPRINT1( 1, "start interactive called in recvproc with info file %s\n", interactInfoFile );
if (mapIn( interactInfoFile ) == -1) {
errLogRet(ErrLogOp,debugInfo,
"start interact: Exp Info Not Present, start request Ignored.");
return(-1);
}
/*DPRINT3(1,
"Expecting: NP: %ld, Data File Size: %ld, put into file %s\n",
expInfo->NumDataPts,expInfo->DataSize, expInfo->DataFile);*/
ifile = mOpen(expInfo->DataFile,expInfo->DataSize,O_RDWR | O_CREAT );
if (ifile == NULL) {
errLogSysRet(ErrLogOp,debugInfo,
"start interact: could not open %s",expInfo->DataFile);
resetState();
return(-1);
}
DPRINT1(1,"offset into mmap file is 0x%x\n", ifile->offsetAddr );
/* get the UID & GID of exp. owner */
if ( getUserUid(expInfo->UserName,&uid,&gid) == 0)
{
int old_euid = geteuid();
seteuid( getuid() );
chown(expInfo->DataFile, uid, gid);
seteuid( old_euid );
}
else
{
errLogRet(ErrLogOp,debugInfo,
"startInteract: Unable to change '%s' uid for User: '%s'\n",
expInfo->DataFile,expInfo->UserName);
}
DPRINT( 1, "calling recvInteract\n" );
recvInteract();
DPRINT( 1, "start interactive completes in recvproc\n" );
stopInteract();
}
int stopInteract()
{
DPRINT( 1, "stop interactive starts in recvproc\n" );
if ( ! consoleConn() ) {
errLogRet(ErrLogOp,debugInfo,
"stop interact: Channel not connected to console yet, stop request Ignored.");
return(-1);
}
if (mapOut( interactInfoFile ) == -1) {
errLogRet(ErrLogOp,debugInfo,
"stop interact: Exp Info Not Present, stop request Ignored.");
return(-1);
}
mClose(ifile);
ifile = NULL;
rmAcqiFiles( expInfo );
unlink( interactInfoFile );
closeMsgQ(pExpMsgQ);
pExpMsgQ = NULL;
DPRINT( 1, "stop interactive completes in recvproc\n" );
}
/**********************************************************
* rmAcqiFiles - removes ACQI files
*
*/
void rmAcqiFiles( SHR_EXP_INFO ExpInfo )
{
if (ExpInfo == NULL)
return;
if ((int) strlen( ExpInfo->DataFile ) > 1)
unlink( ExpInfo->DataFile );
}
int recvInteract()
{
char *dataPtr;
unsigned long xfrSize,bytes2xfr,size2alloc;
unsigned long ptsRecv;
int64_t lastFid;
int bytesPerPt,done,bytes,sync;
FID_STAT_BLOCK fidstatblk;
char acqMsg[ACQ_UPLINK_XFR_MSG_SIZE+5];
int enddata_flag;
/* These identifiers were added to insure transfer into the memory shared with
ACQI is done one long-word at a time. The socket driver (see readChannel ->
readSocket) appears to do this transfer one short word at a time. If a data
point is changing its sign and ACQI gets one short word before and one short
word afterwards, the resulting long word will have a value around +/- 65536
(2**16) and introduce a Spike into the displayed spectrum. March 1996. */
char *dataRecvBuf;
int *isrca, *idsta, iter;
/* sit in this while loop for the entire Experiment */
done = enddata_flag = 0;
lastFid = -1;
ptsRecv = 0;
bytesPerPt = 0;
/* See comment dated March 1996, above (dataRecvBuf, size2alloc was added January 1997) */
size2alloc = expInfo->NumDataPts * expInfo->DataPtSize * expInfo->NumFids;
dataRecvBuf = (char *) malloc( size2alloc );
/* The value for NumFids should always be valid, even if nf
is not defined. Look at initacqparms.c, SCCS category PSG. */
DPRINT1( 1, "in recvInteract, allocated %d chars\n", size2alloc );
DPRINT1( 1, "in recvInteract: number of FIDS: %d\n", expInfo->NumFids );
if (dataRecvBuf == NULL) {
errLogSysRet(ErrLogOp,debugInfo,"recvInteract: cannot get space to receive data\n" );
return(-1);
}
bytes = flushChannel( chanId );
DPRINT1(1,"recvInteract: flush %d bytes from channel\n",bytes);
while( !done )
{
/* keep reading channel till uplink msg is obtain then proceed */
/* This action is an attempt to resync channels incase there are */
/* problems on the channel, garbled, wrong # bytes, etc. */
sync = 0;
while( !sync )
{
DPRINT(1,"recvInteract: Waiting for Acq ACQ_UPLINK_INTERA_MSG Msg\n");
blockAllEvents();
bytes = readChannel(chanId,acqMsg,ACQ_UPLINK_XFR_MSG_SIZE);
unblockAllEvents();
acqMsg[ACQ_UPLINK_XFR_MSG_SIZE] = '\0';
DPRINT1(1,"recvInteract: Acq UPLINK Msg: '%s'\n",acqMsg);
if (strncmp(acqMsg,ACQ_UPLINK_INTERA_MSG,sizeof(ACQ_UPLINK_INTERA_MSG)) == 0)
{
sync = 1;
}
else
{
/* test if for some reason we are to stop data transfer */
if (
strncmp(acqMsg,ACQ_UPLINK_ENDDATA_MSG,strlen(ACQ_UPLINK_ENDDATA_MSG))
== 0)
{
enddata_flag = 1;
sync = 1;
}
else if (
strncmp( acqMsg, ACQ_UPLINK_NODATA_MSG,strlen(ACQ_UPLINK_NODATA_MSG) )
== 0)
{
sync = 0;
}
}
}
blockAllEvents();
bytes = readChannel(chanId,(char*)&fidstatblk,sizeof(fidstatblk));
unblockAllEvents();
if (bytes < sizeof(fidstatblk))
{
/* don't know how to recover, so terminate process */
errLogSysRet(ErrLogOp,debugInfo,"recvInteract: Failed to get fidstatblk\n");
free( dataRecvBuf );
return(-1);
}
#ifdef LINUX
FSB_CONVERT( fidstatblk );
#endif
DPRINT5(1,"Fid StatBlk: Fid: %ld, DataSize: %ld, CT: %ld, NP: %ld,\n State: %d\n",
fidstatblk.elemId, fidstatblk.dataSize, fidstatblk.ct,
fidstatblk.np, fidstatblk.doneCode);
if (fidstatblk.elemId != lastFid)
{
lastFid = fidstatblk.elemId;
ptsRecv = 0;
if (fidstatblk.np > 0)
bytesPerPt = fidstatblk.dataSize / fidstatblk.np;
}
dataPtr = ifile->offsetAddr + sizeof(TIMESTAMP);
memcpy((void*) dataPtr, (void*) &fidstatblk,sizeof(fidstatblk));
/*********************************************************************
* If data transfer stopped permaturely use fidstatblk to find out why
* then do the right thing.
*
* Special Notes:
* The time stamp is updated only after the interactive data has
* been received. If for some reason the program returns prematurely
* you probably will want to update the time stamp before returning.
* See the EXP_ABORTED case, below.
*
* Except for EXP_ABORTED, processing continues, even if an error
* has occurred. recvInteract relies on the data size being 0 to
* avoid a serious jam.
*/
if (enddata_flag)
{
switch(fidstatblk.doneCode)
{
case STOP_CMPLT: /* result of SA, no process */
DPRINT(1,"recvInteract: STOP_CMPLT\n");
/* return(EXP_STOPPED); */
break;
case EXP_HALTED: /* result of Halt, do Wexp processing */
DPRINT(1,"recvInteract: EXP_HALTED\n");
/* return(EXP_HALTED); */
break;
case EXP_ABORTED:
DPRINT(1,"recvInteract: EXP_ABORTED\n");
gettimeofday((struct timeval *) ifile->offsetAddr, NULL );
free( dataRecvBuf );
return(EXP_ABORTED); /* result of ABORT Experiment */
break;
case HARD_ERROR:
DPRINT(1,"recvInteract: HARD_ERROR\n");
/* return(EXP_HALTED); /* result of HARD_ERROR. RPNZ */
break;
default:
/* return(EXP_STOPPED); */
break;
}
}
/* set to fid data position */;
/* We no longer let the socket driver (readChannel -> readSocket) transfer
directly into the shared memory. See comment dated March 1996, above */
/*dataPtr = ifile->offsetAddr + sizeof(TIMESTAMP) + sizeof( fidstatblk );
dataPtr += ptsRecv * bytesPerPt;*/
dataPtr = dataRecvBuf; /* put the data here, initially */
bytes2xfr = fidstatblk.dataSize;
DPRINT(2,"Data Xfr:\n");
while( bytes2xfr ) /* bytes2xfr is 0 if an error occurred */
{
if (bytes2xfr < XFR_SIZE)
xfrSize = bytes2xfr;
else
xfrSize = XFR_SIZE;
blockAllEvents();
bytes = readChannel(chanId,dataPtr,xfrSize);
unblockAllEvents();
if (bytes < xfrSize)
{
/* don't know how to recover, so terminate process */
/*mClose(ifile);*/
errLogRet(ErrLogOp,debugInfo,"uploadData: Failed to get xfrSize.\n");
free( dataRecvBuf );
return( -1 );
}
dataPtr += xfrSize;
bytes2xfr -= xfrSize;
}
/* Now transfer the new console data into the memory shared with ACQI.
Be aware the value of dataRecvBuf never changes. We used dataPtr
to move through the receive buffer, above, and now use it to access
the shared memory.
PSG sets dp to "y", so np is always a count in long-words. */
if ((fidstatblk.np > 0) &&
((ptsRecv + fidstatblk.np) <= expInfo->NumDataPts))
{
dataPtr = ifile->offsetAddr + sizeof(TIMESTAMP) + sizeof( fidstatblk );
dataPtr += ptsRecv * bytesPerPt;
isrca = (int *) dataRecvBuf;
idsta = (int *) dataPtr;
for (iter = 0; iter < fidstatblk.np; iter++)
{
*idsta++ = ntohl( *isrca );
isrca++;
}
}
ptsRecv += fidstatblk.np;
if (ptsRecv >= expInfo->NumDataPts)
ptsRecv = 0;
/* Now we are ready to mark this as new data... */
gettimeofday((struct timeval *) ifile->offsetAddr, NULL );
}
/* This never happens ... an interactive experiment never completes ... for now */
free( dataRecvBuf ); /* Prevent memory leak if it ever does happen */
return(EXP_CMPLT);
}
|
OpenVnmrJ/OpenVnmrJ
|
src/recvproc/recvfuncs.c
|
C
|
apache-2.0
| 65,638
|
/**
* MVEL 2.0
* Copyright (C) 2007 The Codehaus
* Mike Brock, Dhanji Prasanna, John Graham, Mark Proctor
*
* 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.mvel2.ast;
import org.mvel2.DataTypes;
import org.mvel2.Operator;
import org.mvel2.ParserContext;
import org.mvel2.integration.VariableResolver;
import org.mvel2.integration.VariableResolverFactory;
import org.mvel2.math.MathProcessor;
/**
* @author Christopher Brock
*/
public class IndexedPreFixDecNode extends ASTNode {
private int register;
public IndexedPreFixDecNode(int register, ParserContext pCtx) {
this.register = register;
this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]);
}
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
VariableResolver vResolver = factory.getIndexedVariableResolver(register);
vResolver.setValue(ctx = MathProcessor.doOperations(vResolver.getValue(), Operator.SUB, DataTypes.INTEGER, 1));
return ctx;
}
public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
return getReducedValueAccelerated(ctx, thisValue, factory);
}
}
|
mikebrock/mvel
|
src/main/java/org/mvel2/ast/IndexedPreFixDecNode.java
|
Java
|
apache-2.0
| 1,710
|
// This file has been autogenerated from a class added in the UI designer.
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MvvmTest.Core._01;
namespace MvvmTest.iOS
{
public partial class InterfaceDrivenController : UIViewController, ILoginView
{
private readonly LoginViewModel _viewModel;
public event EventHandler Login;
public InterfaceDrivenController (IntPtr handle) : base (handle)
{
_viewModel = new LoginViewModel();
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
_viewModel.View = this;
NSNotificationCenter.DefaultCenter.AddObserver(UITextField.TextFieldTextDidChangeNotification, n =>
{
Username = _username.Text;
}, _username);
NSNotificationCenter.DefaultCenter.AddObserver(UITextField.TextFieldTextDidChangeNotification, n =>
{
Password = _password.Text;
}, _password);
_login.TouchUpInside += (sender, e) => Login(sender, e);
}
public string Username
{
get;
set;
}
public string Password
{
get;
set;
}
}
}
|
Hitcents/MVVMTest
|
MVVMText.Core/MvvmTest.iOS/Controllers/InterfaceDrivenController.cs
|
C#
|
apache-2.0
| 1,055
|
package com.github.megatronking.svg.iconlibs;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import com.github.megatronking.svg.support.SVGRenderer;
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* SVG-Generator. It should not be modified by hand.
*/
public class ic_replay_10 extends SVGRenderer {
public ic_replay_10(Context context) {
super(context);
mAlpha = 1.0f;
mWidth = dip2px(24.0f);
mHeight = dip2px(24.0f);
}
@Override
public void render(Canvas canvas, int w, int h, ColorFilter filter) {
final float scaleX = w / 24.0f;
final float scaleY = h / 24.0f;
mPath.reset();
mRenderPath.reset();
mFinalPathMatrix.setValues(new float[]{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f});
mFinalPathMatrix.postScale(scaleX, scaleY);
mPath.moveTo(12.0f, 5.0f);
mPath.lineTo(12.0f, 1.0f);
mPath.lineTo(7.0f, 6.0f);
mPath.rLineTo(5.0f, 5.0f);
mPath.lineTo(12.0f, 7.0f);
mPath.rCubicTo(3.3f, 0.0f, 6.0f, 2.7f, 6.0f, 6.0f);
mPath.rCubicTo(0.0f, 3.3000002f, -2.7f, 6.0f, -6.0f, 6.0f);
mPath.rCubicTo(-3.3000002f, 0.0f, -6.0f, -2.7f, -6.0f, -6.0f);
mPath.lineTo(4.0f, 13.0f);
mPath.rCubicTo(0.0f, 4.4f, 3.6f, 8.0f, 8.0f, 8.0f);
mPath.rCubicTo(4.4f, 0.0f, 8.0f, -3.6f, 8.0f, -8.0f);
mPath.rCubicTo(0.0f, -4.3999996f, -3.6f, -8.0f, -8.0f, -8.0f);
mPath.close();
mPath.moveTo(12.0f, 5.0f);
mPath.rMoveTo(-1.1f, 11.0f);
mPath.lineTo(10.0f, 16.0f);
mPath.rLineTo(0f, -3.3f);
mPath.lineTo(9.0f, 13.0f);
mPath.rLineTo(0f, -0.7f);
mPath.rLineTo(1.8f, -0.6f);
mPath.rLineTo(0.1f, 0f);
mPath.lineTo(10.900001f, 16.0f);
mPath.close();
mPath.moveTo(10.9f, 16.0f);
mPath.rMoveTo(4.3f, -1.8f);
mPath.rCubicTo(0.0f, 0.3f, 0.0f, 0.6f, -0.1f, 0.8f);
mPath.rLineTo(-0.3f, 0.6f);
mPath.rCubicTo(0.0f, 0.0f, -0.3f, 0.3f, -0.5f, 0.3f);
mPath.rCubicTo(-0.19999981f, 0.0f, -0.4f, 0.1f, -0.6f, 0.1f);
mPath.rCubicTo(-0.20000076f, 0.0f, -0.4f, 0.0f, -0.6f, -0.1f);
mPath.rCubicTo(-0.20000076f, -0.10000038f, -0.3f, -0.2f, -0.5f, -0.3f);
mPath.rCubicTo(-0.19999981f, -0.10000038f, -0.2f, -0.3f, -0.3f, -0.6f);
mPath.rCubicTo(-0.10000038f, -0.3000002f, -0.1f, -0.5f, -0.1f, -0.8f);
mPath.rLineTo(0f, -0.7f);
mPath.rCubicTo(0.0f, -0.3f, 0.0f, -0.6f, 0.1f, -0.8f);
mPath.rLineTo(0.3f, -0.6f);
mPath.rCubicTo(0.0f, 0.0f, 0.3f, -0.3f, 0.5f, -0.3f);
mPath.rCubicTo(0.19999981f, 0.0f, 0.4f, -0.1f, 0.6f, -0.1f);
mPath.rCubicTo(0.20000076f, 0.0f, 0.4f, 0.0f, 0.6f, 0.1f);
mPath.rCubicTo(0.2f, 0.1f, 0.3f, 0.2f, 0.5f, 0.3f);
mPath.rCubicTo(0.19999981f, 0.10000038f, 0.2f, 0.3f, 0.3f, 0.6f);
mPath.rCubicTo(0.10000038f, 0.3000002f, 0.1f, 0.5f, 0.1f, 0.8f);
mPath.rLineTo(0f, 0.7f);
mPath.close();
mPath.moveTo(15.2f, 14.2f);
mPath.rMoveTo(-0.9f, -0.8f);
mPath.rLineTo(0f, -0.5f);
mPath.rCubicTo(0.0f, 0.0f, -0.1f, -0.2f, -0.1f, -0.3f);
mPath.rCubicTo(0.0f, -0.10000038f, -0.1f, -0.1f, -0.2f, -0.2f);
mPath.rCubicTo(-0.09999943f, -0.09999943f, -0.2f, -0.1f, -0.3f, -0.1f);
mPath.rCubicTo(-0.10000038f, 0.0f, -0.2f, 0.0f, -0.3f, 0.1f);
mPath.rLineTo(-0.2f, 0.2f);
mPath.rCubicTo(0.0f, 0.0f, -0.1f, 0.2f, -0.1f, 0.3f);
mPath.rLineTo(0f, 2.0f);
mPath.rCubicTo(0.0f, 0.0f, 0.1f, 0.2f, 0.1f, 0.3f);
mPath.rCubicTo(0.0f, 0.10000038f, 0.1f, 0.1f, 0.2f, 0.2f);
mPath.rCubicTo(0.09999943f, 0.09999943f, 0.2f, 0.1f, 0.3f, 0.1f);
mPath.rCubicTo(0.10000038f, 0.0f, 0.2f, 0.0f, 0.3f, -0.1f);
mPath.rLineTo(0.2f, -0.2f);
mPath.rCubicTo(0.0f, 0.0f, 0.1f, -0.2f, 0.1f, -0.3f);
mPath.rLineTo(0f, -1.5f);
mPath.close();
mPath.moveTo(14.3f, 13.4f);
mRenderPath.addPath(mPath, mFinalPathMatrix);
if (mFillPaint == null) {
mFillPaint = new Paint();
mFillPaint.setStyle(Paint.Style.FILL);
mFillPaint.setAntiAlias(true);
}
mFillPaint.setColor(applyAlpha(-16777216, 1.0f));
mFillPaint.setColorFilter(filter);
canvas.drawPath(mRenderPath, mFillPaint);
}
}
|
MegatronKing/SVG-Android
|
svg-iconlibs/av/src/main/java/com/github/megatronking/svg/iconlibs/ic_replay_10.java
|
Java
|
apache-2.0
| 4,560
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style type="text/css">
.ExternalClass {width:100%;}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
line-height: 100%;
}
body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;}
body {margin:0; padding:0;}
table td {border-collapse:collapse;}
p {margin:0; padding:0; margin-bottom:0;}
h1, h2, h3, h4, h5, h6 {
color: black;
line-height: 100%;
}
a, a:link {
color:#0070cc;
text-decoration: none;
}
body, #body_style {
background:#f5f5f5;
color:#000000;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
span.yshortcuts { color:#000; background-color:none; border:none;}
span.yshortcuts:hover,
span.yshortcuts:active,
span.yshortcuts:focus {color:#000; background-color:none; border:none;}
a:visited { color: #3c96e2; text-decoration: none}
a:focus { color: #3c96e2; text-decoration: underline}
a:hover { color: #3c96e2; text-decoration: underline}
@media only screen and (max-device-width: 480px) {
body[yahoo] #container1 {display:block !important}
body[yahoo] p {font-size: 10px}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
body[yahoo] #container1 {display:block !important}
body[yahoo] p {font-size: 12px}
}
@media only screen and (max-width: 640px), only screen and (max-device-width: 640px) {
div[class=hide-menu], td[class=hide-menu] {
height: 0 !important;
max-height: 0 !important;
display: none !important;
visibility: hidden !important;
}
}
@media only screen and (max-width: 600px), only screen and (max-device-width: 600px) {
table[class=full-width], img[class=full-width], td[class=full-width], div[class=full-width] {
width:100% !important;
height:auto !important;
}
td[class=alignCenter] {
text-align: center !important;
}
td[class=leftPadding] {
width: 25px !important;
}
td[class=width-none] {
width: 0 !important;
}
}
@media only screen and (max-width: 480px), only screen and (max-device-width: 480px) {
div[class=w480-full] {
width:100% !important;
height:auto !important;
}
}
@media only screen and (min-device-width: 640px) and (max-device-width: 640px) {
table[class=w640-full] {
width:100% !important;
height:auto !important;
}
}
.preheader {display:none !important; visibility:hidden; opacity:0; color:transparent; height:0; width:0;}
</style>
</head>
<body style="color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; background:#ffffff; " alink="#FF0000" link="#FF0000" bgcolor="#f5f5f5" text="#000000" yahoo="fix">
<!--[if gte mso 10]>
<table align="center" width="640" border="0" cellspacing="0" cellpadding="0">
<tr><td><![endif]-->
<table bgcolor="#f5f5f5" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tbody>
<tr>
<td bgcolor="#f5f5f5" align="center" width="640" style="width: 640px;">
<table bgcolor="#ffffff" class="full-width" width="640" cellspacing="0" cellpadding="0" style="width: 100%; max-width: 640px; min-width: 300px;">
<tbody>
<tr>
<td align="center">
<table align="center" width="94%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style="padding-top: 14px; font-size: 1px; line-height: 1px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#ffffff; text-align: center;">
Ваш уникальный промокод внутри
</td>
</tr>
<tr>
<td style="padding-bottom: 14px; font-size: 12px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a href="http://contact.mvideo.ru/u/gm.php?UID=$uid$&ID=$ident$" target="_blank" style="color: #838383; text-decoration: underline;" title = "Онлайн-версия письма">Письмо не отображается корректно?</a>
</td>
</tr>
<tr>
<td style="padding-bottom: 4px; font-size: 0; line-height: 0;">
<img style="display: block; border:none; width: 100% !important; max-width: 600px !important; height: auto !important; max-height: 15px !important;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/top-shadow-img.gif" alt=""/>
</td>
</tr>
<tr>
<td align="center" style="text-align: center; color: rgb(0, 0, 0); line-height: 28px; padding-bottom: 18px; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">
<a href="http://www.mvideo.ru/?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_logo&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_logo&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank"><img width="110" height="64" title="Перейти на сайт М.Видео" style="border: currentColor; border-image: none; width: 110px; height: 64px; vertical-align: top;" alt="Перейти на сайт М.Видео" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/logo.gif"></a>
</td>
</tr>
<!-- начало блока с главным меню -->
<tr>
<td class="hide-menu" style="padding-bottom: 20px; font-size: 0; text-align: center;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 83px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/telefony#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="82" height="53" title="Телефоны" alt="Телефоны и гаджеты" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img01.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 134px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/noutbuki-planshety-i-kompyutery#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="133" height="53" title="Ноутбуки, планшеты, компьютеры" alt="Ноутбуки, планшеты, компьютеры" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img02.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 93px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/televizory-i-video#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="92" height="53" title="Телевизоры и видео" alt="Телевизоры и видео" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img03.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 74px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/malaya-bytovaya-tehnika#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="73" height="53" title="Малая бытовая техника" alt="Малая бытовая техника" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img04.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 72px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/krupnaya-bytovaya-tehnika#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="71" height="53" title="Крупная бытовая техника" alt="Крупная бытовая техника" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img05.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 66px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/fotoapparaty-i-videotehnika#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="65" height="53" title="Фото и видео" alt="Фото и видео" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img06.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="bottom" align="left" height="55">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 77px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" height="55" style="font-size: 11px; line-height: 14px; font-family: Arial, Helvetica, sans-serif; color:#333333; text-align: center; font-weight:bold; border: 1px solid #c9c9c9; border-collapse: collapse;">
<a style="color: #5a5a5a; text-decoration: none; font-weight:bold;" target="_blank" href="http://www.mvideo.ru/catalog#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_head_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_head_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><img width="76" height="53" title="Другие категории" alt="Другие категории" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/nav-item-img07.gif" style="display: block; border:none;"></a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<!-- конец блока с главным меню -->
<tr>
<td align="center" style="padding-bottom: 20px; font-size: 19px; line-height: 24px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333;">
<a target="_blank" href="http://www.mvideo.ru?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_banner_top&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_banner_top&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="color: #0070cc; text-decoration: underline;">
<img width="600" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/banner-top-nout.gif" style="display: block; border:none; width: 100% !important; max-width: 600px !important; height: auto !important; max-height: 300px !important;" alt="Для вас Подарок! Возвращайтесь" title="Для вас Подарок! Возвращайтесь">
</a>
</td>
</tr>
<tr>
<td align="center" style="text-align: left; padding-bottom: 20px; font-size: 24px; line-height: 30px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#000000; font-weight: bold;">
Здравствуйте!
</td>
</tr>
<tr>
<td align="center" style="text-align: left; padding-bottom: 20px; font-size: 16px; line-height: 20px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333;">
Спасибо, что Вы с нами! Как и положено верным друзьям, мы подготовили для Вас подарок. Получите промокод на 1000 рублей со скидкой до 50% при покупке в «М.Видео». Промокод действует 30 дней с момента его получения.
</td>
</tr>
<tr>
<td bgcolor="#ed1c24" style="color: #FFFFFF; text-align: center; font-family: Verdana, Arial, Helvetica, sans-serif; -webkit-border-radius:4px; -moz-border-radius:4px; border-radius:4px; padding-top: 15px; padding-bottom: 15px; padding-left: 10px; padding-right: 10px; font-weight: bold; font-size: 22px;">
Ваш уникальный промокод: ХХХХХ
</td>
</tr>
<tr>
<td align="center" style="text-align: center; padding-bottom: 20px; padding-top: 20px; font-size: 17px; line-height: 21px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333;">
<a href="http://www.mvideo.ru/promo/promokod-500rub?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_txt_pravila_prim&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_txt_pravila_prim&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #b6b6b6; text-decoration: underline;">Правила применения промокода</a>
</td>
</tr>
<tr>
<td style="text-align: center;">
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_ispolzovat_promo&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_ispolzovat_promo&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="height:50px;v-text-anchor:middle;width:270px;" arcsize="10%" strokecolor="#000000" fillcolor="#fef200" strokeweight="2px">
<w:anchorlock/>
<center style="color:#000000;font-family:Verdand, sans-serif;font-size:18px;font-weight:bold;">Использовать промокод</center>
</v:roundrect>
<![endif]--><a href="http://www.mvideo.ru?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_ispolzovat_promo&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_ispolzovat_promo&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#fef200;border:2px solid #000000;border-radius:5px;color:#000000;display:inline-block;font-family:Verdand, sans-serif;font-size:18px;font-weight:bold;line-height:50px;text-align:center;text-decoration:none;width:270px;-webkit-text-size-adjust:none;mso-hide:all; white-space: nowrap">Использовать промокод</a></div>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 20px; padding-top: 20px; font-size: 25px; line-height: 30px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<strong>Вам также могут понравиться</strong>
</td>
</tr>
<tr>
<td style="font-size: 0; text-align: center;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" width="50%" align="left"> <![endif]-->
<div style="display: inline-block; vertical-align: top; width: 300px;">
<table width="285" align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="100%" height="420" valign="top" align="center" style="vertical-align: top; border-width: 1px; border-style: solid; border-color: #9a9a9a; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px;">
<table width="90%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="240" valign="middle" style="vertical-align: middle; text-align: center;">
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_1#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_img_recmoend_tovar&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_img_recmoend_tovar&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank"><img style="display: inline-block; vertical-align: top; border:none;" src="http://img.mvideo.ru/Pdb/small_pic/480/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_1#b.jpg" width="200" height="200" alt="Изображение товара 1" title="Изображение товара 1"></a>
</td>
</tr>
<tr>
<td height="70" valign="top" style="padding-bottom: 5px; font-size: 14px; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; color:#000000; text-align: left;">
<a style="font-size: 15px; color: #000000; text-decoration: none;" target="_blank" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_1#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_txt_recomend_tvar&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_txt_recomend_tvar&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_NAME_1" dir="ltr" value="Может понравиться товар 1" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; font-size: 14px;"></a>
</td>
</tr>
<tr>
<td style="padding-bottom: 20px; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight: bold;">
<input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_PRICE_1" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight:bold; background: transparent;" dir="ltr" value="Цена товара 1">
</td>
</tr>
<tr>
<td>
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_1#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="height:36px;v-text-anchor:middle;width:115px;" arcsize="12%" strokecolor="#ed1c24" fillcolor="#ed1c24">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Verdana, sans-serif;font-size:16px;">Купить</center>
</v:roundrect>
<![endif]-->
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_1#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#ed1c24;border:1px solid #ed1c24;border-radius:4px;color:#ffffff;display:inline-block;font-family: Verdana, sans-serif;font-size:16px;font-weight:bold;line-height:36px;text-align:center;text-decoration:none;width:115px;-webkit-text-size-adjust:none;mso-hide:all;">Купить</a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="30"></td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]> </td>
<td valign="top" width="50%" align="left"> <![endif]-->
<div style="display: inline-block; vertical-align: top; width: 300px;">
<table width="285" align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="100%" height="420" valign="top" align="center" style="vertical-align: top; border-width: 1px; border-style: solid; border-color: #9a9a9a; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px;">
<table width="90%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="240" valign="middle" style="vertical-align: middle; text-align: center;">
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_2#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_img_recmoend_tovar2&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_img_recmoend_tovar2&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank"><img style="display: inline-block; vertical-align: top; border:none;" src="http://img.mvideo.ru/Pdb/small_pic/480/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_2#b.jpg" width="200" height="200" alt="Изображение товара 1" title="Изображение товара 2"></a>
</td>
</tr>
<tr>
<td height="70" valign="top" style="padding-bottom: 5px; font-size: 14px; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; color:#000000; text-align: left;">
<a style="font-size: 15px; color: #000000; text-decoration: none;" target="_blank" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_2#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_txt_recomend_tvar2&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_txt_recomend_tvar2&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_NAME_2" dir="ltr" value="Может понравиться товар 2" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; font-size: 14px;"></a>
</td>
</tr>
<tr>
<td style="padding-bottom: 20px; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight: bold;">
<input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_PRICE_2" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight:bold; background: transparent;" dir="ltr" value="Цена товара 2">
</td>
</tr>
<tr>
<td>
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_2#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar2&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar2&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="height:36px;v-text-anchor:middle;width:115px;" arcsize="12%" strokecolor="#ed1c24" fillcolor="#ed1c24">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Verdana, sans-serif;font-size:16px;">Купить</center>
</v:roundrect>
<![endif]-->
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_2#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar2&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar2&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#ed1c24;border:1px solid #ed1c24;border-radius:4px;color:#ffffff;display:inline-block;font-family: Verdana, sans-serif;font-size:16px;font-weight:bold;line-height:36px;text-align:center;text-decoration:none;width:115px;-webkit-text-size-adjust:none;mso-hide:all;">Купить</a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="30"></td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]-->
</td>
</tr>
<!--/prdcr_row-->
<!--prdcr_row-->
<tr>
<td style="font-size: 0; text-align: center;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" width="50%" align="left"> <![endif]-->
<div style="display: inline-block; vertical-align: top; width: 300px;">
<table width="285" align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="100%" height="420" valign="top" align="center" style="vertical-align: top; border-width: 1px; border-style: solid; border-color: #9a9a9a; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px;">
<table width="90%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="240" valign="middle" style="vertical-align: middle; text-align: center;">
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_3#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_img_recmoend_tovar3&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_img_recmoend_tovar3&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank"><img style="display: inline-block; vertical-align: top; border:none;" src="http://img.mvideo.ru/Pdb/small_pic/480/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_3#b.jpg" width="200" height="200" alt="Изображение товара 3" title="Изображение товара 3"></a>
</td>
</tr>
<tr>
<td height="70" valign="top" style="padding-bottom: 5px; font-size: 14px; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; color:#000000; text-align: left;">
<a style="font-size: 15px; color: #000000; text-decoration: none;" target="_blank" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_3#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_txt_recomend_tvar3&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_txt_recomend_tvar3&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_NAME_3" dir="ltr" value="Может понравиться товар 3" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; font-size: 14px;"></a>
</td>
</tr>
<tr>
<td style="padding-bottom: 20px; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight: bold;">
<input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_PRICE_3" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight:bold; background: transparent;" dir="ltr" value="Цена товара 3">
</td>
</tr>
<tr>
<td>
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_3#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar3&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar3&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="height:36px;v-text-anchor:middle;width:115px;" arcsize="12%" strokecolor="#ed1c24" fillcolor="#ed1c24">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Verdana, sans-serif;font-size:16px;">Купить</center>
</v:roundrect>
<![endif]-->
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_3#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar3&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar3&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#ed1c24;border:1px solid #ed1c24;border-radius:4px;color:#ffffff;display:inline-block;font-family: Verdana, sans-serif;font-size:16px;font-weight:bold;line-height:36px;text-align:center;text-decoration:none;width:115px;-webkit-text-size-adjust:none;mso-hide:all;">Купить</a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="30"></td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]> </td>
<td valign="top" width="50%" align="left"> <![endif]-->
<div style="display: inline-block; vertical-align: top; width: 300px;">
<table width="285" align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="100%" height="420" valign="top" align="center" style="vertical-align: top; border-width: 1px; border-style: solid; border-color: #9a9a9a; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px;">
<table width="90%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="240" valign="middle" style="vertical-align: middle; text-align: center;">
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_4#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_img_recmoend_tovar4&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_img_recmoend_tovar4&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank"><img style="display: inline-block; vertical-align: top; border:none;" src="http://img.mvideo.ru/Pdb/small_pic/480/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_4#b.jpg" width="200" height="200" alt="Изображение товара 4" title="Изображение товара 4"></a>
</td>
</tr>
<tr>
<td height="70" valign="top" style="padding-bottom: 5px; font-size: 14px; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; color:#000000; text-align: left;">
<a style="font-size: 15px; color: #000000; text-decoration: none;" target="_blank" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_4#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_txt_recomend_tvar4&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_txt_recomend_tvar4&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#"><input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_NAME_4" dir="ltr" value="Может понравиться товар 4" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 21px; font-family: Verdana, Helvetica, sans-serif; font-size: 14px;"></a>
</td>
</tr>
<tr>
<td style="padding-bottom: 20px; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight: bold;">
<input id="%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_PRICE_4" style="border: currentColor; border-image: none; width: 100%; text-align: left; color: #000000; line-height: 25px; font-family: Verdana, Helvetica, sans-serif; font-size: 25px; font-weight:bold; background: transparent;" dir="ltr" value="Цена товара 4">
</td>
</tr>
<tr>
<td>
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_4#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar4&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar4&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="height:36px;v-text-anchor:middle;width:115px;" arcsize="12%" strokecolor="#ed1c24" fillcolor="#ed1c24">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Verdana, sans-serif;font-size:16px;">Купить</center>
</v:roundrect>
<![endif]-->
<a href="http://www.mvideo.ru/products/%SAP_ZMKT_S_PERS_ATTR_LV-ZZMKT_ALTPROD_SKU_4#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_kupit_tovar4&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_kupit_tovar4&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#ed1c24;border:1px solid #ed1c24;border-radius:4px;color:#ffffff;display:inline-block;font-family: Verdana, sans-serif;font-size:16px;font-weight:bold;line-height:36px;text-align:center;text-decoration:none;width:115px;-webkit-text-size-adjust:none;mso-hide:all;">Купить</a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="30"></td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]-->
</td>
</tr>
<!--/prdcr_row-->
<tr>
<td style="text-align: center; padding-bottom: 30px;">
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.mvideo.ru" style="height:50px;v-text-anchor:middle;width:270px;" arcsize="10%" strokecolor="#000000" fillcolor="#fef200" strokeweight="2px">
<w:anchorlock/>
<center style="color:#000000;font-family:Verdand, sans-serif;font-size:18px;font-weight:bold;">Перейти в магазин</center>
</v:roundrect>
<![endif]--><a href="http://www.mvideo.ru?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_btn_site&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_btn_site&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="background-color:#fef200;border:2px solid #000000;border-radius:5px;color:#000000;display:inline-block;font-family:Verdand, sans-serif;font-size:18px;font-weight:bold;line-height:50px;text-align:center;text-decoration:none;width:270px;-webkit-text-size-adjust:none;mso-hide:all; white-space: nowrap">Перейти в магазин</a></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="98%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="font-size: 0; text-align: center; padding-bottom: 30px;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td valign="top" width="120" align="right">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="LED-телевизоры и цифровое ТВ" href="http://www.mvideo.ru/televizory-i-cifrovoe-tv-1?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico01.gif" width="88" height="83" alt="LED-телевизоры и цифровое ТВ">
<br><strong>LED-телевизоры и цифровое ТВ</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Ноутбуки" href="http://www.mvideo.ru/noutbuki-planshety-komputery/noutbuki-118?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico02.gif" width="88" height="83" alt="Ноутбуки">
<br><strong>Ноутбуки</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Планшеты" href="http://www.mvideo.ru/noutbuki-planshety-komputery/planshety-195?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico03.gif" width="88" height="83" alt="Планшеты">
<br><strong>Планшеты</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Apple" href="http://www.mvideo.ru/komputernaya-tehnika-apple-2667?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico04.gif" width="88" height="83" alt="Apple">
<br><strong>Apple</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Смартфоны и сотовые телефоны" href="http://www.mvideo.ru/smartfony-sotovye-telefony-10?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico05.gif" width="88" height="83" alt="Смартфоны и сотовые телефоны">
<br><strong>Смартфоны <br>и сотовые телефоны</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if gte mso 9]>
</td></tr>
</table><![endif]-->
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td valign="top" width="120" align="right">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Электронные книги" href="http://www.mvideo.ru/elektronnye-knigi-i-aksessuary/elektronnye-knigi-73?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico06.gif" width="88" height="83" alt="Электронные книги">
<br><strong>Электронные книги</strong><br><br>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Фото и видео" href="http://www.mvideo.ru/fotoapparaty-i-videotehnika?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico07.gif" width="88" height="83" alt="Фото и видео">
<br><strong>Фото и видео</strong><br><br>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Аудио" href="http://www.mvideo.ru/audiotehnika?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico08.gif" width="88" height="83" alt="Аудио">
<br><strong>Аудио</strong><br><br>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Красота и здоровье" href="http://www.mvideo.ru/krasota-i-zdorove?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico09.gif" width="88" height="83" alt="Красота и здоровье">
<br><strong>Красота и здоровье</strong><br><br>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Малая бытовая техника" href="http://www.mvideo.ru/malaya-bytovaya-tehnika?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico10.gif" width="88" height="83" alt="Техника для кухни">
<br><strong>Малая бытовая техника</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if gte mso 9]>
</td></tr>
</table><![endif]-->
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td valign="top" width="120" align="right">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Крупная бытовая техника" href="http://www.mvideo.ru/krupnaya-bytovaya-tehnika?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico11.gif" width="88" height="83" alt="Бытовая техника">
<br><strong>Крупная бытовая техника</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Автотехника" href="http://www.mvideo.ru/avtomobilnaya-elektronika-i-gps?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico12.gif" width="88" height="83" alt="Автотехника">
<br><strong>Автотехника</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Игры и развлечения" href="http://www.mvideo.ru/igry-i-razvlecheniya?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico13.gif" width="88" height="83" alt="Игры и развлечения">
<br><strong>Игры и развлечения</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Компьютерные программы" href="http://www.mvideo.ru/komputernye-programmy-i-pc-igry-19?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico14.gif" width="88" height="83" alt="Компьютерные программы">
<br><strong>Компьютерные <br>программы</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="120" align="left">
<![endif]-->
<div style="display: inline-block; vertical-align: top; width: 120px;">
<div style="display: inline-block; vertical-align: top; width: 120px;">
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td align="center" style="padding-bottom: 14px; font-size: 10px; line-height: 13px; font-family: Tahoma, Arial, Helvetica, sans-serif; color:#333333; text-align: center;">
<a title="Аксессуары" href="http://www.mvideo.ru/aksessuary-dlya-telefonov-58?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_menu&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_menu&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" target="_blank" style="color: #333333; text-decoration: none;">
<img style="vertical-align:top; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/article-ico15.gif" width="88" height="83" alt="Аксессуары">
<br><strong>Аксессуары</strong>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" bgcolor="#dfdfdf">
<table width="94%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style="padding-bottom: 15px; font-family:Arial,sans-serif;font-size:13px;line-height:20px;font-weight:normal;color:#333333;text-decoration:none">
<br/>
<font color="#333333" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:20px;font-weight:normal;color:#333333;text-decoration:none">Вы можете <a target="_blank" href="http://contact.mvideo.ru/u/un.php?par=$uid$_$cid$_$llid$_$sid$" style="text-decoration:none" title=""><font color="#A3A0A0" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:normal;font-weight:normal;color:#a3a0a0;text-decoration:underline">отписаться</font></a> и не получать информацию об акциях, распродажах и спецпредложениях.</font>
<br>
<font color="#333333" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:20px;font-weight:normal;color:#333333;text-decoration:none">Данное сообщение отправлено автоматически и не требует ответа.</font>
<br>
<font color="#333333" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:20px;font-weight:normal;color:#333333;text-decoration:none">Чтобы регулярно и без проблем получать рассылку от «М.Видео», пожалуйста, добавьте адрес <a target="_blank" href="mailto:m.video@sender.mvideo.ru" style="text-decoration:none" title=""><font color="#A3A0A0" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:normal;font-weight:normal;color:#a3a0a0;text-decoration:underline">m.video@sender.mvideo.ru</font></a> в свою адресную книгу.</font>
<br>
<font color="#333333" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:20px;font-weight:normal;color:#333333;text-decoration:none">Цены и скидки на товары действительны на момент отправки данного письма.</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="1" bgcolor="#aaaaaa" style="font-size: 0; line-height: 0;"></td>
</tr>
<tr>
<td align="center" bgcolor="#dfdfdf">
<table width="94%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style="padding-bottom: 25px; font-family:Arial,sans-serif;font-size:13px;line-height:18px;font-weight:normal;color:#333333;text-decoration:none">
<br/><br/>
<font color="#333333" face="Arial, sans-serif" style="font-family:Arial,sans-serif;font-size:13px;line-height:18px;font-weight:normal;color:#333333;text-decoration:none">ООО «М.видео Менеджмент», ОГРН 1057746840095.
<br/>Юридический адрес: 105066, Россия, Москва, ул. Нижняя Красносельская, дом 40/12, корп. 20.
</font>
</td>
</tr>
<tr>
<td style="padding-bottom: 10px; font-size: 0; text-align: center;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" width="50%" align="left">
<![endif]-->
<div style="display: inline-block; width:50%; min-width: 228px; vertical-align: top;">
<table align="left" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding-bottom: 15px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style=" font-size: 12px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333;">
<img style="display: block; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/footer_logo_mvideo.jpg" width="49" height="49" alt=""/>
</td>
<td width="2" style="font-size:0; line-height: 0;"> </td>
<td style=" font-size: 13px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333;">
<span style="white-space: nowrap;"> Copyright © М.Видео, 2017</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td valign="top" width="50%" align="right">
<![endif]-->
<div style="display: inline-block; width:50%; min-width: 266px; vertical-align: top;">
<table align="right" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding-bottom: 15px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td style="padding-right: 5px; font-size: 12px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333;">
<a target="_blank" href="http://www.mvideo.ru/legalcontent#?reff=Action_mail_email_a_reactivation_zabiraite_promocode100050_a_foot_links&utm_source=Action_mail&utm_medium=email&utm_campaign=a_reactivation_zabiraite_promocode100050&utm_content=a_foot_links&userId=%SAP_ZMKT_S_PERS_ATTR_LV-ZZ_WEBID#" style="color:#a3a0a0;text-decoration:underline; white-space: nowrap;" title="Политика конфиденциальности">Политика конфиденциальности </a>
</td>
<td style=" font-size: 12px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; color:#333333;">
<img style="display: block; border:none;" src="http://static.mvideo.ru/emarsis/trigger_20170310_reactivation/footer_logo_akit.jpg" width="51" height="48" alt=""/>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if gte mso 10]>
</td></tr>
</table><![endif]-->
</body>
</html>
|
wim-agency/wim-agency.github.io
|
mvideo_captain/trigger_20170310_reactivation/trigger_promokod_1000_50prcnt.html
|
HTML
|
apache-2.0
| 69,788
|
### `tf.contrib.graph_editor.make_placeholder_from_tensor(t, scope=None)` {#make_placeholder_from_tensor}
Create a tf.placeholder for the Graph Editor.
Note that the correct graph scope must be set by the calling function.
##### Args:
* <b>`t`</b>: a tf.Tensor whose name will be used to create the placeholder
(see function placeholder_name).
* <b>`scope`</b>: absolute scope within which to create the placeholder. None
means that the scope of t is preserved. "" means the root scope.
##### Returns:
A newly created tf.placeholder.
##### Raises:
* <b>`TypeError`</b>: if t is not None or a tf.Tensor.
|
naturali/tensorflow
|
tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.graph_editor.make_placeholder_from_tensor.md
|
Markdown
|
apache-2.0
| 627
|
@font-face {
font-family: 'iconfont';
src: url('//at.alicdn.com/t/font_1464249904_214311.eot');
/* IE9*/
src: url('//at.alicdn.com/t/font_1464249904_214311.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('//at.alicdn.com/t/font_1464249904_214311.woff') format('woff'), /* chromeã€firefox */ url('//at.alicdn.com/t/font_1464249904_214311.ttf') format('truetype'), /* chromeã€firefoxã€operaã€Safari, Android, iOS 4.2+*/ url('//at.alicdn.com/t/font_1464249904_214311.svg#iconfont') format('svg');
/* iOS 4.1- */
}
.hide {
display: none;
}
body {
font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", sans-serif;
color: #757575;
}
body .clear {
clear: both;
}
body .flagRed {
color: red;
}
body #navTop {
width: 100%;
}
body #navTop #top {
font-size: 12px;
width: 1200px;
margin: 0 auto;
}
body #navTop #top #topleft {
display: inline-block;
float: left;
margin: 4px 0px;
}
body #navTop #top #topright {
float: right;
}
body #navTop #top #topright li {
letter-spacing: 1px;
}
body #navTop #top #topright li {
display: inline-block;
margin: 4px 8px;
}
body #headNav {
background-color: #fff;
width: 100%;
}
body #headNav #header {
width: 1200px;
margin: 0 auto;
padding: 6px 0px 6px;
}
body #headNav #header #logo {
float: left;
margin-top: 5px;
}
body #headNav #header #showList {
display: inline-block;
float: right;
width: 660px;
}
body #headNav #header #showList dl {
margin: 5px 17px;
float: left;
}
body #headNav #header #showList dl dt {
width: 60px;
height: 70px;
}
body #headNav #header #showList dl .rg {
background-image: url('/images/baozhang.png');
background-position: 0px 1px;
}
body #headNav #header #showList dl .zy {
background-image: url('/images/baozhang.png');
background-position: 0px -77px;
}
body #headNav #header #showList dl .qc {
background-image: url('/images/baozhang.png');
background-position: 0px -151px;
}
body #headNav #header #showList #search {
float: left;
margin-right: 40px;
margin-top: 31px;
}
body #headNav #header #showList #search input {
height: 33px;
border: 2px solid #f00582;
width: 240px;
padding-left: 5px;
float: left;
}
body #headNav #header #showList #search button {
display: inline-block;
background-color: #f00582;
color: white;
padding: 8px 30px;
letter-spacing: 2px;
float: right;
border: 0;
line-height: 21px;
cursor: pointer;
}
body #baner {
width: 100%;
background-color: #f00582;
}
body #baner #nav {
width: 1200px;
margin: 0 auto;
position: relative;
}
body #baner #nav a {
color: white;
width: 126px;
padding: 12px 27px;
display: inline-block;
text-align: center;
}
body #baner #nav a.app_download {
position: absolute;
right:0;
padding: 8px;
text-indent: 17px;
}
body #baner #nav a.app_download b {
font: 16px "Arial";
}
body #baner #nav a.app_download i {
position: absolute;
left: 32px;
background:url(../images/cms_mobile.png);
width: 9px;
height: 14px;
top: 11px;
}
body #baner #nav a.app_download .app_wechat {
position: absolute;
top: 49px;
height: 140px;
width: 120px;
padding:14px;
border:#ccc 1px solid;
text-align: center;
z-index: 99999;
text-indent: 0;
background: white;
color: #333;
right: 0;
display:none;
}
#nav a.app_download .app_wechat:before ,#nav a.app_download .app_wechat:after {
position: absolute;
width: 0;
height:0;
content:"";
border-bottom: 10px solid #ccc;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
top: -10px;
left:65px;
display:block;
}
#nav a.app_download .app_wechat:after{
top:-9px;
border-bottom: 10px solid white;
}
body #baner #nav a.app_download .app_wechat span {
display:block;
font:14px/14px "Microsoft Yahei";
}
body #baner #nav a:hover,
body #baner #nav a:focus {
background-color: #bd166f;
}
body #baner #nav a.app_download:hover .app_wechat {
display:block;
}
body #baner #nav a.iconM {
position: relative;
text-align: right;
}
body #baner #nav a.iconM .iconfont {
position: absolute;
font-family: "iconfont";
font-size: 18px;
font-style: normal;
left: 48px;
top: 5px;
}
body #baner #nav a.iconH {
position: relative;
}
body #baner #nav a.iconH .iconfont {
font-family: "iconfont";
font-size: 30px;
font-style: normal;
position: absolute;
top: -6px;
color: yellow;
right: 22px;
}
body #baner #nav .active {
background-color: #bd166f;
}
body #indexBg {
width: 100%;
background-color: #fff;
}
body #indexBg .topMain {
width: 1200px;
margin: 0 auto;
}
body #indexBg .topMain .left {
float: left;
display: inline-block;
width: 180px;
background-color: #fbe9f3;
}
body #indexBg .topMain .left ul {
padding-top: 4px;
}
body #indexBg .topMain .left ul li {
padding: 8px 35px;
position: relative;
}
body #indexBg .topMain .left ul li a {
color: #757575;
margin-left: 39px;
}
body #indexBg .topMain .left ul li .iconfont {
font-family: "iconfont";
font-style: normal;
position: absolute;
top: 8px;
color: hotpink;
left: 50px;
}
body #indexBg .topMain .left ul li:hover {
background-color: #ff6700;
}
body #indexBg .topMain .left ul li:hover a {
color: #fff;
}
body #indexBg .topMain .left ul li:hover .iconfont {
background-color: #fff;
}
body #indexBg .topMain .middle {
float: left;
display: inline-block;
width: 720px;
}
body #indexBg .topMain .middle img {
float: left;
}
body #indexBg .topMain .right {
float: left;
display: inline-block;
width: 300px;
background-color: #2c3e50;
}
body #indexBg .topMain .right img {
float: left;
}
body #indexMain {
width: 1200px;
margin: 0 auto;
min-height: 500px;
background-color: #fff;
padding-top: 10px;
}
body #indexMain .hua {
margin: 10px 0px;
padding: 12px 10px;
background-color: #f8f7c8;
color: #757575;
letter-spacing: 1px;
font-weight: bold;
}
body #indexMain .indexLingQuanNav {
margin-top: 20px;
margin-bottom: 25px;
}
body #indexMain .indexLingQuanNav .indexLeft {
display: inline-block;
float: left;
color: #df75ad;
}
body #indexMain .indexLingQuanNav .indexLeft .a {
font-size: 24px;
color: #675D5D;
letter-spacing: 2px;
}
body #indexMain .indexLingQuanNav .indexLeft .b {
margin-left: 20px;
margin-right: 6px;
}
body #indexMain .indexLingQuanNav .indexLeft .c {
margin-right: 8px;
letter-spacing: 1.9px;
}
body #indexMain .indexLingQuanNav .indexLeft .e {
margin-left: 8px;
letter-spacing: 2px;
}
body #indexMain .indexLingQuanNav .indexRight {
float: right;
display: inline-block;
padding-top: 8px;
font-size: 18px;
letter-spacing: 2px;
margin-right: 14px;
color: #df75ad;
}
body #indexMain .lingQuanJinList .oneQuanRight {
float: right;
}
body #indexMain .lingQuanJinList .oneQuan {
background-color: rgba(232, 191, 191, 0.19);
width: 580px;
display: inline-block;
margin-bottom: 14px;
border: 1px solid #fff;
color: #696666;
}
body #indexMain .lingQuanJinList .oneQuan .imgLeft {
float: left;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight {
width: 282px;
float: right;
display: inline-block;
padding: 10px 14px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight div {
display: inline-block;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexTitle {
font-size: 15px;
letter-spacing: 1px;
color: #696666;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexTwo {
margin: 6px 0px;
color: #df75ad;
font-size: 15px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexTwo .iconfont {
font-family: "iconfont";
font-style: normal;
font-size: 15px;
margin-right: 3px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexTwo em {
font-size: 18px;
margin: 0px 6px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinThree {
margin: 8px 0px;
font-size: 12px;
letter-spacing: 1px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinThree i {
margin: 0px 4px;
color: #df75ad;
letter-spacing: 0px;
font-size: 14px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFour {
background-color: #ea2a60;
margin: 3px 0px;
/* padding: 0px 12px; */
color: white;
font-size: 14px;
width: 100%;
letter-spacing: 1px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFour span {
margin-left: 12px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFour span em {
font-size: 34px;
margin-right: 20px;
font-weight: normal;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFive {
font-size: 14px;
margin: 17px 0px;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFive a {
display: inline-block;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFive .indexBorder {
border: 1px dashed red;
padding: 8px;
border-radius: 4px;
color: red;
display: inline-block;
cursor: pointer;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFive .indexBorder:hover {
background-color: yellow;
}
body #indexMain .lingQuanJinList .oneQuan .indexJinRight .indexJinFive .indexto {
line-height: 18px;
font-size: 18px;
margin: 0px 13px;
text-align: center;
display: inline-block;
}
body #indexMain .lingQuanJinList .oneQuan:hover {
border: 1px solid red;
border-radius: 4px;
}
body #indexMain .indexPinZhi .pzOne {
margin-right: 7px;
display: inline-block;
box-shadow: 2px 5px 5px #888888;
}
body #indexMain .indexPinZhi .pzOne .pzTitle {
padding: 4px 8px;
}
body #indexMain .indexPinZhi .pzOne .pzTitle .pzSpanTime {
display: inline-block;
margin-left: 4px;
color: #f37ea5;
}
body #indexMain .indexPinZhi .pzOne .pzTitle .pzSpanTitle {
display: inline-block;
/* overflow: hidden; */
}
body #indexMain .indexPinZhi .pzOne .pzTwo {
padding: 4px 8px;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .one {
float: left;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .one label {
color: #df1956;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .one i {
font-size: 22px;
color: #df1956;
display: inline-block;
margin-right: 10px;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .one em {
color: white;
background-color: #d85c85;
padding: 4px;
font-size: 12px;
border-radius: 4px;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .two {
float: right;
padding-top: 8px;
margin-right: 16px;
}
body #indexMain .indexPinZhi .pzOne .pzTwo .two i {
color: blueviolet;
margin-left: 6px;
}
body #indexMain .indexPinZhi .pzOne .pzThree {
padding: 4px 8px;
}
body #indexMain .indexPinZhi .pzOne .pzThree .one {
display: inline-block;
padding-top: 9px;
}
body #indexMain .indexPinZhi .pzOne .pzThree .one .iconfont {
font-family: "iconfont";
font-style: normal;
margin-right: 8px;
margin-left: 4px;
}
body #indexMain .indexPinZhi .pzOne .pzThree .one em {
font-weight: normal;
}
body #indexMain .indexPinZhi .pzOne .pzThree .two {
float: right;
}
body #indexMain .indexPinZhi .pzOne .pzThree .two a {
display: inline-block;
margin-right: 8px;
background-color: antiquewhite;
padding: 9px 21px;
color: #757575;
}
body #indexMain .indexPinZhi .pzOne:hover {
box-shadow: 2px 5px 5px #FBE9F3;
}
body #indexMain .indexYouHuiNav {
margin-top: 40px;
margin-bottom: 25px;
color: #757575;
}
body #indexMain .indexYouHuiNav .indexLeft {
float: left;
}
body #indexMain .indexYouHuiNav .indexLeft span {
font-size: 24px;
letter-spacing: 2px;
}
body #indexMain .indexYouHuiNav .indexLeft .tatal {
margin: 0px 6px;
letter-spacing: 0px;
font-size: 17px;
background-color: aquamarine;
padding: 4px 8px;
border-radius: 6px;
}
body #indexMain .indexYouHuiNav .indexRight {
float: right;
margin-right: 22px;
}
body #indexMain .indexZhiBoList .zbOne {
position: relative;
display: inline-block;
margin: 0px 5px;
margin-bottom: 18px;
width: 284px;
/* margin: 0 auto; */
/* padding-top: 12px; */
border: 1px solid #ccc;
}
body #indexMain .indexZhiBoList .zbOne .pzImgTop {
margin: 0 auto;
display: block;
margin-top: 12px;
}
body #indexMain .indexZhiBoList .zbOne .one {
padding-left: 6px;
margin-top: 16px;
margin-bottom: 5px;
}
body #indexMain .indexZhiBoList .zbOne .one .taobaoImg {
background-color: red;
display: inline-block;
float: left;
margin-right: 6px;
background-image: url("/images/logo_ico.png");
background-position: 0px -24px;
width: 17px;
height: 17px;
}
body #indexMain .indexZhiBoList .zbOne .two {
padding-left: 6px;
margin: 8px 0px;
}
body #indexMain .indexZhiBoList .zbOne .two span em {
color: #f199d0;
margin: 0px 6px;
}
body #indexMain .indexZhiBoList .zbOne .three {
padding-left: 6px;
font-size: 16px;
background-color: #de366e;
color: white;
padding-bottom: 10px;
padding-top: 6px;
}
body #indexMain .indexZhiBoList .zbOne .three em {
font-size: 24px;
color: white;
}
body #indexMain .indexZhiBoList .zbOne .three span .rightSpan {
margin-left: 28px;
}
body #indexMain .indexZhiBoList .zbOne .four {
position: absolute;
top: 0px;
background-image: url("/images/today_goods.png");
width: 43px;
height: 43px;
color: white;
}
body #indexMain .indexZhiBoList .zbOne .four span {
display: inline-block;
width: 32px;
margin-left: 8px;
font-size: 12px;
}
body #zhiboModule {
width: 1200px;
margin: 0 auto;
min-height: 500px;
background-color: #fff;
}
body #zhiboModule .dtkSearchForm {
background-color: #00C1B3;
padding: 8px 30px 14px;
margin-top: 12px;
margin-bottom: 18px;
}
body #zhiboModule .dtkSearchForm .left {
float: left;
display: inline-block;
}
body #zhiboModule .dtkSearchForm .left .txtLeft {
font-size: 28px;
letter-spacing: 1px;
margin-top: 12px;
}
body #zhiboModule .dtkSearchForm .left .leftDiv {
letter-spacing: 2px;
margin-top: 12px;
margin-bottom: 20px;
}
body #zhiboModule .dtkSearchForm .right {
float: right;
display: inline-block;
}
body #zhiboModule .dtkSearchForm .right #searchForm .searchDivIput {
margin-top: 22px;
}
body #zhiboModule .dtkSearchForm .right #searchForm .searchDivIput input {
width: 160px;
line-height: 23px;
}
body #zhiboModule .dtkSearchForm .right #searchForm .searchSpanSel select {
width: 66px;
line-height: 23px;
height: 23px;
margin-top: 10px;
}
body #zhiboModule .dtkSearchForm .right #searchForm .searchSpanTj {
margin-top: 10px;
}
body #zhiboModule .dtkSearchForm .right #searchForm .searchSpanTj input {
padding: 3px 33px;
}
body #zhiboModule .keyNav .left {
display: inline-block;
float: left;
}
body #zhiboModule .keyNav .left span {
margin: 0px 8px;
cursor: pointer;
}
body #zhiboModule .keyNav .left span:first-child {
margin-left: 0px;
}
body #zhiboModule .keyNav .right {
float: right;
display: inline-block;
}
body #zhiboModule .chkNav {
margin: 4px 0px;
}
body #zhiboModule .chkNav .left {
display: inline-block;
}
body #zhiboModule .chkNav .left span input {
vertical-align: middle;
}
body #zhiboModule .chkNav .right {
display: inline-block;
}
body #zhiboModule .chkNav .right label {
margin-left: 20px;
}
body #zhiboModule .quanZhiBoList .zbOne {
position: relative;
display: inline-block;
margin: 0px 5px;
margin-bottom: 18px;
width: 284px;
/* margin: 0 auto; */
/* padding-top: 12px; */
border: 1px solid #ccc;
}
body #zhiboModule .quanZhiBoList .zbOne .pzImgTop {
margin: 0 auto;
display: block;
margin-top: 12px;
}
body #zhiboModule .quanZhiBoList .zbOne .one {
padding-left: 6px;
margin-top: 16px;
margin-bottom: 5px;
}
body #zhiboModule .quanZhiBoList .zbOne .one .taobaoImg {
background-color: red;
display: inline-block;
float: left;
margin-right: 6px;
background-image: url("/images/logo_ico.png");
background-position: 0px -24px;
width: 17px;
height: 17px;
}
body #zhiboModule .quanZhiBoList .zbOne .two {
padding-left: 6px;
margin: 8px 0px;
}
body #zhiboModule .quanZhiBoList .zbOne .two span em {
color: #f199d0;
margin: 0px 6px;
}
body #zhiboModule .quanZhiBoList .zbOne .three {
padding-left: 6px;
font-size: 16px;
background-color: #de366e;
color: white;
padding-bottom: 10px;
padding-top: 6px;
}
body #zhiboModule .quanZhiBoList .zbOne .three em {
font-size: 24px;
color: white;
}
body #zhiboModule .quanZhiBoList .zbOne .three span .rightSpan {
margin-left: 28px;
}
body #zhiboModule .quanZhiBoList .zbOne .four {
position: absolute;
top: 0px;
background-image: url("/images/today_goods.png");
width: 43px;
height: 43px;
color: white;
}
body #zhiboModule .quanZhiBoList .zbOne .four span {
display: inline-block;
width: 32px;
margin-left: 8px;
font-size: 12px;
}
body #rqModule {
width: 1200px;
margin: 0 auto;
min-height: 500px;
background-color: #fff;
}
body #rqModule .top {
background-color: #00C1B3;
height: 77px;
width: 100%;
}
body #rqModule .keyNav {
margin-top: 30px;
}
body #rqModule .keyNav .left {
display: inline-block;
float: left;
}
body #rqModule .keyNav .left span {
margin: 0px 8px;
cursor: pointer;
}
body #rqModule .keyNav .left span:first-child {
margin-left: 0px;
}
body #rqModule .keyNav .left span:hover {
color: red;
}
body #rqModule .keyNav .right {
float: right;
display: inline-block;
cursor: pointer;
}
body #rqModule .keyNav .right span:hover {
color: red;
}
body #rqModule .chkNav {
margin: 10px 76px 20px;
}
body #rqModule .chkNav .left {
display: inline-block;
}
body #rqModule .chkNav .left span input {
vertical-align: middle;
}
body #rqModule .chkNav .right {
display: inline-block;
}
body #rqModule .chkNav .right label {
margin-left: 20px;
}
body #rqModule .quanZhiBoList .zbOne {
position: relative;
display: inline-block;
margin: 0px 5px;
margin-bottom: 18px;
width: 284px;
/* margin: 0 auto; */
/* padding-top: 12px; */
border: 1px solid #ccc;
}
body #rqModule .quanZhiBoList .zbOne .pzImgTop {
margin: 0 auto;
display: block;
margin-top: 12px;
}
body #rqModule .quanZhiBoList .zbOne .one {
padding-left: 6px;
margin-top: 16px;
margin-bottom: 5px;
}
body #rqModule .quanZhiBoList .zbOne .one .taobaoImg {
background-color: red;
display: inline-block;
float: left;
margin-right: 6px;
background-image: url("/images/logo_ico.png");
background-position: 0px -24px;
width: 17px;
height: 17px;
}
body #rqModule .quanZhiBoList .zbOne .two {
padding-left: 6px;
margin: 8px 0px;
}
body #rqModule .quanZhiBoList .zbOne .two span em {
color: #f199d0;
margin: 0px 6px;
}
body #rqModule .quanZhiBoList .zbOne .three {
padding-left: 6px;
font-size: 16px;
background-color: #de366e;
color: white;
padding-bottom: 10px;
padding-top: 6px;
}
body #rqModule .quanZhiBoList .zbOne .three em {
font-size: 24px;
color: white;
}
body #rqModule .quanZhiBoList .zbOne .three span .rightSpan {
margin-left: 28px;
}
body #rqModule .quanZhiBoList .zbOne .four {
position: absolute;
top: 0px;
background-image: url("/images/today_goods.png");
width: 43px;
height: 43px;
color: white;
}
body #rqModule .quanZhiBoList .zbOne .four span {
display: inline-block;
width: 32px;
margin-left: 8px;
font-size: 12px;
}
body #rqModule .quanZhiBoList .zbOne .six {
padding: 4px 6px;
}
body #rqModule .quanZhiBoList .zbOne .six i {
font-size: 14px;
color: crimson;
}
body #rqModule .quanZhiBoList .zbOne:hover {
box-shadow: 2px 5px 5px #888888;
}
/* 11-11 */
.mask11{
display:none;
position:fixed;
top:0;
right:0;
bottom:0;
left:0;
background-color:rgba(0,0,0,.5);
z-index:1000000;
}
.mask11 .bg-11-img{
position:absolute;
top:50%;
left:50%;
width:626px;
height:519px;
margin-top:-260px;
margin-left:-313px;
z-index:1000001;
}
.mask11 .close-11-btn{
position:absolute;
top:50%;
left:50%;
display:block;
width:62px;
height:62px;
margin-top:-260px;
margin-left:190px;
background:url('../images/11-close.png');
z-index:1000002;
}
.goods-type {
position:absolute;
right:0;
top: 0;
}
.goods-type i {
width:16px;
height:16px;
margin-left:5px;
float:left;
background: url(../web/images/cms_pc_img.png?v=60) 0 0 no-repeat;
}
.goods-type i.haitao {
background-position-x: -26px;
}
.goods-type i.trans {
background-position-x: -104px;
}
.goods-type i.pinpai {
background-position-x: -130px;
}
.goods-type i.tmall {
background-position-x: -78px;
}
.goods-type i.you {
background-position-x: -52px;
}
.goods-type i.ddq {
background-position-x: -246px;
}
.goods-type i.video {
background-position-x: -272px;
}
.video-goods .video-icon{
width:27px;
height:16px;
margin-right:5px;
float:left;
background: url(../web/images/cms_pc_img.png?v=60) -194px -349px no-repeat;
}
a.img .video_icon {
width: 50px;
height: 50px;
border:2px solid white ;
border-radius: 100%;
position: absolute;
left: 50%;
top: 50%;
margin: -27px;
background:rgba(0,0,0,.5);
}
a.img .video_icon:after {
content: '';
width:0;
height: 0;
position: absolute;
top: 13px;
left: 18px;
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left: 16px solid white;
}
|
taobaoquan/taobaoquan.github.io
|
taobaoquan/dtk.css
|
CSS
|
apache-2.0
| 21,223
|
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>随机标签云</title>
<style type="text/css">
*{
margin:0;
padding:0
}
a{
text-decoration:none
}
#wrap{
width:600px;
margin:auto
}
</style>
<script type="text/javascript">
window.onload=function(){
var obox=document.getElementById("wrap");
var obj=obox.getElementsByTagName("a");
//随机方法
function rand(num){
return parseInt(Math.random()*num+1);
}
//随机颜色值
function randomcolor(){
var str=Math.ceil(Math.random()*16777215).toString(16);
if(str.length<6){
str="0"+str;
}
return str;
}
//循环
for( len=obj.length,i=len;i--;){
obj[i].className="color"+rand(5);
obj[i].style.zIndex=rand(5);
obj[i].style.fontSize=rand(24)+12+"px";
// obj[i].style.background="#"+randomcolor();
obj[i].style.color="#"+randomcolor();
obj[i].onmouseover=function(){
this.style.background="#"+randomcolor();
}
obj[i].onmouseout=function(){
this.style.background="none";
}
}
}
</script>
</head>
<body>
<div id="wrap">
<a href="#">web标准学习</a>
<a href="#">css</a>
<a href="#">javascript</a>
<a href="#">html5</a>
<a href="#">canvas</a>
<a href="#">video</a>
<a href="#">audio</a>
<a href="#">jQuery</a>
<a href="#">jQuerymobile</a>
<a href="#">flash</a>
<a href="#">firefox</a>
<a href="#">chrome</a>
<a href="#">opera</a>
<a href="#">IE9</a>
<a href="#">css3.0</a>
<a href="#">andriod</a>
<a href="#">apple</a>
<a href="#">google</a>
<a href="#">jobs</a>
</div>
</body>
</html>
|
blue8wolf/CodeDemos
|
UI/tag could/标签云示例代码.html
|
HTML
|
apache-2.0
| 1,738
|
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreQuestionDelegate } from '@core/question/providers/delegate';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonQtypeShortAnswerHandler } from './providers/handler';
import { AddonQtypeShortAnswerComponent } from './component/shortanswer';
@NgModule({
declarations: [
AddonQtypeShortAnswerComponent
],
imports: [
IonicModule,
TranslateModule.forChild(),
CoreDirectivesModule
],
providers: [
AddonQtypeShortAnswerHandler
],
exports: [
AddonQtypeShortAnswerComponent
],
entryComponents: [
AddonQtypeShortAnswerComponent
]
})
export class AddonQtypeShortAnswerModule {
constructor(questionDelegate: CoreQuestionDelegate, handler: AddonQtypeShortAnswerHandler) {
questionDelegate.registerHandler(handler);
}
}
|
jleyva/moodlemobile2
|
src/addon/qtype/shortanswer/shortanswer.module.ts
|
TypeScript
|
apache-2.0
| 1,605
|
#
# CloudBoost Storage Analytics Dockerfile
#
# Pull base image nodejs image.
FROM node:5.3
#Maintainer.
MAINTAINER Nawaz Dhandala <nawazdhandala@outlook.com>
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
# Expose ports.
# - 4730: CloudBoost HTTP REST API
EXPOSE 4730
#Run the app
CMD [ "npm", "start" ]
|
CloudBoost/cloudboost
|
storage-analytics-service/Dockerfile
|
Dockerfile
|
apache-2.0
| 430
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EveScalper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EveScalper.Tests
{
[TestClass()]
public class RandomWalkerTests
{
private RandomWalker walker;
[TestInitialize()]
public void TestInitialize()
{
List<int> testList = new List<int>();
testList.Add(3);
testList.Add(5);
testList.Add(9);
this.walker = new RandomWalker(testList);
}
[TestMethod()]
public void testRemainingIds()
{
Assert.AreEqual(3, this.walker.remainingIds());
}
[TestMethod()]
public void pickTestReducesList()
{
this.walker.pick();
Assert.AreEqual(2, this.walker.remainingIds());
}
[TestMethod()]
public void pickTestResetsWhenEmpty()
{
this.walker.pick();
this.walker.pick();
this.walker.pick();
Assert.AreEqual(3, this.walker.remainingIds());
}
[TestMethod()]
public void resetTest()
{
this.walker.pick();
this.walker.reset();
Assert.AreEqual(3, this.walker.remainingIds());
}
}
}
|
brainscrape/EveScalper
|
EveScalperTests/RandomWalkerTests.cs
|
C#
|
apache-2.0
| 1,369
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.